@odigos/ui-kit 0.0.21 → 0.0.23

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.
@@ -10,13 +10,6 @@ import { M as MONITORS_OPTIONS } from './index-D3sp5Hx7.js';
10
10
  import { u as useContainerSize, a as useCopy, g as useTransition, d as useKeyDown, e as useOnClickOutside } from './useTransition-D0ykOLrk.js';
11
11
  import ReactDOM from 'react-dom';
12
12
  import { I as ImageErrorIcon } from './index-DGel4E-Z.js';
13
- import require$$0 from 'babel-runtime/helpers/extends';
14
- import require$$1$1 from 'babel-runtime/core-js/object/get-prototype-of';
15
- import require$$2 from 'babel-runtime/helpers/classCallCheck';
16
- import require$$3 from 'babel-runtime/helpers/createClass';
17
- import require$$4 from 'babel-runtime/helpers/possibleConstructorReturn';
18
- import require$$5 from 'babel-runtime/helpers/inherits';
19
- import require$$1 from 'object-assign';
20
13
  import { I as InfoIcon } from './index-BsH_egEe.js';
21
14
 
22
15
  const TextWrapper$2 = styled.div `
@@ -404,6 +397,10 @@ const TooltipContainer = styled.div `
404
397
  gap: 4px;
405
398
  cursor: help;
406
399
  `;
400
+ const TextBreakWord = styled(Text) `
401
+ word-break: break-word;
402
+ white-space: pre-wrap;
403
+ `;
407
404
  const Tooltip = ({ withIcon, titleIcon: TitleIcon, title, text, timestamp, children }) => {
408
405
  const theme = Theme.useTheme();
409
406
  const [isHovered, setIsHovered] = useState(false);
@@ -433,7 +430,7 @@ const Tooltip = ({ withIcon, titleIcon: TitleIcon, title, text, timestamp, child
433
430
  title && React.createElement(React.Fragment, null,
434
431
  title,
435
432
  "\u00A0-\u00A0"))),
436
- React.createElement(Text, { size: 12, color: theme.text.info }, text),
433
+ React.createElement(TextBreakWord, { size: 12, color: theme.text.info }, text),
437
434
  !!timestamp && (React.createElement(Text, { size: 10, color: theme.text.darker_grey, family: 'secondary', style: { marginTop: '8px' } }, new Date(timestamp).toLocaleString())))))));
438
435
  };
439
436
  const PopupContainer = styled.div `
@@ -4092,7 +4089,7 @@ const Status = ({ title, subtitle, size = 12, family = 'secondary', status = Sta
4092
4089
  };
4093
4090
 
4094
4091
  const LimitedText = styled(Text) `
4095
- max-width: ${({ $maxWidth }) => `${$maxWidth}px` || 'unset'};
4092
+ max-width: ${({ $maxWidth }) => ($maxWidth ? `${$maxWidth}px` : 'unset')};
4096
4093
  white-space: nowrap;
4097
4094
  overflow-x: auto;
4098
4095
 
@@ -4102,23 +4099,22 @@ const LimitedText = styled(Text) `
4102
4099
  display: block;
4103
4100
  }
4104
4101
  `;
4105
- const ELIPSIS_WIDTH = 12;
4106
- const ScrollX = ({ maxWidth, text, textSize, textColor }) => {
4102
+ const ScrollX = ({ maxWidth, text, textSize = 16, textColor }) => {
4107
4103
  const [isOverflowed, setIsOverflowed] = useState(false);
4108
4104
  const ref = useRef(null);
4109
4105
  // Check if text is overflowed from maximum width
4110
4106
  useEffect(() => {
4111
4107
  if (ref.current) {
4112
4108
  const { clientWidth } = ref.current;
4113
- const marginUp = (maxWidth - ELIPSIS_WIDTH) * 1.05; // add 5%
4114
- const marginDown = (maxWidth - ELIPSIS_WIDTH) * 0.95; // subtract 5%
4109
+ const marginUp = (maxWidth - textSize) * 1.05; // add 5%
4110
+ const marginDown = (maxWidth - textSize) * 0.95; // subtract 5%
4115
4111
  setIsOverflowed(clientWidth < marginUp && clientWidth > marginDown);
4116
4112
  }
4117
- }, [maxWidth, text]);
4113
+ }, [maxWidth, textSize, text]);
4118
4114
  return (React.createElement(FlexRow, { "$gap": 0 },
4119
4115
  text && (React.createElement(Tooltip, { text: isOverflowed ? text : undefined },
4120
- React.createElement(LimitedText, { ref: ref, "$maxWidth": maxWidth - ELIPSIS_WIDTH, size: textSize, color: textColor }, text))),
4121
- isOverflowed && (React.createElement(LimitedText, { "$maxWidth": ELIPSIS_WIDTH, size: textSize, color: textColor }, "..."))));
4116
+ React.createElement(LimitedText, { ref: ref, "$maxWidth": maxWidth - textSize, size: textSize, color: textColor }, text))),
4117
+ isOverflowed && (React.createElement(LimitedText, { "$maxWidth": textSize, size: textSize, color: textColor }, "..."))));
4122
4118
  };
4123
4119
 
4124
4120
  const ImageControlled = ({ src = '', alt = '', size = 16 }) => {
@@ -4137,12 +4133,12 @@ const Container$o = styled.div `
4137
4133
  height: ${({ $size }) => $size}px;
4138
4134
  border-radius: 8px;
4139
4135
  background: ${({ $status, theme }) => {
4140
- const clr = $status ? theme.text[$status] : theme.text.secondary;
4141
- return `linear-gradient(180deg, ${clr + Theme.opacity.hex['020']} 0%, ${clr + Theme.opacity.hex['005']} 100%)`;
4136
+ const clr = theme.colors[$status || 'dropdown_bg_2'];
4137
+ return `linear-gradient(180deg, ${clr} 0%, ${clr + Theme.opacity.hex['030']} 100%)`;
4142
4138
  }};
4143
4139
  `;
4144
4140
  const IconWrapped = ({ icon: Icon, src = '', alt = '', status, size = 36 }) => {
4145
- return (React.createElement(Container$o, { "$status": status, "$size": size }, src ? React.createElement(ImageControlled, { src: src, alt: alt, size: size - 16 }) : !!Icon ? React.createElement(Icon, { size: size - 16 }) : React.createElement(ImageErrorIcon, { size: size - 16 })));
4141
+ return (React.createElement(Container$o, { "$status": status, "$size": size }, src ? React.createElement(ImageControlled, { src: src, alt: alt, size: size - 12 }) : !!Icon ? React.createElement(Icon, { size: size - 12 }) : React.createElement(ImageErrorIcon, { size: size - 12 })));
4146
4142
  };
4147
4143
 
4148
4144
  const Container$n = styled.div `
@@ -4153,11 +4149,6 @@ const Container$n = styled.div `
4153
4149
  justify-content: center;
4154
4150
  width: ${({ $size }) => $size}px;
4155
4151
  height: ${({ $size }) => $size}px;
4156
- border-radius: 8px;
4157
- background: ${({ $status, theme }) => {
4158
- const clr = $status ? theme.text[$status] : theme.text.secondary;
4159
- return `linear-gradient(180deg, ${clr + Theme.opacity.hex['020']} 0%, ${clr + Theme.opacity.hex['005']} 100%)`;
4160
- }};
4161
4152
  `;
4162
4153
  const IconWrapper$3 = styled.div `
4163
4154
  position: absolute;
@@ -4170,10 +4161,17 @@ const IconWrapper$3 = styled.div `
4170
4161
  width: ${({ $size }) => $size}px;
4171
4162
  height: ${({ $size }) => $size}px;
4172
4163
  border-radius: 100%;
4164
+ border: 1px solid ${({ theme, $status }) => ($status ? theme.text[$status] : theme.colors.border) + Theme.opacity.hex['030']};
4165
+ background: ${({ $status, theme }) => {
4166
+ const clr = theme.colors[$status || 'dropdown_bg_2'];
4167
+ return `linear-gradient(180deg, ${clr} 0%, ${clr + Theme.opacity.hex['030']} 100%)`;
4168
+ }};
4173
4169
  `;
4174
4170
  const IconGroup = ({ icons = [], iconSrcs = [], status, size = 36, id }) => {
4175
4171
  const theme = Theme.useTheme();
4176
- const imgSize = icons.length === 1 || iconSrcs.length === 1 ? size - 16 : size / 3;
4172
+ const SINGLE_ICON_PADDING = 12;
4173
+ const MULTI_ICON_SCALE_DIVIDER = 2.7;
4174
+ const imgSize = icons.length === 1 || iconSrcs.length === 1 ? size - SINGLE_ICON_PADDING : size / MULTI_ICON_SCALE_DIVIDER;
4177
4175
  if (iconSrcs.length > 0) {
4178
4176
  return React.createElement(IconGroup, { icons: iconSrcs.map((src) => (() => React.createElement(ImageControlled, { src: src, size: imgSize }))), status: status, size: size, id: id });
4179
4177
  }
@@ -4181,24 +4179,25 @@ const IconGroup = ({ icons = [], iconSrcs = [], status, size = 36, id }) => {
4181
4179
  return React.createElement(IconWrapped, { icon: icons[0], status: status, size: size });
4182
4180
  }
4183
4181
  const getTopPosition = (idx) => {
4184
- if (icons.length > 2) {
4185
- return idx === 0 || idx === 1 ? imgSize * 0.2 : imgSize * 1.4;
4186
- }
4187
- return imgSize * 0.7;
4182
+ // The multiplications are magic numbers chosen based on the divider of the image size (currently 2.7)
4183
+ if (icons.length <= 2)
4184
+ return imgSize * 0.5;
4185
+ if (idx === 0 || idx === 1)
4186
+ return 0;
4187
+ return imgSize * 1.15;
4188
4188
  };
4189
4189
  const getLeftPosition = (idx) => {
4190
- if (idx >= 2) {
4191
- return imgSize * 0.7;
4192
- }
4193
- else if (idx % 2 === 0) {
4194
- return imgSize * 0.05;
4195
- }
4196
- return imgSize * 1.4;
4190
+ // The multiplications are magic numbers chosen based on the divider of the image size (currently 2.7)
4191
+ if (idx === 0)
4192
+ return 0;
4193
+ if (idx === 1)
4194
+ return imgSize * 1.15;
4195
+ return imgSize * 1.15 * 0.5;
4197
4196
  };
4198
4197
  return (React.createElement(Container$n, { "$status": status, "$size": size }, icons.map((Icon, idx) => {
4199
4198
  if (idx > 2)
4200
4199
  return null;
4201
- return (React.createElement(IconWrapper$3, { key: `icon-${id}-${idx}`, "$size": imgSize * 1.5, "$top": getTopPosition(idx), "$left": getLeftPosition(idx), "$zIndex": idx + 1 }, idx === 2 && icons.length > 3 ? (React.createElement(Text, { family: 'secondary', color: theme.text.dark_grey, size: imgSize * 0.8 },
4200
+ return (React.createElement(IconWrapper$3, { key: `icon-${id}-${idx}`, "$status": status, "$size": imgSize * 1.5, "$top": getTopPosition(idx), "$left": getLeftPosition(idx), "$zIndex": idx + 1 }, idx === 2 && icons.length > 3 ? (React.createElement(Text, { family: 'secondary', color: theme.text.dark_grey, size: imgSize * 0.8 },
4202
4201
  "+",
4203
4202
  icons.length - 2)) : (React.createElement(Icon, { size: imgSize }))));
4204
4203
  })));
@@ -4593,10 +4592,10 @@ const DataCardFields = ({ data }) => {
4593
4592
  ? '100%'
4594
4593
  : 'unset' },
4595
4594
  React.createElement(Tooltip, { text: tooltip, withIcon: true }, !!title && React.createElement(ItemTitle, null, title)),
4596
- renderValue(type, value))))));
4595
+ React.createElement(RenderValue, { type: type, value: value }))))));
4597
4596
  };
4598
4597
  // We need to maintain this with new components every time we add a new type to "DataCardFieldTypes"
4599
- const renderValue = (type, value) => {
4598
+ const RenderValue = ({ type, value }) => {
4600
4599
  const theme = Theme.useTheme();
4601
4600
  const { clickCopy, isCopied } = useCopy();
4602
4601
  switch (type) {
@@ -6246,1110 +6245,19 @@ function getDefaultExportFromCjs (x) {
6246
6245
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
6247
6246
  }
6248
6247
 
6249
- var dist = {};
6250
-
6251
- var propTypes = {exports: {}};
6252
-
6253
- var reactIs = {exports: {}};
6254
-
6255
- var reactIs_production_min = {};
6256
-
6257
- /** @license React v16.13.1
6258
- * react-is.production.min.js
6259
- *
6260
- * Copyright (c) Facebook, Inc. and its affiliates.
6261
- *
6262
- * This source code is licensed under the MIT license found in the
6263
- * LICENSE file in the root directory of this source tree.
6264
- */
6265
-
6266
- var hasRequiredReactIs_production_min;
6267
-
6268
- function requireReactIs_production_min () {
6269
- if (hasRequiredReactIs_production_min) return reactIs_production_min;
6270
- hasRequiredReactIs_production_min = 1;
6271
- 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?
6272
- 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;
6273
- 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;
6274
- 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};
6275
- 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};
6276
- 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;
6277
- return reactIs_production_min;
6278
- }
6279
-
6280
- var reactIs_development = {};
6281
-
6282
- /** @license React v16.13.1
6283
- * react-is.development.js
6284
- *
6285
- * Copyright (c) Facebook, Inc. and its affiliates.
6286
- *
6287
- * This source code is licensed under the MIT license found in the
6288
- * LICENSE file in the root directory of this source tree.
6289
- */
6290
-
6291
- var hasRequiredReactIs_development;
6292
-
6293
- function requireReactIs_development () {
6294
- if (hasRequiredReactIs_development) return reactIs_development;
6295
- hasRequiredReactIs_development = 1;
6296
-
6297
-
6298
-
6299
- if (process.env.NODE_ENV !== "production") {
6300
- (function() {
6301
-
6302
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
6303
- // nor polyfill, then a plain number is used for performance.
6304
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
6305
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
6306
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
6307
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
6308
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
6309
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
6310
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
6311
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
6312
- // (unstable) APIs that have been removed. Can we remove the symbols?
6313
-
6314
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
6315
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
6316
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
6317
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
6318
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
6319
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
6320
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
6321
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
6322
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
6323
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
6324
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
6325
-
6326
- function isValidElementType(type) {
6327
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
6328
- 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);
6329
- }
6330
-
6331
- function typeOf(object) {
6332
- if (typeof object === 'object' && object !== null) {
6333
- var $$typeof = object.$$typeof;
6334
-
6335
- switch ($$typeof) {
6336
- case REACT_ELEMENT_TYPE:
6337
- var type = object.type;
6338
-
6339
- switch (type) {
6340
- case REACT_ASYNC_MODE_TYPE:
6341
- case REACT_CONCURRENT_MODE_TYPE:
6342
- case REACT_FRAGMENT_TYPE:
6343
- case REACT_PROFILER_TYPE:
6344
- case REACT_STRICT_MODE_TYPE:
6345
- case REACT_SUSPENSE_TYPE:
6346
- return type;
6347
-
6348
- default:
6349
- var $$typeofType = type && type.$$typeof;
6350
-
6351
- switch ($$typeofType) {
6352
- case REACT_CONTEXT_TYPE:
6353
- case REACT_FORWARD_REF_TYPE:
6354
- case REACT_LAZY_TYPE:
6355
- case REACT_MEMO_TYPE:
6356
- case REACT_PROVIDER_TYPE:
6357
- return $$typeofType;
6358
-
6359
- default:
6360
- return $$typeof;
6361
- }
6362
-
6363
- }
6364
-
6365
- case REACT_PORTAL_TYPE:
6366
- return $$typeof;
6367
- }
6368
- }
6369
-
6370
- return undefined;
6371
- } // AsyncMode is deprecated along with isAsyncMode
6372
-
6373
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
6374
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
6375
- var ContextConsumer = REACT_CONTEXT_TYPE;
6376
- var ContextProvider = REACT_PROVIDER_TYPE;
6377
- var Element = REACT_ELEMENT_TYPE;
6378
- var ForwardRef = REACT_FORWARD_REF_TYPE;
6379
- var Fragment = REACT_FRAGMENT_TYPE;
6380
- var Lazy = REACT_LAZY_TYPE;
6381
- var Memo = REACT_MEMO_TYPE;
6382
- var Portal = REACT_PORTAL_TYPE;
6383
- var Profiler = REACT_PROFILER_TYPE;
6384
- var StrictMode = REACT_STRICT_MODE_TYPE;
6385
- var Suspense = REACT_SUSPENSE_TYPE;
6386
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
6387
-
6388
- function isAsyncMode(object) {
6389
- {
6390
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
6391
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
6392
-
6393
- 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.');
6394
- }
6395
- }
6396
-
6397
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
6398
- }
6399
- function isConcurrentMode(object) {
6400
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
6401
- }
6402
- function isContextConsumer(object) {
6403
- return typeOf(object) === REACT_CONTEXT_TYPE;
6404
- }
6405
- function isContextProvider(object) {
6406
- return typeOf(object) === REACT_PROVIDER_TYPE;
6407
- }
6408
- function isElement(object) {
6409
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
6410
- }
6411
- function isForwardRef(object) {
6412
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
6413
- }
6414
- function isFragment(object) {
6415
- return typeOf(object) === REACT_FRAGMENT_TYPE;
6416
- }
6417
- function isLazy(object) {
6418
- return typeOf(object) === REACT_LAZY_TYPE;
6419
- }
6420
- function isMemo(object) {
6421
- return typeOf(object) === REACT_MEMO_TYPE;
6422
- }
6423
- function isPortal(object) {
6424
- return typeOf(object) === REACT_PORTAL_TYPE;
6425
- }
6426
- function isProfiler(object) {
6427
- return typeOf(object) === REACT_PROFILER_TYPE;
6428
- }
6429
- function isStrictMode(object) {
6430
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
6431
- }
6432
- function isSuspense(object) {
6433
- return typeOf(object) === REACT_SUSPENSE_TYPE;
6434
- }
6435
-
6436
- reactIs_development.AsyncMode = AsyncMode;
6437
- reactIs_development.ConcurrentMode = ConcurrentMode;
6438
- reactIs_development.ContextConsumer = ContextConsumer;
6439
- reactIs_development.ContextProvider = ContextProvider;
6440
- reactIs_development.Element = Element;
6441
- reactIs_development.ForwardRef = ForwardRef;
6442
- reactIs_development.Fragment = Fragment;
6443
- reactIs_development.Lazy = Lazy;
6444
- reactIs_development.Memo = Memo;
6445
- reactIs_development.Portal = Portal;
6446
- reactIs_development.Profiler = Profiler;
6447
- reactIs_development.StrictMode = StrictMode;
6448
- reactIs_development.Suspense = Suspense;
6449
- reactIs_development.isAsyncMode = isAsyncMode;
6450
- reactIs_development.isConcurrentMode = isConcurrentMode;
6451
- reactIs_development.isContextConsumer = isContextConsumer;
6452
- reactIs_development.isContextProvider = isContextProvider;
6453
- reactIs_development.isElement = isElement;
6454
- reactIs_development.isForwardRef = isForwardRef;
6455
- reactIs_development.isFragment = isFragment;
6456
- reactIs_development.isLazy = isLazy;
6457
- reactIs_development.isMemo = isMemo;
6458
- reactIs_development.isPortal = isPortal;
6459
- reactIs_development.isProfiler = isProfiler;
6460
- reactIs_development.isStrictMode = isStrictMode;
6461
- reactIs_development.isSuspense = isSuspense;
6462
- reactIs_development.isValidElementType = isValidElementType;
6463
- reactIs_development.typeOf = typeOf;
6464
- })();
6465
- }
6466
- return reactIs_development;
6467
- }
6468
-
6469
- var hasRequiredReactIs;
6470
-
6471
- function requireReactIs () {
6472
- if (hasRequiredReactIs) return reactIs.exports;
6473
- hasRequiredReactIs = 1;
6474
-
6475
- if (process.env.NODE_ENV === 'production') {
6476
- reactIs.exports = requireReactIs_production_min();
6477
- } else {
6478
- reactIs.exports = requireReactIs_development();
6479
- }
6480
- return reactIs.exports;
6481
- }
6482
-
6483
- /**
6484
- * Copyright (c) 2013-present, Facebook, Inc.
6485
- *
6486
- * This source code is licensed under the MIT license found in the
6487
- * LICENSE file in the root directory of this source tree.
6488
- */
6489
-
6490
- var ReactPropTypesSecret_1;
6491
- var hasRequiredReactPropTypesSecret;
6492
-
6493
- function requireReactPropTypesSecret () {
6494
- if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
6495
- hasRequiredReactPropTypesSecret = 1;
6496
-
6497
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
6498
-
6499
- ReactPropTypesSecret_1 = ReactPropTypesSecret;
6500
- return ReactPropTypesSecret_1;
6501
- }
6502
-
6503
- var has;
6504
- var hasRequiredHas;
6505
-
6506
- function requireHas () {
6507
- if (hasRequiredHas) return has;
6508
- hasRequiredHas = 1;
6509
- has = Function.call.bind(Object.prototype.hasOwnProperty);
6510
- return has;
6511
- }
6512
-
6513
- /**
6514
- * Copyright (c) 2013-present, Facebook, Inc.
6515
- *
6516
- * This source code is licensed under the MIT license found in the
6517
- * LICENSE file in the root directory of this source tree.
6518
- */
6519
-
6520
- var checkPropTypes_1;
6521
- var hasRequiredCheckPropTypes;
6522
-
6523
- function requireCheckPropTypes () {
6524
- if (hasRequiredCheckPropTypes) return checkPropTypes_1;
6525
- hasRequiredCheckPropTypes = 1;
6526
-
6527
- var printWarning = function() {};
6528
-
6529
- if (process.env.NODE_ENV !== 'production') {
6530
- var ReactPropTypesSecret = requireReactPropTypesSecret();
6531
- var loggedTypeFailures = {};
6532
- var has = requireHas();
6533
-
6534
- printWarning = function(text) {
6535
- var message = 'Warning: ' + text;
6536
- if (typeof console !== 'undefined') {
6537
- console.error(message);
6538
- }
6539
- try {
6540
- // --- Welcome to debugging React ---
6541
- // This error was thrown as a convenience so that you can use this stack
6542
- // to find the callsite that caused this warning to fire.
6543
- throw new Error(message);
6544
- } catch (x) { /**/ }
6545
- };
6546
- }
6547
-
6548
- /**
6549
- * Assert that the values match with the type specs.
6550
- * Error messages are memorized and will only be shown once.
6551
- *
6552
- * @param {object} typeSpecs Map of name to a ReactPropType
6553
- * @param {object} values Runtime values that need to be type-checked
6554
- * @param {string} location e.g. "prop", "context", "child context"
6555
- * @param {string} componentName Name of the component for error messages.
6556
- * @param {?Function} getStack Returns the component stack.
6557
- * @private
6558
- */
6559
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
6560
- if (process.env.NODE_ENV !== 'production') {
6561
- for (var typeSpecName in typeSpecs) {
6562
- if (has(typeSpecs, typeSpecName)) {
6563
- var error;
6564
- // Prop type validation may throw. In case they do, we don't want to
6565
- // fail the render phase where it didn't fail before. So we log it.
6566
- // After these have been cleaned up, we'll let them throw.
6567
- try {
6568
- // This is intentionally an invariant that gets caught. It's the same
6569
- // behavior as without this statement except with a better message.
6570
- if (typeof typeSpecs[typeSpecName] !== 'function') {
6571
- var err = Error(
6572
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
6573
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
6574
- 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
6575
- );
6576
- err.name = 'Invariant Violation';
6577
- throw err;
6578
- }
6579
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
6580
- } catch (ex) {
6581
- error = ex;
6582
- }
6583
- if (error && !(error instanceof Error)) {
6584
- printWarning(
6585
- (componentName || 'React class') + ': type specification of ' +
6586
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
6587
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
6588
- 'You may have forgotten to pass an argument to the type checker ' +
6589
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
6590
- 'shape all require an argument).'
6591
- );
6592
- }
6593
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
6594
- // Only monitor this failure once because there tends to be a lot of the
6595
- // same error.
6596
- loggedTypeFailures[error.message] = true;
6597
-
6598
- var stack = getStack ? getStack() : '';
6599
-
6600
- printWarning(
6601
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
6602
- );
6603
- }
6604
- }
6605
- }
6606
- }
6607
- }
6608
-
6609
- /**
6610
- * Resets warning cache when testing.
6611
- *
6612
- * @private
6613
- */
6614
- checkPropTypes.resetWarningCache = function() {
6615
- if (process.env.NODE_ENV !== 'production') {
6616
- loggedTypeFailures = {};
6617
- }
6618
- };
6619
-
6620
- checkPropTypes_1 = checkPropTypes;
6621
- return checkPropTypes_1;
6622
- }
6623
-
6624
- /**
6625
- * Copyright (c) 2013-present, Facebook, Inc.
6626
- *
6627
- * This source code is licensed under the MIT license found in the
6628
- * LICENSE file in the root directory of this source tree.
6629
- */
6630
-
6631
- var factoryWithTypeCheckers;
6632
- var hasRequiredFactoryWithTypeCheckers;
6633
-
6634
- function requireFactoryWithTypeCheckers () {
6635
- if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
6636
- hasRequiredFactoryWithTypeCheckers = 1;
6637
-
6638
- var ReactIs = requireReactIs();
6639
- var assign = require$$1;
6640
-
6641
- var ReactPropTypesSecret = requireReactPropTypesSecret();
6642
- var has = requireHas();
6643
- var checkPropTypes = requireCheckPropTypes();
6644
-
6645
- var printWarning = function() {};
6646
-
6647
- if (process.env.NODE_ENV !== 'production') {
6648
- printWarning = function(text) {
6649
- var message = 'Warning: ' + text;
6650
- if (typeof console !== 'undefined') {
6651
- console.error(message);
6652
- }
6653
- try {
6654
- // --- Welcome to debugging React ---
6655
- // This error was thrown as a convenience so that you can use this stack
6656
- // to find the callsite that caused this warning to fire.
6657
- throw new Error(message);
6658
- } catch (x) {}
6659
- };
6660
- }
6661
-
6662
- function emptyFunctionThatReturnsNull() {
6663
- return null;
6664
- }
6665
-
6666
- factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
6667
- /* global Symbol */
6668
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
6669
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
6670
-
6671
- /**
6672
- * Returns the iterator method function contained on the iterable object.
6673
- *
6674
- * Be sure to invoke the function with the iterable as context:
6675
- *
6676
- * var iteratorFn = getIteratorFn(myIterable);
6677
- * if (iteratorFn) {
6678
- * var iterator = iteratorFn.call(myIterable);
6679
- * ...
6680
- * }
6681
- *
6682
- * @param {?object} maybeIterable
6683
- * @return {?function}
6684
- */
6685
- function getIteratorFn(maybeIterable) {
6686
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
6687
- if (typeof iteratorFn === 'function') {
6688
- return iteratorFn;
6689
- }
6690
- }
6691
-
6692
- /**
6693
- * Collection of methods that allow declaration and validation of props that are
6694
- * supplied to React components. Example usage:
6695
- *
6696
- * var Props = require('ReactPropTypes');
6697
- * var MyArticle = React.createClass({
6698
- * propTypes: {
6699
- * // An optional string prop named "description".
6700
- * description: Props.string,
6701
- *
6702
- * // A required enum prop named "category".
6703
- * category: Props.oneOf(['News','Photos']).isRequired,
6704
- *
6705
- * // A prop named "dialog" that requires an instance of Dialog.
6706
- * dialog: Props.instanceOf(Dialog).isRequired
6707
- * },
6708
- * render: function() { ... }
6709
- * });
6710
- *
6711
- * A more formal specification of how these methods are used:
6712
- *
6713
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
6714
- * decl := ReactPropTypes.{type}(.isRequired)?
6715
- *
6716
- * Each and every declaration produces a function with the same signature. This
6717
- * allows the creation of custom validation functions. For example:
6718
- *
6719
- * var MyLink = React.createClass({
6720
- * propTypes: {
6721
- * // An optional string or URI prop named "href".
6722
- * href: function(props, propName, componentName) {
6723
- * var propValue = props[propName];
6724
- * if (propValue != null && typeof propValue !== 'string' &&
6725
- * !(propValue instanceof URI)) {
6726
- * return new Error(
6727
- * 'Expected a string or an URI for ' + propName + ' in ' +
6728
- * componentName
6729
- * );
6730
- * }
6731
- * }
6732
- * },
6733
- * render: function() {...}
6734
- * });
6735
- *
6736
- * @internal
6737
- */
6738
-
6739
- var ANONYMOUS = '<<anonymous>>';
6740
-
6741
- // Important!
6742
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
6743
- var ReactPropTypes = {
6744
- array: createPrimitiveTypeChecker('array'),
6745
- bigint: createPrimitiveTypeChecker('bigint'),
6746
- bool: createPrimitiveTypeChecker('boolean'),
6747
- func: createPrimitiveTypeChecker('function'),
6748
- number: createPrimitiveTypeChecker('number'),
6749
- object: createPrimitiveTypeChecker('object'),
6750
- string: createPrimitiveTypeChecker('string'),
6751
- symbol: createPrimitiveTypeChecker('symbol'),
6752
-
6753
- any: createAnyTypeChecker(),
6754
- arrayOf: createArrayOfTypeChecker,
6755
- element: createElementTypeChecker(),
6756
- elementType: createElementTypeTypeChecker(),
6757
- instanceOf: createInstanceTypeChecker,
6758
- node: createNodeChecker(),
6759
- objectOf: createObjectOfTypeChecker,
6760
- oneOf: createEnumTypeChecker,
6761
- oneOfType: createUnionTypeChecker,
6762
- shape: createShapeTypeChecker,
6763
- exact: createStrictShapeTypeChecker,
6764
- };
6765
-
6766
- /**
6767
- * inlined Object.is polyfill to avoid requiring consumers ship their own
6768
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
6769
- */
6770
- /*eslint-disable no-self-compare*/
6771
- function is(x, y) {
6772
- // SameValue algorithm
6773
- if (x === y) {
6774
- // Steps 1-5, 7-10
6775
- // Steps 6.b-6.e: +0 != -0
6776
- return x !== 0 || 1 / x === 1 / y;
6777
- } else {
6778
- // Step 6.a: NaN == NaN
6779
- return x !== x && y !== y;
6780
- }
6781
- }
6782
- /*eslint-enable no-self-compare*/
6783
-
6784
- /**
6785
- * We use an Error-like object for backward compatibility as people may call
6786
- * PropTypes directly and inspect their output. However, we don't use real
6787
- * Errors anymore. We don't inspect their stack anyway, and creating them
6788
- * is prohibitively expensive if they are created too often, such as what
6789
- * happens in oneOfType() for any type before the one that matched.
6790
- */
6791
- function PropTypeError(message, data) {
6792
- this.message = message;
6793
- this.data = data && typeof data === 'object' ? data: {};
6794
- this.stack = '';
6795
- }
6796
- // Make `instanceof Error` still work for returned errors.
6797
- PropTypeError.prototype = Error.prototype;
6798
-
6799
- function createChainableTypeChecker(validate) {
6800
- if (process.env.NODE_ENV !== 'production') {
6801
- var manualPropTypeCallCache = {};
6802
- var manualPropTypeWarningCount = 0;
6803
- }
6804
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
6805
- componentName = componentName || ANONYMOUS;
6806
- propFullName = propFullName || propName;
6807
-
6808
- if (secret !== ReactPropTypesSecret) {
6809
- if (throwOnDirectAccess) {
6810
- // New behavior only for users of `prop-types` package
6811
- var err = new Error(
6812
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
6813
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
6814
- 'Read more at http://fb.me/use-check-prop-types'
6815
- );
6816
- err.name = 'Invariant Violation';
6817
- throw err;
6818
- } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
6819
- // Old behavior for people using React.PropTypes
6820
- var cacheKey = componentName + ':' + propName;
6821
- if (
6822
- !manualPropTypeCallCache[cacheKey] &&
6823
- // Avoid spamming the console because they are often not actionable except for lib authors
6824
- manualPropTypeWarningCount < 3
6825
- ) {
6826
- printWarning(
6827
- 'You are manually calling a React.PropTypes validation ' +
6828
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
6829
- 'and will throw in the standalone `prop-types` package. ' +
6830
- 'You may be seeing this warning due to a third-party PropTypes ' +
6831
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
6832
- );
6833
- manualPropTypeCallCache[cacheKey] = true;
6834
- manualPropTypeWarningCount++;
6835
- }
6836
- }
6837
- }
6838
- if (props[propName] == null) {
6839
- if (isRequired) {
6840
- if (props[propName] === null) {
6841
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
6842
- }
6843
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
6844
- }
6845
- return null;
6846
- } else {
6847
- return validate(props, propName, componentName, location, propFullName);
6848
- }
6849
- }
6850
-
6851
- var chainedCheckType = checkType.bind(null, false);
6852
- chainedCheckType.isRequired = checkType.bind(null, true);
6853
-
6854
- return chainedCheckType;
6855
- }
6856
-
6857
- function createPrimitiveTypeChecker(expectedType) {
6858
- function validate(props, propName, componentName, location, propFullName, secret) {
6859
- var propValue = props[propName];
6860
- var propType = getPropType(propValue);
6861
- if (propType !== expectedType) {
6862
- // `propValue` being instance of, say, date/regexp, pass the 'object'
6863
- // check, but we can offer a more precise error message here rather than
6864
- // 'of type `object`'.
6865
- var preciseType = getPreciseType(propValue);
6866
-
6867
- return new PropTypeError(
6868
- 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
6869
- {expectedType: expectedType}
6870
- );
6871
- }
6872
- return null;
6873
- }
6874
- return createChainableTypeChecker(validate);
6875
- }
6876
-
6877
- function createAnyTypeChecker() {
6878
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
6879
- }
6880
-
6881
- function createArrayOfTypeChecker(typeChecker) {
6882
- function validate(props, propName, componentName, location, propFullName) {
6883
- if (typeof typeChecker !== 'function') {
6884
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
6885
- }
6886
- var propValue = props[propName];
6887
- if (!Array.isArray(propValue)) {
6888
- var propType = getPropType(propValue);
6889
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
6890
- }
6891
- for (var i = 0; i < propValue.length; i++) {
6892
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
6893
- if (error instanceof Error) {
6894
- return error;
6895
- }
6896
- }
6897
- return null;
6898
- }
6899
- return createChainableTypeChecker(validate);
6900
- }
6901
-
6902
- function createElementTypeChecker() {
6903
- function validate(props, propName, componentName, location, propFullName) {
6904
- var propValue = props[propName];
6905
- if (!isValidElement(propValue)) {
6906
- var propType = getPropType(propValue);
6907
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
6908
- }
6909
- return null;
6910
- }
6911
- return createChainableTypeChecker(validate);
6912
- }
6913
-
6914
- function createElementTypeTypeChecker() {
6915
- function validate(props, propName, componentName, location, propFullName) {
6916
- var propValue = props[propName];
6917
- if (!ReactIs.isValidElementType(propValue)) {
6918
- var propType = getPropType(propValue);
6919
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
6920
- }
6921
- return null;
6922
- }
6923
- return createChainableTypeChecker(validate);
6924
- }
6925
-
6926
- function createInstanceTypeChecker(expectedClass) {
6927
- function validate(props, propName, componentName, location, propFullName) {
6928
- if (!(props[propName] instanceof expectedClass)) {
6929
- var expectedClassName = expectedClass.name || ANONYMOUS;
6930
- var actualClassName = getClassName(props[propName]);
6931
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
6932
- }
6933
- return null;
6934
- }
6935
- return createChainableTypeChecker(validate);
6936
- }
6937
-
6938
- function createEnumTypeChecker(expectedValues) {
6939
- if (!Array.isArray(expectedValues)) {
6940
- if (process.env.NODE_ENV !== 'production') {
6941
- if (arguments.length > 1) {
6942
- printWarning(
6943
- 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
6944
- 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
6945
- );
6946
- } else {
6947
- printWarning('Invalid argument supplied to oneOf, expected an array.');
6948
- }
6949
- }
6950
- return emptyFunctionThatReturnsNull;
6951
- }
6952
-
6953
- function validate(props, propName, componentName, location, propFullName) {
6954
- var propValue = props[propName];
6955
- for (var i = 0; i < expectedValues.length; i++) {
6956
- if (is(propValue, expectedValues[i])) {
6957
- return null;
6958
- }
6959
- }
6960
-
6961
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
6962
- var type = getPreciseType(value);
6963
- if (type === 'symbol') {
6964
- return String(value);
6965
- }
6966
- return value;
6967
- });
6968
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
6969
- }
6970
- return createChainableTypeChecker(validate);
6971
- }
6972
-
6973
- function createObjectOfTypeChecker(typeChecker) {
6974
- function validate(props, propName, componentName, location, propFullName) {
6975
- if (typeof typeChecker !== 'function') {
6976
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
6977
- }
6978
- var propValue = props[propName];
6979
- var propType = getPropType(propValue);
6980
- if (propType !== 'object') {
6981
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
6982
- }
6983
- for (var key in propValue) {
6984
- if (has(propValue, key)) {
6985
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
6986
- if (error instanceof Error) {
6987
- return error;
6988
- }
6989
- }
6990
- }
6991
- return null;
6992
- }
6993
- return createChainableTypeChecker(validate);
6994
- }
6995
-
6996
- function createUnionTypeChecker(arrayOfTypeCheckers) {
6997
- if (!Array.isArray(arrayOfTypeCheckers)) {
6998
- process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
6999
- return emptyFunctionThatReturnsNull;
7000
- }
7001
-
7002
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
7003
- var checker = arrayOfTypeCheckers[i];
7004
- if (typeof checker !== 'function') {
7005
- printWarning(
7006
- 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
7007
- 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
7008
- );
7009
- return emptyFunctionThatReturnsNull;
7010
- }
7011
- }
7012
-
7013
- function validate(props, propName, componentName, location, propFullName) {
7014
- var expectedTypes = [];
7015
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
7016
- var checker = arrayOfTypeCheckers[i];
7017
- var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
7018
- if (checkerResult == null) {
7019
- return null;
7020
- }
7021
- if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
7022
- expectedTypes.push(checkerResult.data.expectedType);
7023
- }
7024
- }
7025
- var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
7026
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
7027
- }
7028
- return createChainableTypeChecker(validate);
7029
- }
7030
-
7031
- function createNodeChecker() {
7032
- function validate(props, propName, componentName, location, propFullName) {
7033
- if (!isNode(props[propName])) {
7034
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
7035
- }
7036
- return null;
7037
- }
7038
- return createChainableTypeChecker(validate);
7039
- }
7040
-
7041
- function invalidValidatorError(componentName, location, propFullName, key, type) {
7042
- return new PropTypeError(
7043
- (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
7044
- 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
7045
- );
7046
- }
7047
-
7048
- function createShapeTypeChecker(shapeTypes) {
7049
- function validate(props, propName, componentName, location, propFullName) {
7050
- var propValue = props[propName];
7051
- var propType = getPropType(propValue);
7052
- if (propType !== 'object') {
7053
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
7054
- }
7055
- for (var key in shapeTypes) {
7056
- var checker = shapeTypes[key];
7057
- if (typeof checker !== 'function') {
7058
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
7059
- }
7060
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
7061
- if (error) {
7062
- return error;
7063
- }
7064
- }
7065
- return null;
7066
- }
7067
- return createChainableTypeChecker(validate);
7068
- }
7069
-
7070
- function createStrictShapeTypeChecker(shapeTypes) {
7071
- function validate(props, propName, componentName, location, propFullName) {
7072
- var propValue = props[propName];
7073
- var propType = getPropType(propValue);
7074
- if (propType !== 'object') {
7075
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
7076
- }
7077
- // We need to check all keys in case some are required but missing from props.
7078
- var allKeys = assign({}, props[propName], shapeTypes);
7079
- for (var key in allKeys) {
7080
- var checker = shapeTypes[key];
7081
- if (has(shapeTypes, key) && typeof checker !== 'function') {
7082
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
7083
- }
7084
- if (!checker) {
7085
- return new PropTypeError(
7086
- 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
7087
- '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
7088
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
7089
- );
7090
- }
7091
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
7092
- if (error) {
7093
- return error;
7094
- }
7095
- }
7096
- return null;
7097
- }
7098
-
7099
- return createChainableTypeChecker(validate);
7100
- }
7101
-
7102
- function isNode(propValue) {
7103
- switch (typeof propValue) {
7104
- case 'number':
7105
- case 'string':
7106
- case 'undefined':
7107
- return true;
7108
- case 'boolean':
7109
- return !propValue;
7110
- case 'object':
7111
- if (Array.isArray(propValue)) {
7112
- return propValue.every(isNode);
7113
- }
7114
- if (propValue === null || isValidElement(propValue)) {
7115
- return true;
7116
- }
7117
-
7118
- var iteratorFn = getIteratorFn(propValue);
7119
- if (iteratorFn) {
7120
- var iterator = iteratorFn.call(propValue);
7121
- var step;
7122
- if (iteratorFn !== propValue.entries) {
7123
- while (!(step = iterator.next()).done) {
7124
- if (!isNode(step.value)) {
7125
- return false;
7126
- }
7127
- }
7128
- } else {
7129
- // Iterator will provide entry [k,v] tuples rather than values.
7130
- while (!(step = iterator.next()).done) {
7131
- var entry = step.value;
7132
- if (entry) {
7133
- if (!isNode(entry[1])) {
7134
- return false;
7135
- }
7136
- }
7137
- }
7138
- }
7139
- } else {
7140
- return false;
7141
- }
7142
-
7143
- return true;
7144
- default:
7145
- return false;
7146
- }
7147
- }
7148
-
7149
- function isSymbol(propType, propValue) {
7150
- // Native Symbol.
7151
- if (propType === 'symbol') {
7152
- return true;
7153
- }
7154
-
7155
- // falsy value can't be a Symbol
7156
- if (!propValue) {
7157
- return false;
7158
- }
7159
-
7160
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
7161
- if (propValue['@@toStringTag'] === 'Symbol') {
7162
- return true;
7163
- }
7164
-
7165
- // Fallback for non-spec compliant Symbols which are polyfilled.
7166
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
7167
- return true;
7168
- }
7169
-
7170
- return false;
7171
- }
7172
-
7173
- // Equivalent of `typeof` but with special handling for array and regexp.
7174
- function getPropType(propValue) {
7175
- var propType = typeof propValue;
7176
- if (Array.isArray(propValue)) {
7177
- return 'array';
7178
- }
7179
- if (propValue instanceof RegExp) {
7180
- // Old webkits (at least until Android 4.0) return 'function' rather than
7181
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
7182
- // passes PropTypes.object.
7183
- return 'object';
7184
- }
7185
- if (isSymbol(propType, propValue)) {
7186
- return 'symbol';
7187
- }
7188
- return propType;
7189
- }
7190
-
7191
- // This handles more types than `getPropType`. Only used for error messages.
7192
- // See `createPrimitiveTypeChecker`.
7193
- function getPreciseType(propValue) {
7194
- if (typeof propValue === 'undefined' || propValue === null) {
7195
- return '' + propValue;
7196
- }
7197
- var propType = getPropType(propValue);
7198
- if (propType === 'object') {
7199
- if (propValue instanceof Date) {
7200
- return 'date';
7201
- } else if (propValue instanceof RegExp) {
7202
- return 'regexp';
7203
- }
7204
- }
7205
- return propType;
7206
- }
7207
-
7208
- // Returns a string that is postfixed to a warning about an invalid type.
7209
- // For example, "undefined" or "of type array"
7210
- function getPostfixForTypeWarning(value) {
7211
- var type = getPreciseType(value);
7212
- switch (type) {
7213
- case 'array':
7214
- case 'object':
7215
- return 'an ' + type;
7216
- case 'boolean':
7217
- case 'date':
7218
- case 'regexp':
7219
- return 'a ' + type;
7220
- default:
7221
- return type;
7222
- }
7223
- }
7224
-
7225
- // Returns class name of the object, if any.
7226
- function getClassName(propValue) {
7227
- if (!propValue.constructor || !propValue.constructor.name) {
7228
- return ANONYMOUS;
7229
- }
7230
- return propValue.constructor.name;
7231
- }
7232
-
7233
- ReactPropTypes.checkPropTypes = checkPropTypes;
7234
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
7235
- ReactPropTypes.PropTypes = ReactPropTypes;
7236
-
7237
- return ReactPropTypes;
7238
- };
7239
- return factoryWithTypeCheckers;
7240
- }
7241
-
7242
- /**
7243
- * Copyright (c) 2013-present, Facebook, Inc.
7244
- *
7245
- * This source code is licensed under the MIT license found in the
7246
- * LICENSE file in the root directory of this source tree.
7247
- */
6248
+ var lottie$2 = {exports: {}};
7248
6249
 
7249
- var factoryWithThrowingShims;
7250
- var hasRequiredFactoryWithThrowingShims;
7251
-
7252
- function requireFactoryWithThrowingShims () {
7253
- if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
7254
- hasRequiredFactoryWithThrowingShims = 1;
7255
-
7256
- var ReactPropTypesSecret = requireReactPropTypesSecret();
7257
-
7258
- function emptyFunction() {}
7259
- function emptyFunctionWithReset() {}
7260
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
7261
-
7262
- factoryWithThrowingShims = function() {
7263
- function shim(props, propName, componentName, location, propFullName, secret) {
7264
- if (secret === ReactPropTypesSecret) {
7265
- // It is still safe when called from React.
7266
- return;
7267
- }
7268
- var err = new Error(
7269
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
7270
- 'Use PropTypes.checkPropTypes() to call them. ' +
7271
- 'Read more at http://fb.me/use-check-prop-types'
7272
- );
7273
- err.name = 'Invariant Violation';
7274
- throw err;
7275
- } shim.isRequired = shim;
7276
- function getShim() {
7277
- return shim;
7278
- } // Important!
7279
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
7280
- var ReactPropTypes = {
7281
- array: shim,
7282
- bigint: shim,
7283
- bool: shim,
7284
- func: shim,
7285
- number: shim,
7286
- object: shim,
7287
- string: shim,
7288
- symbol: shim,
7289
-
7290
- any: shim,
7291
- arrayOf: getShim,
7292
- element: shim,
7293
- elementType: shim,
7294
- instanceOf: getShim,
7295
- node: shim,
7296
- objectOf: getShim,
7297
- oneOf: getShim,
7298
- oneOfType: getShim,
7299
- shape: getShim,
7300
- exact: getShim,
7301
-
7302
- checkPropTypes: emptyFunctionWithReset,
7303
- resetWarningCache: emptyFunction
7304
- };
7305
-
7306
- ReactPropTypes.PropTypes = ReactPropTypes;
7307
-
7308
- return ReactPropTypes;
7309
- };
7310
- return factoryWithThrowingShims;
7311
- }
7312
-
7313
- /**
7314
- * Copyright (c) 2013-present, Facebook, Inc.
7315
- *
7316
- * This source code is licensed under the MIT license found in the
7317
- * LICENSE file in the root directory of this source tree.
7318
- */
7319
-
7320
- var hasRequiredPropTypes;
7321
-
7322
- function requirePropTypes () {
7323
- if (hasRequiredPropTypes) return propTypes.exports;
7324
- hasRequiredPropTypes = 1;
7325
- if (process.env.NODE_ENV !== 'production') {
7326
- var ReactIs = requireReactIs();
7327
-
7328
- // By explicitly using `prop-types` you are opting into new development behavior.
7329
- // http://fb.me/prop-types-in-prod
7330
- var throwOnDirectAccess = true;
7331
- propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
7332
- } else {
7333
- // By explicitly using `prop-types` you are opting into new production behavior.
7334
- // http://fb.me/prop-types-in-prod
7335
- propTypes.exports = requireFactoryWithThrowingShims()();
7336
- }
7337
- return propTypes.exports;
7338
- }
7339
-
7340
- var lottie$1 = {exports: {}};
7341
-
7342
- var lottie = lottie$1.exports;
6250
+ var lottie$1 = lottie$2.exports;
7343
6251
 
7344
6252
  var hasRequiredLottie;
7345
6253
 
7346
6254
  function requireLottie () {
7347
- if (hasRequiredLottie) return lottie$1.exports;
6255
+ if (hasRequiredLottie) return lottie$2.exports;
7348
6256
  hasRequiredLottie = 1;
7349
6257
  (function (module, exports) {
7350
6258
  (typeof navigator !== "undefined") && (function (global, factory) {
7351
6259
  module.exports = factory() ;
7352
- })(lottie, (function () {
6260
+ })(lottie$1, (function () {
7353
6261
  var svgNS = 'http://www.w3.org/2000/svg';
7354
6262
  var locationHref = '';
7355
6263
  var _useWebWorker = false;
@@ -27426,296 +26334,656 @@ function requireLottie () {
27426
26334
  return lottie;
27427
26335
 
27428
26336
  }));
27429
- } (lottie$1, lottie$1.exports));
27430
- return lottie$1.exports;
26337
+ } (lottie$2, lottie$2.exports));
26338
+ return lottie$2.exports;
27431
26339
  }
27432
26340
 
27433
- var hasRequiredDist;
27434
-
27435
- function requireDist () {
27436
- if (hasRequiredDist) return dist;
27437
- hasRequiredDist = 1;
27438
-
27439
- Object.defineProperty(dist, "__esModule", {
27440
- value: true
27441
- });
27442
-
27443
- var _extends2 = require$$0;
27444
-
27445
- var _extends3 = _interopRequireDefault(_extends2);
27446
-
27447
- var _getPrototypeOf = require$$1$1;
27448
-
27449
- var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
26341
+ var lottieExports = requireLottie();
26342
+ var lottie = /*@__PURE__*/getDefaultExportFromCjs(lottieExports);
27450
26343
 
27451
- var _classCallCheck2 = require$$2;
27452
-
27453
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
27454
-
27455
- var _createClass2 = require$$3;
27456
-
27457
- var _createClass3 = _interopRequireDefault(_createClass2);
27458
-
27459
- var _possibleConstructorReturn2 = require$$4;
27460
-
27461
- var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
27462
-
27463
- var _inherits2 = require$$5;
26344
+ function _arrayLikeToArray(r, a) {
26345
+ (null == a || a > r.length) && (a = r.length);
26346
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
26347
+ return n;
26348
+ }
26349
+ function _arrayWithHoles(r) {
26350
+ if (Array.isArray(r)) return r;
26351
+ }
26352
+ function _defineProperty(e, r, t) {
26353
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
26354
+ value: t,
26355
+ enumerable: true,
26356
+ configurable: true,
26357
+ writable: true
26358
+ }) : e[r] = t, e;
26359
+ }
26360
+ function _iterableToArrayLimit(r, l) {
26361
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
26362
+ if (null != t) {
26363
+ var e,
26364
+ n,
26365
+ i,
26366
+ u,
26367
+ a = [],
26368
+ f = true,
26369
+ o = false;
26370
+ try {
26371
+ if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
26372
+ } catch (r) {
26373
+ o = true, n = r;
26374
+ } finally {
26375
+ try {
26376
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
26377
+ } finally {
26378
+ if (o) throw n;
26379
+ }
26380
+ }
26381
+ return a;
26382
+ }
26383
+ }
26384
+ function _nonIterableRest() {
26385
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
26386
+ }
26387
+ function ownKeys(e, r) {
26388
+ var t = Object.keys(e);
26389
+ if (Object.getOwnPropertySymbols) {
26390
+ var o = Object.getOwnPropertySymbols(e);
26391
+ r && (o = o.filter(function (r) {
26392
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
26393
+ })), t.push.apply(t, o);
26394
+ }
26395
+ return t;
26396
+ }
26397
+ function _objectSpread2(e) {
26398
+ for (var r = 1; r < arguments.length; r++) {
26399
+ var t = null != arguments[r] ? arguments[r] : {};
26400
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
26401
+ _defineProperty(e, r, t[r]);
26402
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
26403
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
26404
+ });
26405
+ }
26406
+ return e;
26407
+ }
26408
+ function _objectWithoutProperties(e, t) {
26409
+ if (null == e) return {};
26410
+ var o,
26411
+ r,
26412
+ i = _objectWithoutPropertiesLoose(e, t);
26413
+ if (Object.getOwnPropertySymbols) {
26414
+ var s = Object.getOwnPropertySymbols(e);
26415
+ for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
26416
+ }
26417
+ return i;
26418
+ }
26419
+ function _objectWithoutPropertiesLoose(r, e) {
26420
+ if (null == r) return {};
26421
+ var t = {};
26422
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
26423
+ if (e.includes(n)) continue;
26424
+ t[n] = r[n];
26425
+ }
26426
+ return t;
26427
+ }
26428
+ function _slicedToArray(r, e) {
26429
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
26430
+ }
26431
+ function _toPrimitive(t, r) {
26432
+ if ("object" != typeof t || !t) return t;
26433
+ var e = t[Symbol.toPrimitive];
26434
+ if (void 0 !== e) {
26435
+ var i = e.call(t, r);
26436
+ if ("object" != typeof i) return i;
26437
+ throw new TypeError("@@toPrimitive must return a primitive value.");
26438
+ }
26439
+ return ("string" === r ? String : Number)(t);
26440
+ }
26441
+ function _toPropertyKey(t) {
26442
+ var i = _toPrimitive(t, "string");
26443
+ return "symbol" == typeof i ? i : i + "";
26444
+ }
26445
+ function _unsupportedIterableToArray(r, a) {
26446
+ if (r) {
26447
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
26448
+ var t = {}.toString.call(r).slice(8, -1);
26449
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
26450
+ }
26451
+ }
27464
26452
 
27465
- var _inherits3 = _interopRequireDefault(_inherits2);
26453
+ var _excluded$1 = ["animationData", "loop", "autoplay", "initialSegment", "onComplete", "onLoopComplete", "onEnterFrame", "onSegmentStart", "onConfigReady", "onDataReady", "onDataFailed", "onLoadedImages", "onDOMLoaded", "onDestroy", "lottieRef", "renderer", "name", "assetsPath", "rendererSettings"];
26454
+ var useLottie = function useLottie(props, style) {
26455
+ var animationData = props.animationData,
26456
+ loop = props.loop,
26457
+ autoplay = props.autoplay,
26458
+ initialSegment = props.initialSegment,
26459
+ onComplete = props.onComplete,
26460
+ onLoopComplete = props.onLoopComplete,
26461
+ onEnterFrame = props.onEnterFrame,
26462
+ onSegmentStart = props.onSegmentStart,
26463
+ onConfigReady = props.onConfigReady,
26464
+ onDataReady = props.onDataReady,
26465
+ onDataFailed = props.onDataFailed,
26466
+ onLoadedImages = props.onLoadedImages,
26467
+ onDOMLoaded = props.onDOMLoaded,
26468
+ onDestroy = props.onDestroy;
26469
+ props.lottieRef;
26470
+ props.renderer;
26471
+ props.name;
26472
+ props.assetsPath;
26473
+ props.rendererSettings;
26474
+ var rest = _objectWithoutProperties(props, _excluded$1);
26475
+ var _useState = useState(false),
26476
+ _useState2 = _slicedToArray(_useState, 2),
26477
+ animationLoaded = _useState2[0],
26478
+ setAnimationLoaded = _useState2[1];
26479
+ var animationInstanceRef = useRef();
26480
+ var animationContainer = useRef(null);
26481
+ /*
26482
+ ======================================
26483
+ INTERACTION METHODS
26484
+ ======================================
26485
+ */
26486
+ /**
26487
+ * Play
26488
+ */
26489
+ var play = function play() {
26490
+ var _a;
26491
+ (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.play();
26492
+ };
26493
+ /**
26494
+ * Stop
26495
+ */
26496
+ var stop = function stop() {
26497
+ var _a;
26498
+ (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.stop();
26499
+ };
26500
+ /**
26501
+ * Pause
26502
+ */
26503
+ var pause = function pause() {
26504
+ var _a;
26505
+ (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.pause();
26506
+ };
26507
+ /**
26508
+ * Set animation speed
26509
+ * @param speed
26510
+ */
26511
+ var setSpeed = function setSpeed(speed) {
26512
+ var _a;
26513
+ (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSpeed(speed);
26514
+ };
26515
+ /**
26516
+ * Got to frame and play
26517
+ * @param value
26518
+ * @param isFrame
26519
+ */
26520
+ var goToAndPlay = function goToAndPlay(value, isFrame) {
26521
+ var _a;
26522
+ (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndPlay(value, isFrame);
26523
+ };
26524
+ /**
26525
+ * Got to frame and stop
26526
+ * @param value
26527
+ * @param isFrame
26528
+ */
26529
+ var goToAndStop = function goToAndStop(value, isFrame) {
26530
+ var _a;
26531
+ (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndStop(value, isFrame);
26532
+ };
26533
+ /**
26534
+ * Set animation direction
26535
+ * @param direction
26536
+ */
26537
+ var setDirection = function setDirection(direction) {
26538
+ var _a;
26539
+ (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setDirection(direction);
26540
+ };
26541
+ /**
26542
+ * Play animation segments
26543
+ * @param segments
26544
+ * @param forceFlag
26545
+ */
26546
+ var playSegments = function playSegments(segments, forceFlag) {
26547
+ var _a;
26548
+ (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.playSegments(segments, forceFlag);
26549
+ };
26550
+ /**
26551
+ * Set sub frames
26552
+ * @param useSubFrames
26553
+ */
26554
+ var setSubframe = function setSubframe(useSubFrames) {
26555
+ var _a;
26556
+ (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSubframe(useSubFrames);
26557
+ };
26558
+ /**
26559
+ * Get animation duration
26560
+ * @param inFrames
26561
+ */
26562
+ var getDuration = function getDuration(inFrames) {
26563
+ var _a;
26564
+ return (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.getDuration(inFrames);
26565
+ };
26566
+ /**
26567
+ * Destroy animation
26568
+ */
26569
+ var destroy = function destroy() {
26570
+ var _a;
26571
+ (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
26572
+ // Removing the reference to the animation so separate cleanups are skipped.
26573
+ // Without it the internal `lottie-react` instance throws exceptions as it already cleared itself on destroy.
26574
+ animationInstanceRef.current = undefined;
26575
+ };
26576
+ /*
26577
+ ======================================
26578
+ LOTTIE
26579
+ ======================================
26580
+ */
26581
+ /**
26582
+ * Load a new animation, and if it's the case, destroy the previous one
26583
+ * @param {Object} forcedConfigs
26584
+ */
26585
+ var loadAnimation = function loadAnimation() {
26586
+ var forcedConfigs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
26587
+ var _a;
26588
+ // Return if the container ref is null
26589
+ if (!animationContainer.current) {
26590
+ return;
26591
+ }
26592
+ // Destroy any previous instance
26593
+ (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
26594
+ // Build the animation configuration
26595
+ var config = _objectSpread2(_objectSpread2(_objectSpread2({}, props), forcedConfigs), {}, {
26596
+ container: animationContainer.current
26597
+ });
26598
+ // Save the animation instance
26599
+ animationInstanceRef.current = lottie.loadAnimation(config);
26600
+ setAnimationLoaded(!!animationInstanceRef.current);
26601
+ // Return a function that will clean up
26602
+ return function () {
26603
+ var _a;
26604
+ (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
26605
+ animationInstanceRef.current = undefined;
26606
+ };
26607
+ };
26608
+ /**
26609
+ * (Re)Initialize when animation data changed
26610
+ */
26611
+ useEffect(function () {
26612
+ var onUnmount = loadAnimation();
26613
+ // Clean up on unmount
26614
+ return function () {
26615
+ return onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount();
26616
+ };
26617
+ // eslint-disable-next-line react-hooks/exhaustive-deps
26618
+ }, [animationData, loop]);
26619
+ // Update the autoplay state
26620
+ useEffect(function () {
26621
+ if (!animationInstanceRef.current) {
26622
+ return;
26623
+ }
26624
+ animationInstanceRef.current.autoplay = !!autoplay;
26625
+ }, [autoplay]);
26626
+ // Update the initial segment state
26627
+ useEffect(function () {
26628
+ if (!animationInstanceRef.current) {
26629
+ return;
26630
+ }
26631
+ // When null should reset to default animation length
26632
+ if (!initialSegment) {
26633
+ animationInstanceRef.current.resetSegments(true);
26634
+ return;
26635
+ }
26636
+ // If it's not a valid segment, do nothing
26637
+ if (!Array.isArray(initialSegment) || !initialSegment.length) {
26638
+ return;
26639
+ }
26640
+ // If the current position it's not in the new segment
26641
+ // set the current position to start
26642
+ if (animationInstanceRef.current.currentRawFrame < initialSegment[0] || animationInstanceRef.current.currentRawFrame > initialSegment[1]) {
26643
+ animationInstanceRef.current.currentRawFrame = initialSegment[0];
26644
+ }
26645
+ // Update the segment
26646
+ animationInstanceRef.current.setSegment(initialSegment[0], initialSegment[1]);
26647
+ }, [initialSegment]);
26648
+ /*
26649
+ ======================================
26650
+ EVENTS
26651
+ ======================================
26652
+ */
26653
+ /**
26654
+ * Reinitialize listener on change
26655
+ */
26656
+ useEffect(function () {
26657
+ var partialListeners = [{
26658
+ name: "complete",
26659
+ handler: onComplete
26660
+ }, {
26661
+ name: "loopComplete",
26662
+ handler: onLoopComplete
26663
+ }, {
26664
+ name: "enterFrame",
26665
+ handler: onEnterFrame
26666
+ }, {
26667
+ name: "segmentStart",
26668
+ handler: onSegmentStart
26669
+ }, {
26670
+ name: "config_ready",
26671
+ handler: onConfigReady
26672
+ }, {
26673
+ name: "data_ready",
26674
+ handler: onDataReady
26675
+ }, {
26676
+ name: "data_failed",
26677
+ handler: onDataFailed
26678
+ }, {
26679
+ name: "loaded_images",
26680
+ handler: onLoadedImages
26681
+ }, {
26682
+ name: "DOMLoaded",
26683
+ handler: onDOMLoaded
26684
+ }, {
26685
+ name: "destroy",
26686
+ handler: onDestroy
26687
+ }];
26688
+ var listeners = partialListeners.filter(function (listener) {
26689
+ return listener.handler != null;
26690
+ });
26691
+ if (!listeners.length) {
26692
+ return;
26693
+ }
26694
+ var deregisterList = listeners.map(
26695
+ /**
26696
+ * Handle the process of adding an event listener
26697
+ * @param {Listener} listener
26698
+ * @return {Function} Function that deregister the listener
26699
+ */
26700
+ function (listener) {
26701
+ var _a;
26702
+ (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(listener.name, listener.handler);
26703
+ // Return a function to deregister this listener
26704
+ return function () {
26705
+ var _a;
26706
+ (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(listener.name, listener.handler);
26707
+ };
26708
+ });
26709
+ // Deregister listeners on unmount
26710
+ return function () {
26711
+ deregisterList.forEach(function (deregister) {
26712
+ return deregister();
26713
+ });
26714
+ };
26715
+ }, [onComplete, onLoopComplete, onEnterFrame, onSegmentStart, onConfigReady, onDataReady, onDataFailed, onLoadedImages, onDOMLoaded, onDestroy]);
26716
+ /**
26717
+ * Build the animation view
26718
+ */
26719
+ var View = /*#__PURE__*/React.createElement("div", _objectSpread2({
26720
+ style: style,
26721
+ ref: animationContainer
26722
+ }, rest));
26723
+ return {
26724
+ View: View,
26725
+ play: play,
26726
+ stop: stop,
26727
+ pause: pause,
26728
+ setSpeed: setSpeed,
26729
+ goToAndStop: goToAndStop,
26730
+ goToAndPlay: goToAndPlay,
26731
+ setDirection: setDirection,
26732
+ playSegments: playSegments,
26733
+ setSubframe: setSubframe,
26734
+ getDuration: getDuration,
26735
+ destroy: destroy,
26736
+ animationContainerRef: animationContainer,
26737
+ animationLoaded: animationLoaded,
26738
+ animationItem: animationInstanceRef.current
26739
+ };
26740
+ };
27466
26741
 
27467
- var _react = React;
27468
-
27469
- var _react2 = _interopRequireDefault(_react);
27470
-
27471
- var _propTypes = /*@__PURE__*/ requirePropTypes();
27472
-
27473
- var _propTypes2 = _interopRequireDefault(_propTypes);
27474
-
27475
- var _lottieWeb = requireLottie();
27476
-
27477
- var _lottieWeb2 = _interopRequireDefault(_lottieWeb);
27478
-
27479
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27480
-
27481
- var Lottie = function (_React$Component) {
27482
- (0, _inherits3.default)(Lottie, _React$Component);
27483
-
27484
- function Lottie() {
27485
- var _ref;
27486
-
27487
- var _temp, _this, _ret;
27488
-
27489
- (0, _classCallCheck3.default)(this, Lottie);
27490
-
27491
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
27492
- args[_key] = arguments[_key];
27493
- }
27494
-
27495
- return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Lottie.__proto__ || (0, _getPrototypeOf2.default)(Lottie)).call.apply(_ref, [this].concat(args))), _this), _this.handleClickToPause = function () {
27496
- // The pause() method is for handling pausing by passing a prop isPaused
27497
- // This method is for handling the ability to pause by clicking on the animation
27498
- if (_this.anim.isPaused) {
27499
- _this.anim.play();
27500
- } else {
27501
- _this.anim.pause();
27502
- }
27503
- }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
27504
- }
27505
-
27506
- (0, _createClass3.default)(Lottie, [{
27507
- key: 'componentDidMount',
27508
- value: function componentDidMount() {
27509
- var _props = this.props,
27510
- options = _props.options,
27511
- eventListeners = _props.eventListeners;
27512
- var loop = options.loop,
27513
- autoplay = options.autoplay,
27514
- animationData = options.animationData,
27515
- rendererSettings = options.rendererSettings,
27516
- segments = options.segments;
27517
-
27518
-
27519
- this.options = {
27520
- container: this.el,
27521
- renderer: 'svg',
27522
- loop: loop !== false,
27523
- autoplay: autoplay !== false,
27524
- segments: segments !== false,
27525
- animationData: animationData,
27526
- rendererSettings: rendererSettings
27527
- };
27528
-
27529
- this.options = (0, _extends3.default)({}, this.options, options);
27530
- this.anim = _lottieWeb2.default.loadAnimation(this.options);
27531
- this.registerEvents(eventListeners);
27532
- this.setSpeed();
27533
- }
27534
- }, {
27535
- key: 'componentWillUpdate',
27536
- value: function componentWillUpdate(nextProps /* , nextState */) {
27537
- /* Recreate the animation handle if the data is changed */
27538
- if (this.options.animationData !== nextProps.options.animationData) {
27539
- this.deRegisterEvents(this.props.eventListeners);
27540
- this.destroy();
27541
- this.options = (0, _extends3.default)({}, this.options, nextProps.options);
27542
- this.anim = _lottieWeb2.default.loadAnimation(this.options);
27543
- this.registerEvents(nextProps.eventListeners);
27544
- }
27545
- }
27546
- }, {
27547
- key: 'componentDidUpdate',
27548
- value: function componentDidUpdate() {
27549
- if (this.props.isStopped) {
27550
- this.stop();
27551
- } else if (this.props.segments) {
27552
- this.playSegments();
27553
- } else {
27554
- this.play();
27555
- }
27556
-
27557
- this.pause();
27558
- this.setSpeed();
27559
- this.setDirection();
27560
- }
27561
- }, {
27562
- key: 'componentWillUnmount',
27563
- value: function componentWillUnmount() {
27564
- this.deRegisterEvents(this.props.eventListeners);
27565
- this.destroy();
27566
- this.options.animationData = null;
27567
- this.anim = null;
27568
- }
27569
- }, {
27570
- key: 'setSpeed',
27571
- value: function setSpeed() {
27572
- this.anim.setSpeed(this.props.speed);
27573
- }
27574
- }, {
27575
- key: 'setDirection',
27576
- value: function setDirection() {
27577
- this.anim.setDirection(this.props.direction);
27578
- }
27579
- }, {
27580
- key: 'play',
27581
- value: function play() {
27582
- this.anim.play();
27583
- }
27584
- }, {
27585
- key: 'playSegments',
27586
- value: function playSegments() {
27587
- this.anim.playSegments(this.props.segments);
27588
- }
27589
- }, {
27590
- key: 'stop',
27591
- value: function stop() {
27592
- this.anim.stop();
27593
- }
27594
- }, {
27595
- key: 'pause',
27596
- value: function pause() {
27597
- if (this.props.isPaused && !this.anim.isPaused) {
27598
- this.anim.pause();
27599
- } else if (!this.props.isPaused && this.anim.isPaused) {
27600
- this.anim.pause();
27601
- }
27602
- }
27603
- }, {
27604
- key: 'destroy',
27605
- value: function destroy() {
27606
- this.anim.destroy();
27607
- }
27608
- }, {
27609
- key: 'registerEvents',
27610
- value: function registerEvents(eventListeners) {
27611
- var _this2 = this;
27612
-
27613
- eventListeners.forEach(function (eventListener) {
27614
- _this2.anim.addEventListener(eventListener.eventName, eventListener.callback);
27615
- });
27616
- }
27617
- }, {
27618
- key: 'deRegisterEvents',
27619
- value: function deRegisterEvents(eventListeners) {
27620
- var _this3 = this;
27621
-
27622
- eventListeners.forEach(function (eventListener) {
27623
- _this3.anim.removeEventListener(eventListener.eventName, eventListener.callback);
27624
- });
27625
- }
27626
- }, {
27627
- key: 'render',
27628
- value: function render() {
27629
- var _this4 = this;
27630
-
27631
- var _props2 = this.props,
27632
- width = _props2.width,
27633
- height = _props2.height,
27634
- ariaRole = _props2.ariaRole,
27635
- ariaLabel = _props2.ariaLabel,
27636
- isClickToPauseDisabled = _props2.isClickToPauseDisabled,
27637
- title = _props2.title;
27638
-
27639
-
27640
- var getSize = function getSize(initial) {
27641
- var size = void 0;
27642
-
27643
- if (typeof initial === 'number') {
27644
- size = initial + 'px';
27645
- } else {
27646
- size = initial || '100%';
27647
- }
27648
-
27649
- return size;
27650
- };
27651
-
27652
- var lottieStyles = (0, _extends3.default)({
27653
- width: getSize(width),
27654
- height: getSize(height),
27655
- overflow: 'hidden',
27656
- margin: '0 auto',
27657
- outline: 'none'
27658
- }, this.props.style);
27659
-
27660
- var onClickHandler = isClickToPauseDisabled ? function () {
27661
- return null;
27662
- } : this.handleClickToPause;
27663
-
27664
- return (
27665
- // Bug with eslint rules https://github.com/airbnb/javascript/issues/1374
27666
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions
27667
- _react2.default.createElement('div', {
27668
- ref: function ref(c) {
27669
- _this4.el = c;
27670
- },
27671
- style: lottieStyles,
27672
- onClick: onClickHandler,
27673
- title: title,
27674
- role: ariaRole,
27675
- 'aria-label': ariaLabel,
27676
- tabIndex: '0'
27677
- })
27678
- );
27679
- }
27680
- }]);
27681
- return Lottie;
27682
- }(_react2.default.Component);
27683
-
27684
- dist.default = Lottie;
27685
-
27686
-
27687
- Lottie.propTypes = {
27688
- eventListeners: _propTypes2.default.arrayOf(_propTypes2.default.object),
27689
- options: _propTypes2.default.object.isRequired,
27690
- height: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
27691
- width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
27692
- isStopped: _propTypes2.default.bool,
27693
- isPaused: _propTypes2.default.bool,
27694
- speed: _propTypes2.default.number,
27695
- segments: _propTypes2.default.arrayOf(_propTypes2.default.number),
27696
- direction: _propTypes2.default.number,
27697
- ariaRole: _propTypes2.default.string,
27698
- ariaLabel: _propTypes2.default.string,
27699
- isClickToPauseDisabled: _propTypes2.default.bool,
27700
- title: _propTypes2.default.string,
27701
- style: _propTypes2.default.object
27702
- };
27703
-
27704
- Lottie.defaultProps = {
27705
- eventListeners: [],
27706
- isStopped: false,
27707
- isPaused: false,
27708
- speed: 1,
27709
- ariaRole: 'button',
27710
- ariaLabel: 'animation',
27711
- isClickToPauseDisabled: false,
27712
- title: ''
27713
- };
27714
- return dist;
26742
+ // helpers
26743
+ function getContainerVisibility(container) {
26744
+ var _container$getBoundin = container.getBoundingClientRect(),
26745
+ top = _container$getBoundin.top,
26746
+ height = _container$getBoundin.height;
26747
+ var current = window.innerHeight - top;
26748
+ var max = window.innerHeight + height;
26749
+ return current / max;
26750
+ }
26751
+ function getContainerCursorPosition(container, cursorX, cursorY) {
26752
+ var _container$getBoundin2 = container.getBoundingClientRect(),
26753
+ top = _container$getBoundin2.top,
26754
+ left = _container$getBoundin2.left,
26755
+ width = _container$getBoundin2.width,
26756
+ height = _container$getBoundin2.height;
26757
+ var x = (cursorX - left) / width;
26758
+ var y = (cursorY - top) / height;
26759
+ return {
26760
+ x: x,
26761
+ y: y
26762
+ };
27715
26763
  }
26764
+ var useInitInteractivity = function useInitInteractivity(_ref) {
26765
+ var wrapperRef = _ref.wrapperRef,
26766
+ animationItem = _ref.animationItem,
26767
+ mode = _ref.mode,
26768
+ actions = _ref.actions;
26769
+ useEffect(function () {
26770
+ var wrapper = wrapperRef.current;
26771
+ if (!wrapper || !animationItem || !actions.length) {
26772
+ return;
26773
+ }
26774
+ animationItem.stop();
26775
+ var scrollModeHandler = function scrollModeHandler() {
26776
+ var assignedSegment = null;
26777
+ var scrollHandler = function scrollHandler() {
26778
+ var currentPercent = getContainerVisibility(wrapper);
26779
+ // Find the first action that satisfies the current position conditions
26780
+ var action = actions.find(function (_ref2) {
26781
+ var visibility = _ref2.visibility;
26782
+ return visibility && currentPercent >= visibility[0] && currentPercent <= visibility[1];
26783
+ });
26784
+ // Skip if no matching action was found!
26785
+ if (!action) {
26786
+ return;
26787
+ }
26788
+ if (action.type === "seek" && action.visibility && action.frames.length === 2) {
26789
+ // Seek: Go to a frame based on player scroll position action
26790
+ var frameToGo = action.frames[0] + Math.ceil((currentPercent - action.visibility[0]) / (action.visibility[1] - action.visibility[0]) * action.frames[1]);
26791
+ //! goToAndStop must be relative to the start of the current segment
26792
+ animationItem.goToAndStop(frameToGo - animationItem.firstFrame - 1, true);
26793
+ }
26794
+ if (action.type === "loop") {
26795
+ // Loop: Loop a given frames
26796
+ if (assignedSegment === null) {
26797
+ // if not playing any segments currently. play those segments and save to state
26798
+ animationItem.playSegments(action.frames, true);
26799
+ assignedSegment = action.frames;
26800
+ } else {
26801
+ // if playing any segments currently.
26802
+ //check if segments in state are equal to the frames selected by action
26803
+ if (assignedSegment !== action.frames) {
26804
+ // if they are not equal. new segments are to be loaded
26805
+ animationItem.playSegments(action.frames, true);
26806
+ assignedSegment = action.frames;
26807
+ } else if (animationItem.isPaused) {
26808
+ // if they are equal the play method must be called only if lottie is paused
26809
+ animationItem.playSegments(action.frames, true);
26810
+ assignedSegment = action.frames;
26811
+ }
26812
+ }
26813
+ }
26814
+ if (action.type === "play" && animationItem.isPaused) {
26815
+ // Play: Reset segments and continue playing full animation from current position
26816
+ animationItem.resetSegments(true);
26817
+ animationItem.play();
26818
+ }
26819
+ if (action.type === "stop") {
26820
+ // Stop: Stop playback
26821
+ animationItem.goToAndStop(action.frames[0] - animationItem.firstFrame - 1, true);
26822
+ }
26823
+ };
26824
+ document.addEventListener("scroll", scrollHandler);
26825
+ return function () {
26826
+ document.removeEventListener("scroll", scrollHandler);
26827
+ };
26828
+ };
26829
+ var cursorModeHandler = function cursorModeHandler() {
26830
+ var handleCursor = function handleCursor(_x, _y) {
26831
+ var x = _x;
26832
+ var y = _y;
26833
+ // Resolve cursor position if cursor is inside container
26834
+ if (x !== -1 && y !== -1) {
26835
+ // Get container cursor position
26836
+ var pos = getContainerCursorPosition(wrapper, x, y);
26837
+ // Use the resolved position
26838
+ x = pos.x;
26839
+ y = pos.y;
26840
+ }
26841
+ // Find the first action that satisfies the current position conditions
26842
+ var action = actions.find(function (_ref3) {
26843
+ var position = _ref3.position;
26844
+ if (position && Array.isArray(position.x) && Array.isArray(position.y)) {
26845
+ return x >= position.x[0] && x <= position.x[1] && y >= position.y[0] && y <= position.y[1];
26846
+ }
26847
+ if (position && !Number.isNaN(position.x) && !Number.isNaN(position.y)) {
26848
+ return x === position.x && y === position.y;
26849
+ }
26850
+ return false;
26851
+ });
26852
+ // Skip if no matching action was found!
26853
+ if (!action) {
26854
+ return;
26855
+ }
26856
+ // Process action types:
26857
+ if (action.type === "seek" && action.position && Array.isArray(action.position.x) && Array.isArray(action.position.y) && action.frames.length === 2) {
26858
+ // Seek: Go to a frame based on player scroll position action
26859
+ var xPercent = (x - action.position.x[0]) / (action.position.x[1] - action.position.x[0]);
26860
+ var yPercent = (y - action.position.y[0]) / (action.position.y[1] - action.position.y[0]);
26861
+ animationItem.playSegments(action.frames, true);
26862
+ animationItem.goToAndStop(Math.ceil((xPercent + yPercent) / 2 * (action.frames[1] - action.frames[0])), true);
26863
+ }
26864
+ if (action.type === "loop") {
26865
+ animationItem.playSegments(action.frames, true);
26866
+ }
26867
+ if (action.type === "play") {
26868
+ // Play: Reset segments and continue playing full animation from current position
26869
+ if (animationItem.isPaused) {
26870
+ animationItem.resetSegments(false);
26871
+ }
26872
+ animationItem.playSegments(action.frames);
26873
+ }
26874
+ if (action.type === "stop") {
26875
+ animationItem.goToAndStop(action.frames[0], true);
26876
+ }
26877
+ };
26878
+ var mouseMoveHandler = function mouseMoveHandler(ev) {
26879
+ handleCursor(ev.clientX, ev.clientY);
26880
+ };
26881
+ var mouseOutHandler = function mouseOutHandler() {
26882
+ handleCursor(-1, -1);
26883
+ };
26884
+ wrapper.addEventListener("mousemove", mouseMoveHandler);
26885
+ wrapper.addEventListener("mouseout", mouseOutHandler);
26886
+ return function () {
26887
+ wrapper.removeEventListener("mousemove", mouseMoveHandler);
26888
+ wrapper.removeEventListener("mouseout", mouseOutHandler);
26889
+ };
26890
+ };
26891
+ switch (mode) {
26892
+ case "scroll":
26893
+ return scrollModeHandler();
26894
+ case "cursor":
26895
+ return cursorModeHandler();
26896
+ }
26897
+ // eslint-disable-next-line react-hooks/exhaustive-deps
26898
+ }, [mode, animationItem]);
26899
+ };
26900
+ var useLottieInteractivity = function useLottieInteractivity(_ref4) {
26901
+ var actions = _ref4.actions,
26902
+ mode = _ref4.mode,
26903
+ lottieObj = _ref4.lottieObj;
26904
+ var animationItem = lottieObj.animationItem,
26905
+ View = lottieObj.View,
26906
+ animationContainerRef = lottieObj.animationContainerRef;
26907
+ useInitInteractivity({
26908
+ actions: actions,
26909
+ animationItem: animationItem,
26910
+ mode: mode,
26911
+ wrapperRef: animationContainerRef
26912
+ });
26913
+ return View;
26914
+ };
27716
26915
 
27717
- var distExports = requireDist();
27718
- var Lottie = /*@__PURE__*/getDefaultExportFromCjs(distExports);
26916
+ var _excluded = ["style", "interactivity"];
26917
+ var Lottie = function Lottie(props) {
26918
+ var _a, _b, _c;
26919
+ var style = props.style,
26920
+ interactivity = props.interactivity,
26921
+ lottieProps = _objectWithoutProperties(props, _excluded);
26922
+ /**
26923
+ * Initialize the 'useLottie' hook
26924
+ */
26925
+ var _useLottie = useLottie(lottieProps, style),
26926
+ View = _useLottie.View,
26927
+ play = _useLottie.play,
26928
+ stop = _useLottie.stop,
26929
+ pause = _useLottie.pause,
26930
+ setSpeed = _useLottie.setSpeed,
26931
+ goToAndStop = _useLottie.goToAndStop,
26932
+ goToAndPlay = _useLottie.goToAndPlay,
26933
+ setDirection = _useLottie.setDirection,
26934
+ playSegments = _useLottie.playSegments,
26935
+ setSubframe = _useLottie.setSubframe,
26936
+ getDuration = _useLottie.getDuration,
26937
+ destroy = _useLottie.destroy,
26938
+ animationContainerRef = _useLottie.animationContainerRef,
26939
+ animationLoaded = _useLottie.animationLoaded,
26940
+ animationItem = _useLottie.animationItem;
26941
+ /**
26942
+ * Make the hook variables/methods available through the provided 'lottieRef'
26943
+ */
26944
+ useEffect(function () {
26945
+ if (props.lottieRef) {
26946
+ props.lottieRef.current = {
26947
+ play: play,
26948
+ stop: stop,
26949
+ pause: pause,
26950
+ setSpeed: setSpeed,
26951
+ goToAndPlay: goToAndPlay,
26952
+ goToAndStop: goToAndStop,
26953
+ setDirection: setDirection,
26954
+ playSegments: playSegments,
26955
+ setSubframe: setSubframe,
26956
+ getDuration: getDuration,
26957
+ destroy: destroy,
26958
+ animationContainerRef: animationContainerRef,
26959
+ animationLoaded: animationLoaded,
26960
+ animationItem: animationItem
26961
+ };
26962
+ }
26963
+ // eslint-disable-next-line react-hooks/exhaustive-deps
26964
+ }, [(_a = props.lottieRef) === null || _a === void 0 ? void 0 : _a.current]);
26965
+ return useLottieInteractivity({
26966
+ lottieObj: {
26967
+ View: View,
26968
+ play: play,
26969
+ stop: stop,
26970
+ pause: pause,
26971
+ setSpeed: setSpeed,
26972
+ goToAndStop: goToAndStop,
26973
+ goToAndPlay: goToAndPlay,
26974
+ setDirection: setDirection,
26975
+ playSegments: playSegments,
26976
+ setSubframe: setSubframe,
26977
+ getDuration: getDuration,
26978
+ destroy: destroy,
26979
+ animationContainerRef: animationContainerRef,
26980
+ animationLoaded: animationLoaded,
26981
+ animationItem: animationItem
26982
+ },
26983
+ actions: (_b = interactivity === null || interactivity === void 0 ? void 0 : interactivity.actions) !== null && _b !== void 0 ? _b : [],
26984
+ mode: (_c = interactivity === null || interactivity === void 0 ? void 0 : interactivity.mode) !== null && _c !== void 0 ? _c : "scroll"
26985
+ });
26986
+ };
27719
26987
 
27720
26988
  var v = "5.12.1";
27721
26989
  var fr = 60;
@@ -29551,11 +28819,9 @@ const TraceLoader = ({ width: w = 620 }) => {
29551
28819
  return (
29552
28820
  // Note: The container width and height are swapped because the animation is rotated
29553
28821
  React.createElement(Container$1, { "$width": height, "$height": width },
29554
- React.createElement(Lottie, { width: width, height: height, isClickToPauseDisabled: true, options: {
29555
- loop: true,
29556
- autoplay: true,
29557
- animationData: animationData,
29558
- }, style: {
28822
+ React.createElement(Lottie, { autoplay: true, loop: true, animationData: animationData, style: {
28823
+ width,
28824
+ height,
29559
28825
  transform: 'rotate(-90deg)',
29560
28826
  position: 'absolute',
29561
28827
  top: -(width - width / 10),