@bigbinary/neeto-molecules 1.1.64 → 1.1.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,14 @@
1
- import React, { useRef, forwardRef } from 'react';
2
- import { Upload, LeftArrow } from '@bigbinary/neeto-icons';
3
- import { Typography, Button, Toastr, DatePicker, Label } from '@bigbinary/neetoui';
1
+ import React, { useState, useRef, forwardRef } from 'react';
2
+ import { Download, Upload, LeftArrow } from '@bigbinary/neeto-icons';
3
+ import { Typography, Button, Callout, Pane, Toastr, DatePicker, Label } from '@bigbinary/neetoui';
4
4
  import { MultiEmailInput, Input, Switch, ActionBlock, Form as Form$1 } from '@bigbinary/neetoui/formik';
5
- import { useTranslation } from 'react-i18next';
5
+ import { Trans, useTranslation } from 'react-i18next';
6
6
  import classnames from 'classnames';
7
- import { isPresent, isNotEmpty } from '@bigbinary/neeto-cist';
7
+ import { isPresent } from '@bigbinary/neeto-cist';
8
8
  import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
9
9
  import { EditorContent, FormikEditor, isEditorEmpty } from '@bigbinary/neeto-editor';
10
10
  import { useFormikContext, useField } from 'formik';
11
+ import { useDropzone } from 'react-dropzone';
11
12
  import { t } from 'i18next';
12
13
  import Papa from 'papaparse';
13
14
  import { prop } from 'ramda';
@@ -15,1248 +16,23 @@ import * as yup from 'yup';
15
16
  import { string } from 'yup';
16
17
  import dayjs from 'dayjs';
17
18
 
18
- function _typeof$1(obj) {
19
- "@babel/helpers - typeof";
20
-
21
- return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
22
- return typeof obj;
23
- } : function (obj) {
24
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
25
- }, _typeof$1(obj);
26
- }
27
-
28
- function _toPrimitive(input, hint) {
29
- if (_typeof$1(input) !== "object" || input === null) return input;
30
- var prim = input[Symbol.toPrimitive];
31
- if (prim !== undefined) {
32
- var res = prim.call(input, hint || "default");
33
- if (_typeof$1(res) !== "object") return res;
34
- throw new TypeError("@@toPrimitive must return a primitive value.");
35
- }
36
- return (hint === "string" ? String : Number)(input);
37
- }
38
-
39
- function _toPropertyKey(arg) {
40
- var key = _toPrimitive(arg, "string");
41
- return _typeof$1(key) === "symbol" ? key : String(key);
42
- }
43
-
44
- function _defineProperty(obj, key, value) {
45
- key = _toPropertyKey(key);
46
- if (key in obj) {
47
- Object.defineProperty(obj, key, {
48
- value: value,
49
- enumerable: true,
50
- configurable: true,
51
- writable: true
52
- });
53
- } else {
54
- obj[key] = value;
55
- }
56
- return obj;
57
- }
58
-
59
- var propTypes = {exports: {}};
60
-
61
- var reactIs = {exports: {}};
62
-
63
- var reactIs_production_min = {};
64
-
65
- /** @license React v16.13.1
66
- * react-is.production.min.js
67
- *
68
- * Copyright (c) Facebook, Inc. and its affiliates.
69
- *
70
- * This source code is licensed under the MIT license found in the
71
- * LICENSE file in the root directory of this source tree.
72
- */
73
-
74
- var hasRequiredReactIs_production_min;
75
-
76
- function requireReactIs_production_min () {
77
- if (hasRequiredReactIs_production_min) return reactIs_production_min;
78
- hasRequiredReactIs_production_min = 1;
79
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
80
- Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
81
- function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
82
- reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
83
- reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
84
- reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
85
- return reactIs_production_min;
86
- }
87
-
88
- var reactIs_development = {};
89
-
90
- /** @license React v16.13.1
91
- * react-is.development.js
92
- *
93
- * Copyright (c) Facebook, Inc. and its affiliates.
94
- *
95
- * This source code is licensed under the MIT license found in the
96
- * LICENSE file in the root directory of this source tree.
97
- */
98
-
99
- var hasRequiredReactIs_development;
100
-
101
- function requireReactIs_development () {
102
- if (hasRequiredReactIs_development) return reactIs_development;
103
- hasRequiredReactIs_development = 1;
104
-
105
-
106
-
107
- if (process.env.NODE_ENV !== "production") {
108
- (function() {
109
-
110
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
111
- // nor polyfill, then a plain number is used for performance.
112
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
113
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
114
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
115
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
116
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
117
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
118
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
119
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
120
- // (unstable) APIs that have been removed. Can we remove the symbols?
121
-
122
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
123
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
124
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
125
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
126
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
127
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
128
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
129
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
130
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
131
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
132
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
133
-
134
- function isValidElementType(type) {
135
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
136
- 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);
137
- }
138
-
139
- function typeOf(object) {
140
- if (typeof object === 'object' && object !== null) {
141
- var $$typeof = object.$$typeof;
142
-
143
- switch ($$typeof) {
144
- case REACT_ELEMENT_TYPE:
145
- var type = object.type;
146
-
147
- switch (type) {
148
- case REACT_ASYNC_MODE_TYPE:
149
- case REACT_CONCURRENT_MODE_TYPE:
150
- case REACT_FRAGMENT_TYPE:
151
- case REACT_PROFILER_TYPE:
152
- case REACT_STRICT_MODE_TYPE:
153
- case REACT_SUSPENSE_TYPE:
154
- return type;
155
-
156
- default:
157
- var $$typeofType = type && type.$$typeof;
158
-
159
- switch ($$typeofType) {
160
- case REACT_CONTEXT_TYPE:
161
- case REACT_FORWARD_REF_TYPE:
162
- case REACT_LAZY_TYPE:
163
- case REACT_MEMO_TYPE:
164
- case REACT_PROVIDER_TYPE:
165
- return $$typeofType;
166
-
167
- default:
168
- return $$typeof;
169
- }
170
-
171
- }
172
-
173
- case REACT_PORTAL_TYPE:
174
- return $$typeof;
175
- }
176
- }
177
-
178
- return undefined;
179
- } // AsyncMode is deprecated along with isAsyncMode
180
-
181
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
182
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
183
- var ContextConsumer = REACT_CONTEXT_TYPE;
184
- var ContextProvider = REACT_PROVIDER_TYPE;
185
- var Element = REACT_ELEMENT_TYPE;
186
- var ForwardRef = REACT_FORWARD_REF_TYPE;
187
- var Fragment = REACT_FRAGMENT_TYPE;
188
- var Lazy = REACT_LAZY_TYPE;
189
- var Memo = REACT_MEMO_TYPE;
190
- var Portal = REACT_PORTAL_TYPE;
191
- var Profiler = REACT_PROFILER_TYPE;
192
- var StrictMode = REACT_STRICT_MODE_TYPE;
193
- var Suspense = REACT_SUSPENSE_TYPE;
194
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
195
-
196
- function isAsyncMode(object) {
197
- {
198
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
199
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
200
-
201
- 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.');
202
- }
203
- }
204
-
205
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
206
- }
207
- function isConcurrentMode(object) {
208
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
209
- }
210
- function isContextConsumer(object) {
211
- return typeOf(object) === REACT_CONTEXT_TYPE;
212
- }
213
- function isContextProvider(object) {
214
- return typeOf(object) === REACT_PROVIDER_TYPE;
215
- }
216
- function isElement(object) {
217
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
218
- }
219
- function isForwardRef(object) {
220
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
221
- }
222
- function isFragment(object) {
223
- return typeOf(object) === REACT_FRAGMENT_TYPE;
224
- }
225
- function isLazy(object) {
226
- return typeOf(object) === REACT_LAZY_TYPE;
227
- }
228
- function isMemo(object) {
229
- return typeOf(object) === REACT_MEMO_TYPE;
230
- }
231
- function isPortal(object) {
232
- return typeOf(object) === REACT_PORTAL_TYPE;
233
- }
234
- function isProfiler(object) {
235
- return typeOf(object) === REACT_PROFILER_TYPE;
236
- }
237
- function isStrictMode(object) {
238
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
239
- }
240
- function isSuspense(object) {
241
- return typeOf(object) === REACT_SUSPENSE_TYPE;
242
- }
243
-
244
- reactIs_development.AsyncMode = AsyncMode;
245
- reactIs_development.ConcurrentMode = ConcurrentMode;
246
- reactIs_development.ContextConsumer = ContextConsumer;
247
- reactIs_development.ContextProvider = ContextProvider;
248
- reactIs_development.Element = Element;
249
- reactIs_development.ForwardRef = ForwardRef;
250
- reactIs_development.Fragment = Fragment;
251
- reactIs_development.Lazy = Lazy;
252
- reactIs_development.Memo = Memo;
253
- reactIs_development.Portal = Portal;
254
- reactIs_development.Profiler = Profiler;
255
- reactIs_development.StrictMode = StrictMode;
256
- reactIs_development.Suspense = Suspense;
257
- reactIs_development.isAsyncMode = isAsyncMode;
258
- reactIs_development.isConcurrentMode = isConcurrentMode;
259
- reactIs_development.isContextConsumer = isContextConsumer;
260
- reactIs_development.isContextProvider = isContextProvider;
261
- reactIs_development.isElement = isElement;
262
- reactIs_development.isForwardRef = isForwardRef;
263
- reactIs_development.isFragment = isFragment;
264
- reactIs_development.isLazy = isLazy;
265
- reactIs_development.isMemo = isMemo;
266
- reactIs_development.isPortal = isPortal;
267
- reactIs_development.isProfiler = isProfiler;
268
- reactIs_development.isStrictMode = isStrictMode;
269
- reactIs_development.isSuspense = isSuspense;
270
- reactIs_development.isValidElementType = isValidElementType;
271
- reactIs_development.typeOf = typeOf;
272
- })();
273
- }
274
- return reactIs_development;
275
- }
276
-
277
- var hasRequiredReactIs;
278
-
279
- function requireReactIs () {
280
- if (hasRequiredReactIs) return reactIs.exports;
281
- hasRequiredReactIs = 1;
282
- (function (module) {
283
-
284
- if (process.env.NODE_ENV === 'production') {
285
- module.exports = requireReactIs_production_min();
286
- } else {
287
- module.exports = requireReactIs_development();
288
- }
289
- } (reactIs));
290
- return reactIs.exports;
291
- }
292
-
293
- /*
294
- object-assign
295
- (c) Sindre Sorhus
296
- @license MIT
297
- */
298
-
299
- var objectAssign;
300
- var hasRequiredObjectAssign;
301
-
302
- function requireObjectAssign () {
303
- if (hasRequiredObjectAssign) return objectAssign;
304
- hasRequiredObjectAssign = 1;
305
- /* eslint-disable no-unused-vars */
306
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
307
- var hasOwnProperty = Object.prototype.hasOwnProperty;
308
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
309
-
310
- function toObject(val) {
311
- if (val === null || val === undefined) {
312
- throw new TypeError('Object.assign cannot be called with null or undefined');
313
- }
314
-
315
- return Object(val);
316
- }
317
-
318
- function shouldUseNative() {
319
- try {
320
- if (!Object.assign) {
321
- return false;
322
- }
323
-
324
- // Detect buggy property enumeration order in older V8 versions.
325
-
326
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
327
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
328
- test1[5] = 'de';
329
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
330
- return false;
331
- }
332
-
333
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
334
- var test2 = {};
335
- for (var i = 0; i < 10; i++) {
336
- test2['_' + String.fromCharCode(i)] = i;
337
- }
338
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
339
- return test2[n];
340
- });
341
- if (order2.join('') !== '0123456789') {
342
- return false;
343
- }
344
-
345
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
346
- var test3 = {};
347
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
348
- test3[letter] = letter;
349
- });
350
- if (Object.keys(Object.assign({}, test3)).join('') !==
351
- 'abcdefghijklmnopqrst') {
352
- return false;
353
- }
354
-
355
- return true;
356
- } catch (err) {
357
- // We don't expect any of the above to throw, but better to be safe.
358
- return false;
359
- }
360
- }
361
-
362
- objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
363
- var from;
364
- var to = toObject(target);
365
- var symbols;
366
-
367
- for (var s = 1; s < arguments.length; s++) {
368
- from = Object(arguments[s]);
369
-
370
- for (var key in from) {
371
- if (hasOwnProperty.call(from, key)) {
372
- to[key] = from[key];
373
- }
374
- }
375
-
376
- if (getOwnPropertySymbols) {
377
- symbols = getOwnPropertySymbols(from);
378
- for (var i = 0; i < symbols.length; i++) {
379
- if (propIsEnumerable.call(from, symbols[i])) {
380
- to[symbols[i]] = from[symbols[i]];
381
- }
382
- }
383
- }
384
- }
385
-
386
- return to;
387
- };
388
- return objectAssign;
389
- }
390
-
391
- /**
392
- * Copyright (c) 2013-present, Facebook, Inc.
393
- *
394
- * This source code is licensed under the MIT license found in the
395
- * LICENSE file in the root directory of this source tree.
396
- */
397
-
398
- var ReactPropTypesSecret_1;
399
- var hasRequiredReactPropTypesSecret;
400
-
401
- function requireReactPropTypesSecret () {
402
- if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
403
- hasRequiredReactPropTypesSecret = 1;
404
-
405
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
406
-
407
- ReactPropTypesSecret_1 = ReactPropTypesSecret;
408
- return ReactPropTypesSecret_1;
409
- }
410
-
411
- var has;
412
- var hasRequiredHas;
413
-
414
- function requireHas () {
415
- if (hasRequiredHas) return has;
416
- hasRequiredHas = 1;
417
- has = Function.call.bind(Object.prototype.hasOwnProperty);
418
- return has;
419
- }
420
-
421
- /**
422
- * Copyright (c) 2013-present, Facebook, Inc.
423
- *
424
- * This source code is licensed under the MIT license found in the
425
- * LICENSE file in the root directory of this source tree.
426
- */
427
-
428
- var checkPropTypes_1;
429
- var hasRequiredCheckPropTypes;
430
-
431
- function requireCheckPropTypes () {
432
- if (hasRequiredCheckPropTypes) return checkPropTypes_1;
433
- hasRequiredCheckPropTypes = 1;
434
-
435
- var printWarning = function() {};
436
-
437
- if (process.env.NODE_ENV !== 'production') {
438
- var ReactPropTypesSecret = requireReactPropTypesSecret();
439
- var loggedTypeFailures = {};
440
- var has = requireHas();
441
-
442
- printWarning = function(text) {
443
- var message = 'Warning: ' + text;
444
- if (typeof console !== 'undefined') {
445
- console.error(message);
446
- }
447
- try {
448
- // --- Welcome to debugging React ---
449
- // This error was thrown as a convenience so that you can use this stack
450
- // to find the callsite that caused this warning to fire.
451
- throw new Error(message);
452
- } catch (x) { /**/ }
453
- };
454
- }
455
-
456
- /**
457
- * Assert that the values match with the type specs.
458
- * Error messages are memorized and will only be shown once.
459
- *
460
- * @param {object} typeSpecs Map of name to a ReactPropType
461
- * @param {object} values Runtime values that need to be type-checked
462
- * @param {string} location e.g. "prop", "context", "child context"
463
- * @param {string} componentName Name of the component for error messages.
464
- * @param {?Function} getStack Returns the component stack.
465
- * @private
466
- */
467
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
468
- if (process.env.NODE_ENV !== 'production') {
469
- for (var typeSpecName in typeSpecs) {
470
- if (has(typeSpecs, typeSpecName)) {
471
- var error;
472
- // Prop type validation may throw. In case they do, we don't want to
473
- // fail the render phase where it didn't fail before. So we log it.
474
- // After these have been cleaned up, we'll let them throw.
475
- try {
476
- // This is intentionally an invariant that gets caught. It's the same
477
- // behavior as without this statement except with a better message.
478
- if (typeof typeSpecs[typeSpecName] !== 'function') {
479
- var err = Error(
480
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
481
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
482
- 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
483
- );
484
- err.name = 'Invariant Violation';
485
- throw err;
486
- }
487
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
488
- } catch (ex) {
489
- error = ex;
490
- }
491
- if (error && !(error instanceof Error)) {
492
- printWarning(
493
- (componentName || 'React class') + ': type specification of ' +
494
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
495
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
496
- 'You may have forgotten to pass an argument to the type checker ' +
497
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
498
- 'shape all require an argument).'
499
- );
500
- }
501
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
502
- // Only monitor this failure once because there tends to be a lot of the
503
- // same error.
504
- loggedTypeFailures[error.message] = true;
505
-
506
- var stack = getStack ? getStack() : '';
507
-
508
- printWarning(
509
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
510
- );
511
- }
512
- }
513
- }
514
- }
515
- }
516
-
517
- /**
518
- * Resets warning cache when testing.
519
- *
520
- * @private
521
- */
522
- checkPropTypes.resetWarningCache = function() {
523
- if (process.env.NODE_ENV !== 'production') {
524
- loggedTypeFailures = {};
525
- }
526
- };
527
-
528
- checkPropTypes_1 = checkPropTypes;
529
- return checkPropTypes_1;
530
- }
531
-
532
- /**
533
- * Copyright (c) 2013-present, Facebook, Inc.
534
- *
535
- * This source code is licensed under the MIT license found in the
536
- * LICENSE file in the root directory of this source tree.
537
- */
538
-
539
- var factoryWithTypeCheckers;
540
- var hasRequiredFactoryWithTypeCheckers;
541
-
542
- function requireFactoryWithTypeCheckers () {
543
- if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
544
- hasRequiredFactoryWithTypeCheckers = 1;
545
-
546
- var ReactIs = requireReactIs();
547
- var assign = requireObjectAssign();
548
-
549
- var ReactPropTypesSecret = requireReactPropTypesSecret();
550
- var has = requireHas();
551
- var checkPropTypes = requireCheckPropTypes();
552
-
553
- var printWarning = function() {};
554
-
555
- if (process.env.NODE_ENV !== 'production') {
556
- printWarning = function(text) {
557
- var message = 'Warning: ' + text;
558
- if (typeof console !== 'undefined') {
559
- console.error(message);
560
- }
561
- try {
562
- // --- Welcome to debugging React ---
563
- // This error was thrown as a convenience so that you can use this stack
564
- // to find the callsite that caused this warning to fire.
565
- throw new Error(message);
566
- } catch (x) {}
567
- };
568
- }
569
-
570
- function emptyFunctionThatReturnsNull() {
571
- return null;
572
- }
573
-
574
- factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
575
- /* global Symbol */
576
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
577
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
578
-
579
- /**
580
- * Returns the iterator method function contained on the iterable object.
581
- *
582
- * Be sure to invoke the function with the iterable as context:
583
- *
584
- * var iteratorFn = getIteratorFn(myIterable);
585
- * if (iteratorFn) {
586
- * var iterator = iteratorFn.call(myIterable);
587
- * ...
588
- * }
589
- *
590
- * @param {?object} maybeIterable
591
- * @return {?function}
592
- */
593
- function getIteratorFn(maybeIterable) {
594
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
595
- if (typeof iteratorFn === 'function') {
596
- return iteratorFn;
597
- }
598
- }
599
-
600
- /**
601
- * Collection of methods that allow declaration and validation of props that are
602
- * supplied to React components. Example usage:
603
- *
604
- * var Props = require('ReactPropTypes');
605
- * var MyArticle = React.createClass({
606
- * propTypes: {
607
- * // An optional string prop named "description".
608
- * description: Props.string,
609
- *
610
- * // A required enum prop named "category".
611
- * category: Props.oneOf(['News','Photos']).isRequired,
612
- *
613
- * // A prop named "dialog" that requires an instance of Dialog.
614
- * dialog: Props.instanceOf(Dialog).isRequired
615
- * },
616
- * render: function() { ... }
617
- * });
618
- *
619
- * A more formal specification of how these methods are used:
620
- *
621
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
622
- * decl := ReactPropTypes.{type}(.isRequired)?
623
- *
624
- * Each and every declaration produces a function with the same signature. This
625
- * allows the creation of custom validation functions. For example:
626
- *
627
- * var MyLink = React.createClass({
628
- * propTypes: {
629
- * // An optional string or URI prop named "href".
630
- * href: function(props, propName, componentName) {
631
- * var propValue = props[propName];
632
- * if (propValue != null && typeof propValue !== 'string' &&
633
- * !(propValue instanceof URI)) {
634
- * return new Error(
635
- * 'Expected a string or an URI for ' + propName + ' in ' +
636
- * componentName
637
- * );
638
- * }
639
- * }
640
- * },
641
- * render: function() {...}
642
- * });
643
- *
644
- * @internal
645
- */
646
-
647
- var ANONYMOUS = '<<anonymous>>';
648
-
649
- // Important!
650
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
651
- var ReactPropTypes = {
652
- array: createPrimitiveTypeChecker('array'),
653
- bigint: createPrimitiveTypeChecker('bigint'),
654
- bool: createPrimitiveTypeChecker('boolean'),
655
- func: createPrimitiveTypeChecker('function'),
656
- number: createPrimitiveTypeChecker('number'),
657
- object: createPrimitiveTypeChecker('object'),
658
- string: createPrimitiveTypeChecker('string'),
659
- symbol: createPrimitiveTypeChecker('symbol'),
660
-
661
- any: createAnyTypeChecker(),
662
- arrayOf: createArrayOfTypeChecker,
663
- element: createElementTypeChecker(),
664
- elementType: createElementTypeTypeChecker(),
665
- instanceOf: createInstanceTypeChecker,
666
- node: createNodeChecker(),
667
- objectOf: createObjectOfTypeChecker,
668
- oneOf: createEnumTypeChecker,
669
- oneOfType: createUnionTypeChecker,
670
- shape: createShapeTypeChecker,
671
- exact: createStrictShapeTypeChecker,
672
- };
673
-
674
- /**
675
- * inlined Object.is polyfill to avoid requiring consumers ship their own
676
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
677
- */
678
- /*eslint-disable no-self-compare*/
679
- function is(x, y) {
680
- // SameValue algorithm
681
- if (x === y) {
682
- // Steps 1-5, 7-10
683
- // Steps 6.b-6.e: +0 != -0
684
- return x !== 0 || 1 / x === 1 / y;
685
- } else {
686
- // Step 6.a: NaN == NaN
687
- return x !== x && y !== y;
688
- }
689
- }
690
- /*eslint-enable no-self-compare*/
691
-
692
- /**
693
- * We use an Error-like object for backward compatibility as people may call
694
- * PropTypes directly and inspect their output. However, we don't use real
695
- * Errors anymore. We don't inspect their stack anyway, and creating them
696
- * is prohibitively expensive if they are created too often, such as what
697
- * happens in oneOfType() for any type before the one that matched.
698
- */
699
- function PropTypeError(message, data) {
700
- this.message = message;
701
- this.data = data && typeof data === 'object' ? data: {};
702
- this.stack = '';
703
- }
704
- // Make `instanceof Error` still work for returned errors.
705
- PropTypeError.prototype = Error.prototype;
706
-
707
- function createChainableTypeChecker(validate) {
708
- if (process.env.NODE_ENV !== 'production') {
709
- var manualPropTypeCallCache = {};
710
- var manualPropTypeWarningCount = 0;
711
- }
712
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
713
- componentName = componentName || ANONYMOUS;
714
- propFullName = propFullName || propName;
715
-
716
- if (secret !== ReactPropTypesSecret) {
717
- if (throwOnDirectAccess) {
718
- // New behavior only for users of `prop-types` package
719
- var err = new Error(
720
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
721
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
722
- 'Read more at http://fb.me/use-check-prop-types'
723
- );
724
- err.name = 'Invariant Violation';
725
- throw err;
726
- } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
727
- // Old behavior for people using React.PropTypes
728
- var cacheKey = componentName + ':' + propName;
729
- if (
730
- !manualPropTypeCallCache[cacheKey] &&
731
- // Avoid spamming the console because they are often not actionable except for lib authors
732
- manualPropTypeWarningCount < 3
733
- ) {
734
- printWarning(
735
- 'You are manually calling a React.PropTypes validation ' +
736
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
737
- 'and will throw in the standalone `prop-types` package. ' +
738
- 'You may be seeing this warning due to a third-party PropTypes ' +
739
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
740
- );
741
- manualPropTypeCallCache[cacheKey] = true;
742
- manualPropTypeWarningCount++;
743
- }
744
- }
745
- }
746
- if (props[propName] == null) {
747
- if (isRequired) {
748
- if (props[propName] === null) {
749
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
750
- }
751
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
752
- }
753
- return null;
754
- } else {
755
- return validate(props, propName, componentName, location, propFullName);
756
- }
757
- }
758
-
759
- var chainedCheckType = checkType.bind(null, false);
760
- chainedCheckType.isRequired = checkType.bind(null, true);
761
-
762
- return chainedCheckType;
763
- }
764
-
765
- function createPrimitiveTypeChecker(expectedType) {
766
- function validate(props, propName, componentName, location, propFullName, secret) {
767
- var propValue = props[propName];
768
- var propType = getPropType(propValue);
769
- if (propType !== expectedType) {
770
- // `propValue` being instance of, say, date/regexp, pass the 'object'
771
- // check, but we can offer a more precise error message here rather than
772
- // 'of type `object`'.
773
- var preciseType = getPreciseType(propValue);
774
-
775
- return new PropTypeError(
776
- 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
777
- {expectedType: expectedType}
778
- );
779
- }
780
- return null;
781
- }
782
- return createChainableTypeChecker(validate);
783
- }
784
-
785
- function createAnyTypeChecker() {
786
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
787
- }
788
-
789
- function createArrayOfTypeChecker(typeChecker) {
790
- function validate(props, propName, componentName, location, propFullName) {
791
- if (typeof typeChecker !== 'function') {
792
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
793
- }
794
- var propValue = props[propName];
795
- if (!Array.isArray(propValue)) {
796
- var propType = getPropType(propValue);
797
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
798
- }
799
- for (var i = 0; i < propValue.length; i++) {
800
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
801
- if (error instanceof Error) {
802
- return error;
803
- }
804
- }
805
- return null;
806
- }
807
- return createChainableTypeChecker(validate);
808
- }
809
-
810
- function createElementTypeChecker() {
811
- function validate(props, propName, componentName, location, propFullName) {
812
- var propValue = props[propName];
813
- if (!isValidElement(propValue)) {
814
- var propType = getPropType(propValue);
815
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
816
- }
817
- return null;
818
- }
819
- return createChainableTypeChecker(validate);
820
- }
821
-
822
- function createElementTypeTypeChecker() {
823
- function validate(props, propName, componentName, location, propFullName) {
824
- var propValue = props[propName];
825
- if (!ReactIs.isValidElementType(propValue)) {
826
- var propType = getPropType(propValue);
827
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
828
- }
829
- return null;
830
- }
831
- return createChainableTypeChecker(validate);
832
- }
833
-
834
- function createInstanceTypeChecker(expectedClass) {
835
- function validate(props, propName, componentName, location, propFullName) {
836
- if (!(props[propName] instanceof expectedClass)) {
837
- var expectedClassName = expectedClass.name || ANONYMOUS;
838
- var actualClassName = getClassName(props[propName]);
839
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
840
- }
841
- return null;
842
- }
843
- return createChainableTypeChecker(validate);
844
- }
845
-
846
- function createEnumTypeChecker(expectedValues) {
847
- if (!Array.isArray(expectedValues)) {
848
- if (process.env.NODE_ENV !== 'production') {
849
- if (arguments.length > 1) {
850
- printWarning(
851
- 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
852
- 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
853
- );
854
- } else {
855
- printWarning('Invalid argument supplied to oneOf, expected an array.');
856
- }
857
- }
858
- return emptyFunctionThatReturnsNull;
859
- }
860
-
861
- function validate(props, propName, componentName, location, propFullName) {
862
- var propValue = props[propName];
863
- for (var i = 0; i < expectedValues.length; i++) {
864
- if (is(propValue, expectedValues[i])) {
865
- return null;
866
- }
867
- }
868
-
869
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
870
- var type = getPreciseType(value);
871
- if (type === 'symbol') {
872
- return String(value);
873
- }
874
- return value;
875
- });
876
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
877
- }
878
- return createChainableTypeChecker(validate);
879
- }
880
-
881
- function createObjectOfTypeChecker(typeChecker) {
882
- function validate(props, propName, componentName, location, propFullName) {
883
- if (typeof typeChecker !== 'function') {
884
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
885
- }
886
- var propValue = props[propName];
887
- var propType = getPropType(propValue);
888
- if (propType !== 'object') {
889
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
890
- }
891
- for (var key in propValue) {
892
- if (has(propValue, key)) {
893
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
894
- if (error instanceof Error) {
895
- return error;
896
- }
897
- }
898
- }
899
- return null;
900
- }
901
- return createChainableTypeChecker(validate);
902
- }
903
-
904
- function createUnionTypeChecker(arrayOfTypeCheckers) {
905
- if (!Array.isArray(arrayOfTypeCheckers)) {
906
- process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
907
- return emptyFunctionThatReturnsNull;
908
- }
909
-
910
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
911
- var checker = arrayOfTypeCheckers[i];
912
- if (typeof checker !== 'function') {
913
- printWarning(
914
- 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
915
- 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
916
- );
917
- return emptyFunctionThatReturnsNull;
918
- }
919
- }
920
-
921
- function validate(props, propName, componentName, location, propFullName) {
922
- var expectedTypes = [];
923
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
924
- var checker = arrayOfTypeCheckers[i];
925
- var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
926
- if (checkerResult == null) {
927
- return null;
928
- }
929
- if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
930
- expectedTypes.push(checkerResult.data.expectedType);
931
- }
932
- }
933
- var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
934
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
935
- }
936
- return createChainableTypeChecker(validate);
937
- }
938
-
939
- function createNodeChecker() {
940
- function validate(props, propName, componentName, location, propFullName) {
941
- if (!isNode(props[propName])) {
942
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
943
- }
944
- return null;
945
- }
946
- return createChainableTypeChecker(validate);
947
- }
948
-
949
- function invalidValidatorError(componentName, location, propFullName, key, type) {
950
- return new PropTypeError(
951
- (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
952
- 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
953
- );
954
- }
955
-
956
- function createShapeTypeChecker(shapeTypes) {
957
- function validate(props, propName, componentName, location, propFullName) {
958
- var propValue = props[propName];
959
- var propType = getPropType(propValue);
960
- if (propType !== 'object') {
961
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
962
- }
963
- for (var key in shapeTypes) {
964
- var checker = shapeTypes[key];
965
- if (typeof checker !== 'function') {
966
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
967
- }
968
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
969
- if (error) {
970
- return error;
971
- }
972
- }
973
- return null;
974
- }
975
- return createChainableTypeChecker(validate);
976
- }
977
-
978
- function createStrictShapeTypeChecker(shapeTypes) {
979
- function validate(props, propName, componentName, location, propFullName) {
980
- var propValue = props[propName];
981
- var propType = getPropType(propValue);
982
- if (propType !== 'object') {
983
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
984
- }
985
- // We need to check all keys in case some are required but missing from props.
986
- var allKeys = assign({}, props[propName], shapeTypes);
987
- for (var key in allKeys) {
988
- var checker = shapeTypes[key];
989
- if (has(shapeTypes, key) && typeof checker !== 'function') {
990
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
991
- }
992
- if (!checker) {
993
- return new PropTypeError(
994
- 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
995
- '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
996
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
997
- );
998
- }
999
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1000
- if (error) {
1001
- return error;
1002
- }
1003
- }
1004
- return null;
1005
- }
1006
-
1007
- return createChainableTypeChecker(validate);
1008
- }
1009
-
1010
- function isNode(propValue) {
1011
- switch (typeof propValue) {
1012
- case 'number':
1013
- case 'string':
1014
- case 'undefined':
1015
- return true;
1016
- case 'boolean':
1017
- return !propValue;
1018
- case 'object':
1019
- if (Array.isArray(propValue)) {
1020
- return propValue.every(isNode);
1021
- }
1022
- if (propValue === null || isValidElement(propValue)) {
1023
- return true;
1024
- }
1025
-
1026
- var iteratorFn = getIteratorFn(propValue);
1027
- if (iteratorFn) {
1028
- var iterator = iteratorFn.call(propValue);
1029
- var step;
1030
- if (iteratorFn !== propValue.entries) {
1031
- while (!(step = iterator.next()).done) {
1032
- if (!isNode(step.value)) {
1033
- return false;
1034
- }
1035
- }
1036
- } else {
1037
- // Iterator will provide entry [k,v] tuples rather than values.
1038
- while (!(step = iterator.next()).done) {
1039
- var entry = step.value;
1040
- if (entry) {
1041
- if (!isNode(entry[1])) {
1042
- return false;
1043
- }
1044
- }
1045
- }
1046
- }
1047
- } else {
1048
- return false;
1049
- }
1050
-
1051
- return true;
1052
- default:
1053
- return false;
1054
- }
1055
- }
1056
-
1057
- function isSymbol(propType, propValue) {
1058
- // Native Symbol.
1059
- if (propType === 'symbol') {
1060
- return true;
1061
- }
1062
-
1063
- // falsy value can't be a Symbol
1064
- if (!propValue) {
1065
- return false;
1066
- }
1067
-
1068
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1069
- if (propValue['@@toStringTag'] === 'Symbol') {
1070
- return true;
1071
- }
1072
-
1073
- // Fallback for non-spec compliant Symbols which are polyfilled.
1074
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1075
- return true;
1076
- }
1077
-
1078
- return false;
1079
- }
1080
-
1081
- // Equivalent of `typeof` but with special handling for array and regexp.
1082
- function getPropType(propValue) {
1083
- var propType = typeof propValue;
1084
- if (Array.isArray(propValue)) {
1085
- return 'array';
1086
- }
1087
- if (propValue instanceof RegExp) {
1088
- // Old webkits (at least until Android 4.0) return 'function' rather than
1089
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1090
- // passes PropTypes.object.
1091
- return 'object';
1092
- }
1093
- if (isSymbol(propType, propValue)) {
1094
- return 'symbol';
1095
- }
1096
- return propType;
1097
- }
1098
-
1099
- // This handles more types than `getPropType`. Only used for error messages.
1100
- // See `createPrimitiveTypeChecker`.
1101
- function getPreciseType(propValue) {
1102
- if (typeof propValue === 'undefined' || propValue === null) {
1103
- return '' + propValue;
1104
- }
1105
- var propType = getPropType(propValue);
1106
- if (propType === 'object') {
1107
- if (propValue instanceof Date) {
1108
- return 'date';
1109
- } else if (propValue instanceof RegExp) {
1110
- return 'regexp';
1111
- }
1112
- }
1113
- return propType;
1114
- }
1115
-
1116
- // Returns a string that is postfixed to a warning about an invalid type.
1117
- // For example, "undefined" or "of type array"
1118
- function getPostfixForTypeWarning(value) {
1119
- var type = getPreciseType(value);
1120
- switch (type) {
1121
- case 'array':
1122
- case 'object':
1123
- return 'an ' + type;
1124
- case 'boolean':
1125
- case 'date':
1126
- case 'regexp':
1127
- return 'a ' + type;
1128
- default:
1129
- return type;
1130
- }
1131
- }
1132
-
1133
- // Returns class name of the object, if any.
1134
- function getClassName(propValue) {
1135
- if (!propValue.constructor || !propValue.constructor.name) {
1136
- return ANONYMOUS;
1137
- }
1138
- return propValue.constructor.name;
1139
- }
1140
-
1141
- ReactPropTypes.checkPropTypes = checkPropTypes;
1142
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1143
- ReactPropTypes.PropTypes = ReactPropTypes;
1144
-
1145
- return ReactPropTypes;
1146
- };
1147
- return factoryWithTypeCheckers;
1148
- }
1149
-
1150
- /**
1151
- * Copyright (c) 2013-present, Facebook, Inc.
1152
- *
1153
- * This source code is licensed under the MIT license found in the
1154
- * LICENSE file in the root directory of this source tree.
1155
- */
1156
-
1157
- var factoryWithThrowingShims;
1158
- var hasRequiredFactoryWithThrowingShims;
1159
-
1160
- function requireFactoryWithThrowingShims () {
1161
- if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
1162
- hasRequiredFactoryWithThrowingShims = 1;
1163
-
1164
- var ReactPropTypesSecret = requireReactPropTypesSecret();
1165
-
1166
- function emptyFunction() {}
1167
- function emptyFunctionWithReset() {}
1168
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
1169
-
1170
- factoryWithThrowingShims = function() {
1171
- function shim(props, propName, componentName, location, propFullName, secret) {
1172
- if (secret === ReactPropTypesSecret) {
1173
- // It is still safe when called from React.
1174
- return;
1175
- }
1176
- var err = new Error(
1177
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1178
- 'Use PropTypes.checkPropTypes() to call them. ' +
1179
- 'Read more at http://fb.me/use-check-prop-types'
1180
- );
1181
- err.name = 'Invariant Violation';
1182
- throw err;
1183
- } shim.isRequired = shim;
1184
- function getShim() {
1185
- return shim;
1186
- } // Important!
1187
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1188
- var ReactPropTypes = {
1189
- array: shim,
1190
- bigint: shim,
1191
- bool: shim,
1192
- func: shim,
1193
- number: shim,
1194
- object: shim,
1195
- string: shim,
1196
- symbol: shim,
1197
-
1198
- any: shim,
1199
- arrayOf: getShim,
1200
- element: shim,
1201
- elementType: shim,
1202
- instanceOf: getShim,
1203
- node: shim,
1204
- objectOf: getShim,
1205
- oneOf: getShim,
1206
- oneOfType: getShim,
1207
- shape: getShim,
1208
- exact: getShim,
1209
-
1210
- checkPropTypes: emptyFunctionWithReset,
1211
- resetWarningCache: emptyFunction
1212
- };
1213
-
1214
- ReactPropTypes.PropTypes = ReactPropTypes;
1215
-
1216
- return ReactPropTypes;
1217
- };
1218
- return factoryWithThrowingShims;
1219
- }
1220
-
1221
- /**
1222
- * Copyright (c) 2013-present, Facebook, Inc.
1223
- *
1224
- * This source code is licensed under the MIT license found in the
1225
- * LICENSE file in the root directory of this source tree.
1226
- */
1227
-
1228
- if (process.env.NODE_ENV !== 'production') {
1229
- var ReactIs = requireReactIs();
1230
-
1231
- // By explicitly using `prop-types` you are opting into new development behavior.
1232
- // http://fb.me/prop-types-in-prod
1233
- var throwOnDirectAccess = true;
1234
- propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
1235
- } else {
1236
- // By explicitly using `prop-types` you are opting into new production behavior.
1237
- // http://fb.me/prop-types-in-prod
1238
- propTypes.exports = requireFactoryWithThrowingShims()();
1239
- }
1240
-
1241
19
  var MemoizedEditorContent = /*#__PURE__*/React.memo(EditorContent);
1242
20
  var EmailPreview = withT(function (_ref) {
1243
21
  var t = _ref.t,
1244
22
  _ref$to = _ref.to,
1245
23
  to = _ref$to === void 0 ? [] : _ref$to,
1246
- from = _ref.from,
1247
24
  subject = _ref.subject,
1248
25
  body = _ref.body,
1249
26
  productName = _ref.productName,
1250
27
  actionButtonText = _ref.actionButtonText,
1251
- logo = _ref.logo,
1252
28
  _ref$className = _ref.className,
1253
29
  className = _ref$className === void 0 ? "" : _ref$className;
1254
30
  return /*#__PURE__*/React.createElement("div", {
1255
31
  "data-cy": "email-preview-card",
1256
32
  "data-testid": "email-preview",
1257
- className: classnames("neeto-ui-border-gray-300 neeto-ui-shadow-m neeto-ui-bg-white flex flex-1 flex-col border", _defineProperty({}, className, className))
33
+ className: classnames("neeto-ui-border-gray-300 neeto-ui-shadow-m neeto-ui-bg-white flex flex-1 flex-col border", className)
1258
34
  }, /*#__PURE__*/React.createElement("div", {
1259
- className: "neeto-ui-border-gray-300 space-y-3 divide-y divide-gray-200 border-b p-6"
35
+ className: "neeto-ui-border-gray-300 space-y-6 divide-y divide-gray-200 border-b p-6"
1260
36
  }, /*#__PURE__*/React.createElement("div", {
1261
37
  className: "flex gap-2",
1262
38
  "data-cy": "email-send-to-preview",
@@ -1265,25 +41,14 @@ var EmailPreview = withT(function (_ref) {
1265
41
  className: "neeto-ui-text-gray-500",
1266
42
  lineHeight: "normal",
1267
43
  style: "body2"
1268
- }, t("neetoMolecules.emailPreview.to"), ":"), isPresent(to) && isNotEmpty(to) ? /*#__PURE__*/React.createElement(Typography, {
44
+ }, t("neetoMolecules.emailPreview.to"), ":"), isPresent(to) ? /*#__PURE__*/React.createElement(Typography, {
1269
45
  className: "neeto-ui-text-gray-800 min-w-0 flex-grow break-words",
1270
46
  lineHeight: "normal",
1271
47
  style: "body2"
1272
48
  }, to.join(", ")) : /*#__PURE__*/React.createElement("div", {
1273
49
  className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full mt-2 h-2 w-40"
1274
- })), from && /*#__PURE__*/React.createElement("div", {
1275
- className: "flex items-center gap-2 pt-3"
1276
- }, /*#__PURE__*/React.createElement(Typography, {
1277
- className: "neeto-ui-text-gray-500",
1278
- lineHeight: "normal",
1279
- style: "body2"
1280
- }, t("neetoMolecules.emailPreview.from"), ":"), /*#__PURE__*/React.createElement(Typography, {
1281
- className: "neeto-ui-text-gray-800 min-w-0 flex-grow break-words",
1282
- "data-cy": "email-send-from-preview",
1283
- lineHeight: "normal",
1284
- style: "body2"
1285
- }, from)), /*#__PURE__*/React.createElement("div", {
1286
- className: "flex items-center gap-2 pt-3"
50
+ })), /*#__PURE__*/React.createElement("div", {
51
+ className: "flex items-center gap-2 pt-6"
1287
52
  }, /*#__PURE__*/React.createElement(Typography, {
1288
53
  className: "neeto-ui-text-gray-500",
1289
54
  lineHeight: "normal",
@@ -1296,7 +61,7 @@ var EmailPreview = withT(function (_ref) {
1296
61
  }, subject || /*#__PURE__*/React.createElement("span", {
1297
62
  className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-40"
1298
63
  })))), /*#__PURE__*/React.createElement("div", {
1299
- className: "neeto-ui-text-gray-800 flex flex-1 flex-col justify-between space-y-6 p-6 pr-10 text-base leading-relaxed",
64
+ className: "neeto-ui-text-gray-800 my-10 flex flex-1 flex-col justify-between space-y-6 p-6 pr-10 text-base leading-relaxed",
1300
65
  "data-cy": "email-body-preview-container"
1301
66
  }, body ? /*#__PURE__*/React.createElement(MemoizedEditorContent, {
1302
67
  content: body
@@ -1313,12 +78,7 @@ var EmailPreview = withT(function (_ref) {
1313
78
  }, /*#__PURE__*/React.createElement(Button, {
1314
79
  className: "pointer-events-none",
1315
80
  label: actionButtonText
1316
- })), logo && /*#__PURE__*/React.createElement("img", {
1317
- alt: t("neetoMolecules.emailPreview.logoAltText"),
1318
- className: "h-20 w-36 object-cover",
1319
- "data-cy": "company-logo-preview",
1320
- src: logo
1321
- })), productName && /*#__PURE__*/React.createElement("div", {
81
+ }))), productName && /*#__PURE__*/React.createElement("div", {
1322
82
  className: "neeto-ui-bg-gray-100 mt-auto p-2",
1323
83
  "data-testid": "product-name-block"
1324
84
  }, /*#__PURE__*/React.createElement(Typography, {
@@ -1328,36 +88,6 @@ var EmailPreview = withT(function (_ref) {
1328
88
  className: "neeto-ui-text-gray-800 font-medium"
1329
89
  }, productName))));
1330
90
  });
1331
- EmailPreview.propTypes = {
1332
- /**
1333
- * The value of the send-to field.
1334
- */
1335
- to: propTypes.exports.arrayOf(propTypes.exports.string),
1336
- /**
1337
- * The value of the send-from field.
1338
- */
1339
- from: propTypes.exports.string,
1340
- /**
1341
- * The subject of the email.
1342
- */
1343
- subject: propTypes.exports.string,
1344
- /**
1345
- * The body of the email.
1346
- */
1347
- body: propTypes.exports.string,
1348
- /**
1349
- * The name of the neeto product to be previewed.
1350
- */
1351
- productName: propTypes.exports.string,
1352
- /**
1353
- * The text to be shown in the action button.
1354
- */
1355
- actionButtonText: propTypes.exports.string,
1356
- /**
1357
- * Source link for the company logo.
1358
- */
1359
- logo: propTypes.exports.string
1360
- };
1361
91
 
1362
92
  function _extends() {
1363
93
  _extends = Object.assign ? Object.assign.bind() : function (target) {
@@ -1405,409 +135,173 @@ function _toConsumableArray(arr) {
1405
135
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
1406
136
  }
1407
137
 
1408
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
1409
- try {
1410
- var info = gen[key](arg);
1411
- var value = info.value;
1412
- } catch (error) {
1413
- reject(error);
1414
- return;
1415
- }
1416
- if (info.done) {
1417
- resolve(value);
1418
- } else {
1419
- Promise.resolve(value).then(_next, _throw);
1420
- }
138
+ function _arrayWithHoles(arr) {
139
+ if (Array.isArray(arr)) return arr;
1421
140
  }
1422
- function _asyncToGenerator(fn) {
1423
- return function () {
1424
- var self = this,
1425
- args = arguments;
1426
- return new Promise(function (resolve, reject) {
1427
- var gen = fn.apply(self, args);
1428
- function _next(value) {
1429
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
1430
- }
1431
- function _throw(err) {
1432
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
141
+
142
+ function _iterableToArrayLimit(arr, i) {
143
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
144
+ if (null != _i) {
145
+ var _s,
146
+ _e,
147
+ _x,
148
+ _r,
149
+ _arr = [],
150
+ _n = !0,
151
+ _d = !1;
152
+ try {
153
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
154
+ if (Object(_i) !== _i) return;
155
+ _n = !1;
156
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
157
+ } catch (err) {
158
+ _d = !0, _e = err;
159
+ } finally {
160
+ try {
161
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
162
+ } finally {
163
+ if (_d) throw _e;
1433
164
  }
1434
- _next(undefined);
1435
- });
1436
- };
165
+ }
166
+ return _arr;
167
+ }
1437
168
  }
1438
169
 
1439
- var regeneratorRuntime$1 = {exports: {}};
1440
-
1441
- var _typeof = {exports: {}};
1442
-
1443
- (function (module) {
1444
- function _typeof(obj) {
1445
- "@babel/helpers - typeof";
1446
-
1447
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1448
- return typeof obj;
1449
- } : function (obj) {
1450
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1451
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
1452
- }
1453
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
1454
- } (_typeof));
1455
-
1456
- (function (module) {
1457
- var _typeof$1 = _typeof.exports["default"];
1458
- function _regeneratorRuntime() {
1459
- module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
1460
- return exports;
1461
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
1462
- var exports = {},
1463
- Op = Object.prototype,
1464
- hasOwn = Op.hasOwnProperty,
1465
- defineProperty = Object.defineProperty || function (obj, key, desc) {
1466
- obj[key] = desc.value;
1467
- },
1468
- $Symbol = "function" == typeof Symbol ? Symbol : {},
1469
- iteratorSymbol = $Symbol.iterator || "@@iterator",
1470
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
1471
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
1472
- function define(obj, key, value) {
1473
- return Object.defineProperty(obj, key, {
1474
- value: value,
1475
- enumerable: !0,
1476
- configurable: !0,
1477
- writable: !0
1478
- }), obj[key];
1479
- }
1480
- try {
1481
- define({}, "");
1482
- } catch (err) {
1483
- define = function define(obj, key, value) {
1484
- return obj[key] = value;
1485
- };
1486
- }
1487
- function wrap(innerFn, outerFn, self, tryLocsList) {
1488
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
1489
- generator = Object.create(protoGenerator.prototype),
1490
- context = new Context(tryLocsList || []);
1491
- return defineProperty(generator, "_invoke", {
1492
- value: makeInvokeMethod(innerFn, self, context)
1493
- }), generator;
1494
- }
1495
- function tryCatch(fn, obj, arg) {
1496
- try {
1497
- return {
1498
- type: "normal",
1499
- arg: fn.call(obj, arg)
1500
- };
1501
- } catch (err) {
1502
- return {
1503
- type: "throw",
1504
- arg: err
1505
- };
1506
- }
1507
- }
1508
- exports.wrap = wrap;
1509
- var ContinueSentinel = {};
1510
- function Generator() {}
1511
- function GeneratorFunction() {}
1512
- function GeneratorFunctionPrototype() {}
1513
- var IteratorPrototype = {};
1514
- define(IteratorPrototype, iteratorSymbol, function () {
1515
- return this;
1516
- });
1517
- var getProto = Object.getPrototypeOf,
1518
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
1519
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
1520
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
1521
- function defineIteratorMethods(prototype) {
1522
- ["next", "throw", "return"].forEach(function (method) {
1523
- define(prototype, method, function (arg) {
1524
- return this._invoke(method, arg);
1525
- });
1526
- });
1527
- }
1528
- function AsyncIterator(generator, PromiseImpl) {
1529
- function invoke(method, arg, resolve, reject) {
1530
- var record = tryCatch(generator[method], generator, arg);
1531
- if ("throw" !== record.type) {
1532
- var result = record.arg,
1533
- value = result.value;
1534
- return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
1535
- invoke("next", value, resolve, reject);
1536
- }, function (err) {
1537
- invoke("throw", err, resolve, reject);
1538
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
1539
- result.value = unwrapped, resolve(result);
1540
- }, function (error) {
1541
- return invoke("throw", error, resolve, reject);
1542
- });
1543
- }
1544
- reject(record.arg);
1545
- }
1546
- var previousPromise;
1547
- defineProperty(this, "_invoke", {
1548
- value: function value(method, arg) {
1549
- function callInvokeWithMethodAndArg() {
1550
- return new PromiseImpl(function (resolve, reject) {
1551
- invoke(method, arg, resolve, reject);
1552
- });
1553
- }
1554
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
1555
- }
1556
- });
1557
- }
1558
- function makeInvokeMethod(innerFn, self, context) {
1559
- var state = "suspendedStart";
1560
- return function (method, arg) {
1561
- if ("executing" === state) throw new Error("Generator is already running");
1562
- if ("completed" === state) {
1563
- if ("throw" === method) throw arg;
1564
- return doneResult();
1565
- }
1566
- for (context.method = method, context.arg = arg;;) {
1567
- var delegate = context.delegate;
1568
- if (delegate) {
1569
- var delegateResult = maybeInvokeDelegate(delegate, context);
1570
- if (delegateResult) {
1571
- if (delegateResult === ContinueSentinel) continue;
1572
- return delegateResult;
1573
- }
1574
- }
1575
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
1576
- if ("suspendedStart" === state) throw state = "completed", context.arg;
1577
- context.dispatchException(context.arg);
1578
- } else "return" === context.method && context.abrupt("return", context.arg);
1579
- state = "executing";
1580
- var record = tryCatch(innerFn, self, context);
1581
- if ("normal" === record.type) {
1582
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
1583
- return {
1584
- value: record.arg,
1585
- done: context.done
1586
- };
1587
- }
1588
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
1589
- }
1590
- };
1591
- }
1592
- function maybeInvokeDelegate(delegate, context) {
1593
- var methodName = context.method,
1594
- method = delegate.iterator[methodName];
1595
- if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
1596
- var record = tryCatch(method, delegate.iterator, context.arg);
1597
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
1598
- var info = record.arg;
1599
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
1600
- }
1601
- function pushTryEntry(locs) {
1602
- var entry = {
1603
- tryLoc: locs[0]
1604
- };
1605
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
1606
- }
1607
- function resetTryEntry(entry) {
1608
- var record = entry.completion || {};
1609
- record.type = "normal", delete record.arg, entry.completion = record;
1610
- }
1611
- function Context(tryLocsList) {
1612
- this.tryEntries = [{
1613
- tryLoc: "root"
1614
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
1615
- }
1616
- function values(iterable) {
1617
- if (iterable) {
1618
- var iteratorMethod = iterable[iteratorSymbol];
1619
- if (iteratorMethod) return iteratorMethod.call(iterable);
1620
- if ("function" == typeof iterable.next) return iterable;
1621
- if (!isNaN(iterable.length)) {
1622
- var i = -1,
1623
- next = function next() {
1624
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
1625
- return next.value = undefined, next.done = !0, next;
1626
- };
1627
- return next.next = next;
1628
- }
1629
- }
1630
- return {
1631
- next: doneResult
1632
- };
1633
- }
1634
- function doneResult() {
1635
- return {
1636
- value: undefined,
1637
- done: !0
1638
- };
1639
- }
1640
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
1641
- value: GeneratorFunctionPrototype,
1642
- configurable: !0
1643
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
1644
- value: GeneratorFunction,
1645
- configurable: !0
1646
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
1647
- var ctor = "function" == typeof genFun && genFun.constructor;
1648
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
1649
- }, exports.mark = function (genFun) {
1650
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
1651
- }, exports.awrap = function (arg) {
1652
- return {
1653
- __await: arg
1654
- };
1655
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
1656
- return this;
1657
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
1658
- void 0 === PromiseImpl && (PromiseImpl = Promise);
1659
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
1660
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
1661
- return result.done ? result.value : iter.next();
1662
- });
1663
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
1664
- return this;
1665
- }), define(Gp, "toString", function () {
1666
- return "[object Generator]";
1667
- }), exports.keys = function (val) {
1668
- var object = Object(val),
1669
- keys = [];
1670
- for (var key in object) keys.push(key);
1671
- return keys.reverse(), function next() {
1672
- for (; keys.length;) {
1673
- var key = keys.pop();
1674
- if (key in object) return next.value = key, next.done = !1, next;
1675
- }
1676
- return next.done = !0, next;
1677
- };
1678
- }, exports.values = values, Context.prototype = {
1679
- constructor: Context,
1680
- reset: function reset(skipTempReset) {
1681
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
1682
- },
1683
- stop: function stop() {
1684
- this.done = !0;
1685
- var rootRecord = this.tryEntries[0].completion;
1686
- if ("throw" === rootRecord.type) throw rootRecord.arg;
1687
- return this.rval;
1688
- },
1689
- dispatchException: function dispatchException(exception) {
1690
- if (this.done) throw exception;
1691
- var context = this;
1692
- function handle(loc, caught) {
1693
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
1694
- }
1695
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1696
- var entry = this.tryEntries[i],
1697
- record = entry.completion;
1698
- if ("root" === entry.tryLoc) return handle("end");
1699
- if (entry.tryLoc <= this.prev) {
1700
- var hasCatch = hasOwn.call(entry, "catchLoc"),
1701
- hasFinally = hasOwn.call(entry, "finallyLoc");
1702
- if (hasCatch && hasFinally) {
1703
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
1704
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
1705
- } else if (hasCatch) {
1706
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
1707
- } else {
1708
- if (!hasFinally) throw new Error("try statement without catch or finally");
1709
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
1710
- }
1711
- }
1712
- }
1713
- },
1714
- abrupt: function abrupt(type, arg) {
1715
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1716
- var entry = this.tryEntries[i];
1717
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
1718
- var finallyEntry = entry;
1719
- break;
1720
- }
1721
- }
1722
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
1723
- var record = finallyEntry ? finallyEntry.completion : {};
1724
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
1725
- },
1726
- complete: function complete(record, afterLoc) {
1727
- if ("throw" === record.type) throw record.arg;
1728
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
1729
- },
1730
- finish: function finish(finallyLoc) {
1731
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1732
- var entry = this.tryEntries[i];
1733
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
1734
- }
1735
- },
1736
- "catch": function _catch(tryLoc) {
1737
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1738
- var entry = this.tryEntries[i];
1739
- if (entry.tryLoc === tryLoc) {
1740
- var record = entry.completion;
1741
- if ("throw" === record.type) {
1742
- var thrown = record.arg;
1743
- resetTryEntry(entry);
1744
- }
1745
- return thrown;
1746
- }
1747
- }
1748
- throw new Error("illegal catch attempt");
1749
- },
1750
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
1751
- return this.delegate = {
1752
- iterator: values(iterable),
1753
- resultName: resultName,
1754
- nextLoc: nextLoc
1755
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
1756
- }
1757
- }, exports;
1758
- }
1759
- module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
1760
- } (regeneratorRuntime$1));
1761
-
1762
- // TODO(Babel 8): Remove this file.
1763
-
1764
- var runtime = regeneratorRuntime$1.exports();
1765
- var regenerator = runtime;
1766
-
1767
- // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
1768
- try {
1769
- regeneratorRuntime = runtime;
1770
- } catch (accidentalStrictMode) {
1771
- if (typeof globalThis === "object") {
1772
- globalThis.regeneratorRuntime = runtime;
1773
- } else {
1774
- Function("r", "regeneratorRuntime = r")(runtime);
1775
- }
170
+ function _nonIterableRest() {
171
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1776
172
  }
1777
173
 
1778
- var ALLOWED_FILE_PICKER_TYPES = [".csv"];
174
+ function _slicedToArray(arr, i) {
175
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
176
+ }
1779
177
 
1780
- var FilePicker = function FilePicker(_ref) {
1781
- var _ref$types = _ref.types,
1782
- types = _ref$types === void 0 ? [] : _ref$types,
1783
- onChange = _ref.onChange,
1784
- children = _ref.children;
1785
- var inputRef = useRef();
1786
- var accept = types.reduce(function (acc, ext) {
1787
- return "".concat(acc, ", ").concat(ext);
1788
- }, "");
1789
- var handleInputChange = function handleInputChange(_ref2) {
1790
- var target = _ref2.target;
1791
- if (!target.files) return;
1792
- onChange(target.files);
178
+ var ALLOWED_FILE_TYPES = [".csv"];
179
+ var ONE_MEGABYTE_IN_BYTES = 1024 * 1024;
180
+ var DOWNLOAD_SAMPLE_EMAIL_CSV_FILE = "https://d2v7kzglnr2dnh.cloudfront.net/others/sample-bulk-email.csv";
1793
181
 
1794
- // This will trigger handleClick when same file is uploaded again.
1795
- inputRef.current.value = "";
1796
- handleClick();
1797
- };
1798
- var handleClick = function handleClick() {
1799
- if (!inputRef.current) return;
1800
- inputRef.current.click();
1801
- };
1802
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
1803
- onClick: handleClick
1804
- }, children), /*#__PURE__*/React.createElement("input", {
1805
- accept: accept,
1806
- className: "hidden",
1807
- ref: inputRef,
1808
- type: "file",
1809
- onChange: handleInputChange
182
+ var Requirements = withT(function (_ref) {
183
+ var t = _ref.t,
184
+ fileSize = _ref.fileSize;
185
+ return /*#__PURE__*/React.createElement(Callout, {
186
+ className: "flex flex-col items-center py-6",
187
+ style: "info"
188
+ }, /*#__PURE__*/React.createElement("ul", {
189
+ className: "list-outside list-disc space-y-1 font-normal leading-normal"
190
+ }, fileSize && /*#__PURE__*/React.createElement("li", null, t("neetoMolecules.shareViaLink.requirements.fileTypeAndSize", {
191
+ limit: fileSize
192
+ })), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Trans, {
193
+ components: {
194
+ strong: /*#__PURE__*/React.createElement("strong", {
195
+ className: "font-semibold"
196
+ })
197
+ },
198
+ i18nKey: "neetoMolecules.shareViaLink.requirements.shouldContainColumns"
199
+ }))), /*#__PURE__*/React.createElement(Button, {
200
+ href: DOWNLOAD_SAMPLE_EMAIL_CSV_FILE,
201
+ icon: Download,
202
+ iconPosition: "left",
203
+ label: t("neetoMolecules.shareViaLink.bulkUploadPane.downloadSampleCSV"),
204
+ style: "link"
1810
205
  }));
206
+ });
207
+ var Requirements$1 = /*#__PURE__*/React.memo(Requirements);
208
+
209
+ var BulkUploadPane = function BulkUploadPane(_ref) {
210
+ var _fileRejections$;
211
+ var isOpen = _ref.isOpen,
212
+ fileType = _ref.fileType,
213
+ fileSize = _ref.fileSize,
214
+ onClose = _ref.onClose,
215
+ handleFileSubmit = _ref.handleFileSubmit;
216
+ var _useDropzone = useDropzone({
217
+ accept: fileType,
218
+ maxFiles: 1,
219
+ maxSize: fileSize * ONE_MEGABYTE_IN_BYTES,
220
+ onDrop: function onDrop(files) {
221
+ return files[0] && handleFileSubmit(files[0]);
222
+ }
223
+ }),
224
+ getRootProps = _useDropzone.getRootProps,
225
+ getInputProps = _useDropzone.getInputProps,
226
+ isDragActive = _useDropzone.isDragActive,
227
+ fileRejections = _useDropzone.fileRejections;
228
+ var errors = (_fileRejections$ = fileRejections[0]) === null || _fileRejections$ === void 0 ? void 0 : _fileRejections$.errors.map(function (_ref2) {
229
+ var message = _ref2.message,
230
+ code = _ref2.code;
231
+ return /*#__PURE__*/React.createElement(Typography, {
232
+ className: "neeto-ui-text-error-500 items",
233
+ "data-cy": "file-input-error-message",
234
+ key: code,
235
+ style: "body3"
236
+ }, message);
237
+ });
238
+ var _useTranslation = useTranslation(),
239
+ t = _useTranslation.t;
240
+ return /*#__PURE__*/React.createElement(Pane, {
241
+ "data-testid": "bulk-upload-pane",
242
+ isOpen: isOpen,
243
+ onClose: onClose
244
+ }, /*#__PURE__*/React.createElement("div", {
245
+ tabIndex: 0
246
+ }, /*#__PURE__*/React.createElement(Pane.Header, null, /*#__PURE__*/React.createElement(Typography, {
247
+ "data-testid": "bulk-upload-header",
248
+ style: "h2",
249
+ weight: "semibold"
250
+ }, t("neetoMolecules.shareViaLink.bulkUpload"))), /*#__PURE__*/React.createElement(Pane.Body, null, /*#__PURE__*/React.createElement("div", {
251
+ className: "w-full space-y-4"
252
+ }, /*#__PURE__*/React.createElement(Requirements$1, {
253
+ fileSize: fileSize
254
+ }), /*#__PURE__*/React.createElement("div", getRootProps({
255
+ className: classnames("flex flex-col p-2 border neeto-ui-border-primary-500 border-dashed neeto-ui-rounded-md transition duration-500 ease-in-out hover:neeto-ui-bg-gray-100 cursor-pointer items-center", {
256
+ "neeto-ui-border-gray-100": isDragActive,
257
+ "neeto-ui-border-error neeto-ui-bg-pastel-red hover:neeto-ui-bg-pastel-red": fileRejections.length
258
+ })
259
+ }), /*#__PURE__*/React.createElement("div", {
260
+ className: "flex flex-col items-center space-y-3 p-4"
261
+ }, /*#__PURE__*/React.createElement(Upload, {
262
+ className: "neeto-ui-text-primary-500",
263
+ size: 32
264
+ }), /*#__PURE__*/React.createElement("input", _extends({}, getInputProps(), {
265
+ "data-cy": "csv-upload-input",
266
+ "data-testid": "csv-upload-input"
267
+ })), isDragActive ? /*#__PURE__*/React.createElement(Typography, {
268
+ style: "body2"
269
+ }, t("neetoMolecules.shareViaLink.bulkUploadPane.dropFileHere")) : /*#__PURE__*/React.createElement("div", {
270
+ className: "flex flex-col items-center space-y-1"
271
+ }, /*#__PURE__*/React.createElement("div", {
272
+ className: "flex w-full items-center justify-center gap-x-1"
273
+ }, /*#__PURE__*/React.createElement(Trans, {
274
+ i18nKey: "neetoMolecules.shareViaLink.bulkUploadPane.dragNDrop",
275
+ components: {
276
+ Button: /*#__PURE__*/React.createElement(Button, {
277
+ style: "link"
278
+ })
279
+ }
280
+ })), /*#__PURE__*/React.createElement(Typography, {
281
+ className: "neeto-ui-text-gray-700",
282
+ style: "body3"
283
+ }, fileType && /*#__PURE__*/React.createElement(Trans, {
284
+ i18nKey: "neetoMolecules.shareViaLink.bulkUploadPane.supportedFormat",
285
+ values: {
286
+ fileType: fileType
287
+ },
288
+ components: {
289
+ code: /*#__PURE__*/React.createElement("code", {
290
+ className: "neeto-ui-typography neeto-ui-text-body3 neeto-ui-bg-white m-0 border-l-0 p-0"
291
+ })
292
+ }
293
+ }), " ", fileSize && t("neetoMolecules.shareViaLink.bulkUploadPane.supportedSize", {
294
+ fileSize: fileSize
295
+ })))), errors))), /*#__PURE__*/React.createElement(Pane.Footer, {
296
+ className: "flex items-center space-x-2"
297
+ }, /*#__PURE__*/React.createElement(Button, {
298
+ "data-cy": "bulk-upload-cancel-button",
299
+ "data-testid": "bulk-upload-cancel-button",
300
+ label: t("neetoMolecules.common.actions.cancel"),
301
+ style: "text",
302
+ type: "reset",
303
+ onClick: onClose
304
+ }))));
1811
305
  };
1812
306
 
1813
307
  var isValidEmail = function isValidEmail(email) {
@@ -1823,40 +317,27 @@ var createEmailOptions = function createEmailOptions() {
1823
317
  };
1824
318
  });
1825
319
  };
1826
- var parseCsvEmails = /*#__PURE__*/function () {
1827
- var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(file, onSuccess) {
1828
- return regenerator.wrap(function _callee$(_context) {
1829
- while (1) switch (_context.prev = _context.next) {
1830
- case 0:
1831
- Papa.parse(file, {
1832
- header: true,
1833
- skipEmptyLines: true,
1834
- transformHeader: function transformHeader(h) {
1835
- return h.toLowerCase().replace(/\W/g, "");
1836
- },
1837
- complete: function complete(results) {
1838
- var _results$meta$fields;
1839
- var isEmailFieldPresent = (_results$meta$fields = results.meta.fields) === null || _results$meta$fields === void 0 ? void 0 : _results$meta$fields.includes("email");
1840
- if (isEmailFieldPresent) {
1841
- var emails = results.data.filter(prop("email")).map(function (item) {
1842
- return item.email.trim();
1843
- });
1844
- onSuccess(createEmailOptions(emails));
1845
- } else {
1846
- Toastr.error(t("neetoMolecules.sendToFields.errors.invalidCsv"));
1847
- }
1848
- }
1849
- });
1850
- case 1:
1851
- case "end":
1852
- return _context.stop();
320
+ var parseCsvEmails = function parseCsvEmails(file, onSuccess) {
321
+ Papa.parse(file, {
322
+ header: true,
323
+ skipEmptyLines: true,
324
+ transformHeader: function transformHeader(h) {
325
+ return h.toLowerCase().replace(/\W/g, "");
326
+ },
327
+ complete: function complete(results) {
328
+ var _results$meta$fields;
329
+ var isEmailFieldPresent = (_results$meta$fields = results.meta.fields) === null || _results$meta$fields === void 0 ? void 0 : _results$meta$fields.includes("email");
330
+ if (isEmailFieldPresent) {
331
+ var emails = results.data.filter(prop("email")).map(function (item) {
332
+ return item.email.trim();
333
+ });
334
+ onSuccess(createEmailOptions(emails));
335
+ } else {
336
+ Toastr.error(t("neetoMolecules.sendToFields.errors.invalidCsv"));
1853
337
  }
1854
- }, _callee);
1855
- }));
1856
- return function parseCsvEmails(_x, _x2) {
1857
- return _ref.apply(this, arguments);
1858
- };
1859
- }();
338
+ }
339
+ });
340
+ };
1860
341
 
1861
342
  var SendToFields = function SendToFields(_ref) {
1862
343
  var emailInputProps = _ref.emailInputProps,
@@ -1866,6 +347,10 @@ var SendToFields = function SendToFields(_ref) {
1866
347
  showUploadCsvButton = _ref$showUploadCsvBut === void 0 ? false : _ref$showUploadCsvBut,
1867
348
  _ref$showCcBccButton = _ref.showCcBccButton,
1868
349
  showCcBccButton = _ref$showCcBccButton === void 0 ? false : _ref$showCcBccButton;
350
+ var _useState = useState(false),
351
+ _useState2 = _slicedToArray(_useState, 2),
352
+ isBulkUploadPaneOpen = _useState2[0],
353
+ setIsBulkUploadPaneOpen = _useState2[1];
1869
354
  var sendToFieldRef = useRef();
1870
355
  var _useFormikContext = useFormikContext(),
1871
356
  _useFormikContext$val = _useFormikContext.values,
@@ -1874,58 +359,36 @@ var SendToFields = function SendToFields(_ref) {
1874
359
  setFieldValue = _useFormikContext.setFieldValue;
1875
360
  var _useTranslation = useTranslation(),
1876
361
  t = _useTranslation.t;
1877
- var handleCSVFile = /*#__PURE__*/function () {
1878
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(files) {
1879
- var _sendToFieldRef$curre, onSuccess;
1880
- return regenerator.wrap(function _callee$(_context) {
1881
- while (1) switch (_context.prev = _context.next) {
1882
- case 0:
1883
- _context.prev = 0;
1884
- onSuccess = function onSuccess(values) {
1885
- return setFieldValue(emailInputProps.name || "sendTo", [].concat(_toConsumableArray(existingSendToEmails), _toConsumableArray(values)));
1886
- };
1887
- _context.next = 4;
1888
- return parseCsvEmails(files[0], onSuccess);
1889
- case 4:
1890
- (_sendToFieldRef$curre = sendToFieldRef.current) === null || _sendToFieldRef$curre === void 0 ? void 0 : _sendToFieldRef$curre.focus();
1891
- _context.next = 10;
1892
- break;
1893
- case 7:
1894
- _context.prev = 7;
1895
- _context.t0 = _context["catch"](0);
1896
- Toastr.error(_context.t0);
1897
- case 10:
1898
- case "end":
1899
- return _context.stop();
1900
- }
1901
- }, _callee, null, [[0, 7]]);
1902
- }));
1903
- return function handleCSVFile(_x) {
1904
- return _ref2.apply(this, arguments);
1905
- };
1906
- }();
362
+ var handleCSVFile = function handleCSVFile(file) {
363
+ try {
364
+ var _sendToFieldRef$curre;
365
+ var onSuccess = function onSuccess(values) {
366
+ return setFieldValue(emailInputProps.name || "sendTo", [].concat(_toConsumableArray(existingSendToEmails), _toConsumableArray(values)));
367
+ };
368
+ parseCsvEmails(file, onSuccess);
369
+ setIsBulkUploadPaneOpen(false);
370
+ (_sendToFieldRef$curre = sendToFieldRef.current) === null || _sendToFieldRef$curre === void 0 ? void 0 : _sendToFieldRef$curre.focus();
371
+ } catch (error) {
372
+ Toastr.error(error);
373
+ }
374
+ };
1907
375
  var handelCcBccButtonClick = function handelCcBccButtonClick(e) {
1908
376
  e.stopPropagation();
1909
377
  setFieldValue("showCopyEmails", !showCopyEmails);
1910
378
  };
1911
379
  return /*#__PURE__*/React.createElement("div", {
1912
380
  className: "relative w-full flex-col gap-2"
1913
- }, showUploadCsvButton && /*#__PURE__*/React.createElement("div", {
1914
- className: "absolute top-0 right-1"
1915
- }, /*#__PURE__*/React.createElement(FilePicker, {
1916
- types: ALLOWED_FILE_PICKER_TYPES,
1917
- onChange: handleCSVFile
1918
- }, /*#__PURE__*/React.createElement(Button, {
1919
- "data-cy": "upload-csv-button",
381
+ }, showUploadCsvButton && /*#__PURE__*/React.createElement(Button, {
382
+ className: "absolute top-0 right-1",
383
+ "data-testid": "bulk-upload-button",
1920
384
  icon: Upload,
1921
- label: t("neetoMolecules.emailForm.uploadCSV"),
385
+ label: t("neetoMolecules.shareViaLink.bulkUpload"),
1922
386
  size: "small",
1923
387
  style: "link",
1924
- tooltipProps: {
1925
- content: t("neetoMolecules.sendToFields.uploadCsvTooltip"),
1926
- position: "right"
388
+ onClick: function onClick() {
389
+ return setIsBulkUploadPaneOpen(true);
1927
390
  }
1928
- }))), /*#__PURE__*/React.createElement(MultiEmailInput, _extends({
391
+ }), /*#__PURE__*/React.createElement(MultiEmailInput, _extends({
1929
392
  "data-testid": "emails",
1930
393
  name: "sendTo",
1931
394
  ref: sendToFieldRef
@@ -1944,7 +407,15 @@ var SendToFields = function SendToFields(_ref) {
1944
407
  name: "sendToBcc"
1945
408
  }, ccInputProps)), /*#__PURE__*/React.createElement(MultiEmailInput, _extends({
1946
409
  name: "sendToCc"
1947
- }, bccInputProps))));
410
+ }, bccInputProps))), /*#__PURE__*/React.createElement(BulkUploadPane, {
411
+ fileSize: globalProps.endUserUploadedFileSizeLimitInMb,
412
+ fileType: ALLOWED_FILE_TYPES,
413
+ handleFileSubmit: handleCSVFile,
414
+ isOpen: isBulkUploadPaneOpen,
415
+ onClose: function onClose() {
416
+ return setIsBulkUploadPaneOpen(false);
417
+ }
418
+ }));
1948
419
  };
1949
420
 
1950
421
  var INITIAL_VALUES = {
@@ -1978,46 +449,6 @@ var EmailBody = function EmailBody(_ref, ref) {
1978
449
  };
1979
450
  var EmailBody$1 = /*#__PURE__*/forwardRef(EmailBody);
1980
451
 
1981
- function _arrayWithHoles(arr) {
1982
- if (Array.isArray(arr)) return arr;
1983
- }
1984
-
1985
- function _iterableToArrayLimit(arr, i) {
1986
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
1987
- if (null != _i) {
1988
- var _s,
1989
- _e,
1990
- _x,
1991
- _r,
1992
- _arr = [],
1993
- _n = !0,
1994
- _d = !1;
1995
- try {
1996
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
1997
- if (Object(_i) !== _i) return;
1998
- _n = !1;
1999
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
2000
- } catch (err) {
2001
- _d = !0, _e = err;
2002
- } finally {
2003
- try {
2004
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
2005
- } finally {
2006
- if (_d) throw _e;
2007
- }
2008
- }
2009
- return _arr;
2010
- }
2011
- }
2012
-
2013
- function _nonIterableRest() {
2014
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2015
- }
2016
-
2017
- function _slicedToArray(arr, i) {
2018
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
2019
- }
2020
-
2021
452
  function _objectWithoutPropertiesLoose(source, excluded) {
2022
453
  if (source == null) return {};
2023
454
  var target = {};
@@ -2065,6 +496,47 @@ var FormikDatePicker = function FormikDatePicker(_ref) {
2065
496
  }));
2066
497
  };
2067
498
 
499
+ function _typeof(obj) {
500
+ "@babel/helpers - typeof";
501
+
502
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
503
+ return typeof obj;
504
+ } : function (obj) {
505
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
506
+ }, _typeof(obj);
507
+ }
508
+
509
+ function _toPrimitive(input, hint) {
510
+ if (_typeof(input) !== "object" || input === null) return input;
511
+ var prim = input[Symbol.toPrimitive];
512
+ if (prim !== undefined) {
513
+ var res = prim.call(input, hint || "default");
514
+ if (_typeof(res) !== "object") return res;
515
+ throw new TypeError("@@toPrimitive must return a primitive value.");
516
+ }
517
+ return (hint === "string" ? String : Number)(input);
518
+ }
519
+
520
+ function _toPropertyKey(arg) {
521
+ var key = _toPrimitive(arg, "string");
522
+ return _typeof(key) === "symbol" ? key : String(key);
523
+ }
524
+
525
+ function _defineProperty(obj, key, value) {
526
+ key = _toPropertyKey(key);
527
+ if (key in obj) {
528
+ Object.defineProperty(obj, key, {
529
+ value: value,
530
+ enumerable: true,
531
+ configurable: true,
532
+ writable: true
533
+ });
534
+ } else {
535
+ obj[key] = value;
536
+ }
537
+ return obj;
538
+ }
539
+
2068
540
  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; }
2069
541
  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; }
2070
542
  var isPastDate = function isPastDate(date) {
@@ -2259,16 +731,14 @@ var ShareViaEmail = function ShareViaEmail(_ref) {
2259
731
  showVideoEmbedInEditor: showVideoEmbedInEditor
2260
732
  }, children)), /*#__PURE__*/React.createElement("div", {
2261
733
  className: "col-span-7"
2262
- }, /*#__PURE__*/React.createElement("div", {
2263
- className: "sticky top-10 pt-10"
2264
734
  }, /*#__PURE__*/React.createElement(EmailPreview, {
2265
735
  actionButtonText: values.actionButtonText,
2266
736
  body: values.emailBody,
2267
- from: values.sendFromEmail,
737
+ className: "sticky mt-28 pt-1",
2268
738
  productName: productName,
2269
739
  subject: values.emailSubject,
2270
740
  to: sendToEmails(values.notifyEmails)
2271
- }))));
741
+ })));
2272
742
  })));
2273
743
  };
2274
744