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

13,095 lines 497.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /******/ (() => { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({
3
4 /***/ "./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js":
5 /*!*******************************************************************************!*\
6 !*** ./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js ***!
7 \*******************************************************************************/
8 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9
10 "use strict";
11 __webpack_require__.r(__webpack_exports__);
12 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
14 /* harmony export */ });
15 /* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize/dist/memoize.browser.esm.js");
16
17
18 var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
19
20 var index = (0,_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__["default"])(function (prop) {
21 return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
22 /* o */
23 && prop.charCodeAt(1) === 110
24 /* n */
25 && prop.charCodeAt(2) < 91;
26 }
27 /* Z+1 */
28 );
29
30 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (index);
31
32
33 /***/ }),
34
35 /***/ "./node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize/dist/memoize.browser.esm.js":
36 /*!*******************************************************************************************************!*\
37 !*** ./node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize/dist/memoize.browser.esm.js ***!
38 \*******************************************************************************************************/
39 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
40
41 "use strict";
42 __webpack_require__.r(__webpack_exports__);
43 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
44 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
45 /* harmony export */ });
46 function memoize(fn) {
47 var cache = {};
48 return function (arg) {
49 if (cache[arg] === undefined) cache[arg] = fn(arg);
50 return cache[arg];
51 };
52 }
53
54 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoize);
55
56
57 /***/ }),
58
59 /***/ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js":
60 /*!*******************************************************************!*\
61 !*** ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js ***!
62 \*******************************************************************/
63 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
64
65 "use strict";
66 __webpack_require__.r(__webpack_exports__);
67 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
68 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
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 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoize);
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": () => (__WEBPACK_DEFAULT_EXPORT__)
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 var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
163
164 var isPropValid = /* #__PURE__ */(0,_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__["default"])(function (prop) {
165 return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
166 /* o */
167 && prop.charCodeAt(1) === 110
168 /* n */
169 && prop.charCodeAt(2) < 91;
170 }
171 /* Z+1 */
172 );
173
174 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isPropValid);
175
176
177 /***/ }),
178
179 /***/ "./scripts/constants/defaultFormOptions.ts":
180 /*!*************************************************!*\
181 !*** ./scripts/constants/defaultFormOptions.ts ***!
182 \*************************************************/
183 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
184
185 "use strict";
186 __webpack_require__.r(__webpack_exports__);
187 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
188 /* harmony export */ "DEFAULT_OPTIONS": () => (/* binding */ DEFAULT_OPTIONS),
189 /* harmony export */ "isDefaultForm": () => (/* binding */ isDefaultForm)
190 /* harmony export */ });
191 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
192 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
193
194 var REGISTRATION_FORM = 'REGISTRATION_FORM';
195 var CONTACT_US_FORM = 'CONTACT_US_FORM';
196 var NEWSLETTER_FORM = 'NEWSLETTER_FORM';
197 var SUPPORT_FORM = 'SUPPORT_FORM';
198 var EVENT_FORM = 'EVENT_FORM';
199 var DEFAULT_OPTIONS = {
200 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Templates', 'leadin'),
201 options: [{
202 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Registration Form', 'leadin'),
203 value: REGISTRATION_FORM
204 }, {
205 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Contact us Form', 'leadin'),
206 value: CONTACT_US_FORM
207 }, {
208 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Newsletter sign-up Form', 'leadin'),
209 value: NEWSLETTER_FORM
210 }, {
211 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Support Form', 'leadin'),
212 value: SUPPORT_FORM
213 }, {
214 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Event Registration Form', 'leadin'),
215 value: EVENT_FORM
216 }]
217 };
218 function isDefaultForm(value) {
219 return value === REGISTRATION_FORM || value === CONTACT_US_FORM || value === NEWSLETTER_FORM || value === SUPPORT_FORM || value === EVENT_FORM;
220 }
221
222 /***/ }),
223
224 /***/ "./scripts/constants/leadinConfig.ts":
225 /*!*******************************************!*\
226 !*** ./scripts/constants/leadinConfig.ts ***!
227 \*******************************************/
228 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
229
230 "use strict";
231 __webpack_require__.r(__webpack_exports__);
232 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
233 /* harmony export */ "accountName": () => (/* binding */ accountName),
234 /* harmony export */ "activationTime": () => (/* binding */ activationTime),
235 /* harmony export */ "adminUrl": () => (/* binding */ adminUrl),
236 /* harmony export */ "connectionStatus": () => (/* binding */ connectionStatus),
237 /* harmony export */ "deviceId": () => (/* binding */ deviceId),
238 /* harmony export */ "didDisconnect": () => (/* binding */ didDisconnect),
239 /* harmony export */ "env": () => (/* binding */ env),
240 /* harmony export */ "formsScript": () => (/* binding */ formsScript),
241 /* harmony export */ "formsScriptPayload": () => (/* binding */ formsScriptPayload),
242 /* harmony export */ "hublet": () => (/* binding */ hublet),
243 /* harmony export */ "hubspotBaseUrl": () => (/* binding */ hubspotBaseUrl),
244 /* harmony export */ "hubspotNonce": () => (/* binding */ hubspotNonce),
245 /* harmony export */ "iframeUrl": () => (/* binding */ iframeUrl),
246 /* harmony export */ "impactLink": () => (/* binding */ impactLink),
247 /* harmony export */ "leadinPluginVersion": () => (/* binding */ leadinPluginVersion),
248 /* harmony export */ "leadinQueryParams": () => (/* binding */ leadinQueryParams),
249 /* harmony export */ "locale": () => (/* binding */ locale),
250 /* harmony export */ "loginUrl": () => (/* binding */ loginUrl),
251 /* harmony export */ "meetingsScript": () => (/* binding */ meetingsScript),
252 /* harmony export */ "phpVersion": () => (/* binding */ phpVersion),
253 /* harmony export */ "pluginPath": () => (/* binding */ pluginPath),
254 /* harmony export */ "plugins": () => (/* binding */ plugins),
255 /* harmony export */ "portalDomain": () => (/* binding */ portalDomain),
256 /* harmony export */ "portalEmail": () => (/* binding */ portalEmail),
257 /* harmony export */ "portalId": () => (/* binding */ portalId),
258 /* harmony export */ "redirectNonce": () => (/* binding */ redirectNonce),
259 /* harmony export */ "refreshToken": () => (/* binding */ refreshToken),
260 /* harmony export */ "restNonce": () => (/* binding */ restNonce),
261 /* harmony export */ "restUrl": () => (/* binding */ restUrl),
262 /* harmony export */ "reviewSkippedDate": () => (/* binding */ reviewSkippedDate),
263 /* harmony export */ "theme": () => (/* binding */ theme),
264 /* harmony export */ "trackConsent": () => (/* binding */ trackConsent),
265 /* harmony export */ "wpVersion": () => (/* binding */ wpVersion)
266 /* harmony export */ });
267 var _window$leadinConfig = window.leadinConfig,
268 accountName = _window$leadinConfig.accountName,
269 adminUrl = _window$leadinConfig.adminUrl,
270 activationTime = _window$leadinConfig.activationTime,
271 connectionStatus = _window$leadinConfig.connectionStatus,
272 deviceId = _window$leadinConfig.deviceId,
273 didDisconnect = _window$leadinConfig.didDisconnect,
274 env = _window$leadinConfig.env,
275 formsScript = _window$leadinConfig.formsScript,
276 meetingsScript = _window$leadinConfig.meetingsScript,
277 formsScriptPayload = _window$leadinConfig.formsScriptPayload,
278 hublet = _window$leadinConfig.hublet,
279 hubspotBaseUrl = _window$leadinConfig.hubspotBaseUrl,
280 hubspotNonce = _window$leadinConfig.hubspotNonce,
281 iframeUrl = _window$leadinConfig.iframeUrl,
282 impactLink = _window$leadinConfig.impactLink,
283 leadinPluginVersion = _window$leadinConfig.leadinPluginVersion,
284 leadinQueryParams = _window$leadinConfig.leadinQueryParams,
285 locale = _window$leadinConfig.locale,
286 loginUrl = _window$leadinConfig.loginUrl,
287 phpVersion = _window$leadinConfig.phpVersion,
288 pluginPath = _window$leadinConfig.pluginPath,
289 plugins = _window$leadinConfig.plugins,
290 portalDomain = _window$leadinConfig.portalDomain,
291 portalEmail = _window$leadinConfig.portalEmail,
292 portalId = _window$leadinConfig.portalId,
293 redirectNonce = _window$leadinConfig.redirectNonce,
294 restNonce = _window$leadinConfig.restNonce,
295 restUrl = _window$leadinConfig.restUrl,
296 refreshToken = _window$leadinConfig.refreshToken,
297 reviewSkippedDate = _window$leadinConfig.reviewSkippedDate,
298 theme = _window$leadinConfig.theme,
299 trackConsent = _window$leadinConfig.trackConsent,
300 wpVersion = _window$leadinConfig.wpVersion;
301
302
303 /***/ }),
304
305 /***/ "./scripts/gutenberg/Common/CalendarIcon.tsx":
306 /*!***************************************************!*\
307 !*** ./scripts/gutenberg/Common/CalendarIcon.tsx ***!
308 \***************************************************/
309 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
310
311 "use strict";
312 __webpack_require__.r(__webpack_exports__);
313 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
314 /* harmony export */ "default": () => (/* binding */ CalendarIcon)
315 /* harmony export */ });
316 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
317
318 function CalendarIcon() {
319 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", {
320 width: "18",
321 height: "18",
322 viewBox: "0 0 18 18",
323 fill: "none",
324 xmlns: "http://www.w3.org/2000/svg",
325 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", {
326 clipPath: "url(#clip0_903_1965)",
327 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", {
328 fillRule: "evenodd",
329 clipRule: "evenodd",
330 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",
331 fill: "#FF7A59"
332 })
333 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("defs", {
334 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("clipPath", {
335 id: "clip0_903_1965",
336 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", {
337 width: "18",
338 height: "18",
339 fill: "white"
340 })
341 })
342 })]
343 });
344 }
345
346 /***/ }),
347
348 /***/ "./scripts/gutenberg/Common/SidebarSprocketIcon.tsx":
349 /*!**********************************************************!*\
350 !*** ./scripts/gutenberg/Common/SidebarSprocketIcon.tsx ***!
351 \**********************************************************/
352 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
353
354 "use strict";
355 __webpack_require__.r(__webpack_exports__);
356 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
357 /* harmony export */ "default": () => (/* binding */ SidebarSprocketIcon)
358 /* harmony export */ });
359 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
360
361 function SidebarSprocketIcon() {
362 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", {
363 width: "20px",
364 height: "20px",
365 version: "1.1",
366 viewBox: "0 0 40 42",
367 xmlns: "http://www.w3.org/2000/svg",
368 xmlnsXlink: "http://www.w3.org/1999/xlink",
369 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", {
370 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",
371 id: "Fill-1",
372 fillRule: "evenodd"
373 })
374 });
375 }
376
377 /***/ }),
378
379 /***/ "./scripts/gutenberg/Common/SprocketIcon.tsx":
380 /*!***************************************************!*\
381 !*** ./scripts/gutenberg/Common/SprocketIcon.tsx ***!
382 \***************************************************/
383 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
384
385 "use strict";
386 __webpack_require__.r(__webpack_exports__);
387 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
388 /* harmony export */ "default": () => (/* binding */ SprocketIcon)
389 /* harmony export */ });
390 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
391
392 function SprocketIcon() {
393 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", {
394 width: "40px",
395 height: "42px",
396 viewBox: "0 0 40 42",
397 version: "1.1",
398 xmlns: "http://www.w3.org/2000/svg",
399 xmlnsXlink: "http://www.w3.org/1999/xlink",
400 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("defs", {
401 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polygon", {
402 id: "path-1",
403 points: "0.000123751494 0 39.7808917 0 39.7808917 41.6871084 0.000123751494 41.6871084"
404 })
405 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", {
406 id: "Page-1",
407 stroke: "none",
408 strokeWidth: "1",
409 fill: "none",
410 fillRule: "evenodd",
411 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", {
412 id: "HubSpot-Sprocket---Full-Color",
413 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("mask", {
414 id: "mask-2",
415 fill: "white",
416 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("use", {
417 xlinkHref: "#path-1"
418 })
419 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", {
420 id: "path-1"
421 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", {
422 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",
423 id: "Fill-1",
424 fill: "#F3785B",
425 fillRule: "nonzero",
426 mask: "url(#mask-2)"
427 })]
428 })
429 })]
430 });
431 }
432
433 /***/ }),
434
435 /***/ "./scripts/gutenberg/FormBlock/FormBlockSave.tsx":
436 /*!*******************************************************!*\
437 !*** ./scripts/gutenberg/FormBlock/FormBlockSave.tsx ***!
438 \*******************************************************/
439 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
440
441 "use strict";
442 __webpack_require__.r(__webpack_exports__);
443 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
444 /* harmony export */ "default": () => (/* binding */ FormSaveBlock)
445 /* harmony export */ });
446 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
447 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
448 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
449
450
451 function FormSaveBlock(_ref) {
452 var attributes = _ref.attributes;
453 var portalId = attributes.portalId,
454 formId = attributes.formId;
455
456 if (portalId && formId) {
457 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.RawHTML, {
458 className: "wp-block-leadin-hubspot-form-block",
459 children: "[hubspot portal=\"".concat(portalId, "\" id=\"").concat(formId, "\" type=\"form\"]")
460 });
461 }
462
463 return null;
464 }
465
466 /***/ }),
467
468 /***/ "./scripts/gutenberg/FormBlock/FormGutenbergPreview.tsx":
469 /*!**************************************************************!*\
470 !*** ./scripts/gutenberg/FormBlock/FormGutenbergPreview.tsx ***!
471 \**************************************************************/
472 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
473
474 "use strict";
475 __webpack_require__.r(__webpack_exports__);
476 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
477 /* harmony export */ "default": () => (/* binding */ FormGutenbergPreview)
478 /* harmony export */ });
479 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
480 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
481 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
482 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
483 /* harmony import */ var _UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UIImage */ "./scripts/gutenberg/UIComponents/UIImage.ts");
484
485
486
487
488 function FormGutenbergPreview() {
489 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
490 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__["default"], {
491 alt: "Create a new Hubspot Form",
492 src: "".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.pluginPath, "/public/assets/images/hubspot-form.png")
493 })
494 });
495 }
496
497 /***/ }),
498
499 /***/ "./scripts/gutenberg/FormBlock/registerFormBlock.tsx":
500 /*!***********************************************************!*\
501 !*** ./scripts/gutenberg/FormBlock/registerFormBlock.tsx ***!
502 \***********************************************************/
503 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
504
505 "use strict";
506 __webpack_require__.r(__webpack_exports__);
507 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
508 /* harmony export */ "default": () => (/* binding */ registerFormBlock)
509 /* harmony export */ });
510 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
511 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
512 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
513 /* harmony import */ var _Common_SprocketIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/SprocketIcon */ "./scripts/gutenberg/Common/SprocketIcon.tsx");
514 /* harmony import */ var _FormBlockSave__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FormBlockSave */ "./scripts/gutenberg/FormBlock/FormBlockSave.tsx");
515 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
516 /* harmony import */ var _FormGutenbergPreview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FormGutenbergPreview */ "./scripts/gutenberg/FormBlock/FormGutenbergPreview.tsx");
517 /* harmony import */ var _shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
518 /* harmony import */ var _shared_Form_FormEdit__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/Form/FormEdit */ "./scripts/shared/Form/FormEdit.tsx");
519 /* harmony import */ var _shared_enums_connectionStatus__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../shared/enums/connectionStatus */ "./scripts/shared/enums/connectionStatus.ts");
520 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
521 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__);
522 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
523
524 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
525
526 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
527
528
529
530
531
532
533
534
535
536
537
538 function registerFormBlock() {
539 var editComponent = function editComponent(props) {
540 if (props.attributes.preview) {
541 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormGutenbergPreview__WEBPACK_IMPORTED_MODULE_5__["default"], {});
542 } else if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__.connectionStatus === _shared_enums_connectionStatus__WEBPACK_IMPORTED_MODULE_8__["default"].Connected) {
543 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Form_FormEdit__WEBPACK_IMPORTED_MODULE_7__["default"], _objectSpread(_objectSpread({}, props), {}, {
544 origin: "gutenberg",
545 preview: true
546 }));
547 } else {
548 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_6__["default"], {
549 status: 401
550 });
551 }
552 };
553
554 if (!_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__) {
555 return null;
556 }
557
558 _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType('leadin/hubspot-form-block', {
559 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('HubSpot Form', 'leadin'),
560 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('Select and embed a HubSpot form', 'leadin'),
561 icon: _Common_SprocketIcon__WEBPACK_IMPORTED_MODULE_2__["default"],
562 category: 'leadin-blocks',
563 attributes: {
564 portalId: {
565 type: 'string',
566 "default": ''
567 },
568 formId: {
569 type: 'string'
570 },
571 formName: {
572 type: 'string'
573 },
574 preview: {
575 type: 'boolean',
576 "default": false
577 }
578 },
579 example: {
580 attributes: {
581 preview: true
582 }
583 },
584 edit: editComponent,
585 save: function save(props) {
586 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormBlockSave__WEBPACK_IMPORTED_MODULE_3__["default"], _objectSpread({}, props));
587 }
588 });
589 }
590
591 /***/ }),
592
593 /***/ "./scripts/gutenberg/MeetingsBlock/MeetingGutenbergPreview.tsx":
594 /*!*********************************************************************!*\
595 !*** ./scripts/gutenberg/MeetingsBlock/MeetingGutenbergPreview.tsx ***!
596 \*********************************************************************/
597 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
598
599 "use strict";
600 __webpack_require__.r(__webpack_exports__);
601 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
602 /* harmony export */ "default": () => (/* binding */ MeetingGutenbergPreview)
603 /* harmony export */ });
604 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
605 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
606 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
607 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
608 /* harmony import */ var _UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UIImage */ "./scripts/gutenberg/UIComponents/UIImage.ts");
609
610
611
612
613 function MeetingGutenbergPreview() {
614 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
615 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__["default"], {
616 alt: "Create a new Hubspot Meeting",
617 width: "100%",
618 src: "".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.pluginPath, "/public/assets/images/hubspot-meetings.png")
619 })
620 });
621 }
622
623 /***/ }),
624
625 /***/ "./scripts/gutenberg/MeetingsBlock/MeetingSaveBlock.tsx":
626 /*!**************************************************************!*\
627 !*** ./scripts/gutenberg/MeetingsBlock/MeetingSaveBlock.tsx ***!
628 \**************************************************************/
629 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
630
631 "use strict";
632 __webpack_require__.r(__webpack_exports__);
633 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
634 /* harmony export */ "default": () => (/* binding */ MeetingSaveBlock)
635 /* harmony export */ });
636 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
637 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
638 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
639
640
641 function MeetingSaveBlock(_ref) {
642 var attributes = _ref.attributes;
643 var url = attributes.url;
644
645 if (url) {
646 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.RawHTML, {
647 className: "wp-block-leadin-hubspot-meeting-block",
648 children: "[hubspot url=\"".concat(url, "\" type=\"meeting\"]")
649 });
650 }
651
652 return null;
653 }
654
655 /***/ }),
656
657 /***/ "./scripts/gutenberg/MeetingsBlock/registerMeetingBlock.tsx":
658 /*!******************************************************************!*\
659 !*** ./scripts/gutenberg/MeetingsBlock/registerMeetingBlock.tsx ***!
660 \******************************************************************/
661 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
662
663 "use strict";
664 __webpack_require__.r(__webpack_exports__);
665 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
666 /* harmony export */ "default": () => (/* binding */ registerMeetingBlock)
667 /* harmony export */ });
668 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
669 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
670 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
671 /* harmony import */ var _Common_CalendarIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/CalendarIcon */ "./scripts/gutenberg/Common/CalendarIcon.tsx");
672 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
673 /* harmony import */ var _MeetingGutenbergPreview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MeetingGutenbergPreview */ "./scripts/gutenberg/MeetingsBlock/MeetingGutenbergPreview.tsx");
674 /* harmony import */ var _MeetingSaveBlock__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./MeetingSaveBlock */ "./scripts/gutenberg/MeetingsBlock/MeetingSaveBlock.tsx");
675 /* harmony import */ var _shared_Meeting_MeetingEdit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/Meeting/MeetingEdit */ "./scripts/shared/Meeting/MeetingEdit.tsx");
676 /* harmony import */ var _shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
677 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
678 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__);
679 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
680
681 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
682
683 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
684
685
686
687
688
689
690
691
692
693
694 var ConnectionStatus = {
695 Connected: 'Connected',
696 NotConnected: 'NotConnected'
697 };
698 function registerMeetingBlock() {
699 var editComponent = function editComponent(props) {
700 if (props.attributes.preview) {
701 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingGutenbergPreview__WEBPACK_IMPORTED_MODULE_4__["default"], {});
702 } else if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.connectionStatus === ConnectionStatus.Connected) {
703 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Meeting_MeetingEdit__WEBPACK_IMPORTED_MODULE_6__["default"], _objectSpread(_objectSpread({}, props), {}, {
704 preview: true,
705 origin: "gutenberg"
706 }));
707 } else {
708 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__["default"], {
709 status: 401
710 });
711 }
712 };
713
714 if (!_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__) {
715 return null;
716 }
717
718 _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType('leadin/hubspot-meeting-block', {
719 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)('Hubspot Meetings Scheduler', 'leadin'),
720 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'),
721 icon: _Common_CalendarIcon__WEBPACK_IMPORTED_MODULE_2__["default"],
722 category: 'leadin-blocks',
723 attributes: {
724 url: {
725 type: 'string',
726 "default": ''
727 },
728 preview: {
729 type: 'boolean',
730 "default": false
731 }
732 },
733 example: {
734 attributes: {
735 preview: true
736 }
737 },
738 edit: editComponent,
739 save: function save(props) {
740 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingSaveBlock__WEBPACK_IMPORTED_MODULE_5__["default"], _objectSpread({}, props));
741 }
742 });
743 }
744
745 /***/ }),
746
747 /***/ "./scripts/gutenberg/Sidebar/contentType.tsx":
748 /*!***************************************************!*\
749 !*** ./scripts/gutenberg/Sidebar/contentType.tsx ***!
750 \***************************************************/
751 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
752
753 "use strict";
754 __webpack_require__.r(__webpack_exports__);
755 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
756 /* harmony export */ "registerHubspotSidebar": () => (/* binding */ registerHubspotSidebar)
757 /* harmony export */ });
758 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
759 /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/plugins */ "@wordpress/plugins");
760 /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__);
761 /* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/edit-post */ "@wordpress/edit-post");
762 /* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__);
763 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
764 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
765 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
766 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__);
767 /* harmony import */ var _UIComponents_UISidebarSelectControl__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../UIComponents/UISidebarSelectControl */ "./scripts/gutenberg/UIComponents/UISidebarSelectControl.tsx");
768 /* harmony import */ var _Common_SidebarSprocketIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/SidebarSprocketIcon */ "./scripts/gutenberg/Common/SidebarSprocketIcon.tsx");
769 /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! styled-components */ "./node_modules/styled-components/dist/styled-components.browser.esm.js");
770 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
771 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__);
772 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
773 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
774 /* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts");
775 var _templateObject;
776
777 function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
778
779
780
781
782
783
784
785
786
787
788
789
790
791 function registerHubspotSidebar() {
792 var ContentTypeLabelStyle = styled_components__WEBPACK_IMPORTED_MODULE_11__["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n white-space: normal;\n text-transform: none;\n "])));
793
794 var ContentTypeLabel = (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ContentTypeLabelStyle, {
795 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Select the content type HubSpot Analytics uses to track this page.', 'leadin')
796 });
797
798 var LeadinPluginSidebar = function LeadinPluginSidebar(_ref) {
799 var postType = _ref.postType;
800 return postType ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__.PluginSidebar, {
801 name: "leadin",
802 title: "HubSpot",
803 icon: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Icon, {
804 className: "hs-plugin-sidebar-sprocket",
805 icon: (0,_Common_SidebarSprocketIcon__WEBPACK_IMPORTED_MODULE_6__["default"])()
806 }),
807 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
808 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('HubSpot Analytics', 'leadin'),
809 initialOpen: true,
810 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_8__.BackgroudAppContext.Provider, {
811 value: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_9__.refreshToken && (0,_utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_10__.getOrCreateBackgroundApp)(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_9__.refreshToken),
812 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISidebarSelectControl__WEBPACK_IMPORTED_MODULE_5__["default"], {
813 metaKey: "content-type",
814 className: "select-content-type",
815 label: ContentTypeLabel,
816 options: [{
817 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Detect Automatically', 'leadin'),
818 value: ''
819 }, {
820 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Blog Post', 'leadin'),
821 value: 'blog-post'
822 }, {
823 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Knowledge Article', 'leadin'),
824 value: 'knowledge-article'
825 }, {
826 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Landing Page', 'leadin'),
827 value: 'landing-page'
828 }, {
829 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Listing Page', 'leadin'),
830 value: 'listing-page'
831 }, {
832 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Standard Page', 'leadin'),
833 value: 'standard-page'
834 }]
835 })
836 })
837 })
838 }) : null;
839 };
840
841 var LeadinPluginSidebarWrapper = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.withSelect)(function (select) {
842 var data = select('core/editor');
843 return {
844 postType: data && data.getCurrentPostType() && data.getEditedPostAttribute('meta')
845 };
846 })(LeadinPluginSidebar);
847
848 if (_wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__) {
849 _wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__.registerPlugin('leadin', {
850 render: LeadinPluginSidebarWrapper,
851 icon: _Common_SidebarSprocketIcon__WEBPACK_IMPORTED_MODULE_6__["default"]
852 });
853 }
854 }
855
856 /***/ }),
857
858 /***/ "./scripts/gutenberg/UIComponents/UIImage.ts":
859 /*!***************************************************!*\
860 !*** ./scripts/gutenberg/UIComponents/UIImage.ts ***!
861 \***************************************************/
862 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
863
864 "use strict";
865 __webpack_require__.r(__webpack_exports__);
866 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
867 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
868 /* harmony export */ });
869 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
870
871
872 var _exp = /*#__PURE__*/function _exp() {
873 return function (props) {
874 return props.height ? props.height : 'auto';
875 };
876 };
877
878 var _exp2 = /*#__PURE__*/function _exp2() {
879 return function (props) {
880 return props.width ? props.width : 'auto';
881 };
882 };
883
884 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('img')({
885 name: "UIImage0",
886 "class": "ump7xqy",
887 propsAsIs: false,
888 vars: {
889 "ump7xqy-0": [_exp()],
890 "ump7xqy-1": [_exp2()]
891 }
892 }));
893
894 __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");
895
896 /***/ }),
897
898 /***/ "./scripts/gutenberg/UIComponents/UISidebarSelectControl.tsx":
899 /*!*******************************************************************!*\
900 !*** ./scripts/gutenberg/UIComponents/UISidebarSelectControl.tsx ***!
901 \*******************************************************************/
902 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
903
904 "use strict";
905 __webpack_require__.r(__webpack_exports__);
906 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
907 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
908 /* harmony export */ });
909 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
910 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
911 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
912 /* harmony import */ var _utils_withMetaData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/withMetaData */ "./scripts/utils/withMetaData.ts");
913 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
914 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
915 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
916
917 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
918
919 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
920
921
922
923
924
925
926
927 var UISidebarSelectControl = function UISidebarSelectControl(props) {
928 var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_3__.useBackgroundAppContext)();
929 var monitorSidebarMetaChange = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_3__.usePostBackgroundMessage)();
930 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, _objectSpread({
931 value: props.metaValue,
932 onChange: function onChange(content) {
933 if (props.setMetaValue) {
934 props.setMetaValue(content);
935 }
936
937 isBackgroundAppReady && monitorSidebarMetaChange({
938 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_4__.ProxyMessages.TrackSidebarMetaChange,
939 payload: {
940 metaKey: props.metaKey
941 }
942 });
943 }
944 }, props));
945 };
946
947 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_utils_withMetaData__WEBPACK_IMPORTED_MODULE_2__["default"])(UISidebarSelectControl));
948
949 /***/ }),
950
951 /***/ "./scripts/iframe/integratedMessages/core/CoreMessages.ts":
952 /*!****************************************************************!*\
953 !*** ./scripts/iframe/integratedMessages/core/CoreMessages.ts ***!
954 \****************************************************************/
955 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
956
957 "use strict";
958 __webpack_require__.r(__webpack_exports__);
959 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
960 /* harmony export */ "CoreMessages": () => (/* binding */ CoreMessages)
961 /* harmony export */ });
962 var CoreMessages = {
963 HandshakeReceive: 'INTEGRATED_APP_EMBEDDER_HANDSHAKE_RECEIVED',
964 SendRefreshToken: 'INTEGRATED_APP_EMBEDDER_SEND_REFRESH_TOKEN',
965 ReloadParentFrame: 'INTEGRATED_APP_EMBEDDER_RELOAD_PARENT_FRAME',
966 RedirectParentFrame: 'INTEGRATED_APP_EMBEDDER_REDIRECT_PARENT_FRAME',
967 SendLocale: 'INTEGRATED_APP_EMBEDDER_SEND_LOCALE',
968 SendDeviceId: 'INTEGRATED_APP_EMBEDDER_SEND_DEVICE_ID'
969 };
970
971 /***/ }),
972
973 /***/ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts":
974 /*!******************************************************************!*\
975 !*** ./scripts/iframe/integratedMessages/forms/FormsMessages.ts ***!
976 \******************************************************************/
977 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
978
979 "use strict";
980 __webpack_require__.r(__webpack_exports__);
981 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
982 /* harmony export */ "FormMessages": () => (/* binding */ FormMessages)
983 /* harmony export */ });
984 var FormMessages = {
985 CreateFormAppNavigation: 'CREATE_FORM_APP_NAVIGATION'
986 };
987
988 /***/ }),
989
990 /***/ "./scripts/iframe/integratedMessages/index.ts":
991 /*!****************************************************!*\
992 !*** ./scripts/iframe/integratedMessages/index.ts ***!
993 \****************************************************/
994 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
995
996 "use strict";
997 __webpack_require__.r(__webpack_exports__);
998 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
999 /* harmony export */ "CoreMessages": () => (/* reexport safe */ _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__.CoreMessages),
1000 /* harmony export */ "FormMessages": () => (/* reexport safe */ _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__.FormMessages),
1001 /* harmony export */ "LiveChatMessages": () => (/* reexport safe */ _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__.LiveChatMessages),
1002 /* harmony export */ "PluginMessages": () => (/* reexport safe */ _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__.PluginMessages),
1003 /* harmony export */ "ProxyMessages": () => (/* reexport safe */ _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__.ProxyMessages)
1004 /* harmony export */ });
1005 /* harmony import */ var _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/CoreMessages */ "./scripts/iframe/integratedMessages/core/CoreMessages.ts");
1006 /* harmony import */ var _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./forms/FormsMessages */ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts");
1007 /* harmony import */ var _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./livechat/LiveChatMessages */ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts");
1008 /* harmony import */ var _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./plugin/PluginMessages */ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts");
1009 /* harmony import */ var _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./proxy/ProxyMessages */ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts");
1010
1011
1012
1013
1014
1015
1016 /***/ }),
1017
1018 /***/ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts":
1019 /*!************************************************************************!*\
1020 !*** ./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts ***!
1021 \************************************************************************/
1022 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1023
1024 "use strict";
1025 __webpack_require__.r(__webpack_exports__);
1026 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1027 /* harmony export */ "LiveChatMessages": () => (/* binding */ LiveChatMessages)
1028 /* harmony export */ });
1029 var LiveChatMessages = {
1030 CreateLiveChatAppNavigation: 'CREATE_LIVE_CHAT_APP_NAVIGATION'
1031 };
1032
1033 /***/ }),
1034
1035 /***/ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts":
1036 /*!********************************************************************!*\
1037 !*** ./scripts/iframe/integratedMessages/plugin/PluginMessages.ts ***!
1038 \********************************************************************/
1039 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1040
1041 "use strict";
1042 __webpack_require__.r(__webpack_exports__);
1043 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1044 /* harmony export */ "PluginMessages": () => (/* binding */ PluginMessages)
1045 /* harmony export */ });
1046 var PluginMessages = {
1047 PluginSettingsNavigation: 'PLUGIN_SETTINGS_NAVIGATION',
1048 PluginLeadinConfig: 'PLUGIN_LEADIN_CONFIG',
1049 TrackConsent: 'INTEGRATED_APP_EMBEDDER_TRACK_CONSENT',
1050 InternalTrackingFetchRequest: 'INTEGRATED_TRACKING_FETCH_REQUEST',
1051 InternalTrackingFetchResponse: 'INTEGRATED_TRACKING_FETCH_RESPONSE',
1052 InternalTrackingFetchError: 'INTEGRATED_TRACKING_FETCH_ERROR',
1053 InternalTrackingChangeRequest: 'INTEGRATED_TRACKING_CHANGE_REQUEST',
1054 InternalTrackingChangeError: 'INTEGRATED_TRACKING_CHANGE_ERROR',
1055 BusinessUnitFetchRequest: 'BUSINESS_UNIT_FETCH_REQUEST',
1056 BusinessUnitFetchResponse: 'BUSINESS_UNIT_FETCH_FETCH_RESPONSE',
1057 BusinessUnitFetchError: 'BUSINESS_UNIT_FETCH_FETCH_ERROR',
1058 BusinessUnitChangeRequest: 'BUSINESS_UNIT_CHANGE_REQUEST',
1059 BusinessUnitChangeError: 'BUSINESS_UNIT_CHANGE_ERROR',
1060 SkipReviewRequest: 'SKIP_REVIEW_REQUEST',
1061 SkipReviewResponse: 'SKIP_REVIEW_RESPONSE',
1062 SkipReviewError: 'SKIP_REVIEW_ERROR',
1063 RemoveParentQueryParam: 'REMOVE_PARENT_QUERY_PARAM'
1064 };
1065
1066 /***/ }),
1067
1068 /***/ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts":
1069 /*!******************************************************************!*\
1070 !*** ./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts ***!
1071 \******************************************************************/
1072 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1073
1074 "use strict";
1075 __webpack_require__.r(__webpack_exports__);
1076 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1077 /* harmony export */ "ProxyMessages": () => (/* binding */ ProxyMessages)
1078 /* harmony export */ });
1079 var ProxyMessages = {
1080 FetchForms: 'FETCH_FORMS',
1081 FetchForm: 'FETCH_FORM',
1082 CreateFormFromTemplate: 'CREATE_FORM_FROM_TEMPLATE',
1083 FetchAuth: 'FETCH_AUTH',
1084 FetchMeetingsAndUsers: 'FETCH_MEETINGS_AND_USERS',
1085 FetchContactsCreateSinceActivation: 'FETCH_CONTACTS_CREATED_SINCE_ACTIVATION',
1086 FetchOrCreateMeetingUser: 'FETCH_OR_CREATE_MEETING_USER',
1087 ConnectMeetingsCalendar: 'CONNECT_MEETINGS_CALENDAR',
1088 TrackFormPreviewRender: 'TRACK_FORM_PREVIEW_RENDER',
1089 TrackFormCreatedFromTemplate: 'TRACK_FORM_CREATED_FROM_TEMPLATE',
1090 TrackFormCreationFailed: 'TRACK_FORM_CREATION_FAILED',
1091 TrackMeetingPreviewRender: 'TRACK_MEETING_PREVIEW_RENDER',
1092 TrackSidebarMetaChange: 'TRACK_SIDEBAR_META_CHANGE',
1093 TrackReviewBannerRender: 'TRACK_REVIEW_BANNER_RENDER',
1094 TrackReviewBannerInteraction: 'TRACK_REVIEW_BANNER_INTERACTION',
1095 TrackReviewBannerDismissed: 'TRACK_REVIEW_BANNER_DISMISSED',
1096 TrackPluginDeactivation: 'TRACK_PLUGIN_DEACTIVATION'
1097 };
1098
1099 /***/ }),
1100
1101 /***/ "./scripts/iframe/useBackgroundApp.ts":
1102 /*!********************************************!*\
1103 !*** ./scripts/iframe/useBackgroundApp.ts ***!
1104 \********************************************/
1105 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1106
1107 "use strict";
1108 __webpack_require__.r(__webpack_exports__);
1109 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1110 /* harmony export */ "BackgroudAppContext": () => (/* binding */ BackgroudAppContext),
1111 /* harmony export */ "useBackgroundAppContext": () => (/* binding */ useBackgroundAppContext),
1112 /* harmony export */ "usePostAsyncBackgroundMessage": () => (/* binding */ usePostAsyncBackgroundMessage),
1113 /* harmony export */ "usePostBackgroundMessage": () => (/* binding */ usePostBackgroundMessage)
1114 /* harmony export */ });
1115 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1116 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1117
1118 var BackgroudAppContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
1119 function useBackgroundAppContext() {
1120 return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BackgroudAppContext);
1121 }
1122 function usePostBackgroundMessage() {
1123 var app = useBackgroundAppContext();
1124 return function (message) {
1125 app.postMessage(message);
1126 };
1127 }
1128 function usePostAsyncBackgroundMessage() {
1129 var app = useBackgroundAppContext();
1130 return function (message) {
1131 return app.postAsyncMessage(message);
1132 };
1133 }
1134
1135 /***/ }),
1136
1137 /***/ "./scripts/lib/Raven.ts":
1138 /*!******************************!*\
1139 !*** ./scripts/lib/Raven.ts ***!
1140 \******************************/
1141 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1142
1143 "use strict";
1144 __webpack_require__.r(__webpack_exports__);
1145 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1146 /* harmony export */ "configureRaven": () => (/* binding */ configureRaven),
1147 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1148 /* harmony export */ });
1149 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! raven-js */ "./node_modules/raven-js/src/singleton.js");
1150 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(raven_js__WEBPACK_IMPORTED_MODULE_0__);
1151 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1152
1153
1154 function configureRaven() {
1155 if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.hubspotBaseUrl.indexOf('app.hubspot.com') === -1) {
1156 return;
1157 }
1158
1159 raven_js__WEBPACK_IMPORTED_MODULE_0___default().config('https://e9b8f382cdd130c0d415cd977d2be56f@exceptions.hubspot.com/1', {
1160 instrument: {
1161 tryCatch: false
1162 },
1163 release: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion
1164 }).install();
1165 raven_js__WEBPACK_IMPORTED_MODULE_0___default().setTagsContext({
1166 v: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion,
1167 php: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.phpVersion,
1168 wordpress: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.wpVersion
1169 });
1170 raven_js__WEBPACK_IMPORTED_MODULE_0___default().setExtraContext({
1171 hub: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.portalId,
1172 plugins: Object.keys(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins).map(function (name) {
1173 return "".concat(name, "#").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins[name]);
1174 }).join(',')
1175 });
1176 }
1177 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((raven_js__WEBPACK_IMPORTED_MODULE_0___default()));
1178
1179 /***/ }),
1180
1181 /***/ "./scripts/shared/Common/AsyncSelect.tsx":
1182 /*!***********************************************!*\
1183 !*** ./scripts/shared/Common/AsyncSelect.tsx ***!
1184 \***********************************************/
1185 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1186
1187 "use strict";
1188 __webpack_require__.r(__webpack_exports__);
1189 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1190 /* harmony export */ "default": () => (/* binding */ AsyncSelect)
1191 /* harmony export */ });
1192 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1193 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
1194 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
1195 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
1196 /* harmony import */ var _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/colors */ "./scripts/shared/UIComponents/colors.ts");
1197 /* harmony import */ var _UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpinner */ "./scripts/shared/UIComponents/UISpinner.tsx");
1198 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../enums/loadState */ "./scripts/shared/enums/loadState.ts");
1199 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1200
1201 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."); }
1202
1203 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1204
1205 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1206
1207 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
1208
1209 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1210
1211
1212
1213
1214
1215
1216
1217 var Container = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1218 name: "Container",
1219 "class": "c1wxx7eu",
1220 propsAsIs: false
1221 });
1222
1223 var _exp2 = /*#__PURE__*/function _exp2() {
1224 return function (props) {
1225 return props.focused ? '0' : '1px';
1226 };
1227 };
1228
1229 var _exp3 = /*#__PURE__*/function _exp3() {
1230 return function (props) {
1231 return props.focused ? "0 0 0 2px ".concat(_UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_MEDIUM) : 'none';
1232 };
1233 };
1234
1235 var ControlContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1236 name: "ControlContainer",
1237 "class": "c1rgwbep",
1238 propsAsIs: false,
1239 vars: {
1240 "c1rgwbep-0": [_exp2()],
1241 "c1rgwbep-1": [_exp3()]
1242 }
1243 });
1244 var ValueContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1245 name: "ValueContainer",
1246 "class": "v1mdmbaj",
1247 propsAsIs: false
1248 });
1249 var Placeholder = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1250 name: "Placeholder",
1251 "class": "p1gwkvxy",
1252 propsAsIs: false
1253 });
1254 var SingleValue = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1255 name: "SingleValue",
1256 "class": "s1bwlafs",
1257 propsAsIs: false
1258 });
1259 var IndicatorContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1260 name: "IndicatorContainer",
1261 "class": "i196z9y5",
1262 propsAsIs: false
1263 });
1264 var DropdownIndicator = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1265 name: "DropdownIndicator",
1266 "class": "d1dfo5ow",
1267 propsAsIs: false
1268 });
1269 var InputContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1270 name: "InputContainer",
1271 "class": "if3lze",
1272 propsAsIs: false
1273 });
1274 var Input = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('input')({
1275 name: "Input",
1276 "class": "i9kxf50",
1277 propsAsIs: false
1278 });
1279 var InputShadow = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1280 name: "InputShadow",
1281 "class": "igjr3uc",
1282 propsAsIs: false
1283 });
1284 var MenuContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1285 name: "MenuContainer",
1286 "class": "mhb9if7",
1287 propsAsIs: false
1288 });
1289 var MenuList = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1290 name: "MenuList",
1291 "class": "mxaof7s",
1292 propsAsIs: false
1293 });
1294 var MenuGroup = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1295 name: "MenuGroup",
1296 "class": "mw50s5v",
1297 propsAsIs: false
1298 });
1299 var MenuGroupHeader = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1300 name: "MenuGroupHeader",
1301 "class": "m11rzvjw",
1302 propsAsIs: false
1303 });
1304
1305 var _exp5 = /*#__PURE__*/function _exp5() {
1306 return function (props) {
1307 return props.selected ? _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_MEDIUM : 'transparent';
1308 };
1309 };
1310
1311 var _exp6 = /*#__PURE__*/function _exp6() {
1312 return function (props) {
1313 return props.selected ? '#fff' : 'inherit';
1314 };
1315 };
1316
1317 var _exp7 = /*#__PURE__*/function _exp7() {
1318 return function (props) {
1319 return props.selected ? _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_MEDIUM : _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_LIGHT;
1320 };
1321 };
1322
1323 var MenuItem = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1324 name: "MenuItem",
1325 "class": "m1jcdsjv",
1326 propsAsIs: false,
1327 vars: {
1328 "m1jcdsjv-0": [_exp5()],
1329 "m1jcdsjv-1": [_exp6()],
1330 "m1jcdsjv-2": [_exp7()]
1331 }
1332 });
1333 function AsyncSelect(_ref) {
1334 var placeholder = _ref.placeholder,
1335 value = _ref.value,
1336 loadOptions = _ref.loadOptions,
1337 onChange = _ref.onChange,
1338 defaultOptions = _ref.defaultOptions;
1339 var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
1340 var inputShadowEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
1341
1342 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
1343 _useState2 = _slicedToArray(_useState, 2),
1344 isFocused = _useState2[0],
1345 setFocus = _useState2[1];
1346
1347 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].NotLoaded),
1348 _useState4 = _slicedToArray(_useState3, 2),
1349 loadState = _useState4[0],
1350 setLoadState = _useState4[1];
1351
1352 var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''),
1353 _useState6 = _slicedToArray(_useState5, 2),
1354 localValue = _useState6[0],
1355 setLocalValue = _useState6[1];
1356
1357 var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(defaultOptions),
1358 _useState8 = _slicedToArray(_useState7, 2),
1359 options = _useState8[0],
1360 setOptions = _useState8[1];
1361
1362 var inputSize = "".concat(inputShadowEl.current ? inputShadowEl.current.clientWidth + 10 : 2, "px");
1363 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
1364 if (loadOptions && loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].NotLoaded) {
1365 loadOptions('', function (result) {
1366 setOptions(result);
1367 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Idle);
1368 });
1369 }
1370 }, [loadOptions, loadState]);
1371
1372 var renderItems = function renderItems() {
1373 var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1374 var parentKey = arguments.length > 1 ? arguments[1] : undefined;
1375 return items.map(function (item, index) {
1376 if (item.options) {
1377 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(MenuGroup, {
1378 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuGroupHeader, {
1379 id: "".concat(index, "-heading"),
1380 children: item.label
1381 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
1382 children: renderItems(item.options, index)
1383 })]
1384 }, "async-select-item-".concat(index));
1385 } else {
1386 var key = "async-select-item-".concat(parentKey !== undefined ? "".concat(parentKey, "-").concat(index) : index);
1387 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuItem, {
1388 id: key,
1389 selected: value && item.value === value.value,
1390 onClick: function onClick() {
1391 onChange(item);
1392 setFocus(false);
1393 },
1394 children: item.label
1395 }, key);
1396 }
1397 });
1398 };
1399
1400 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Container, {
1401 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ControlContainer, {
1402 id: "leadin-async-selector",
1403 focused: isFocused,
1404 onClick: function onClick() {
1405 if (isFocused) {
1406 if (inputEl.current) {
1407 inputEl.current.blur();
1408 }
1409
1410 setFocus(false);
1411 setLocalValue('');
1412 } else {
1413 if (inputEl.current) {
1414 inputEl.current.focus();
1415 }
1416
1417 setFocus(true);
1418 }
1419 },
1420 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ValueContainer, {
1421 children: [localValue === '' && (!value ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Placeholder, {
1422 children: placeholder
1423 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SingleValue, {
1424 children: value.label
1425 })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(InputContainer, {
1426 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Input, {
1427 ref: inputEl,
1428 onFocus: function onFocus() {
1429 setFocus(true);
1430 },
1431 onChange: function onChange(e) {
1432 setLocalValue(e.target.value);
1433 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Loading);
1434 loadOptions && loadOptions(e.target.value, function (result) {
1435 setOptions(result);
1436 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Idle);
1437 });
1438 },
1439 value: localValue,
1440 width: inputSize,
1441 id: "asycn-select-input"
1442 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputShadow, {
1443 ref: inputShadowEl,
1444 children: localValue
1445 })]
1446 })]
1447 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(IndicatorContainer, {
1448 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, {})]
1449 })]
1450 }), isFocused && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuContainer, {
1451 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuList, {
1452 children: renderItems(options)
1453 })
1454 })]
1455 });
1456 }
1457
1458 __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");
1459
1460 /***/ }),
1461
1462 /***/ "./scripts/shared/Common/ErrorHandler.tsx":
1463 /*!************************************************!*\
1464 !*** ./scripts/shared/Common/ErrorHandler.tsx ***!
1465 \************************************************/
1466 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1467
1468 "use strict";
1469 __webpack_require__.r(__webpack_exports__);
1470 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1471 /* harmony export */ "default": () => (/* binding */ ErrorHandler)
1472 /* harmony export */ });
1473 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1474 /* harmony import */ var _UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../UIComponents/UIButton */ "./scripts/shared/UIComponents/UIButton.ts");
1475 /* harmony import */ var _UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIContainer */ "./scripts/shared/UIComponents/UIContainer.ts");
1476 /* harmony import */ var _HubspotWrapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
1477 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1478 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1479 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__);
1480
1481
1482
1483
1484
1485
1486
1487
1488 function redirectToPlugin() {
1489 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);
1490 }
1491
1492 function ErrorHandler(_ref) {
1493 var status = _ref.status,
1494 resetErrorState = _ref.resetErrorState,
1495 _ref$errorInfo = _ref.errorInfo,
1496 errorInfo = _ref$errorInfo === void 0 ? {
1497 header: '',
1498 message: '',
1499 action: ''
1500 } : _ref$errorInfo;
1501 var isUnauthorized = status === 401 || status === 403;
1502 var errorHeader = isUnauthorized ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Your plugin isn't authorized", 'leadin') : errorInfo.header;
1503 var errorMessage = isUnauthorized ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Reauthorize your plugin to access your free HubSpot tools.', 'leadin') : errorInfo.message;
1504 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HubspotWrapper__WEBPACK_IMPORTED_MODULE_3__["default"], {
1505 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__.pluginPath,
1506 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_2__["default"], {
1507 textAlign: "center",
1508 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h4", {
1509 children: errorHeader
1510 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
1511 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
1512 children: errorMessage
1513 })
1514 }), isUnauthorized ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__["default"], {
1515 "data-test-id": "authorize-button",
1516 onClick: redirectToPlugin,
1517 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Go to plugin', 'leadin')
1518 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__["default"], {
1519 "data-test-id": "retry-button",
1520 onClick: resetErrorState,
1521 children: errorInfo.action
1522 })]
1523 })
1524 });
1525 }
1526
1527 /***/ }),
1528
1529 /***/ "./scripts/shared/Common/HubspotWrapper.ts":
1530 /*!*************************************************!*\
1531 !*** ./scripts/shared/Common/HubspotWrapper.ts ***!
1532 \*************************************************/
1533 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1534
1535 "use strict";
1536 __webpack_require__.r(__webpack_exports__);
1537 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1538 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1539 /* harmony export */ });
1540 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
1541
1542
1543 var _exp = /*#__PURE__*/function _exp() {
1544 return function (props) {
1545 return "url(".concat(props.pluginPath, "/public/assets/images/hubspot.svg)");
1546 };
1547 };
1548
1549 var _exp2 = /*#__PURE__*/function _exp2() {
1550 return function (props) {
1551 return props.padding || '90px 20% 25px';
1552 };
1553 };
1554
1555 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
1556 name: "HubspotWrapper0",
1557 "class": "h1q5v5ee",
1558 propsAsIs: false,
1559 vars: {
1560 "h1q5v5ee-0": [_exp()],
1561 "h1q5v5ee-1": [_exp2()]
1562 }
1563 }));
1564
1565 __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");
1566
1567 /***/ }),
1568
1569 /***/ "./scripts/shared/Common/LoadingBlock.tsx":
1570 /*!************************************************!*\
1571 !*** ./scripts/shared/Common/LoadingBlock.tsx ***!
1572 \************************************************/
1573 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1574
1575 "use strict";
1576 __webpack_require__.r(__webpack_exports__);
1577 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1578 /* harmony export */ "default": () => (/* binding */ LoadingBlock)
1579 /* harmony export */ });
1580 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1581 /* harmony import */ var _HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
1582 /* harmony import */ var _UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UISpinner */ "./scripts/shared/UIComponents/UISpinner.tsx");
1583 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1584
1585
1586
1587
1588 function LoadingBlock() {
1589 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], {
1590 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.pluginPath,
1591 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_2__["default"], {
1592 size: 50
1593 })
1594 });
1595 }
1596
1597 /***/ }),
1598
1599 /***/ "./scripts/shared/Form/FormEdit.tsx":
1600 /*!******************************************!*\
1601 !*** ./scripts/shared/Form/FormEdit.tsx ***!
1602 \******************************************/
1603 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1604
1605 "use strict";
1606 __webpack_require__.r(__webpack_exports__);
1607 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1608 /* harmony export */ "default": () => (/* binding */ FormEditContainer)
1609 /* harmony export */ });
1610 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1611 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
1612 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
1613 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1614 /* harmony import */ var _UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpacer */ "./scripts/shared/UIComponents/UISpacer.ts");
1615 /* harmony import */ var _PreviewForm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PreviewForm */ "./scripts/shared/Form/PreviewForm.tsx");
1616 /* harmony import */ var _FormSelect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FormSelect */ "./scripts/shared/Form/FormSelect.tsx");
1617 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
1618 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
1619 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
1620 /* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts");
1621 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1622
1623 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1624
1625 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638 function FormEdit(_ref) {
1639 var attributes = _ref.attributes,
1640 isSelected = _ref.isSelected,
1641 setAttributes = _ref.setAttributes,
1642 _ref$preview = _ref.preview,
1643 preview = _ref$preview === void 0 ? true : _ref$preview,
1644 _ref$origin = _ref.origin,
1645 origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin;
1646 var formId = attributes.formId,
1647 formName = attributes.formName;
1648 var formSelected = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId && formId;
1649 var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.useBackgroundAppContext)();
1650 var monitorFormPreviewRender = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.usePostBackgroundMessage)();
1651
1652 var handleChange = function handleChange(selectedForm) {
1653 setAttributes({
1654 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
1655 formId: selectedForm.value,
1656 formName: selectedForm.label
1657 });
1658 };
1659
1660 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
1661 monitorFormPreviewRender({
1662 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__.ProxyMessages.TrackFormPreviewRender,
1663 payload: {
1664 origin: origin
1665 }
1666 });
1667 }, [origin]);
1668 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, {
1669 children: [(isSelected || !formSelected) && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormSelect__WEBPACK_IMPORTED_MODULE_5__["default"], {
1670 formId: formId,
1671 formName: formName,
1672 handleChange: handleChange,
1673 origin: origin
1674 }), formSelected && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
1675 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"], {
1676 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
1677 formId: formId
1678 })]
1679 })]
1680 });
1681 }
1682
1683 function FormEditContainer(props) {
1684 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.BackgroudAppContext.Provider, {
1685 value: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.refreshToken && (0,_utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_9__.getOrCreateBackgroundApp)(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.refreshToken),
1686 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(FormEdit, _objectSpread({}, props))
1687 });
1688 }
1689
1690 /***/ }),
1691
1692 /***/ "./scripts/shared/Form/FormSelect.tsx":
1693 /*!********************************************!*\
1694 !*** ./scripts/shared/Form/FormSelect.tsx ***!
1695 \********************************************/
1696 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1697
1698 "use strict";
1699 __webpack_require__.r(__webpack_exports__);
1700 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1701 /* harmony export */ "default": () => (/* binding */ FormSelect)
1702 /* harmony export */ });
1703 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1704 /* harmony import */ var _FormSelector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FormSelector */ "./scripts/shared/Form/FormSelector.tsx");
1705 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
1706 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1707 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
1708 /* harmony import */ var _hooks_useForms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hooks/useForms */ "./scripts/shared/Form/hooks/useForms.ts");
1709 /* harmony import */ var _hooks_useCreateFormFromTemplate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks/useCreateFormFromTemplate */ "./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts");
1710 /* harmony import */ var _constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../constants/defaultFormOptions */ "./scripts/constants/defaultFormOptions.ts");
1711 /* harmony import */ var _Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
1712
1713
1714
1715
1716
1717
1718
1719
1720 function FormSelect(_ref) {
1721 var formId = _ref.formId,
1722 formName = _ref.formName,
1723 handleChange = _ref.handleChange,
1724 _ref$origin = _ref.origin,
1725 origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin;
1726
1727 var _useForms = (0,_hooks_useForms__WEBPACK_IMPORTED_MODULE_4__["default"])(),
1728 search = _useForms.search,
1729 formApiError = _useForms.formApiError,
1730 reset = _useForms.reset;
1731
1732 var _useCreateFormFromTem = (0,_hooks_useCreateFormFromTemplate__WEBPACK_IMPORTED_MODULE_5__["default"])(origin),
1733 createFormByTemplate = _useCreateFormFromTem.createFormByTemplate,
1734 createReset = _useCreateFormFromTem.reset,
1735 isCreating = _useCreateFormFromTem.isCreating,
1736 hasError = _useCreateFormFromTem.hasError,
1737 createApiError = _useCreateFormFromTem.formApiError;
1738
1739 var value = formId && formName ? {
1740 label: formName,
1741 value: formId
1742 } : null;
1743
1744 var handleLocalChange = function handleLocalChange(option) {
1745 if ((0,_constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_6__.isDefaultForm)(option.value)) {
1746 createFormByTemplate(option.value).then(function (_ref2) {
1747 var guid = _ref2.guid,
1748 name = _ref2.name;
1749 handleChange({
1750 value: guid,
1751 label: name
1752 });
1753 });
1754 } else {
1755 handleChange(option);
1756 }
1757 };
1758
1759 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"], {
1760 status: formApiError ? formApiError.status : createApiError.status,
1761 resetErrorState: function resetErrorState() {
1762 if (hasError) {
1763 createReset();
1764 } else {
1765 reset();
1766 }
1767 },
1768 errorInfo: {
1769 header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('There was a problem retrieving your forms', 'leadin'),
1770 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Please refresh your forms or try again in a few minutes.', 'leadin'),
1771 action: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Refresh forms', 'leadin')
1772 }
1773 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormSelector__WEBPACK_IMPORTED_MODULE_1__["default"], {
1774 loadOptions: search,
1775 onChange: function onChange(option) {
1776 return handleLocalChange(option);
1777 },
1778 value: value
1779 });
1780 }
1781
1782 /***/ }),
1783
1784 /***/ "./scripts/shared/Form/FormSelector.tsx":
1785 /*!**********************************************!*\
1786 !*** ./scripts/shared/Form/FormSelector.tsx ***!
1787 \**********************************************/
1788 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1789
1790 "use strict";
1791 __webpack_require__.r(__webpack_exports__);
1792 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1793 /* harmony export */ "default": () => (/* binding */ FormSelector)
1794 /* harmony export */ });
1795 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1796 /* harmony import */ var _Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Common/HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
1797 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1798 /* harmony import */ var _Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/AsyncSelect */ "./scripts/shared/Common/AsyncSelect.tsx");
1799 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1800 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
1801
1802
1803
1804
1805
1806 function FormSelector(_ref) {
1807 var loadOptions = _ref.loadOptions,
1808 onChange = _ref.onChange,
1809 value = _ref.value;
1810 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], {
1811 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.pluginPath,
1812 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
1813 "data-test-id": "leadin-form-select",
1814 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
1815 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select an existing form or create a new one from a template', 'leadin')
1816 })
1817 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_3__["default"], {
1818 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Search for a form', 'leadin'),
1819 value: value,
1820 loadOptions: loadOptions,
1821 onChange: onChange
1822 })]
1823 });
1824 }
1825
1826 /***/ }),
1827
1828 /***/ "./scripts/shared/Form/PreviewForm.tsx":
1829 /*!*********************************************!*\
1830 !*** ./scripts/shared/Form/PreviewForm.tsx ***!
1831 \*********************************************/
1832 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1833
1834 "use strict";
1835 __webpack_require__.r(__webpack_exports__);
1836 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1837 /* harmony export */ "default": () => (/* binding */ PreviewForm)
1838 /* harmony export */ });
1839 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1840 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
1841 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
1842 /* harmony import */ var _UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIOverlay */ "./scripts/shared/UIComponents/UIOverlay.ts");
1843 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1844 /* harmony import */ var _hooks_useFormsScript__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hooks/useFormsScript */ "./scripts/shared/Form/hooks/useFormsScript.ts");
1845
1846
1847
1848
1849
1850 function PreviewForm(_ref) {
1851 var portalId = _ref.portalId,
1852 formId = _ref.formId;
1853 var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
1854 var ready = (0,_hooks_useFormsScript__WEBPACK_IMPORTED_MODULE_4__["default"])();
1855 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
1856 if (!ready) {
1857 return;
1858 }
1859
1860 if (inputEl.current) {
1861 inputEl.current.innerHTML = '';
1862 var embedScript = document.createElement('script');
1863 embedScript.innerHTML = "hbspt.forms.create({ portalId: '".concat(portalId, "', formId: '").concat(formId, "', region: '").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.hublet, "', ").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.formsScriptPayload, " });");
1864 inputEl.current.appendChild(embedScript);
1865 }
1866 }, [formId, portalId, ready, inputEl]);
1867 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__["default"], {
1868 ref: inputEl
1869 });
1870 }
1871
1872 /***/ }),
1873
1874 /***/ "./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts":
1875 /*!****************************************************************!*\
1876 !*** ./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts ***!
1877 \****************************************************************/
1878 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1879
1880 "use strict";
1881 __webpack_require__.r(__webpack_exports__);
1882 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1883 /* harmony export */ "default": () => (/* binding */ useCreateFormFromTemplate)
1884 /* harmony export */ });
1885 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1886 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1887 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
1888 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
1889 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
1890 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1891
1892 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."); }
1893
1894 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1895
1896 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1897
1898 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
1899
1900 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1901
1902
1903
1904
1905
1906 function useCreateFormFromTemplate() {
1907 var origin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'gutenberg';
1908 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)();
1909 var track = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostBackgroundMessage)();
1910
1911 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle),
1912 _useState2 = _slicedToArray(_useState, 2),
1913 loadState = _useState2[0],
1914 setLoadState = _useState2[1];
1915
1916 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
1917 _useState4 = _slicedToArray(_useState3, 2),
1918 formApiError = _useState4[0],
1919 setFormApiError = _useState4[1];
1920
1921 var createFormByTemplate = function createFormByTemplate(type) {
1922 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading);
1923 track({
1924 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.TrackFormCreatedFromTemplate,
1925 payload: {
1926 type: type,
1927 origin: origin
1928 }
1929 });
1930 return proxy({
1931 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.CreateFormFromTemplate,
1932 payload: type
1933 }).then(function (form) {
1934 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle);
1935 return form;
1936 })["catch"](function (err) {
1937 setFormApiError(err);
1938 track({
1939 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.TrackFormCreationFailed,
1940 payload: {
1941 origin: origin
1942 }
1943 });
1944 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed);
1945 });
1946 };
1947
1948 return {
1949 isCreating: loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading,
1950 hasError: loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed,
1951 formApiError: formApiError,
1952 createFormByTemplate: createFormByTemplate,
1953 reset: function reset() {
1954 return setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle);
1955 }
1956 };
1957 }
1958
1959 /***/ }),
1960
1961 /***/ "./scripts/shared/Form/hooks/useForms.ts":
1962 /*!***********************************************!*\
1963 !*** ./scripts/shared/Form/hooks/useForms.ts ***!
1964 \***********************************************/
1965 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1966
1967 "use strict";
1968 __webpack_require__.r(__webpack_exports__);
1969 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1970 /* harmony export */ "default": () => (/* binding */ useForms)
1971 /* harmony export */ });
1972 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1973 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1974 /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/debounce */ "./node_modules/lodash/debounce.js");
1975 /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_1__);
1976 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
1977 /* harmony import */ var _constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../constants/defaultFormOptions */ "./scripts/constants/defaultFormOptions.ts");
1978 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
1979 function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1980
1981 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."); }
1982
1983 function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1984
1985 function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1986
1987 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1988
1989 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."); }
1990
1991 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1992
1993 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1994
1995 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
1996
1997 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1998
1999
2000
2001
2002
2003
2004 function useForms() {
2005 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__.usePostAsyncBackgroundMessage)();
2006
2007 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2008 _useState2 = _slicedToArray(_useState, 2),
2009 formApiError = _useState2[0],
2010 setFormApiError = _useState2[1];
2011
2012 var search = lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default()(function (search, callback) {
2013 return proxy({
2014 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_4__.ProxyMessages.FetchForms,
2015 payload: {
2016 search: search
2017 }
2018 }).then(function (forms) {
2019 callback([].concat(_toConsumableArray(forms.map(function (form) {
2020 return {
2021 label: form.name,
2022 value: form.guid
2023 };
2024 })), [_constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_OPTIONS]));
2025 })["catch"](function (error) {
2026 setFormApiError(error);
2027 });
2028 }, 300, {
2029 trailing: true
2030 });
2031 return {
2032 search: search,
2033 formApiError: formApiError,
2034 reset: function reset() {
2035 return setFormApiError(null);
2036 }
2037 };
2038 }
2039
2040 /***/ }),
2041
2042 /***/ "./scripts/shared/Form/hooks/useFormsScript.ts":
2043 /*!*****************************************************!*\
2044 !*** ./scripts/shared/Form/hooks/useFormsScript.ts ***!
2045 \*****************************************************/
2046 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2047
2048 "use strict";
2049 __webpack_require__.r(__webpack_exports__);
2050 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2051 /* harmony export */ "default": () => (/* binding */ useFormScript)
2052 /* harmony export */ });
2053 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
2054 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
2055 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2056 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2057 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2058 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../lib/Raven */ "./scripts/lib/Raven.ts");
2059 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2060
2061 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."); }
2062
2063 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2064
2065 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
2066
2067 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
2068
2069 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2070
2071
2072
2073
2074
2075 var promise;
2076
2077 function loadFormsScript() {
2078 if (!promise) {
2079 promise = new Promise(function (resolve, reject) {
2080 return jquery__WEBPACK_IMPORTED_MODULE_0___default().getScript(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.formsScript).done(resolve).fail(reject);
2081 });
2082 }
2083
2084 return promise;
2085 }
2086
2087 function useFormScript() {
2088 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
2089 _useState2 = _slicedToArray(_useState, 2),
2090 ready = _useState2[0],
2091 setReady = _useState2[1];
2092
2093 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2094 loadFormsScript().then(function () {
2095 return setReady(true);
2096 })["catch"](function (error) {
2097 return _lib_Raven__WEBPACK_IMPORTED_MODULE_3__["default"].captureException(error);
2098 });
2099 }, []);
2100 return ready;
2101 }
2102
2103 /***/ }),
2104
2105 /***/ "./scripts/shared/Meeting/MeetingController.tsx":
2106 /*!******************************************************!*\
2107 !*** ./scripts/shared/Meeting/MeetingController.tsx ***!
2108 \******************************************************/
2109 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2110
2111 "use strict";
2112 __webpack_require__.r(__webpack_exports__);
2113 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2114 /* harmony export */ "default": () => (/* binding */ MeetingController)
2115 /* harmony export */ });
2116 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2117 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2118 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2119 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
2120 /* harmony import */ var _MeetingSelector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MeetingSelector */ "./scripts/shared/Meeting/MeetingSelector.tsx");
2121 /* harmony import */ var _MeetingWarning__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MeetingWarning */ "./scripts/shared/Meeting/MeetingWarning.tsx");
2122 /* harmony import */ var _hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks/useMeetings */ "./scripts/shared/Meeting/hooks/useMeetings.ts");
2123 /* harmony import */ var _Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
2124 /* harmony import */ var _Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
2125 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2126 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2127 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__);
2128 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! raven-js */ "./node_modules/raven-js/src/singleton.js");
2129 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(raven_js__WEBPACK_IMPORTED_MODULE_10__);
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141 function MeetingController(_ref) {
2142 var handleChange = _ref.handleChange,
2143 url = _ref.url;
2144
2145 var _useMeetings = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__["default"])(),
2146 meetings = _useMeetings.mappedMeetings,
2147 loading = _useMeetings.loading,
2148 error = _useMeetings.error,
2149 reload = _useMeetings.reload,
2150 connectCalendar = _useMeetings.connectCalendar;
2151
2152 var selectedMeetingOption = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__.useSelectedMeeting)(url);
2153 var selectedMeetingCalendar = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__.useSelectedMeetingCalendar)(url);
2154 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2155 if (!url && meetings.length > 0) {
2156 handleChange(meetings[0].value);
2157 }
2158 }, [meetings, url, handleChange]);
2159
2160 var handleLocalChange = function handleLocalChange(option) {
2161 handleChange(option.value);
2162 };
2163
2164 var handleConnectCalendar = function handleConnectCalendar() {
2165 return connectCalendar().then(function () {
2166 reload();
2167 })["catch"](function (error) {
2168 raven_js__WEBPACK_IMPORTED_MODULE_10___default().captureMessage('Unable to connect calendar', {
2169 extra: {
2170 error: error
2171 }
2172 });
2173 });
2174 };
2175
2176 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2177 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"], {
2178 status: error && error.status || error,
2179 resetErrorState: function resetErrorState() {
2180 return reload();
2181 },
2182 errorInfo: {
2183 header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('There was a problem retrieving your meetings', 'leadin'),
2184 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('Please refresh your meetings or try again in a few minutes.', 'leadin'),
2185 action: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('Refresh meetings', 'leadin')
2186 }
2187 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_6__["default"], {
2188 padding: "90px 32px 24px",
2189 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_8__.pluginPath,
2190 children: [selectedMeetingCalendar && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingWarning__WEBPACK_IMPORTED_MODULE_4__["default"], {
2191 status: selectedMeetingCalendar,
2192 onConnectCalendar: handleConnectCalendar
2193 }), meetings.length > 1 && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingSelector__WEBPACK_IMPORTED_MODULE_3__["default"], {
2194 onChange: handleLocalChange,
2195 options: meetings,
2196 value: selectedMeetingOption
2197 })]
2198 })
2199 });
2200 }
2201
2202 /***/ }),
2203
2204 /***/ "./scripts/shared/Meeting/MeetingEdit.tsx":
2205 /*!************************************************!*\
2206 !*** ./scripts/shared/Meeting/MeetingEdit.tsx ***!
2207 \************************************************/
2208 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2209
2210 "use strict";
2211 __webpack_require__.r(__webpack_exports__);
2212 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2213 /* harmony export */ "default": () => (/* binding */ MeetingsEditContainer)
2214 /* harmony export */ });
2215 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2216 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2217 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2218 /* harmony import */ var _MeetingController__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MeetingController */ "./scripts/shared/Meeting/MeetingController.tsx");
2219 /* harmony import */ var _PreviewMeeting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PreviewMeeting */ "./scripts/shared/Meeting/PreviewMeeting.tsx");
2220 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2221 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2222 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2223 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
2224 /* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts");
2225 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2226
2227 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2228
2229 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241 function MeetingEdit(_ref) {
2242 var url = _ref.attributes.url,
2243 isSelected = _ref.isSelected,
2244 setAttributes = _ref.setAttributes,
2245 _ref$preview = _ref.preview,
2246 preview = _ref$preview === void 0 ? true : _ref$preview,
2247 _ref$origin = _ref.origin,
2248 origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin;
2249 var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.useBackgroundAppContext)();
2250 var monitorFormPreviewRender = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.usePostBackgroundMessage)();
2251
2252 var handleChange = function handleChange(newUrl) {
2253 setAttributes({
2254 url: newUrl
2255 });
2256 };
2257
2258 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2259 monitorFormPreviewRender({
2260 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_6__.ProxyMessages.TrackMeetingPreviewRender,
2261 payload: {
2262 origin: origin
2263 }
2264 });
2265 }, [origin]);
2266 return !isBackgroundAppReady ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_7__["default"], {}) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2267 children: [(isSelected || !url) && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingController__WEBPACK_IMPORTED_MODULE_2__["default"], {
2268 url: url,
2269 handleChange: handleChange
2270 }), preview && url && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_PreviewMeeting__WEBPACK_IMPORTED_MODULE_3__["default"], {
2271 url: url
2272 })]
2273 });
2274 }
2275
2276 function MeetingsEditContainer(props) {
2277 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.BackgroudAppContext.Provider, {
2278 value: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_5__.refreshToken && (0,_utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_8__.getOrCreateBackgroundApp)(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_5__.refreshToken),
2279 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MeetingEdit, _objectSpread({}, props))
2280 });
2281 }
2282
2283 /***/ }),
2284
2285 /***/ "./scripts/shared/Meeting/MeetingSelector.tsx":
2286 /*!****************************************************!*\
2287 !*** ./scripts/shared/Meeting/MeetingSelector.tsx ***!
2288 \****************************************************/
2289 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2290
2291 "use strict";
2292 __webpack_require__.r(__webpack_exports__);
2293 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2294 /* harmony export */ "default": () => (/* binding */ MeetingSelector)
2295 /* harmony export */ });
2296 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2297 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2298 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2299 /* harmony import */ var _Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/AsyncSelect */ "./scripts/shared/Common/AsyncSelect.tsx");
2300 /* harmony import */ var _UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpacer */ "./scripts/shared/UIComponents/UISpacer.ts");
2301 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2302 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
2303
2304
2305
2306
2307
2308 function MeetingSelector(_ref) {
2309 var options = _ref.options,
2310 onChange = _ref.onChange,
2311 value = _ref.value;
2312 var optionsWrapper = [{
2313 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Meeting name', 'leadin'),
2314 options: options
2315 }];
2316 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2317 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", {
2318 "data-test-id": "leadin-meeting-select",
2319 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
2320 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select a meeting scheduling page', 'leadin')
2321 })
2322 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_2__["default"], {
2323 defaultOptions: optionsWrapper,
2324 onChange: onChange,
2325 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select a meeting', 'leadin'),
2326 value: value
2327 })]
2328 });
2329 }
2330
2331 /***/ }),
2332
2333 /***/ "./scripts/shared/Meeting/MeetingWarning.tsx":
2334 /*!***************************************************!*\
2335 !*** ./scripts/shared/Meeting/MeetingWarning.tsx ***!
2336 \***************************************************/
2337 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2338
2339 "use strict";
2340 __webpack_require__.r(__webpack_exports__);
2341 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2342 /* harmony export */ "default": () => (/* binding */ MeetingWarning)
2343 /* harmony export */ });
2344 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2345 /* harmony import */ var _UIComponents_UIAlert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../UIComponents/UIAlert */ "./scripts/shared/UIComponents/UIAlert.tsx");
2346 /* harmony import */ var _UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIButton */ "./scripts/shared/UIComponents/UIButton.ts");
2347 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./scripts/shared/Meeting/constants.ts");
2348 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2349 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
2350
2351
2352
2353
2354
2355 function MeetingWarning(_ref) {
2356 var status = _ref.status,
2357 onConnectCalendar = _ref.onConnectCalendar;
2358 var isMeetingOwner = status === _constants__WEBPACK_IMPORTED_MODULE_3__.CURRENT_USER_CALENDAR_MISSING;
2359 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');
2360 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');
2361 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIAlert__WEBPACK_IMPORTED_MODULE_1__["default"], {
2362 titleText: titleText,
2363 titleMessage: titleMessage,
2364 children: isMeetingOwner && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_2__["default"], {
2365 use: "tertiary",
2366 id: "meetings-connect-calendar",
2367 onClick: onConnectCalendar,
2368 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Connect calendar', 'leadin')
2369 })
2370 });
2371 }
2372
2373 /***/ }),
2374
2375 /***/ "./scripts/shared/Meeting/PreviewMeeting.tsx":
2376 /*!***************************************************!*\
2377 !*** ./scripts/shared/Meeting/PreviewMeeting.tsx ***!
2378 \***************************************************/
2379 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2380
2381 "use strict";
2382 __webpack_require__.r(__webpack_exports__);
2383 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2384 /* harmony export */ "default": () => (/* binding */ PreviewForm)
2385 /* harmony export */ });
2386 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2387 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2388 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2389 /* harmony import */ var _UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIOverlay */ "./scripts/shared/UIComponents/UIOverlay.ts");
2390 /* harmony import */ var _hooks_useMeetingsScript__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./hooks/useMeetingsScript */ "./scripts/shared/Meeting/hooks/useMeetingsScript.ts");
2391
2392
2393
2394
2395 function PreviewForm(_ref) {
2396 var url = _ref.url;
2397 var ready = (0,_hooks_useMeetingsScript__WEBPACK_IMPORTED_MODULE_3__["default"])();
2398 var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
2399 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2400 if (!ready) {
2401 return;
2402 }
2403
2404 if (inputEl.current) {
2405 inputEl.current.innerHTML = '';
2406 var container = document.createElement('div');
2407 container.dataset.src = "".concat(url, "?embed=true");
2408 container.classList.add('meetings-iframe-container');
2409 inputEl.current.appendChild(container);
2410 var embedScript = document.createElement('script');
2411 embedScript.innerHTML = 'hbspt.meetings.create(".meetings-iframe-container");';
2412 inputEl.current.appendChild(embedScript);
2413 }
2414 }, [url, ready, inputEl]);
2415 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2416 children: url && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__["default"], {
2417 ref: inputEl
2418 })
2419 });
2420 }
2421
2422 /***/ }),
2423
2424 /***/ "./scripts/shared/Meeting/constants.ts":
2425 /*!*********************************************!*\
2426 !*** ./scripts/shared/Meeting/constants.ts ***!
2427 \*********************************************/
2428 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2429
2430 "use strict";
2431 __webpack_require__.r(__webpack_exports__);
2432 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2433 /* harmony export */ "CURRENT_USER_CALENDAR_MISSING": () => (/* binding */ CURRENT_USER_CALENDAR_MISSING),
2434 /* harmony export */ "OTHER_USER_CALENDAR_MISSING": () => (/* binding */ OTHER_USER_CALENDAR_MISSING)
2435 /* harmony export */ });
2436 var OTHER_USER_CALENDAR_MISSING = 'OTHER_USER_CALENDAR_MISSING';
2437 var CURRENT_USER_CALENDAR_MISSING = 'CURRENT_USER_CALENDAR_MISSING';
2438
2439 /***/ }),
2440
2441 /***/ "./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts":
2442 /*!*************************************************************!*\
2443 !*** ./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts ***!
2444 \*************************************************************/
2445 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2446
2447 "use strict";
2448 __webpack_require__.r(__webpack_exports__);
2449 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2450 /* harmony export */ "default": () => (/* binding */ useCurrentUserFetch)
2451 /* harmony export */ });
2452 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2453 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2454 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2455 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2456 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2457 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2458
2459 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."); }
2460
2461 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2462
2463 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
2464
2465 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
2466
2467 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2468
2469
2470
2471
2472
2473 var user = null;
2474 function useCurrentUserFetch() {
2475 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)();
2476
2477 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded),
2478 _useState2 = _slicedToArray(_useState, 2),
2479 loadState = _useState2[0],
2480 setLoadState = _useState2[1];
2481
2482 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2483 _useState4 = _slicedToArray(_useState3, 2),
2484 error = _useState4[0],
2485 setError = _useState4[1];
2486
2487 var createUser = function createUser() {
2488 if (!user) {
2489 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded);
2490 }
2491 };
2492
2493 var reload = function reload() {
2494 user = null;
2495 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded);
2496 setError(null);
2497 };
2498
2499 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
2500 if (loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded && !user) {
2501 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading);
2502 proxy({
2503 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.FetchOrCreateMeetingUser
2504 }).then(function (data) {
2505 user = data;
2506 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle);
2507 })["catch"](function (err) {
2508 setError(err);
2509 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed);
2510 });
2511 }
2512 }, [loadState]);
2513 return {
2514 user: user,
2515 loadUserState: loadState,
2516 error: error,
2517 createUser: createUser,
2518 reload: reload
2519 };
2520 }
2521
2522 /***/ }),
2523
2524 /***/ "./scripts/shared/Meeting/hooks/useMeetings.ts":
2525 /*!*****************************************************!*\
2526 !*** ./scripts/shared/Meeting/hooks/useMeetings.ts ***!
2527 \*****************************************************/
2528 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2529
2530 "use strict";
2531 __webpack_require__.r(__webpack_exports__);
2532 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2533 /* harmony export */ "default": () => (/* binding */ useMeetings),
2534 /* harmony export */ "useSelectedMeeting": () => (/* binding */ useSelectedMeeting),
2535 /* harmony export */ "useSelectedMeetingCalendar": () => (/* binding */ useSelectedMeetingCalendar)
2536 /* harmony export */ });
2537 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2538 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2539 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2540 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
2541 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./scripts/shared/Meeting/constants.ts");
2542 /* harmony import */ var _useMeetingsFetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./useMeetingsFetch */ "./scripts/shared/Meeting/hooks/useMeetingsFetch.ts");
2543 /* harmony import */ var _useCurrentUserFetch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./useCurrentUserFetch */ "./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts");
2544 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2545 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2546 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2547 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2548
2549 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2550
2551 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2552
2553 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2554
2555 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."); }
2556
2557 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2558
2559 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
2560
2561 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
2562
2563 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574 function getDefaultMeetingName(meeting, currentUser, meetingUsers) {
2575 var _meeting$meetingsUser = _slicedToArray(meeting.meetingsUserIds, 1),
2576 meetingOwnerId = _meeting$meetingsUser[0];
2577
2578 var result = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Default', 'leadin');
2579
2580 if (currentUser && meetingOwnerId !== currentUser.id && meetingUsers[meetingOwnerId]) {
2581 var user = meetingUsers[meetingOwnerId];
2582 result += " (".concat(user.userProfile.fullName, ")");
2583 }
2584
2585 return result;
2586 }
2587
2588 function hasCalendarObject(user) {
2589 return user && user.meetingsUserBlob && user.meetingsUserBlob.calendarSettings && user.meetingsUserBlob.calendarSettings.email;
2590 }
2591
2592 function useMeetings() {
2593 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.usePostAsyncBackgroundMessage)();
2594
2595 var _useMeetingsFetch = (0,_useMeetingsFetch__WEBPACK_IMPORTED_MODULE_3__["default"])(),
2596 meetings = _useMeetingsFetch.meetings,
2597 meetingUsers = _useMeetingsFetch.meetingUsers,
2598 meetingsError = _useMeetingsFetch.error,
2599 loadMeetingsState = _useMeetingsFetch.loadMeetingsState,
2600 reloadMeetings = _useMeetingsFetch.reload;
2601
2602 var _useCurrentUserFetch = (0,_useCurrentUserFetch__WEBPACK_IMPORTED_MODULE_4__["default"])(),
2603 currentUser = _useCurrentUserFetch.user,
2604 userError = _useCurrentUserFetch.error,
2605 loadUserState = _useCurrentUserFetch.loadUserState,
2606 reloadUser = _useCurrentUserFetch.reload;
2607
2608 var reload = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
2609 reloadUser();
2610 reloadMeetings();
2611 }, [reloadUser, reloadMeetings]);
2612
2613 var connectCalendar = function connectCalendar() {
2614 return proxy({
2615 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__.ProxyMessages.ConnectMeetingsCalendar
2616 });
2617 };
2618
2619 return {
2620 mappedMeetings: meetings.map(function (meet) {
2621 return {
2622 label: meet.name || getDefaultMeetingName(meet, currentUser, meetingUsers),
2623 value: meet.link
2624 };
2625 }),
2626 meetings: meetings,
2627 meetingUsers: meetingUsers,
2628 currentUser: currentUser,
2629 error: meetingsError || userError,
2630 loading: loadMeetingsState == _enums_loadState__WEBPACK_IMPORTED_MODULE_5__["default"].Loading || loadUserState === _enums_loadState__WEBPACK_IMPORTED_MODULE_5__["default"].Loading,
2631 reload: reload,
2632 connectCalendar: connectCalendar
2633 };
2634 }
2635 function useSelectedMeeting(url) {
2636 var _useMeetings = useMeetings(),
2637 meetings = _useMeetings.mappedMeetings;
2638
2639 var option = meetings.find(function (_ref) {
2640 var value = _ref.value;
2641 return value === url;
2642 });
2643 return option;
2644 }
2645 function useSelectedMeetingCalendar(url) {
2646 var _useMeetings2 = useMeetings(),
2647 meetings = _useMeetings2.meetings,
2648 meetingUsers = _useMeetings2.meetingUsers,
2649 currentUser = _useMeetings2.currentUser;
2650
2651 var meeting = meetings.find(function (meet) {
2652 return meet.link === url;
2653 });
2654 var mappedMeetingUsersId = meetingUsers.reduce(function (p, c) {
2655 return _objectSpread(_objectSpread({}, p), {}, _defineProperty({}, c.id, c));
2656 }, {});
2657
2658 if (!meeting) {
2659 return null;
2660 } else {
2661 var meetingsUserIds = meeting.meetingsUserIds;
2662
2663 if (currentUser && meetingsUserIds.includes(currentUser.id) && !hasCalendarObject(currentUser)) {
2664 return _constants__WEBPACK_IMPORTED_MODULE_2__.CURRENT_USER_CALENDAR_MISSING;
2665 } else if (meetingsUserIds.map(function (id) {
2666 return mappedMeetingUsersId[id];
2667 }).some(function (user) {
2668 return !hasCalendarObject(user);
2669 })) {
2670 return _constants__WEBPACK_IMPORTED_MODULE_2__.OTHER_USER_CALENDAR_MISSING;
2671 } else {
2672 return null;
2673 }
2674 }
2675 }
2676
2677 /***/ }),
2678
2679 /***/ "./scripts/shared/Meeting/hooks/useMeetingsFetch.ts":
2680 /*!**********************************************************!*\
2681 !*** ./scripts/shared/Meeting/hooks/useMeetingsFetch.ts ***!
2682 \**********************************************************/
2683 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2684
2685 "use strict";
2686 __webpack_require__.r(__webpack_exports__);
2687 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2688 /* harmony export */ "default": () => (/* binding */ useMeetingsFetch)
2689 /* harmony export */ });
2690 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2691 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2692 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2693 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2694 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2695 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2696
2697 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."); }
2698
2699 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2700
2701 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
2702
2703 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
2704
2705 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2706
2707
2708
2709
2710
2711 var meetings = [];
2712 var meetingUsers = [];
2713 function useMeetingsFetch() {
2714 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)();
2715
2716 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded),
2717 _useState2 = _slicedToArray(_useState, 2),
2718 loadState = _useState2[0],
2719 setLoadState = _useState2[1];
2720
2721 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2722 _useState4 = _slicedToArray(_useState3, 2),
2723 error = _useState4[0],
2724 setError = _useState4[1];
2725
2726 var reload = function reload() {
2727 meetings = [];
2728 setError(null);
2729 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded);
2730 };
2731
2732 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
2733 if (loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded && meetings.length === 0) {
2734 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading);
2735 proxy({
2736 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.FetchMeetingsAndUsers
2737 }).then(function (data) {
2738 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loaded);
2739 meetings = data && data.meetingLinks;
2740 meetingUsers = data && data.meetingUsers;
2741 })["catch"](function (e) {
2742 setError(e);
2743 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed);
2744 });
2745 }
2746 }, [loadState]);
2747 return {
2748 meetings: meetings,
2749 meetingUsers: meetingUsers,
2750 loadMeetingsState: loadState,
2751 error: error,
2752 reload: reload
2753 };
2754 }
2755
2756 /***/ }),
2757
2758 /***/ "./scripts/shared/Meeting/hooks/useMeetingsScript.ts":
2759 /*!***********************************************************!*\
2760 !*** ./scripts/shared/Meeting/hooks/useMeetingsScript.ts ***!
2761 \***********************************************************/
2762 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2763
2764 "use strict";
2765 __webpack_require__.r(__webpack_exports__);
2766 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2767 /* harmony export */ "default": () => (/* binding */ useMeetingsScript)
2768 /* harmony export */ });
2769 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
2770 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
2771 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2772 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2773 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2774 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../lib/Raven */ "./scripts/lib/Raven.ts");
2775 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2776
2777 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."); }
2778
2779 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2780
2781 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
2782
2783 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
2784
2785 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2786
2787
2788
2789
2790
2791 var promise;
2792
2793 function loadMeetingsScript() {
2794 if (!promise) {
2795 promise = new Promise(function (resolve, reject) {
2796 return jquery__WEBPACK_IMPORTED_MODULE_0___default().getScript(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.meetingsScript).done(resolve).fail(reject);
2797 });
2798 }
2799
2800 return promise;
2801 }
2802
2803 function useMeetingsScript() {
2804 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
2805 _useState2 = _slicedToArray(_useState, 2),
2806 ready = _useState2[0],
2807 setReady = _useState2[1];
2808
2809 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2810 loadMeetingsScript().then(function () {
2811 return setReady(true);
2812 })["catch"](function (error) {
2813 return _lib_Raven__WEBPACK_IMPORTED_MODULE_3__["default"].captureException(error);
2814 });
2815 }, []);
2816 return ready;
2817 }
2818
2819 /***/ }),
2820
2821 /***/ "./scripts/shared/UIComponents/UIAlert.tsx":
2822 /*!*************************************************!*\
2823 !*** ./scripts/shared/UIComponents/UIAlert.tsx ***!
2824 \*************************************************/
2825 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2826
2827 "use strict";
2828 __webpack_require__.r(__webpack_exports__);
2829 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2830 /* harmony export */ "default": () => (/* binding */ UIAlert)
2831 /* harmony export */ });
2832 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2833 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
2834
2835
2836 var AlertContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('div')({
2837 name: "AlertContainer",
2838 "class": "a1h8m4fo",
2839 propsAsIs: false
2840 });
2841 var Title = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('p')({
2842 name: "Title",
2843 "class": "tyndzxk",
2844 propsAsIs: false
2845 });
2846 var Message = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('p')({
2847 name: "Message",
2848 "class": "m1m9sbk4",
2849 propsAsIs: false
2850 });
2851 var MessageContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('div')({
2852 name: "MessageContainer",
2853 "class": "mg5o421",
2854 propsAsIs: false
2855 });
2856 function UIAlert(_ref) {
2857 var titleText = _ref.titleText,
2858 titleMessage = _ref.titleMessage,
2859 children = _ref.children;
2860 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(AlertContainer, {
2861 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(MessageContainer, {
2862 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Title, {
2863 children: titleText
2864 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Message, {
2865 children: titleMessage
2866 })]
2867 }), children]
2868 });
2869 }
2870
2871 __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");
2872
2873 /***/ }),
2874
2875 /***/ "./scripts/shared/UIComponents/UIButton.ts":
2876 /*!*************************************************!*\
2877 !*** ./scripts/shared/UIComponents/UIButton.ts ***!
2878 \*************************************************/
2879 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2880
2881 "use strict";
2882 __webpack_require__.r(__webpack_exports__);
2883 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2884 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2885 /* harmony export */ });
2886 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
2887 /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./colors */ "./scripts/shared/UIComponents/colors.ts");
2888
2889
2890
2891 var _exp2 = /*#__PURE__*/function _exp2() {
2892 return function (props) {
2893 return props.use === 'tertiary' ? _colors__WEBPACK_IMPORTED_MODULE_0__.HEFFALUMP : _colors__WEBPACK_IMPORTED_MODULE_0__.LORAX;
2894 };
2895 };
2896
2897 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('button')({
2898 name: "UIButton0",
2899 "class": "ug152ch",
2900 propsAsIs: false,
2901 vars: {
2902 "ug152ch-0": [_exp2()]
2903 }
2904 }));
2905
2906 __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");
2907
2908 /***/ }),
2909
2910 /***/ "./scripts/shared/UIComponents/UIContainer.ts":
2911 /*!****************************************************!*\
2912 !*** ./scripts/shared/UIComponents/UIContainer.ts ***!
2913 \****************************************************/
2914 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2915
2916 "use strict";
2917 __webpack_require__.r(__webpack_exports__);
2918 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2919 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2920 /* harmony export */ });
2921 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
2922
2923
2924 var _exp = /*#__PURE__*/function _exp() {
2925 return function (props) {
2926 return props.textAlign ? props.textAlign : 'inherit';
2927 };
2928 };
2929
2930 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
2931 name: "UIContainer0",
2932 "class": "ua13n1c",
2933 propsAsIs: false,
2934 vars: {
2935 "ua13n1c-0": [_exp()]
2936 }
2937 }));
2938
2939 __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");
2940
2941 /***/ }),
2942
2943 /***/ "./scripts/shared/UIComponents/UIOverlay.ts":
2944 /*!**************************************************!*\
2945 !*** ./scripts/shared/UIComponents/UIOverlay.ts ***!
2946 \**************************************************/
2947 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2948
2949 "use strict";
2950 __webpack_require__.r(__webpack_exports__);
2951 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2952 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2953 /* harmony export */ });
2954 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
2955
2956 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
2957 name: "UIOverlay0",
2958 "class": "u1q7a48k",
2959 propsAsIs: false
2960 }));
2961
2962 __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");
2963
2964 /***/ }),
2965
2966 /***/ "./scripts/shared/UIComponents/UISpacer.ts":
2967 /*!*************************************************!*\
2968 !*** ./scripts/shared/UIComponents/UISpacer.ts ***!
2969 \*************************************************/
2970 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2971
2972 "use strict";
2973 __webpack_require__.r(__webpack_exports__);
2974 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2975 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2976 /* harmony export */ });
2977 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
2978
2979 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
2980 name: "UISpacer0",
2981 "class": "u3qxofx",
2982 propsAsIs: false
2983 }));
2984
2985 __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");
2986
2987 /***/ }),
2988
2989 /***/ "./scripts/shared/UIComponents/UISpinner.tsx":
2990 /*!***************************************************!*\
2991 !*** ./scripts/shared/UIComponents/UISpinner.tsx ***!
2992 \***************************************************/
2993 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2994
2995 "use strict";
2996 __webpack_require__.r(__webpack_exports__);
2997 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2998 /* harmony export */ "default": () => (/* binding */ UISpinner)
2999 /* harmony export */ });
3000 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
3001 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3002 /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colors */ "./scripts/shared/UIComponents/colors.ts");
3003
3004
3005
3006 var SpinnerOuter = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('div')({
3007 name: "SpinnerOuter",
3008 "class": "sxa9zrc",
3009 propsAsIs: false
3010 });
3011 var SpinnerInner = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('div')({
3012 name: "SpinnerInner",
3013 "class": "s14430wa",
3014 propsAsIs: false
3015 });
3016
3017 var _exp = /*#__PURE__*/function _exp() {
3018 return function (props) {
3019 return props.color;
3020 };
3021 };
3022
3023 var Circle = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('circle')({
3024 name: "Circle",
3025 "class": "ct87ghk",
3026 propsAsIs: true,
3027 vars: {
3028 "ct87ghk-0": [_exp()]
3029 }
3030 });
3031
3032 var _exp2 = /*#__PURE__*/function _exp2() {
3033 return function (props) {
3034 return props.color;
3035 };
3036 };
3037
3038 var AnimatedCircle = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('circle')({
3039 name: "AnimatedCircle",
3040 "class": "avili0h",
3041 propsAsIs: true,
3042 vars: {
3043 "avili0h-0": [_exp2()]
3044 }
3045 });
3046 function UISpinner(_ref) {
3047 var _ref$size = _ref.size,
3048 size = _ref$size === void 0 ? 20 : _ref$size;
3049 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpinnerOuter, {
3050 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpinnerInner, {
3051 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", {
3052 height: size,
3053 width: size,
3054 viewBox: "0 0 50 50",
3055 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Circle, {
3056 color: _colors__WEBPACK_IMPORTED_MODULE_1__.CALYPSO_MEDIUM,
3057 cx: "25",
3058 cy: "25",
3059 r: "22.5"
3060 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AnimatedCircle, {
3061 color: _colors__WEBPACK_IMPORTED_MODULE_1__.CALYPSO,
3062 cx: "25",
3063 cy: "25",
3064 r: "22.5"
3065 })]
3066 })
3067 })
3068 });
3069 }
3070
3071 __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");
3072
3073 /***/ }),
3074
3075 /***/ "./scripts/shared/UIComponents/colors.ts":
3076 /*!***********************************************!*\
3077 !*** ./scripts/shared/UIComponents/colors.ts ***!
3078 \***********************************************/
3079 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3080
3081 "use strict";
3082 __webpack_require__.r(__webpack_exports__);
3083 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3084 /* harmony export */ "CALYPSO": () => (/* binding */ CALYPSO),
3085 /* harmony export */ "CALYPSO_LIGHT": () => (/* binding */ CALYPSO_LIGHT),
3086 /* harmony export */ "CALYPSO_MEDIUM": () => (/* binding */ CALYPSO_MEDIUM),
3087 /* harmony export */ "HEFFALUMP": () => (/* binding */ HEFFALUMP),
3088 /* harmony export */ "LORAX": () => (/* binding */ LORAX),
3089 /* harmony export */ "MARIGOLD_LIGHT": () => (/* binding */ MARIGOLD_LIGHT),
3090 /* harmony export */ "MARIGOLD_MEDIUM": () => (/* binding */ MARIGOLD_MEDIUM),
3091 /* harmony export */ "OBSIDIAN": () => (/* binding */ OBSIDIAN),
3092 /* harmony export */ "OLAF": () => (/* binding */ OLAF)
3093 /* harmony export */ });
3094 var CALYPSO = '#00a4bd';
3095 var CALYPSO_MEDIUM = '#7fd1de';
3096 var CALYPSO_LIGHT = '#e5f5f8';
3097 var LORAX = '#ff7a59';
3098 var OLAF = '#ffffff';
3099 var HEFFALUMP = '#425b76';
3100 var MARIGOLD_LIGHT = '#fef8f0';
3101 var MARIGOLD_MEDIUM = '#fae0b5';
3102 var OBSIDIAN = '#33475b';
3103
3104 /***/ }),
3105
3106 /***/ "./scripts/shared/enums/connectionStatus.ts":
3107 /*!**************************************************!*\
3108 !*** ./scripts/shared/enums/connectionStatus.ts ***!
3109 \**************************************************/
3110 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3111
3112 "use strict";
3113 __webpack_require__.r(__webpack_exports__);
3114 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3115 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3116 /* harmony export */ });
3117 var ConnectionStatus = {
3118 Connected: 'Connected',
3119 NotConnected: 'NotConnected'
3120 };
3121 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ConnectionStatus);
3122
3123 /***/ }),
3124
3125 /***/ "./scripts/shared/enums/loadState.ts":
3126 /*!*******************************************!*\
3127 !*** ./scripts/shared/enums/loadState.ts ***!
3128 \*******************************************/
3129 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3130
3131 "use strict";
3132 __webpack_require__.r(__webpack_exports__);
3133 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3134 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3135 /* harmony export */ });
3136 var LoadState = {
3137 NotLoaded: 'NotLoaded',
3138 Loading: 'Loading',
3139 Loaded: 'Loaded',
3140 Idle: 'Idle',
3141 Failed: 'Failed'
3142 };
3143 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadState);
3144
3145 /***/ }),
3146
3147 /***/ "./scripts/utils/appUtils.ts":
3148 /*!***********************************!*\
3149 !*** ./scripts/utils/appUtils.ts ***!
3150 \***********************************/
3151 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3152
3153 "use strict";
3154 __webpack_require__.r(__webpack_exports__);
3155 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3156 /* harmony export */ "initApp": () => (/* binding */ initApp),
3157 /* harmony export */ "initAppOnReady": () => (/* binding */ initAppOnReady)
3158 /* harmony export */ });
3159 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
3160 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
3161 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
3162
3163
3164 function initApp(initFn) {
3165 (0,_lib_Raven__WEBPACK_IMPORTED_MODULE_1__.configureRaven)();
3166 _lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].context(initFn);
3167 }
3168 function initAppOnReady(initFn) {
3169 function main() {
3170 jquery__WEBPACK_IMPORTED_MODULE_0___default()(initFn);
3171 }
3172
3173 initApp(main);
3174 }
3175
3176 /***/ }),
3177
3178 /***/ "./scripts/utils/backgroundAppUtils.ts":
3179 /*!*********************************************!*\
3180 !*** ./scripts/utils/backgroundAppUtils.ts ***!
3181 \*********************************************/
3182 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3183
3184 "use strict";
3185 __webpack_require__.r(__webpack_exports__);
3186 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3187 /* harmony export */ "getOrCreateBackgroundApp": () => (/* binding */ getOrCreateBackgroundApp),
3188 /* harmony export */ "initBackgroundApp": () => (/* binding */ initBackgroundApp)
3189 /* harmony export */ });
3190 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
3191 /* harmony import */ var _appUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./appUtils */ "./scripts/utils/appUtils.ts");
3192
3193
3194 function initBackgroundApp(initFn) {
3195 function main() {
3196 if (Array.isArray(initFn)) {
3197 initFn.forEach(function (callback) {
3198 return callback();
3199 });
3200 } else {
3201 initFn();
3202 }
3203 }
3204
3205 (0,_appUtils__WEBPACK_IMPORTED_MODULE_1__.initApp)(main);
3206 }
3207 var getOrCreateBackgroundApp = function getOrCreateBackgroundApp(refreshToken) {
3208 if (window.LeadinBackgroundApp) {
3209 return window.LeadinBackgroundApp;
3210 }
3211
3212 var _window = window,
3213 IntegratedAppEmbedder = _window.IntegratedAppEmbedder,
3214 IntegratedAppOptions = _window.IntegratedAppOptions;
3215 var options = new IntegratedAppOptions().setLocale(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.locale).setDeviceId(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.deviceId).setRefreshToken(refreshToken);
3216 var embedder = new IntegratedAppEmbedder('integrated-plugin-proxy', _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.portalId, _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.hubspotBaseUrl, function () {}).setOptions(options);
3217 embedder.attachTo(document.body, false);
3218 embedder.postStartAppMessage(); // lets the app know all all data has been passed to it
3219
3220 window.LeadinBackgroundApp = embedder;
3221 return window.LeadinBackgroundApp;
3222 };
3223
3224 /***/ }),
3225
3226 /***/ "./scripts/utils/withMetaData.ts":
3227 /*!***************************************!*\
3228 !*** ./scripts/utils/withMetaData.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 */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3236 /* harmony export */ });
3237 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
3238 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
3239 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3240
3241
3242 var applyWithSelect = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.withSelect)(function (select, props) {
3243 return {
3244 metaValue: select('core/editor').getEditedPostAttribute('meta')[props.metaKey]
3245 };
3246 });
3247 var applyWithDispatch = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.withDispatch)(function (dispatch, props) {
3248 return {
3249 setMetaValue: function setMetaValue(value) {
3250 dispatch('core/editor').editPost({
3251 meta: _defineProperty({}, props.metaKey, value)
3252 });
3253 }
3254 };
3255 });
3256
3257 function apply(el) {
3258 return applyWithSelect(applyWithDispatch(el));
3259 }
3260
3261 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (apply);
3262
3263 /***/ }),
3264
3265 /***/ "./node_modules/is-what/dist/index.esm.js":
3266 /*!************************************************!*\
3267 !*** ./node_modules/is-what/dist/index.esm.js ***!
3268 \************************************************/
3269 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3270
3271 "use strict";
3272 __webpack_require__.r(__webpack_exports__);
3273 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3274 /* harmony export */ "getType": () => (/* binding */ getType),
3275 /* harmony export */ "isAnyObject": () => (/* binding */ isAnyObject),
3276 /* harmony export */ "isArray": () => (/* binding */ isArray),
3277 /* harmony export */ "isBlob": () => (/* binding */ isBlob),
3278 /* harmony export */ "isBoolean": () => (/* binding */ isBoolean),
3279 /* harmony export */ "isDate": () => (/* binding */ isDate),
3280 /* harmony export */ "isEmptyArray": () => (/* binding */ isEmptyArray),
3281 /* harmony export */ "isEmptyObject": () => (/* binding */ isEmptyObject),
3282 /* harmony export */ "isEmptyString": () => (/* binding */ isEmptyString),
3283 /* harmony export */ "isError": () => (/* binding */ isError),
3284 /* harmony export */ "isFile": () => (/* binding */ isFile),
3285 /* harmony export */ "isFullArray": () => (/* binding */ isFullArray),
3286 /* harmony export */ "isFullObject": () => (/* binding */ isFullObject),
3287 /* harmony export */ "isFullString": () => (/* binding */ isFullString),
3288 /* harmony export */ "isFunction": () => (/* binding */ isFunction),
3289 /* harmony export */ "isMap": () => (/* binding */ isMap),
3290 /* harmony export */ "isNaNValue": () => (/* binding */ isNaNValue),
3291 /* harmony export */ "isNull": () => (/* binding */ isNull),
3292 /* harmony export */ "isNullOrUndefined": () => (/* binding */ isNullOrUndefined),
3293 /* harmony export */ "isNumber": () => (/* binding */ isNumber),
3294 /* harmony export */ "isObject": () => (/* binding */ isObject),
3295 /* harmony export */ "isObjectLike": () => (/* binding */ isObjectLike),
3296 /* harmony export */ "isOneOf": () => (/* binding */ isOneOf),
3297 /* harmony export */ "isPlainObject": () => (/* binding */ isPlainObject),
3298 /* harmony export */ "isPrimitive": () => (/* binding */ isPrimitive),
3299 /* harmony export */ "isPromise": () => (/* binding */ isPromise),
3300 /* harmony export */ "isRegExp": () => (/* binding */ isRegExp),
3301 /* harmony export */ "isSet": () => (/* binding */ isSet),
3302 /* harmony export */ "isString": () => (/* binding */ isString),
3303 /* harmony export */ "isSymbol": () => (/* binding */ isSymbol),
3304 /* harmony export */ "isType": () => (/* binding */ isType),
3305 /* harmony export */ "isUndefined": () => (/* binding */ isUndefined),
3306 /* harmony export */ "isWeakMap": () => (/* binding */ isWeakMap),
3307 /* harmony export */ "isWeakSet": () => (/* binding */ isWeakSet)
3308 /* harmony export */ });
3309 /**
3310 * Returns the object type of the given payload
3311 *
3312 * @param {*} payload
3313 * @returns {string}
3314 */
3315 function getType(payload) {
3316 return Object.prototype.toString.call(payload).slice(8, -1);
3317 }
3318 /**
3319 * Returns whether the payload is undefined
3320 *
3321 * @param {*} payload
3322 * @returns {payload is undefined}
3323 */
3324 function isUndefined(payload) {
3325 return getType(payload) === 'Undefined';
3326 }
3327 /**
3328 * Returns whether the payload is null
3329 *
3330 * @param {*} payload
3331 * @returns {payload is null}
3332 */
3333 function isNull(payload) {
3334 return getType(payload) === 'Null';
3335 }
3336 /**
3337 * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
3338 *
3339 * @param {*} payload
3340 * @returns {payload is PlainObject}
3341 */
3342 function isPlainObject(payload) {
3343 if (getType(payload) !== 'Object')
3344 return false;
3345 return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;
3346 }
3347 /**
3348 * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
3349 *
3350 * @param {*} payload
3351 * @returns {payload is PlainObject}
3352 */
3353 function isObject(payload) {
3354 return isPlainObject(payload);
3355 }
3356 /**
3357 * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
3358 *
3359 * @param {*} payload
3360 * @returns {payload is { [K in any]: never }}
3361 */
3362 function isEmptyObject(payload) {
3363 return isPlainObject(payload) && Object.keys(payload).length === 0;
3364 }
3365 /**
3366 * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
3367 *
3368 * @param {*} payload
3369 * @returns {payload is PlainObject}
3370 */
3371 function isFullObject(payload) {
3372 return isPlainObject(payload) && Object.keys(payload).length > 0;
3373 }
3374 /**
3375 * Returns whether the payload is an any kind of object (including special classes or objects with different prototypes)
3376 *
3377 * @param {*} payload
3378 * @returns {payload is PlainObject}
3379 */
3380 function isAnyObject(payload) {
3381 return getType(payload) === 'Object';
3382 }
3383 /**
3384 * Returns whether the payload is an object like a type passed in < >
3385 *
3386 * Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an `id` prop.
3387 *
3388 * @template T this must be passed in < >
3389 * @param {*} payload
3390 * @returns {payload is T}
3391 */
3392 function isObjectLike(payload) {
3393 return isAnyObject(payload);
3394 }
3395 /**
3396 * Returns whether the payload is a function (regular or async)
3397 *
3398 * @param {*} payload
3399 * @returns {payload is AnyFunction}
3400 */
3401 function isFunction(payload) {
3402 return typeof payload === 'function';
3403 }
3404 /**
3405 * Returns whether the payload is an array
3406 *
3407 * @param {any} payload
3408 * @returns {payload is any[]}
3409 */
3410 function isArray(payload) {
3411 return getType(payload) === 'Array';
3412 }
3413 /**
3414 * Returns whether the payload is a an array with at least 1 item
3415 *
3416 * @param {*} payload
3417 * @returns {payload is any[]}
3418 */
3419 function isFullArray(payload) {
3420 return isArray(payload) && payload.length > 0;
3421 }
3422 /**
3423 * Returns whether the payload is a an empty array
3424 *
3425 * @param {*} payload
3426 * @returns {payload is []}
3427 */
3428 function isEmptyArray(payload) {
3429 return isArray(payload) && payload.length === 0;
3430 }
3431 /**
3432 * Returns whether the payload is a string
3433 *
3434 * @param {*} payload
3435 * @returns {payload is string}
3436 */
3437 function isString(payload) {
3438 return getType(payload) === 'String';
3439 }
3440 /**
3441 * Returns whether the payload is a string, BUT returns false for ''
3442 *
3443 * @param {*} payload
3444 * @returns {payload is string}
3445 */
3446 function isFullString(payload) {
3447 return isString(payload) && payload !== '';
3448 }
3449 /**
3450 * Returns whether the payload is ''
3451 *
3452 * @param {*} payload
3453 * @returns {payload is string}
3454 */
3455 function isEmptyString(payload) {
3456 return payload === '';
3457 }
3458 /**
3459 * Returns whether the payload is a number (but not NaN)
3460 *
3461 * This will return `false` for `NaN`!!
3462 *
3463 * @param {*} payload
3464 * @returns {payload is number}
3465 */
3466 function isNumber(payload) {
3467 return getType(payload) === 'Number' && !isNaN(payload);
3468 }
3469 /**
3470 * Returns whether the payload is a boolean
3471 *
3472 * @param {*} payload
3473 * @returns {payload is boolean}
3474 */
3475 function isBoolean(payload) {
3476 return getType(payload) === 'Boolean';
3477 }
3478 /**
3479 * Returns whether the payload is a regular expression (RegExp)
3480 *
3481 * @param {*} payload
3482 * @returns {payload is RegExp}
3483 */
3484 function isRegExp(payload) {
3485 return getType(payload) === 'RegExp';
3486 }
3487 /**
3488 * Returns whether the payload is a Map
3489 *
3490 * @param {*} payload
3491 * @returns {payload is Map<any, any>}
3492 */
3493 function isMap(payload) {
3494 return getType(payload) === 'Map';
3495 }
3496 /**
3497 * Returns whether the payload is a WeakMap
3498 *
3499 * @param {*} payload
3500 * @returns {payload is WeakMap<any, any>}
3501 */
3502 function isWeakMap(payload) {
3503 return getType(payload) === 'WeakMap';
3504 }
3505 /**
3506 * Returns whether the payload is a Set
3507 *
3508 * @param {*} payload
3509 * @returns {payload is Set<any>}
3510 */
3511 function isSet(payload) {
3512 return getType(payload) === 'Set';
3513 }
3514 /**
3515 * Returns whether the payload is a WeakSet
3516 *
3517 * @param {*} payload
3518 * @returns {payload is WeakSet<any>}
3519 */
3520 function isWeakSet(payload) {
3521 return getType(payload) === 'WeakSet';
3522 }
3523 /**
3524 * Returns whether the payload is a Symbol
3525 *
3526 * @param {*} payload
3527 * @returns {payload is symbol}
3528 */
3529 function isSymbol(payload) {
3530 return getType(payload) === 'Symbol';
3531 }
3532 /**
3533 * Returns whether the payload is a Date, and that the date is valid
3534 *
3535 * @param {*} payload
3536 * @returns {payload is Date}
3537 */
3538 function isDate(payload) {
3539 return getType(payload) === 'Date' && !isNaN(payload);
3540 }
3541 /**
3542 * Returns whether the payload is a Blob
3543 *
3544 * @param {*} payload
3545 * @returns {payload is Blob}
3546 */
3547 function isBlob(payload) {
3548 return getType(payload) === 'Blob';
3549 }
3550 /**
3551 * Returns whether the payload is a File
3552 *
3553 * @param {*} payload
3554 * @returns {payload is File}
3555 */
3556 function isFile(payload) {
3557 return getType(payload) === 'File';
3558 }
3559 /**
3560 * Returns whether the payload is a Promise
3561 *
3562 * @param {*} payload
3563 * @returns {payload is Promise<any>}
3564 */
3565 function isPromise(payload) {
3566 return getType(payload) === 'Promise';
3567 }
3568 /**
3569 * Returns whether the payload is an Error
3570 *
3571 * @param {*} payload
3572 * @returns {payload is Error}
3573 */
3574 function isError(payload) {
3575 return getType(payload) === 'Error';
3576 }
3577 /**
3578 * Returns whether the payload is literally the value `NaN` (it's `NaN` and also a `number`)
3579 *
3580 * @param {*} payload
3581 * @returns {payload is typeof NaN}
3582 */
3583 function isNaNValue(payload) {
3584 return getType(payload) === 'Number' && isNaN(payload);
3585 }
3586 /**
3587 * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)
3588 *
3589 * @param {*} payload
3590 * @returns {(payload is boolean | null | undefined | number | string | symbol)}
3591 */
3592 function isPrimitive(payload) {
3593 return (isBoolean(payload) ||
3594 isNull(payload) ||
3595 isUndefined(payload) ||
3596 isNumber(payload) ||
3597 isString(payload) ||
3598 isSymbol(payload));
3599 }
3600 /**
3601 * Returns true whether the payload is null or undefined
3602 *
3603 * @param {*} payload
3604 * @returns {(payload is null | undefined)}
3605 */
3606 var isNullOrUndefined = isOneOf(isNull, isUndefined);
3607 function isOneOf(a, b, c, d, e) {
3608 return function (value) {
3609 return a(value) || b(value) || (!!c && c(value)) || (!!d && d(value)) || (!!e && e(value));
3610 };
3611 }
3612 /**
3613 * Does a generic check to check that the given payload is of a given type.
3614 * In cases like Number, it will return true for NaN as NaN is a Number (thanks javascript!);
3615 * It will, however, differentiate between object and null
3616 *
3617 * @template T
3618 * @param {*} payload
3619 * @param {T} type
3620 * @throws {TypeError} Will throw type error if type is an invalid type
3621 * @returns {payload is T}
3622 */
3623 function isType(payload, type) {
3624 if (!(type instanceof Function)) {
3625 throw new TypeError('Type must be a function');
3626 }
3627 if (!Object.prototype.hasOwnProperty.call(type, 'prototype')) {
3628 throw new TypeError('Type is not a class');
3629 }
3630 // Classes usually have names (as functions usually have names)
3631 var name = type.name;
3632 return getType(payload) === name || Boolean(payload && payload.constructor === type);
3633 }
3634
3635
3636
3637
3638 /***/ }),
3639
3640 /***/ "./node_modules/lodash/_Symbol.js":
3641 /*!****************************************!*\
3642 !*** ./node_modules/lodash/_Symbol.js ***!
3643 \****************************************/
3644 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3645
3646 var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
3647
3648 /** Built-in value references. */
3649 var Symbol = root.Symbol;
3650
3651 module.exports = Symbol;
3652
3653
3654 /***/ }),
3655
3656 /***/ "./node_modules/lodash/_baseGetTag.js":
3657 /*!********************************************!*\
3658 !*** ./node_modules/lodash/_baseGetTag.js ***!
3659 \********************************************/
3660 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3661
3662 var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),
3663 getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"),
3664 objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js");
3665
3666 /** `Object#toString` result references. */
3667 var nullTag = '[object Null]',
3668 undefinedTag = '[object Undefined]';
3669
3670 /** Built-in value references. */
3671 var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
3672
3673 /**
3674 * The base implementation of `getTag` without fallbacks for buggy environments.
3675 *
3676 * @private
3677 * @param {*} value The value to query.
3678 * @returns {string} Returns the `toStringTag`.
3679 */
3680 function baseGetTag(value) {
3681 if (value == null) {
3682 return value === undefined ? undefinedTag : nullTag;
3683 }
3684 return (symToStringTag && symToStringTag in Object(value))
3685 ? getRawTag(value)
3686 : objectToString(value);
3687 }
3688
3689 module.exports = baseGetTag;
3690
3691
3692 /***/ }),
3693
3694 /***/ "./node_modules/lodash/_baseTrim.js":
3695 /*!******************************************!*\
3696 !*** ./node_modules/lodash/_baseTrim.js ***!
3697 \******************************************/
3698 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3699
3700 var trimmedEndIndex = __webpack_require__(/*! ./_trimmedEndIndex */ "./node_modules/lodash/_trimmedEndIndex.js");
3701
3702 /** Used to match leading whitespace. */
3703 var reTrimStart = /^\s+/;
3704
3705 /**
3706 * The base implementation of `_.trim`.
3707 *
3708 * @private
3709 * @param {string} string The string to trim.
3710 * @returns {string} Returns the trimmed string.
3711 */
3712 function baseTrim(string) {
3713 return string
3714 ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
3715 : string;
3716 }
3717
3718 module.exports = baseTrim;
3719
3720
3721 /***/ }),
3722
3723 /***/ "./node_modules/lodash/_freeGlobal.js":
3724 /*!********************************************!*\
3725 !*** ./node_modules/lodash/_freeGlobal.js ***!
3726 \********************************************/
3727 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3728
3729 /** Detect free variable `global` from Node.js. */
3730 var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
3731
3732 module.exports = freeGlobal;
3733
3734
3735 /***/ }),
3736
3737 /***/ "./node_modules/lodash/_getRawTag.js":
3738 /*!*******************************************!*\
3739 !*** ./node_modules/lodash/_getRawTag.js ***!
3740 \*******************************************/
3741 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3742
3743 var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");
3744
3745 /** Used for built-in method references. */
3746 var objectProto = Object.prototype;
3747
3748 /** Used to check objects for own properties. */
3749 var hasOwnProperty = objectProto.hasOwnProperty;
3750
3751 /**
3752 * Used to resolve the
3753 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
3754 * of values.
3755 */
3756 var nativeObjectToString = objectProto.toString;
3757
3758 /** Built-in value references. */
3759 var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
3760
3761 /**
3762 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
3763 *
3764 * @private
3765 * @param {*} value The value to query.
3766 * @returns {string} Returns the raw `toStringTag`.
3767 */
3768 function getRawTag(value) {
3769 var isOwn = hasOwnProperty.call(value, symToStringTag),
3770 tag = value[symToStringTag];
3771
3772 try {
3773 value[symToStringTag] = undefined;
3774 var unmasked = true;
3775 } catch (e) {}
3776
3777 var result = nativeObjectToString.call(value);
3778 if (unmasked) {
3779 if (isOwn) {
3780 value[symToStringTag] = tag;
3781 } else {
3782 delete value[symToStringTag];
3783 }
3784 }
3785 return result;
3786 }
3787
3788 module.exports = getRawTag;
3789
3790
3791 /***/ }),
3792
3793 /***/ "./node_modules/lodash/_objectToString.js":
3794 /*!************************************************!*\
3795 !*** ./node_modules/lodash/_objectToString.js ***!
3796 \************************************************/
3797 /***/ ((module) => {
3798
3799 /** Used for built-in method references. */
3800 var objectProto = Object.prototype;
3801
3802 /**
3803 * Used to resolve the
3804 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
3805 * of values.
3806 */
3807 var nativeObjectToString = objectProto.toString;
3808
3809 /**
3810 * Converts `value` to a string using `Object.prototype.toString`.
3811 *
3812 * @private
3813 * @param {*} value The value to convert.
3814 * @returns {string} Returns the converted string.
3815 */
3816 function objectToString(value) {
3817 return nativeObjectToString.call(value);
3818 }
3819
3820 module.exports = objectToString;
3821
3822
3823 /***/ }),
3824
3825 /***/ "./node_modules/lodash/_root.js":
3826 /*!**************************************!*\
3827 !*** ./node_modules/lodash/_root.js ***!
3828 \**************************************/
3829 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3830
3831 var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js");
3832
3833 /** Detect free variable `self`. */
3834 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
3835
3836 /** Used as a reference to the global object. */
3837 var root = freeGlobal || freeSelf || Function('return this')();
3838
3839 module.exports = root;
3840
3841
3842 /***/ }),
3843
3844 /***/ "./node_modules/lodash/_trimmedEndIndex.js":
3845 /*!*************************************************!*\
3846 !*** ./node_modules/lodash/_trimmedEndIndex.js ***!
3847 \*************************************************/
3848 /***/ ((module) => {
3849
3850 /** Used to match a single whitespace character. */
3851 var reWhitespace = /\s/;
3852
3853 /**
3854 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
3855 * character of `string`.
3856 *
3857 * @private
3858 * @param {string} string The string to inspect.
3859 * @returns {number} Returns the index of the last non-whitespace character.
3860 */
3861 function trimmedEndIndex(string) {
3862 var index = string.length;
3863
3864 while (index-- && reWhitespace.test(string.charAt(index))) {}
3865 return index;
3866 }
3867
3868 module.exports = trimmedEndIndex;
3869
3870
3871 /***/ }),
3872
3873 /***/ "./node_modules/lodash/debounce.js":
3874 /*!*****************************************!*\
3875 !*** ./node_modules/lodash/debounce.js ***!
3876 \*****************************************/
3877 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3878
3879 var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
3880 now = __webpack_require__(/*! ./now */ "./node_modules/lodash/now.js"),
3881 toNumber = __webpack_require__(/*! ./toNumber */ "./node_modules/lodash/toNumber.js");
3882
3883 /** Error message constants. */
3884 var FUNC_ERROR_TEXT = 'Expected a function';
3885
3886 /* Built-in method references for those with the same name as other `lodash` methods. */
3887 var nativeMax = Math.max,
3888 nativeMin = Math.min;
3889
3890 /**
3891 * Creates a debounced function that delays invoking `func` until after `wait`
3892 * milliseconds have elapsed since the last time the debounced function was
3893 * invoked. The debounced function comes with a `cancel` method to cancel
3894 * delayed `func` invocations and a `flush` method to immediately invoke them.
3895 * Provide `options` to indicate whether `func` should be invoked on the
3896 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
3897 * with the last arguments provided to the debounced function. Subsequent
3898 * calls to the debounced function return the result of the last `func`
3899 * invocation.
3900 *
3901 * **Note:** If `leading` and `trailing` options are `true`, `func` is
3902 * invoked on the trailing edge of the timeout only if the debounced function
3903 * is invoked more than once during the `wait` timeout.
3904 *
3905 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
3906 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
3907 *
3908 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
3909 * for details over the differences between `_.debounce` and `_.throttle`.
3910 *
3911 * @static
3912 * @memberOf _
3913 * @since 0.1.0
3914 * @category Function
3915 * @param {Function} func The function to debounce.
3916 * @param {number} [wait=0] The number of milliseconds to delay.
3917 * @param {Object} [options={}] The options object.
3918 * @param {boolean} [options.leading=false]
3919 * Specify invoking on the leading edge of the timeout.
3920 * @param {number} [options.maxWait]
3921 * The maximum time `func` is allowed to be delayed before it's invoked.
3922 * @param {boolean} [options.trailing=true]
3923 * Specify invoking on the trailing edge of the timeout.
3924 * @returns {Function} Returns the new debounced function.
3925 * @example
3926 *
3927 * // Avoid costly calculations while the window size is in flux.
3928 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
3929 *
3930 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
3931 * jQuery(element).on('click', _.debounce(sendMail, 300, {
3932 * 'leading': true,
3933 * 'trailing': false
3934 * }));
3935 *
3936 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
3937 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
3938 * var source = new EventSource('/stream');
3939 * jQuery(source).on('message', debounced);
3940 *
3941 * // Cancel the trailing debounced invocation.
3942 * jQuery(window).on('popstate', debounced.cancel);
3943 */
3944 function debounce(func, wait, options) {
3945 var lastArgs,
3946 lastThis,
3947 maxWait,
3948 result,
3949 timerId,
3950 lastCallTime,
3951 lastInvokeTime = 0,
3952 leading = false,
3953 maxing = false,
3954 trailing = true;
3955
3956 if (typeof func != 'function') {
3957 throw new TypeError(FUNC_ERROR_TEXT);
3958 }
3959 wait = toNumber(wait) || 0;
3960 if (isObject(options)) {
3961 leading = !!options.leading;
3962 maxing = 'maxWait' in options;
3963 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
3964 trailing = 'trailing' in options ? !!options.trailing : trailing;
3965 }
3966
3967 function invokeFunc(time) {
3968 var args = lastArgs,
3969 thisArg = lastThis;
3970
3971 lastArgs = lastThis = undefined;
3972 lastInvokeTime = time;
3973 result = func.apply(thisArg, args);
3974 return result;
3975 }
3976
3977 function leadingEdge(time) {
3978 // Reset any `maxWait` timer.
3979 lastInvokeTime = time;
3980 // Start the timer for the trailing edge.
3981 timerId = setTimeout(timerExpired, wait);
3982 // Invoke the leading edge.
3983 return leading ? invokeFunc(time) : result;
3984 }
3985
3986 function remainingWait(time) {
3987 var timeSinceLastCall = time - lastCallTime,
3988 timeSinceLastInvoke = time - lastInvokeTime,
3989 timeWaiting = wait - timeSinceLastCall;
3990
3991 return maxing
3992 ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
3993 : timeWaiting;
3994 }
3995
3996 function shouldInvoke(time) {
3997 var timeSinceLastCall = time - lastCallTime,
3998 timeSinceLastInvoke = time - lastInvokeTime;
3999
4000 // Either this is the first call, activity has stopped and we're at the
4001 // trailing edge, the system time has gone backwards and we're treating
4002 // it as the trailing edge, or we've hit the `maxWait` limit.
4003 return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
4004 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
4005 }
4006
4007 function timerExpired() {
4008 var time = now();
4009 if (shouldInvoke(time)) {
4010 return trailingEdge(time);
4011 }
4012 // Restart the timer.
4013 timerId = setTimeout(timerExpired, remainingWait(time));
4014 }
4015
4016 function trailingEdge(time) {
4017 timerId = undefined;
4018
4019 // Only invoke if we have `lastArgs` which means `func` has been
4020 // debounced at least once.
4021 if (trailing && lastArgs) {
4022 return invokeFunc(time);
4023 }
4024 lastArgs = lastThis = undefined;
4025 return result;
4026 }
4027
4028 function cancel() {
4029 if (timerId !== undefined) {
4030 clearTimeout(timerId);
4031 }
4032 lastInvokeTime = 0;
4033 lastArgs = lastCallTime = lastThis = timerId = undefined;
4034 }
4035
4036 function flush() {
4037 return timerId === undefined ? result : trailingEdge(now());
4038 }
4039
4040 function debounced() {
4041 var time = now(),
4042 isInvoking = shouldInvoke(time);
4043
4044 lastArgs = arguments;
4045 lastThis = this;
4046 lastCallTime = time;
4047
4048 if (isInvoking) {
4049 if (timerId === undefined) {
4050 return leadingEdge(lastCallTime);
4051 }
4052 if (maxing) {
4053 // Handle invocations in a tight loop.
4054 clearTimeout(timerId);
4055 timerId = setTimeout(timerExpired, wait);
4056 return invokeFunc(lastCallTime);
4057 }
4058 }
4059 if (timerId === undefined) {
4060 timerId = setTimeout(timerExpired, wait);
4061 }
4062 return result;
4063 }
4064 debounced.cancel = cancel;
4065 debounced.flush = flush;
4066 return debounced;
4067 }
4068
4069 module.exports = debounce;
4070
4071
4072 /***/ }),
4073
4074 /***/ "./node_modules/lodash/isObject.js":
4075 /*!*****************************************!*\
4076 !*** ./node_modules/lodash/isObject.js ***!
4077 \*****************************************/
4078 /***/ ((module) => {
4079
4080 /**
4081 * Checks if `value` is the
4082 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
4083 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
4084 *
4085 * @static
4086 * @memberOf _
4087 * @since 0.1.0
4088 * @category Lang
4089 * @param {*} value The value to check.
4090 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
4091 * @example
4092 *
4093 * _.isObject({});
4094 * // => true
4095 *
4096 * _.isObject([1, 2, 3]);
4097 * // => true
4098 *
4099 * _.isObject(_.noop);
4100 * // => true
4101 *
4102 * _.isObject(null);
4103 * // => false
4104 */
4105 function isObject(value) {
4106 var type = typeof value;
4107 return value != null && (type == 'object' || type == 'function');
4108 }
4109
4110 module.exports = isObject;
4111
4112
4113 /***/ }),
4114
4115 /***/ "./node_modules/lodash/isObjectLike.js":
4116 /*!*********************************************!*\
4117 !*** ./node_modules/lodash/isObjectLike.js ***!
4118 \*********************************************/
4119 /***/ ((module) => {
4120
4121 /**
4122 * Checks if `value` is object-like. A value is object-like if it's not `null`
4123 * and has a `typeof` result of "object".
4124 *
4125 * @static
4126 * @memberOf _
4127 * @since 4.0.0
4128 * @category Lang
4129 * @param {*} value The value to check.
4130 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
4131 * @example
4132 *
4133 * _.isObjectLike({});
4134 * // => true
4135 *
4136 * _.isObjectLike([1, 2, 3]);
4137 * // => true
4138 *
4139 * _.isObjectLike(_.noop);
4140 * // => false
4141 *
4142 * _.isObjectLike(null);
4143 * // => false
4144 */
4145 function isObjectLike(value) {
4146 return value != null && typeof value == 'object';
4147 }
4148
4149 module.exports = isObjectLike;
4150
4151
4152 /***/ }),
4153
4154 /***/ "./node_modules/lodash/isSymbol.js":
4155 /*!*****************************************!*\
4156 !*** ./node_modules/lodash/isSymbol.js ***!
4157 \*****************************************/
4158 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4159
4160 var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
4161 isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
4162
4163 /** `Object#toString` result references. */
4164 var symbolTag = '[object Symbol]';
4165
4166 /**
4167 * Checks if `value` is classified as a `Symbol` primitive or object.
4168 *
4169 * @static
4170 * @memberOf _
4171 * @since 4.0.0
4172 * @category Lang
4173 * @param {*} value The value to check.
4174 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
4175 * @example
4176 *
4177 * _.isSymbol(Symbol.iterator);
4178 * // => true
4179 *
4180 * _.isSymbol('abc');
4181 * // => false
4182 */
4183 function isSymbol(value) {
4184 return typeof value == 'symbol' ||
4185 (isObjectLike(value) && baseGetTag(value) == symbolTag);
4186 }
4187
4188 module.exports = isSymbol;
4189
4190
4191 /***/ }),
4192
4193 /***/ "./node_modules/lodash/now.js":
4194 /*!************************************!*\
4195 !*** ./node_modules/lodash/now.js ***!
4196 \************************************/
4197 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4198
4199 var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
4200
4201 /**
4202 * Gets the timestamp of the number of milliseconds that have elapsed since
4203 * the Unix epoch (1 January 1970 00:00:00 UTC).
4204 *
4205 * @static
4206 * @memberOf _
4207 * @since 2.4.0
4208 * @category Date
4209 * @returns {number} Returns the timestamp.
4210 * @example
4211 *
4212 * _.defer(function(stamp) {
4213 * console.log(_.now() - stamp);
4214 * }, _.now());
4215 * // => Logs the number of milliseconds it took for the deferred invocation.
4216 */
4217 var now = function() {
4218 return root.Date.now();
4219 };
4220
4221 module.exports = now;
4222
4223
4224 /***/ }),
4225
4226 /***/ "./node_modules/lodash/toNumber.js":
4227 /*!*****************************************!*\
4228 !*** ./node_modules/lodash/toNumber.js ***!
4229 \*****************************************/
4230 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4231
4232 var baseTrim = __webpack_require__(/*! ./_baseTrim */ "./node_modules/lodash/_baseTrim.js"),
4233 isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
4234 isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js");
4235
4236 /** Used as references for various `Number` constants. */
4237 var NAN = 0 / 0;
4238
4239 /** Used to detect bad signed hexadecimal string values. */
4240 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
4241
4242 /** Used to detect binary string values. */
4243 var reIsBinary = /^0b[01]+$/i;
4244
4245 /** Used to detect octal string values. */
4246 var reIsOctal = /^0o[0-7]+$/i;
4247
4248 /** Built-in method references without a dependency on `root`. */
4249 var freeParseInt = parseInt;
4250
4251 /**
4252 * Converts `value` to a number.
4253 *
4254 * @static
4255 * @memberOf _
4256 * @since 4.0.0
4257 * @category Lang
4258 * @param {*} value The value to process.
4259 * @returns {number} Returns the number.
4260 * @example
4261 *
4262 * _.toNumber(3.2);
4263 * // => 3.2
4264 *
4265 * _.toNumber(Number.MIN_VALUE);
4266 * // => 5e-324
4267 *
4268 * _.toNumber(Infinity);
4269 * // => Infinity
4270 *
4271 * _.toNumber('3.2');
4272 * // => 3.2
4273 */
4274 function toNumber(value) {
4275 if (typeof value == 'number') {
4276 return value;
4277 }
4278 if (isSymbol(value)) {
4279 return NAN;
4280 }
4281 if (isObject(value)) {
4282 var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
4283 value = isObject(other) ? (other + '') : other;
4284 }
4285 if (typeof value != 'string') {
4286 return value === 0 ? value : +value;
4287 }
4288 value = baseTrim(value);
4289 var isBinary = reIsBinary.test(value);
4290 return (isBinary || reIsOctal.test(value))
4291 ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
4292 : (reIsBadHex.test(value) ? NAN : +value);
4293 }
4294
4295 module.exports = toNumber;
4296
4297
4298 /***/ }),
4299
4300 /***/ "./node_modules/memoize-one/dist/memoize-one.esm.js":
4301 /*!**********************************************************!*\
4302 !*** ./node_modules/memoize-one/dist/memoize-one.esm.js ***!
4303 \**********************************************************/
4304 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4305
4306 "use strict";
4307 __webpack_require__.r(__webpack_exports__);
4308 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4309 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
4310 /* harmony export */ });
4311 var safeIsNaN = Number.isNaN ||
4312 function ponyfill(value) {
4313 return typeof value === 'number' && value !== value;
4314 };
4315 function isEqual(first, second) {
4316 if (first === second) {
4317 return true;
4318 }
4319 if (safeIsNaN(first) && safeIsNaN(second)) {
4320 return true;
4321 }
4322 return false;
4323 }
4324 function areInputsEqual(newInputs, lastInputs) {
4325 if (newInputs.length !== lastInputs.length) {
4326 return false;
4327 }
4328 for (var i = 0; i < newInputs.length; i++) {
4329 if (!isEqual(newInputs[i], lastInputs[i])) {
4330 return false;
4331 }
4332 }
4333 return true;
4334 }
4335
4336 function memoizeOne(resultFn, isEqual) {
4337 if (isEqual === void 0) { isEqual = areInputsEqual; }
4338 var lastThis;
4339 var lastArgs = [];
4340 var lastResult;
4341 var calledOnce = false;
4342 function memoized() {
4343 var newArgs = [];
4344 for (var _i = 0; _i < arguments.length; _i++) {
4345 newArgs[_i] = arguments[_i];
4346 }
4347 if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
4348 return lastResult;
4349 }
4350 lastResult = resultFn.apply(this, newArgs);
4351 calledOnce = true;
4352 lastThis = this;
4353 lastArgs = newArgs;
4354 return lastResult;
4355 }
4356 return memoized;
4357 }
4358
4359 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoizeOne);
4360
4361
4362 /***/ }),
4363
4364 /***/ "./node_modules/merge-anything/dist/index.esm.js":
4365 /*!*******************************************************!*\
4366 !*** ./node_modules/merge-anything/dist/index.esm.js ***!
4367 \*******************************************************/
4368 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4369
4370 "use strict";
4371 __webpack_require__.r(__webpack_exports__);
4372 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4373 /* harmony export */ "concatArrays": () => (/* binding */ concatArrays),
4374 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
4375 /* harmony export */ "merge": () => (/* binding */ merge)
4376 /* harmony export */ });
4377 /* harmony import */ var is_what__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-what */ "./node_modules/is-what/dist/index.esm.js");
4378
4379
4380 /*! *****************************************************************************
4381 Copyright (c) Microsoft Corporation. All rights reserved.
4382 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4383 this file except in compliance with the License. You may obtain a copy of the
4384 License at http://www.apache.org/licenses/LICENSE-2.0
4385
4386 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4387 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
4388 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
4389 MERCHANTABLITY OR NON-INFRINGEMENT.
4390
4391 See the Apache Version 2.0 License for specific language governing permissions
4392 and limitations under the License.
4393 ***************************************************************************** */
4394
4395 function __spreadArrays() {
4396 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4397 for (var r = Array(s), k = 0, i = 0; i < il; i++)
4398 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
4399 r[k] = a[j];
4400 return r;
4401 }
4402
4403 function assignProp(carry, key, newVal, originalObject) {
4404 var propType = originalObject.propertyIsEnumerable(key)
4405 ? 'enumerable'
4406 : 'nonenumerable';
4407 if (propType === 'enumerable')
4408 carry[key] = newVal;
4409 if (propType === 'nonenumerable') {
4410 Object.defineProperty(carry, key, {
4411 value: newVal,
4412 enumerable: false,
4413 writable: true,
4414 configurable: true
4415 });
4416 }
4417 }
4418 function mergeRecursively(origin, newComer, extensions) {
4419 // work directly on newComer if its not an object
4420 if (!(0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(newComer)) {
4421 // extend merge rules
4422 if (extensions && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(extensions)) {
4423 extensions.forEach(function (extend) {
4424 newComer = extend(origin, newComer);
4425 });
4426 }
4427 return newComer;
4428 }
4429 // define newObject to merge all values upon
4430 var newObject = {};
4431 if ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(origin)) {
4432 var props_1 = Object.getOwnPropertyNames(origin);
4433 var symbols_1 = Object.getOwnPropertySymbols(origin);
4434 newObject = __spreadArrays(props_1, symbols_1).reduce(function (carry, key) {
4435 // @ts-ignore
4436 var targetVal = origin[key];
4437 if ((!(0,is_what__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) && !Object.getOwnPropertyNames(newComer).includes(key)) ||
4438 ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) && !Object.getOwnPropertySymbols(newComer).includes(key))) {
4439 assignProp(carry, key, targetVal, origin);
4440 }
4441 return carry;
4442 }, {});
4443 }
4444 var props = Object.getOwnPropertyNames(newComer);
4445 var symbols = Object.getOwnPropertySymbols(newComer);
4446 var result = __spreadArrays(props, symbols).reduce(function (carry, key) {
4447 // re-define the origin and newComer as targetVal and newVal
4448 var newVal = newComer[key];
4449 var targetVal = ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(origin))
4450 // @ts-ignore
4451 ? origin[key]
4452 : undefined;
4453 // extend merge rules
4454 if (extensions && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(extensions)) {
4455 extensions.forEach(function (extend) {
4456 newVal = extend(targetVal, newVal);
4457 });
4458 }
4459 // When newVal is an object do the merge recursively
4460 if (targetVal !== undefined && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(newVal)) {
4461 newVal = mergeRecursively(targetVal, newVal, extensions);
4462 }
4463 assignProp(carry, key, newVal, newComer);
4464 return carry;
4465 }, newObject);
4466 return result;
4467 }
4468 /**
4469 * Merge anything recursively.
4470 * Objects get merged, special objects (classes etc.) are re-assigned "as is".
4471 * Basic types overwrite objects or other basic types.
4472 *
4473 * @param {(IConfig | any)} origin
4474 * @param {...any[]} newComers
4475 * @returns the result
4476 */
4477 function merge(origin) {
4478 var newComers = [];
4479 for (var _i = 1; _i < arguments.length; _i++) {
4480 newComers[_i - 1] = arguments[_i];
4481 }
4482 var extensions = null;
4483 var base = origin;
4484 if ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(origin) && origin.extensions && Object.keys(origin).length === 1) {
4485 base = {};
4486 extensions = origin.extensions;
4487 }
4488 return newComers.reduce(function (result, newComer) {
4489 return mergeRecursively(result, newComer, extensions);
4490 }, base);
4491 }
4492
4493 function concatArrays(originVal, newVal) {
4494 if ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(originVal) && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(newVal)) {
4495 // concat logic
4496 return originVal.concat(newVal);
4497 }
4498 return newVal; // always return newVal as fallback!!
4499 }
4500
4501 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (merge);
4502
4503
4504
4505 /***/ }),
4506
4507 /***/ "./scripts/gutenberg/UIComponents/UIImage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/gutenberg/UIComponents/UIImage.ts":
4508 /*!****************************************************************************************************************************************************************************************!*\
4509 !*** ./scripts/gutenberg/UIComponents/UIImage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/gutenberg/UIComponents/UIImage.ts ***!
4510 \****************************************************************************************************************************************************************************************/
4511 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4512
4513 "use strict";
4514 __webpack_require__.r(__webpack_exports__);
4515 // extracted by mini-css-extract-plugin
4516
4517
4518 /***/ }),
4519
4520 /***/ "./scripts/shared/Common/AsyncSelect.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/AsyncSelect.tsx":
4521 /*!*******************************************************************************************************************************************************************************!*\
4522 !*** ./scripts/shared/Common/AsyncSelect.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/AsyncSelect.tsx ***!
4523 \*******************************************************************************************************************************************************************************/
4524 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4525
4526 "use strict";
4527 __webpack_require__.r(__webpack_exports__);
4528 // extracted by mini-css-extract-plugin
4529
4530
4531 /***/ }),
4532
4533 /***/ "./scripts/shared/Common/HubspotWrapper.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/HubspotWrapper.ts":
4534 /*!************************************************************************************************************************************************************************************!*\
4535 !*** ./scripts/shared/Common/HubspotWrapper.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/HubspotWrapper.ts ***!
4536 \************************************************************************************************************************************************************************************/
4537 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4538
4539 "use strict";
4540 __webpack_require__.r(__webpack_exports__);
4541 // extracted by mini-css-extract-plugin
4542
4543
4544 /***/ }),
4545
4546 /***/ "./scripts/shared/UIComponents/UIAlert.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIAlert.tsx":
4547 /*!***********************************************************************************************************************************************************************************!*\
4548 !*** ./scripts/shared/UIComponents/UIAlert.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIAlert.tsx ***!
4549 \***********************************************************************************************************************************************************************************/
4550 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4551
4552 "use strict";
4553 __webpack_require__.r(__webpack_exports__);
4554 // extracted by mini-css-extract-plugin
4555
4556
4557 /***/ }),
4558
4559 /***/ "./scripts/shared/UIComponents/UIButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIButton.ts":
4560 /*!************************************************************************************************************************************************************************************!*\
4561 !*** ./scripts/shared/UIComponents/UIButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIButton.ts ***!
4562 \************************************************************************************************************************************************************************************/
4563 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4564
4565 "use strict";
4566 __webpack_require__.r(__webpack_exports__);
4567 // extracted by mini-css-extract-plugin
4568
4569
4570 /***/ }),
4571
4572 /***/ "./scripts/shared/UIComponents/UIContainer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIContainer.ts":
4573 /*!******************************************************************************************************************************************************************************************!*\
4574 !*** ./scripts/shared/UIComponents/UIContainer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIContainer.ts ***!
4575 \******************************************************************************************************************************************************************************************/
4576 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4577
4578 "use strict";
4579 __webpack_require__.r(__webpack_exports__);
4580 // extracted by mini-css-extract-plugin
4581
4582
4583 /***/ }),
4584
4585 /***/ "./scripts/shared/UIComponents/UIOverlay.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIOverlay.ts":
4586 /*!**************************************************************************************************************************************************************************************!*\
4587 !*** ./scripts/shared/UIComponents/UIOverlay.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIOverlay.ts ***!
4588 \**************************************************************************************************************************************************************************************/
4589 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4590
4591 "use strict";
4592 __webpack_require__.r(__webpack_exports__);
4593 // extracted by mini-css-extract-plugin
4594
4595
4596 /***/ }),
4597
4598 /***/ "./scripts/shared/UIComponents/UISpacer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpacer.ts":
4599 /*!************************************************************************************************************************************************************************************!*\
4600 !*** ./scripts/shared/UIComponents/UISpacer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpacer.ts ***!
4601 \************************************************************************************************************************************************************************************/
4602 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4603
4604 "use strict";
4605 __webpack_require__.r(__webpack_exports__);
4606 // extracted by mini-css-extract-plugin
4607
4608
4609 /***/ }),
4610
4611 /***/ "./scripts/shared/UIComponents/UISpinner.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpinner.tsx":
4612 /*!***************************************************************************************************************************************************************************************!*\
4613 !*** ./scripts/shared/UIComponents/UISpinner.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpinner.tsx ***!
4614 \***************************************************************************************************************************************************************************************/
4615 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4616
4617 "use strict";
4618 __webpack_require__.r(__webpack_exports__);
4619 // extracted by mini-css-extract-plugin
4620
4621
4622 /***/ }),
4623
4624 /***/ "./node_modules/object-assign/index.js":
4625 /*!*********************************************!*\
4626 !*** ./node_modules/object-assign/index.js ***!
4627 \*********************************************/
4628 /***/ ((module) => {
4629
4630 "use strict";
4631 /*
4632 object-assign
4633 (c) Sindre Sorhus
4634 @license MIT
4635 */
4636
4637
4638 /* eslint-disable no-unused-vars */
4639 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
4640 var hasOwnProperty = Object.prototype.hasOwnProperty;
4641 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
4642
4643 function toObject(val) {
4644 if (val === null || val === undefined) {
4645 throw new TypeError('Object.assign cannot be called with null or undefined');
4646 }
4647
4648 return Object(val);
4649 }
4650
4651 function shouldUseNative() {
4652 try {
4653 if (!Object.assign) {
4654 return false;
4655 }
4656
4657 // Detect buggy property enumeration order in older V8 versions.
4658
4659 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
4660 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
4661 test1[5] = 'de';
4662 if (Object.getOwnPropertyNames(test1)[0] === '5') {
4663 return false;
4664 }
4665
4666 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
4667 var test2 = {};
4668 for (var i = 0; i < 10; i++) {
4669 test2['_' + String.fromCharCode(i)] = i;
4670 }
4671 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
4672 return test2[n];
4673 });
4674 if (order2.join('') !== '0123456789') {
4675 return false;
4676 }
4677
4678 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
4679 var test3 = {};
4680 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
4681 test3[letter] = letter;
4682 });
4683 if (Object.keys(Object.assign({}, test3)).join('') !==
4684 'abcdefghijklmnopqrst') {
4685 return false;
4686 }
4687
4688 return true;
4689 } catch (err) {
4690 // We don't expect any of the above to throw, but better to be safe.
4691 return false;
4692 }
4693 }
4694
4695 module.exports = shouldUseNative() ? Object.assign : function (target, source) {
4696 var from;
4697 var to = toObject(target);
4698 var symbols;
4699
4700 for (var s = 1; s < arguments.length; s++) {
4701 from = Object(arguments[s]);
4702
4703 for (var key in from) {
4704 if (hasOwnProperty.call(from, key)) {
4705 to[key] = from[key];
4706 }
4707 }
4708
4709 if (getOwnPropertySymbols) {
4710 symbols = getOwnPropertySymbols(from);
4711 for (var i = 0; i < symbols.length; i++) {
4712 if (propIsEnumerable.call(from, symbols[i])) {
4713 to[symbols[i]] = from[symbols[i]];
4714 }
4715 }
4716 }
4717 }
4718
4719 return to;
4720 };
4721
4722
4723 /***/ }),
4724
4725 /***/ "./node_modules/prop-types/checkPropTypes.js":
4726 /*!***************************************************!*\
4727 !*** ./node_modules/prop-types/checkPropTypes.js ***!
4728 \***************************************************/
4729 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4730
4731 "use strict";
4732 /**
4733 * Copyright (c) 2013-present, Facebook, Inc.
4734 *
4735 * This source code is licensed under the MIT license found in the
4736 * LICENSE file in the root directory of this source tree.
4737 */
4738
4739
4740
4741 var printWarning = function() {};
4742
4743 if (true) {
4744 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
4745 var loggedTypeFailures = {};
4746 var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js");
4747
4748 printWarning = function(text) {
4749 var message = 'Warning: ' + text;
4750 if (typeof console !== 'undefined') {
4751 console.error(message);
4752 }
4753 try {
4754 // --- Welcome to debugging React ---
4755 // This error was thrown as a convenience so that you can use this stack
4756 // to find the callsite that caused this warning to fire.
4757 throw new Error(message);
4758 } catch (x) { /**/ }
4759 };
4760 }
4761
4762 /**
4763 * Assert that the values match with the type specs.
4764 * Error messages are memorized and will only be shown once.
4765 *
4766 * @param {object} typeSpecs Map of name to a ReactPropType
4767 * @param {object} values Runtime values that need to be type-checked
4768 * @param {string} location e.g. "prop", "context", "child context"
4769 * @param {string} componentName Name of the component for error messages.
4770 * @param {?Function} getStack Returns the component stack.
4771 * @private
4772 */
4773 function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
4774 if (true) {
4775 for (var typeSpecName in typeSpecs) {
4776 if (has(typeSpecs, typeSpecName)) {
4777 var error;
4778 // Prop type validation may throw. In case they do, we don't want to
4779 // fail the render phase where it didn't fail before. So we log it.
4780 // After these have been cleaned up, we'll let them throw.
4781 try {
4782 // This is intentionally an invariant that gets caught. It's the same
4783 // behavior as without this statement except with a better message.
4784 if (typeof typeSpecs[typeSpecName] !== 'function') {
4785 var err = Error(
4786 (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
4787 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
4788 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
4789 );
4790 err.name = 'Invariant Violation';
4791 throw err;
4792 }
4793 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
4794 } catch (ex) {
4795 error = ex;
4796 }
4797 if (error && !(error instanceof Error)) {
4798 printWarning(
4799 (componentName || 'React class') + ': type specification of ' +
4800 location + ' `' + typeSpecName + '` is invalid; the type checker ' +
4801 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
4802 'You may have forgotten to pass an argument to the type checker ' +
4803 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
4804 'shape all require an argument).'
4805 );
4806 }
4807 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
4808 // Only monitor this failure once because there tends to be a lot of the
4809 // same error.
4810 loggedTypeFailures[error.message] = true;
4811
4812 var stack = getStack ? getStack() : '';
4813
4814 printWarning(
4815 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
4816 );
4817 }
4818 }
4819 }
4820 }
4821 }
4822
4823 /**
4824 * Resets warning cache when testing.
4825 *
4826 * @private
4827 */
4828 checkPropTypes.resetWarningCache = function() {
4829 if (true) {
4830 loggedTypeFailures = {};
4831 }
4832 }
4833
4834 module.exports = checkPropTypes;
4835
4836
4837 /***/ }),
4838
4839 /***/ "./node_modules/prop-types/factoryWithTypeCheckers.js":
4840 /*!************************************************************!*\
4841 !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***!
4842 \************************************************************/
4843 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4844
4845 "use strict";
4846 /**
4847 * Copyright (c) 2013-present, Facebook, Inc.
4848 *
4849 * This source code is licensed under the MIT license found in the
4850 * LICENSE file in the root directory of this source tree.
4851 */
4852
4853
4854
4855 var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
4856 var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
4857
4858 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
4859 var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js");
4860 var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js");
4861
4862 var printWarning = function() {};
4863
4864 if (true) {
4865 printWarning = function(text) {
4866 var message = 'Warning: ' + text;
4867 if (typeof console !== 'undefined') {
4868 console.error(message);
4869 }
4870 try {
4871 // --- Welcome to debugging React ---
4872 // This error was thrown as a convenience so that you can use this stack
4873 // to find the callsite that caused this warning to fire.
4874 throw new Error(message);
4875 } catch (x) {}
4876 };
4877 }
4878
4879 function emptyFunctionThatReturnsNull() {
4880 return null;
4881 }
4882
4883 module.exports = function(isValidElement, throwOnDirectAccess) {
4884 /* global Symbol */
4885 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
4886 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
4887
4888 /**
4889 * Returns the iterator method function contained on the iterable object.
4890 *
4891 * Be sure to invoke the function with the iterable as context:
4892 *
4893 * var iteratorFn = getIteratorFn(myIterable);
4894 * if (iteratorFn) {
4895 * var iterator = iteratorFn.call(myIterable);
4896 * ...
4897 * }
4898 *
4899 * @param {?object} maybeIterable
4900 * @return {?function}
4901 */
4902 function getIteratorFn(maybeIterable) {
4903 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
4904 if (typeof iteratorFn === 'function') {
4905 return iteratorFn;
4906 }
4907 }
4908
4909 /**
4910 * Collection of methods that allow declaration and validation of props that are
4911 * supplied to React components. Example usage:
4912 *
4913 * var Props = require('ReactPropTypes');
4914 * var MyArticle = React.createClass({
4915 * propTypes: {
4916 * // An optional string prop named "description".
4917 * description: Props.string,
4918 *
4919 * // A required enum prop named "category".
4920 * category: Props.oneOf(['News','Photos']).isRequired,
4921 *
4922 * // A prop named "dialog" that requires an instance of Dialog.
4923 * dialog: Props.instanceOf(Dialog).isRequired
4924 * },
4925 * render: function() { ... }
4926 * });
4927 *
4928 * A more formal specification of how these methods are used:
4929 *
4930 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
4931 * decl := ReactPropTypes.{type}(.isRequired)?
4932 *
4933 * Each and every declaration produces a function with the same signature. This
4934 * allows the creation of custom validation functions. For example:
4935 *
4936 * var MyLink = React.createClass({
4937 * propTypes: {
4938 * // An optional string or URI prop named "href".
4939 * href: function(props, propName, componentName) {
4940 * var propValue = props[propName];
4941 * if (propValue != null && typeof propValue !== 'string' &&
4942 * !(propValue instanceof URI)) {
4943 * return new Error(
4944 * 'Expected a string or an URI for ' + propName + ' in ' +
4945 * componentName
4946 * );
4947 * }
4948 * }
4949 * },
4950 * render: function() {...}
4951 * });
4952 *
4953 * @internal
4954 */
4955
4956 var ANONYMOUS = '<<anonymous>>';
4957
4958 // Important!
4959 // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
4960 var ReactPropTypes = {
4961 array: createPrimitiveTypeChecker('array'),
4962 bigint: createPrimitiveTypeChecker('bigint'),
4963 bool: createPrimitiveTypeChecker('boolean'),
4964 func: createPrimitiveTypeChecker('function'),
4965 number: createPrimitiveTypeChecker('number'),
4966 object: createPrimitiveTypeChecker('object'),
4967 string: createPrimitiveTypeChecker('string'),
4968 symbol: createPrimitiveTypeChecker('symbol'),
4969
4970 any: createAnyTypeChecker(),
4971 arrayOf: createArrayOfTypeChecker,
4972 element: createElementTypeChecker(),
4973 elementType: createElementTypeTypeChecker(),
4974 instanceOf: createInstanceTypeChecker,
4975 node: createNodeChecker(),
4976 objectOf: createObjectOfTypeChecker,
4977 oneOf: createEnumTypeChecker,
4978 oneOfType: createUnionTypeChecker,
4979 shape: createShapeTypeChecker,
4980 exact: createStrictShapeTypeChecker,
4981 };
4982
4983 /**
4984 * inlined Object.is polyfill to avoid requiring consumers ship their own
4985 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
4986 */
4987 /*eslint-disable no-self-compare*/
4988 function is(x, y) {
4989 // SameValue algorithm
4990 if (x === y) {
4991 // Steps 1-5, 7-10
4992 // Steps 6.b-6.e: +0 != -0
4993 return x !== 0 || 1 / x === 1 / y;
4994 } else {
4995 // Step 6.a: NaN == NaN
4996 return x !== x && y !== y;
4997 }
4998 }
4999 /*eslint-enable no-self-compare*/
5000
5001 /**
5002 * We use an Error-like object for backward compatibility as people may call
5003 * PropTypes directly and inspect their output. However, we don't use real
5004 * Errors anymore. We don't inspect their stack anyway, and creating them
5005 * is prohibitively expensive if they are created too often, such as what
5006 * happens in oneOfType() for any type before the one that matched.
5007 */
5008 function PropTypeError(message, data) {
5009 this.message = message;
5010 this.data = data && typeof data === 'object' ? data: {};
5011 this.stack = '';
5012 }
5013 // Make `instanceof Error` still work for returned errors.
5014 PropTypeError.prototype = Error.prototype;
5015
5016 function createChainableTypeChecker(validate) {
5017 if (true) {
5018 var manualPropTypeCallCache = {};
5019 var manualPropTypeWarningCount = 0;
5020 }
5021 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
5022 componentName = componentName || ANONYMOUS;
5023 propFullName = propFullName || propName;
5024
5025 if (secret !== ReactPropTypesSecret) {
5026 if (throwOnDirectAccess) {
5027 // New behavior only for users of `prop-types` package
5028 var err = new Error(
5029 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
5030 'Use `PropTypes.checkPropTypes()` to call them. ' +
5031 'Read more at http://fb.me/use-check-prop-types'
5032 );
5033 err.name = 'Invariant Violation';
5034 throw err;
5035 } else if ( true && typeof console !== 'undefined') {
5036 // Old behavior for people using React.PropTypes
5037 var cacheKey = componentName + ':' + propName;
5038 if (
5039 !manualPropTypeCallCache[cacheKey] &&
5040 // Avoid spamming the console because they are often not actionable except for lib authors
5041 manualPropTypeWarningCount < 3
5042 ) {
5043 printWarning(
5044 'You are manually calling a React.PropTypes validation ' +
5045 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
5046 'and will throw in the standalone `prop-types` package. ' +
5047 'You may be seeing this warning due to a third-party PropTypes ' +
5048 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
5049 );
5050 manualPropTypeCallCache[cacheKey] = true;
5051 manualPropTypeWarningCount++;
5052 }
5053 }
5054 }
5055 if (props[propName] == null) {
5056 if (isRequired) {
5057 if (props[propName] === null) {
5058 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
5059 }
5060 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
5061 }
5062 return null;
5063 } else {
5064 return validate(props, propName, componentName, location, propFullName);
5065 }
5066 }
5067
5068 var chainedCheckType = checkType.bind(null, false);
5069 chainedCheckType.isRequired = checkType.bind(null, true);
5070
5071 return chainedCheckType;
5072 }
5073
5074 function createPrimitiveTypeChecker(expectedType) {
5075 function validate(props, propName, componentName, location, propFullName, secret) {
5076 var propValue = props[propName];
5077 var propType = getPropType(propValue);
5078 if (propType !== expectedType) {
5079 // `propValue` being instance of, say, date/regexp, pass the 'object'
5080 // check, but we can offer a more precise error message here rather than
5081 // 'of type `object`'.
5082 var preciseType = getPreciseType(propValue);
5083
5084 return new PropTypeError(
5085 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
5086 {expectedType: expectedType}
5087 );
5088 }
5089 return null;
5090 }
5091 return createChainableTypeChecker(validate);
5092 }
5093
5094 function createAnyTypeChecker() {
5095 return createChainableTypeChecker(emptyFunctionThatReturnsNull);
5096 }
5097
5098 function createArrayOfTypeChecker(typeChecker) {
5099 function validate(props, propName, componentName, location, propFullName) {
5100 if (typeof typeChecker !== 'function') {
5101 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
5102 }
5103 var propValue = props[propName];
5104 if (!Array.isArray(propValue)) {
5105 var propType = getPropType(propValue);
5106 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
5107 }
5108 for (var i = 0; i < propValue.length; i++) {
5109 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
5110 if (error instanceof Error) {
5111 return error;
5112 }
5113 }
5114 return null;
5115 }
5116 return createChainableTypeChecker(validate);
5117 }
5118
5119 function createElementTypeChecker() {
5120 function validate(props, propName, componentName, location, propFullName) {
5121 var propValue = props[propName];
5122 if (!isValidElement(propValue)) {
5123 var propType = getPropType(propValue);
5124 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
5125 }
5126 return null;
5127 }
5128 return createChainableTypeChecker(validate);
5129 }
5130
5131 function createElementTypeTypeChecker() {
5132 function validate(props, propName, componentName, location, propFullName) {
5133 var propValue = props[propName];
5134 if (!ReactIs.isValidElementType(propValue)) {
5135 var propType = getPropType(propValue);
5136 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
5137 }
5138 return null;
5139 }
5140 return createChainableTypeChecker(validate);
5141 }
5142
5143 function createInstanceTypeChecker(expectedClass) {
5144 function validate(props, propName, componentName, location, propFullName) {
5145 if (!(props[propName] instanceof expectedClass)) {
5146 var expectedClassName = expectedClass.name || ANONYMOUS;
5147 var actualClassName = getClassName(props[propName]);
5148 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
5149 }
5150 return null;
5151 }
5152 return createChainableTypeChecker(validate);
5153 }
5154
5155 function createEnumTypeChecker(expectedValues) {
5156 if (!Array.isArray(expectedValues)) {
5157 if (true) {
5158 if (arguments.length > 1) {
5159 printWarning(
5160 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
5161 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
5162 );
5163 } else {
5164 printWarning('Invalid argument supplied to oneOf, expected an array.');
5165 }
5166 }
5167 return emptyFunctionThatReturnsNull;
5168 }
5169
5170 function validate(props, propName, componentName, location, propFullName) {
5171 var propValue = props[propName];
5172 for (var i = 0; i < expectedValues.length; i++) {
5173 if (is(propValue, expectedValues[i])) {
5174 return null;
5175 }
5176 }
5177
5178 var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
5179 var type = getPreciseType(value);
5180 if (type === 'symbol') {
5181 return String(value);
5182 }
5183 return value;
5184 });
5185 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
5186 }
5187 return createChainableTypeChecker(validate);
5188 }
5189
5190 function createObjectOfTypeChecker(typeChecker) {
5191 function validate(props, propName, componentName, location, propFullName) {
5192 if (typeof typeChecker !== 'function') {
5193 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
5194 }
5195 var propValue = props[propName];
5196 var propType = getPropType(propValue);
5197 if (propType !== 'object') {
5198 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
5199 }
5200 for (var key in propValue) {
5201 if (has(propValue, key)) {
5202 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5203 if (error instanceof Error) {
5204 return error;
5205 }
5206 }
5207 }
5208 return null;
5209 }
5210 return createChainableTypeChecker(validate);
5211 }
5212
5213 function createUnionTypeChecker(arrayOfTypeCheckers) {
5214 if (!Array.isArray(arrayOfTypeCheckers)) {
5215 true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0;
5216 return emptyFunctionThatReturnsNull;
5217 }
5218
5219 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
5220 var checker = arrayOfTypeCheckers[i];
5221 if (typeof checker !== 'function') {
5222 printWarning(
5223 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
5224 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
5225 );
5226 return emptyFunctionThatReturnsNull;
5227 }
5228 }
5229
5230 function validate(props, propName, componentName, location, propFullName) {
5231 var expectedTypes = [];
5232 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
5233 var checker = arrayOfTypeCheckers[i];
5234 var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
5235 if (checkerResult == null) {
5236 return null;
5237 }
5238 if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
5239 expectedTypes.push(checkerResult.data.expectedType);
5240 }
5241 }
5242 var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
5243 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
5244 }
5245 return createChainableTypeChecker(validate);
5246 }
5247
5248 function createNodeChecker() {
5249 function validate(props, propName, componentName, location, propFullName) {
5250 if (!isNode(props[propName])) {
5251 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
5252 }
5253 return null;
5254 }
5255 return createChainableTypeChecker(validate);
5256 }
5257
5258 function invalidValidatorError(componentName, location, propFullName, key, type) {
5259 return new PropTypeError(
5260 (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
5261 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
5262 );
5263 }
5264
5265 function createShapeTypeChecker(shapeTypes) {
5266 function validate(props, propName, componentName, location, propFullName) {
5267 var propValue = props[propName];
5268 var propType = getPropType(propValue);
5269 if (propType !== 'object') {
5270 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
5271 }
5272 for (var key in shapeTypes) {
5273 var checker = shapeTypes[key];
5274 if (typeof checker !== 'function') {
5275 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
5276 }
5277 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5278 if (error) {
5279 return error;
5280 }
5281 }
5282 return null;
5283 }
5284 return createChainableTypeChecker(validate);
5285 }
5286
5287 function createStrictShapeTypeChecker(shapeTypes) {
5288 function validate(props, propName, componentName, location, propFullName) {
5289 var propValue = props[propName];
5290 var propType = getPropType(propValue);
5291 if (propType !== 'object') {
5292 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
5293 }
5294 // We need to check all keys in case some are required but missing from props.
5295 var allKeys = assign({}, props[propName], shapeTypes);
5296 for (var key in allKeys) {
5297 var checker = shapeTypes[key];
5298 if (has(shapeTypes, key) && typeof checker !== 'function') {
5299 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
5300 }
5301 if (!checker) {
5302 return new PropTypeError(
5303 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
5304 '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
5305 '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
5306 );
5307 }
5308 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5309 if (error) {
5310 return error;
5311 }
5312 }
5313 return null;
5314 }
5315
5316 return createChainableTypeChecker(validate);
5317 }
5318
5319 function isNode(propValue) {
5320 switch (typeof propValue) {
5321 case 'number':
5322 case 'string':
5323 case 'undefined':
5324 return true;
5325 case 'boolean':
5326 return !propValue;
5327 case 'object':
5328 if (Array.isArray(propValue)) {
5329 return propValue.every(isNode);
5330 }
5331 if (propValue === null || isValidElement(propValue)) {
5332 return true;
5333 }
5334
5335 var iteratorFn = getIteratorFn(propValue);
5336 if (iteratorFn) {
5337 var iterator = iteratorFn.call(propValue);
5338 var step;
5339 if (iteratorFn !== propValue.entries) {
5340 while (!(step = iterator.next()).done) {
5341 if (!isNode(step.value)) {
5342 return false;
5343 }
5344 }
5345 } else {
5346 // Iterator will provide entry [k,v] tuples rather than values.
5347 while (!(step = iterator.next()).done) {
5348 var entry = step.value;
5349 if (entry) {
5350 if (!isNode(entry[1])) {
5351 return false;
5352 }
5353 }
5354 }
5355 }
5356 } else {
5357 return false;
5358 }
5359
5360 return true;
5361 default:
5362 return false;
5363 }
5364 }
5365
5366 function isSymbol(propType, propValue) {
5367 // Native Symbol.
5368 if (propType === 'symbol') {
5369 return true;
5370 }
5371
5372 // falsy value can't be a Symbol
5373 if (!propValue) {
5374 return false;
5375 }
5376
5377 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
5378 if (propValue['@@toStringTag'] === 'Symbol') {
5379 return true;
5380 }
5381
5382 // Fallback for non-spec compliant Symbols which are polyfilled.
5383 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
5384 return true;
5385 }
5386
5387 return false;
5388 }
5389
5390 // Equivalent of `typeof` but with special handling for array and regexp.
5391 function getPropType(propValue) {
5392 var propType = typeof propValue;
5393 if (Array.isArray(propValue)) {
5394 return 'array';
5395 }
5396 if (propValue instanceof RegExp) {
5397 // Old webkits (at least until Android 4.0) return 'function' rather than
5398 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
5399 // passes PropTypes.object.
5400 return 'object';
5401 }
5402 if (isSymbol(propType, propValue)) {
5403 return 'symbol';
5404 }
5405 return propType;
5406 }
5407
5408 // This handles more types than `getPropType`. Only used for error messages.
5409 // See `createPrimitiveTypeChecker`.
5410 function getPreciseType(propValue) {
5411 if (typeof propValue === 'undefined' || propValue === null) {
5412 return '' + propValue;
5413 }
5414 var propType = getPropType(propValue);
5415 if (propType === 'object') {
5416 if (propValue instanceof Date) {
5417 return 'date';
5418 } else if (propValue instanceof RegExp) {
5419 return 'regexp';
5420 }
5421 }
5422 return propType;
5423 }
5424
5425 // Returns a string that is postfixed to a warning about an invalid type.
5426 // For example, "undefined" or "of type array"
5427 function getPostfixForTypeWarning(value) {
5428 var type = getPreciseType(value);
5429 switch (type) {
5430 case 'array':
5431 case 'object':
5432 return 'an ' + type;
5433 case 'boolean':
5434 case 'date':
5435 case 'regexp':
5436 return 'a ' + type;
5437 default:
5438 return type;
5439 }
5440 }
5441
5442 // Returns class name of the object, if any.
5443 function getClassName(propValue) {
5444 if (!propValue.constructor || !propValue.constructor.name) {
5445 return ANONYMOUS;
5446 }
5447 return propValue.constructor.name;
5448 }
5449
5450 ReactPropTypes.checkPropTypes = checkPropTypes;
5451 ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
5452 ReactPropTypes.PropTypes = ReactPropTypes;
5453
5454 return ReactPropTypes;
5455 };
5456
5457
5458 /***/ }),
5459
5460 /***/ "./node_modules/prop-types/index.js":
5461 /*!******************************************!*\
5462 !*** ./node_modules/prop-types/index.js ***!
5463 \******************************************/
5464 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5465
5466 /**
5467 * Copyright (c) 2013-present, Facebook, Inc.
5468 *
5469 * This source code is licensed under the MIT license found in the
5470 * LICENSE file in the root directory of this source tree.
5471 */
5472
5473 if (true) {
5474 var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
5475
5476 // By explicitly using `prop-types` you are opting into new development behavior.
5477 // http://fb.me/prop-types-in-prod
5478 var throwOnDirectAccess = true;
5479 module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess);
5480 } else {}
5481
5482
5483 /***/ }),
5484
5485 /***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js":
5486 /*!*************************************************************!*\
5487 !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
5488 \*************************************************************/
5489 /***/ ((module) => {
5490
5491 "use strict";
5492 /**
5493 * Copyright (c) 2013-present, Facebook, Inc.
5494 *
5495 * This source code is licensed under the MIT license found in the
5496 * LICENSE file in the root directory of this source tree.
5497 */
5498
5499
5500
5501 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
5502
5503 module.exports = ReactPropTypesSecret;
5504
5505
5506 /***/ }),
5507
5508 /***/ "./node_modules/prop-types/lib/has.js":
5509 /*!********************************************!*\
5510 !*** ./node_modules/prop-types/lib/has.js ***!
5511 \********************************************/
5512 /***/ ((module) => {
5513
5514 module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
5515
5516
5517 /***/ }),
5518
5519 /***/ "./node_modules/raven-js/src/configError.js":
5520 /*!**************************************************!*\
5521 !*** ./node_modules/raven-js/src/configError.js ***!
5522 \**************************************************/
5523 /***/ ((module) => {
5524
5525 function RavenConfigError(message) {
5526 this.name = 'RavenConfigError';
5527 this.message = message;
5528 }
5529 RavenConfigError.prototype = new Error();
5530 RavenConfigError.prototype.constructor = RavenConfigError;
5531
5532 module.exports = RavenConfigError;
5533
5534
5535 /***/ }),
5536
5537 /***/ "./node_modules/raven-js/src/console.js":
5538 /*!**********************************************!*\
5539 !*** ./node_modules/raven-js/src/console.js ***!
5540 \**********************************************/
5541 /***/ ((module) => {
5542
5543 var wrapMethod = function(console, level, callback) {
5544 var originalConsoleLevel = console[level];
5545 var originalConsole = console;
5546
5547 if (!(level in console)) {
5548 return;
5549 }
5550
5551 var sentryLevel = level === 'warn' ? 'warning' : level;
5552
5553 console[level] = function() {
5554 var args = [].slice.call(arguments);
5555
5556 var msg = '' + args.join(' ');
5557 var data = {level: sentryLevel, logger: 'console', extra: {arguments: args}};
5558
5559 if (level === 'assert') {
5560 if (args[0] === false) {
5561 // Default browsers message
5562 msg = 'Assertion failed: ' + (args.slice(1).join(' ') || 'console.assert');
5563 data.extra.arguments = args.slice(1);
5564 callback && callback(msg, data);
5565 }
5566 } else {
5567 callback && callback(msg, data);
5568 }
5569
5570 // this fails for some browsers. :(
5571 if (originalConsoleLevel) {
5572 // IE9 doesn't allow calling apply on console functions directly
5573 // See: https://stackoverflow.com/questions/5472938/does-ie9-support-console-log-and-is-it-a-real-function#answer-5473193
5574 Function.prototype.apply.call(originalConsoleLevel, originalConsole, args);
5575 }
5576 };
5577 };
5578
5579 module.exports = {
5580 wrapMethod: wrapMethod
5581 };
5582
5583
5584 /***/ }),
5585
5586 /***/ "./node_modules/raven-js/src/raven.js":
5587 /*!********************************************!*\
5588 !*** ./node_modules/raven-js/src/raven.js ***!
5589 \********************************************/
5590 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5591
5592 /*global XDomainRequest:false */
5593
5594 var TraceKit = __webpack_require__(/*! ../vendor/TraceKit/tracekit */ "./node_modules/raven-js/vendor/TraceKit/tracekit.js");
5595 var stringify = __webpack_require__(/*! ../vendor/json-stringify-safe/stringify */ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js");
5596 var RavenConfigError = __webpack_require__(/*! ./configError */ "./node_modules/raven-js/src/configError.js");
5597
5598 var utils = __webpack_require__(/*! ./utils */ "./node_modules/raven-js/src/utils.js");
5599 var isError = utils.isError;
5600 var isObject = utils.isObject;
5601 var isObject = utils.isObject;
5602 var isErrorEvent = utils.isErrorEvent;
5603 var isUndefined = utils.isUndefined;
5604 var isFunction = utils.isFunction;
5605 var isString = utils.isString;
5606 var isEmptyObject = utils.isEmptyObject;
5607 var each = utils.each;
5608 var objectMerge = utils.objectMerge;
5609 var truncate = utils.truncate;
5610 var objectFrozen = utils.objectFrozen;
5611 var hasKey = utils.hasKey;
5612 var joinRegExp = utils.joinRegExp;
5613 var urlencode = utils.urlencode;
5614 var uuid4 = utils.uuid4;
5615 var htmlTreeAsString = utils.htmlTreeAsString;
5616 var isSameException = utils.isSameException;
5617 var isSameStacktrace = utils.isSameStacktrace;
5618 var parseUrl = utils.parseUrl;
5619 var fill = utils.fill;
5620
5621 var wrapConsoleMethod = (__webpack_require__(/*! ./console */ "./node_modules/raven-js/src/console.js").wrapMethod);
5622
5623 var dsnKeys = 'source protocol user pass host port path'.split(' '),
5624 dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;
5625
5626 function now() {
5627 return +new Date();
5628 }
5629
5630 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
5631 var _window =
5632 typeof window !== 'undefined'
5633 ? window
5634 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
5635 var _document = _window.document;
5636 var _navigator = _window.navigator;
5637
5638 function keepOriginalCallback(original, callback) {
5639 return isFunction(callback)
5640 ? function(data) {
5641 return callback(data, original);
5642 }
5643 : callback;
5644 }
5645
5646 // First, check for JSON support
5647 // If there is no JSON, we no-op the core features of Raven
5648 // since JSON is required to encode the payload
5649 function Raven() {
5650 this._hasJSON = !!(typeof JSON === 'object' && JSON.stringify);
5651 // Raven can run in contexts where there's no document (react-native)
5652 this._hasDocument = !isUndefined(_document);
5653 this._hasNavigator = !isUndefined(_navigator);
5654 this._lastCapturedException = null;
5655 this._lastData = null;
5656 this._lastEventId = null;
5657 this._globalServer = null;
5658 this._globalKey = null;
5659 this._globalProject = null;
5660 this._globalContext = {};
5661 this._globalOptions = {
5662 logger: 'javascript',
5663 ignoreErrors: [],
5664 ignoreUrls: [],
5665 whitelistUrls: [],
5666 includePaths: [],
5667 collectWindowErrors: true,
5668 maxMessageLength: 0,
5669
5670 // By default, truncates URL values to 250 chars
5671 maxUrlLength: 250,
5672 stackTraceLimit: 50,
5673 autoBreadcrumbs: true,
5674 instrument: true,
5675 sampleRate: 1
5676 };
5677 this._ignoreOnError = 0;
5678 this._isRavenInstalled = false;
5679 this._originalErrorStackTraceLimit = Error.stackTraceLimit;
5680 // capture references to window.console *and* all its methods first
5681 // before the console plugin has a chance to monkey patch
5682 this._originalConsole = _window.console || {};
5683 this._originalConsoleMethods = {};
5684 this._plugins = [];
5685 this._startTime = now();
5686 this._wrappedBuiltIns = [];
5687 this._breadcrumbs = [];
5688 this._lastCapturedEvent = null;
5689 this._keypressTimeout;
5690 this._location = _window.location;
5691 this._lastHref = this._location && this._location.href;
5692 this._resetBackoff();
5693
5694 // eslint-disable-next-line guard-for-in
5695 for (var method in this._originalConsole) {
5696 this._originalConsoleMethods[method] = this._originalConsole[method];
5697 }
5698 }
5699
5700 /*
5701 * The core Raven singleton
5702 *
5703 * @this {Raven}
5704 */
5705
5706 Raven.prototype = {
5707 // Hardcode version string so that raven source can be loaded directly via
5708 // webpack (using a build step causes webpack #1617). Grunt verifies that
5709 // this value matches package.json during build.
5710 // See: https://github.com/getsentry/raven-js/issues/465
5711 VERSION: '3.19.1',
5712
5713 debug: false,
5714
5715 TraceKit: TraceKit, // alias to TraceKit
5716
5717 /*
5718 * Configure Raven with a DSN and extra options
5719 *
5720 * @param {string} dsn The public Sentry DSN
5721 * @param {object} options Set of global options [optional]
5722 * @return {Raven}
5723 */
5724 config: function(dsn, options) {
5725 var self = this;
5726
5727 if (self._globalServer) {
5728 this._logDebug('error', 'Error: Raven has already been configured');
5729 return self;
5730 }
5731 if (!dsn) return self;
5732
5733 var globalOptions = self._globalOptions;
5734
5735 // merge in options
5736 if (options) {
5737 each(options, function(key, value) {
5738 // tags and extra are special and need to be put into context
5739 if (key === 'tags' || key === 'extra' || key === 'user') {
5740 self._globalContext[key] = value;
5741 } else {
5742 globalOptions[key] = value;
5743 }
5744 });
5745 }
5746
5747 self.setDSN(dsn);
5748
5749 // "Script error." is hard coded into browsers for errors that it can't read.
5750 // this is the result of a script being pulled in from an external domain and CORS.
5751 globalOptions.ignoreErrors.push(/^Script error\.?$/);
5752 globalOptions.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/);
5753
5754 // join regexp rules into one big rule
5755 globalOptions.ignoreErrors = joinRegExp(globalOptions.ignoreErrors);
5756 globalOptions.ignoreUrls = globalOptions.ignoreUrls.length
5757 ? joinRegExp(globalOptions.ignoreUrls)
5758 : false;
5759 globalOptions.whitelistUrls = globalOptions.whitelistUrls.length
5760 ? joinRegExp(globalOptions.whitelistUrls)
5761 : false;
5762 globalOptions.includePaths = joinRegExp(globalOptions.includePaths);
5763 globalOptions.maxBreadcrumbs = Math.max(
5764 0,
5765 Math.min(globalOptions.maxBreadcrumbs || 100, 100)
5766 ); // default and hard limit is 100
5767
5768 var autoBreadcrumbDefaults = {
5769 xhr: true,
5770 console: true,
5771 dom: true,
5772 location: true
5773 };
5774
5775 var autoBreadcrumbs = globalOptions.autoBreadcrumbs;
5776 if ({}.toString.call(autoBreadcrumbs) === '[object Object]') {
5777 autoBreadcrumbs = objectMerge(autoBreadcrumbDefaults, autoBreadcrumbs);
5778 } else if (autoBreadcrumbs !== false) {
5779 autoBreadcrumbs = autoBreadcrumbDefaults;
5780 }
5781 globalOptions.autoBreadcrumbs = autoBreadcrumbs;
5782
5783 var instrumentDefaults = {
5784 tryCatch: true
5785 };
5786
5787 var instrument = globalOptions.instrument;
5788 if ({}.toString.call(instrument) === '[object Object]') {
5789 instrument = objectMerge(instrumentDefaults, instrument);
5790 } else if (instrument !== false) {
5791 instrument = instrumentDefaults;
5792 }
5793 globalOptions.instrument = instrument;
5794
5795 TraceKit.collectWindowErrors = !!globalOptions.collectWindowErrors;
5796
5797 // return for chaining
5798 return self;
5799 },
5800
5801 /*
5802 * Installs a global window.onerror error handler
5803 * to capture and report uncaught exceptions.
5804 * At this point, install() is required to be called due
5805 * to the way TraceKit is set up.
5806 *
5807 * @return {Raven}
5808 */
5809 install: function() {
5810 var self = this;
5811 if (self.isSetup() && !self._isRavenInstalled) {
5812 TraceKit.report.subscribe(function() {
5813 self._handleOnErrorStackInfo.apply(self, arguments);
5814 });
5815 if (self._globalOptions.instrument && self._globalOptions.instrument.tryCatch) {
5816 self._instrumentTryCatch();
5817 }
5818
5819 if (self._globalOptions.autoBreadcrumbs) self._instrumentBreadcrumbs();
5820
5821 // Install all of the plugins
5822 self._drainPlugins();
5823
5824 self._isRavenInstalled = true;
5825 }
5826
5827 Error.stackTraceLimit = self._globalOptions.stackTraceLimit;
5828 return this;
5829 },
5830
5831 /*
5832 * Set the DSN (can be called multiple time unlike config)
5833 *
5834 * @param {string} dsn The public Sentry DSN
5835 */
5836 setDSN: function(dsn) {
5837 var self = this,
5838 uri = self._parseDSN(dsn),
5839 lastSlash = uri.path.lastIndexOf('/'),
5840 path = uri.path.substr(1, lastSlash);
5841
5842 self._dsn = dsn;
5843 self._globalKey = uri.user;
5844 self._globalSecret = uri.pass && uri.pass.substr(1);
5845 self._globalProject = uri.path.substr(lastSlash + 1);
5846
5847 self._globalServer = self._getGlobalServer(uri);
5848
5849 self._globalEndpoint =
5850 self._globalServer + '/' + path + 'api/' + self._globalProject + '/store/';
5851
5852 // Reset backoff state since we may be pointing at a
5853 // new project/server
5854 this._resetBackoff();
5855 },
5856
5857 /*
5858 * Wrap code within a context so Raven can capture errors
5859 * reliably across domains that is executed immediately.
5860 *
5861 * @param {object} options A specific set of options for this context [optional]
5862 * @param {function} func The callback to be immediately executed within the context
5863 * @param {array} args An array of arguments to be called with the callback [optional]
5864 */
5865 context: function(options, func, args) {
5866 if (isFunction(options)) {
5867 args = func || [];
5868 func = options;
5869 options = undefined;
5870 }
5871
5872 return this.wrap(options, func).apply(this, args);
5873 },
5874
5875 /*
5876 * Wrap code within a context and returns back a new function to be executed
5877 *
5878 * @param {object} options A specific set of options for this context [optional]
5879 * @param {function} func The function to be wrapped in a new context
5880 * @param {function} func A function to call before the try/catch wrapper [optional, private]
5881 * @return {function} The newly wrapped functions with a context
5882 */
5883 wrap: function(options, func, _before) {
5884 var self = this;
5885 // 1 argument has been passed, and it's not a function
5886 // so just return it
5887 if (isUndefined(func) && !isFunction(options)) {
5888 return options;
5889 }
5890
5891 // options is optional
5892 if (isFunction(options)) {
5893 func = options;
5894 options = undefined;
5895 }
5896
5897 // At this point, we've passed along 2 arguments, and the second one
5898 // is not a function either, so we'll just return the second argument.
5899 if (!isFunction(func)) {
5900 return func;
5901 }
5902
5903 // We don't wanna wrap it twice!
5904 try {
5905 if (func.__raven__) {
5906 return func;
5907 }
5908
5909 // If this has already been wrapped in the past, return that
5910 if (func.__raven_wrapper__) {
5911 return func.__raven_wrapper__;
5912 }
5913 } catch (e) {
5914 // Just accessing custom props in some Selenium environments
5915 // can cause a "Permission denied" exception (see raven-js#495).
5916 // Bail on wrapping and return the function as-is (defers to window.onerror).
5917 return func;
5918 }
5919
5920 function wrapped() {
5921 var args = [],
5922 i = arguments.length,
5923 deep = !options || (options && options.deep !== false);
5924
5925 if (_before && isFunction(_before)) {
5926 _before.apply(this, arguments);
5927 }
5928
5929 // Recursively wrap all of a function's arguments that are
5930 // functions themselves.
5931 while (i--) args[i] = deep ? self.wrap(options, arguments[i]) : arguments[i];
5932
5933 try {
5934 // Attempt to invoke user-land function
5935 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
5936 // means Raven caught an error invoking your application code. This is
5937 // expected behavior and NOT indicative of a bug with Raven.js.
5938 return func.apply(this, args);
5939 } catch (e) {
5940 self._ignoreNextOnError();
5941 self.captureException(e, options);
5942 throw e;
5943 }
5944 }
5945
5946 // copy over properties of the old function
5947 for (var property in func) {
5948 if (hasKey(func, property)) {
5949 wrapped[property] = func[property];
5950 }
5951 }
5952 wrapped.prototype = func.prototype;
5953
5954 func.__raven_wrapper__ = wrapped;
5955 // Signal that this function has been wrapped already
5956 // for both debugging and to prevent it to being wrapped twice
5957 wrapped.__raven__ = true;
5958 wrapped.__inner__ = func;
5959
5960 return wrapped;
5961 },
5962
5963 /*
5964 * Uninstalls the global error handler.
5965 *
5966 * @return {Raven}
5967 */
5968 uninstall: function() {
5969 TraceKit.report.uninstall();
5970
5971 this._restoreBuiltIns();
5972
5973 Error.stackTraceLimit = this._originalErrorStackTraceLimit;
5974 this._isRavenInstalled = false;
5975
5976 return this;
5977 },
5978
5979 /*
5980 * Manually capture an exception and send it over to Sentry
5981 *
5982 * @param {error} ex An exception to be logged
5983 * @param {object} options A specific set of options for this error [optional]
5984 * @return {Raven}
5985 */
5986 captureException: function(ex, options) {
5987 // Cases for sending ex as a message, rather than an exception
5988 var isNotError = !isError(ex);
5989 var isNotErrorEvent = !isErrorEvent(ex);
5990 var isErrorEventWithoutError = isErrorEvent(ex) && !ex.error;
5991
5992 if ((isNotError && isNotErrorEvent) || isErrorEventWithoutError) {
5993 return this.captureMessage(
5994 ex,
5995 objectMerge(
5996 {
5997 trimHeadFrames: 1,
5998 stacktrace: true // if we fall back to captureMessage, default to attempting a new trace
5999 },
6000 options
6001 )
6002 );
6003 }
6004
6005 // Get actual Error from ErrorEvent
6006 if (isErrorEvent(ex)) ex = ex.error;
6007
6008 // Store the raw exception object for potential debugging and introspection
6009 this._lastCapturedException = ex;
6010
6011 // TraceKit.report will re-raise any exception passed to it,
6012 // which means you have to wrap it in try/catch. Instead, we
6013 // can wrap it here and only re-raise if TraceKit.report
6014 // raises an exception different from the one we asked to
6015 // report on.
6016 try {
6017 var stack = TraceKit.computeStackTrace(ex);
6018 this._handleStackInfo(stack, options);
6019 } catch (ex1) {
6020 if (ex !== ex1) {
6021 throw ex1;
6022 }
6023 }
6024
6025 return this;
6026 },
6027
6028 /*
6029 * Manually send a message to Sentry
6030 *
6031 * @param {string} msg A plain message to be captured in Sentry
6032 * @param {object} options A specific set of options for this message [optional]
6033 * @return {Raven}
6034 */
6035 captureMessage: function(msg, options) {
6036 // config() automagically converts ignoreErrors from a list to a RegExp so we need to test for an
6037 // early call; we'll error on the side of logging anything called before configuration since it's
6038 // probably something you should see:
6039 if (
6040 !!this._globalOptions.ignoreErrors.test &&
6041 this._globalOptions.ignoreErrors.test(msg)
6042 ) {
6043 return;
6044 }
6045
6046 options = options || {};
6047
6048 var data = objectMerge(
6049 {
6050 message: msg + '' // Make sure it's actually a string
6051 },
6052 options
6053 );
6054
6055 var ex;
6056 // Generate a "synthetic" stack trace from this point.
6057 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it is NOT indicative
6058 // of a bug with Raven.js. Sentry generates synthetic traces either by configuration,
6059 // or if it catches a thrown object without a "stack" property.
6060 try {
6061 throw new Error(msg);
6062 } catch (ex1) {
6063 ex = ex1;
6064 }
6065
6066 // null exception name so `Error` isn't prefixed to msg
6067 ex.name = null;
6068 var stack = TraceKit.computeStackTrace(ex);
6069
6070 // stack[0] is `throw new Error(msg)` call itself, we are interested in the frame that was just before that, stack[1]
6071 var initialCall = stack.stack[1];
6072
6073 var fileurl = (initialCall && initialCall.url) || '';
6074
6075 if (
6076 !!this._globalOptions.ignoreUrls.test &&
6077 this._globalOptions.ignoreUrls.test(fileurl)
6078 ) {
6079 return;
6080 }
6081
6082 if (
6083 !!this._globalOptions.whitelistUrls.test &&
6084 !this._globalOptions.whitelistUrls.test(fileurl)
6085 ) {
6086 return;
6087 }
6088
6089 if (this._globalOptions.stacktrace || (options && options.stacktrace)) {
6090 options = objectMerge(
6091 {
6092 // fingerprint on msg, not stack trace (legacy behavior, could be
6093 // revisited)
6094 fingerprint: msg,
6095 // since we know this is a synthetic trace, the top N-most frames
6096 // MUST be from Raven.js, so mark them as in_app later by setting
6097 // trimHeadFrames
6098 trimHeadFrames: (options.trimHeadFrames || 0) + 1
6099 },
6100 options
6101 );
6102
6103 var frames = this._prepareFrames(stack, options);
6104 data.stacktrace = {
6105 // Sentry expects frames oldest to newest
6106 frames: frames.reverse()
6107 };
6108 }
6109
6110 // Fire away!
6111 this._send(data);
6112
6113 return this;
6114 },
6115
6116 captureBreadcrumb: function(obj) {
6117 var crumb = objectMerge(
6118 {
6119 timestamp: now() / 1000
6120 },
6121 obj
6122 );
6123
6124 if (isFunction(this._globalOptions.breadcrumbCallback)) {
6125 var result = this._globalOptions.breadcrumbCallback(crumb);
6126
6127 if (isObject(result) && !isEmptyObject(result)) {
6128 crumb = result;
6129 } else if (result === false) {
6130 return this;
6131 }
6132 }
6133
6134 this._breadcrumbs.push(crumb);
6135 if (this._breadcrumbs.length > this._globalOptions.maxBreadcrumbs) {
6136 this._breadcrumbs.shift();
6137 }
6138 return this;
6139 },
6140
6141 addPlugin: function(plugin /*arg1, arg2, ... argN*/) {
6142 var pluginArgs = [].slice.call(arguments, 1);
6143
6144 this._plugins.push([plugin, pluginArgs]);
6145 if (this._isRavenInstalled) {
6146 this._drainPlugins();
6147 }
6148
6149 return this;
6150 },
6151
6152 /*
6153 * Set/clear a user to be sent along with the payload.
6154 *
6155 * @param {object} user An object representing user data [optional]
6156 * @return {Raven}
6157 */
6158 setUserContext: function(user) {
6159 // Intentionally do not merge here since that's an unexpected behavior.
6160 this._globalContext.user = user;
6161
6162 return this;
6163 },
6164
6165 /*
6166 * Merge extra attributes to be sent along with the payload.
6167 *
6168 * @param {object} extra An object representing extra data [optional]
6169 * @return {Raven}
6170 */
6171 setExtraContext: function(extra) {
6172 this._mergeContext('extra', extra);
6173
6174 return this;
6175 },
6176
6177 /*
6178 * Merge tags to be sent along with the payload.
6179 *
6180 * @param {object} tags An object representing tags [optional]
6181 * @return {Raven}
6182 */
6183 setTagsContext: function(tags) {
6184 this._mergeContext('tags', tags);
6185
6186 return this;
6187 },
6188
6189 /*
6190 * Clear all of the context.
6191 *
6192 * @return {Raven}
6193 */
6194 clearContext: function() {
6195 this._globalContext = {};
6196
6197 return this;
6198 },
6199
6200 /*
6201 * Get a copy of the current context. This cannot be mutated.
6202 *
6203 * @return {object} copy of context
6204 */
6205 getContext: function() {
6206 // lol javascript
6207 return JSON.parse(stringify(this._globalContext));
6208 },
6209
6210 /*
6211 * Set environment of application
6212 *
6213 * @param {string} environment Typically something like 'production'.
6214 * @return {Raven}
6215 */
6216 setEnvironment: function(environment) {
6217 this._globalOptions.environment = environment;
6218
6219 return this;
6220 },
6221
6222 /*
6223 * Set release version of application
6224 *
6225 * @param {string} release Typically something like a git SHA to identify version
6226 * @return {Raven}
6227 */
6228 setRelease: function(release) {
6229 this._globalOptions.release = release;
6230
6231 return this;
6232 },
6233
6234 /*
6235 * Set the dataCallback option
6236 *
6237 * @param {function} callback The callback to run which allows the
6238 * data blob to be mutated before sending
6239 * @return {Raven}
6240 */
6241 setDataCallback: function(callback) {
6242 var original = this._globalOptions.dataCallback;
6243 this._globalOptions.dataCallback = keepOriginalCallback(original, callback);
6244 return this;
6245 },
6246
6247 /*
6248 * Set the breadcrumbCallback option
6249 *
6250 * @param {function} callback The callback to run which allows filtering
6251 * or mutating breadcrumbs
6252 * @return {Raven}
6253 */
6254 setBreadcrumbCallback: function(callback) {
6255 var original = this._globalOptions.breadcrumbCallback;
6256 this._globalOptions.breadcrumbCallback = keepOriginalCallback(original, callback);
6257 return this;
6258 },
6259
6260 /*
6261 * Set the shouldSendCallback option
6262 *
6263 * @param {function} callback The callback to run which allows
6264 * introspecting the blob before sending
6265 * @return {Raven}
6266 */
6267 setShouldSendCallback: function(callback) {
6268 var original = this._globalOptions.shouldSendCallback;
6269 this._globalOptions.shouldSendCallback = keepOriginalCallback(original, callback);
6270 return this;
6271 },
6272
6273 /**
6274 * Override the default HTTP transport mechanism that transmits data
6275 * to the Sentry server.
6276 *
6277 * @param {function} transport Function invoked instead of the default
6278 * `makeRequest` handler.
6279 *
6280 * @return {Raven}
6281 */
6282 setTransport: function(transport) {
6283 this._globalOptions.transport = transport;
6284
6285 return this;
6286 },
6287
6288 /*
6289 * Get the latest raw exception that was captured by Raven.
6290 *
6291 * @return {error}
6292 */
6293 lastException: function() {
6294 return this._lastCapturedException;
6295 },
6296
6297 /*
6298 * Get the last event id
6299 *
6300 * @return {string}
6301 */
6302 lastEventId: function() {
6303 return this._lastEventId;
6304 },
6305
6306 /*
6307 * Determine if Raven is setup and ready to go.
6308 *
6309 * @return {boolean}
6310 */
6311 isSetup: function() {
6312 if (!this._hasJSON) return false; // needs JSON support
6313 if (!this._globalServer) {
6314 if (!this.ravenNotConfiguredError) {
6315 this.ravenNotConfiguredError = true;
6316 this._logDebug('error', 'Error: Raven has not been configured.');
6317 }
6318 return false;
6319 }
6320 return true;
6321 },
6322
6323 afterLoad: function() {
6324 // TODO: remove window dependence?
6325
6326 // Attempt to initialize Raven on load
6327 var RavenConfig = _window.RavenConfig;
6328 if (RavenConfig) {
6329 this.config(RavenConfig.dsn, RavenConfig.config).install();
6330 }
6331 },
6332
6333 showReportDialog: function(options) {
6334 if (
6335 !_document // doesn't work without a document (React native)
6336 )
6337 return;
6338
6339 options = options || {};
6340
6341 var lastEventId = options.eventId || this.lastEventId();
6342 if (!lastEventId) {
6343 throw new RavenConfigError('Missing eventId');
6344 }
6345
6346 var dsn = options.dsn || this._dsn;
6347 if (!dsn) {
6348 throw new RavenConfigError('Missing DSN');
6349 }
6350
6351 var encode = encodeURIComponent;
6352 var qs = '';
6353 qs += '?eventId=' + encode(lastEventId);
6354 qs += '&dsn=' + encode(dsn);
6355
6356 var user = options.user || this._globalContext.user;
6357 if (user) {
6358 if (user.name) qs += '&name=' + encode(user.name);
6359 if (user.email) qs += '&email=' + encode(user.email);
6360 }
6361
6362 var globalServer = this._getGlobalServer(this._parseDSN(dsn));
6363
6364 var script = _document.createElement('script');
6365 script.async = true;
6366 script.src = globalServer + '/api/embed/error-page/' + qs;
6367 (_document.head || _document.body).appendChild(script);
6368 },
6369
6370 /**** Private functions ****/
6371 _ignoreNextOnError: function() {
6372 var self = this;
6373 this._ignoreOnError += 1;
6374 setTimeout(function() {
6375 // onerror should trigger before setTimeout
6376 self._ignoreOnError -= 1;
6377 });
6378 },
6379
6380 _triggerEvent: function(eventType, options) {
6381 // NOTE: `event` is a native browser thing, so let's avoid conflicting wiht it
6382 var evt, key;
6383
6384 if (!this._hasDocument) return;
6385
6386 options = options || {};
6387
6388 eventType = 'raven' + eventType.substr(0, 1).toUpperCase() + eventType.substr(1);
6389
6390 if (_document.createEvent) {
6391 evt = _document.createEvent('HTMLEvents');
6392 evt.initEvent(eventType, true, true);
6393 } else {
6394 evt = _document.createEventObject();
6395 evt.eventType = eventType;
6396 }
6397
6398 for (key in options)
6399 if (hasKey(options, key)) {
6400 evt[key] = options[key];
6401 }
6402
6403 if (_document.createEvent) {
6404 // IE9 if standards
6405 _document.dispatchEvent(evt);
6406 } else {
6407 // IE8 regardless of Quirks or Standards
6408 // IE9 if quirks
6409 try {
6410 _document.fireEvent('on' + evt.eventType.toLowerCase(), evt);
6411 } catch (e) {
6412 // Do nothing
6413 }
6414 }
6415 },
6416
6417 /**
6418 * Wraps addEventListener to capture UI breadcrumbs
6419 * @param evtName the event name (e.g. "click")
6420 * @returns {Function}
6421 * @private
6422 */
6423 _breadcrumbEventHandler: function(evtName) {
6424 var self = this;
6425 return function(evt) {
6426 // reset keypress timeout; e.g. triggering a 'click' after
6427 // a 'keypress' will reset the keypress debounce so that a new
6428 // set of keypresses can be recorded
6429 self._keypressTimeout = null;
6430
6431 // It's possible this handler might trigger multiple times for the same
6432 // event (e.g. event propagation through node ancestors). Ignore if we've
6433 // already captured the event.
6434 if (self._lastCapturedEvent === evt) return;
6435
6436 self._lastCapturedEvent = evt;
6437
6438 // try/catch both:
6439 // - accessing evt.target (see getsentry/raven-js#838, #768)
6440 // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
6441 // can throw an exception in some circumstances.
6442 var target;
6443 try {
6444 target = htmlTreeAsString(evt.target);
6445 } catch (e) {
6446 target = '<unknown>';
6447 }
6448
6449 self.captureBreadcrumb({
6450 category: 'ui.' + evtName, // e.g. ui.click, ui.input
6451 message: target
6452 });
6453 };
6454 },
6455
6456 /**
6457 * Wraps addEventListener to capture keypress UI events
6458 * @returns {Function}
6459 * @private
6460 */
6461 _keypressEventHandler: function() {
6462 var self = this,
6463 debounceDuration = 1000; // milliseconds
6464
6465 // TODO: if somehow user switches keypress target before
6466 // debounce timeout is triggered, we will only capture
6467 // a single breadcrumb from the FIRST target (acceptable?)
6468 return function(evt) {
6469 var target;
6470 try {
6471 target = evt.target;
6472 } catch (e) {
6473 // just accessing event properties can throw an exception in some rare circumstances
6474 // see: https://github.com/getsentry/raven-js/issues/838
6475 return;
6476 }
6477 var tagName = target && target.tagName;
6478
6479 // only consider keypress events on actual input elements
6480 // this will disregard keypresses targeting body (e.g. tabbing
6481 // through elements, hotkeys, etc)
6482 if (
6483 !tagName ||
6484 (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !target.isContentEditable)
6485 )
6486 return;
6487
6488 // record first keypress in a series, but ignore subsequent
6489 // keypresses until debounce clears
6490 var timeout = self._keypressTimeout;
6491 if (!timeout) {
6492 self._breadcrumbEventHandler('input')(evt);
6493 }
6494 clearTimeout(timeout);
6495 self._keypressTimeout = setTimeout(function() {
6496 self._keypressTimeout = null;
6497 }, debounceDuration);
6498 };
6499 },
6500
6501 /**
6502 * Captures a breadcrumb of type "navigation", normalizing input URLs
6503 * @param to the originating URL
6504 * @param from the target URL
6505 * @private
6506 */
6507 _captureUrlChange: function(from, to) {
6508 var parsedLoc = parseUrl(this._location.href);
6509 var parsedTo = parseUrl(to);
6510 var parsedFrom = parseUrl(from);
6511
6512 // because onpopstate only tells you the "new" (to) value of location.href, and
6513 // not the previous (from) value, we need to track the value of the current URL
6514 // state ourselves
6515 this._lastHref = to;
6516
6517 // Use only the path component of the URL if the URL matches the current
6518 // document (almost all the time when using pushState)
6519 if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host)
6520 to = parsedTo.relative;
6521 if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host)
6522 from = parsedFrom.relative;
6523
6524 this.captureBreadcrumb({
6525 category: 'navigation',
6526 data: {
6527 to: to,
6528 from: from
6529 }
6530 });
6531 },
6532
6533 /**
6534 * Wrap timer functions and event targets to catch errors and provide
6535 * better metadata.
6536 */
6537 _instrumentTryCatch: function() {
6538 var self = this;
6539
6540 var wrappedBuiltIns = self._wrappedBuiltIns;
6541
6542 function wrapTimeFn(orig) {
6543 return function(fn, t) {
6544 // preserve arity
6545 // Make a copy of the arguments to prevent deoptimization
6546 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
6547 var args = new Array(arguments.length);
6548 for (var i = 0; i < args.length; ++i) {
6549 args[i] = arguments[i];
6550 }
6551 var originalCallback = args[0];
6552 if (isFunction(originalCallback)) {
6553 args[0] = self.wrap(originalCallback);
6554 }
6555
6556 // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it
6557 // also supports only two arguments and doesn't care what this is, so we
6558 // can just call the original function directly.
6559 if (orig.apply) {
6560 return orig.apply(this, args);
6561 } else {
6562 return orig(args[0], args[1]);
6563 }
6564 };
6565 }
6566
6567 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
6568
6569 function wrapEventTarget(global) {
6570 var proto = _window[global] && _window[global].prototype;
6571 if (proto && proto.hasOwnProperty && proto.hasOwnProperty('addEventListener')) {
6572 fill(
6573 proto,
6574 'addEventListener',
6575 function(orig) {
6576 return function(evtName, fn, capture, secure) {
6577 // preserve arity
6578 try {
6579 if (fn && fn.handleEvent) {
6580 fn.handleEvent = self.wrap(fn.handleEvent);
6581 }
6582 } catch (err) {
6583 // can sometimes get 'Permission denied to access property "handle Event'
6584 }
6585
6586 // More breadcrumb DOM capture ... done here and not in `_instrumentBreadcrumbs`
6587 // so that we don't have more than one wrapper function
6588 var before, clickHandler, keypressHandler;
6589
6590 if (
6591 autoBreadcrumbs &&
6592 autoBreadcrumbs.dom &&
6593 (global === 'EventTarget' || global === 'Node')
6594 ) {
6595 // NOTE: generating multiple handlers per addEventListener invocation, should
6596 // revisit and verify we can just use one (almost certainly)
6597 clickHandler = self._breadcrumbEventHandler('click');
6598 keypressHandler = self._keypressEventHandler();
6599 before = function(evt) {
6600 // need to intercept every DOM event in `before` argument, in case that
6601 // same wrapped method is re-used for different events (e.g. mousemove THEN click)
6602 // see #724
6603 if (!evt) return;
6604
6605 var eventType;
6606 try {
6607 eventType = evt.type;
6608 } catch (e) {
6609 // just accessing event properties can throw an exception in some rare circumstances
6610 // see: https://github.com/getsentry/raven-js/issues/838
6611 return;
6612 }
6613 if (eventType === 'click') return clickHandler(evt);
6614 else if (eventType === 'keypress') return keypressHandler(evt);
6615 };
6616 }
6617 return orig.call(
6618 this,
6619 evtName,
6620 self.wrap(fn, undefined, before),
6621 capture,
6622 secure
6623 );
6624 };
6625 },
6626 wrappedBuiltIns
6627 );
6628 fill(
6629 proto,
6630 'removeEventListener',
6631 function(orig) {
6632 return function(evt, fn, capture, secure) {
6633 try {
6634 fn = fn && (fn.__raven_wrapper__ ? fn.__raven_wrapper__ : fn);
6635 } catch (e) {
6636 // ignore, accessing __raven_wrapper__ will throw in some Selenium environments
6637 }
6638 return orig.call(this, evt, fn, capture, secure);
6639 };
6640 },
6641 wrappedBuiltIns
6642 );
6643 }
6644 }
6645
6646 fill(_window, 'setTimeout', wrapTimeFn, wrappedBuiltIns);
6647 fill(_window, 'setInterval', wrapTimeFn, wrappedBuiltIns);
6648 if (_window.requestAnimationFrame) {
6649 fill(
6650 _window,
6651 'requestAnimationFrame',
6652 function(orig) {
6653 return function(cb) {
6654 return orig(self.wrap(cb));
6655 };
6656 },
6657 wrappedBuiltIns
6658 );
6659 }
6660
6661 // event targets borrowed from bugsnag-js:
6662 // https://github.com/bugsnag/bugsnag-js/blob/master/src/bugsnag.js#L666
6663 var eventTargets = [
6664 'EventTarget',
6665 'Window',
6666 'Node',
6667 'ApplicationCache',
6668 'AudioTrackList',
6669 'ChannelMergerNode',
6670 'CryptoOperation',
6671 'EventSource',
6672 'FileReader',
6673 'HTMLUnknownElement',
6674 'IDBDatabase',
6675 'IDBRequest',
6676 'IDBTransaction',
6677 'KeyOperation',
6678 'MediaController',
6679 'MessagePort',
6680 'ModalWindow',
6681 'Notification',
6682 'SVGElementInstance',
6683 'Screen',
6684 'TextTrack',
6685 'TextTrackCue',
6686 'TextTrackList',
6687 'WebSocket',
6688 'WebSocketWorker',
6689 'Worker',
6690 'XMLHttpRequest',
6691 'XMLHttpRequestEventTarget',
6692 'XMLHttpRequestUpload'
6693 ];
6694 for (var i = 0; i < eventTargets.length; i++) {
6695 wrapEventTarget(eventTargets[i]);
6696 }
6697 },
6698
6699 /**
6700 * Instrument browser built-ins w/ breadcrumb capturing
6701 * - XMLHttpRequests
6702 * - DOM interactions (click/typing)
6703 * - window.location changes
6704 * - console
6705 *
6706 * Can be disabled or individually configured via the `autoBreadcrumbs` config option
6707 */
6708 _instrumentBreadcrumbs: function() {
6709 var self = this;
6710 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
6711
6712 var wrappedBuiltIns = self._wrappedBuiltIns;
6713
6714 function wrapProp(prop, xhr) {
6715 if (prop in xhr && isFunction(xhr[prop])) {
6716 fill(xhr, prop, function(orig) {
6717 return self.wrap(orig);
6718 }); // intentionally don't track filled methods on XHR instances
6719 }
6720 }
6721
6722 if (autoBreadcrumbs.xhr && 'XMLHttpRequest' in _window) {
6723 var xhrproto = XMLHttpRequest.prototype;
6724 fill(
6725 xhrproto,
6726 'open',
6727 function(origOpen) {
6728 return function(method, url) {
6729 // preserve arity
6730
6731 // if Sentry key appears in URL, don't capture
6732 if (isString(url) && url.indexOf(self._globalKey) === -1) {
6733 this.__raven_xhr = {
6734 method: method,
6735 url: url,
6736 status_code: null
6737 };
6738 }
6739
6740 return origOpen.apply(this, arguments);
6741 };
6742 },
6743 wrappedBuiltIns
6744 );
6745
6746 fill(
6747 xhrproto,
6748 'send',
6749 function(origSend) {
6750 return function(data) {
6751 // preserve arity
6752 var xhr = this;
6753
6754 function onreadystatechangeHandler() {
6755 if (xhr.__raven_xhr && xhr.readyState === 4) {
6756 try {
6757 // touching statusCode in some platforms throws
6758 // an exception
6759 xhr.__raven_xhr.status_code = xhr.status;
6760 } catch (e) {
6761 /* do nothing */
6762 }
6763
6764 self.captureBreadcrumb({
6765 type: 'http',
6766 category: 'xhr',
6767 data: xhr.__raven_xhr
6768 });
6769 }
6770 }
6771
6772 var props = ['onload', 'onerror', 'onprogress'];
6773 for (var j = 0; j < props.length; j++) {
6774 wrapProp(props[j], xhr);
6775 }
6776
6777 if ('onreadystatechange' in xhr && isFunction(xhr.onreadystatechange)) {
6778 fill(
6779 xhr,
6780 'onreadystatechange',
6781 function(orig) {
6782 return self.wrap(orig, undefined, onreadystatechangeHandler);
6783 } /* intentionally don't track this instrumentation */
6784 );
6785 } else {
6786 // if onreadystatechange wasn't actually set by the page on this xhr, we
6787 // are free to set our own and capture the breadcrumb
6788 xhr.onreadystatechange = onreadystatechangeHandler;
6789 }
6790
6791 return origSend.apply(this, arguments);
6792 };
6793 },
6794 wrappedBuiltIns
6795 );
6796 }
6797
6798 if (autoBreadcrumbs.xhr && 'fetch' in _window) {
6799 fill(
6800 _window,
6801 'fetch',
6802 function(origFetch) {
6803 return function(fn, t) {
6804 // preserve arity
6805 // Make a copy of the arguments to prevent deoptimization
6806 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
6807 var args = new Array(arguments.length);
6808 for (var i = 0; i < args.length; ++i) {
6809 args[i] = arguments[i];
6810 }
6811
6812 var fetchInput = args[0];
6813 var method = 'GET';
6814 var url;
6815
6816 if (typeof fetchInput === 'string') {
6817 url = fetchInput;
6818 } else if ('Request' in _window && fetchInput instanceof _window.Request) {
6819 url = fetchInput.url;
6820 if (fetchInput.method) {
6821 method = fetchInput.method;
6822 }
6823 } else {
6824 url = '' + fetchInput;
6825 }
6826
6827 if (args[1] && args[1].method) {
6828 method = args[1].method;
6829 }
6830
6831 var fetchData = {
6832 method: method,
6833 url: url,
6834 status_code: null
6835 };
6836
6837 self.captureBreadcrumb({
6838 type: 'http',
6839 category: 'fetch',
6840 data: fetchData
6841 });
6842
6843 return origFetch.apply(this, args).then(function(response) {
6844 fetchData.status_code = response.status;
6845
6846 return response;
6847 });
6848 };
6849 },
6850 wrappedBuiltIns
6851 );
6852 }
6853
6854 // Capture breadcrumbs from any click that is unhandled / bubbled up all the way
6855 // to the document. Do this before we instrument addEventListener.
6856 if (autoBreadcrumbs.dom && this._hasDocument) {
6857 if (_document.addEventListener) {
6858 _document.addEventListener('click', self._breadcrumbEventHandler('click'), false);
6859 _document.addEventListener('keypress', self._keypressEventHandler(), false);
6860 } else {
6861 // IE8 Compatibility
6862 _document.attachEvent('onclick', self._breadcrumbEventHandler('click'));
6863 _document.attachEvent('onkeypress', self._keypressEventHandler());
6864 }
6865 }
6866
6867 // record navigation (URL) changes
6868 // NOTE: in Chrome App environment, touching history.pushState, *even inside
6869 // a try/catch block*, will cause Chrome to output an error to console.error
6870 // borrowed from: https://github.com/angular/angular.js/pull/13945/files
6871 var chrome = _window.chrome;
6872 var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
6873 var hasPushAndReplaceState =
6874 !isChromePackagedApp &&
6875 _window.history &&
6876 history.pushState &&
6877 history.replaceState;
6878 if (autoBreadcrumbs.location && hasPushAndReplaceState) {
6879 // TODO: remove onpopstate handler on uninstall()
6880 var oldOnPopState = _window.onpopstate;
6881 _window.onpopstate = function() {
6882 var currentHref = self._location.href;
6883 self._captureUrlChange(self._lastHref, currentHref);
6884
6885 if (oldOnPopState) {
6886 return oldOnPopState.apply(this, arguments);
6887 }
6888 };
6889
6890 var historyReplacementFunction = function(origHistFunction) {
6891 // note history.pushState.length is 0; intentionally not declaring
6892 // params to preserve 0 arity
6893 return function(/* state, title, url */) {
6894 var url = arguments.length > 2 ? arguments[2] : undefined;
6895
6896 // url argument is optional
6897 if (url) {
6898 // coerce to string (this is what pushState does)
6899 self._captureUrlChange(self._lastHref, url + '');
6900 }
6901
6902 return origHistFunction.apply(this, arguments);
6903 };
6904 };
6905
6906 fill(history, 'pushState', historyReplacementFunction, wrappedBuiltIns);
6907 fill(history, 'replaceState', historyReplacementFunction, wrappedBuiltIns);
6908 }
6909
6910 if (autoBreadcrumbs.console && 'console' in _window && console.log) {
6911 // console
6912 var consoleMethodCallback = function(msg, data) {
6913 self.captureBreadcrumb({
6914 message: msg,
6915 level: data.level,
6916 category: 'console'
6917 });
6918 };
6919
6920 each(['debug', 'info', 'warn', 'error', 'log'], function(_, level) {
6921 wrapConsoleMethod(console, level, consoleMethodCallback);
6922 });
6923 }
6924 },
6925
6926 _restoreBuiltIns: function() {
6927 // restore any wrapped builtins
6928 var builtin;
6929 while (this._wrappedBuiltIns.length) {
6930 builtin = this._wrappedBuiltIns.shift();
6931
6932 var obj = builtin[0],
6933 name = builtin[1],
6934 orig = builtin[2];
6935
6936 obj[name] = orig;
6937 }
6938 },
6939
6940 _drainPlugins: function() {
6941 var self = this;
6942
6943 // FIX ME TODO
6944 each(this._plugins, function(_, plugin) {
6945 var installer = plugin[0];
6946 var args = plugin[1];
6947 installer.apply(self, [self].concat(args));
6948 });
6949 },
6950
6951 _parseDSN: function(str) {
6952 var m = dsnPattern.exec(str),
6953 dsn = {},
6954 i = 7;
6955
6956 try {
6957 while (i--) dsn[dsnKeys[i]] = m[i] || '';
6958 } catch (e) {
6959 throw new RavenConfigError('Invalid DSN: ' + str);
6960 }
6961
6962 if (dsn.pass && !this._globalOptions.allowSecretKey) {
6963 throw new RavenConfigError(
6964 'Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key'
6965 );
6966 }
6967
6968 return dsn;
6969 },
6970
6971 _getGlobalServer: function(uri) {
6972 // assemble the endpoint from the uri pieces
6973 var globalServer = '//' + uri.host + (uri.port ? ':' + uri.port : '');
6974
6975 if (uri.protocol) {
6976 globalServer = uri.protocol + ':' + globalServer;
6977 }
6978 return globalServer;
6979 },
6980
6981 _handleOnErrorStackInfo: function() {
6982 // if we are intentionally ignoring errors via onerror, bail out
6983 if (!this._ignoreOnError) {
6984 this._handleStackInfo.apply(this, arguments);
6985 }
6986 },
6987
6988 _handleStackInfo: function(stackInfo, options) {
6989 var frames = this._prepareFrames(stackInfo, options);
6990
6991 this._triggerEvent('handle', {
6992 stackInfo: stackInfo,
6993 options: options
6994 });
6995
6996 this._processException(
6997 stackInfo.name,
6998 stackInfo.message,
6999 stackInfo.url,
7000 stackInfo.lineno,
7001 frames,
7002 options
7003 );
7004 },
7005
7006 _prepareFrames: function(stackInfo, options) {
7007 var self = this;
7008 var frames = [];
7009 if (stackInfo.stack && stackInfo.stack.length) {
7010 each(stackInfo.stack, function(i, stack) {
7011 var frame = self._normalizeFrame(stack, stackInfo.url);
7012 if (frame) {
7013 frames.push(frame);
7014 }
7015 });
7016
7017 // e.g. frames captured via captureMessage throw
7018 if (options && options.trimHeadFrames) {
7019 for (var j = 0; j < options.trimHeadFrames && j < frames.length; j++) {
7020 frames[j].in_app = false;
7021 }
7022 }
7023 }
7024 frames = frames.slice(0, this._globalOptions.stackTraceLimit);
7025 return frames;
7026 },
7027
7028 _normalizeFrame: function(frame, stackInfoUrl) {
7029 // normalize the frames data
7030 var normalized = {
7031 filename: frame.url,
7032 lineno: frame.line,
7033 colno: frame.column,
7034 function: frame.func || '?'
7035 };
7036
7037 // Case when we don't have any information about the error
7038 // E.g. throwing a string or raw object, instead of an `Error` in Firefox
7039 // Generating synthetic error doesn't add any value here
7040 //
7041 // We should probably somehow let a user know that they should fix their code
7042 if (!frame.url) {
7043 normalized.filename = stackInfoUrl; // fallback to whole stacks url from onerror handler
7044 }
7045
7046 normalized.in_app = !// determine if an exception came from outside of our app
7047 // first we check the global includePaths list.
7048 (
7049 (!!this._globalOptions.includePaths.test &&
7050 !this._globalOptions.includePaths.test(normalized.filename)) ||
7051 // Now we check for fun, if the function name is Raven or TraceKit
7052 /(Raven|TraceKit)\./.test(normalized['function']) ||
7053 // finally, we do a last ditch effort and check for raven.min.js
7054 /raven\.(min\.)?js$/.test(normalized.filename)
7055 );
7056
7057 return normalized;
7058 },
7059
7060 _processException: function(type, message, fileurl, lineno, frames, options) {
7061 var prefixedMessage = (type ? type + ': ' : '') + (message || '');
7062 if (
7063 !!this._globalOptions.ignoreErrors.test &&
7064 (this._globalOptions.ignoreErrors.test(message) ||
7065 this._globalOptions.ignoreErrors.test(prefixedMessage))
7066 ) {
7067 return;
7068 }
7069
7070 var stacktrace;
7071
7072 if (frames && frames.length) {
7073 fileurl = frames[0].filename || fileurl;
7074 // Sentry expects frames oldest to newest
7075 // and JS sends them as newest to oldest
7076 frames.reverse();
7077 stacktrace = {frames: frames};
7078 } else if (fileurl) {
7079 stacktrace = {
7080 frames: [
7081 {
7082 filename: fileurl,
7083 lineno: lineno,
7084 in_app: true
7085 }
7086 ]
7087 };
7088 }
7089
7090 if (
7091 !!this._globalOptions.ignoreUrls.test &&
7092 this._globalOptions.ignoreUrls.test(fileurl)
7093 ) {
7094 return;
7095 }
7096
7097 if (
7098 !!this._globalOptions.whitelistUrls.test &&
7099 !this._globalOptions.whitelistUrls.test(fileurl)
7100 ) {
7101 return;
7102 }
7103
7104 var data = objectMerge(
7105 {
7106 // sentry.interfaces.Exception
7107 exception: {
7108 values: [
7109 {
7110 type: type,
7111 value: message,
7112 stacktrace: stacktrace
7113 }
7114 ]
7115 },
7116 culprit: fileurl
7117 },
7118 options
7119 );
7120
7121 // Fire away!
7122 this._send(data);
7123 },
7124
7125 _trimPacket: function(data) {
7126 // For now, we only want to truncate the two different messages
7127 // but this could/should be expanded to just trim everything
7128 var max = this._globalOptions.maxMessageLength;
7129 if (data.message) {
7130 data.message = truncate(data.message, max);
7131 }
7132 if (data.exception) {
7133 var exception = data.exception.values[0];
7134 exception.value = truncate(exception.value, max);
7135 }
7136
7137 var request = data.request;
7138 if (request) {
7139 if (request.url) {
7140 request.url = truncate(request.url, this._globalOptions.maxUrlLength);
7141 }
7142 if (request.Referer) {
7143 request.Referer = truncate(request.Referer, this._globalOptions.maxUrlLength);
7144 }
7145 }
7146
7147 if (data.breadcrumbs && data.breadcrumbs.values)
7148 this._trimBreadcrumbs(data.breadcrumbs);
7149
7150 return data;
7151 },
7152
7153 /**
7154 * Truncate breadcrumb values (right now just URLs)
7155 */
7156 _trimBreadcrumbs: function(breadcrumbs) {
7157 // known breadcrumb properties with urls
7158 // TODO: also consider arbitrary prop values that start with (https?)?://
7159 var urlProps = ['to', 'from', 'url'],
7160 urlProp,
7161 crumb,
7162 data;
7163
7164 for (var i = 0; i < breadcrumbs.values.length; ++i) {
7165 crumb = breadcrumbs.values[i];
7166 if (
7167 !crumb.hasOwnProperty('data') ||
7168 !isObject(crumb.data) ||
7169 objectFrozen(crumb.data)
7170 )
7171 continue;
7172
7173 data = objectMerge({}, crumb.data);
7174 for (var j = 0; j < urlProps.length; ++j) {
7175 urlProp = urlProps[j];
7176 if (data.hasOwnProperty(urlProp) && data[urlProp]) {
7177 data[urlProp] = truncate(data[urlProp], this._globalOptions.maxUrlLength);
7178 }
7179 }
7180 breadcrumbs.values[i].data = data;
7181 }
7182 },
7183
7184 _getHttpData: function() {
7185 if (!this._hasNavigator && !this._hasDocument) return;
7186 var httpData = {};
7187
7188 if (this._hasNavigator && _navigator.userAgent) {
7189 httpData.headers = {
7190 'User-Agent': navigator.userAgent
7191 };
7192 }
7193
7194 if (this._hasDocument) {
7195 if (_document.location && _document.location.href) {
7196 httpData.url = _document.location.href;
7197 }
7198 if (_document.referrer) {
7199 if (!httpData.headers) httpData.headers = {};
7200 httpData.headers.Referer = _document.referrer;
7201 }
7202 }
7203
7204 return httpData;
7205 },
7206
7207 _resetBackoff: function() {
7208 this._backoffDuration = 0;
7209 this._backoffStart = null;
7210 },
7211
7212 _shouldBackoff: function() {
7213 return this._backoffDuration && now() - this._backoffStart < this._backoffDuration;
7214 },
7215
7216 /**
7217 * Returns true if the in-process data payload matches the signature
7218 * of the previously-sent data
7219 *
7220 * NOTE: This has to be done at this level because TraceKit can generate
7221 * data from window.onerror WITHOUT an exception object (IE8, IE9,
7222 * other old browsers). This can take the form of an "exception"
7223 * data object with a single frame (derived from the onerror args).
7224 */
7225 _isRepeatData: function(current) {
7226 var last = this._lastData;
7227
7228 if (
7229 !last ||
7230 current.message !== last.message || // defined for captureMessage
7231 current.culprit !== last.culprit // defined for captureException/onerror
7232 )
7233 return false;
7234
7235 // Stacktrace interface (i.e. from captureMessage)
7236 if (current.stacktrace || last.stacktrace) {
7237 return isSameStacktrace(current.stacktrace, last.stacktrace);
7238 } else if (current.exception || last.exception) {
7239 // Exception interface (i.e. from captureException/onerror)
7240 return isSameException(current.exception, last.exception);
7241 }
7242
7243 return true;
7244 },
7245
7246 _setBackoffState: function(request) {
7247 // If we are already in a backoff state, don't change anything
7248 if (this._shouldBackoff()) {
7249 return;
7250 }
7251
7252 var status = request.status;
7253
7254 // 400 - project_id doesn't exist or some other fatal
7255 // 401 - invalid/revoked dsn
7256 // 429 - too many requests
7257 if (!(status === 400 || status === 401 || status === 429)) return;
7258
7259 var retry;
7260 try {
7261 // If Retry-After is not in Access-Control-Expose-Headers, most
7262 // browsers will throw an exception trying to access it
7263 retry = request.getResponseHeader('Retry-After');
7264 retry = parseInt(retry, 10) * 1000; // Retry-After is returned in seconds
7265 } catch (e) {
7266 /* eslint no-empty:0 */
7267 }
7268
7269 this._backoffDuration = retry
7270 ? // If Sentry server returned a Retry-After value, use it
7271 retry
7272 : // Otherwise, double the last backoff duration (starts at 1 sec)
7273 this._backoffDuration * 2 || 1000;
7274
7275 this._backoffStart = now();
7276 },
7277
7278 _send: function(data) {
7279 var globalOptions = this._globalOptions;
7280
7281 var baseData = {
7282 project: this._globalProject,
7283 logger: globalOptions.logger,
7284 platform: 'javascript'
7285 },
7286 httpData = this._getHttpData();
7287
7288 if (httpData) {
7289 baseData.request = httpData;
7290 }
7291
7292 // HACK: delete `trimHeadFrames` to prevent from appearing in outbound payload
7293 if (data.trimHeadFrames) delete data.trimHeadFrames;
7294
7295 data = objectMerge(baseData, data);
7296
7297 // Merge in the tags and extra separately since objectMerge doesn't handle a deep merge
7298 data.tags = objectMerge(objectMerge({}, this._globalContext.tags), data.tags);
7299 data.extra = objectMerge(objectMerge({}, this._globalContext.extra), data.extra);
7300
7301 // Send along our own collected metadata with extra
7302 data.extra['session:duration'] = now() - this._startTime;
7303
7304 if (this._breadcrumbs && this._breadcrumbs.length > 0) {
7305 // intentionally make shallow copy so that additions
7306 // to breadcrumbs aren't accidentally sent in this request
7307 data.breadcrumbs = {
7308 values: [].slice.call(this._breadcrumbs, 0)
7309 };
7310 }
7311
7312 // If there are no tags/extra, strip the key from the payload alltogther.
7313 if (isEmptyObject(data.tags)) delete data.tags;
7314
7315 if (this._globalContext.user) {
7316 // sentry.interfaces.User
7317 data.user = this._globalContext.user;
7318 }
7319
7320 // Include the environment if it's defined in globalOptions
7321 if (globalOptions.environment) data.environment = globalOptions.environment;
7322
7323 // Include the release if it's defined in globalOptions
7324 if (globalOptions.release) data.release = globalOptions.release;
7325
7326 // Include server_name if it's defined in globalOptions
7327 if (globalOptions.serverName) data.server_name = globalOptions.serverName;
7328
7329 if (isFunction(globalOptions.dataCallback)) {
7330 data = globalOptions.dataCallback(data) || data;
7331 }
7332
7333 // Why??????????
7334 if (!data || isEmptyObject(data)) {
7335 return;
7336 }
7337
7338 // Check if the request should be filtered or not
7339 if (
7340 isFunction(globalOptions.shouldSendCallback) &&
7341 !globalOptions.shouldSendCallback(data)
7342 ) {
7343 return;
7344 }
7345
7346 // Backoff state: Sentry server previously responded w/ an error (e.g. 429 - too many requests),
7347 // so drop requests until "cool-off" period has elapsed.
7348 if (this._shouldBackoff()) {
7349 this._logDebug('warn', 'Raven dropped error due to backoff: ', data);
7350 return;
7351 }
7352
7353 if (typeof globalOptions.sampleRate === 'number') {
7354 if (Math.random() < globalOptions.sampleRate) {
7355 this._sendProcessedPayload(data);
7356 }
7357 } else {
7358 this._sendProcessedPayload(data);
7359 }
7360 },
7361
7362 _getUuid: function() {
7363 return uuid4();
7364 },
7365
7366 _sendProcessedPayload: function(data, callback) {
7367 var self = this;
7368 var globalOptions = this._globalOptions;
7369
7370 if (!this.isSetup()) return;
7371
7372 // Try and clean up the packet before sending by truncating long values
7373 data = this._trimPacket(data);
7374
7375 // ideally duplicate error testing should occur *before* dataCallback/shouldSendCallback,
7376 // but this would require copying an un-truncated copy of the data packet, which can be
7377 // arbitrarily deep (extra_data) -- could be worthwhile? will revisit
7378 if (!this._globalOptions.allowDuplicates && this._isRepeatData(data)) {
7379 this._logDebug('warn', 'Raven dropped repeat event: ', data);
7380 return;
7381 }
7382
7383 // Send along an event_id if not explicitly passed.
7384 // This event_id can be used to reference the error within Sentry itself.
7385 // Set lastEventId after we know the error should actually be sent
7386 this._lastEventId = data.event_id || (data.event_id = this._getUuid());
7387
7388 // Store outbound payload after trim
7389 this._lastData = data;
7390
7391 this._logDebug('debug', 'Raven about to send:', data);
7392
7393 var auth = {
7394 sentry_version: '7',
7395 sentry_client: 'raven-js/' + this.VERSION,
7396 sentry_key: this._globalKey
7397 };
7398
7399 if (this._globalSecret) {
7400 auth.sentry_secret = this._globalSecret;
7401 }
7402
7403 var exception = data.exception && data.exception.values[0];
7404 this.captureBreadcrumb({
7405 category: 'sentry',
7406 message: exception
7407 ? (exception.type ? exception.type + ': ' : '') + exception.value
7408 : data.message,
7409 event_id: data.event_id,
7410 level: data.level || 'error' // presume error unless specified
7411 });
7412
7413 var url = this._globalEndpoint;
7414 (globalOptions.transport || this._makeRequest).call(this, {
7415 url: url,
7416 auth: auth,
7417 data: data,
7418 options: globalOptions,
7419 onSuccess: function success() {
7420 self._resetBackoff();
7421
7422 self._triggerEvent('success', {
7423 data: data,
7424 src: url
7425 });
7426 callback && callback();
7427 },
7428 onError: function failure(error) {
7429 self._logDebug('error', 'Raven transport failed to send: ', error);
7430
7431 if (error.request) {
7432 self._setBackoffState(error.request);
7433 }
7434
7435 self._triggerEvent('failure', {
7436 data: data,
7437 src: url
7438 });
7439 error = error || new Error('Raven send failed (no additional details provided)');
7440 callback && callback(error);
7441 }
7442 });
7443 },
7444
7445 _makeRequest: function(opts) {
7446 var request = _window.XMLHttpRequest && new _window.XMLHttpRequest();
7447 if (!request) return;
7448
7449 // if browser doesn't support CORS (e.g. IE7), we are out of luck
7450 var hasCORS = 'withCredentials' in request || typeof XDomainRequest !== 'undefined';
7451
7452 if (!hasCORS) return;
7453
7454 var url = opts.url;
7455
7456 if ('withCredentials' in request) {
7457 request.onreadystatechange = function() {
7458 if (request.readyState !== 4) {
7459 return;
7460 } else if (request.status === 200) {
7461 opts.onSuccess && opts.onSuccess();
7462 } else if (opts.onError) {
7463 var err = new Error('Sentry error code: ' + request.status);
7464 err.request = request;
7465 opts.onError(err);
7466 }
7467 };
7468 } else {
7469 request = new XDomainRequest();
7470 // xdomainrequest cannot go http -> https (or vice versa),
7471 // so always use protocol relative
7472 url = url.replace(/^https?:/, '');
7473
7474 // onreadystatechange not supported by XDomainRequest
7475 if (opts.onSuccess) {
7476 request.onload = opts.onSuccess;
7477 }
7478 if (opts.onError) {
7479 request.onerror = function() {
7480 var err = new Error('Sentry error code: XDomainRequest');
7481 err.request = request;
7482 opts.onError(err);
7483 };
7484 }
7485 }
7486
7487 // NOTE: auth is intentionally sent as part of query string (NOT as custom
7488 // HTTP header) so as to avoid preflight CORS requests
7489 request.open('POST', url + '?' + urlencode(opts.auth));
7490 request.send(stringify(opts.data));
7491 },
7492
7493 _logDebug: function(level) {
7494 if (this._originalConsoleMethods[level] && this.debug) {
7495 // In IE<10 console methods do not have their own 'apply' method
7496 Function.prototype.apply.call(
7497 this._originalConsoleMethods[level],
7498 this._originalConsole,
7499 [].slice.call(arguments, 1)
7500 );
7501 }
7502 },
7503
7504 _mergeContext: function(key, context) {
7505 if (isUndefined(context)) {
7506 delete this._globalContext[key];
7507 } else {
7508 this._globalContext[key] = objectMerge(this._globalContext[key] || {}, context);
7509 }
7510 }
7511 };
7512
7513 // Deprecations
7514 Raven.prototype.setUser = Raven.prototype.setUserContext;
7515 Raven.prototype.setReleaseContext = Raven.prototype.setRelease;
7516
7517 module.exports = Raven;
7518
7519
7520 /***/ }),
7521
7522 /***/ "./node_modules/raven-js/src/singleton.js":
7523 /*!************************************************!*\
7524 !*** ./node_modules/raven-js/src/singleton.js ***!
7525 \************************************************/
7526 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7527
7528 /**
7529 * Enforces a single instance of the Raven client, and the
7530 * main entry point for Raven. If you are a consumer of the
7531 * Raven library, you SHOULD load this file (vs raven.js).
7532 **/
7533
7534 var RavenConstructor = __webpack_require__(/*! ./raven */ "./node_modules/raven-js/src/raven.js");
7535
7536 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
7537 var _window =
7538 typeof window !== 'undefined'
7539 ? window
7540 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
7541 var _Raven = _window.Raven;
7542
7543 var Raven = new RavenConstructor();
7544
7545 /*
7546 * Allow multiple versions of Raven to be installed.
7547 * Strip Raven from the global context and returns the instance.
7548 *
7549 * @return {Raven}
7550 */
7551 Raven.noConflict = function() {
7552 _window.Raven = _Raven;
7553 return Raven;
7554 };
7555
7556 Raven.afterLoad();
7557
7558 module.exports = Raven;
7559
7560
7561 /***/ }),
7562
7563 /***/ "./node_modules/raven-js/src/utils.js":
7564 /*!********************************************!*\
7565 !*** ./node_modules/raven-js/src/utils.js ***!
7566 \********************************************/
7567 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7568
7569 var _window =
7570 typeof window !== 'undefined'
7571 ? window
7572 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
7573
7574 function isObject(what) {
7575 return typeof what === 'object' && what !== null;
7576 }
7577
7578 // Yanked from https://git.io/vS8DV re-used under CC0
7579 // with some tiny modifications
7580 function isError(value) {
7581 switch ({}.toString.call(value)) {
7582 case '[object Error]':
7583 return true;
7584 case '[object Exception]':
7585 return true;
7586 case '[object DOMException]':
7587 return true;
7588 default:
7589 return value instanceof Error;
7590 }
7591 }
7592
7593 function isErrorEvent(value) {
7594 return supportsErrorEvent() && {}.toString.call(value) === '[object ErrorEvent]';
7595 }
7596
7597 function isUndefined(what) {
7598 return what === void 0;
7599 }
7600
7601 function isFunction(what) {
7602 return typeof what === 'function';
7603 }
7604
7605 function isString(what) {
7606 return Object.prototype.toString.call(what) === '[object String]';
7607 }
7608
7609 function isEmptyObject(what) {
7610 for (var _ in what) return false; // eslint-disable-line guard-for-in, no-unused-vars
7611 return true;
7612 }
7613
7614 function supportsErrorEvent() {
7615 try {
7616 new ErrorEvent(''); // eslint-disable-line no-new
7617 return true;
7618 } catch (e) {
7619 return false;
7620 }
7621 }
7622
7623 function wrappedCallback(callback) {
7624 function dataCallback(data, original) {
7625 var normalizedData = callback(data) || data;
7626 if (original) {
7627 return original(normalizedData) || normalizedData;
7628 }
7629 return normalizedData;
7630 }
7631
7632 return dataCallback;
7633 }
7634
7635 function each(obj, callback) {
7636 var i, j;
7637
7638 if (isUndefined(obj.length)) {
7639 for (i in obj) {
7640 if (hasKey(obj, i)) {
7641 callback.call(null, i, obj[i]);
7642 }
7643 }
7644 } else {
7645 j = obj.length;
7646 if (j) {
7647 for (i = 0; i < j; i++) {
7648 callback.call(null, i, obj[i]);
7649 }
7650 }
7651 }
7652 }
7653
7654 function objectMerge(obj1, obj2) {
7655 if (!obj2) {
7656 return obj1;
7657 }
7658 each(obj2, function(key, value) {
7659 obj1[key] = value;
7660 });
7661 return obj1;
7662 }
7663
7664 /**
7665 * This function is only used for react-native.
7666 * react-native freezes object that have already been sent over the
7667 * js bridge. We need this function in order to check if the object is frozen.
7668 * So it's ok that objectFrozen returns false if Object.isFrozen is not
7669 * supported because it's not relevant for other "platforms". See related issue:
7670 * https://github.com/getsentry/react-native-sentry/issues/57
7671 */
7672 function objectFrozen(obj) {
7673 if (!Object.isFrozen) {
7674 return false;
7675 }
7676 return Object.isFrozen(obj);
7677 }
7678
7679 function truncate(str, max) {
7680 return !max || str.length <= max ? str : str.substr(0, max) + '\u2026';
7681 }
7682
7683 /**
7684 * hasKey, a better form of hasOwnProperty
7685 * Example: hasKey(MainHostObject, property) === true/false
7686 *
7687 * @param {Object} host object to check property
7688 * @param {string} key to check
7689 */
7690 function hasKey(object, key) {
7691 return Object.prototype.hasOwnProperty.call(object, key);
7692 }
7693
7694 function joinRegExp(patterns) {
7695 // Combine an array of regular expressions and strings into one large regexp
7696 // Be mad.
7697 var sources = [],
7698 i = 0,
7699 len = patterns.length,
7700 pattern;
7701
7702 for (; i < len; i++) {
7703 pattern = patterns[i];
7704 if (isString(pattern)) {
7705 // If it's a string, we need to escape it
7706 // Taken from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
7707 sources.push(pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1'));
7708 } else if (pattern && pattern.source) {
7709 // If it's a regexp already, we want to extract the source
7710 sources.push(pattern.source);
7711 }
7712 // Intentionally skip other cases
7713 }
7714 return new RegExp(sources.join('|'), 'i');
7715 }
7716
7717 function urlencode(o) {
7718 var pairs = [];
7719 each(o, function(key, value) {
7720 pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
7721 });
7722 return pairs.join('&');
7723 }
7724
7725 // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
7726 // intentionally using regex and not <a/> href parsing trick because React Native and other
7727 // environments where DOM might not be available
7728 function parseUrl(url) {
7729 var match = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);
7730 if (!match) return {};
7731
7732 // coerce to undefined values to empty string so we don't get 'undefined'
7733 var query = match[6] || '';
7734 var fragment = match[8] || '';
7735 return {
7736 protocol: match[2],
7737 host: match[4],
7738 path: match[5],
7739 relative: match[5] + query + fragment // everything minus origin
7740 };
7741 }
7742 function uuid4() {
7743 var crypto = _window.crypto || _window.msCrypto;
7744
7745 if (!isUndefined(crypto) && crypto.getRandomValues) {
7746 // Use window.crypto API if available
7747 // eslint-disable-next-line no-undef
7748 var arr = new Uint16Array(8);
7749 crypto.getRandomValues(arr);
7750
7751 // set 4 in byte 7
7752 arr[3] = (arr[3] & 0xfff) | 0x4000;
7753 // set 2 most significant bits of byte 9 to '10'
7754 arr[4] = (arr[4] & 0x3fff) | 0x8000;
7755
7756 var pad = function(num) {
7757 var v = num.toString(16);
7758 while (v.length < 4) {
7759 v = '0' + v;
7760 }
7761 return v;
7762 };
7763
7764 return (
7765 pad(arr[0]) +
7766 pad(arr[1]) +
7767 pad(arr[2]) +
7768 pad(arr[3]) +
7769 pad(arr[4]) +
7770 pad(arr[5]) +
7771 pad(arr[6]) +
7772 pad(arr[7])
7773 );
7774 } else {
7775 // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
7776 return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
7777 var r = (Math.random() * 16) | 0,
7778 v = c === 'x' ? r : (r & 0x3) | 0x8;
7779 return v.toString(16);
7780 });
7781 }
7782 }
7783
7784 /**
7785 * Given a child DOM element, returns a query-selector statement describing that
7786 * and its ancestors
7787 * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
7788 * @param elem
7789 * @returns {string}
7790 */
7791 function htmlTreeAsString(elem) {
7792 /* eslint no-extra-parens:0*/
7793 var MAX_TRAVERSE_HEIGHT = 5,
7794 MAX_OUTPUT_LEN = 80,
7795 out = [],
7796 height = 0,
7797 len = 0,
7798 separator = ' > ',
7799 sepLength = separator.length,
7800 nextStr;
7801
7802 while (elem && height++ < MAX_TRAVERSE_HEIGHT) {
7803 nextStr = htmlElementAsString(elem);
7804 // bail out if
7805 // - nextStr is the 'html' element
7806 // - the length of the string that would be created exceeds MAX_OUTPUT_LEN
7807 // (ignore this limit if we are on the first iteration)
7808 if (
7809 nextStr === 'html' ||
7810 (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)
7811 ) {
7812 break;
7813 }
7814
7815 out.push(nextStr);
7816
7817 len += nextStr.length;
7818 elem = elem.parentNode;
7819 }
7820
7821 return out.reverse().join(separator);
7822 }
7823
7824 /**
7825 * Returns a simple, query-selector representation of a DOM element
7826 * e.g. [HTMLElement] => input#foo.btn[name=baz]
7827 * @param HTMLElement
7828 * @returns {string}
7829 */
7830 function htmlElementAsString(elem) {
7831 var out = [],
7832 className,
7833 classes,
7834 key,
7835 attr,
7836 i;
7837
7838 if (!elem || !elem.tagName) {
7839 return '';
7840 }
7841
7842 out.push(elem.tagName.toLowerCase());
7843 if (elem.id) {
7844 out.push('#' + elem.id);
7845 }
7846
7847 className = elem.className;
7848 if (className && isString(className)) {
7849 classes = className.split(/\s+/);
7850 for (i = 0; i < classes.length; i++) {
7851 out.push('.' + classes[i]);
7852 }
7853 }
7854 var attrWhitelist = ['type', 'name', 'title', 'alt'];
7855 for (i = 0; i < attrWhitelist.length; i++) {
7856 key = attrWhitelist[i];
7857 attr = elem.getAttribute(key);
7858 if (attr) {
7859 out.push('[' + key + '="' + attr + '"]');
7860 }
7861 }
7862 return out.join('');
7863 }
7864
7865 /**
7866 * Returns true if either a OR b is truthy, but not both
7867 */
7868 function isOnlyOneTruthy(a, b) {
7869 return !!(!!a ^ !!b);
7870 }
7871
7872 /**
7873 * Returns true if the two input exception interfaces have the same content
7874 */
7875 function isSameException(ex1, ex2) {
7876 if (isOnlyOneTruthy(ex1, ex2)) return false;
7877
7878 ex1 = ex1.values[0];
7879 ex2 = ex2.values[0];
7880
7881 if (ex1.type !== ex2.type || ex1.value !== ex2.value) return false;
7882
7883 return isSameStacktrace(ex1.stacktrace, ex2.stacktrace);
7884 }
7885
7886 /**
7887 * Returns true if the two input stack trace interfaces have the same content
7888 */
7889 function isSameStacktrace(stack1, stack2) {
7890 if (isOnlyOneTruthy(stack1, stack2)) return false;
7891
7892 var frames1 = stack1.frames;
7893 var frames2 = stack2.frames;
7894
7895 // Exit early if frame count differs
7896 if (frames1.length !== frames2.length) return false;
7897
7898 // Iterate through every frame; bail out if anything differs
7899 var a, b;
7900 for (var i = 0; i < frames1.length; i++) {
7901 a = frames1[i];
7902 b = frames2[i];
7903 if (
7904 a.filename !== b.filename ||
7905 a.lineno !== b.lineno ||
7906 a.colno !== b.colno ||
7907 a['function'] !== b['function']
7908 )
7909 return false;
7910 }
7911 return true;
7912 }
7913
7914 /**
7915 * Polyfill a method
7916 * @param obj object e.g. `document`
7917 * @param name method name present on object e.g. `addEventListener`
7918 * @param replacement replacement function
7919 * @param track {optional} record instrumentation to an array
7920 */
7921 function fill(obj, name, replacement, track) {
7922 var orig = obj[name];
7923 obj[name] = replacement(orig);
7924 if (track) {
7925 track.push([obj, name, orig]);
7926 }
7927 }
7928
7929 module.exports = {
7930 isObject: isObject,
7931 isError: isError,
7932 isErrorEvent: isErrorEvent,
7933 isUndefined: isUndefined,
7934 isFunction: isFunction,
7935 isString: isString,
7936 isEmptyObject: isEmptyObject,
7937 supportsErrorEvent: supportsErrorEvent,
7938 wrappedCallback: wrappedCallback,
7939 each: each,
7940 objectMerge: objectMerge,
7941 truncate: truncate,
7942 objectFrozen: objectFrozen,
7943 hasKey: hasKey,
7944 joinRegExp: joinRegExp,
7945 urlencode: urlencode,
7946 uuid4: uuid4,
7947 htmlTreeAsString: htmlTreeAsString,
7948 htmlElementAsString: htmlElementAsString,
7949 isSameException: isSameException,
7950 isSameStacktrace: isSameStacktrace,
7951 parseUrl: parseUrl,
7952 fill: fill
7953 };
7954
7955
7956 /***/ }),
7957
7958 /***/ "./node_modules/raven-js/vendor/TraceKit/tracekit.js":
7959 /*!***********************************************************!*\
7960 !*** ./node_modules/raven-js/vendor/TraceKit/tracekit.js ***!
7961 \***********************************************************/
7962 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7963
7964 var utils = __webpack_require__(/*! ../../src/utils */ "./node_modules/raven-js/src/utils.js");
7965
7966 /*
7967 TraceKit - Cross brower stack traces
7968
7969 This was originally forked from github.com/occ/TraceKit, but has since been
7970 largely re-written and is now maintained as part of raven-js. Tests for
7971 this are in test/vendor.
7972
7973 MIT license
7974 */
7975
7976 var TraceKit = {
7977 collectWindowErrors: true,
7978 debug: false
7979 };
7980
7981 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
7982 var _window =
7983 typeof window !== 'undefined'
7984 ? window
7985 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
7986
7987 // global reference to slice
7988 var _slice = [].slice;
7989 var UNKNOWN_FUNCTION = '?';
7990
7991 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types
7992 var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;
7993
7994 function getLocationHref() {
7995 if (typeof document === 'undefined' || document.location == null) return '';
7996
7997 return document.location.href;
7998 }
7999
8000 /**
8001 * TraceKit.report: cross-browser processing of unhandled exceptions
8002 *
8003 * Syntax:
8004 * TraceKit.report.subscribe(function(stackInfo) { ... })
8005 * TraceKit.report.unsubscribe(function(stackInfo) { ... })
8006 * TraceKit.report(exception)
8007 * try { ...code... } catch(ex) { TraceKit.report(ex); }
8008 *
8009 * Supports:
8010 * - Firefox: full stack trace with line numbers, plus column number
8011 * on top frame; column number is not guaranteed
8012 * - Opera: full stack trace with line and column numbers
8013 * - Chrome: full stack trace with line and column numbers
8014 * - Safari: line and column number for the top frame only; some frames
8015 * may be missing, and column number is not guaranteed
8016 * - IE: line and column number for the top frame only; some frames
8017 * may be missing, and column number is not guaranteed
8018 *
8019 * In theory, TraceKit should work on all of the following versions:
8020 * - IE5.5+ (only 8.0 tested)
8021 * - Firefox 0.9+ (only 3.5+ tested)
8022 * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require
8023 * Exceptions Have Stacktrace to be enabled in opera:config)
8024 * - Safari 3+ (only 4+ tested)
8025 * - Chrome 1+ (only 5+ tested)
8026 * - Konqueror 3.5+ (untested)
8027 *
8028 * Requires TraceKit.computeStackTrace.
8029 *
8030 * Tries to catch all unhandled exceptions and report them to the
8031 * subscribed handlers. Please note that TraceKit.report will rethrow the
8032 * exception. This is REQUIRED in order to get a useful stack trace in IE.
8033 * If the exception does not reach the top of the browser, you will only
8034 * get a stack trace from the point where TraceKit.report was called.
8035 *
8036 * Handlers receive a stackInfo object as described in the
8037 * TraceKit.computeStackTrace docs.
8038 */
8039 TraceKit.report = (function reportModuleWrapper() {
8040 var handlers = [],
8041 lastArgs = null,
8042 lastException = null,
8043 lastExceptionStack = null;
8044
8045 /**
8046 * Add a crash handler.
8047 * @param {Function} handler
8048 */
8049 function subscribe(handler) {
8050 installGlobalHandler();
8051 handlers.push(handler);
8052 }
8053
8054 /**
8055 * Remove a crash handler.
8056 * @param {Function} handler
8057 */
8058 function unsubscribe(handler) {
8059 for (var i = handlers.length - 1; i >= 0; --i) {
8060 if (handlers[i] === handler) {
8061 handlers.splice(i, 1);
8062 }
8063 }
8064 }
8065
8066 /**
8067 * Remove all crash handlers.
8068 */
8069 function unsubscribeAll() {
8070 uninstallGlobalHandler();
8071 handlers = [];
8072 }
8073
8074 /**
8075 * Dispatch stack information to all handlers.
8076 * @param {Object.<string, *>} stack
8077 */
8078 function notifyHandlers(stack, isWindowError) {
8079 var exception = null;
8080 if (isWindowError && !TraceKit.collectWindowErrors) {
8081 return;
8082 }
8083 for (var i in handlers) {
8084 if (handlers.hasOwnProperty(i)) {
8085 try {
8086 handlers[i].apply(null, [stack].concat(_slice.call(arguments, 2)));
8087 } catch (inner) {
8088 exception = inner;
8089 }
8090 }
8091 }
8092
8093 if (exception) {
8094 throw exception;
8095 }
8096 }
8097
8098 var _oldOnerrorHandler, _onErrorHandlerInstalled;
8099
8100 /**
8101 * Ensures all global unhandled exceptions are recorded.
8102 * Supported by Gecko and IE.
8103 * @param {string} message Error message.
8104 * @param {string} url URL of script that generated the exception.
8105 * @param {(number|string)} lineNo The line number at which the error
8106 * occurred.
8107 * @param {?(number|string)} colNo The column number at which the error
8108 * occurred.
8109 * @param {?Error} ex The actual Error object.
8110 */
8111 function traceKitWindowOnError(message, url, lineNo, colNo, ex) {
8112 var stack = null;
8113
8114 if (lastExceptionStack) {
8115 TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(
8116 lastExceptionStack,
8117 url,
8118 lineNo,
8119 message
8120 );
8121 processLastException();
8122 } else if (ex && utils.isError(ex)) {
8123 // non-string `ex` arg; attempt to extract stack trace
8124
8125 // New chrome and blink send along a real error object
8126 // Let's just report that like a normal error.
8127 // See: https://mikewest.org/2013/08/debugging-runtime-errors-with-window-onerror
8128 stack = TraceKit.computeStackTrace(ex);
8129 notifyHandlers(stack, true);
8130 } else {
8131 var location = {
8132 url: url,
8133 line: lineNo,
8134 column: colNo
8135 };
8136
8137 var name = undefined;
8138 var msg = message; // must be new var or will modify original `arguments`
8139 var groups;
8140 if ({}.toString.call(message) === '[object String]') {
8141 var groups = message.match(ERROR_TYPES_RE);
8142 if (groups) {
8143 name = groups[1];
8144 msg = groups[2];
8145 }
8146 }
8147
8148 location.func = UNKNOWN_FUNCTION;
8149
8150 stack = {
8151 name: name,
8152 message: msg,
8153 url: getLocationHref(),
8154 stack: [location]
8155 };
8156 notifyHandlers(stack, true);
8157 }
8158
8159 if (_oldOnerrorHandler) {
8160 return _oldOnerrorHandler.apply(this, arguments);
8161 }
8162
8163 return false;
8164 }
8165
8166 function installGlobalHandler() {
8167 if (_onErrorHandlerInstalled) {
8168 return;
8169 }
8170 _oldOnerrorHandler = _window.onerror;
8171 _window.onerror = traceKitWindowOnError;
8172 _onErrorHandlerInstalled = true;
8173 }
8174
8175 function uninstallGlobalHandler() {
8176 if (!_onErrorHandlerInstalled) {
8177 return;
8178 }
8179 _window.onerror = _oldOnerrorHandler;
8180 _onErrorHandlerInstalled = false;
8181 _oldOnerrorHandler = undefined;
8182 }
8183
8184 function processLastException() {
8185 var _lastExceptionStack = lastExceptionStack,
8186 _lastArgs = lastArgs;
8187 lastArgs = null;
8188 lastExceptionStack = null;
8189 lastException = null;
8190 notifyHandlers.apply(null, [_lastExceptionStack, false].concat(_lastArgs));
8191 }
8192
8193 /**
8194 * Reports an unhandled Error to TraceKit.
8195 * @param {Error} ex
8196 * @param {?boolean} rethrow If false, do not re-throw the exception.
8197 * Only used for window.onerror to not cause an infinite loop of
8198 * rethrowing.
8199 */
8200 function report(ex, rethrow) {
8201 var args = _slice.call(arguments, 1);
8202 if (lastExceptionStack) {
8203 if (lastException === ex) {
8204 return; // already caught by an inner catch block, ignore
8205 } else {
8206 processLastException();
8207 }
8208 }
8209
8210 var stack = TraceKit.computeStackTrace(ex);
8211 lastExceptionStack = stack;
8212 lastException = ex;
8213 lastArgs = args;
8214
8215 // If the stack trace is incomplete, wait for 2 seconds for
8216 // slow slow IE to see if onerror occurs or not before reporting
8217 // this exception; otherwise, we will end up with an incomplete
8218 // stack trace
8219 setTimeout(function() {
8220 if (lastException === ex) {
8221 processLastException();
8222 }
8223 }, stack.incomplete ? 2000 : 0);
8224
8225 if (rethrow !== false) {
8226 throw ex; // re-throw to propagate to the top level (and cause window.onerror)
8227 }
8228 }
8229
8230 report.subscribe = subscribe;
8231 report.unsubscribe = unsubscribe;
8232 report.uninstall = unsubscribeAll;
8233 return report;
8234 })();
8235
8236 /**
8237 * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript
8238 *
8239 * Syntax:
8240 * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below)
8241 * Returns:
8242 * s.name - exception name
8243 * s.message - exception message
8244 * s.stack[i].url - JavaScript or HTML file URL
8245 * s.stack[i].func - function name, or empty for anonymous functions (if guessing did not work)
8246 * s.stack[i].args - arguments passed to the function, if known
8247 * s.stack[i].line - line number, if known
8248 * s.stack[i].column - column number, if known
8249 *
8250 * Supports:
8251 * - Firefox: full stack trace with line numbers and unreliable column
8252 * number on top frame
8253 * - Opera 10: full stack trace with line and column numbers
8254 * - Opera 9-: full stack trace with line numbers
8255 * - Chrome: full stack trace with line and column numbers
8256 * - Safari: line and column number for the topmost stacktrace element
8257 * only
8258 * - IE: no line numbers whatsoever
8259 *
8260 * Tries to guess names of anonymous functions by looking for assignments
8261 * in the source code. In IE and Safari, we have to guess source file names
8262 * by searching for function bodies inside all page scripts. This will not
8263 * work for scripts that are loaded cross-domain.
8264 * Here be dragons: some function names may be guessed incorrectly, and
8265 * duplicate functions may be mismatched.
8266 *
8267 * TraceKit.computeStackTrace should only be used for tracing purposes.
8268 * Logging of unhandled exceptions should be done with TraceKit.report,
8269 * which builds on top of TraceKit.computeStackTrace and provides better
8270 * IE support by utilizing the window.onerror event to retrieve information
8271 * about the top of the stack.
8272 *
8273 * Note: In IE and Safari, no stack trace is recorded on the Error object,
8274 * so computeStackTrace instead walks its *own* chain of callers.
8275 * This means that:
8276 * * in Safari, some methods may be missing from the stack trace;
8277 * * in IE, the topmost function in the stack trace will always be the
8278 * caller of computeStackTrace.
8279 *
8280 * This is okay for tracing (because you are likely to be calling
8281 * computeStackTrace from the function you want to be the topmost element
8282 * of the stack trace anyway), but not okay for logging unhandled
8283 * exceptions (because your catch block will likely be far away from the
8284 * inner function that actually caused the exception).
8285 *
8286 */
8287 TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
8288 // Contents of Exception in various browsers.
8289 //
8290 // SAFARI:
8291 // ex.message = Can't find variable: qq
8292 // ex.line = 59
8293 // ex.sourceId = 580238192
8294 // ex.sourceURL = http://...
8295 // ex.expressionBeginOffset = 96
8296 // ex.expressionCaretOffset = 98
8297 // ex.expressionEndOffset = 98
8298 // ex.name = ReferenceError
8299 //
8300 // FIREFOX:
8301 // ex.message = qq is not defined
8302 // ex.fileName = http://...
8303 // ex.lineNumber = 59
8304 // ex.columnNumber = 69
8305 // ex.stack = ...stack trace... (see the example below)
8306 // ex.name = ReferenceError
8307 //
8308 // CHROME:
8309 // ex.message = qq is not defined
8310 // ex.name = ReferenceError
8311 // ex.type = not_defined
8312 // ex.arguments = ['aa']
8313 // ex.stack = ...stack trace...
8314 //
8315 // INTERNET EXPLORER:
8316 // ex.message = ...
8317 // ex.name = ReferenceError
8318 //
8319 // OPERA:
8320 // ex.message = ...message... (see the example below)
8321 // ex.name = ReferenceError
8322 // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message)
8323 // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
8324
8325 /**
8326 * Computes stack trace information from the stack property.
8327 * Chrome and Gecko use this property.
8328 * @param {Error} ex
8329 * @return {?Object.<string, *>} Stack trace information.
8330 */
8331 function computeStackTraceFromStackProp(ex) {
8332 if (typeof ex.stack === 'undefined' || !ex.stack) return;
8333
8334 var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,
8335 gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,
8336 winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
8337 // Used to additionally parse URL/line/column from eval frames
8338 geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i,
8339 chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/,
8340 lines = ex.stack.split('\n'),
8341 stack = [],
8342 submatch,
8343 parts,
8344 element,
8345 reference = /^(.*) is undefined$/.exec(ex.message);
8346
8347 for (var i = 0, j = lines.length; i < j; ++i) {
8348 if ((parts = chrome.exec(lines[i]))) {
8349 var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line
8350 var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line
8351 if (isEval && (submatch = chromeEval.exec(parts[2]))) {
8352 // throw out eval line/column and use top-most line/column number
8353 parts[2] = submatch[1]; // url
8354 parts[3] = submatch[2]; // line
8355 parts[4] = submatch[3]; // column
8356 }
8357 element = {
8358 url: !isNative ? parts[2] : null,
8359 func: parts[1] || UNKNOWN_FUNCTION,
8360 args: isNative ? [parts[2]] : [],
8361 line: parts[3] ? +parts[3] : null,
8362 column: parts[4] ? +parts[4] : null
8363 };
8364 } else if ((parts = winjs.exec(lines[i]))) {
8365 element = {
8366 url: parts[2],
8367 func: parts[1] || UNKNOWN_FUNCTION,
8368 args: [],
8369 line: +parts[3],
8370 column: parts[4] ? +parts[4] : null
8371 };
8372 } else if ((parts = gecko.exec(lines[i]))) {
8373 var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
8374 if (isEval && (submatch = geckoEval.exec(parts[3]))) {
8375 // throw out eval line/column and use top-most line number
8376 parts[3] = submatch[1];
8377 parts[4] = submatch[2];
8378 parts[5] = null; // no column when eval
8379 } else if (i === 0 && !parts[5] && typeof ex.columnNumber !== 'undefined') {
8380 // FireFox uses this awesome columnNumber property for its top frame
8381 // Also note, Firefox's column number is 0-based and everything else expects 1-based,
8382 // so adding 1
8383 // NOTE: this hack doesn't work if top-most frame is eval
8384 stack[0].column = ex.columnNumber + 1;
8385 }
8386 element = {
8387 url: parts[3],
8388 func: parts[1] || UNKNOWN_FUNCTION,
8389 args: parts[2] ? parts[2].split(',') : [],
8390 line: parts[4] ? +parts[4] : null,
8391 column: parts[5] ? +parts[5] : null
8392 };
8393 } else {
8394 continue;
8395 }
8396
8397 if (!element.func && element.line) {
8398 element.func = UNKNOWN_FUNCTION;
8399 }
8400
8401 stack.push(element);
8402 }
8403
8404 if (!stack.length) {
8405 return null;
8406 }
8407
8408 return {
8409 name: ex.name,
8410 message: ex.message,
8411 url: getLocationHref(),
8412 stack: stack
8413 };
8414 }
8415
8416 /**
8417 * Adds information about the first frame to incomplete stack traces.
8418 * Safari and IE require this to get complete data on the first frame.
8419 * @param {Object.<string, *>} stackInfo Stack trace information from
8420 * one of the compute* methods.
8421 * @param {string} url The URL of the script that caused an error.
8422 * @param {(number|string)} lineNo The line number of the script that
8423 * caused an error.
8424 * @param {string=} message The error generated by the browser, which
8425 * hopefully contains the name of the object that caused the error.
8426 * @return {boolean} Whether or not the stack information was
8427 * augmented.
8428 */
8429 function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) {
8430 var initial = {
8431 url: url,
8432 line: lineNo
8433 };
8434
8435 if (initial.url && initial.line) {
8436 stackInfo.incomplete = false;
8437
8438 if (!initial.func) {
8439 initial.func = UNKNOWN_FUNCTION;
8440 }
8441
8442 if (stackInfo.stack.length > 0) {
8443 if (stackInfo.stack[0].url === initial.url) {
8444 if (stackInfo.stack[0].line === initial.line) {
8445 return false; // already in stack trace
8446 } else if (
8447 !stackInfo.stack[0].line &&
8448 stackInfo.stack[0].func === initial.func
8449 ) {
8450 stackInfo.stack[0].line = initial.line;
8451 return false;
8452 }
8453 }
8454 }
8455
8456 stackInfo.stack.unshift(initial);
8457 stackInfo.partial = true;
8458 return true;
8459 } else {
8460 stackInfo.incomplete = true;
8461 }
8462
8463 return false;
8464 }
8465
8466 /**
8467 * Computes stack trace information by walking the arguments.caller
8468 * chain at the time the exception occurred. This will cause earlier
8469 * frames to be missed but is the only way to get any stack trace in
8470 * Safari and IE. The top frame is restored by
8471 * {@link augmentStackTraceWithInitialElement}.
8472 * @param {Error} ex
8473 * @return {?Object.<string, *>} Stack trace information.
8474 */
8475 function computeStackTraceByWalkingCallerChain(ex, depth) {
8476 var functionName = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,
8477 stack = [],
8478 funcs = {},
8479 recursion = false,
8480 parts,
8481 item,
8482 source;
8483
8484 for (
8485 var curr = computeStackTraceByWalkingCallerChain.caller;
8486 curr && !recursion;
8487 curr = curr.caller
8488 ) {
8489 if (curr === computeStackTrace || curr === TraceKit.report) {
8490 // console.log('skipping internal function');
8491 continue;
8492 }
8493
8494 item = {
8495 url: null,
8496 func: UNKNOWN_FUNCTION,
8497 line: null,
8498 column: null
8499 };
8500
8501 if (curr.name) {
8502 item.func = curr.name;
8503 } else if ((parts = functionName.exec(curr.toString()))) {
8504 item.func = parts[1];
8505 }
8506
8507 if (typeof item.func === 'undefined') {
8508 try {
8509 item.func = parts.input.substring(0, parts.input.indexOf('{'));
8510 } catch (e) {}
8511 }
8512
8513 if (funcs['' + curr]) {
8514 recursion = true;
8515 } else {
8516 funcs['' + curr] = true;
8517 }
8518
8519 stack.push(item);
8520 }
8521
8522 if (depth) {
8523 // console.log('depth is ' + depth);
8524 // console.log('stack is ' + stack.length);
8525 stack.splice(0, depth);
8526 }
8527
8528 var result = {
8529 name: ex.name,
8530 message: ex.message,
8531 url: getLocationHref(),
8532 stack: stack
8533 };
8534 augmentStackTraceWithInitialElement(
8535 result,
8536 ex.sourceURL || ex.fileName,
8537 ex.line || ex.lineNumber,
8538 ex.message || ex.description
8539 );
8540 return result;
8541 }
8542
8543 /**
8544 * Computes a stack trace for an exception.
8545 * @param {Error} ex
8546 * @param {(string|number)=} depth
8547 */
8548 function computeStackTrace(ex, depth) {
8549 var stack = null;
8550 depth = depth == null ? 0 : +depth;
8551
8552 try {
8553 stack = computeStackTraceFromStackProp(ex);
8554 if (stack) {
8555 return stack;
8556 }
8557 } catch (e) {
8558 if (TraceKit.debug) {
8559 throw e;
8560 }
8561 }
8562
8563 try {
8564 stack = computeStackTraceByWalkingCallerChain(ex, depth + 1);
8565 if (stack) {
8566 return stack;
8567 }
8568 } catch (e) {
8569 if (TraceKit.debug) {
8570 throw e;
8571 }
8572 }
8573 return {
8574 name: ex.name,
8575 message: ex.message,
8576 url: getLocationHref()
8577 };
8578 }
8579
8580 computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement;
8581 computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp;
8582
8583 return computeStackTrace;
8584 })();
8585
8586 module.exports = TraceKit;
8587
8588
8589 /***/ }),
8590
8591 /***/ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js":
8592 /*!***********************************************************************!*\
8593 !*** ./node_modules/raven-js/vendor/json-stringify-safe/stringify.js ***!
8594 \***********************************************************************/
8595 /***/ ((module, exports) => {
8596
8597 /*
8598 json-stringify-safe
8599 Like JSON.stringify, but doesn't throw on circular references.
8600
8601 Originally forked from https://github.com/isaacs/json-stringify-safe
8602 version 5.0.1 on 3/8/2017 and modified to handle Errors serialization
8603 and IE8 compatibility. Tests for this are in test/vendor.
8604
8605 ISC license: https://github.com/isaacs/json-stringify-safe/blob/master/LICENSE
8606 */
8607
8608 exports = module.exports = stringify;
8609 exports.getSerialize = serializer;
8610
8611 function indexOf(haystack, needle) {
8612 for (var i = 0; i < haystack.length; ++i) {
8613 if (haystack[i] === needle) return i;
8614 }
8615 return -1;
8616 }
8617
8618 function stringify(obj, replacer, spaces, cycleReplacer) {
8619 return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);
8620 }
8621
8622 // https://github.com/ftlabs/js-abbreviate/blob/fa709e5f139e7770a71827b1893f22418097fbda/index.js#L95-L106
8623 function stringifyError(value) {
8624 var err = {
8625 // These properties are implemented as magical getters and don't show up in for in
8626 stack: value.stack,
8627 message: value.message,
8628 name: value.name
8629 };
8630
8631 for (var i in value) {
8632 if (Object.prototype.hasOwnProperty.call(value, i)) {
8633 err[i] = value[i];
8634 }
8635 }
8636
8637 return err;
8638 }
8639
8640 function serializer(replacer, cycleReplacer) {
8641 var stack = [];
8642 var keys = [];
8643
8644 if (cycleReplacer == null) {
8645 cycleReplacer = function(key, value) {
8646 if (stack[0] === value) {
8647 return '[Circular ~]';
8648 }
8649 return '[Circular ~.' + keys.slice(0, indexOf(stack, value)).join('.') + ']';
8650 };
8651 }
8652
8653 return function(key, value) {
8654 if (stack.length > 0) {
8655 var thisPos = indexOf(stack, this);
8656 ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
8657 ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
8658
8659 if (~indexOf(stack, value)) {
8660 value = cycleReplacer.call(this, key, value);
8661 }
8662 } else {
8663 stack.push(value);
8664 }
8665
8666 return replacer == null
8667 ? value instanceof Error ? stringifyError(value) : value
8668 : replacer.call(this, key, value);
8669 };
8670 }
8671
8672
8673 /***/ }),
8674
8675 /***/ "./node_modules/react-is/cjs/react-is.development.js":
8676 /*!***********************************************************!*\
8677 !*** ./node_modules/react-is/cjs/react-is.development.js ***!
8678 \***********************************************************/
8679 /***/ ((__unused_webpack_module, exports) => {
8680
8681 "use strict";
8682 /** @license React v16.13.1
8683 * react-is.development.js
8684 *
8685 * Copyright (c) Facebook, Inc. and its affiliates.
8686 *
8687 * This source code is licensed under the MIT license found in the
8688 * LICENSE file in the root directory of this source tree.
8689 */
8690
8691
8692
8693
8694
8695 if (true) {
8696 (function() {
8697 'use strict';
8698
8699 // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
8700 // nor polyfill, then a plain number is used for performance.
8701 var hasSymbol = typeof Symbol === 'function' && Symbol.for;
8702 var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
8703 var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
8704 var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
8705 var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
8706 var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
8707 var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
8708 var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
8709 // (unstable) APIs that have been removed. Can we remove the symbols?
8710
8711 var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
8712 var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
8713 var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
8714 var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
8715 var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
8716 var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
8717 var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
8718 var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
8719 var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
8720 var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
8721 var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
8722
8723 function isValidElementType(type) {
8724 return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
8725 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);
8726 }
8727
8728 function typeOf(object) {
8729 if (typeof object === 'object' && object !== null) {
8730 var $$typeof = object.$$typeof;
8731
8732 switch ($$typeof) {
8733 case REACT_ELEMENT_TYPE:
8734 var type = object.type;
8735
8736 switch (type) {
8737 case REACT_ASYNC_MODE_TYPE:
8738 case REACT_CONCURRENT_MODE_TYPE:
8739 case REACT_FRAGMENT_TYPE:
8740 case REACT_PROFILER_TYPE:
8741 case REACT_STRICT_MODE_TYPE:
8742 case REACT_SUSPENSE_TYPE:
8743 return type;
8744
8745 default:
8746 var $$typeofType = type && type.$$typeof;
8747
8748 switch ($$typeofType) {
8749 case REACT_CONTEXT_TYPE:
8750 case REACT_FORWARD_REF_TYPE:
8751 case REACT_LAZY_TYPE:
8752 case REACT_MEMO_TYPE:
8753 case REACT_PROVIDER_TYPE:
8754 return $$typeofType;
8755
8756 default:
8757 return $$typeof;
8758 }
8759
8760 }
8761
8762 case REACT_PORTAL_TYPE:
8763 return $$typeof;
8764 }
8765 }
8766
8767 return undefined;
8768 } // AsyncMode is deprecated along with isAsyncMode
8769
8770 var AsyncMode = REACT_ASYNC_MODE_TYPE;
8771 var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
8772 var ContextConsumer = REACT_CONTEXT_TYPE;
8773 var ContextProvider = REACT_PROVIDER_TYPE;
8774 var Element = REACT_ELEMENT_TYPE;
8775 var ForwardRef = REACT_FORWARD_REF_TYPE;
8776 var Fragment = REACT_FRAGMENT_TYPE;
8777 var Lazy = REACT_LAZY_TYPE;
8778 var Memo = REACT_MEMO_TYPE;
8779 var Portal = REACT_PORTAL_TYPE;
8780 var Profiler = REACT_PROFILER_TYPE;
8781 var StrictMode = REACT_STRICT_MODE_TYPE;
8782 var Suspense = REACT_SUSPENSE_TYPE;
8783 var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
8784
8785 function isAsyncMode(object) {
8786 {
8787 if (!hasWarnedAboutDeprecatedIsAsyncMode) {
8788 hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
8789
8790 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.');
8791 }
8792 }
8793
8794 return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
8795 }
8796 function isConcurrentMode(object) {
8797 return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
8798 }
8799 function isContextConsumer(object) {
8800 return typeOf(object) === REACT_CONTEXT_TYPE;
8801 }
8802 function isContextProvider(object) {
8803 return typeOf(object) === REACT_PROVIDER_TYPE;
8804 }
8805 function isElement(object) {
8806 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
8807 }
8808 function isForwardRef(object) {
8809 return typeOf(object) === REACT_FORWARD_REF_TYPE;
8810 }
8811 function isFragment(object) {
8812 return typeOf(object) === REACT_FRAGMENT_TYPE;
8813 }
8814 function isLazy(object) {
8815 return typeOf(object) === REACT_LAZY_TYPE;
8816 }
8817 function isMemo(object) {
8818 return typeOf(object) === REACT_MEMO_TYPE;
8819 }
8820 function isPortal(object) {
8821 return typeOf(object) === REACT_PORTAL_TYPE;
8822 }
8823 function isProfiler(object) {
8824 return typeOf(object) === REACT_PROFILER_TYPE;
8825 }
8826 function isStrictMode(object) {
8827 return typeOf(object) === REACT_STRICT_MODE_TYPE;
8828 }
8829 function isSuspense(object) {
8830 return typeOf(object) === REACT_SUSPENSE_TYPE;
8831 }
8832
8833 exports.AsyncMode = AsyncMode;
8834 exports.ConcurrentMode = ConcurrentMode;
8835 exports.ContextConsumer = ContextConsumer;
8836 exports.ContextProvider = ContextProvider;
8837 exports.Element = Element;
8838 exports.ForwardRef = ForwardRef;
8839 exports.Fragment = Fragment;
8840 exports.Lazy = Lazy;
8841 exports.Memo = Memo;
8842 exports.Portal = Portal;
8843 exports.Profiler = Profiler;
8844 exports.StrictMode = StrictMode;
8845 exports.Suspense = Suspense;
8846 exports.isAsyncMode = isAsyncMode;
8847 exports.isConcurrentMode = isConcurrentMode;
8848 exports.isContextConsumer = isContextConsumer;
8849 exports.isContextProvider = isContextProvider;
8850 exports.isElement = isElement;
8851 exports.isForwardRef = isForwardRef;
8852 exports.isFragment = isFragment;
8853 exports.isLazy = isLazy;
8854 exports.isMemo = isMemo;
8855 exports.isPortal = isPortal;
8856 exports.isProfiler = isProfiler;
8857 exports.isStrictMode = isStrictMode;
8858 exports.isSuspense = isSuspense;
8859 exports.isValidElementType = isValidElementType;
8860 exports.typeOf = typeOf;
8861 })();
8862 }
8863
8864
8865 /***/ }),
8866
8867 /***/ "./node_modules/react-is/index.js":
8868 /*!****************************************!*\
8869 !*** ./node_modules/react-is/index.js ***!
8870 \****************************************/
8871 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8872
8873 "use strict";
8874
8875
8876 if (false) {} else {
8877 module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "./node_modules/react-is/cjs/react-is.development.js");
8878 }
8879
8880
8881 /***/ }),
8882
8883 /***/ "./node_modules/react/cjs/react-jsx-runtime.development.js":
8884 /*!*****************************************************************!*\
8885 !*** ./node_modules/react/cjs/react-jsx-runtime.development.js ***!
8886 \*****************************************************************/
8887 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8888
8889 "use strict";
8890 /** @license React v17.0.2
8891 * react-jsx-runtime.development.js
8892 *
8893 * Copyright (c) Facebook, Inc. and its affiliates.
8894 *
8895 * This source code is licensed under the MIT license found in the
8896 * LICENSE file in the root directory of this source tree.
8897 */
8898
8899
8900
8901 if (true) {
8902 (function() {
8903 'use strict';
8904
8905 var React = __webpack_require__(/*! react */ "react");
8906 var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
8907
8908 // ATTENTION
8909 // When adding new symbols to this file,
8910 // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
8911 // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
8912 // nor polyfill, then a plain number is used for performance.
8913 var REACT_ELEMENT_TYPE = 0xeac7;
8914 var REACT_PORTAL_TYPE = 0xeaca;
8915 exports.Fragment = 0xeacb;
8916 var REACT_STRICT_MODE_TYPE = 0xeacc;
8917 var REACT_PROFILER_TYPE = 0xead2;
8918 var REACT_PROVIDER_TYPE = 0xeacd;
8919 var REACT_CONTEXT_TYPE = 0xeace;
8920 var REACT_FORWARD_REF_TYPE = 0xead0;
8921 var REACT_SUSPENSE_TYPE = 0xead1;
8922 var REACT_SUSPENSE_LIST_TYPE = 0xead8;
8923 var REACT_MEMO_TYPE = 0xead3;
8924 var REACT_LAZY_TYPE = 0xead4;
8925 var REACT_BLOCK_TYPE = 0xead9;
8926 var REACT_SERVER_BLOCK_TYPE = 0xeada;
8927 var REACT_FUNDAMENTAL_TYPE = 0xead5;
8928 var REACT_SCOPE_TYPE = 0xead7;
8929 var REACT_OPAQUE_ID_TYPE = 0xeae0;
8930 var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
8931 var REACT_OFFSCREEN_TYPE = 0xeae2;
8932 var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
8933
8934 if (typeof Symbol === 'function' && Symbol.for) {
8935 var symbolFor = Symbol.for;
8936 REACT_ELEMENT_TYPE = symbolFor('react.element');
8937 REACT_PORTAL_TYPE = symbolFor('react.portal');
8938 exports.Fragment = symbolFor('react.fragment');
8939 REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
8940 REACT_PROFILER_TYPE = symbolFor('react.profiler');
8941 REACT_PROVIDER_TYPE = symbolFor('react.provider');
8942 REACT_CONTEXT_TYPE = symbolFor('react.context');
8943 REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
8944 REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
8945 REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
8946 REACT_MEMO_TYPE = symbolFor('react.memo');
8947 REACT_LAZY_TYPE = symbolFor('react.lazy');
8948 REACT_BLOCK_TYPE = symbolFor('react.block');
8949 REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
8950 REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
8951 REACT_SCOPE_TYPE = symbolFor('react.scope');
8952 REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
8953 REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
8954 REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
8955 REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
8956 }
8957
8958 var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
8959 var FAUX_ITERATOR_SYMBOL = '@@iterator';
8960 function getIteratorFn(maybeIterable) {
8961 if (maybeIterable === null || typeof maybeIterable !== 'object') {
8962 return null;
8963 }
8964
8965 var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
8966
8967 if (typeof maybeIterator === 'function') {
8968 return maybeIterator;
8969 }
8970
8971 return null;
8972 }
8973
8974 var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
8975
8976 function error(format) {
8977 {
8978 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
8979 args[_key2 - 1] = arguments[_key2];
8980 }
8981
8982 printWarning('error', format, args);
8983 }
8984 }
8985
8986 function printWarning(level, format, args) {
8987 // When changing this logic, you might want to also
8988 // update consoleWithStackDev.www.js as well.
8989 {
8990 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
8991 var stack = ReactDebugCurrentFrame.getStackAddendum();
8992
8993 if (stack !== '') {
8994 format += '%s';
8995 args = args.concat([stack]);
8996 }
8997
8998 var argsWithFormat = args.map(function (item) {
8999 return '' + item;
9000 }); // Careful: RN currently depends on this prefix
9001
9002 argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
9003 // breaks IE9: https://github.com/facebook/react/issues/13610
9004 // eslint-disable-next-line react-internal/no-production-logging
9005
9006 Function.prototype.apply.call(console[level], console, argsWithFormat);
9007 }
9008 }
9009
9010 // Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
9011
9012 var enableScopeAPI = false; // Experimental Create Event Handle API.
9013
9014 function isValidElementType(type) {
9015 if (typeof type === 'string' || typeof type === 'function') {
9016 return true;
9017 } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
9018
9019
9020 if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
9021 return true;
9022 }
9023
9024 if (typeof type === 'object' && type !== null) {
9025 if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
9026 return true;
9027 }
9028 }
9029
9030 return false;
9031 }
9032
9033 function getWrappedName(outerType, innerType, wrapperName) {
9034 var functionName = innerType.displayName || innerType.name || '';
9035 return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
9036 }
9037
9038 function getContextName(type) {
9039 return type.displayName || 'Context';
9040 }
9041
9042 function getComponentName(type) {
9043 if (type == null) {
9044 // Host root, text node or just invalid type.
9045 return null;
9046 }
9047
9048 {
9049 if (typeof type.tag === 'number') {
9050 error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
9051 }
9052 }
9053
9054 if (typeof type === 'function') {
9055 return type.displayName || type.name || null;
9056 }
9057
9058 if (typeof type === 'string') {
9059 return type;
9060 }
9061
9062 switch (type) {
9063 case exports.Fragment:
9064 return 'Fragment';
9065
9066 case REACT_PORTAL_TYPE:
9067 return 'Portal';
9068
9069 case REACT_PROFILER_TYPE:
9070 return 'Profiler';
9071
9072 case REACT_STRICT_MODE_TYPE:
9073 return 'StrictMode';
9074
9075 case REACT_SUSPENSE_TYPE:
9076 return 'Suspense';
9077
9078 case REACT_SUSPENSE_LIST_TYPE:
9079 return 'SuspenseList';
9080 }
9081
9082 if (typeof type === 'object') {
9083 switch (type.$$typeof) {
9084 case REACT_CONTEXT_TYPE:
9085 var context = type;
9086 return getContextName(context) + '.Consumer';
9087
9088 case REACT_PROVIDER_TYPE:
9089 var provider = type;
9090 return getContextName(provider._context) + '.Provider';
9091
9092 case REACT_FORWARD_REF_TYPE:
9093 return getWrappedName(type, type.render, 'ForwardRef');
9094
9095 case REACT_MEMO_TYPE:
9096 return getComponentName(type.type);
9097
9098 case REACT_BLOCK_TYPE:
9099 return getComponentName(type._render);
9100
9101 case REACT_LAZY_TYPE:
9102 {
9103 var lazyComponent = type;
9104 var payload = lazyComponent._payload;
9105 var init = lazyComponent._init;
9106
9107 try {
9108 return getComponentName(init(payload));
9109 } catch (x) {
9110 return null;
9111 }
9112 }
9113 }
9114 }
9115
9116 return null;
9117 }
9118
9119 // Helpers to patch console.logs to avoid logging during side-effect free
9120 // replaying on render function. This currently only patches the object
9121 // lazily which won't cover if the log function was extracted eagerly.
9122 // We could also eagerly patch the method.
9123 var disabledDepth = 0;
9124 var prevLog;
9125 var prevInfo;
9126 var prevWarn;
9127 var prevError;
9128 var prevGroup;
9129 var prevGroupCollapsed;
9130 var prevGroupEnd;
9131
9132 function disabledLog() {}
9133
9134 disabledLog.__reactDisabledLog = true;
9135 function disableLogs() {
9136 {
9137 if (disabledDepth === 0) {
9138 /* eslint-disable react-internal/no-production-logging */
9139 prevLog = console.log;
9140 prevInfo = console.info;
9141 prevWarn = console.warn;
9142 prevError = console.error;
9143 prevGroup = console.group;
9144 prevGroupCollapsed = console.groupCollapsed;
9145 prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
9146
9147 var props = {
9148 configurable: true,
9149 enumerable: true,
9150 value: disabledLog,
9151 writable: true
9152 }; // $FlowFixMe Flow thinks console is immutable.
9153
9154 Object.defineProperties(console, {
9155 info: props,
9156 log: props,
9157 warn: props,
9158 error: props,
9159 group: props,
9160 groupCollapsed: props,
9161 groupEnd: props
9162 });
9163 /* eslint-enable react-internal/no-production-logging */
9164 }
9165
9166 disabledDepth++;
9167 }
9168 }
9169 function reenableLogs() {
9170 {
9171 disabledDepth--;
9172
9173 if (disabledDepth === 0) {
9174 /* eslint-disable react-internal/no-production-logging */
9175 var props = {
9176 configurable: true,
9177 enumerable: true,
9178 writable: true
9179 }; // $FlowFixMe Flow thinks console is immutable.
9180
9181 Object.defineProperties(console, {
9182 log: _assign({}, props, {
9183 value: prevLog
9184 }),
9185 info: _assign({}, props, {
9186 value: prevInfo
9187 }),
9188 warn: _assign({}, props, {
9189 value: prevWarn
9190 }),
9191 error: _assign({}, props, {
9192 value: prevError
9193 }),
9194 group: _assign({}, props, {
9195 value: prevGroup
9196 }),
9197 groupCollapsed: _assign({}, props, {
9198 value: prevGroupCollapsed
9199 }),
9200 groupEnd: _assign({}, props, {
9201 value: prevGroupEnd
9202 })
9203 });
9204 /* eslint-enable react-internal/no-production-logging */
9205 }
9206
9207 if (disabledDepth < 0) {
9208 error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
9209 }
9210 }
9211 }
9212
9213 var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
9214 var prefix;
9215 function describeBuiltInComponentFrame(name, source, ownerFn) {
9216 {
9217 if (prefix === undefined) {
9218 // Extract the VM specific prefix used by each line.
9219 try {
9220 throw Error();
9221 } catch (x) {
9222 var match = x.stack.trim().match(/\n( *(at )?)/);
9223 prefix = match && match[1] || '';
9224 }
9225 } // We use the prefix to ensure our stacks line up with native stack frames.
9226
9227
9228 return '\n' + prefix + name;
9229 }
9230 }
9231 var reentry = false;
9232 var componentFrameCache;
9233
9234 {
9235 var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
9236 componentFrameCache = new PossiblyWeakMap();
9237 }
9238
9239 function describeNativeComponentFrame(fn, construct) {
9240 // If something asked for a stack inside a fake render, it should get ignored.
9241 if (!fn || reentry) {
9242 return '';
9243 }
9244
9245 {
9246 var frame = componentFrameCache.get(fn);
9247
9248 if (frame !== undefined) {
9249 return frame;
9250 }
9251 }
9252
9253 var control;
9254 reentry = true;
9255 var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
9256
9257 Error.prepareStackTrace = undefined;
9258 var previousDispatcher;
9259
9260 {
9261 previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
9262 // for warnings.
9263
9264 ReactCurrentDispatcher.current = null;
9265 disableLogs();
9266 }
9267
9268 try {
9269 // This should throw.
9270 if (construct) {
9271 // Something should be setting the props in the constructor.
9272 var Fake = function () {
9273 throw Error();
9274 }; // $FlowFixMe
9275
9276
9277 Object.defineProperty(Fake.prototype, 'props', {
9278 set: function () {
9279 // We use a throwing setter instead of frozen or non-writable props
9280 // because that won't throw in a non-strict mode function.
9281 throw Error();
9282 }
9283 });
9284
9285 if (typeof Reflect === 'object' && Reflect.construct) {
9286 // We construct a different control for this case to include any extra
9287 // frames added by the construct call.
9288 try {
9289 Reflect.construct(Fake, []);
9290 } catch (x) {
9291 control = x;
9292 }
9293
9294 Reflect.construct(fn, [], Fake);
9295 } else {
9296 try {
9297 Fake.call();
9298 } catch (x) {
9299 control = x;
9300 }
9301
9302 fn.call(Fake.prototype);
9303 }
9304 } else {
9305 try {
9306 throw Error();
9307 } catch (x) {
9308 control = x;
9309 }
9310
9311 fn();
9312 }
9313 } catch (sample) {
9314 // This is inlined manually because closure doesn't do it for us.
9315 if (sample && control && typeof sample.stack === 'string') {
9316 // This extracts the first frame from the sample that isn't also in the control.
9317 // Skipping one frame that we assume is the frame that calls the two.
9318 var sampleLines = sample.stack.split('\n');
9319 var controlLines = control.stack.split('\n');
9320 var s = sampleLines.length - 1;
9321 var c = controlLines.length - 1;
9322
9323 while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
9324 // We expect at least one stack frame to be shared.
9325 // Typically this will be the root most one. However, stack frames may be
9326 // cut off due to maximum stack limits. In this case, one maybe cut off
9327 // earlier than the other. We assume that the sample is longer or the same
9328 // and there for cut off earlier. So we should find the root most frame in
9329 // the sample somewhere in the control.
9330 c--;
9331 }
9332
9333 for (; s >= 1 && c >= 0; s--, c--) {
9334 // Next we find the first one that isn't the same which should be the
9335 // frame that called our sample function and the control.
9336 if (sampleLines[s] !== controlLines[c]) {
9337 // In V8, the first line is describing the message but other VMs don't.
9338 // If we're about to return the first line, and the control is also on the same
9339 // line, that's a pretty good indicator that our sample threw at same line as
9340 // the control. I.e. before we entered the sample frame. So we ignore this result.
9341 // This can happen if you passed a class to function component, or non-function.
9342 if (s !== 1 || c !== 1) {
9343 do {
9344 s--;
9345 c--; // We may still have similar intermediate frames from the construct call.
9346 // The next one that isn't the same should be our match though.
9347
9348 if (c < 0 || sampleLines[s] !== controlLines[c]) {
9349 // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
9350 var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
9351
9352 {
9353 if (typeof fn === 'function') {
9354 componentFrameCache.set(fn, _frame);
9355 }
9356 } // Return the line we found.
9357
9358
9359 return _frame;
9360 }
9361 } while (s >= 1 && c >= 0);
9362 }
9363
9364 break;
9365 }
9366 }
9367 }
9368 } finally {
9369 reentry = false;
9370
9371 {
9372 ReactCurrentDispatcher.current = previousDispatcher;
9373 reenableLogs();
9374 }
9375
9376 Error.prepareStackTrace = previousPrepareStackTrace;
9377 } // Fallback to just using the name if we couldn't make it throw.
9378
9379
9380 var name = fn ? fn.displayName || fn.name : '';
9381 var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
9382
9383 {
9384 if (typeof fn === 'function') {
9385 componentFrameCache.set(fn, syntheticFrame);
9386 }
9387 }
9388
9389 return syntheticFrame;
9390 }
9391 function describeFunctionComponentFrame(fn, source, ownerFn) {
9392 {
9393 return describeNativeComponentFrame(fn, false);
9394 }
9395 }
9396
9397 function shouldConstruct(Component) {
9398 var prototype = Component.prototype;
9399 return !!(prototype && prototype.isReactComponent);
9400 }
9401
9402 function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
9403
9404 if (type == null) {
9405 return '';
9406 }
9407
9408 if (typeof type === 'function') {
9409 {
9410 return describeNativeComponentFrame(type, shouldConstruct(type));
9411 }
9412 }
9413
9414 if (typeof type === 'string') {
9415 return describeBuiltInComponentFrame(type);
9416 }
9417
9418 switch (type) {
9419 case REACT_SUSPENSE_TYPE:
9420 return describeBuiltInComponentFrame('Suspense');
9421
9422 case REACT_SUSPENSE_LIST_TYPE:
9423 return describeBuiltInComponentFrame('SuspenseList');
9424 }
9425
9426 if (typeof type === 'object') {
9427 switch (type.$$typeof) {
9428 case REACT_FORWARD_REF_TYPE:
9429 return describeFunctionComponentFrame(type.render);
9430
9431 case REACT_MEMO_TYPE:
9432 // Memo may contain any component type so we recursively resolve it.
9433 return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
9434
9435 case REACT_BLOCK_TYPE:
9436 return describeFunctionComponentFrame(type._render);
9437
9438 case REACT_LAZY_TYPE:
9439 {
9440 var lazyComponent = type;
9441 var payload = lazyComponent._payload;
9442 var init = lazyComponent._init;
9443
9444 try {
9445 // Lazy may contain any component type so we recursively resolve it.
9446 return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
9447 } catch (x) {}
9448 }
9449 }
9450 }
9451
9452 return '';
9453 }
9454
9455 var loggedTypeFailures = {};
9456 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
9457
9458 function setCurrentlyValidatingElement(element) {
9459 {
9460 if (element) {
9461 var owner = element._owner;
9462 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
9463 ReactDebugCurrentFrame.setExtraStackFrame(stack);
9464 } else {
9465 ReactDebugCurrentFrame.setExtraStackFrame(null);
9466 }
9467 }
9468 }
9469
9470 function checkPropTypes(typeSpecs, values, location, componentName, element) {
9471 {
9472 // $FlowFixMe This is okay but Flow doesn't know it.
9473 var has = Function.call.bind(Object.prototype.hasOwnProperty);
9474
9475 for (var typeSpecName in typeSpecs) {
9476 if (has(typeSpecs, typeSpecName)) {
9477 var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
9478 // fail the render phase where it didn't fail before. So we log it.
9479 // After these have been cleaned up, we'll let them throw.
9480
9481 try {
9482 // This is intentionally an invariant that gets caught. It's the same
9483 // behavior as without this statement except with a better message.
9484 if (typeof typeSpecs[typeSpecName] !== 'function') {
9485 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`.');
9486 err.name = 'Invariant Violation';
9487 throw err;
9488 }
9489
9490 error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
9491 } catch (ex) {
9492 error$1 = ex;
9493 }
9494
9495 if (error$1 && !(error$1 instanceof Error)) {
9496 setCurrentlyValidatingElement(element);
9497
9498 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);
9499
9500 setCurrentlyValidatingElement(null);
9501 }
9502
9503 if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
9504 // Only monitor this failure once because there tends to be a lot of the
9505 // same error.
9506 loggedTypeFailures[error$1.message] = true;
9507 setCurrentlyValidatingElement(element);
9508
9509 error('Failed %s type: %s', location, error$1.message);
9510
9511 setCurrentlyValidatingElement(null);
9512 }
9513 }
9514 }
9515 }
9516 }
9517
9518 var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
9519 var hasOwnProperty = Object.prototype.hasOwnProperty;
9520 var RESERVED_PROPS = {
9521 key: true,
9522 ref: true,
9523 __self: true,
9524 __source: true
9525 };
9526 var specialPropKeyWarningShown;
9527 var specialPropRefWarningShown;
9528 var didWarnAboutStringRefs;
9529
9530 {
9531 didWarnAboutStringRefs = {};
9532 }
9533
9534 function hasValidRef(config) {
9535 {
9536 if (hasOwnProperty.call(config, 'ref')) {
9537 var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
9538
9539 if (getter && getter.isReactWarning) {
9540 return false;
9541 }
9542 }
9543 }
9544
9545 return config.ref !== undefined;
9546 }
9547
9548 function hasValidKey(config) {
9549 {
9550 if (hasOwnProperty.call(config, 'key')) {
9551 var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
9552
9553 if (getter && getter.isReactWarning) {
9554 return false;
9555 }
9556 }
9557 }
9558
9559 return config.key !== undefined;
9560 }
9561
9562 function warnIfStringRefCannotBeAutoConverted(config, self) {
9563 {
9564 if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
9565 var componentName = getComponentName(ReactCurrentOwner.current.type);
9566
9567 if (!didWarnAboutStringRefs[componentName]) {
9568 error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
9569
9570 didWarnAboutStringRefs[componentName] = true;
9571 }
9572 }
9573 }
9574 }
9575
9576 function defineKeyPropWarningGetter(props, displayName) {
9577 {
9578 var warnAboutAccessingKey = function () {
9579 if (!specialPropKeyWarningShown) {
9580 specialPropKeyWarningShown = true;
9581
9582 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);
9583 }
9584 };
9585
9586 warnAboutAccessingKey.isReactWarning = true;
9587 Object.defineProperty(props, 'key', {
9588 get: warnAboutAccessingKey,
9589 configurable: true
9590 });
9591 }
9592 }
9593
9594 function defineRefPropWarningGetter(props, displayName) {
9595 {
9596 var warnAboutAccessingRef = function () {
9597 if (!specialPropRefWarningShown) {
9598 specialPropRefWarningShown = true;
9599
9600 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);
9601 }
9602 };
9603
9604 warnAboutAccessingRef.isReactWarning = true;
9605 Object.defineProperty(props, 'ref', {
9606 get: warnAboutAccessingRef,
9607 configurable: true
9608 });
9609 }
9610 }
9611 /**
9612 * Factory method to create a new React element. This no longer adheres to
9613 * the class pattern, so do not use new to call it. Also, instanceof check
9614 * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
9615 * if something is a React Element.
9616 *
9617 * @param {*} type
9618 * @param {*} props
9619 * @param {*} key
9620 * @param {string|object} ref
9621 * @param {*} owner
9622 * @param {*} self A *temporary* helper to detect places where `this` is
9623 * different from the `owner` when React.createElement is called, so that we
9624 * can warn. We want to get rid of owner and replace string `ref`s with arrow
9625 * functions, and as long as `this` and owner are the same, there will be no
9626 * change in behavior.
9627 * @param {*} source An annotation object (added by a transpiler or otherwise)
9628 * indicating filename, line number, and/or other information.
9629 * @internal
9630 */
9631
9632
9633 var ReactElement = function (type, key, ref, self, source, owner, props) {
9634 var element = {
9635 // This tag allows us to uniquely identify this as a React Element
9636 $$typeof: REACT_ELEMENT_TYPE,
9637 // Built-in properties that belong on the element
9638 type: type,
9639 key: key,
9640 ref: ref,
9641 props: props,
9642 // Record the component responsible for creating this element.
9643 _owner: owner
9644 };
9645
9646 {
9647 // The validation flag is currently mutative. We put it on
9648 // an external backing store so that we can freeze the whole object.
9649 // This can be replaced with a WeakMap once they are implemented in
9650 // commonly used development environments.
9651 element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
9652 // the validation flag non-enumerable (where possible, which should
9653 // include every environment we run tests in), so the test framework
9654 // ignores it.
9655
9656 Object.defineProperty(element._store, 'validated', {
9657 configurable: false,
9658 enumerable: false,
9659 writable: true,
9660 value: false
9661 }); // self and source are DEV only properties.
9662
9663 Object.defineProperty(element, '_self', {
9664 configurable: false,
9665 enumerable: false,
9666 writable: false,
9667 value: self
9668 }); // Two elements created in two different places should be considered
9669 // equal for testing purposes and therefore we hide it from enumeration.
9670
9671 Object.defineProperty(element, '_source', {
9672 configurable: false,
9673 enumerable: false,
9674 writable: false,
9675 value: source
9676 });
9677
9678 if (Object.freeze) {
9679 Object.freeze(element.props);
9680 Object.freeze(element);
9681 }
9682 }
9683
9684 return element;
9685 };
9686 /**
9687 * https://github.com/reactjs/rfcs/pull/107
9688 * @param {*} type
9689 * @param {object} props
9690 * @param {string} key
9691 */
9692
9693 function jsxDEV(type, config, maybeKey, source, self) {
9694 {
9695 var propName; // Reserved names are extracted
9696
9697 var props = {};
9698 var key = null;
9699 var ref = null; // Currently, key can be spread in as a prop. This causes a potential
9700 // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
9701 // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
9702 // but as an intermediary step, we will use jsxDEV for everything except
9703 // <div {...props} key="Hi" />, because we aren't currently able to tell if
9704 // key is explicitly declared to be undefined or not.
9705
9706 if (maybeKey !== undefined) {
9707 key = '' + maybeKey;
9708 }
9709
9710 if (hasValidKey(config)) {
9711 key = '' + config.key;
9712 }
9713
9714 if (hasValidRef(config)) {
9715 ref = config.ref;
9716 warnIfStringRefCannotBeAutoConverted(config, self);
9717 } // Remaining properties are added to a new props object
9718
9719
9720 for (propName in config) {
9721 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
9722 props[propName] = config[propName];
9723 }
9724 } // Resolve default props
9725
9726
9727 if (type && type.defaultProps) {
9728 var defaultProps = type.defaultProps;
9729
9730 for (propName in defaultProps) {
9731 if (props[propName] === undefined) {
9732 props[propName] = defaultProps[propName];
9733 }
9734 }
9735 }
9736
9737 if (key || ref) {
9738 var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
9739
9740 if (key) {
9741 defineKeyPropWarningGetter(props, displayName);
9742 }
9743
9744 if (ref) {
9745 defineRefPropWarningGetter(props, displayName);
9746 }
9747 }
9748
9749 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
9750 }
9751 }
9752
9753 var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
9754 var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
9755
9756 function setCurrentlyValidatingElement$1(element) {
9757 {
9758 if (element) {
9759 var owner = element._owner;
9760 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
9761 ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
9762 } else {
9763 ReactDebugCurrentFrame$1.setExtraStackFrame(null);
9764 }
9765 }
9766 }
9767
9768 var propTypesMisspellWarningShown;
9769
9770 {
9771 propTypesMisspellWarningShown = false;
9772 }
9773 /**
9774 * Verifies the object is a ReactElement.
9775 * See https://reactjs.org/docs/react-api.html#isvalidelement
9776 * @param {?object} object
9777 * @return {boolean} True if `object` is a ReactElement.
9778 * @final
9779 */
9780
9781 function isValidElement(object) {
9782 {
9783 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
9784 }
9785 }
9786
9787 function getDeclarationErrorAddendum() {
9788 {
9789 if (ReactCurrentOwner$1.current) {
9790 var name = getComponentName(ReactCurrentOwner$1.current.type);
9791
9792 if (name) {
9793 return '\n\nCheck the render method of `' + name + '`.';
9794 }
9795 }
9796
9797 return '';
9798 }
9799 }
9800
9801 function getSourceInfoErrorAddendum(source) {
9802 {
9803 if (source !== undefined) {
9804 var fileName = source.fileName.replace(/^.*[\\\/]/, '');
9805 var lineNumber = source.lineNumber;
9806 return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
9807 }
9808
9809 return '';
9810 }
9811 }
9812 /**
9813 * Warn if there's no key explicitly set on dynamic arrays of children or
9814 * object keys are not valid. This allows us to keep track of children between
9815 * updates.
9816 */
9817
9818
9819 var ownerHasKeyUseWarning = {};
9820
9821 function getCurrentComponentErrorInfo(parentType) {
9822 {
9823 var info = getDeclarationErrorAddendum();
9824
9825 if (!info) {
9826 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
9827
9828 if (parentName) {
9829 info = "\n\nCheck the top-level render call using <" + parentName + ">.";
9830 }
9831 }
9832
9833 return info;
9834 }
9835 }
9836 /**
9837 * Warn if the element doesn't have an explicit key assigned to it.
9838 * This element is in an array. The array could grow and shrink or be
9839 * reordered. All children that haven't already been validated are required to
9840 * have a "key" property assigned to it. Error statuses are cached so a warning
9841 * will only be shown once.
9842 *
9843 * @internal
9844 * @param {ReactElement} element Element that requires a key.
9845 * @param {*} parentType element's parent's type.
9846 */
9847
9848
9849 function validateExplicitKey(element, parentType) {
9850 {
9851 if (!element._store || element._store.validated || element.key != null) {
9852 return;
9853 }
9854
9855 element._store.validated = true;
9856 var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
9857
9858 if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
9859 return;
9860 }
9861
9862 ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
9863 // property, it may be the creator of the child that's responsible for
9864 // assigning it a key.
9865
9866 var childOwner = '';
9867
9868 if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
9869 // Give the component that originally created this child.
9870 childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
9871 }
9872
9873 setCurrentlyValidatingElement$1(element);
9874
9875 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);
9876
9877 setCurrentlyValidatingElement$1(null);
9878 }
9879 }
9880 /**
9881 * Ensure that every element either is passed in a static location, in an
9882 * array with an explicit keys property defined, or in an object literal
9883 * with valid key property.
9884 *
9885 * @internal
9886 * @param {ReactNode} node Statically passed child of any type.
9887 * @param {*} parentType node's parent's type.
9888 */
9889
9890
9891 function validateChildKeys(node, parentType) {
9892 {
9893 if (typeof node !== 'object') {
9894 return;
9895 }
9896
9897 if (Array.isArray(node)) {
9898 for (var i = 0; i < node.length; i++) {
9899 var child = node[i];
9900
9901 if (isValidElement(child)) {
9902 validateExplicitKey(child, parentType);
9903 }
9904 }
9905 } else if (isValidElement(node)) {
9906 // This element was passed in a valid location.
9907 if (node._store) {
9908 node._store.validated = true;
9909 }
9910 } else if (node) {
9911 var iteratorFn = getIteratorFn(node);
9912
9913 if (typeof iteratorFn === 'function') {
9914 // Entry iterators used to provide implicit keys,
9915 // but now we print a separate warning for them later.
9916 if (iteratorFn !== node.entries) {
9917 var iterator = iteratorFn.call(node);
9918 var step;
9919
9920 while (!(step = iterator.next()).done) {
9921 if (isValidElement(step.value)) {
9922 validateExplicitKey(step.value, parentType);
9923 }
9924 }
9925 }
9926 }
9927 }
9928 }
9929 }
9930 /**
9931 * Given an element, validate that its props follow the propTypes definition,
9932 * provided by the type.
9933 *
9934 * @param {ReactElement} element
9935 */
9936
9937
9938 function validatePropTypes(element) {
9939 {
9940 var type = element.type;
9941
9942 if (type === null || type === undefined || typeof type === 'string') {
9943 return;
9944 }
9945
9946 var propTypes;
9947
9948 if (typeof type === 'function') {
9949 propTypes = type.propTypes;
9950 } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
9951 // Inner props are checked in the reconciler.
9952 type.$$typeof === REACT_MEMO_TYPE)) {
9953 propTypes = type.propTypes;
9954 } else {
9955 return;
9956 }
9957
9958 if (propTypes) {
9959 // Intentionally inside to avoid triggering lazy initializers:
9960 var name = getComponentName(type);
9961 checkPropTypes(propTypes, element.props, 'prop', name, element);
9962 } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
9963 propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
9964
9965 var _name = getComponentName(type);
9966
9967 error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
9968 }
9969
9970 if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
9971 error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
9972 }
9973 }
9974 }
9975 /**
9976 * Given a fragment, validate that it can only be provided with fragment props
9977 * @param {ReactElement} fragment
9978 */
9979
9980
9981 function validateFragmentProps(fragment) {
9982 {
9983 var keys = Object.keys(fragment.props);
9984
9985 for (var i = 0; i < keys.length; i++) {
9986 var key = keys[i];
9987
9988 if (key !== 'children' && key !== 'key') {
9989 setCurrentlyValidatingElement$1(fragment);
9990
9991 error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
9992
9993 setCurrentlyValidatingElement$1(null);
9994 break;
9995 }
9996 }
9997
9998 if (fragment.ref !== null) {
9999 setCurrentlyValidatingElement$1(fragment);
10000
10001 error('Invalid attribute `ref` supplied to `React.Fragment`.');
10002
10003 setCurrentlyValidatingElement$1(null);
10004 }
10005 }
10006 }
10007
10008 function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
10009 {
10010 var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
10011 // succeed and there will likely be errors in render.
10012
10013 if (!validType) {
10014 var info = '';
10015
10016 if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
10017 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.";
10018 }
10019
10020 var sourceInfo = getSourceInfoErrorAddendum(source);
10021
10022 if (sourceInfo) {
10023 info += sourceInfo;
10024 } else {
10025 info += getDeclarationErrorAddendum();
10026 }
10027
10028 var typeString;
10029
10030 if (type === null) {
10031 typeString = 'null';
10032 } else if (Array.isArray(type)) {
10033 typeString = 'array';
10034 } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
10035 typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
10036 info = ' Did you accidentally export a JSX literal instead of a component?';
10037 } else {
10038 typeString = typeof type;
10039 }
10040
10041 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);
10042 }
10043
10044 var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
10045 // TODO: Drop this when these are no longer allowed as the type argument.
10046
10047 if (element == null) {
10048 return element;
10049 } // Skip key warning if the type isn't valid since our key validation logic
10050 // doesn't expect a non-string/function type and can throw confusing errors.
10051 // We don't want exception behavior to differ between dev and prod.
10052 // (Rendering will throw with a helpful message and as soon as the type is
10053 // fixed, the key warnings will appear.)
10054
10055
10056 if (validType) {
10057 var children = props.children;
10058
10059 if (children !== undefined) {
10060 if (isStaticChildren) {
10061 if (Array.isArray(children)) {
10062 for (var i = 0; i < children.length; i++) {
10063 validateChildKeys(children[i], type);
10064 }
10065
10066 if (Object.freeze) {
10067 Object.freeze(children);
10068 }
10069 } else {
10070 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.');
10071 }
10072 } else {
10073 validateChildKeys(children, type);
10074 }
10075 }
10076 }
10077
10078 if (type === exports.Fragment) {
10079 validateFragmentProps(element);
10080 } else {
10081 validatePropTypes(element);
10082 }
10083
10084 return element;
10085 }
10086 } // These two functions exist to still get child warnings in dev
10087 // even with the prod transform. This means that jsxDEV is purely
10088 // opt-in behavior for better messages but that we won't stop
10089 // giving you warnings if you use production apis.
10090
10091 function jsxWithValidationStatic(type, props, key) {
10092 {
10093 return jsxWithValidation(type, props, key, true);
10094 }
10095 }
10096 function jsxWithValidationDynamic(type, props, key) {
10097 {
10098 return jsxWithValidation(type, props, key, false);
10099 }
10100 }
10101
10102 var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
10103 // for now we can ship identical prod functions
10104
10105 var jsxs = jsxWithValidationStatic ;
10106
10107 exports.jsx = jsx;
10108 exports.jsxs = jsxs;
10109 })();
10110 }
10111
10112
10113 /***/ }),
10114
10115 /***/ "./node_modules/react/jsx-runtime.js":
10116 /*!*******************************************!*\
10117 !*** ./node_modules/react/jsx-runtime.js ***!
10118 \*******************************************/
10119 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10120
10121 "use strict";
10122
10123
10124 if (false) {} else {
10125 module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ "./node_modules/react/cjs/react-jsx-runtime.development.js");
10126 }
10127
10128
10129 /***/ }),
10130
10131 /***/ "./node_modules/styled-components/dist/styled-components.browser.esm.js":
10132 /*!******************************************************************************!*\
10133 !*** ./node_modules/styled-components/dist/styled-components.browser.esm.js ***!
10134 \******************************************************************************/
10135 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10136
10137 "use strict";
10138 __webpack_require__.r(__webpack_exports__);
10139 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10140 /* harmony export */ "ServerStyleSheet": () => (/* binding */ ServerStyleSheet),
10141 /* harmony export */ "StyleSheetConsumer": () => (/* binding */ StyleSheetConsumer),
10142 /* harmony export */ "StyleSheetContext": () => (/* binding */ StyleSheetContext),
10143 /* harmony export */ "StyleSheetManager": () => (/* binding */ StyleSheetManager),
10144 /* harmony export */ "ThemeConsumer": () => (/* binding */ ThemeConsumer),
10145 /* harmony export */ "ThemeContext": () => (/* binding */ ThemeContext),
10146 /* harmony export */ "ThemeProvider": () => (/* binding */ ThemeProvider),
10147 /* 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),
10148 /* harmony export */ "createGlobalStyle": () => (/* binding */ createGlobalStyle),
10149 /* harmony export */ "css": () => (/* binding */ css),
10150 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
10151 /* harmony export */ "isStyledComponent": () => (/* binding */ isStyledComponent),
10152 /* harmony export */ "keyframes": () => (/* binding */ keyframes),
10153 /* harmony export */ "withTheme": () => (/* binding */ withTheme)
10154 /* harmony export */ });
10155 /* harmony import */ var stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stylis/stylis.min */ "./node_modules/stylis/stylis.min.js");
10156 /* harmony import */ var stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0__);
10157 /* harmony import */ var stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! stylis-rule-sheet */ "./node_modules/stylis-rule-sheet/index.js");
10158 /* harmony import */ var stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1__);
10159 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
10160 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
10161 /* harmony import */ var _emotion_unitless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @emotion/unitless */ "./node_modules/@emotion/unitless/dist/unitless.browser.esm.js");
10162 /* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
10163 /* harmony import */ var memoize_one__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! memoize-one */ "./node_modules/memoize-one/dist/memoize-one.esm.js");
10164 /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
10165 /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
10166 /* 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");
10167 /* harmony import */ var merge_anything__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! merge-anything */ "./node_modules/merge-anything/dist/index.esm.js");
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178 //
10179
10180 var interleave = (function (strings, interpolations) {
10181 var result = [strings[0]];
10182
10183 for (var i = 0, len = interpolations.length; i < len; i += 1) {
10184 result.push(interpolations[i], strings[i + 1]);
10185 }
10186
10187 return result;
10188 });
10189
10190 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
10191 return typeof obj;
10192 } : function (obj) {
10193 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
10194 };
10195
10196 var classCallCheck = function (instance, Constructor) {
10197 if (!(instance instanceof Constructor)) {
10198 throw new TypeError("Cannot call a class as a function");
10199 }
10200 };
10201
10202 var createClass = function () {
10203 function defineProperties(target, props) {
10204 for (var i = 0; i < props.length; i++) {
10205 var descriptor = props[i];
10206 descriptor.enumerable = descriptor.enumerable || false;
10207 descriptor.configurable = true;
10208 if ("value" in descriptor) descriptor.writable = true;
10209 Object.defineProperty(target, descriptor.key, descriptor);
10210 }
10211 }
10212
10213 return function (Constructor, protoProps, staticProps) {
10214 if (protoProps) defineProperties(Constructor.prototype, protoProps);
10215 if (staticProps) defineProperties(Constructor, staticProps);
10216 return Constructor;
10217 };
10218 }();
10219
10220 var _extends = Object.assign || function (target) {
10221 for (var i = 1; i < arguments.length; i++) {
10222 var source = arguments[i];
10223
10224 for (var key in source) {
10225 if (Object.prototype.hasOwnProperty.call(source, key)) {
10226 target[key] = source[key];
10227 }
10228 }
10229 }
10230
10231 return target;
10232 };
10233
10234 var inherits = function (subClass, superClass) {
10235 if (typeof superClass !== "function" && superClass !== null) {
10236 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
10237 }
10238
10239 subClass.prototype = Object.create(superClass && superClass.prototype, {
10240 constructor: {
10241 value: subClass,
10242 enumerable: false,
10243 writable: true,
10244 configurable: true
10245 }
10246 });
10247 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
10248 };
10249
10250 var objectWithoutProperties = function (obj, keys) {
10251 var target = {};
10252
10253 for (var i in obj) {
10254 if (keys.indexOf(i) >= 0) continue;
10255 if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
10256 target[i] = obj[i];
10257 }
10258
10259 return target;
10260 };
10261
10262 var possibleConstructorReturn = function (self, call) {
10263 if (!self) {
10264 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
10265 }
10266
10267 return call && (typeof call === "object" || typeof call === "function") ? call : self;
10268 };
10269
10270 //
10271 var isPlainObject = (function (x) {
10272 return (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x.constructor === Object;
10273 });
10274
10275 //
10276 var EMPTY_ARRAY = Object.freeze([]);
10277 var EMPTY_OBJECT = Object.freeze({});
10278
10279 //
10280 function isFunction(test) {
10281 return typeof test === 'function';
10282 }
10283
10284 //
10285
10286 function getComponentName(target) {
10287 return ( true ? typeof target === 'string' && target : 0) || target.displayName || target.name || 'Component';
10288 }
10289
10290 //
10291 function isStatelessFunction(test) {
10292 return typeof test === 'function' && !(test.prototype && test.prototype.isReactComponent);
10293 }
10294
10295 //
10296 function isStyledComponent(target) {
10297 return target && typeof target.styledComponentId === 'string';
10298 }
10299
10300 //
10301
10302 var SC_ATTR = typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || 'data-styled';
10303
10304 var SC_VERSION_ATTR = 'data-styled-version';
10305
10306 var SC_STREAM_ATTR = 'data-styled-streamed';
10307
10308 var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
10309
10310 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';
10311
10312 // Shared empty execution context when generating static styles
10313 var STATIC_EXECUTION_CONTEXT = {};
10314
10315 //
10316
10317
10318 /**
10319 * Parse errors.md and turn it into a simple hash of code: message
10320 */
10321 var ERRORS = true ? {
10322 "1": "Cannot create styled-component for component: %s.\n\n",
10323 "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",
10324 "3": "Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",
10325 "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",
10326 "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",
10327 "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",
10328 "7": "ThemeProvider: Please return an object from your \"theme\" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n",
10329 "8": "ThemeProvider: Please make your \"theme\" prop an object.\n\n",
10330 "9": "Missing document `<head>`\n\n",
10331 "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",
10332 "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",
10333 "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",
10334 "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"
10335 } : 0;
10336
10337 /**
10338 * super basic version of sprintf
10339 */
10340 function format() {
10341 var a = arguments.length <= 0 ? undefined : arguments[0];
10342 var b = [];
10343
10344 for (var c = 1, len = arguments.length; c < len; c += 1) {
10345 b.push(arguments.length <= c ? undefined : arguments[c]);
10346 }
10347
10348 b.forEach(function (d) {
10349 a = a.replace(/%[a-z]/, d);
10350 });
10351
10352 return a;
10353 }
10354
10355 /**
10356 * Create an error file out of errors.md for development and a simple web link to the full errors
10357 * in production mode.
10358 */
10359
10360 var StyledComponentsError = function (_Error) {
10361 inherits(StyledComponentsError, _Error);
10362
10363 function StyledComponentsError(code) {
10364 classCallCheck(this, StyledComponentsError);
10365
10366 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
10367 interpolations[_key - 1] = arguments[_key];
10368 }
10369
10370 if (false) { var _this; } else {
10371 var _this = possibleConstructorReturn(this, _Error.call(this, format.apply(undefined, [ERRORS[code]].concat(interpolations)).trim()));
10372 }
10373 return possibleConstructorReturn(_this);
10374 }
10375
10376 return StyledComponentsError;
10377 }(Error);
10378
10379 //
10380 var SC_COMPONENT_ID = /^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm;
10381
10382 var extractComps = (function (maybeCSS) {
10383 var css = '' + (maybeCSS || ''); // Definitely a string, and a clone
10384 var existingComponents = [];
10385 css.replace(SC_COMPONENT_ID, function (match, componentId, matchIndex) {
10386 existingComponents.push({ componentId: componentId, matchIndex: matchIndex });
10387 return match;
10388 });
10389 return existingComponents.map(function (_ref, i) {
10390 var componentId = _ref.componentId,
10391 matchIndex = _ref.matchIndex;
10392
10393 var nextComp = existingComponents[i + 1];
10394 var cssFromDOM = nextComp ? css.slice(matchIndex, nextComp.matchIndex) : css.slice(matchIndex);
10395 return { componentId: componentId, cssFromDOM: cssFromDOM };
10396 });
10397 });
10398
10399 //
10400
10401 var COMMENT_REGEX = /^\s*\/\/.*$/gm;
10402
10403 // NOTE: This stylis instance is only used to split rules from SSR'd style tags
10404 var stylisSplitter = new (stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default())({
10405 global: false,
10406 cascade: true,
10407 keyframe: false,
10408 prefix: false,
10409 compress: false,
10410 semicolon: true
10411 });
10412
10413 var stylis = new (stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default())({
10414 global: false,
10415 cascade: true,
10416 keyframe: false,
10417 prefix: true,
10418 compress: false,
10419 semicolon: false // NOTE: This means "autocomplete missing semicolons"
10420 });
10421
10422 // Wrap `insertRulePlugin to build a list of rules,
10423 // and then make our own plugin to return the rules. This
10424 // makes it easier to hook into the existing SSR architecture
10425
10426 var parsingRules = [];
10427
10428 // eslint-disable-next-line consistent-return
10429 var returnRulesPlugin = function returnRulesPlugin(context) {
10430 if (context === -2) {
10431 var parsedRules = parsingRules;
10432 parsingRules = [];
10433 return parsedRules;
10434 }
10435 };
10436
10437 var parseRulesPlugin = stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1___default()(function (rule) {
10438 parsingRules.push(rule);
10439 });
10440
10441 var _componentId = void 0;
10442 var _selector = void 0;
10443 var _selectorRegexp = void 0;
10444
10445 var selfReferenceReplacer = function selfReferenceReplacer(match, offset, string) {
10446 if (
10447 // the first self-ref is always untouched
10448 offset > 0 &&
10449 // there should be at least two self-refs to do a replacement (.b > .b)
10450 string.slice(0, offset).indexOf(_selector) !== -1 &&
10451 // no consecutive self refs (.b.b); that is a precedence boost and treated differently
10452 string.slice(offset - _selector.length, offset) !== _selector) {
10453 return '.' + _componentId;
10454 }
10455
10456 return match;
10457 };
10458
10459 /**
10460 * When writing a style like
10461 *
10462 * & + & {
10463 * color: red;
10464 * }
10465 *
10466 * The second ampersand should be a reference to the static component class. stylis
10467 * has no knowledge of static class so we have to intelligently replace the base selector.
10468 */
10469 var selfReferenceReplacementPlugin = function selfReferenceReplacementPlugin(context, _, selectors) {
10470 if (context === 2 && selectors.length && selectors[0].lastIndexOf(_selector) > 0) {
10471 // eslint-disable-next-line no-param-reassign
10472 selectors[0] = selectors[0].replace(_selectorRegexp, selfReferenceReplacer);
10473 }
10474 };
10475
10476 stylis.use([selfReferenceReplacementPlugin, parseRulesPlugin, returnRulesPlugin]);
10477 stylisSplitter.use([parseRulesPlugin, returnRulesPlugin]);
10478
10479 var splitByRules = function splitByRules(css) {
10480 return stylisSplitter('', css);
10481 };
10482
10483 function stringifyRules(rules, selector, prefix) {
10484 var componentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '&';
10485
10486 var flatCSS = rules.join('').replace(COMMENT_REGEX, ''); // replace JS comments
10487
10488 var cssStr = selector && prefix ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS;
10489
10490 // stylis has no concept of state to be passed to plugins
10491 // but since JS is single=threaded, we can rely on that to ensure
10492 // these properties stay in sync with the current stylis run
10493 _componentId = componentId;
10494 _selector = selector;
10495 _selectorRegexp = new RegExp('\\' + _selector + '\\b', 'g');
10496
10497 return stylis(prefix || !selector ? '' : selector, cssStr);
10498 }
10499
10500 //
10501 /* eslint-disable camelcase, no-undef */
10502
10503 var getNonce = (function () {
10504 return true ? __webpack_require__.nc : 0;
10505 });
10506
10507 //
10508 /* These are helpers for the StyleTags to keep track of the injected
10509 * rule names for each (component) ID that they're keeping track of.
10510 * They're crucial for detecting whether a name has already been
10511 * injected.
10512 * (This excludes rehydrated names) */
10513
10514 /* adds a new ID:name pairing to a names dictionary */
10515 var addNameForId = function addNameForId(names, id, name) {
10516 if (name) {
10517 // eslint-disable-next-line no-param-reassign
10518 var namesForId = names[id] || (names[id] = Object.create(null));
10519 namesForId[name] = true;
10520 }
10521 };
10522
10523 /* resets an ID entirely by overwriting it in the dictionary */
10524 var resetIdNames = function resetIdNames(names, id) {
10525 // eslint-disable-next-line no-param-reassign
10526 names[id] = Object.create(null);
10527 };
10528
10529 /* factory for a names dictionary checking the existance of an ID:name pairing */
10530 var hasNameForId = function hasNameForId(names) {
10531 return function (id, name) {
10532 return names[id] !== undefined && names[id][name];
10533 };
10534 };
10535
10536 /* stringifies names for the html/element output */
10537 var stringifyNames = function stringifyNames(names) {
10538 var str = '';
10539 // eslint-disable-next-line guard-for-in
10540 for (var id in names) {
10541 str += Object.keys(names[id]).join(' ') + ' ';
10542 }
10543 return str.trim();
10544 };
10545
10546 /* clones the nested names dictionary */
10547 var cloneNames = function cloneNames(names) {
10548 var clone = Object.create(null);
10549 // eslint-disable-next-line guard-for-in
10550 for (var id in names) {
10551 clone[id] = _extends({}, names[id]);
10552 }
10553 return clone;
10554 };
10555
10556 //
10557
10558 /* These are helpers that deal with the insertRule (aka speedy) API
10559 * They are used in the StyleTags and specifically the speedy tag
10560 */
10561
10562 /* retrieve a sheet for a given style tag */
10563 var sheetForTag = function sheetForTag(tag) {
10564 // $FlowFixMe
10565 if (tag.sheet) return tag.sheet;
10566
10567 /* Firefox quirk requires us to step through all stylesheets to find one owned by the given tag */
10568 var size = tag.ownerDocument.styleSheets.length;
10569 for (var i = 0; i < size; i += 1) {
10570 var sheet = tag.ownerDocument.styleSheets[i];
10571 // $FlowFixMe
10572 if (sheet.ownerNode === tag) return sheet;
10573 }
10574
10575 /* we should always be able to find a tag */
10576 throw new StyledComponentsError(10);
10577 };
10578
10579 /* insert a rule safely and return whether it was actually injected */
10580 var safeInsertRule = function safeInsertRule(sheet, cssRule, index) {
10581 /* abort early if cssRule string is falsy */
10582 if (!cssRule) return false;
10583
10584 var maxIndex = sheet.cssRules.length;
10585
10586 try {
10587 /* use insertRule and cap passed index with maxIndex (no of cssRules) */
10588 sheet.insertRule(cssRule, index <= maxIndex ? index : maxIndex);
10589 } catch (err) {
10590 /* any error indicates an invalid rule */
10591 return false;
10592 }
10593
10594 return true;
10595 };
10596
10597 /* deletes `size` rules starting from `removalIndex` */
10598 var deleteRules = function deleteRules(sheet, removalIndex, size) {
10599 var lowerBound = removalIndex - size;
10600 for (var i = removalIndex; i > lowerBound; i -= 1) {
10601 sheet.deleteRule(i);
10602 }
10603 };
10604
10605 //
10606
10607 /* this marker separates component styles and is important for rehydration */
10608 var makeTextMarker = function makeTextMarker(id) {
10609 return '\n/* sc-component-id: ' + id + ' */\n';
10610 };
10611
10612 /* add up all numbers in array up until and including the index */
10613 var addUpUntilIndex = function addUpUntilIndex(sizes, index) {
10614 var totalUpToIndex = 0;
10615 for (var i = 0; i <= index; i += 1) {
10616 totalUpToIndex += sizes[i];
10617 }
10618
10619 return totalUpToIndex;
10620 };
10621
10622 /* create a new style tag after lastEl */
10623 var makeStyleTag = function makeStyleTag(target, tagEl, insertBefore) {
10624 var targetDocument = document;
10625 if (target) targetDocument = target.ownerDocument;else if (tagEl) targetDocument = tagEl.ownerDocument;
10626
10627 var el = targetDocument.createElement('style');
10628 el.setAttribute(SC_ATTR, '');
10629 el.setAttribute(SC_VERSION_ATTR, "4.4.1");
10630
10631 var nonce = getNonce();
10632 if (nonce) {
10633 el.setAttribute('nonce', nonce);
10634 }
10635
10636 /* Work around insertRule quirk in EdgeHTML */
10637 el.appendChild(targetDocument.createTextNode(''));
10638
10639 if (target && !tagEl) {
10640 /* Append to target when no previous element was passed */
10641 target.appendChild(el);
10642 } else {
10643 if (!tagEl || !target || !tagEl.parentNode) {
10644 throw new StyledComponentsError(6);
10645 }
10646
10647 /* Insert new style tag after the previous one */
10648 tagEl.parentNode.insertBefore(el, insertBefore ? tagEl : tagEl.nextSibling);
10649 }
10650
10651 return el;
10652 };
10653
10654 /* takes a css factory function and outputs an html styled tag factory */
10655 var wrapAsHtmlTag = function wrapAsHtmlTag(css, names) {
10656 return function (additionalAttrs) {
10657 var nonce = getNonce();
10658 var attrs = [nonce && 'nonce="' + nonce + '"', SC_ATTR + '="' + stringifyNames(names) + '"', SC_VERSION_ATTR + '="' + "4.4.1" + '"', additionalAttrs];
10659
10660 var htmlAttr = attrs.filter(Boolean).join(' ');
10661 return '<style ' + htmlAttr + '>' + css() + '</style>';
10662 };
10663 };
10664
10665 /* takes a css factory function and outputs an element factory */
10666 var wrapAsElement = function wrapAsElement(css, names) {
10667 return function () {
10668 var _props;
10669
10670 var props = (_props = {}, _props[SC_ATTR] = stringifyNames(names), _props[SC_VERSION_ATTR] = "4.4.1", _props);
10671
10672 var nonce = getNonce();
10673 if (nonce) {
10674 // $FlowFixMe
10675 props.nonce = nonce;
10676 }
10677
10678 // eslint-disable-next-line react/no-danger
10679 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement('style', _extends({}, props, { dangerouslySetInnerHTML: { __html: css() } }));
10680 };
10681 };
10682
10683 var getIdsFromMarkersFactory = function getIdsFromMarkersFactory(markers) {
10684 return function () {
10685 return Object.keys(markers);
10686 };
10687 };
10688
10689 /* speedy tags utilise insertRule */
10690 var makeSpeedyTag = function makeSpeedyTag(el, getImportRuleTag) {
10691 var names = Object.create(null);
10692 var markers = Object.create(null);
10693 var sizes = [];
10694
10695 var extractImport = getImportRuleTag !== undefined;
10696 /* indicates whether getImportRuleTag was called */
10697 var usedImportRuleTag = false;
10698
10699 var insertMarker = function insertMarker(id) {
10700 var prev = markers[id];
10701 if (prev !== undefined) {
10702 return prev;
10703 }
10704
10705 markers[id] = sizes.length;
10706 sizes.push(0);
10707 resetIdNames(names, id);
10708
10709 return markers[id];
10710 };
10711
10712 var insertRules = function insertRules(id, cssRules, name) {
10713 var marker = insertMarker(id);
10714 var sheet = sheetForTag(el);
10715 var insertIndex = addUpUntilIndex(sizes, marker);
10716
10717 var injectedRules = 0;
10718 var importRules = [];
10719 var cssRulesSize = cssRules.length;
10720
10721 for (var i = 0; i < cssRulesSize; i += 1) {
10722 var cssRule = cssRules[i];
10723 var mayHaveImport = extractImport; /* @import rules are reordered to appear first */
10724 if (mayHaveImport && cssRule.indexOf('@import') !== -1) {
10725 importRules.push(cssRule);
10726 } else if (safeInsertRule(sheet, cssRule, insertIndex + injectedRules)) {
10727 mayHaveImport = false;
10728 injectedRules += 1;
10729 }
10730 }
10731
10732 if (extractImport && importRules.length > 0) {
10733 usedImportRuleTag = true;
10734 // $FlowFixMe
10735 getImportRuleTag().insertRules(id + '-import', importRules);
10736 }
10737
10738 sizes[marker] += injectedRules; /* add up no of injected rules */
10739 addNameForId(names, id, name);
10740 };
10741
10742 var removeRules = function removeRules(id) {
10743 var marker = markers[id];
10744 if (marker === undefined) return;
10745 // $FlowFixMe
10746 if (el.isConnected === false) return;
10747
10748 var size = sizes[marker];
10749 var sheet = sheetForTag(el);
10750 var removalIndex = addUpUntilIndex(sizes, marker) - 1;
10751 deleteRules(sheet, removalIndex, size);
10752 sizes[marker] = 0;
10753 resetIdNames(names, id);
10754
10755 if (extractImport && usedImportRuleTag) {
10756 // $FlowFixMe
10757 getImportRuleTag().removeRules(id + '-import');
10758 }
10759 };
10760
10761 var css = function css() {
10762 var _sheetForTag = sheetForTag(el),
10763 cssRules = _sheetForTag.cssRules;
10764
10765 var str = '';
10766
10767 // eslint-disable-next-line guard-for-in
10768 for (var id in markers) {
10769 str += makeTextMarker(id);
10770 var marker = markers[id];
10771 var end = addUpUntilIndex(sizes, marker);
10772 var size = sizes[marker];
10773 for (var i = end - size; i < end; i += 1) {
10774 var rule = cssRules[i];
10775 if (rule !== undefined) {
10776 str += rule.cssText;
10777 }
10778 }
10779 }
10780
10781 return str;
10782 };
10783
10784 return {
10785 clone: function clone() {
10786 throw new StyledComponentsError(5);
10787 },
10788
10789 css: css,
10790 getIds: getIdsFromMarkersFactory(markers),
10791 hasNameForId: hasNameForId(names),
10792 insertMarker: insertMarker,
10793 insertRules: insertRules,
10794 removeRules: removeRules,
10795 sealed: false,
10796 styleTag: el,
10797 toElement: wrapAsElement(css, names),
10798 toHTML: wrapAsHtmlTag(css, names)
10799 };
10800 };
10801
10802 var makeTextNode = function makeTextNode(targetDocument, id) {
10803 return targetDocument.createTextNode(makeTextMarker(id));
10804 };
10805
10806 var makeBrowserTag = function makeBrowserTag(el, getImportRuleTag) {
10807 var names = Object.create(null);
10808 var markers = Object.create(null);
10809
10810 var extractImport = getImportRuleTag !== undefined;
10811
10812 /* indicates whether getImportRuleTag was called */
10813 var usedImportRuleTag = false;
10814
10815 var insertMarker = function insertMarker(id) {
10816 var prev = markers[id];
10817 if (prev !== undefined) {
10818 return prev;
10819 }
10820
10821 markers[id] = makeTextNode(el.ownerDocument, id);
10822 el.appendChild(markers[id]);
10823 names[id] = Object.create(null);
10824
10825 return markers[id];
10826 };
10827
10828 var insertRules = function insertRules(id, cssRules, name) {
10829 var marker = insertMarker(id);
10830 var importRules = [];
10831 var cssRulesSize = cssRules.length;
10832
10833 for (var i = 0; i < cssRulesSize; i += 1) {
10834 var rule = cssRules[i];
10835 var mayHaveImport = extractImport;
10836 if (mayHaveImport && rule.indexOf('@import') !== -1) {
10837 importRules.push(rule);
10838 } else {
10839 mayHaveImport = false;
10840 var separator = i === cssRulesSize - 1 ? '' : ' ';
10841 marker.appendData('' + rule + separator);
10842 }
10843 }
10844
10845 addNameForId(names, id, name);
10846
10847 if (extractImport && importRules.length > 0) {
10848 usedImportRuleTag = true;
10849 // $FlowFixMe
10850 getImportRuleTag().insertRules(id + '-import', importRules);
10851 }
10852 };
10853
10854 var removeRules = function removeRules(id) {
10855 var marker = markers[id];
10856 if (marker === undefined) return;
10857
10858 /* create new empty text node and replace the current one */
10859 var newMarker = makeTextNode(el.ownerDocument, id);
10860 el.replaceChild(newMarker, marker);
10861 markers[id] = newMarker;
10862 resetIdNames(names, id);
10863
10864 if (extractImport && usedImportRuleTag) {
10865 // $FlowFixMe
10866 getImportRuleTag().removeRules(id + '-import');
10867 }
10868 };
10869
10870 var css = function css() {
10871 var str = '';
10872
10873 // eslint-disable-next-line guard-for-in
10874 for (var id in markers) {
10875 str += markers[id].data;
10876 }
10877
10878 return str;
10879 };
10880
10881 return {
10882 clone: function clone() {
10883 throw new StyledComponentsError(5);
10884 },
10885
10886 css: css,
10887 getIds: getIdsFromMarkersFactory(markers),
10888 hasNameForId: hasNameForId(names),
10889 insertMarker: insertMarker,
10890 insertRules: insertRules,
10891 removeRules: removeRules,
10892 sealed: false,
10893 styleTag: el,
10894 toElement: wrapAsElement(css, names),
10895 toHTML: wrapAsHtmlTag(css, names)
10896 };
10897 };
10898
10899 var makeServerTag = function makeServerTag(namesArg, markersArg) {
10900 var names = namesArg === undefined ? Object.create(null) : namesArg;
10901 var markers = markersArg === undefined ? Object.create(null) : markersArg;
10902
10903 var insertMarker = function insertMarker(id) {
10904 var prev = markers[id];
10905 if (prev !== undefined) {
10906 return prev;
10907 }
10908
10909 return markers[id] = [''];
10910 };
10911
10912 var insertRules = function insertRules(id, cssRules, name) {
10913 var marker = insertMarker(id);
10914 marker[0] += cssRules.join(' ');
10915 addNameForId(names, id, name);
10916 };
10917
10918 var removeRules = function removeRules(id) {
10919 var marker = markers[id];
10920 if (marker === undefined) return;
10921 marker[0] = '';
10922 resetIdNames(names, id);
10923 };
10924
10925 var css = function css() {
10926 var str = '';
10927 // eslint-disable-next-line guard-for-in
10928 for (var id in markers) {
10929 var cssForId = markers[id][0];
10930 if (cssForId) {
10931 str += makeTextMarker(id) + cssForId;
10932 }
10933 }
10934 return str;
10935 };
10936
10937 var clone = function clone() {
10938 var namesClone = cloneNames(names);
10939 var markersClone = Object.create(null);
10940
10941 // eslint-disable-next-line guard-for-in
10942 for (var id in markers) {
10943 markersClone[id] = [markers[id][0]];
10944 }
10945
10946 return makeServerTag(namesClone, markersClone);
10947 };
10948
10949 var tag = {
10950 clone: clone,
10951 css: css,
10952 getIds: getIdsFromMarkersFactory(markers),
10953 hasNameForId: hasNameForId(names),
10954 insertMarker: insertMarker,
10955 insertRules: insertRules,
10956 removeRules: removeRules,
10957 sealed: false,
10958 styleTag: null,
10959 toElement: wrapAsElement(css, names),
10960 toHTML: wrapAsHtmlTag(css, names)
10961 };
10962
10963 return tag;
10964 };
10965
10966 var makeTag = function makeTag(target, tagEl, forceServer, insertBefore, getImportRuleTag) {
10967 if (IS_BROWSER && !forceServer) {
10968 var el = makeStyleTag(target, tagEl, insertBefore);
10969
10970 if (DISABLE_SPEEDY) {
10971 return makeBrowserTag(el, getImportRuleTag);
10972 } else {
10973 return makeSpeedyTag(el, getImportRuleTag);
10974 }
10975 }
10976
10977 return makeServerTag();
10978 };
10979
10980 var rehydrate = function rehydrate(tag, els, extracted) {
10981 /* add all extracted components to the new tag */
10982 for (var i = 0, len = extracted.length; i < len; i += 1) {
10983 var _extracted$i = extracted[i],
10984 componentId = _extracted$i.componentId,
10985 cssFromDOM = _extracted$i.cssFromDOM;
10986
10987 var cssRules = splitByRules(cssFromDOM);
10988 tag.insertRules(componentId, cssRules);
10989 }
10990
10991 /* remove old HTMLStyleElements, since they have been rehydrated */
10992 for (var _i = 0, _len = els.length; _i < _len; _i += 1) {
10993 var el = els[_i];
10994 if (el.parentNode) {
10995 el.parentNode.removeChild(el);
10996 }
10997 }
10998 };
10999
11000 //
11001
11002 var SPLIT_REGEX = /\s+/;
11003
11004 /* determine the maximum number of components before tags are sharded */
11005 var MAX_SIZE = void 0;
11006 if (IS_BROWSER) {
11007 /* in speedy mode we can keep a lot more rules in a sheet before a slowdown can be expected */
11008 MAX_SIZE = DISABLE_SPEEDY ? 40 : 1000;
11009 } else {
11010 /* for servers we do not need to shard at all */
11011 MAX_SIZE = -1;
11012 }
11013
11014 var sheetRunningId = 0;
11015 var master = void 0;
11016
11017 var StyleSheet = function () {
11018
11019 /* a map from ids to tags */
11020
11021 /* deferred rules for a given id */
11022
11023 /* this is used for not reinjecting rules via hasNameForId() */
11024
11025 /* when rules for an id are removed using remove() we have to ignore rehydratedNames for it */
11026
11027 /* a list of tags belonging to this StyleSheet */
11028
11029 /* a tag for import rules */
11030
11031 /* current capacity until a new tag must be created */
11032
11033 /* children (aka clones) of this StyleSheet inheriting all and future injections */
11034
11035 function StyleSheet() {
11036 var _this = this;
11037
11038 var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : IS_BROWSER ? document.head : null;
11039 var forceServer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
11040 classCallCheck(this, StyleSheet);
11041
11042 this.getImportRuleTag = function () {
11043 var importRuleTag = _this.importRuleTag;
11044
11045 if (importRuleTag !== undefined) {
11046 return importRuleTag;
11047 }
11048
11049 var firstTag = _this.tags[0];
11050 var insertBefore = true;
11051
11052 return _this.importRuleTag = makeTag(_this.target, firstTag ? firstTag.styleTag : null, _this.forceServer, insertBefore);
11053 };
11054
11055 sheetRunningId += 1;
11056 this.id = sheetRunningId;
11057 this.forceServer = forceServer;
11058 this.target = forceServer ? null : target;
11059 this.tagMap = {};
11060 this.deferred = {};
11061 this.rehydratedNames = {};
11062 this.ignoreRehydratedNames = {};
11063 this.tags = [];
11064 this.capacity = 1;
11065 this.clones = [];
11066 }
11067
11068 /* rehydrate all SSR'd style tags */
11069
11070
11071 StyleSheet.prototype.rehydrate = function rehydrate$$1() {
11072 if (!IS_BROWSER || this.forceServer) return this;
11073
11074 var els = [];
11075 var extracted = [];
11076 var isStreamed = false;
11077
11078 /* retrieve all of our SSR style elements from the DOM */
11079 var nodes = document.querySelectorAll('style[' + SC_ATTR + '][' + SC_VERSION_ATTR + '="' + "4.4.1" + '"]');
11080
11081 var nodesSize = nodes.length;
11082
11083 /* abort rehydration if no previous style tags were found */
11084 if (!nodesSize) return this;
11085
11086 for (var i = 0; i < nodesSize; i += 1) {
11087 var el = nodes[i];
11088
11089 /* check if style tag is a streamed tag */
11090 if (!isStreamed) isStreamed = !!el.getAttribute(SC_STREAM_ATTR);
11091
11092 /* retrieve all component names */
11093 var elNames = (el.getAttribute(SC_ATTR) || '').trim().split(SPLIT_REGEX);
11094 var elNamesSize = elNames.length;
11095 for (var j = 0, name; j < elNamesSize; j += 1) {
11096 name = elNames[j];
11097 /* add rehydrated name to sheet to avoid re-adding styles */
11098 this.rehydratedNames[name] = true;
11099 }
11100
11101 /* extract all components and their CSS */
11102 extracted.push.apply(extracted, extractComps(el.textContent));
11103
11104 /* store original HTMLStyleElement */
11105 els.push(el);
11106 }
11107
11108 /* abort rehydration if nothing was extracted */
11109 var extractedSize = extracted.length;
11110 if (!extractedSize) return this;
11111
11112 /* create a tag to be used for rehydration */
11113 var tag = this.makeTag(null);
11114
11115 rehydrate(tag, els, extracted);
11116
11117 /* reset capacity and adjust MAX_SIZE by the initial size of the rehydration */
11118 this.capacity = Math.max(1, MAX_SIZE - extractedSize);
11119 this.tags.push(tag);
11120
11121 /* retrieve all component ids */
11122 for (var _j = 0; _j < extractedSize; _j += 1) {
11123 this.tagMap[extracted[_j].componentId] = tag;
11124 }
11125
11126 return this;
11127 };
11128
11129 /* retrieve a "master" instance of StyleSheet which is typically used when no other is available
11130 * The master StyleSheet is targeted by createGlobalStyle, keyframes, and components outside of any
11131 * StyleSheetManager's context */
11132
11133
11134 /* reset the internal "master" instance */
11135 StyleSheet.reset = function reset() {
11136 var forceServer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
11137
11138 master = new StyleSheet(undefined, forceServer).rehydrate();
11139 };
11140
11141 /* adds "children" to the StyleSheet that inherit all of the parents' rules
11142 * while their own rules do not affect the parent */
11143
11144
11145 StyleSheet.prototype.clone = function clone() {
11146 var sheet = new StyleSheet(this.target, this.forceServer);
11147
11148 /* add to clone array */
11149 this.clones.push(sheet);
11150
11151 /* clone all tags */
11152 sheet.tags = this.tags.map(function (tag) {
11153 var ids = tag.getIds();
11154 var newTag = tag.clone();
11155
11156 /* reconstruct tagMap */
11157 for (var i = 0; i < ids.length; i += 1) {
11158 sheet.tagMap[ids[i]] = newTag;
11159 }
11160
11161 return newTag;
11162 });
11163
11164 /* clone other maps */
11165 sheet.rehydratedNames = _extends({}, this.rehydratedNames);
11166 sheet.deferred = _extends({}, this.deferred);
11167
11168 return sheet;
11169 };
11170
11171 /* force StyleSheet to create a new tag on the next injection */
11172
11173
11174 StyleSheet.prototype.sealAllTags = function sealAllTags() {
11175 this.capacity = 1;
11176
11177 this.tags.forEach(function (tag) {
11178 // eslint-disable-next-line no-param-reassign
11179 tag.sealed = true;
11180 });
11181 };
11182
11183 StyleSheet.prototype.makeTag = function makeTag$$1(tag) {
11184 var lastEl = tag ? tag.styleTag : null;
11185 var insertBefore = false;
11186
11187 return makeTag(this.target, lastEl, this.forceServer, insertBefore, this.getImportRuleTag);
11188 };
11189
11190 /* get a tag for a given componentId, assign the componentId to one, or shard */
11191 StyleSheet.prototype.getTagForId = function getTagForId(id) {
11192 /* simply return a tag, when the componentId was already assigned one */
11193 var prev = this.tagMap[id];
11194 if (prev !== undefined && !prev.sealed) {
11195 return prev;
11196 }
11197
11198 var tag = this.tags[this.tags.length - 1];
11199
11200 /* shard (create a new tag) if the tag is exhausted (See MAX_SIZE) */
11201 this.capacity -= 1;
11202
11203 if (this.capacity === 0) {
11204 this.capacity = MAX_SIZE;
11205 tag = this.makeTag(tag);
11206 this.tags.push(tag);
11207 }
11208
11209 return this.tagMap[id] = tag;
11210 };
11211
11212 /* mainly for createGlobalStyle to check for its id */
11213
11214
11215 StyleSheet.prototype.hasId = function hasId(id) {
11216 return this.tagMap[id] !== undefined;
11217 };
11218
11219 /* caching layer checking id+name to already have a corresponding tag and injected rules */
11220
11221
11222 StyleSheet.prototype.hasNameForId = function hasNameForId(id, name) {
11223 /* exception for rehydrated names which are checked separately */
11224 if (this.ignoreRehydratedNames[id] === undefined && this.rehydratedNames[name]) {
11225 return true;
11226 }
11227
11228 var tag = this.tagMap[id];
11229 return tag !== undefined && tag.hasNameForId(id, name);
11230 };
11231
11232 /* registers a componentId and registers it on its tag */
11233
11234
11235 StyleSheet.prototype.deferredInject = function deferredInject(id, cssRules) {
11236 /* don't inject when the id is already registered */
11237 if (this.tagMap[id] !== undefined) return;
11238
11239 var clones = this.clones;
11240
11241 for (var i = 0; i < clones.length; i += 1) {
11242 clones[i].deferredInject(id, cssRules);
11243 }
11244
11245 this.getTagForId(id).insertMarker(id);
11246 this.deferred[id] = cssRules;
11247 };
11248
11249 /* injects rules for a given id with a name that will need to be cached */
11250
11251
11252 StyleSheet.prototype.inject = function inject(id, cssRules, name) {
11253 var clones = this.clones;
11254
11255
11256 for (var i = 0; i < clones.length; i += 1) {
11257 clones[i].inject(id, cssRules, name);
11258 }
11259
11260 var tag = this.getTagForId(id);
11261
11262 /* add deferred rules for component */
11263 if (this.deferred[id] !== undefined) {
11264 // Combine passed cssRules with previously deferred CSS rules
11265 // NOTE: We cannot mutate the deferred array itself as all clones
11266 // do the same (see clones[i].inject)
11267 var rules = this.deferred[id].concat(cssRules);
11268 tag.insertRules(id, rules, name);
11269
11270 this.deferred[id] = undefined;
11271 } else {
11272 tag.insertRules(id, cssRules, name);
11273 }
11274 };
11275
11276 /* removes all rules for a given id, which doesn't remove its marker but resets it */
11277
11278
11279 StyleSheet.prototype.remove = function remove(id) {
11280 var tag = this.tagMap[id];
11281 if (tag === undefined) return;
11282
11283 var clones = this.clones;
11284
11285 for (var i = 0; i < clones.length; i += 1) {
11286 clones[i].remove(id);
11287 }
11288
11289 /* remove all rules from the tag */
11290 tag.removeRules(id);
11291
11292 /* ignore possible rehydrated names */
11293 this.ignoreRehydratedNames[id] = true;
11294
11295 /* delete possible deferred rules */
11296 this.deferred[id] = undefined;
11297 };
11298
11299 StyleSheet.prototype.toHTML = function toHTML() {
11300 return this.tags.map(function (tag) {
11301 return tag.toHTML();
11302 }).join('');
11303 };
11304
11305 StyleSheet.prototype.toReactElements = function toReactElements() {
11306 var id = this.id;
11307
11308
11309 return this.tags.map(function (tag, i) {
11310 var key = 'sc-' + id + '-' + i;
11311 return (0,react__WEBPACK_IMPORTED_MODULE_2__.cloneElement)(tag.toElement(), { key: key });
11312 });
11313 };
11314
11315 createClass(StyleSheet, null, [{
11316 key: 'master',
11317 get: function get$$1() {
11318 return master || (master = new StyleSheet().rehydrate());
11319 }
11320
11321 /* NOTE: This is just for backwards-compatibility with jest-styled-components */
11322
11323 }, {
11324 key: 'instance',
11325 get: function get$$1() {
11326 return StyleSheet.master;
11327 }
11328 }]);
11329 return StyleSheet;
11330 }();
11331
11332 //
11333
11334 var Keyframes = function () {
11335 function Keyframes(name, rules) {
11336 var _this = this;
11337
11338 classCallCheck(this, Keyframes);
11339
11340 this.inject = function (styleSheet) {
11341 if (!styleSheet.hasNameForId(_this.id, _this.name)) {
11342 styleSheet.inject(_this.id, _this.rules, _this.name);
11343 }
11344 };
11345
11346 this.toString = function () {
11347 throw new StyledComponentsError(12, String(_this.name));
11348 };
11349
11350 this.name = name;
11351 this.rules = rules;
11352
11353 this.id = 'sc-keyframes-' + name;
11354 }
11355
11356 Keyframes.prototype.getName = function getName() {
11357 return this.name;
11358 };
11359
11360 return Keyframes;
11361 }();
11362
11363 //
11364
11365 /**
11366 * inlined version of
11367 * https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/hyphenateStyleName.js
11368 */
11369
11370 var uppercasePattern = /([A-Z])/g;
11371 var msPattern = /^ms-/;
11372
11373 /**
11374 * Hyphenates a camelcased CSS property name, for example:
11375 *
11376 * > hyphenateStyleName('backgroundColor')
11377 * < "background-color"
11378 * > hyphenateStyleName('MozTransition')
11379 * < "-moz-transition"
11380 * > hyphenateStyleName('msTransition')
11381 * < "-ms-transition"
11382 *
11383 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
11384 * is converted to `-ms-`.
11385 *
11386 * @param {string} string
11387 * @return {string}
11388 */
11389 function hyphenateStyleName(string) {
11390 return string.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
11391 }
11392
11393 //
11394
11395 // Taken from https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/shared/dangerousStyleValue.js
11396 function addUnitIfNeeded(name, value) {
11397 // https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133
11398 // $FlowFixMe
11399 if (value == null || typeof value === 'boolean' || value === '') {
11400 return '';
11401 }
11402
11403 if (typeof value === 'number' && value !== 0 && !(name in _emotion_unitless__WEBPACK_IMPORTED_MODULE_3__["default"])) {
11404 return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
11405 }
11406
11407 return String(value).trim();
11408 }
11409
11410 //
11411
11412 /**
11413 * It's falsish not falsy because 0 is allowed.
11414 */
11415 var isFalsish = function isFalsish(chunk) {
11416 return chunk === undefined || chunk === null || chunk === false || chunk === '';
11417 };
11418
11419 var objToCssArray = function objToCssArray(obj, prevKey) {
11420 var rules = [];
11421 var keys = Object.keys(obj);
11422
11423 keys.forEach(function (key) {
11424 if (!isFalsish(obj[key])) {
11425 if (isPlainObject(obj[key])) {
11426 rules.push.apply(rules, objToCssArray(obj[key], key));
11427
11428 return rules;
11429 } else if (isFunction(obj[key])) {
11430 rules.push(hyphenateStyleName(key) + ':', obj[key], ';');
11431
11432 return rules;
11433 }
11434 rules.push(hyphenateStyleName(key) + ': ' + addUnitIfNeeded(key, obj[key]) + ';');
11435 }
11436 return rules;
11437 });
11438
11439 return prevKey ? [prevKey + ' {'].concat(rules, ['}']) : rules;
11440 };
11441
11442 function flatten(chunk, executionContext, styleSheet) {
11443 if (Array.isArray(chunk)) {
11444 var ruleSet = [];
11445
11446 for (var i = 0, len = chunk.length, result; i < len; i += 1) {
11447 result = flatten(chunk[i], executionContext, styleSheet);
11448
11449 if (result === null) continue;else if (Array.isArray(result)) ruleSet.push.apply(ruleSet, result);else ruleSet.push(result);
11450 }
11451
11452 return ruleSet;
11453 }
11454
11455 if (isFalsish(chunk)) {
11456 return null;
11457 }
11458
11459 /* Handle other components */
11460 if (isStyledComponent(chunk)) {
11461 return '.' + chunk.styledComponentId;
11462 }
11463
11464 /* Either execute or defer the function */
11465 if (isFunction(chunk)) {
11466 if (isStatelessFunction(chunk) && executionContext) {
11467 var _result = chunk(executionContext);
11468
11469 if ( true && (0,react_is__WEBPACK_IMPORTED_MODULE_4__.isElement)(_result)) {
11470 // eslint-disable-next-line no-console
11471 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.');
11472 }
11473
11474 return flatten(_result, executionContext, styleSheet);
11475 } else return chunk;
11476 }
11477
11478 if (chunk instanceof Keyframes) {
11479 if (styleSheet) {
11480 chunk.inject(styleSheet);
11481 return chunk.getName();
11482 } else return chunk;
11483 }
11484
11485 /* Handle objects */
11486 return isPlainObject(chunk) ? objToCssArray(chunk) : chunk.toString();
11487 }
11488
11489 //
11490
11491 function css(styles) {
11492 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
11493 interpolations[_key - 1] = arguments[_key];
11494 }
11495
11496 if (isFunction(styles) || isPlainObject(styles)) {
11497 // $FlowFixMe
11498 return flatten(interleave(EMPTY_ARRAY, [styles].concat(interpolations)));
11499 }
11500
11501 // $FlowFixMe
11502 return flatten(interleave(styles, interpolations));
11503 }
11504
11505 //
11506
11507 function constructWithOptions(componentConstructor, tag) {
11508 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT;
11509
11510 if (!(0,react_is__WEBPACK_IMPORTED_MODULE_4__.isValidElementType)(tag)) {
11511 throw new StyledComponentsError(1, String(tag));
11512 }
11513
11514 /* This is callable directly as a template function */
11515 // $FlowFixMe: Not typed to avoid destructuring arguments
11516 var templateFunction = function templateFunction() {
11517 return componentConstructor(tag, options, css.apply(undefined, arguments));
11518 };
11519
11520 /* If config methods are called, wrap up a new template function and merge options */
11521 templateFunction.withConfig = function (config) {
11522 return constructWithOptions(componentConstructor, tag, _extends({}, options, config));
11523 };
11524
11525 /* Modify/inject new props at runtime */
11526 templateFunction.attrs = function (attrs) {
11527 return constructWithOptions(componentConstructor, tag, _extends({}, options, {
11528 attrs: Array.prototype.concat(options.attrs, attrs).filter(Boolean)
11529 }));
11530 };
11531
11532 return templateFunction;
11533 }
11534
11535 //
11536 // Source: https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js
11537 function murmurhash(c) {
11538 for (var e = c.length | 0, a = e | 0, d = 0, b; e >= 4;) {
11539 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;
11540 }
11541 switch (e) {
11542 case 3:
11543 a ^= (c.charCodeAt(d + 2) & 255) << 16;
11544 case 2:
11545 a ^= (c.charCodeAt(d + 1) & 255) << 8;
11546 case 1:
11547 a ^= c.charCodeAt(d) & 255, a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16);
11548 }
11549 a ^= a >>> 13;
11550 a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16);
11551 return (a ^ a >>> 15) >>> 0;
11552 }
11553
11554 //
11555 /* eslint-disable no-bitwise */
11556
11557 /* This is the "capacity" of our alphabet i.e. 2x26 for all letters plus their capitalised
11558 * counterparts */
11559 var charsLength = 52;
11560
11561 /* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */
11562 var getAlphabeticChar = function getAlphabeticChar(code) {
11563 return String.fromCharCode(code + (code > 25 ? 39 : 97));
11564 };
11565
11566 /* input a number, usually a hash and convert it to base-52 */
11567 function generateAlphabeticName(code) {
11568 var name = '';
11569 var x = void 0;
11570
11571 /* get a char and divide by alphabet-length */
11572 for (x = code; x > charsLength; x = Math.floor(x / charsLength)) {
11573 name = getAlphabeticChar(x % charsLength) + name;
11574 }
11575
11576 return getAlphabeticChar(x % charsLength) + name;
11577 }
11578
11579 //
11580
11581 function hasFunctionObjectKey(obj) {
11582 // eslint-disable-next-line guard-for-in, no-restricted-syntax
11583 for (var key in obj) {
11584 if (isFunction(obj[key])) {
11585 return true;
11586 }
11587 }
11588
11589 return false;
11590 }
11591
11592 function isStaticRules(rules, attrs) {
11593 for (var i = 0; i < rules.length; i += 1) {
11594 var rule = rules[i];
11595
11596 // recursive case
11597 if (Array.isArray(rule) && !isStaticRules(rule, attrs)) {
11598 return false;
11599 } else if (isFunction(rule) && !isStyledComponent(rule)) {
11600 // functions are allowed to be static if they're just being
11601 // used to get the classname of a nested styled component
11602 return false;
11603 }
11604 }
11605
11606 if (attrs.some(function (x) {
11607 return isFunction(x) || hasFunctionObjectKey(x);
11608 })) return false;
11609
11610 return true;
11611 }
11612
11613 //
11614
11615 /* combines hashStr (murmurhash) and nameGenerator for convenience */
11616 var hasher = function hasher(str) {
11617 return generateAlphabeticName(murmurhash(str));
11618 };
11619
11620 /*
11621 ComponentStyle is all the CSS-specific stuff, not
11622 the React-specific stuff.
11623 */
11624
11625 var ComponentStyle = function () {
11626 function ComponentStyle(rules, attrs, componentId) {
11627 classCallCheck(this, ComponentStyle);
11628
11629 this.rules = rules;
11630 this.isStatic = false && 0;
11631 this.componentId = componentId;
11632
11633 if (!StyleSheet.master.hasId(componentId)) {
11634 StyleSheet.master.deferredInject(componentId, []);
11635 }
11636 }
11637
11638 /*
11639 * Flattens a rule set into valid CSS
11640 * Hashes it, wraps the whole chunk in a .hash1234 {}
11641 * Returns the hash to be injected on render()
11642 * */
11643
11644
11645 ComponentStyle.prototype.generateAndInjectStyles = function generateAndInjectStyles(executionContext, styleSheet) {
11646 var isStatic = this.isStatic,
11647 componentId = this.componentId,
11648 lastClassName = this.lastClassName;
11649
11650 if (IS_BROWSER && isStatic && typeof lastClassName === 'string' && styleSheet.hasNameForId(componentId, lastClassName)) {
11651 return lastClassName;
11652 }
11653
11654 var flatCSS = flatten(this.rules, executionContext, styleSheet);
11655 var name = hasher(this.componentId + flatCSS.join(''));
11656 if (!styleSheet.hasNameForId(componentId, name)) {
11657 styleSheet.inject(this.componentId, stringifyRules(flatCSS, '.' + name, undefined, componentId), name);
11658 }
11659
11660 this.lastClassName = name;
11661 return name;
11662 };
11663
11664 ComponentStyle.generateName = function generateName(str) {
11665 return hasher(str);
11666 };
11667
11668 return ComponentStyle;
11669 }();
11670
11671 //
11672
11673 var LIMIT = 200;
11674
11675 var createWarnTooManyClasses = (function (displayName) {
11676 var generatedClasses = {};
11677 var warningSeen = false;
11678
11679 return function (className) {
11680 if (!warningSeen) {
11681 generatedClasses[className] = true;
11682 if (Object.keys(generatedClasses).length >= LIMIT) {
11683 // Unable to find latestRule in test environment.
11684 /* eslint-disable no-console, prefer-template */
11685 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 />');
11686 warningSeen = true;
11687 generatedClasses = {};
11688 }
11689 }
11690 };
11691 });
11692
11693 //
11694
11695 var determineTheme = (function (props, fallbackTheme) {
11696 var defaultProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT;
11697
11698 // Props should take precedence over ThemeProvider, which should take precedence over
11699 // defaultProps, but React automatically puts defaultProps on props.
11700
11701 /* eslint-disable react/prop-types, flowtype-errors/show-errors */
11702 var isDefaultTheme = defaultProps ? props.theme === defaultProps.theme : false;
11703 var theme = props.theme && !isDefaultTheme ? props.theme : fallbackTheme || defaultProps.theme;
11704 /* eslint-enable */
11705
11706 return theme;
11707 });
11708
11709 //
11710 var escapeRegex = /[[\].#*$><+~=|^:(),"'`-]+/g;
11711 var dashesAtEnds = /(^-|-$)/g;
11712
11713 /**
11714 * TODO: Explore using CSS.escape when it becomes more available
11715 * in evergreen browsers.
11716 */
11717 function escape(str) {
11718 return str
11719 // Replace all possible CSS selectors
11720 .replace(escapeRegex, '-')
11721
11722 // Remove extraneous hyphens at the start and end
11723 .replace(dashesAtEnds, '');
11724 }
11725
11726 //
11727
11728 function isTag(target) {
11729 return typeof target === 'string' && ( true ? target.charAt(0) === target.charAt(0).toLowerCase() : 0);
11730 }
11731
11732 //
11733
11734 function generateDisplayName(target) {
11735 // $FlowFixMe
11736 return isTag(target) ? 'styled.' + target : 'Styled(' + getComponentName(target) + ')';
11737 }
11738
11739 var _TYPE_STATICS;
11740
11741 var REACT_STATICS = {
11742 childContextTypes: true,
11743 contextTypes: true,
11744 defaultProps: true,
11745 displayName: true,
11746 getDerivedStateFromProps: true,
11747 propTypes: true,
11748 type: true
11749 };
11750
11751 var KNOWN_STATICS = {
11752 name: true,
11753 length: true,
11754 prototype: true,
11755 caller: true,
11756 callee: true,
11757 arguments: true,
11758 arity: true
11759 };
11760
11761 var TYPE_STATICS = (_TYPE_STATICS = {}, _TYPE_STATICS[react_is__WEBPACK_IMPORTED_MODULE_4__.ForwardRef] = {
11762 $$typeof: true,
11763 render: true
11764 }, _TYPE_STATICS);
11765
11766 var defineProperty$1 = Object.defineProperty,
11767 getOwnPropertyNames = Object.getOwnPropertyNames,
11768 _Object$getOwnPropert = Object.getOwnPropertySymbols,
11769 getOwnPropertySymbols = _Object$getOwnPropert === undefined ? function () {
11770 return [];
11771 } : _Object$getOwnPropert,
11772 getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor,
11773 getPrototypeOf = Object.getPrototypeOf,
11774 objectPrototype = Object.prototype;
11775 var arrayPrototype = Array.prototype;
11776
11777
11778 function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
11779 if (typeof sourceComponent !== 'string') {
11780 // don't hoist over string (html) components
11781
11782 var inheritedComponent = getPrototypeOf(sourceComponent);
11783
11784 if (inheritedComponent && inheritedComponent !== objectPrototype) {
11785 hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
11786 }
11787
11788 var keys = arrayPrototype.concat(getOwnPropertyNames(sourceComponent),
11789 // $FlowFixMe
11790 getOwnPropertySymbols(sourceComponent));
11791
11792 var targetStatics = TYPE_STATICS[targetComponent.$$typeof] || REACT_STATICS;
11793
11794 var sourceStatics = TYPE_STATICS[sourceComponent.$$typeof] || REACT_STATICS;
11795
11796 var i = keys.length;
11797 var descriptor = void 0;
11798 var key = void 0;
11799
11800 // eslint-disable-next-line no-plusplus
11801 while (i--) {
11802 key = keys[i];
11803
11804 if (
11805 // $FlowFixMe
11806 !KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) &&
11807 // $FlowFixMe
11808 !(targetStatics && targetStatics[key])) {
11809 descriptor = getOwnPropertyDescriptor(sourceComponent, key);
11810
11811 if (descriptor) {
11812 try {
11813 // Avoid failures from read-only properties
11814 defineProperty$1(targetComponent, key, descriptor);
11815 } catch (e) {
11816 /* fail silently */
11817 }
11818 }
11819 }
11820 }
11821
11822 return targetComponent;
11823 }
11824
11825 return targetComponent;
11826 }
11827
11828 //
11829 function isDerivedReactComponent(fn) {
11830 return !!(fn && fn.prototype && fn.prototype.isReactComponent);
11831 }
11832
11833 //
11834 // Helper to call a given function, only once
11835 var once = (function (cb) {
11836 var called = false;
11837
11838 return function () {
11839 if (!called) {
11840 called = true;
11841 cb.apply(undefined, arguments);
11842 }
11843 };
11844 });
11845
11846 //
11847
11848 var ThemeContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)();
11849
11850 var ThemeConsumer = ThemeContext.Consumer;
11851
11852 /**
11853 * Provide a theme to an entire react component tree via context
11854 */
11855
11856 var ThemeProvider = function (_Component) {
11857 inherits(ThemeProvider, _Component);
11858
11859 function ThemeProvider(props) {
11860 classCallCheck(this, ThemeProvider);
11861
11862 var _this = possibleConstructorReturn(this, _Component.call(this, props));
11863
11864 _this.getContext = (0,memoize_one__WEBPACK_IMPORTED_MODULE_7__["default"])(_this.getContext.bind(_this));
11865 _this.renderInner = _this.renderInner.bind(_this);
11866 return _this;
11867 }
11868
11869 ThemeProvider.prototype.render = function render() {
11870 if (!this.props.children) return null;
11871
11872 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
11873 ThemeContext.Consumer,
11874 null,
11875 this.renderInner
11876 );
11877 };
11878
11879 ThemeProvider.prototype.renderInner = function renderInner(outerTheme) {
11880 var context = this.getContext(this.props.theme, outerTheme);
11881
11882 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
11883 ThemeContext.Provider,
11884 { value: context },
11885 this.props.children
11886 );
11887 };
11888
11889 /**
11890 * Get the theme from the props, supporting both (outerTheme) => {}
11891 * as well as object notation
11892 */
11893
11894
11895 ThemeProvider.prototype.getTheme = function getTheme(theme, outerTheme) {
11896 if (isFunction(theme)) {
11897 var mergedTheme = theme(outerTheme);
11898
11899 if ( true && (mergedTheme === null || Array.isArray(mergedTheme) || (typeof mergedTheme === 'undefined' ? 'undefined' : _typeof(mergedTheme)) !== 'object')) {
11900 throw new StyledComponentsError(7);
11901 }
11902
11903 return mergedTheme;
11904 }
11905
11906 if (theme === null || Array.isArray(theme) || (typeof theme === 'undefined' ? 'undefined' : _typeof(theme)) !== 'object') {
11907 throw new StyledComponentsError(8);
11908 }
11909
11910 return _extends({}, outerTheme, theme);
11911 };
11912
11913 ThemeProvider.prototype.getContext = function getContext(theme, outerTheme) {
11914 return this.getTheme(theme, outerTheme);
11915 };
11916
11917 return ThemeProvider;
11918 }(react__WEBPACK_IMPORTED_MODULE_2__.Component);
11919
11920 //
11921
11922 var CLOSING_TAG_R = /^\s*<\/[a-z]/i;
11923
11924 var ServerStyleSheet = function () {
11925 function ServerStyleSheet() {
11926 classCallCheck(this, ServerStyleSheet);
11927
11928 /* The master sheet might be reset, so keep a reference here */
11929 this.masterSheet = StyleSheet.master;
11930 this.instance = this.masterSheet.clone();
11931 this.sealed = false;
11932 }
11933
11934 /**
11935 * Mark the ServerStyleSheet as being fully emitted and manually GC it from the
11936 * StyleSheet singleton.
11937 */
11938
11939
11940 ServerStyleSheet.prototype.seal = function seal() {
11941 if (!this.sealed) {
11942 /* Remove sealed StyleSheets from the master sheet */
11943 var index = this.masterSheet.clones.indexOf(this.instance);
11944 this.masterSheet.clones.splice(index, 1);
11945 this.sealed = true;
11946 }
11947 };
11948
11949 ServerStyleSheet.prototype.collectStyles = function collectStyles(children) {
11950 if (this.sealed) {
11951 throw new StyledComponentsError(2);
11952 }
11953
11954 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
11955 StyleSheetManager,
11956 { sheet: this.instance },
11957 children
11958 );
11959 };
11960
11961 ServerStyleSheet.prototype.getStyleTags = function getStyleTags() {
11962 this.seal();
11963 return this.instance.toHTML();
11964 };
11965
11966 ServerStyleSheet.prototype.getStyleElement = function getStyleElement() {
11967 this.seal();
11968 return this.instance.toReactElements();
11969 };
11970
11971 ServerStyleSheet.prototype.interleaveWithNodeStream = function interleaveWithNodeStream(readableStream) {
11972 var _this = this;
11973
11974 {
11975 throw new StyledComponentsError(3);
11976 }
11977
11978 /* the tag index keeps track of which tags have already been emitted */
11979 var instance = this.instance;
11980
11981 var instanceTagIndex = 0;
11982
11983 var streamAttr = SC_STREAM_ATTR + '="true"';
11984
11985 var transformer = new stream.Transform({
11986 transform: function appendStyleChunks(chunk, /* encoding */_, callback) {
11987 var tags = instance.tags;
11988
11989 var html = '';
11990
11991 /* retrieve html for each new style tag */
11992 for (; instanceTagIndex < tags.length; instanceTagIndex += 1) {
11993 var tag = tags[instanceTagIndex];
11994 html += tag.toHTML(streamAttr);
11995 }
11996
11997 /* force our StyleSheets to emit entirely new tags */
11998 instance.sealAllTags();
11999
12000 var renderedHtml = chunk.toString();
12001
12002 /* prepend style html to chunk, unless the start of the chunk is a closing tag in which case append right after that */
12003 if (CLOSING_TAG_R.test(renderedHtml)) {
12004 var endOfClosingTag = renderedHtml.indexOf('>');
12005
12006 this.push(renderedHtml.slice(0, endOfClosingTag + 1) + html + renderedHtml.slice(endOfClosingTag + 1));
12007 } else this.push(html + renderedHtml);
12008
12009 callback();
12010 }
12011 });
12012
12013 readableStream.on('end', function () {
12014 return _this.seal();
12015 });
12016
12017 readableStream.on('error', function (err) {
12018 _this.seal();
12019
12020 // forward the error to the transform stream
12021 transformer.emit('error', err);
12022 });
12023
12024 return readableStream.pipe(transformer);
12025 };
12026
12027 return ServerStyleSheet;
12028 }();
12029
12030 //
12031
12032 var StyleSheetContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)();
12033 var StyleSheetConsumer = StyleSheetContext.Consumer;
12034
12035 var StyleSheetManager = function (_Component) {
12036 inherits(StyleSheetManager, _Component);
12037
12038 function StyleSheetManager(props) {
12039 classCallCheck(this, StyleSheetManager);
12040
12041 var _this = possibleConstructorReturn(this, _Component.call(this, props));
12042
12043 _this.getContext = (0,memoize_one__WEBPACK_IMPORTED_MODULE_7__["default"])(_this.getContext);
12044 return _this;
12045 }
12046
12047 StyleSheetManager.prototype.getContext = function getContext(sheet, target) {
12048 if (sheet) {
12049 return sheet;
12050 } else if (target) {
12051 return new StyleSheet(target);
12052 } else {
12053 throw new StyledComponentsError(4);
12054 }
12055 };
12056
12057 StyleSheetManager.prototype.render = function render() {
12058 var _props = this.props,
12059 children = _props.children,
12060 sheet = _props.sheet,
12061 target = _props.target;
12062
12063
12064 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12065 StyleSheetContext.Provider,
12066 { value: this.getContext(sheet, target) },
12067 true ? react__WEBPACK_IMPORTED_MODULE_2___default().Children.only(children) : 0
12068 );
12069 };
12070
12071 return StyleSheetManager;
12072 }(react__WEBPACK_IMPORTED_MODULE_2__.Component);
12073 true ? StyleSheetManager.propTypes = {
12074 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)]),
12075
12076 target: prop_types__WEBPACK_IMPORTED_MODULE_8___default().shape({
12077 appendChild: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().func.isRequired)
12078 })
12079 } : 0;
12080
12081 //
12082
12083 var identifiers = {};
12084
12085 /* We depend on components having unique IDs */
12086 function generateId(_ComponentStyle, _displayName, parentComponentId) {
12087 var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);
12088
12089 /**
12090 * This ensures uniqueness if two components happen to share
12091 * the same displayName.
12092 */
12093 var nr = (identifiers[displayName] || 0) + 1;
12094 identifiers[displayName] = nr;
12095
12096 var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);
12097
12098 return parentComponentId ? parentComponentId + '-' + componentId : componentId;
12099 }
12100
12101 // $FlowFixMe
12102
12103 var StyledComponent = function (_Component) {
12104 inherits(StyledComponent, _Component);
12105
12106 function StyledComponent() {
12107 classCallCheck(this, StyledComponent);
12108
12109 var _this = possibleConstructorReturn(this, _Component.call(this));
12110
12111 _this.attrs = {};
12112
12113 _this.renderOuter = _this.renderOuter.bind(_this);
12114 _this.renderInner = _this.renderInner.bind(_this);
12115
12116 if (true) {
12117 _this.warnInnerRef = once(function (displayName) {
12118 return (
12119 // eslint-disable-next-line no-console
12120 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 + '".')
12121 );
12122 });
12123
12124 _this.warnAttrsFnObjectKeyDeprecated = once(function (key, displayName) {
12125 return (
12126 // eslint-disable-next-line no-console
12127 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)
12128 );
12129 });
12130
12131 _this.warnNonStyledComponentAttrsObjectKey = once(function (key, displayName) {
12132 return (
12133 // eslint-disable-next-line no-console
12134 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 }'))
12135 );
12136 });
12137 }
12138 return _this;
12139 }
12140
12141 StyledComponent.prototype.render = function render() {
12142 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12143 StyleSheetConsumer,
12144 null,
12145 this.renderOuter
12146 );
12147 };
12148
12149 StyledComponent.prototype.renderOuter = function renderOuter() {
12150 var styleSheet = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : StyleSheet.master;
12151
12152 this.styleSheet = styleSheet;
12153
12154 // No need to subscribe a static component to theme changes, it won't change anything
12155 if (this.props.forwardedComponent.componentStyle.isStatic) return this.renderInner();
12156
12157 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12158 ThemeConsumer,
12159 null,
12160 this.renderInner
12161 );
12162 };
12163
12164 StyledComponent.prototype.renderInner = function renderInner(theme) {
12165 var _props$forwardedCompo = this.props.forwardedComponent,
12166 componentStyle = _props$forwardedCompo.componentStyle,
12167 defaultProps = _props$forwardedCompo.defaultProps,
12168 displayName = _props$forwardedCompo.displayName,
12169 foldedComponentIds = _props$forwardedCompo.foldedComponentIds,
12170 styledComponentId = _props$forwardedCompo.styledComponentId,
12171 target = _props$forwardedCompo.target;
12172
12173
12174 var generatedClassName = void 0;
12175 if (componentStyle.isStatic) {
12176 generatedClassName = this.generateAndInjectStyles(EMPTY_OBJECT, this.props);
12177 } else {
12178 generatedClassName = this.generateAndInjectStyles(determineTheme(this.props, theme, defaultProps) || EMPTY_OBJECT, this.props);
12179 }
12180
12181 var elementToBeCreated = this.props.as || this.attrs.as || target;
12182 var isTargetTag = isTag(elementToBeCreated);
12183
12184 var propsForElement = {};
12185 var computedProps = _extends({}, this.props, this.attrs);
12186
12187 var key = void 0;
12188 // eslint-disable-next-line guard-for-in
12189 for (key in computedProps) {
12190 if ( true && key === 'innerRef' && isTargetTag) {
12191 this.warnInnerRef(displayName);
12192 }
12193
12194 if (key === 'forwardedComponent' || key === 'as') {
12195 continue;
12196 } 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)) {
12197 // Don't pass through non HTML tags through to HTML elements
12198 propsForElement[key] = computedProps[key];
12199 }
12200 }
12201
12202 if (this.props.style && this.attrs.style) {
12203 propsForElement.style = _extends({}, this.attrs.style, this.props.style);
12204 }
12205
12206 propsForElement.className = Array.prototype.concat(foldedComponentIds, styledComponentId, generatedClassName !== styledComponentId ? generatedClassName : null, this.props.className, this.attrs.className).filter(Boolean).join(' ');
12207
12208 return (0,react__WEBPACK_IMPORTED_MODULE_2__.createElement)(elementToBeCreated, propsForElement);
12209 };
12210
12211 StyledComponent.prototype.buildExecutionContext = function buildExecutionContext(theme, props, attrs) {
12212 var _this2 = this;
12213
12214 var context = _extends({}, props, { theme: theme });
12215
12216 if (!attrs.length) return context;
12217
12218 this.attrs = {};
12219
12220 attrs.forEach(function (attrDef) {
12221 var resolvedAttrDef = attrDef;
12222 var attrDefWasFn = false;
12223 var attr = void 0;
12224 var key = void 0;
12225
12226 if (isFunction(resolvedAttrDef)) {
12227 // $FlowFixMe
12228 resolvedAttrDef = resolvedAttrDef(context);
12229 attrDefWasFn = true;
12230 }
12231
12232 /* eslint-disable guard-for-in */
12233 // $FlowFixMe
12234 for (key in resolvedAttrDef) {
12235 attr = resolvedAttrDef[key];
12236
12237 if (!attrDefWasFn) {
12238 if (isFunction(attr) && !isDerivedReactComponent(attr) && !isStyledComponent(attr)) {
12239 if (true) {
12240 _this2.warnAttrsFnObjectKeyDeprecated(key, props.forwardedComponent.displayName);
12241 }
12242
12243 attr = attr(context);
12244
12245 if ( true && react__WEBPACK_IMPORTED_MODULE_2___default().isValidElement(attr)) {
12246 _this2.warnNonStyledComponentAttrsObjectKey(key, props.forwardedComponent.displayName);
12247 }
12248 }
12249 }
12250
12251 _this2.attrs[key] = attr;
12252 context[key] = attr;
12253 }
12254 /* eslint-enable */
12255 });
12256
12257 return context;
12258 };
12259
12260 StyledComponent.prototype.generateAndInjectStyles = function generateAndInjectStyles(theme, props) {
12261 var _props$forwardedCompo2 = props.forwardedComponent,
12262 attrs = _props$forwardedCompo2.attrs,
12263 componentStyle = _props$forwardedCompo2.componentStyle,
12264 warnTooManyClasses = _props$forwardedCompo2.warnTooManyClasses;
12265
12266 // statically styled-components don't need to build an execution context object,
12267 // and shouldn't be increasing the number of class names
12268
12269 if (componentStyle.isStatic && !attrs.length) {
12270 return componentStyle.generateAndInjectStyles(EMPTY_OBJECT, this.styleSheet);
12271 }
12272
12273 var className = componentStyle.generateAndInjectStyles(this.buildExecutionContext(theme, props, attrs), this.styleSheet);
12274
12275 if ( true && warnTooManyClasses) warnTooManyClasses(className);
12276
12277 return className;
12278 };
12279
12280 return StyledComponent;
12281 }(react__WEBPACK_IMPORTED_MODULE_2__.Component);
12282
12283 function createStyledComponent(target, options, rules) {
12284 var isTargetStyledComp = isStyledComponent(target);
12285 var isClass = !isTag(target);
12286
12287 var _options$displayName = options.displayName,
12288 displayName = _options$displayName === undefined ? generateDisplayName(target) : _options$displayName,
12289 _options$componentId = options.componentId,
12290 componentId = _options$componentId === undefined ? generateId(ComponentStyle, options.displayName, options.parentComponentId) : _options$componentId,
12291 _options$ParentCompon = options.ParentComponent,
12292 ParentComponent = _options$ParentCompon === undefined ? StyledComponent : _options$ParentCompon,
12293 _options$attrs = options.attrs,
12294 attrs = _options$attrs === undefined ? EMPTY_ARRAY : _options$attrs;
12295
12296
12297 var styledComponentId = options.displayName && options.componentId ? escape(options.displayName) + '-' + options.componentId : options.componentId || componentId;
12298
12299 // fold the underlying StyledComponent attrs up (implicit extend)
12300 var finalAttrs =
12301 // $FlowFixMe
12302 isTargetStyledComp && target.attrs ? Array.prototype.concat(target.attrs, attrs).filter(Boolean) : attrs;
12303
12304 var componentStyle = new ComponentStyle(isTargetStyledComp ? // fold the underlying StyledComponent rules up (implicit extend)
12305 // $FlowFixMe
12306 target.componentStyle.rules.concat(rules) : rules, finalAttrs, styledComponentId);
12307
12308 /**
12309 * forwardRef creates a new interim component, which we'll take advantage of
12310 * instead of extending ParentComponent to create _another_ interim class
12311 */
12312 var WrappedStyledComponent = void 0;
12313 var forwardRef = function forwardRef(props, ref) {
12314 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ParentComponent, _extends({}, props, { forwardedComponent: WrappedStyledComponent, forwardedRef: ref }));
12315 };
12316 forwardRef.displayName = displayName;
12317 WrappedStyledComponent = react__WEBPACK_IMPORTED_MODULE_2___default().forwardRef(forwardRef);
12318 WrappedStyledComponent.displayName = displayName;
12319
12320 // $FlowFixMe
12321 WrappedStyledComponent.attrs = finalAttrs;
12322 // $FlowFixMe
12323 WrappedStyledComponent.componentStyle = componentStyle;
12324
12325 // $FlowFixMe
12326 WrappedStyledComponent.foldedComponentIds = isTargetStyledComp ? // $FlowFixMe
12327 Array.prototype.concat(target.foldedComponentIds, target.styledComponentId) : EMPTY_ARRAY;
12328
12329 // $FlowFixMe
12330 WrappedStyledComponent.styledComponentId = styledComponentId;
12331
12332 // fold the underlying StyledComponent target up since we folded the styles
12333 // $FlowFixMe
12334 WrappedStyledComponent.target = isTargetStyledComp ? target.target : target;
12335
12336 // $FlowFixMe
12337 WrappedStyledComponent.withComponent = function withComponent(tag) {
12338 var previousComponentId = options.componentId,
12339 optionsToCopy = objectWithoutProperties(options, ['componentId']);
12340
12341
12342 var newComponentId = previousComponentId && previousComponentId + '-' + (isTag(tag) ? tag : escape(getComponentName(tag)));
12343
12344 var newOptions = _extends({}, optionsToCopy, {
12345 attrs: finalAttrs,
12346 componentId: newComponentId,
12347 ParentComponent: ParentComponent
12348 });
12349
12350 return createStyledComponent(tag, newOptions, rules);
12351 };
12352
12353 // $FlowFixMe
12354 Object.defineProperty(WrappedStyledComponent, 'defaultProps', {
12355 get: function get$$1() {
12356 return this._foldedDefaultProps;
12357 },
12358 set: function set$$1(obj) {
12359 // $FlowFixMe
12360 this._foldedDefaultProps = isTargetStyledComp ? (0,merge_anything__WEBPACK_IMPORTED_MODULE_6__["default"])(target.defaultProps, obj) : obj;
12361 }
12362 });
12363
12364 if (true) {
12365 // $FlowFixMe
12366 WrappedStyledComponent.warnTooManyClasses = createWarnTooManyClasses(displayName);
12367 }
12368
12369 // $FlowFixMe
12370 WrappedStyledComponent.toString = function () {
12371 return '.' + WrappedStyledComponent.styledComponentId;
12372 };
12373
12374 if (isClass) {
12375 hoistNonReactStatics(WrappedStyledComponent, target, {
12376 // all SC-specific things should not be hoisted
12377 attrs: true,
12378 componentStyle: true,
12379 displayName: true,
12380 foldedComponentIds: true,
12381 styledComponentId: true,
12382 target: true,
12383 withComponent: true
12384 });
12385 }
12386
12387 return WrappedStyledComponent;
12388 }
12389
12390 //
12391 // Thanks to ReactDOMFactories for this handy list!
12392
12393 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',
12394
12395 // SVG
12396 'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
12397
12398 //
12399
12400 var styled = function styled(tag) {
12401 return constructWithOptions(createStyledComponent, tag);
12402 };
12403
12404 // Shorthands for all valid HTML Elements
12405 domElements.forEach(function (domElement) {
12406 styled[domElement] = styled(domElement);
12407 });
12408
12409 //
12410
12411 var GlobalStyle = function () {
12412 function GlobalStyle(rules, componentId) {
12413 classCallCheck(this, GlobalStyle);
12414
12415 this.rules = rules;
12416 this.componentId = componentId;
12417 this.isStatic = isStaticRules(rules, EMPTY_ARRAY);
12418
12419 if (!StyleSheet.master.hasId(componentId)) {
12420 StyleSheet.master.deferredInject(componentId, []);
12421 }
12422 }
12423
12424 GlobalStyle.prototype.createStyles = function createStyles(executionContext, styleSheet) {
12425 var flatCSS = flatten(this.rules, executionContext, styleSheet);
12426 var css = stringifyRules(flatCSS, '');
12427
12428 styleSheet.inject(this.componentId, css);
12429 };
12430
12431 GlobalStyle.prototype.removeStyles = function removeStyles(styleSheet) {
12432 var componentId = this.componentId;
12433
12434 if (styleSheet.hasId(componentId)) {
12435 styleSheet.remove(componentId);
12436 }
12437 };
12438
12439 // TODO: overwrite in-place instead of remove+create?
12440
12441
12442 GlobalStyle.prototype.renderStyles = function renderStyles(executionContext, styleSheet) {
12443 this.removeStyles(styleSheet);
12444 this.createStyles(executionContext, styleSheet);
12445 };
12446
12447 return GlobalStyle;
12448 }();
12449
12450 //
12451
12452 // place our cache into shared context so it'll persist between HMRs
12453 if (IS_BROWSER) {
12454 window.scCGSHMRCache = {};
12455 }
12456
12457 function createGlobalStyle(strings) {
12458 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
12459 interpolations[_key - 1] = arguments[_key];
12460 }
12461
12462 var rules = css.apply(undefined, [strings].concat(interpolations));
12463 var id = 'sc-global-' + murmurhash(JSON.stringify(rules));
12464 var style = new GlobalStyle(rules, id);
12465
12466 var GlobalStyleComponent = function (_React$Component) {
12467 inherits(GlobalStyleComponent, _React$Component);
12468
12469 function GlobalStyleComponent(props) {
12470 classCallCheck(this, GlobalStyleComponent);
12471
12472 var _this = possibleConstructorReturn(this, _React$Component.call(this, props));
12473
12474 var _this$constructor = _this.constructor,
12475 globalStyle = _this$constructor.globalStyle,
12476 styledComponentId = _this$constructor.styledComponentId;
12477
12478
12479 if (IS_BROWSER) {
12480 window.scCGSHMRCache[styledComponentId] = (window.scCGSHMRCache[styledComponentId] || 0) + 1;
12481 }
12482
12483 /**
12484 * This fixes HMR compatibility. Don't ask me why, but this combination of
12485 * caching the closure variables via statics and then persisting the statics in
12486 * state works across HMR where no other combination did. ¯\_(ツ)_/¯
12487 */
12488 _this.state = {
12489 globalStyle: globalStyle,
12490 styledComponentId: styledComponentId
12491 };
12492 return _this;
12493 }
12494
12495 GlobalStyleComponent.prototype.componentWillUnmount = function componentWillUnmount() {
12496 if (window.scCGSHMRCache[this.state.styledComponentId]) {
12497 window.scCGSHMRCache[this.state.styledComponentId] -= 1;
12498 }
12499 /**
12500 * Depending on the order "render" is called this can cause the styles to be lost
12501 * until the next render pass of the remaining instance, which may
12502 * not be immediate.
12503 */
12504 if (window.scCGSHMRCache[this.state.styledComponentId] === 0) {
12505 this.state.globalStyle.removeStyles(this.styleSheet);
12506 }
12507 };
12508
12509 GlobalStyleComponent.prototype.render = function render() {
12510 var _this2 = this;
12511
12512 if ( true && react__WEBPACK_IMPORTED_MODULE_2___default().Children.count(this.props.children)) {
12513 // eslint-disable-next-line no-console
12514 console.warn('The global style component ' + this.state.styledComponentId + ' was given child JSX. createGlobalStyle does not render children.');
12515 }
12516
12517 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12518 StyleSheetConsumer,
12519 null,
12520 function (styleSheet) {
12521 _this2.styleSheet = styleSheet || StyleSheet.master;
12522
12523 var globalStyle = _this2.state.globalStyle;
12524
12525
12526 if (globalStyle.isStatic) {
12527 globalStyle.renderStyles(STATIC_EXECUTION_CONTEXT, _this2.styleSheet);
12528
12529 return null;
12530 } else {
12531 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12532 ThemeConsumer,
12533 null,
12534 function (theme) {
12535 // $FlowFixMe
12536 var defaultProps = _this2.constructor.defaultProps;
12537
12538
12539 var context = _extends({}, _this2.props);
12540
12541 if (typeof theme !== 'undefined') {
12542 context.theme = determineTheme(_this2.props, theme, defaultProps);
12543 }
12544
12545 globalStyle.renderStyles(context, _this2.styleSheet);
12546
12547 return null;
12548 }
12549 );
12550 }
12551 }
12552 );
12553 };
12554
12555 return GlobalStyleComponent;
12556 }((react__WEBPACK_IMPORTED_MODULE_2___default().Component));
12557
12558 GlobalStyleComponent.globalStyle = style;
12559 GlobalStyleComponent.styledComponentId = id;
12560
12561
12562 return GlobalStyleComponent;
12563 }
12564
12565 //
12566
12567 var replaceWhitespace = function replaceWhitespace(str) {
12568 return str.replace(/\s|\\n/g, '');
12569 };
12570
12571 function keyframes(strings) {
12572 /* Warning if you've used keyframes on React Native */
12573 if ( true && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
12574 // eslint-disable-next-line no-console
12575 console.warn('`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.');
12576 }
12577
12578 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
12579 interpolations[_key - 1] = arguments[_key];
12580 }
12581
12582 var rules = css.apply(undefined, [strings].concat(interpolations));
12583
12584 var name = generateAlphabeticName(murmurhash(replaceWhitespace(JSON.stringify(rules))));
12585
12586 return new Keyframes(name, stringifyRules(rules, name, '@keyframes'));
12587 }
12588
12589 //
12590
12591 var withTheme = (function (Component$$1) {
12592 var WithTheme = react__WEBPACK_IMPORTED_MODULE_2___default().forwardRef(function (props, ref) {
12593 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12594 ThemeConsumer,
12595 null,
12596 function (theme) {
12597 // $FlowFixMe
12598 var defaultProps = Component$$1.defaultProps;
12599
12600 var themeProp = determineTheme(props, theme, defaultProps);
12601
12602 if ( true && themeProp === undefined) {
12603 // eslint-disable-next-line no-console
12604 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) + '"');
12605 }
12606
12607 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(Component$$1, _extends({}, props, { theme: themeProp, ref: ref }));
12608 }
12609 );
12610 });
12611
12612 hoistNonReactStatics(WithTheme, Component$$1);
12613
12614 WithTheme.displayName = 'WithTheme(' + getComponentName(Component$$1) + ')';
12615
12616 return WithTheme;
12617 });
12618
12619 //
12620
12621 /* eslint-disable */
12622 var __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS = {
12623 StyleSheet: StyleSheet
12624 };
12625
12626 //
12627
12628 /* Warning if you've imported this file on React Native */
12629 if ( true && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
12630 // eslint-disable-next-line no-console
12631 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');
12632 }
12633
12634 /* Warning if there are several instances of styled-components */
12635 if ( true && typeof window !== 'undefined' && typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Node.js') === -1 && navigator.userAgent.indexOf('jsdom') === -1) {
12636 window['__styled-components-init__'] = window['__styled-components-init__'] || 0;
12637
12638 if (window['__styled-components-init__'] === 1) {
12639 // eslint-disable-next-line no-console
12640 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.');
12641 }
12642
12643 window['__styled-components-init__'] += 1;
12644 }
12645
12646 //
12647
12648 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (styled);
12649
12650 //# sourceMappingURL=styled-components.browser.esm.js.map
12651
12652
12653 /***/ }),
12654
12655 /***/ "./node_modules/stylis-rule-sheet/index.js":
12656 /*!*************************************************!*\
12657 !*** ./node_modules/stylis-rule-sheet/index.js ***!
12658 \*************************************************/
12659 /***/ ((module) => {
12660
12661 (function (factory) {
12662 true ? (module['exports'] = factory()) :
12663 0
12664 }(function () {
12665
12666 'use strict'
12667
12668 return function (insertRule) {
12669 var delimiter = '/*|*/'
12670 var needle = delimiter+'}'
12671
12672 function toSheet (block) {
12673 if (block)
12674 try {
12675 insertRule(block + '}')
12676 } catch (e) {}
12677 }
12678
12679 return function ruleSheet (context, content, selectors, parents, line, column, length, ns, depth, at) {
12680 switch (context) {
12681 // property
12682 case 1:
12683 // @import
12684 if (depth === 0 && content.charCodeAt(0) === 64)
12685 return insertRule(content+';'), ''
12686 break
12687 // selector
12688 case 2:
12689 if (ns === 0)
12690 return content + delimiter
12691 break
12692 // at-rule
12693 case 3:
12694 switch (ns) {
12695 // @font-face, @page
12696 case 102:
12697 case 112:
12698 return insertRule(selectors[0]+content), ''
12699 default:
12700 return content + (at === 0 ? delimiter : '')
12701 }
12702 case -2:
12703 content.split(needle).forEach(toSheet)
12704 }
12705 }
12706 }
12707 }))
12708
12709
12710 /***/ }),
12711
12712 /***/ "./node_modules/stylis/stylis.min.js":
12713 /*!*******************************************!*\
12714 !*** ./node_modules/stylis/stylis.min.js ***!
12715 \*******************************************/
12716 /***/ ((module) => {
12717
12718 !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});
12719 //# sourceMappingURL=stylis.min.js.map
12720
12721 /***/ }),
12722
12723 /***/ "react":
12724 /*!************************!*\
12725 !*** external "React" ***!
12726 \************************/
12727 /***/ ((module) => {
12728
12729 "use strict";
12730 module.exports = window["React"];
12731
12732 /***/ }),
12733
12734 /***/ "jquery":
12735 /*!*************************!*\
12736 !*** external "jQuery" ***!
12737 \*************************/
12738 /***/ ((module) => {
12739
12740 "use strict";
12741 module.exports = window["jQuery"];
12742
12743 /***/ }),
12744
12745 /***/ "@wordpress/blocks":
12746 /*!********************************!*\
12747 !*** external ["wp","blocks"] ***!
12748 \********************************/
12749 /***/ ((module) => {
12750
12751 "use strict";
12752 module.exports = window["wp"]["blocks"];
12753
12754 /***/ }),
12755
12756 /***/ "@wordpress/components":
12757 /*!************************************!*\
12758 !*** external ["wp","components"] ***!
12759 \************************************/
12760 /***/ ((module) => {
12761
12762 "use strict";
12763 module.exports = window["wp"]["components"];
12764
12765 /***/ }),
12766
12767 /***/ "@wordpress/data":
12768 /*!******************************!*\
12769 !*** external ["wp","data"] ***!
12770 \******************************/
12771 /***/ ((module) => {
12772
12773 "use strict";
12774 module.exports = window["wp"]["data"];
12775
12776 /***/ }),
12777
12778 /***/ "@wordpress/edit-post":
12779 /*!**********************************!*\
12780 !*** external ["wp","editPost"] ***!
12781 \**********************************/
12782 /***/ ((module) => {
12783
12784 "use strict";
12785 module.exports = window["wp"]["editPost"];
12786
12787 /***/ }),
12788
12789 /***/ "@wordpress/element":
12790 /*!*********************************!*\
12791 !*** external ["wp","element"] ***!
12792 \*********************************/
12793 /***/ ((module) => {
12794
12795 "use strict";
12796 module.exports = window["wp"]["element"];
12797
12798 /***/ }),
12799
12800 /***/ "@wordpress/i18n":
12801 /*!******************************!*\
12802 !*** external ["wp","i18n"] ***!
12803 \******************************/
12804 /***/ ((module) => {
12805
12806 "use strict";
12807 module.exports = window["wp"]["i18n"];
12808
12809 /***/ }),
12810
12811 /***/ "@wordpress/plugins":
12812 /*!*********************************!*\
12813 !*** external ["wp","plugins"] ***!
12814 \*********************************/
12815 /***/ ((module) => {
12816
12817 "use strict";
12818 module.exports = window["wp"]["plugins"];
12819
12820 /***/ }),
12821
12822 /***/ "./node_modules/@linaria/react/dist/index.mjs":
12823 /*!****************************************************!*\
12824 !*** ./node_modules/@linaria/react/dist/index.mjs ***!
12825 \****************************************************/
12826 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12827
12828 "use strict";
12829 __webpack_require__.r(__webpack_exports__);
12830 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12831 /* harmony export */ "styled": () => (/* binding */ styled_default)
12832 /* harmony export */ });
12833 /* 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");
12834 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
12835 /* harmony import */ var _linaria_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/core */ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs");
12836 // src/styled.ts
12837
12838
12839
12840 var isCapital = (ch) => ch.toUpperCase() === ch;
12841 var filterKey = (keys) => (key) => keys.indexOf(key) === -1;
12842 var omit = (obj, keys) => {
12843 const res = {};
12844 Object.keys(obj).filter(filterKey(keys)).forEach((key) => {
12845 res[key] = obj[key];
12846 });
12847 return res;
12848 };
12849 function filterProps(asIs, props, omitKeys) {
12850 const filteredProps = omit(props, omitKeys);
12851 if (!asIs) {
12852 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"];
12853 Object.keys(filteredProps).forEach((key) => {
12854 if (!interopValidAttr.default(key)) {
12855 delete filteredProps[key];
12856 }
12857 });
12858 }
12859 return filteredProps;
12860 }
12861 var warnIfInvalid = (value, componentName) => {
12862 if (true) {
12863 if (typeof value === "string" || typeof value === "number" && isFinite(value)) {
12864 return;
12865 }
12866 const stringified = typeof value === "object" ? JSON.stringify(value) : String(value);
12867 console.warn(
12868 `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.`
12869 );
12870 }
12871 };
12872 function styled(tag) {
12873 return (options) => {
12874 if (true) {
12875 if (Array.isArray(options)) {
12876 throw new Error(
12877 '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'
12878 );
12879 }
12880 }
12881 const render = (props, ref) => {
12882 const { as: component = tag, class: className } = props;
12883 const shouldKeepProps = options.propsAsIs === void 0 ? !(typeof component === "string" && component.indexOf("-") === -1 && !isCapital(component[0])) : options.propsAsIs;
12884 const filteredProps = filterProps(shouldKeepProps, props, [
12885 "as",
12886 "class"
12887 ]);
12888 filteredProps.ref = ref;
12889 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);
12890 const { vars } = options;
12891 if (vars) {
12892 const style = {};
12893 for (const name in vars) {
12894 const variable = vars[name];
12895 const result = variable[0];
12896 const unit = variable[1] || "";
12897 const value = typeof result === "function" ? result(props) : result;
12898 warnIfInvalid(value, options.name);
12899 style[`--${name}`] = `${value}${unit}`;
12900 }
12901 const ownStyle = filteredProps.style || {};
12902 const keys = Object.keys(ownStyle);
12903 if (keys.length > 0) {
12904 keys.forEach((key) => {
12905 style[key] = ownStyle[key];
12906 });
12907 }
12908 filteredProps.style = style;
12909 }
12910 if (tag.__linaria && tag !== component) {
12911 filteredProps.as = component;
12912 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(tag, filteredProps);
12913 }
12914 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(component, filteredProps);
12915 };
12916 const Result = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef ? react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(render) : (props) => {
12917 const rest = omit(props, ["innerRef"]);
12918 return render(rest, props.innerRef);
12919 };
12920 Result.displayName = options.name;
12921 Result.__linaria = {
12922 className: options.class,
12923 extends: tag
12924 };
12925 return Result;
12926 };
12927 }
12928 var styled_default = true ? new Proxy(styled, {
12929 get(o, prop) {
12930 return o(prop);
12931 }
12932 }) : 0;
12933
12934 //# sourceMappingURL=index.mjs.map
12935
12936 /***/ }),
12937
12938 /***/ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs":
12939 /*!*******************************************************************************!*\
12940 !*** ./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs ***!
12941 \*******************************************************************************/
12942 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12943
12944 "use strict";
12945 __webpack_require__.r(__webpack_exports__);
12946 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12947 /* harmony export */ "css": () => (/* binding */ css_default),
12948 /* harmony export */ "cx": () => (/* binding */ cx_default)
12949 /* harmony export */ });
12950 // src/css.ts
12951 var css = () => {
12952 throw new Error(
12953 'Using the "css" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly.'
12954 );
12955 };
12956 var css_default = css;
12957
12958 // src/cx.ts
12959 var cx = function cx2() {
12960 const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
12961 const atomicClasses = {};
12962 const nonAtomicClasses = [];
12963 presentClassNames.forEach((arg) => {
12964 const individualClassNames = arg ? arg.split(" ") : [];
12965 individualClassNames.forEach((className) => {
12966 if (className.startsWith("atm_")) {
12967 const [, keyHash] = className.split("_");
12968 atomicClasses[keyHash] = className;
12969 } else {
12970 nonAtomicClasses.push(className);
12971 }
12972 });
12973 });
12974 const result = [];
12975 for (const keyHash in atomicClasses) {
12976 if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
12977 result.push(atomicClasses[keyHash]);
12978 }
12979 }
12980 result.push(...nonAtomicClasses);
12981 return result.join(" ");
12982 };
12983 var cx_default = cx;
12984
12985 //# sourceMappingURL=index.mjs.map
12986
12987 /***/ })
12988
12989 /******/ });
12990 /************************************************************************/
12991 /******/ // The module cache
12992 /******/ var __webpack_module_cache__ = {};
12993 /******/
12994 /******/ // The require function
12995 /******/ function __webpack_require__(moduleId) {
12996 /******/ // Check if module is in cache
12997 /******/ var cachedModule = __webpack_module_cache__[moduleId];
12998 /******/ if (cachedModule !== undefined) {
12999 /******/ return cachedModule.exports;
13000 /******/ }
13001 /******/ // Create a new module (and put it into the cache)
13002 /******/ var module = __webpack_module_cache__[moduleId] = {
13003 /******/ // no module.id needed
13004 /******/ // no module.loaded needed
13005 /******/ exports: {}
13006 /******/ };
13007 /******/
13008 /******/ // Execute the module function
13009 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
13010 /******/
13011 /******/ // Return the exports of the module
13012 /******/ return module.exports;
13013 /******/ }
13014 /******/
13015 /************************************************************************/
13016 /******/ /* webpack/runtime/compat get default export */
13017 /******/ (() => {
13018 /******/ // getDefaultExport function for compatibility with non-harmony modules
13019 /******/ __webpack_require__.n = (module) => {
13020 /******/ var getter = module && module.__esModule ?
13021 /******/ () => (module['default']) :
13022 /******/ () => (module);
13023 /******/ __webpack_require__.d(getter, { a: getter });
13024 /******/ return getter;
13025 /******/ };
13026 /******/ })();
13027 /******/
13028 /******/ /* webpack/runtime/define property getters */
13029 /******/ (() => {
13030 /******/ // define getter functions for harmony exports
13031 /******/ __webpack_require__.d = (exports, definition) => {
13032 /******/ for(var key in definition) {
13033 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
13034 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
13035 /******/ }
13036 /******/ }
13037 /******/ };
13038 /******/ })();
13039 /******/
13040 /******/ /* webpack/runtime/global */
13041 /******/ (() => {
13042 /******/ __webpack_require__.g = (function() {
13043 /******/ if (typeof globalThis === 'object') return globalThis;
13044 /******/ try {
13045 /******/ return this || new Function('return this')();
13046 /******/ } catch (e) {
13047 /******/ if (typeof window === 'object') return window;
13048 /******/ }
13049 /******/ })();
13050 /******/ })();
13051 /******/
13052 /******/ /* webpack/runtime/hasOwnProperty shorthand */
13053 /******/ (() => {
13054 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
13055 /******/ })();
13056 /******/
13057 /******/ /* webpack/runtime/make namespace object */
13058 /******/ (() => {
13059 /******/ // define __esModule on exports
13060 /******/ __webpack_require__.r = (exports) => {
13061 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
13062 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13063 /******/ }
13064 /******/ Object.defineProperty(exports, '__esModule', { value: true });
13065 /******/ };
13066 /******/ })();
13067 /******/
13068 /******/ /* webpack/runtime/nonce */
13069 /******/ (() => {
13070 /******/ __webpack_require__.nc = undefined;
13071 /******/ })();
13072 /******/
13073 /************************************************************************/
13074 var __webpack_exports__ = {};
13075 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
13076 (() => {
13077 "use strict";
13078 /*!**************************************!*\
13079 !*** ./scripts/entries/gutenberg.ts ***!
13080 \**************************************/
13081 __webpack_require__.r(__webpack_exports__);
13082 /* harmony import */ var _gutenberg_FormBlock_registerFormBlock__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../gutenberg/FormBlock/registerFormBlock */ "./scripts/gutenberg/FormBlock/registerFormBlock.tsx");
13083 /* harmony import */ var _gutenberg_Sidebar_contentType__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../gutenberg/Sidebar/contentType */ "./scripts/gutenberg/Sidebar/contentType.tsx");
13084 /* harmony import */ var _gutenberg_MeetingsBlock_registerMeetingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../gutenberg/MeetingsBlock/registerMeetingBlock */ "./scripts/gutenberg/MeetingsBlock/registerMeetingBlock.tsx");
13085 /* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts");
13086
13087
13088
13089
13090 (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]);
13091 })();
13092
13093 /******/ })()
13094 ;
13095 //# sourceMappingURL=gutenberg.js.map