@gravity-ui/navigation 0.0.4 → 0.0.7

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/build/cjs/index.js +4147 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/types/components/AsideHeader/AsideHeader.d.ts +50 -0
  5. package/build/cjs/types/components/AsideHeader/Content.d.ts +11 -0
  6. package/build/cjs/types/components/AsideHeader/__stories__/AsideHeader.stories.d.ts +4 -0
  7. package/build/cjs/types/components/AsideHeader/__stories__/AsideHeaderShowcase.d.ts +3 -0
  8. package/build/cjs/types/components/AsideHeader/__stories__/moc.d.ts +1 -0
  9. package/build/cjs/types/components/CompositeBar/CompositeBar.d.ts +22 -0
  10. package/build/cjs/types/components/CompositeBar/Item/Item.d.ts +27 -0
  11. package/build/cjs/types/components/CompositeBar/__stories__/CompositeBar.stories.d.ts +7 -0
  12. package/build/cjs/types/components/CompositeBar/__stories__/moc.d.ts +2 -0
  13. package/build/cjs/types/components/CompositeBar/constants.d.ts +7 -0
  14. package/build/cjs/types/components/CompositeBar/utils.d.ts +4 -0
  15. package/build/cjs/types/components/Drawer/Drawer.d.ts +20 -0
  16. package/build/cjs/types/components/Drawer/__stories__/Drawer.stories.d.ts +4 -0
  17. package/build/cjs/types/components/Drawer/__stories__/DrawerShowcase.d.ts +3 -0
  18. package/build/cjs/types/components/FooterItem/FooterItem.d.ts +7 -0
  19. package/build/cjs/types/components/FooterItem/__stories__/FooterItem.stories.d.ts +7 -0
  20. package/build/cjs/types/components/ItemTooltip/ItemTooltip.d.ts +7 -0
  21. package/build/cjs/types/components/Logo/Logo.d.ts +19 -0
  22. package/build/cjs/types/components/constants.d.ts +8 -0
  23. package/build/cjs/types/components/index.d.ts +4 -0
  24. package/build/cjs/types/components/types.d.ts +24 -0
  25. package/build/cjs/types/components/utils/cn.d.ts +5 -0
  26. package/build/cjs/types/index.d.ts +1 -0
  27. package/build/esm/index.js +4117 -0
  28. package/build/esm/index.js.map +1 -0
  29. package/build/esm/types/components/AsideHeader/AsideHeader.d.ts +50 -0
  30. package/build/esm/types/components/AsideHeader/Content.d.ts +11 -0
  31. package/build/esm/types/components/AsideHeader/__stories__/AsideHeader.stories.d.ts +4 -0
  32. package/build/esm/types/components/AsideHeader/__stories__/AsideHeaderShowcase.d.ts +3 -0
  33. package/build/esm/types/components/AsideHeader/__stories__/moc.d.ts +1 -0
  34. package/build/esm/types/components/CompositeBar/CompositeBar.d.ts +22 -0
  35. package/build/esm/types/components/CompositeBar/Item/Item.d.ts +27 -0
  36. package/build/esm/types/components/CompositeBar/__stories__/CompositeBar.stories.d.ts +7 -0
  37. package/build/esm/types/components/CompositeBar/__stories__/moc.d.ts +2 -0
  38. package/build/esm/types/components/CompositeBar/constants.d.ts +7 -0
  39. package/build/esm/types/components/CompositeBar/utils.d.ts +4 -0
  40. package/build/esm/types/components/Drawer/Drawer.d.ts +20 -0
  41. package/build/esm/types/components/Drawer/__stories__/Drawer.stories.d.ts +4 -0
  42. package/build/esm/types/components/Drawer/__stories__/DrawerShowcase.d.ts +3 -0
  43. package/build/esm/types/components/FooterItem/FooterItem.d.ts +7 -0
  44. package/build/esm/types/components/FooterItem/__stories__/FooterItem.stories.d.ts +7 -0
  45. package/build/esm/types/components/ItemTooltip/ItemTooltip.d.ts +7 -0
  46. package/build/esm/types/components/Logo/Logo.d.ts +19 -0
  47. package/build/esm/types/components/constants.d.ts +8 -0
  48. package/build/esm/types/components/index.d.ts +4 -0
  49. package/build/esm/types/components/types.d.ts +24 -0
  50. package/build/esm/types/components/utils/cn.d.ts +5 -0
  51. package/build/esm/types/index.d.ts +1 -0
  52. package/package.json +11 -8
@@ -0,0 +1,4117 @@
1
+ import * as React from 'react';
2
+ import React__default, { Children, isValidElement, cloneElement, createElement, PureComponent } from 'react';
3
+ import { Button, Icon, Popup, List } from '@gravity-ui/uikit';
4
+ import ReactDOM from 'react-dom';
5
+
6
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
7
+
8
+ var lib$1 = {};
9
+
10
+ var lib = {exports: {}};
11
+
12
+ /*!
13
+ * bem-cn v3.0.1
14
+ * Friendly BEM class names generator, greate for React
15
+ * @author Alexander Burtsev, https://github.com/albburtsev
16
+ */
17
+
18
+ (function (module, exports) {
19
+ !function(n,t){module.exports=t();}(commonjsGlobal,function(){return function(n){var t={};function e(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=n,e.c=t,e.d=function(n,t,r){e.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:r});},e.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0});},e.t=function(n,t){if(1&t&&(n=e(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var o in n)e.d(r,o,function(t){return n[t]}.bind(null,o));return r},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},e.p="",e(e.s=0)}([function(n,t,e){Object.defineProperty(t,"__esModule",{value:!0});var r=e(1);t.ERROR_BLOCK_NAME_TYPE="Block name should be a string",t.ERROR_BLOCK_NAME_EMPTY="Block name should be non-empty";var o={ns:"",el:"__",mod:"_",modValue:"_"},i=function(n){return "string"==typeof n},u=function(n){return "string"!=typeof n},s=function(n,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var i=r.assign({},t);return i.mixes=i.mixes.concat(e),c(i,n)},a=function(n,t,e){for(var o=[],i=3;i<arguments.length;i++)o[i-3]=arguments[i];var u=r.assign({},t),s=r.assign({},u.states||{});return s[e]=r.assign.apply(void 0,[{},s[e]||{}].concat(o)),u.states=s,c(u,n)},l=function(n,t,e,r){return String.prototype.split.call(f(n,t),e,r)},f=function(n,t){var e=t.name,r=t.mods,o=t.mixes,i=t.states,u=[e];if(r&&(u=u.concat(Object.keys(r).filter(function(n){return r[n]}).map(function(t){var o=r[t];return !0===o?e+n.mod+t:e+n.mod+t+n.modValue+o}))),i&&Object.keys(i).forEach(function(n){var t=i[n];u=u.concat(Object.keys(t).filter(function(n){return t[n]}).map(function(t){return n+t}));}),n.ns&&(u=u.map(function(t){return n.ns+t})),o&&(u=u.concat(function(n){return void 0===n&&(n=[]),n.map(function(n){return Array.isArray(n)?n.join(" "):"object"==typeof n&&null!==n?n.toString():"function"==typeof n?n.toString():"string"==typeof n?n:""}).filter(function(n){return !!n})}(o))),n.classMap){var s=n.classMap;u=u.map(function(n){return s[n]||n});}return u.join(" ")},c=function(n,t){return {mix:s.bind(null,t,n),split:l.bind(null,t,n),is:a.bind(null,t,n,"is-"),has:a.bind(null,t,n,"has-"),state:a.bind(null,t,n,"is-"),toString:f.bind(null,t,n)}},d=function(n,t){var e={name:n,mods:{},mixes:[],states:{"is-":{},"has-":{}}},o=function(n,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];if(!e.length)return f(n,t);var s=r.assign({},t),a=e.filter(i).reduce(function(t,e){return t+n.el+e},"");a&&(s.name=s.name+a);var l=e.filter(u).reduce(function(n,t){return r.assign(n,t)},{});return s.mods=r.assign({},s.mods,l),c(s,n)}.bind(null,t,e);return o.mix=s.bind(null,t,e),o.split=l.bind(null,t,e),o.is=a.bind(null,t,e,"is-"),o.has=a.bind(null,t,e,"has-"),o.state=a.bind(null,t,e,"is-"),o.toString=f.bind(null,t,e),o};t.setup=function(n){return void 0===n&&(n={}),function(e){if("string"!=typeof e)throw new Error(t.ERROR_BLOCK_NAME_TYPE);var i=e.trim();if(!i)throw new Error(t.ERROR_BLOCK_NAME_EMPTY);return d(i,r.assign({},o,n))}},t.block=t.setup(),t.default=t.block;},function(n,t,e){Object.defineProperty(t,"__esModule",{value:!0}),t.assign=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var r=0;r<t.length;r++){var o=t[r];for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i]);}return n};}])});
20
+ } (lib));
21
+
22
+ Object.defineProperty(lib$1, "__esModule", { value: true });
23
+ var bem_cn_1 = lib.exports;
24
+ var block$1 = bem_cn_1.setup();
25
+ function bemClassNameLite(blockName) {
26
+ var b = block$1(blockName);
27
+ function element() {
28
+ var args = [];
29
+ for (var _i = 0; _i < arguments.length; _i++) {
30
+ args[_i] = arguments[_i];
31
+ }
32
+ var elementName = args.shift();
33
+ var modifiers = args[0], mixin = args[1];
34
+ var result;
35
+ if (typeof elementName !== 'string' || typeof modifiers === 'string') {
36
+ mixin = modifiers;
37
+ modifiers = null;
38
+ }
39
+ result = b(elementName, modifiers);
40
+ if (mixin) {
41
+ result = result.mix(mixin);
42
+ }
43
+ return result.toString();
44
+ }
45
+ element.builder = function () {
46
+ return b;
47
+ };
48
+ return element;
49
+ }
50
+ bemClassNameLite.setup = function (config) {
51
+ block$1 = bem_cn_1.setup(config);
52
+ };
53
+ bemClassNameLite.reset = function () {
54
+ block$1 = bem_cn_1.setup();
55
+ };
56
+ var _default = lib$1.default = bemClassNameLite;
57
+
58
+ const NAMESPACE = 'ycn-';
59
+ function block(name) {
60
+ return _default(`${NAMESPACE}${name}`);
61
+ }
62
+
63
+ var Dict;
64
+ (function (Dict) {
65
+ Dict["ExpandButton"] = "button_expand";
66
+ Dict["CollapseButton"] = "button_collapse";
67
+ Dict["MoreButton"] = "button_more";
68
+ })(Dict || (Dict = {}));
69
+
70
+ const ASIDE_HEADER_FOOTER_ICON_SIZE = 20;
71
+ const ASIDE_HEADER_COMPACT_WIDTH = 56;
72
+ const ASIDE_HEADER_EXPANDED_WIDTH = 236;
73
+ const defaultDict = {
74
+ [Dict.CollapseButton]: 'Collapse',
75
+ [Dict.ExpandButton]: 'Expand',
76
+ [Dict.MoreButton]: 'More',
77
+ };
78
+
79
+ function _extends$4() {
80
+ _extends$4 = Object.assign ? Object.assign.bind() : function (target) {
81
+ for (var i = 1; i < arguments.length; i++) {
82
+ var source = arguments[i];
83
+
84
+ for (var key in source) {
85
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
86
+ target[key] = source[key];
87
+ }
88
+ }
89
+ }
90
+
91
+ return target;
92
+ };
93
+ return _extends$4.apply(this, arguments);
94
+ }
95
+
96
+ function _objectWithoutPropertiesLoose(source, excluded) {
97
+ if (source == null) return {};
98
+ var target = {};
99
+ var sourceKeys = Object.keys(source);
100
+ var key, i;
101
+
102
+ for (i = 0; i < sourceKeys.length; i++) {
103
+ key = sourceKeys[i];
104
+ if (excluded.indexOf(key) >= 0) continue;
105
+ target[key] = source[key];
106
+ }
107
+
108
+ return target;
109
+ }
110
+
111
+ function _setPrototypeOf(o, p) {
112
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
113
+ o.__proto__ = p;
114
+ return o;
115
+ };
116
+ return _setPrototypeOf(o, p);
117
+ }
118
+
119
+ function _inheritsLoose(subClass, superClass) {
120
+ subClass.prototype = Object.create(superClass.prototype);
121
+ subClass.prototype.constructor = subClass;
122
+ _setPrototypeOf(subClass, superClass);
123
+ }
124
+
125
+ var propTypes = {exports: {}};
126
+
127
+ var reactIs = {exports: {}};
128
+
129
+ var reactIs_production_min = {};
130
+
131
+ /** @license React v16.13.1
132
+ * react-is.production.min.js
133
+ *
134
+ * Copyright (c) Facebook, Inc. and its affiliates.
135
+ *
136
+ * This source code is licensed under the MIT license found in the
137
+ * LICENSE file in the root directory of this source tree.
138
+ */
139
+
140
+ var hasRequiredReactIs_production_min;
141
+
142
+ function requireReactIs_production_min () {
143
+ if (hasRequiredReactIs_production_min) return reactIs_production_min;
144
+ hasRequiredReactIs_production_min = 1;
145
+ 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?
146
+ 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;
147
+ 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;
148
+ 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};
149
+ 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};
150
+ 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;
151
+ return reactIs_production_min;
152
+ }
153
+
154
+ var reactIs_development = {};
155
+
156
+ /** @license React v16.13.1
157
+ * react-is.development.js
158
+ *
159
+ * Copyright (c) Facebook, Inc. and its affiliates.
160
+ *
161
+ * This source code is licensed under the MIT license found in the
162
+ * LICENSE file in the root directory of this source tree.
163
+ */
164
+
165
+ var hasRequiredReactIs_development;
166
+
167
+ function requireReactIs_development () {
168
+ if (hasRequiredReactIs_development) return reactIs_development;
169
+ hasRequiredReactIs_development = 1;
170
+
171
+
172
+
173
+ if (process.env.NODE_ENV !== "production") {
174
+ (function() {
175
+
176
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
177
+ // nor polyfill, then a plain number is used for performance.
178
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
179
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
180
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
181
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
182
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
183
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
184
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
185
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
186
+ // (unstable) APIs that have been removed. Can we remove the symbols?
187
+
188
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
189
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
190
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
191
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
192
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
193
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
194
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
195
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
196
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
197
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
198
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
199
+
200
+ function isValidElementType(type) {
201
+ return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
202
+ 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);
203
+ }
204
+
205
+ function typeOf(object) {
206
+ if (typeof object === 'object' && object !== null) {
207
+ var $$typeof = object.$$typeof;
208
+
209
+ switch ($$typeof) {
210
+ case REACT_ELEMENT_TYPE:
211
+ var type = object.type;
212
+
213
+ switch (type) {
214
+ case REACT_ASYNC_MODE_TYPE:
215
+ case REACT_CONCURRENT_MODE_TYPE:
216
+ case REACT_FRAGMENT_TYPE:
217
+ case REACT_PROFILER_TYPE:
218
+ case REACT_STRICT_MODE_TYPE:
219
+ case REACT_SUSPENSE_TYPE:
220
+ return type;
221
+
222
+ default:
223
+ var $$typeofType = type && type.$$typeof;
224
+
225
+ switch ($$typeofType) {
226
+ case REACT_CONTEXT_TYPE:
227
+ case REACT_FORWARD_REF_TYPE:
228
+ case REACT_LAZY_TYPE:
229
+ case REACT_MEMO_TYPE:
230
+ case REACT_PROVIDER_TYPE:
231
+ return $$typeofType;
232
+
233
+ default:
234
+ return $$typeof;
235
+ }
236
+
237
+ }
238
+
239
+ case REACT_PORTAL_TYPE:
240
+ return $$typeof;
241
+ }
242
+ }
243
+
244
+ return undefined;
245
+ } // AsyncMode is deprecated along with isAsyncMode
246
+
247
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
248
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
249
+ var ContextConsumer = REACT_CONTEXT_TYPE;
250
+ var ContextProvider = REACT_PROVIDER_TYPE;
251
+ var Element = REACT_ELEMENT_TYPE;
252
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
253
+ var Fragment = REACT_FRAGMENT_TYPE;
254
+ var Lazy = REACT_LAZY_TYPE;
255
+ var Memo = REACT_MEMO_TYPE;
256
+ var Portal = REACT_PORTAL_TYPE;
257
+ var Profiler = REACT_PROFILER_TYPE;
258
+ var StrictMode = REACT_STRICT_MODE_TYPE;
259
+ var Suspense = REACT_SUSPENSE_TYPE;
260
+ var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
261
+
262
+ function isAsyncMode(object) {
263
+ {
264
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
265
+ hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
266
+
267
+ 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.');
268
+ }
269
+ }
270
+
271
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
272
+ }
273
+ function isConcurrentMode(object) {
274
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
275
+ }
276
+ function isContextConsumer(object) {
277
+ return typeOf(object) === REACT_CONTEXT_TYPE;
278
+ }
279
+ function isContextProvider(object) {
280
+ return typeOf(object) === REACT_PROVIDER_TYPE;
281
+ }
282
+ function isElement(object) {
283
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
284
+ }
285
+ function isForwardRef(object) {
286
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
287
+ }
288
+ function isFragment(object) {
289
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
290
+ }
291
+ function isLazy(object) {
292
+ return typeOf(object) === REACT_LAZY_TYPE;
293
+ }
294
+ function isMemo(object) {
295
+ return typeOf(object) === REACT_MEMO_TYPE;
296
+ }
297
+ function isPortal(object) {
298
+ return typeOf(object) === REACT_PORTAL_TYPE;
299
+ }
300
+ function isProfiler(object) {
301
+ return typeOf(object) === REACT_PROFILER_TYPE;
302
+ }
303
+ function isStrictMode(object) {
304
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
305
+ }
306
+ function isSuspense(object) {
307
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
308
+ }
309
+
310
+ reactIs_development.AsyncMode = AsyncMode;
311
+ reactIs_development.ConcurrentMode = ConcurrentMode;
312
+ reactIs_development.ContextConsumer = ContextConsumer;
313
+ reactIs_development.ContextProvider = ContextProvider;
314
+ reactIs_development.Element = Element;
315
+ reactIs_development.ForwardRef = ForwardRef;
316
+ reactIs_development.Fragment = Fragment;
317
+ reactIs_development.Lazy = Lazy;
318
+ reactIs_development.Memo = Memo;
319
+ reactIs_development.Portal = Portal;
320
+ reactIs_development.Profiler = Profiler;
321
+ reactIs_development.StrictMode = StrictMode;
322
+ reactIs_development.Suspense = Suspense;
323
+ reactIs_development.isAsyncMode = isAsyncMode;
324
+ reactIs_development.isConcurrentMode = isConcurrentMode;
325
+ reactIs_development.isContextConsumer = isContextConsumer;
326
+ reactIs_development.isContextProvider = isContextProvider;
327
+ reactIs_development.isElement = isElement;
328
+ reactIs_development.isForwardRef = isForwardRef;
329
+ reactIs_development.isFragment = isFragment;
330
+ reactIs_development.isLazy = isLazy;
331
+ reactIs_development.isMemo = isMemo;
332
+ reactIs_development.isPortal = isPortal;
333
+ reactIs_development.isProfiler = isProfiler;
334
+ reactIs_development.isStrictMode = isStrictMode;
335
+ reactIs_development.isSuspense = isSuspense;
336
+ reactIs_development.isValidElementType = isValidElementType;
337
+ reactIs_development.typeOf = typeOf;
338
+ })();
339
+ }
340
+ return reactIs_development;
341
+ }
342
+
343
+ var hasRequiredReactIs;
344
+
345
+ function requireReactIs () {
346
+ if (hasRequiredReactIs) return reactIs.exports;
347
+ hasRequiredReactIs = 1;
348
+ (function (module) {
349
+
350
+ if (process.env.NODE_ENV === 'production') {
351
+ module.exports = requireReactIs_production_min();
352
+ } else {
353
+ module.exports = requireReactIs_development();
354
+ }
355
+ } (reactIs));
356
+ return reactIs.exports;
357
+ }
358
+
359
+ /*
360
+ object-assign
361
+ (c) Sindre Sorhus
362
+ @license MIT
363
+ */
364
+
365
+ var objectAssign;
366
+ var hasRequiredObjectAssign;
367
+
368
+ function requireObjectAssign () {
369
+ if (hasRequiredObjectAssign) return objectAssign;
370
+ hasRequiredObjectAssign = 1;
371
+ /* eslint-disable no-unused-vars */
372
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
373
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
374
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
375
+
376
+ function toObject(val) {
377
+ if (val === null || val === undefined) {
378
+ throw new TypeError('Object.assign cannot be called with null or undefined');
379
+ }
380
+
381
+ return Object(val);
382
+ }
383
+
384
+ function shouldUseNative() {
385
+ try {
386
+ if (!Object.assign) {
387
+ return false;
388
+ }
389
+
390
+ // Detect buggy property enumeration order in older V8 versions.
391
+
392
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
393
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
394
+ test1[5] = 'de';
395
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
396
+ return false;
397
+ }
398
+
399
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
400
+ var test2 = {};
401
+ for (var i = 0; i < 10; i++) {
402
+ test2['_' + String.fromCharCode(i)] = i;
403
+ }
404
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
405
+ return test2[n];
406
+ });
407
+ if (order2.join('') !== '0123456789') {
408
+ return false;
409
+ }
410
+
411
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
412
+ var test3 = {};
413
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
414
+ test3[letter] = letter;
415
+ });
416
+ if (Object.keys(Object.assign({}, test3)).join('') !==
417
+ 'abcdefghijklmnopqrst') {
418
+ return false;
419
+ }
420
+
421
+ return true;
422
+ } catch (err) {
423
+ // We don't expect any of the above to throw, but better to be safe.
424
+ return false;
425
+ }
426
+ }
427
+
428
+ objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
429
+ var from;
430
+ var to = toObject(target);
431
+ var symbols;
432
+
433
+ for (var s = 1; s < arguments.length; s++) {
434
+ from = Object(arguments[s]);
435
+
436
+ for (var key in from) {
437
+ if (hasOwnProperty.call(from, key)) {
438
+ to[key] = from[key];
439
+ }
440
+ }
441
+
442
+ if (getOwnPropertySymbols) {
443
+ symbols = getOwnPropertySymbols(from);
444
+ for (var i = 0; i < symbols.length; i++) {
445
+ if (propIsEnumerable.call(from, symbols[i])) {
446
+ to[symbols[i]] = from[symbols[i]];
447
+ }
448
+ }
449
+ }
450
+ }
451
+
452
+ return to;
453
+ };
454
+ return objectAssign;
455
+ }
456
+
457
+ /**
458
+ * Copyright (c) 2013-present, Facebook, Inc.
459
+ *
460
+ * This source code is licensed under the MIT license found in the
461
+ * LICENSE file in the root directory of this source tree.
462
+ */
463
+
464
+ var ReactPropTypesSecret_1;
465
+ var hasRequiredReactPropTypesSecret;
466
+
467
+ function requireReactPropTypesSecret () {
468
+ if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
469
+ hasRequiredReactPropTypesSecret = 1;
470
+
471
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
472
+
473
+ ReactPropTypesSecret_1 = ReactPropTypesSecret;
474
+ return ReactPropTypesSecret_1;
475
+ }
476
+
477
+ var has;
478
+ var hasRequiredHas;
479
+
480
+ function requireHas () {
481
+ if (hasRequiredHas) return has;
482
+ hasRequiredHas = 1;
483
+ has = Function.call.bind(Object.prototype.hasOwnProperty);
484
+ return has;
485
+ }
486
+
487
+ /**
488
+ * Copyright (c) 2013-present, Facebook, Inc.
489
+ *
490
+ * This source code is licensed under the MIT license found in the
491
+ * LICENSE file in the root directory of this source tree.
492
+ */
493
+
494
+ var checkPropTypes_1;
495
+ var hasRequiredCheckPropTypes;
496
+
497
+ function requireCheckPropTypes () {
498
+ if (hasRequiredCheckPropTypes) return checkPropTypes_1;
499
+ hasRequiredCheckPropTypes = 1;
500
+
501
+ var printWarning = function() {};
502
+
503
+ if (process.env.NODE_ENV !== 'production') {
504
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
505
+ var loggedTypeFailures = {};
506
+ var has = requireHas();
507
+
508
+ printWarning = function(text) {
509
+ var message = 'Warning: ' + text;
510
+ if (typeof console !== 'undefined') {
511
+ console.error(message);
512
+ }
513
+ try {
514
+ // --- Welcome to debugging React ---
515
+ // This error was thrown as a convenience so that you can use this stack
516
+ // to find the callsite that caused this warning to fire.
517
+ throw new Error(message);
518
+ } catch (x) { /**/ }
519
+ };
520
+ }
521
+
522
+ /**
523
+ * Assert that the values match with the type specs.
524
+ * Error messages are memorized and will only be shown once.
525
+ *
526
+ * @param {object} typeSpecs Map of name to a ReactPropType
527
+ * @param {object} values Runtime values that need to be type-checked
528
+ * @param {string} location e.g. "prop", "context", "child context"
529
+ * @param {string} componentName Name of the component for error messages.
530
+ * @param {?Function} getStack Returns the component stack.
531
+ * @private
532
+ */
533
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
534
+ if (process.env.NODE_ENV !== 'production') {
535
+ for (var typeSpecName in typeSpecs) {
536
+ if (has(typeSpecs, typeSpecName)) {
537
+ var error;
538
+ // Prop type validation may throw. In case they do, we don't want to
539
+ // fail the render phase where it didn't fail before. So we log it.
540
+ // After these have been cleaned up, we'll let them throw.
541
+ try {
542
+ // This is intentionally an invariant that gets caught. It's the same
543
+ // behavior as without this statement except with a better message.
544
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
545
+ var err = Error(
546
+ (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
547
+ 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
548
+ 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
549
+ );
550
+ err.name = 'Invariant Violation';
551
+ throw err;
552
+ }
553
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
554
+ } catch (ex) {
555
+ error = ex;
556
+ }
557
+ if (error && !(error instanceof Error)) {
558
+ printWarning(
559
+ (componentName || 'React class') + ': type specification of ' +
560
+ location + ' `' + typeSpecName + '` is invalid; the type checker ' +
561
+ 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
562
+ 'You may have forgotten to pass an argument to the type checker ' +
563
+ 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
564
+ 'shape all require an argument).'
565
+ );
566
+ }
567
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
568
+ // Only monitor this failure once because there tends to be a lot of the
569
+ // same error.
570
+ loggedTypeFailures[error.message] = true;
571
+
572
+ var stack = getStack ? getStack() : '';
573
+
574
+ printWarning(
575
+ 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
576
+ );
577
+ }
578
+ }
579
+ }
580
+ }
581
+ }
582
+
583
+ /**
584
+ * Resets warning cache when testing.
585
+ *
586
+ * @private
587
+ */
588
+ checkPropTypes.resetWarningCache = function() {
589
+ if (process.env.NODE_ENV !== 'production') {
590
+ loggedTypeFailures = {};
591
+ }
592
+ };
593
+
594
+ checkPropTypes_1 = checkPropTypes;
595
+ return checkPropTypes_1;
596
+ }
597
+
598
+ /**
599
+ * Copyright (c) 2013-present, Facebook, Inc.
600
+ *
601
+ * This source code is licensed under the MIT license found in the
602
+ * LICENSE file in the root directory of this source tree.
603
+ */
604
+
605
+ var factoryWithTypeCheckers;
606
+ var hasRequiredFactoryWithTypeCheckers;
607
+
608
+ function requireFactoryWithTypeCheckers () {
609
+ if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
610
+ hasRequiredFactoryWithTypeCheckers = 1;
611
+
612
+ var ReactIs = requireReactIs();
613
+ var assign = requireObjectAssign();
614
+
615
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
616
+ var has = requireHas();
617
+ var checkPropTypes = requireCheckPropTypes();
618
+
619
+ var printWarning = function() {};
620
+
621
+ if (process.env.NODE_ENV !== 'production') {
622
+ printWarning = function(text) {
623
+ var message = 'Warning: ' + text;
624
+ if (typeof console !== 'undefined') {
625
+ console.error(message);
626
+ }
627
+ try {
628
+ // --- Welcome to debugging React ---
629
+ // This error was thrown as a convenience so that you can use this stack
630
+ // to find the callsite that caused this warning to fire.
631
+ throw new Error(message);
632
+ } catch (x) {}
633
+ };
634
+ }
635
+
636
+ function emptyFunctionThatReturnsNull() {
637
+ return null;
638
+ }
639
+
640
+ factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
641
+ /* global Symbol */
642
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
643
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
644
+
645
+ /**
646
+ * Returns the iterator method function contained on the iterable object.
647
+ *
648
+ * Be sure to invoke the function with the iterable as context:
649
+ *
650
+ * var iteratorFn = getIteratorFn(myIterable);
651
+ * if (iteratorFn) {
652
+ * var iterator = iteratorFn.call(myIterable);
653
+ * ...
654
+ * }
655
+ *
656
+ * @param {?object} maybeIterable
657
+ * @return {?function}
658
+ */
659
+ function getIteratorFn(maybeIterable) {
660
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
661
+ if (typeof iteratorFn === 'function') {
662
+ return iteratorFn;
663
+ }
664
+ }
665
+
666
+ /**
667
+ * Collection of methods that allow declaration and validation of props that are
668
+ * supplied to React components. Example usage:
669
+ *
670
+ * var Props = require('ReactPropTypes');
671
+ * var MyArticle = React.createClass({
672
+ * propTypes: {
673
+ * // An optional string prop named "description".
674
+ * description: Props.string,
675
+ *
676
+ * // A required enum prop named "category".
677
+ * category: Props.oneOf(['News','Photos']).isRequired,
678
+ *
679
+ * // A prop named "dialog" that requires an instance of Dialog.
680
+ * dialog: Props.instanceOf(Dialog).isRequired
681
+ * },
682
+ * render: function() { ... }
683
+ * });
684
+ *
685
+ * A more formal specification of how these methods are used:
686
+ *
687
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
688
+ * decl := ReactPropTypes.{type}(.isRequired)?
689
+ *
690
+ * Each and every declaration produces a function with the same signature. This
691
+ * allows the creation of custom validation functions. For example:
692
+ *
693
+ * var MyLink = React.createClass({
694
+ * propTypes: {
695
+ * // An optional string or URI prop named "href".
696
+ * href: function(props, propName, componentName) {
697
+ * var propValue = props[propName];
698
+ * if (propValue != null && typeof propValue !== 'string' &&
699
+ * !(propValue instanceof URI)) {
700
+ * return new Error(
701
+ * 'Expected a string or an URI for ' + propName + ' in ' +
702
+ * componentName
703
+ * );
704
+ * }
705
+ * }
706
+ * },
707
+ * render: function() {...}
708
+ * });
709
+ *
710
+ * @internal
711
+ */
712
+
713
+ var ANONYMOUS = '<<anonymous>>';
714
+
715
+ // Important!
716
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
717
+ var ReactPropTypes = {
718
+ array: createPrimitiveTypeChecker('array'),
719
+ bigint: createPrimitiveTypeChecker('bigint'),
720
+ bool: createPrimitiveTypeChecker('boolean'),
721
+ func: createPrimitiveTypeChecker('function'),
722
+ number: createPrimitiveTypeChecker('number'),
723
+ object: createPrimitiveTypeChecker('object'),
724
+ string: createPrimitiveTypeChecker('string'),
725
+ symbol: createPrimitiveTypeChecker('symbol'),
726
+
727
+ any: createAnyTypeChecker(),
728
+ arrayOf: createArrayOfTypeChecker,
729
+ element: createElementTypeChecker(),
730
+ elementType: createElementTypeTypeChecker(),
731
+ instanceOf: createInstanceTypeChecker,
732
+ node: createNodeChecker(),
733
+ objectOf: createObjectOfTypeChecker,
734
+ oneOf: createEnumTypeChecker,
735
+ oneOfType: createUnionTypeChecker,
736
+ shape: createShapeTypeChecker,
737
+ exact: createStrictShapeTypeChecker,
738
+ };
739
+
740
+ /**
741
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
742
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
743
+ */
744
+ /*eslint-disable no-self-compare*/
745
+ function is(x, y) {
746
+ // SameValue algorithm
747
+ if (x === y) {
748
+ // Steps 1-5, 7-10
749
+ // Steps 6.b-6.e: +0 != -0
750
+ return x !== 0 || 1 / x === 1 / y;
751
+ } else {
752
+ // Step 6.a: NaN == NaN
753
+ return x !== x && y !== y;
754
+ }
755
+ }
756
+ /*eslint-enable no-self-compare*/
757
+
758
+ /**
759
+ * We use an Error-like object for backward compatibility as people may call
760
+ * PropTypes directly and inspect their output. However, we don't use real
761
+ * Errors anymore. We don't inspect their stack anyway, and creating them
762
+ * is prohibitively expensive if they are created too often, such as what
763
+ * happens in oneOfType() for any type before the one that matched.
764
+ */
765
+ function PropTypeError(message, data) {
766
+ this.message = message;
767
+ this.data = data && typeof data === 'object' ? data: {};
768
+ this.stack = '';
769
+ }
770
+ // Make `instanceof Error` still work for returned errors.
771
+ PropTypeError.prototype = Error.prototype;
772
+
773
+ function createChainableTypeChecker(validate) {
774
+ if (process.env.NODE_ENV !== 'production') {
775
+ var manualPropTypeCallCache = {};
776
+ var manualPropTypeWarningCount = 0;
777
+ }
778
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
779
+ componentName = componentName || ANONYMOUS;
780
+ propFullName = propFullName || propName;
781
+
782
+ if (secret !== ReactPropTypesSecret) {
783
+ if (throwOnDirectAccess) {
784
+ // New behavior only for users of `prop-types` package
785
+ var err = new Error(
786
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
787
+ 'Use `PropTypes.checkPropTypes()` to call them. ' +
788
+ 'Read more at http://fb.me/use-check-prop-types'
789
+ );
790
+ err.name = 'Invariant Violation';
791
+ throw err;
792
+ } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
793
+ // Old behavior for people using React.PropTypes
794
+ var cacheKey = componentName + ':' + propName;
795
+ if (
796
+ !manualPropTypeCallCache[cacheKey] &&
797
+ // Avoid spamming the console because they are often not actionable except for lib authors
798
+ manualPropTypeWarningCount < 3
799
+ ) {
800
+ printWarning(
801
+ 'You are manually calling a React.PropTypes validation ' +
802
+ 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
803
+ 'and will throw in the standalone `prop-types` package. ' +
804
+ 'You may be seeing this warning due to a third-party PropTypes ' +
805
+ 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
806
+ );
807
+ manualPropTypeCallCache[cacheKey] = true;
808
+ manualPropTypeWarningCount++;
809
+ }
810
+ }
811
+ }
812
+ if (props[propName] == null) {
813
+ if (isRequired) {
814
+ if (props[propName] === null) {
815
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
816
+ }
817
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
818
+ }
819
+ return null;
820
+ } else {
821
+ return validate(props, propName, componentName, location, propFullName);
822
+ }
823
+ }
824
+
825
+ var chainedCheckType = checkType.bind(null, false);
826
+ chainedCheckType.isRequired = checkType.bind(null, true);
827
+
828
+ return chainedCheckType;
829
+ }
830
+
831
+ function createPrimitiveTypeChecker(expectedType) {
832
+ function validate(props, propName, componentName, location, propFullName, secret) {
833
+ var propValue = props[propName];
834
+ var propType = getPropType(propValue);
835
+ if (propType !== expectedType) {
836
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
837
+ // check, but we can offer a more precise error message here rather than
838
+ // 'of type `object`'.
839
+ var preciseType = getPreciseType(propValue);
840
+
841
+ return new PropTypeError(
842
+ 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
843
+ {expectedType: expectedType}
844
+ );
845
+ }
846
+ return null;
847
+ }
848
+ return createChainableTypeChecker(validate);
849
+ }
850
+
851
+ function createAnyTypeChecker() {
852
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
853
+ }
854
+
855
+ function createArrayOfTypeChecker(typeChecker) {
856
+ function validate(props, propName, componentName, location, propFullName) {
857
+ if (typeof typeChecker !== 'function') {
858
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
859
+ }
860
+ var propValue = props[propName];
861
+ if (!Array.isArray(propValue)) {
862
+ var propType = getPropType(propValue);
863
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
864
+ }
865
+ for (var i = 0; i < propValue.length; i++) {
866
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
867
+ if (error instanceof Error) {
868
+ return error;
869
+ }
870
+ }
871
+ return null;
872
+ }
873
+ return createChainableTypeChecker(validate);
874
+ }
875
+
876
+ function createElementTypeChecker() {
877
+ function validate(props, propName, componentName, location, propFullName) {
878
+ var propValue = props[propName];
879
+ if (!isValidElement(propValue)) {
880
+ var propType = getPropType(propValue);
881
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
882
+ }
883
+ return null;
884
+ }
885
+ return createChainableTypeChecker(validate);
886
+ }
887
+
888
+ function createElementTypeTypeChecker() {
889
+ function validate(props, propName, componentName, location, propFullName) {
890
+ var propValue = props[propName];
891
+ if (!ReactIs.isValidElementType(propValue)) {
892
+ var propType = getPropType(propValue);
893
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
894
+ }
895
+ return null;
896
+ }
897
+ return createChainableTypeChecker(validate);
898
+ }
899
+
900
+ function createInstanceTypeChecker(expectedClass) {
901
+ function validate(props, propName, componentName, location, propFullName) {
902
+ if (!(props[propName] instanceof expectedClass)) {
903
+ var expectedClassName = expectedClass.name || ANONYMOUS;
904
+ var actualClassName = getClassName(props[propName]);
905
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
906
+ }
907
+ return null;
908
+ }
909
+ return createChainableTypeChecker(validate);
910
+ }
911
+
912
+ function createEnumTypeChecker(expectedValues) {
913
+ if (!Array.isArray(expectedValues)) {
914
+ if (process.env.NODE_ENV !== 'production') {
915
+ if (arguments.length > 1) {
916
+ printWarning(
917
+ 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
918
+ 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
919
+ );
920
+ } else {
921
+ printWarning('Invalid argument supplied to oneOf, expected an array.');
922
+ }
923
+ }
924
+ return emptyFunctionThatReturnsNull;
925
+ }
926
+
927
+ function validate(props, propName, componentName, location, propFullName) {
928
+ var propValue = props[propName];
929
+ for (var i = 0; i < expectedValues.length; i++) {
930
+ if (is(propValue, expectedValues[i])) {
931
+ return null;
932
+ }
933
+ }
934
+
935
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
936
+ var type = getPreciseType(value);
937
+ if (type === 'symbol') {
938
+ return String(value);
939
+ }
940
+ return value;
941
+ });
942
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
943
+ }
944
+ return createChainableTypeChecker(validate);
945
+ }
946
+
947
+ function createObjectOfTypeChecker(typeChecker) {
948
+ function validate(props, propName, componentName, location, propFullName) {
949
+ if (typeof typeChecker !== 'function') {
950
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
951
+ }
952
+ var propValue = props[propName];
953
+ var propType = getPropType(propValue);
954
+ if (propType !== 'object') {
955
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
956
+ }
957
+ for (var key in propValue) {
958
+ if (has(propValue, key)) {
959
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
960
+ if (error instanceof Error) {
961
+ return error;
962
+ }
963
+ }
964
+ }
965
+ return null;
966
+ }
967
+ return createChainableTypeChecker(validate);
968
+ }
969
+
970
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
971
+ if (!Array.isArray(arrayOfTypeCheckers)) {
972
+ process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
973
+ return emptyFunctionThatReturnsNull;
974
+ }
975
+
976
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
977
+ var checker = arrayOfTypeCheckers[i];
978
+ if (typeof checker !== 'function') {
979
+ printWarning(
980
+ 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
981
+ 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
982
+ );
983
+ return emptyFunctionThatReturnsNull;
984
+ }
985
+ }
986
+
987
+ function validate(props, propName, componentName, location, propFullName) {
988
+ var expectedTypes = [];
989
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
990
+ var checker = arrayOfTypeCheckers[i];
991
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
992
+ if (checkerResult == null) {
993
+ return null;
994
+ }
995
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
996
+ expectedTypes.push(checkerResult.data.expectedType);
997
+ }
998
+ }
999
+ var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
1000
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
1001
+ }
1002
+ return createChainableTypeChecker(validate);
1003
+ }
1004
+
1005
+ function createNodeChecker() {
1006
+ function validate(props, propName, componentName, location, propFullName) {
1007
+ if (!isNode(props[propName])) {
1008
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
1009
+ }
1010
+ return null;
1011
+ }
1012
+ return createChainableTypeChecker(validate);
1013
+ }
1014
+
1015
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
1016
+ return new PropTypeError(
1017
+ (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
1018
+ 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
1019
+ );
1020
+ }
1021
+
1022
+ function createShapeTypeChecker(shapeTypes) {
1023
+ function validate(props, propName, componentName, location, propFullName) {
1024
+ var propValue = props[propName];
1025
+ var propType = getPropType(propValue);
1026
+ if (propType !== 'object') {
1027
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1028
+ }
1029
+ for (var key in shapeTypes) {
1030
+ var checker = shapeTypes[key];
1031
+ if (typeof checker !== 'function') {
1032
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1033
+ }
1034
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1035
+ if (error) {
1036
+ return error;
1037
+ }
1038
+ }
1039
+ return null;
1040
+ }
1041
+ return createChainableTypeChecker(validate);
1042
+ }
1043
+
1044
+ function createStrictShapeTypeChecker(shapeTypes) {
1045
+ function validate(props, propName, componentName, location, propFullName) {
1046
+ var propValue = props[propName];
1047
+ var propType = getPropType(propValue);
1048
+ if (propType !== 'object') {
1049
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1050
+ }
1051
+ // We need to check all keys in case some are required but missing from props.
1052
+ var allKeys = assign({}, props[propName], shapeTypes);
1053
+ for (var key in allKeys) {
1054
+ var checker = shapeTypes[key];
1055
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
1056
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1057
+ }
1058
+ if (!checker) {
1059
+ return new PropTypeError(
1060
+ 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
1061
+ '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
1062
+ '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
1063
+ );
1064
+ }
1065
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1066
+ if (error) {
1067
+ return error;
1068
+ }
1069
+ }
1070
+ return null;
1071
+ }
1072
+
1073
+ return createChainableTypeChecker(validate);
1074
+ }
1075
+
1076
+ function isNode(propValue) {
1077
+ switch (typeof propValue) {
1078
+ case 'number':
1079
+ case 'string':
1080
+ case 'undefined':
1081
+ return true;
1082
+ case 'boolean':
1083
+ return !propValue;
1084
+ case 'object':
1085
+ if (Array.isArray(propValue)) {
1086
+ return propValue.every(isNode);
1087
+ }
1088
+ if (propValue === null || isValidElement(propValue)) {
1089
+ return true;
1090
+ }
1091
+
1092
+ var iteratorFn = getIteratorFn(propValue);
1093
+ if (iteratorFn) {
1094
+ var iterator = iteratorFn.call(propValue);
1095
+ var step;
1096
+ if (iteratorFn !== propValue.entries) {
1097
+ while (!(step = iterator.next()).done) {
1098
+ if (!isNode(step.value)) {
1099
+ return false;
1100
+ }
1101
+ }
1102
+ } else {
1103
+ // Iterator will provide entry [k,v] tuples rather than values.
1104
+ while (!(step = iterator.next()).done) {
1105
+ var entry = step.value;
1106
+ if (entry) {
1107
+ if (!isNode(entry[1])) {
1108
+ return false;
1109
+ }
1110
+ }
1111
+ }
1112
+ }
1113
+ } else {
1114
+ return false;
1115
+ }
1116
+
1117
+ return true;
1118
+ default:
1119
+ return false;
1120
+ }
1121
+ }
1122
+
1123
+ function isSymbol(propType, propValue) {
1124
+ // Native Symbol.
1125
+ if (propType === 'symbol') {
1126
+ return true;
1127
+ }
1128
+
1129
+ // falsy value can't be a Symbol
1130
+ if (!propValue) {
1131
+ return false;
1132
+ }
1133
+
1134
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1135
+ if (propValue['@@toStringTag'] === 'Symbol') {
1136
+ return true;
1137
+ }
1138
+
1139
+ // Fallback for non-spec compliant Symbols which are polyfilled.
1140
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1141
+ return true;
1142
+ }
1143
+
1144
+ return false;
1145
+ }
1146
+
1147
+ // Equivalent of `typeof` but with special handling for array and regexp.
1148
+ function getPropType(propValue) {
1149
+ var propType = typeof propValue;
1150
+ if (Array.isArray(propValue)) {
1151
+ return 'array';
1152
+ }
1153
+ if (propValue instanceof RegExp) {
1154
+ // Old webkits (at least until Android 4.0) return 'function' rather than
1155
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1156
+ // passes PropTypes.object.
1157
+ return 'object';
1158
+ }
1159
+ if (isSymbol(propType, propValue)) {
1160
+ return 'symbol';
1161
+ }
1162
+ return propType;
1163
+ }
1164
+
1165
+ // This handles more types than `getPropType`. Only used for error messages.
1166
+ // See `createPrimitiveTypeChecker`.
1167
+ function getPreciseType(propValue) {
1168
+ if (typeof propValue === 'undefined' || propValue === null) {
1169
+ return '' + propValue;
1170
+ }
1171
+ var propType = getPropType(propValue);
1172
+ if (propType === 'object') {
1173
+ if (propValue instanceof Date) {
1174
+ return 'date';
1175
+ } else if (propValue instanceof RegExp) {
1176
+ return 'regexp';
1177
+ }
1178
+ }
1179
+ return propType;
1180
+ }
1181
+
1182
+ // Returns a string that is postfixed to a warning about an invalid type.
1183
+ // For example, "undefined" or "of type array"
1184
+ function getPostfixForTypeWarning(value) {
1185
+ var type = getPreciseType(value);
1186
+ switch (type) {
1187
+ case 'array':
1188
+ case 'object':
1189
+ return 'an ' + type;
1190
+ case 'boolean':
1191
+ case 'date':
1192
+ case 'regexp':
1193
+ return 'a ' + type;
1194
+ default:
1195
+ return type;
1196
+ }
1197
+ }
1198
+
1199
+ // Returns class name of the object, if any.
1200
+ function getClassName(propValue) {
1201
+ if (!propValue.constructor || !propValue.constructor.name) {
1202
+ return ANONYMOUS;
1203
+ }
1204
+ return propValue.constructor.name;
1205
+ }
1206
+
1207
+ ReactPropTypes.checkPropTypes = checkPropTypes;
1208
+ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1209
+ ReactPropTypes.PropTypes = ReactPropTypes;
1210
+
1211
+ return ReactPropTypes;
1212
+ };
1213
+ return factoryWithTypeCheckers;
1214
+ }
1215
+
1216
+ /**
1217
+ * Copyright (c) 2013-present, Facebook, Inc.
1218
+ *
1219
+ * This source code is licensed under the MIT license found in the
1220
+ * LICENSE file in the root directory of this source tree.
1221
+ */
1222
+
1223
+ var factoryWithThrowingShims;
1224
+ var hasRequiredFactoryWithThrowingShims;
1225
+
1226
+ function requireFactoryWithThrowingShims () {
1227
+ if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
1228
+ hasRequiredFactoryWithThrowingShims = 1;
1229
+
1230
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
1231
+
1232
+ function emptyFunction() {}
1233
+ function emptyFunctionWithReset() {}
1234
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
1235
+
1236
+ factoryWithThrowingShims = function() {
1237
+ function shim(props, propName, componentName, location, propFullName, secret) {
1238
+ if (secret === ReactPropTypesSecret) {
1239
+ // It is still safe when called from React.
1240
+ return;
1241
+ }
1242
+ var err = new Error(
1243
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1244
+ 'Use PropTypes.checkPropTypes() to call them. ' +
1245
+ 'Read more at http://fb.me/use-check-prop-types'
1246
+ );
1247
+ err.name = 'Invariant Violation';
1248
+ throw err;
1249
+ } shim.isRequired = shim;
1250
+ function getShim() {
1251
+ return shim;
1252
+ } // Important!
1253
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1254
+ var ReactPropTypes = {
1255
+ array: shim,
1256
+ bigint: shim,
1257
+ bool: shim,
1258
+ func: shim,
1259
+ number: shim,
1260
+ object: shim,
1261
+ string: shim,
1262
+ symbol: shim,
1263
+
1264
+ any: shim,
1265
+ arrayOf: getShim,
1266
+ element: shim,
1267
+ elementType: shim,
1268
+ instanceOf: getShim,
1269
+ node: shim,
1270
+ objectOf: getShim,
1271
+ oneOf: getShim,
1272
+ oneOfType: getShim,
1273
+ shape: getShim,
1274
+ exact: getShim,
1275
+
1276
+ checkPropTypes: emptyFunctionWithReset,
1277
+ resetWarningCache: emptyFunction
1278
+ };
1279
+
1280
+ ReactPropTypes.PropTypes = ReactPropTypes;
1281
+
1282
+ return ReactPropTypes;
1283
+ };
1284
+ return factoryWithThrowingShims;
1285
+ }
1286
+
1287
+ /**
1288
+ * Copyright (c) 2013-present, Facebook, Inc.
1289
+ *
1290
+ * This source code is licensed under the MIT license found in the
1291
+ * LICENSE file in the root directory of this source tree.
1292
+ */
1293
+
1294
+ if (process.env.NODE_ENV !== 'production') {
1295
+ var ReactIs = requireReactIs();
1296
+
1297
+ // By explicitly using `prop-types` you are opting into new development behavior.
1298
+ // http://fb.me/prop-types-in-prod
1299
+ var throwOnDirectAccess = true;
1300
+ propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
1301
+ } else {
1302
+ // By explicitly using `prop-types` you are opting into new production behavior.
1303
+ // http://fb.me/prop-types-in-prod
1304
+ propTypes.exports = requireFactoryWithThrowingShims()();
1305
+ }
1306
+
1307
+ /**
1308
+ * Checks if a given element has a CSS class.
1309
+ *
1310
+ * @param element the element
1311
+ * @param className the CSS class name
1312
+ */
1313
+ function hasClass(element, className) {
1314
+ if (element.classList) return !!className && element.classList.contains(className);
1315
+ return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
1316
+ }
1317
+
1318
+ /**
1319
+ * Adds a CSS class to a given element.
1320
+ *
1321
+ * @param element the element
1322
+ * @param className the CSS class name
1323
+ */
1324
+
1325
+ function addClass(element, className) {
1326
+ if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + " " + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + " " + className);
1327
+ }
1328
+
1329
+ function replaceClassName(origClass, classToRemove) {
1330
+ return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
1331
+ }
1332
+ /**
1333
+ * Removes a CSS class from a given element.
1334
+ *
1335
+ * @param element the element
1336
+ * @param className the CSS class name
1337
+ */
1338
+
1339
+
1340
+ function removeClass$1(element, className) {
1341
+ if (element.classList) {
1342
+ element.classList.remove(className);
1343
+ } else if (typeof element.className === 'string') {
1344
+ element.className = replaceClassName(element.className, className);
1345
+ } else {
1346
+ element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
1347
+ }
1348
+ }
1349
+
1350
+ var config = {
1351
+ disabled: false
1352
+ };
1353
+
1354
+ var timeoutsShape = process.env.NODE_ENV !== 'production' ? propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.shape({
1355
+ enter: propTypes.exports.number,
1356
+ exit: propTypes.exports.number,
1357
+ appear: propTypes.exports.number
1358
+ }).isRequired]) : null;
1359
+ var classNamesShape = process.env.NODE_ENV !== 'production' ? propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.shape({
1360
+ enter: propTypes.exports.string,
1361
+ exit: propTypes.exports.string,
1362
+ active: propTypes.exports.string
1363
+ }), propTypes.exports.shape({
1364
+ enter: propTypes.exports.string,
1365
+ enterDone: propTypes.exports.string,
1366
+ enterActive: propTypes.exports.string,
1367
+ exit: propTypes.exports.string,
1368
+ exitDone: propTypes.exports.string,
1369
+ exitActive: propTypes.exports.string
1370
+ })]) : null;
1371
+
1372
+ var TransitionGroupContext = React__default.createContext(null);
1373
+
1374
+ var UNMOUNTED = 'unmounted';
1375
+ var EXITED = 'exited';
1376
+ var ENTERING = 'entering';
1377
+ var ENTERED = 'entered';
1378
+ var EXITING = 'exiting';
1379
+ /**
1380
+ * The Transition component lets you describe a transition from one component
1381
+ * state to another _over time_ with a simple declarative API. Most commonly
1382
+ * it's used to animate the mounting and unmounting of a component, but can also
1383
+ * be used to describe in-place transition states as well.
1384
+ *
1385
+ * ---
1386
+ *
1387
+ * **Note**: `Transition` is a platform-agnostic base component. If you're using
1388
+ * transitions in CSS, you'll probably want to use
1389
+ * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
1390
+ * instead. It inherits all the features of `Transition`, but contains
1391
+ * additional features necessary to play nice with CSS transitions (hence the
1392
+ * name of the component).
1393
+ *
1394
+ * ---
1395
+ *
1396
+ * By default the `Transition` component does not alter the behavior of the
1397
+ * component it renders, it only tracks "enter" and "exit" states for the
1398
+ * components. It's up to you to give meaning and effect to those states. For
1399
+ * example we can add styles to a component when it enters or exits:
1400
+ *
1401
+ * ```jsx
1402
+ * import { Transition } from 'react-transition-group';
1403
+ *
1404
+ * const duration = 300;
1405
+ *
1406
+ * const defaultStyle = {
1407
+ * transition: `opacity ${duration}ms ease-in-out`,
1408
+ * opacity: 0,
1409
+ * }
1410
+ *
1411
+ * const transitionStyles = {
1412
+ * entering: { opacity: 1 },
1413
+ * entered: { opacity: 1 },
1414
+ * exiting: { opacity: 0 },
1415
+ * exited: { opacity: 0 },
1416
+ * };
1417
+ *
1418
+ * const Fade = ({ in: inProp }) => (
1419
+ * <Transition in={inProp} timeout={duration}>
1420
+ * {state => (
1421
+ * <div style={{
1422
+ * ...defaultStyle,
1423
+ * ...transitionStyles[state]
1424
+ * }}>
1425
+ * I'm a fade Transition!
1426
+ * </div>
1427
+ * )}
1428
+ * </Transition>
1429
+ * );
1430
+ * ```
1431
+ *
1432
+ * There are 4 main states a Transition can be in:
1433
+ * - `'entering'`
1434
+ * - `'entered'`
1435
+ * - `'exiting'`
1436
+ * - `'exited'`
1437
+ *
1438
+ * Transition state is toggled via the `in` prop. When `true` the component
1439
+ * begins the "Enter" stage. During this stage, the component will shift from
1440
+ * its current transition state, to `'entering'` for the duration of the
1441
+ * transition and then to the `'entered'` stage once it's complete. Let's take
1442
+ * the following example (we'll use the
1443
+ * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
1444
+ *
1445
+ * ```jsx
1446
+ * function App() {
1447
+ * const [inProp, setInProp] = useState(false);
1448
+ * return (
1449
+ * <div>
1450
+ * <Transition in={inProp} timeout={500}>
1451
+ * {state => (
1452
+ * // ...
1453
+ * )}
1454
+ * </Transition>
1455
+ * <button onClick={() => setInProp(true)}>
1456
+ * Click to Enter
1457
+ * </button>
1458
+ * </div>
1459
+ * );
1460
+ * }
1461
+ * ```
1462
+ *
1463
+ * When the button is clicked the component will shift to the `'entering'` state
1464
+ * and stay there for 500ms (the value of `timeout`) before it finally switches
1465
+ * to `'entered'`.
1466
+ *
1467
+ * When `in` is `false` the same thing happens except the state moves from
1468
+ * `'exiting'` to `'exited'`.
1469
+ */
1470
+
1471
+ var Transition = /*#__PURE__*/function (_React$Component) {
1472
+ _inheritsLoose(Transition, _React$Component);
1473
+
1474
+ function Transition(props, context) {
1475
+ var _this;
1476
+
1477
+ _this = _React$Component.call(this, props, context) || this;
1478
+ var parentGroup = context; // In the context of a TransitionGroup all enters are really appears
1479
+
1480
+ var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
1481
+ var initialStatus;
1482
+ _this.appearStatus = null;
1483
+
1484
+ if (props.in) {
1485
+ if (appear) {
1486
+ initialStatus = EXITED;
1487
+ _this.appearStatus = ENTERING;
1488
+ } else {
1489
+ initialStatus = ENTERED;
1490
+ }
1491
+ } else {
1492
+ if (props.unmountOnExit || props.mountOnEnter) {
1493
+ initialStatus = UNMOUNTED;
1494
+ } else {
1495
+ initialStatus = EXITED;
1496
+ }
1497
+ }
1498
+
1499
+ _this.state = {
1500
+ status: initialStatus
1501
+ };
1502
+ _this.nextCallback = null;
1503
+ return _this;
1504
+ }
1505
+
1506
+ Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
1507
+ var nextIn = _ref.in;
1508
+
1509
+ if (nextIn && prevState.status === UNMOUNTED) {
1510
+ return {
1511
+ status: EXITED
1512
+ };
1513
+ }
1514
+
1515
+ return null;
1516
+ } // getSnapshotBeforeUpdate(prevProps) {
1517
+ // let nextStatus = null
1518
+ // if (prevProps !== this.props) {
1519
+ // const { status } = this.state
1520
+ // if (this.props.in) {
1521
+ // if (status !== ENTERING && status !== ENTERED) {
1522
+ // nextStatus = ENTERING
1523
+ // }
1524
+ // } else {
1525
+ // if (status === ENTERING || status === ENTERED) {
1526
+ // nextStatus = EXITING
1527
+ // }
1528
+ // }
1529
+ // }
1530
+ // return { nextStatus }
1531
+ // }
1532
+ ;
1533
+
1534
+ var _proto = Transition.prototype;
1535
+
1536
+ _proto.componentDidMount = function componentDidMount() {
1537
+ this.updateStatus(true, this.appearStatus);
1538
+ };
1539
+
1540
+ _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
1541
+ var nextStatus = null;
1542
+
1543
+ if (prevProps !== this.props) {
1544
+ var status = this.state.status;
1545
+
1546
+ if (this.props.in) {
1547
+ if (status !== ENTERING && status !== ENTERED) {
1548
+ nextStatus = ENTERING;
1549
+ }
1550
+ } else {
1551
+ if (status === ENTERING || status === ENTERED) {
1552
+ nextStatus = EXITING;
1553
+ }
1554
+ }
1555
+ }
1556
+
1557
+ this.updateStatus(false, nextStatus);
1558
+ };
1559
+
1560
+ _proto.componentWillUnmount = function componentWillUnmount() {
1561
+ this.cancelNextCallback();
1562
+ };
1563
+
1564
+ _proto.getTimeouts = function getTimeouts() {
1565
+ var timeout = this.props.timeout;
1566
+ var exit, enter, appear;
1567
+ exit = enter = appear = timeout;
1568
+
1569
+ if (timeout != null && typeof timeout !== 'number') {
1570
+ exit = timeout.exit;
1571
+ enter = timeout.enter; // TODO: remove fallback for next major
1572
+
1573
+ appear = timeout.appear !== undefined ? timeout.appear : enter;
1574
+ }
1575
+
1576
+ return {
1577
+ exit: exit,
1578
+ enter: enter,
1579
+ appear: appear
1580
+ };
1581
+ };
1582
+
1583
+ _proto.updateStatus = function updateStatus(mounting, nextStatus) {
1584
+ if (mounting === void 0) {
1585
+ mounting = false;
1586
+ }
1587
+
1588
+ if (nextStatus !== null) {
1589
+ // nextStatus will always be ENTERING or EXITING.
1590
+ this.cancelNextCallback();
1591
+
1592
+ if (nextStatus === ENTERING) {
1593
+ this.performEnter(mounting);
1594
+ } else {
1595
+ this.performExit();
1596
+ }
1597
+ } else if (this.props.unmountOnExit && this.state.status === EXITED) {
1598
+ this.setState({
1599
+ status: UNMOUNTED
1600
+ });
1601
+ }
1602
+ };
1603
+
1604
+ _proto.performEnter = function performEnter(mounting) {
1605
+ var _this2 = this;
1606
+
1607
+ var enter = this.props.enter;
1608
+ var appearing = this.context ? this.context.isMounting : mounting;
1609
+
1610
+ var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],
1611
+ maybeNode = _ref2[0],
1612
+ maybeAppearing = _ref2[1];
1613
+
1614
+ var timeouts = this.getTimeouts();
1615
+ var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
1616
+ // if we are mounting and running this it means appear _must_ be set
1617
+
1618
+ if (!mounting && !enter || config.disabled) {
1619
+ this.safeSetState({
1620
+ status: ENTERED
1621
+ }, function () {
1622
+ _this2.props.onEntered(maybeNode);
1623
+ });
1624
+ return;
1625
+ }
1626
+
1627
+ this.props.onEnter(maybeNode, maybeAppearing);
1628
+ this.safeSetState({
1629
+ status: ENTERING
1630
+ }, function () {
1631
+ _this2.props.onEntering(maybeNode, maybeAppearing);
1632
+
1633
+ _this2.onTransitionEnd(enterTimeout, function () {
1634
+ _this2.safeSetState({
1635
+ status: ENTERED
1636
+ }, function () {
1637
+ _this2.props.onEntered(maybeNode, maybeAppearing);
1638
+ });
1639
+ });
1640
+ });
1641
+ };
1642
+
1643
+ _proto.performExit = function performExit() {
1644
+ var _this3 = this;
1645
+
1646
+ var exit = this.props.exit;
1647
+ var timeouts = this.getTimeouts();
1648
+ var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED
1649
+
1650
+ if (!exit || config.disabled) {
1651
+ this.safeSetState({
1652
+ status: EXITED
1653
+ }, function () {
1654
+ _this3.props.onExited(maybeNode);
1655
+ });
1656
+ return;
1657
+ }
1658
+
1659
+ this.props.onExit(maybeNode);
1660
+ this.safeSetState({
1661
+ status: EXITING
1662
+ }, function () {
1663
+ _this3.props.onExiting(maybeNode);
1664
+
1665
+ _this3.onTransitionEnd(timeouts.exit, function () {
1666
+ _this3.safeSetState({
1667
+ status: EXITED
1668
+ }, function () {
1669
+ _this3.props.onExited(maybeNode);
1670
+ });
1671
+ });
1672
+ });
1673
+ };
1674
+
1675
+ _proto.cancelNextCallback = function cancelNextCallback() {
1676
+ if (this.nextCallback !== null) {
1677
+ this.nextCallback.cancel();
1678
+ this.nextCallback = null;
1679
+ }
1680
+ };
1681
+
1682
+ _proto.safeSetState = function safeSetState(nextState, callback) {
1683
+ // This shouldn't be necessary, but there are weird race conditions with
1684
+ // setState callbacks and unmounting in testing, so always make sure that
1685
+ // we can cancel any pending setState callbacks after we unmount.
1686
+ callback = this.setNextCallback(callback);
1687
+ this.setState(nextState, callback);
1688
+ };
1689
+
1690
+ _proto.setNextCallback = function setNextCallback(callback) {
1691
+ var _this4 = this;
1692
+
1693
+ var active = true;
1694
+
1695
+ this.nextCallback = function (event) {
1696
+ if (active) {
1697
+ active = false;
1698
+ _this4.nextCallback = null;
1699
+ callback(event);
1700
+ }
1701
+ };
1702
+
1703
+ this.nextCallback.cancel = function () {
1704
+ active = false;
1705
+ };
1706
+
1707
+ return this.nextCallback;
1708
+ };
1709
+
1710
+ _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
1711
+ this.setNextCallback(handler);
1712
+ var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);
1713
+ var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
1714
+
1715
+ if (!node || doesNotHaveTimeoutOrListener) {
1716
+ setTimeout(this.nextCallback, 0);
1717
+ return;
1718
+ }
1719
+
1720
+ if (this.props.addEndListener) {
1721
+ var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],
1722
+ maybeNode = _ref3[0],
1723
+ maybeNextCallback = _ref3[1];
1724
+
1725
+ this.props.addEndListener(maybeNode, maybeNextCallback);
1726
+ }
1727
+
1728
+ if (timeout != null) {
1729
+ setTimeout(this.nextCallback, timeout);
1730
+ }
1731
+ };
1732
+
1733
+ _proto.render = function render() {
1734
+ var status = this.state.status;
1735
+
1736
+ if (status === UNMOUNTED) {
1737
+ return null;
1738
+ }
1739
+
1740
+ var _this$props = this.props,
1741
+ children = _this$props.children;
1742
+ _this$props.in;
1743
+ _this$props.mountOnEnter;
1744
+ _this$props.unmountOnExit;
1745
+ _this$props.appear;
1746
+ _this$props.enter;
1747
+ _this$props.exit;
1748
+ _this$props.timeout;
1749
+ _this$props.addEndListener;
1750
+ _this$props.onEnter;
1751
+ _this$props.onEntering;
1752
+ _this$props.onEntered;
1753
+ _this$props.onExit;
1754
+ _this$props.onExiting;
1755
+ _this$props.onExited;
1756
+ _this$props.nodeRef;
1757
+ var childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
1758
+
1759
+ return (
1760
+ /*#__PURE__*/
1761
+ // allows for nested Transitions
1762
+ React__default.createElement(TransitionGroupContext.Provider, {
1763
+ value: null
1764
+ }, typeof children === 'function' ? children(status, childProps) : React__default.cloneElement(React__default.Children.only(children), childProps))
1765
+ );
1766
+ };
1767
+
1768
+ return Transition;
1769
+ }(React__default.Component);
1770
+
1771
+ Transition.contextType = TransitionGroupContext;
1772
+ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
1773
+ /**
1774
+ * A React reference to DOM element that need to transition:
1775
+ * https://stackoverflow.com/a/51127130/4671932
1776
+ *
1777
+ * - When `nodeRef` prop is used, `node` is not passed to callback functions
1778
+ * (e.g. `onEnter`) because user already has direct access to the node.
1779
+ * - When changing `key` prop of `Transition` in a `TransitionGroup` a new
1780
+ * `nodeRef` need to be provided to `Transition` with changed `key` prop
1781
+ * (see
1782
+ * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
1783
+ */
1784
+ nodeRef: propTypes.exports.shape({
1785
+ current: typeof Element === 'undefined' ? propTypes.exports.any : propTypes.exports.instanceOf(Element)
1786
+ }),
1787
+
1788
+ /**
1789
+ * A `function` child can be used instead of a React element. This function is
1790
+ * called with the current transition status (`'entering'`, `'entered'`,
1791
+ * `'exiting'`, `'exited'`), which can be used to apply context
1792
+ * specific props to a component.
1793
+ *
1794
+ * ```jsx
1795
+ * <Transition in={this.state.in} timeout={150}>
1796
+ * {state => (
1797
+ * <MyComponent className={`fade fade-${state}`} />
1798
+ * )}
1799
+ * </Transition>
1800
+ * ```
1801
+ */
1802
+ children: propTypes.exports.oneOfType([propTypes.exports.func.isRequired, propTypes.exports.element.isRequired]).isRequired,
1803
+
1804
+ /**
1805
+ * Show the component; triggers the enter or exit states
1806
+ */
1807
+ in: propTypes.exports.bool,
1808
+
1809
+ /**
1810
+ * By default the child component is mounted immediately along with
1811
+ * the parent `Transition` component. If you want to "lazy mount" the component on the
1812
+ * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
1813
+ * mounted, even on "exited", unless you also specify `unmountOnExit`.
1814
+ */
1815
+ mountOnEnter: propTypes.exports.bool,
1816
+
1817
+ /**
1818
+ * By default the child component stays mounted after it reaches the `'exited'` state.
1819
+ * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
1820
+ */
1821
+ unmountOnExit: propTypes.exports.bool,
1822
+
1823
+ /**
1824
+ * By default the child component does not perform the enter transition when
1825
+ * it first mounts, regardless of the value of `in`. If you want this
1826
+ * behavior, set both `appear` and `in` to `true`.
1827
+ *
1828
+ * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
1829
+ * > only adds an additional enter transition. However, in the
1830
+ * > `<CSSTransition>` component that first enter transition does result in
1831
+ * > additional `.appear-*` classes, that way you can choose to style it
1832
+ * > differently.
1833
+ */
1834
+ appear: propTypes.exports.bool,
1835
+
1836
+ /**
1837
+ * Enable or disable enter transitions.
1838
+ */
1839
+ enter: propTypes.exports.bool,
1840
+
1841
+ /**
1842
+ * Enable or disable exit transitions.
1843
+ */
1844
+ exit: propTypes.exports.bool,
1845
+
1846
+ /**
1847
+ * The duration of the transition, in milliseconds.
1848
+ * Required unless `addEndListener` is provided.
1849
+ *
1850
+ * You may specify a single timeout for all transitions:
1851
+ *
1852
+ * ```jsx
1853
+ * timeout={500}
1854
+ * ```
1855
+ *
1856
+ * or individually:
1857
+ *
1858
+ * ```jsx
1859
+ * timeout={{
1860
+ * appear: 500,
1861
+ * enter: 300,
1862
+ * exit: 500,
1863
+ * }}
1864
+ * ```
1865
+ *
1866
+ * - `appear` defaults to the value of `enter`
1867
+ * - `enter` defaults to `0`
1868
+ * - `exit` defaults to `0`
1869
+ *
1870
+ * @type {number | { enter?: number, exit?: number, appear?: number }}
1871
+ */
1872
+ timeout: function timeout(props) {
1873
+ var pt = timeoutsShape;
1874
+ if (!props.addEndListener) pt = pt.isRequired;
1875
+
1876
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1877
+ args[_key - 1] = arguments[_key];
1878
+ }
1879
+
1880
+ return pt.apply(void 0, [props].concat(args));
1881
+ },
1882
+
1883
+ /**
1884
+ * Add a custom transition end trigger. Called with the transitioning
1885
+ * DOM node and a `done` callback. Allows for more fine grained transition end
1886
+ * logic. Timeouts are still used as a fallback if provided.
1887
+ *
1888
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1889
+ *
1890
+ * ```jsx
1891
+ * addEndListener={(node, done) => {
1892
+ * // use the css transitionend event to mark the finish of a transition
1893
+ * node.addEventListener('transitionend', done, false);
1894
+ * }}
1895
+ * ```
1896
+ */
1897
+ addEndListener: propTypes.exports.func,
1898
+
1899
+ /**
1900
+ * Callback fired before the "entering" status is applied. An extra parameter
1901
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
1902
+ *
1903
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1904
+ *
1905
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
1906
+ */
1907
+ onEnter: propTypes.exports.func,
1908
+
1909
+ /**
1910
+ * Callback fired after the "entering" status is applied. An extra parameter
1911
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
1912
+ *
1913
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1914
+ *
1915
+ * @type Function(node: HtmlElement, isAppearing: bool)
1916
+ */
1917
+ onEntering: propTypes.exports.func,
1918
+
1919
+ /**
1920
+ * Callback fired after the "entered" status is applied. An extra parameter
1921
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
1922
+ *
1923
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1924
+ *
1925
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
1926
+ */
1927
+ onEntered: propTypes.exports.func,
1928
+
1929
+ /**
1930
+ * Callback fired before the "exiting" status is applied.
1931
+ *
1932
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1933
+ *
1934
+ * @type Function(node: HtmlElement) -> void
1935
+ */
1936
+ onExit: propTypes.exports.func,
1937
+
1938
+ /**
1939
+ * Callback fired after the "exiting" status is applied.
1940
+ *
1941
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1942
+ *
1943
+ * @type Function(node: HtmlElement) -> void
1944
+ */
1945
+ onExiting: propTypes.exports.func,
1946
+
1947
+ /**
1948
+ * Callback fired after the "exited" status is applied.
1949
+ *
1950
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
1951
+ *
1952
+ * @type Function(node: HtmlElement) -> void
1953
+ */
1954
+ onExited: propTypes.exports.func
1955
+ } : {}; // Name the function so it is clearer in the documentation
1956
+
1957
+ function noop() {}
1958
+
1959
+ Transition.defaultProps = {
1960
+ in: false,
1961
+ mountOnEnter: false,
1962
+ unmountOnExit: false,
1963
+ appear: false,
1964
+ enter: true,
1965
+ exit: true,
1966
+ onEnter: noop,
1967
+ onEntering: noop,
1968
+ onEntered: noop,
1969
+ onExit: noop,
1970
+ onExiting: noop,
1971
+ onExited: noop
1972
+ };
1973
+ Transition.UNMOUNTED = UNMOUNTED;
1974
+ Transition.EXITED = EXITED;
1975
+ Transition.ENTERING = ENTERING;
1976
+ Transition.ENTERED = ENTERED;
1977
+ Transition.EXITING = EXITING;
1978
+
1979
+ var _addClass = function addClass$1(node, classes) {
1980
+ return node && classes && classes.split(' ').forEach(function (c) {
1981
+ return addClass(node, c);
1982
+ });
1983
+ };
1984
+
1985
+ var removeClass = function removeClass(node, classes) {
1986
+ return node && classes && classes.split(' ').forEach(function (c) {
1987
+ return removeClass$1(node, c);
1988
+ });
1989
+ };
1990
+ /**
1991
+ * A transition component inspired by the excellent
1992
+ * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should
1993
+ * use it if you're using CSS transitions or animations. It's built upon the
1994
+ * [`Transition`](https://reactcommunity.org/react-transition-group/transition)
1995
+ * component, so it inherits all of its props.
1996
+ *
1997
+ * `CSSTransition` applies a pair of class names during the `appear`, `enter`,
1998
+ * and `exit` states of the transition. The first class is applied and then a
1999
+ * second `*-active` class in order to activate the CSS transition. After the
2000
+ * transition, matching `*-done` class names are applied to persist the
2001
+ * transition state.
2002
+ *
2003
+ * ```jsx
2004
+ * function App() {
2005
+ * const [inProp, setInProp] = useState(false);
2006
+ * return (
2007
+ * <div>
2008
+ * <CSSTransition in={inProp} timeout={200} classNames="my-node">
2009
+ * <div>
2010
+ * {"I'll receive my-node-* classes"}
2011
+ * </div>
2012
+ * </CSSTransition>
2013
+ * <button type="button" onClick={() => setInProp(true)}>
2014
+ * Click to Enter
2015
+ * </button>
2016
+ * </div>
2017
+ * );
2018
+ * }
2019
+ * ```
2020
+ *
2021
+ * When the `in` prop is set to `true`, the child component will first receive
2022
+ * the class `example-enter`, then the `example-enter-active` will be added in
2023
+ * the next tick. `CSSTransition` [forces a
2024
+ * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
2025
+ * between before adding the `example-enter-active`. This is an important trick
2026
+ * because it allows us to transition between `example-enter` and
2027
+ * `example-enter-active` even though they were added immediately one after
2028
+ * another. Most notably, this is what makes it possible for us to animate
2029
+ * _appearance_.
2030
+ *
2031
+ * ```css
2032
+ * .my-node-enter {
2033
+ * opacity: 0;
2034
+ * }
2035
+ * .my-node-enter-active {
2036
+ * opacity: 1;
2037
+ * transition: opacity 200ms;
2038
+ * }
2039
+ * .my-node-exit {
2040
+ * opacity: 1;
2041
+ * }
2042
+ * .my-node-exit-active {
2043
+ * opacity: 0;
2044
+ * transition: opacity 200ms;
2045
+ * }
2046
+ * ```
2047
+ *
2048
+ * `*-active` classes represent which styles you want to animate **to**, so it's
2049
+ * important to add `transition` declaration only to them, otherwise transitions
2050
+ * might not behave as intended! This might not be obvious when the transitions
2051
+ * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in
2052
+ * the example above (minus `transition`), but it becomes apparent in more
2053
+ * complex transitions.
2054
+ *
2055
+ * **Note**: If you're using the
2056
+ * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)
2057
+ * prop, make sure to define styles for `.appear-*` classes as well.
2058
+ */
2059
+
2060
+
2061
+ var CSSTransition = /*#__PURE__*/function (_React$Component) {
2062
+ _inheritsLoose(CSSTransition, _React$Component);
2063
+
2064
+ function CSSTransition() {
2065
+ var _this;
2066
+
2067
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2068
+ args[_key] = arguments[_key];
2069
+ }
2070
+
2071
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
2072
+ _this.appliedClasses = {
2073
+ appear: {},
2074
+ enter: {},
2075
+ exit: {}
2076
+ };
2077
+
2078
+ _this.onEnter = function (maybeNode, maybeAppearing) {
2079
+ var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),
2080
+ node = _this$resolveArgument[0],
2081
+ appearing = _this$resolveArgument[1];
2082
+
2083
+ _this.removeClasses(node, 'exit');
2084
+
2085
+ _this.addClass(node, appearing ? 'appear' : 'enter', 'base');
2086
+
2087
+ if (_this.props.onEnter) {
2088
+ _this.props.onEnter(maybeNode, maybeAppearing);
2089
+ }
2090
+ };
2091
+
2092
+ _this.onEntering = function (maybeNode, maybeAppearing) {
2093
+ var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),
2094
+ node = _this$resolveArgument2[0],
2095
+ appearing = _this$resolveArgument2[1];
2096
+
2097
+ var type = appearing ? 'appear' : 'enter';
2098
+
2099
+ _this.addClass(node, type, 'active');
2100
+
2101
+ if (_this.props.onEntering) {
2102
+ _this.props.onEntering(maybeNode, maybeAppearing);
2103
+ }
2104
+ };
2105
+
2106
+ _this.onEntered = function (maybeNode, maybeAppearing) {
2107
+ var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),
2108
+ node = _this$resolveArgument3[0],
2109
+ appearing = _this$resolveArgument3[1];
2110
+
2111
+ var type = appearing ? 'appear' : 'enter';
2112
+
2113
+ _this.removeClasses(node, type);
2114
+
2115
+ _this.addClass(node, type, 'done');
2116
+
2117
+ if (_this.props.onEntered) {
2118
+ _this.props.onEntered(maybeNode, maybeAppearing);
2119
+ }
2120
+ };
2121
+
2122
+ _this.onExit = function (maybeNode) {
2123
+ var _this$resolveArgument4 = _this.resolveArguments(maybeNode),
2124
+ node = _this$resolveArgument4[0];
2125
+
2126
+ _this.removeClasses(node, 'appear');
2127
+
2128
+ _this.removeClasses(node, 'enter');
2129
+
2130
+ _this.addClass(node, 'exit', 'base');
2131
+
2132
+ if (_this.props.onExit) {
2133
+ _this.props.onExit(maybeNode);
2134
+ }
2135
+ };
2136
+
2137
+ _this.onExiting = function (maybeNode) {
2138
+ var _this$resolveArgument5 = _this.resolveArguments(maybeNode),
2139
+ node = _this$resolveArgument5[0];
2140
+
2141
+ _this.addClass(node, 'exit', 'active');
2142
+
2143
+ if (_this.props.onExiting) {
2144
+ _this.props.onExiting(maybeNode);
2145
+ }
2146
+ };
2147
+
2148
+ _this.onExited = function (maybeNode) {
2149
+ var _this$resolveArgument6 = _this.resolveArguments(maybeNode),
2150
+ node = _this$resolveArgument6[0];
2151
+
2152
+ _this.removeClasses(node, 'exit');
2153
+
2154
+ _this.addClass(node, 'exit', 'done');
2155
+
2156
+ if (_this.props.onExited) {
2157
+ _this.props.onExited(maybeNode);
2158
+ }
2159
+ };
2160
+
2161
+ _this.resolveArguments = function (maybeNode, maybeAppearing) {
2162
+ return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`
2163
+ : [maybeNode, maybeAppearing];
2164
+ };
2165
+
2166
+ _this.getClassNames = function (type) {
2167
+ var classNames = _this.props.classNames;
2168
+ var isStringClassNames = typeof classNames === 'string';
2169
+ var prefix = isStringClassNames && classNames ? classNames + "-" : '';
2170
+ var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type];
2171
+ var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"];
2172
+ var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"];
2173
+ return {
2174
+ baseClassName: baseClassName,
2175
+ activeClassName: activeClassName,
2176
+ doneClassName: doneClassName
2177
+ };
2178
+ };
2179
+
2180
+ return _this;
2181
+ }
2182
+
2183
+ var _proto = CSSTransition.prototype;
2184
+
2185
+ _proto.addClass = function addClass(node, type, phase) {
2186
+ var className = this.getClassNames(type)[phase + "ClassName"];
2187
+
2188
+ var _this$getClassNames = this.getClassNames('enter'),
2189
+ doneClassName = _this$getClassNames.doneClassName;
2190
+
2191
+ if (type === 'appear' && phase === 'done' && doneClassName) {
2192
+ className += " " + doneClassName;
2193
+ } // This is for to force a repaint,
2194
+ // which is necessary in order to transition styles when adding a class name.
2195
+
2196
+
2197
+ if (phase === 'active') {
2198
+ /* eslint-disable no-unused-expressions */
2199
+ node && node.scrollTop;
2200
+ }
2201
+
2202
+ if (className) {
2203
+ this.appliedClasses[type][phase] = className;
2204
+
2205
+ _addClass(node, className);
2206
+ }
2207
+ };
2208
+
2209
+ _proto.removeClasses = function removeClasses(node, type) {
2210
+ var _this$appliedClasses$ = this.appliedClasses[type],
2211
+ baseClassName = _this$appliedClasses$.base,
2212
+ activeClassName = _this$appliedClasses$.active,
2213
+ doneClassName = _this$appliedClasses$.done;
2214
+ this.appliedClasses[type] = {};
2215
+
2216
+ if (baseClassName) {
2217
+ removeClass(node, baseClassName);
2218
+ }
2219
+
2220
+ if (activeClassName) {
2221
+ removeClass(node, activeClassName);
2222
+ }
2223
+
2224
+ if (doneClassName) {
2225
+ removeClass(node, doneClassName);
2226
+ }
2227
+ };
2228
+
2229
+ _proto.render = function render() {
2230
+ var _this$props = this.props;
2231
+ _this$props.classNames;
2232
+ var props = _objectWithoutPropertiesLoose(_this$props, ["classNames"]);
2233
+
2234
+ return /*#__PURE__*/React__default.createElement(Transition, _extends$4({}, props, {
2235
+ onEnter: this.onEnter,
2236
+ onEntered: this.onEntered,
2237
+ onEntering: this.onEntering,
2238
+ onExit: this.onExit,
2239
+ onExiting: this.onExiting,
2240
+ onExited: this.onExited
2241
+ }));
2242
+ };
2243
+
2244
+ return CSSTransition;
2245
+ }(React__default.Component);
2246
+
2247
+ CSSTransition.defaultProps = {
2248
+ classNames: ''
2249
+ };
2250
+ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$4({}, Transition.propTypes, {
2251
+ /**
2252
+ * The animation classNames applied to the component as it appears, enters,
2253
+ * exits or has finished the transition. A single name can be provided, which
2254
+ * will be suffixed for each stage, e.g. `classNames="fade"` applies:
2255
+ *
2256
+ * - `fade-appear`, `fade-appear-active`, `fade-appear-done`
2257
+ * - `fade-enter`, `fade-enter-active`, `fade-enter-done`
2258
+ * - `fade-exit`, `fade-exit-active`, `fade-exit-done`
2259
+ *
2260
+ * A few details to note about how these classes are applied:
2261
+ *
2262
+ * 1. They are _joined_ with the ones that are already defined on the child
2263
+ * component, so if you want to add some base styles, you can use
2264
+ * `className` without worrying that it will be overridden.
2265
+ *
2266
+ * 2. If the transition component mounts with `in={false}`, no classes are
2267
+ * applied yet. You might be expecting `*-exit-done`, but if you think
2268
+ * about it, a component cannot finish exiting if it hasn't entered yet.
2269
+ *
2270
+ * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This
2271
+ * allows you to define different behavior for when appearing is done and
2272
+ * when regular entering is done, using selectors like
2273
+ * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply
2274
+ * an epic entrance animation when element first appears in the DOM using
2275
+ * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
2276
+ * simply use `fade-enter-done` for defining both cases.
2277
+ *
2278
+ * Each individual classNames can also be specified independently like:
2279
+ *
2280
+ * ```js
2281
+ * classNames={{
2282
+ * appear: 'my-appear',
2283
+ * appearActive: 'my-active-appear',
2284
+ * appearDone: 'my-done-appear',
2285
+ * enter: 'my-enter',
2286
+ * enterActive: 'my-active-enter',
2287
+ * enterDone: 'my-done-enter',
2288
+ * exit: 'my-exit',
2289
+ * exitActive: 'my-active-exit',
2290
+ * exitDone: 'my-done-exit',
2291
+ * }}
2292
+ * ```
2293
+ *
2294
+ * If you want to set these classes using CSS Modules:
2295
+ *
2296
+ * ```js
2297
+ * import styles from './styles.css';
2298
+ * ```
2299
+ *
2300
+ * you might want to use camelCase in your CSS file, that way could simply
2301
+ * spread them instead of listing them one by one:
2302
+ *
2303
+ * ```js
2304
+ * classNames={{ ...styles }}
2305
+ * ```
2306
+ *
2307
+ * @type {string | {
2308
+ * appear?: string,
2309
+ * appearActive?: string,
2310
+ * appearDone?: string,
2311
+ * enter?: string,
2312
+ * enterActive?: string,
2313
+ * enterDone?: string,
2314
+ * exit?: string,
2315
+ * exitActive?: string,
2316
+ * exitDone?: string,
2317
+ * }}
2318
+ */
2319
+ classNames: classNamesShape,
2320
+
2321
+ /**
2322
+ * A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
2323
+ * applied.
2324
+ *
2325
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
2326
+ *
2327
+ * @type Function(node: HtmlElement, isAppearing: bool)
2328
+ */
2329
+ onEnter: propTypes.exports.func,
2330
+
2331
+ /**
2332
+ * A `<Transition>` callback fired immediately after the 'enter-active' or
2333
+ * 'appear-active' class is applied.
2334
+ *
2335
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
2336
+ *
2337
+ * @type Function(node: HtmlElement, isAppearing: bool)
2338
+ */
2339
+ onEntering: propTypes.exports.func,
2340
+
2341
+ /**
2342
+ * A `<Transition>` callback fired immediately after the 'enter' or
2343
+ * 'appear' classes are **removed** and the `done` class is added to the DOM node.
2344
+ *
2345
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
2346
+ *
2347
+ * @type Function(node: HtmlElement, isAppearing: bool)
2348
+ */
2349
+ onEntered: propTypes.exports.func,
2350
+
2351
+ /**
2352
+ * A `<Transition>` callback fired immediately after the 'exit' class is
2353
+ * applied.
2354
+ *
2355
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
2356
+ *
2357
+ * @type Function(node: HtmlElement)
2358
+ */
2359
+ onExit: propTypes.exports.func,
2360
+
2361
+ /**
2362
+ * A `<Transition>` callback fired immediately after the 'exit-active' is applied.
2363
+ *
2364
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
2365
+ *
2366
+ * @type Function(node: HtmlElement)
2367
+ */
2368
+ onExiting: propTypes.exports.func,
2369
+
2370
+ /**
2371
+ * A `<Transition>` callback fired immediately after the 'exit' classes
2372
+ * are **removed** and the `exit-done` class is added to the DOM node.
2373
+ *
2374
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
2375
+ *
2376
+ * @type Function(node: HtmlElement)
2377
+ */
2378
+ onExited: propTypes.exports.func
2379
+ }) : {};
2380
+
2381
+ function _assertThisInitialized(self) {
2382
+ if (self === void 0) {
2383
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2384
+ }
2385
+
2386
+ return self;
2387
+ }
2388
+
2389
+ /**
2390
+ * Given `this.props.children`, return an object mapping key to child.
2391
+ *
2392
+ * @param {*} children `this.props.children`
2393
+ * @return {object} Mapping of key to child
2394
+ */
2395
+
2396
+ function getChildMapping(children, mapFn) {
2397
+ var mapper = function mapper(child) {
2398
+ return mapFn && isValidElement(child) ? mapFn(child) : child;
2399
+ };
2400
+
2401
+ var result = Object.create(null);
2402
+ if (children) Children.map(children, function (c) {
2403
+ return c;
2404
+ }).forEach(function (child) {
2405
+ // run the map function here instead so that the key is the computed one
2406
+ result[child.key] = mapper(child);
2407
+ });
2408
+ return result;
2409
+ }
2410
+ /**
2411
+ * When you're adding or removing children some may be added or removed in the
2412
+ * same render pass. We want to show *both* since we want to simultaneously
2413
+ * animate elements in and out. This function takes a previous set of keys
2414
+ * and a new set of keys and merges them with its best guess of the correct
2415
+ * ordering. In the future we may expose some of the utilities in
2416
+ * ReactMultiChild to make this easy, but for now React itself does not
2417
+ * directly have this concept of the union of prevChildren and nextChildren
2418
+ * so we implement it here.
2419
+ *
2420
+ * @param {object} prev prev children as returned from
2421
+ * `ReactTransitionChildMapping.getChildMapping()`.
2422
+ * @param {object} next next children as returned from
2423
+ * `ReactTransitionChildMapping.getChildMapping()`.
2424
+ * @return {object} a key set that contains all keys in `prev` and all keys
2425
+ * in `next` in a reasonable order.
2426
+ */
2427
+
2428
+ function mergeChildMappings(prev, next) {
2429
+ prev = prev || {};
2430
+ next = next || {};
2431
+
2432
+ function getValueForKey(key) {
2433
+ return key in next ? next[key] : prev[key];
2434
+ } // For each key of `next`, the list of keys to insert before that key in
2435
+ // the combined list
2436
+
2437
+
2438
+ var nextKeysPending = Object.create(null);
2439
+ var pendingKeys = [];
2440
+
2441
+ for (var prevKey in prev) {
2442
+ if (prevKey in next) {
2443
+ if (pendingKeys.length) {
2444
+ nextKeysPending[prevKey] = pendingKeys;
2445
+ pendingKeys = [];
2446
+ }
2447
+ } else {
2448
+ pendingKeys.push(prevKey);
2449
+ }
2450
+ }
2451
+
2452
+ var i;
2453
+ var childMapping = {};
2454
+
2455
+ for (var nextKey in next) {
2456
+ if (nextKeysPending[nextKey]) {
2457
+ for (i = 0; i < nextKeysPending[nextKey].length; i++) {
2458
+ var pendingNextKey = nextKeysPending[nextKey][i];
2459
+ childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
2460
+ }
2461
+ }
2462
+
2463
+ childMapping[nextKey] = getValueForKey(nextKey);
2464
+ } // Finally, add the keys which didn't appear before any key in `next`
2465
+
2466
+
2467
+ for (i = 0; i < pendingKeys.length; i++) {
2468
+ childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
2469
+ }
2470
+
2471
+ return childMapping;
2472
+ }
2473
+
2474
+ function getProp(child, prop, props) {
2475
+ return props[prop] != null ? props[prop] : child.props[prop];
2476
+ }
2477
+
2478
+ function getInitialChildMapping(props, onExited) {
2479
+ return getChildMapping(props.children, function (child) {
2480
+ return cloneElement(child, {
2481
+ onExited: onExited.bind(null, child),
2482
+ in: true,
2483
+ appear: getProp(child, 'appear', props),
2484
+ enter: getProp(child, 'enter', props),
2485
+ exit: getProp(child, 'exit', props)
2486
+ });
2487
+ });
2488
+ }
2489
+ function getNextChildMapping(nextProps, prevChildMapping, onExited) {
2490
+ var nextChildMapping = getChildMapping(nextProps.children);
2491
+ var children = mergeChildMappings(prevChildMapping, nextChildMapping);
2492
+ Object.keys(children).forEach(function (key) {
2493
+ var child = children[key];
2494
+ if (!isValidElement(child)) return;
2495
+ var hasPrev = (key in prevChildMapping);
2496
+ var hasNext = (key in nextChildMapping);
2497
+ var prevChild = prevChildMapping[key];
2498
+ var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)
2499
+
2500
+ if (hasNext && (!hasPrev || isLeaving)) {
2501
+ // console.log('entering', key)
2502
+ children[key] = cloneElement(child, {
2503
+ onExited: onExited.bind(null, child),
2504
+ in: true,
2505
+ exit: getProp(child, 'exit', nextProps),
2506
+ enter: getProp(child, 'enter', nextProps)
2507
+ });
2508
+ } else if (!hasNext && hasPrev && !isLeaving) {
2509
+ // item is old (exiting)
2510
+ // console.log('leaving', key)
2511
+ children[key] = cloneElement(child, {
2512
+ in: false
2513
+ });
2514
+ } else if (hasNext && hasPrev && isValidElement(prevChild)) {
2515
+ // item hasn't changed transition states
2516
+ // copy over the last transition props;
2517
+ // console.log('unchanged', key)
2518
+ children[key] = cloneElement(child, {
2519
+ onExited: onExited.bind(null, child),
2520
+ in: prevChild.props.in,
2521
+ exit: getProp(child, 'exit', nextProps),
2522
+ enter: getProp(child, 'enter', nextProps)
2523
+ });
2524
+ }
2525
+ });
2526
+ return children;
2527
+ }
2528
+
2529
+ var values = Object.values || function (obj) {
2530
+ return Object.keys(obj).map(function (k) {
2531
+ return obj[k];
2532
+ });
2533
+ };
2534
+
2535
+ var defaultProps = {
2536
+ component: 'div',
2537
+ childFactory: function childFactory(child) {
2538
+ return child;
2539
+ }
2540
+ };
2541
+ /**
2542
+ * The `<TransitionGroup>` component manages a set of transition components
2543
+ * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
2544
+ * components, `<TransitionGroup>` is a state machine for managing the mounting
2545
+ * and unmounting of components over time.
2546
+ *
2547
+ * Consider the example below. As items are removed or added to the TodoList the
2548
+ * `in` prop is toggled automatically by the `<TransitionGroup>`.
2549
+ *
2550
+ * Note that `<TransitionGroup>` does not define any animation behavior!
2551
+ * Exactly _how_ a list item animates is up to the individual transition
2552
+ * component. This means you can mix and match animations across different list
2553
+ * items.
2554
+ */
2555
+
2556
+ var TransitionGroup = /*#__PURE__*/function (_React$Component) {
2557
+ _inheritsLoose(TransitionGroup, _React$Component);
2558
+
2559
+ function TransitionGroup(props, context) {
2560
+ var _this;
2561
+
2562
+ _this = _React$Component.call(this, props, context) || this;
2563
+
2564
+ var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear
2565
+
2566
+
2567
+ _this.state = {
2568
+ contextValue: {
2569
+ isMounting: true
2570
+ },
2571
+ handleExited: handleExited,
2572
+ firstRender: true
2573
+ };
2574
+ return _this;
2575
+ }
2576
+
2577
+ var _proto = TransitionGroup.prototype;
2578
+
2579
+ _proto.componentDidMount = function componentDidMount() {
2580
+ this.mounted = true;
2581
+ this.setState({
2582
+ contextValue: {
2583
+ isMounting: false
2584
+ }
2585
+ });
2586
+ };
2587
+
2588
+ _proto.componentWillUnmount = function componentWillUnmount() {
2589
+ this.mounted = false;
2590
+ };
2591
+
2592
+ TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
2593
+ var prevChildMapping = _ref.children,
2594
+ handleExited = _ref.handleExited,
2595
+ firstRender = _ref.firstRender;
2596
+ return {
2597
+ children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
2598
+ firstRender: false
2599
+ };
2600
+ } // node is `undefined` when user provided `nodeRef` prop
2601
+ ;
2602
+
2603
+ _proto.handleExited = function handleExited(child, node) {
2604
+ var currentChildMapping = getChildMapping(this.props.children);
2605
+ if (child.key in currentChildMapping) return;
2606
+
2607
+ if (child.props.onExited) {
2608
+ child.props.onExited(node);
2609
+ }
2610
+
2611
+ if (this.mounted) {
2612
+ this.setState(function (state) {
2613
+ var children = _extends$4({}, state.children);
2614
+
2615
+ delete children[child.key];
2616
+ return {
2617
+ children: children
2618
+ };
2619
+ });
2620
+ }
2621
+ };
2622
+
2623
+ _proto.render = function render() {
2624
+ var _this$props = this.props,
2625
+ Component = _this$props.component,
2626
+ childFactory = _this$props.childFactory,
2627
+ props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
2628
+
2629
+ var contextValue = this.state.contextValue;
2630
+ var children = values(this.state.children).map(childFactory);
2631
+ delete props.appear;
2632
+ delete props.enter;
2633
+ delete props.exit;
2634
+
2635
+ if (Component === null) {
2636
+ return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
2637
+ value: contextValue
2638
+ }, children);
2639
+ }
2640
+
2641
+ return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
2642
+ value: contextValue
2643
+ }, /*#__PURE__*/React__default.createElement(Component, props, children));
2644
+ };
2645
+
2646
+ return TransitionGroup;
2647
+ }(React__default.Component);
2648
+
2649
+ TransitionGroup.propTypes = process.env.NODE_ENV !== "production" ? {
2650
+ /**
2651
+ * `<TransitionGroup>` renders a `<div>` by default. You can change this
2652
+ * behavior by providing a `component` prop.
2653
+ * If you use React v16+ and would like to avoid a wrapping `<div>` element
2654
+ * you can pass in `component={null}`. This is useful if the wrapping div
2655
+ * borks your css styles.
2656
+ */
2657
+ component: propTypes.exports.any,
2658
+
2659
+ /**
2660
+ * A set of `<Transition>` components, that are toggled `in` and out as they
2661
+ * leave. the `<TransitionGroup>` will inject specific transition props, so
2662
+ * remember to spread them through if you are wrapping the `<Transition>` as
2663
+ * with our `<Fade>` example.
2664
+ *
2665
+ * While this component is meant for multiple `Transition` or `CSSTransition`
2666
+ * children, sometimes you may want to have a single transition child with
2667
+ * content that you want to be transitioned out and in when you change it
2668
+ * (e.g. routes, images etc.) In that case you can change the `key` prop of
2669
+ * the transition child as you change its content, this will cause
2670
+ * `TransitionGroup` to transition the child out and back in.
2671
+ */
2672
+ children: propTypes.exports.node,
2673
+
2674
+ /**
2675
+ * A convenience prop that enables or disables appear animations
2676
+ * for all children. Note that specifying this will override any defaults set
2677
+ * on individual children Transitions.
2678
+ */
2679
+ appear: propTypes.exports.bool,
2680
+
2681
+ /**
2682
+ * A convenience prop that enables or disables enter animations
2683
+ * for all children. Note that specifying this will override any defaults set
2684
+ * on individual children Transitions.
2685
+ */
2686
+ enter: propTypes.exports.bool,
2687
+
2688
+ /**
2689
+ * A convenience prop that enables or disables exit animations
2690
+ * for all children. Note that specifying this will override any defaults set
2691
+ * on individual children Transitions.
2692
+ */
2693
+ exit: propTypes.exports.bool,
2694
+
2695
+ /**
2696
+ * You may need to apply reactive updates to a child as it is exiting.
2697
+ * This is generally done by using `cloneElement` however in the case of an exiting
2698
+ * child the element has already been removed and not accessible to the consumer.
2699
+ *
2700
+ * If you do need to update a child as it leaves you can provide a `childFactory`
2701
+ * to wrap every child, even the ones that are leaving.
2702
+ *
2703
+ * @type Function(child: ReactElement) -> ReactElement
2704
+ */
2705
+ childFactory: propTypes.exports.func
2706
+ } : {};
2707
+ TransitionGroup.defaultProps = defaultProps;
2708
+
2709
+ /**
2710
+ * The `<ReplaceTransition>` component is a specialized `Transition` component
2711
+ * that animates between two children.
2712
+ *
2713
+ * ```jsx
2714
+ * <ReplaceTransition in>
2715
+ * <Fade><div>I appear first</div></Fade>
2716
+ * <Fade><div>I replace the above</div></Fade>
2717
+ * </ReplaceTransition>
2718
+ * ```
2719
+ */
2720
+
2721
+ var ReplaceTransition = /*#__PURE__*/function (_React$Component) {
2722
+ _inheritsLoose(ReplaceTransition, _React$Component);
2723
+
2724
+ function ReplaceTransition() {
2725
+ var _this;
2726
+
2727
+ for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
2728
+ _args[_key] = arguments[_key];
2729
+ }
2730
+
2731
+ _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
2732
+
2733
+ _this.handleEnter = function () {
2734
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
2735
+ args[_key2] = arguments[_key2];
2736
+ }
2737
+
2738
+ return _this.handleLifecycle('onEnter', 0, args);
2739
+ };
2740
+
2741
+ _this.handleEntering = function () {
2742
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
2743
+ args[_key3] = arguments[_key3];
2744
+ }
2745
+
2746
+ return _this.handleLifecycle('onEntering', 0, args);
2747
+ };
2748
+
2749
+ _this.handleEntered = function () {
2750
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
2751
+ args[_key4] = arguments[_key4];
2752
+ }
2753
+
2754
+ return _this.handleLifecycle('onEntered', 0, args);
2755
+ };
2756
+
2757
+ _this.handleExit = function () {
2758
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
2759
+ args[_key5] = arguments[_key5];
2760
+ }
2761
+
2762
+ return _this.handleLifecycle('onExit', 1, args);
2763
+ };
2764
+
2765
+ _this.handleExiting = function () {
2766
+ for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
2767
+ args[_key6] = arguments[_key6];
2768
+ }
2769
+
2770
+ return _this.handleLifecycle('onExiting', 1, args);
2771
+ };
2772
+
2773
+ _this.handleExited = function () {
2774
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
2775
+ args[_key7] = arguments[_key7];
2776
+ }
2777
+
2778
+ return _this.handleLifecycle('onExited', 1, args);
2779
+ };
2780
+
2781
+ return _this;
2782
+ }
2783
+
2784
+ var _proto = ReplaceTransition.prototype;
2785
+
2786
+ _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
2787
+ var _child$props;
2788
+
2789
+ var children = this.props.children;
2790
+ var child = React__default.Children.toArray(children)[idx];
2791
+ if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
2792
+
2793
+ if (this.props[handler]) {
2794
+ var maybeNode = child.props.nodeRef ? undefined : ReactDOM.findDOMNode(this);
2795
+ this.props[handler](maybeNode);
2796
+ }
2797
+ };
2798
+
2799
+ _proto.render = function render() {
2800
+ var _this$props = this.props,
2801
+ children = _this$props.children,
2802
+ inProp = _this$props.in,
2803
+ props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]);
2804
+
2805
+ var _React$Children$toArr = React__default.Children.toArray(children),
2806
+ first = _React$Children$toArr[0],
2807
+ second = _React$Children$toArr[1];
2808
+
2809
+ delete props.onEnter;
2810
+ delete props.onEntering;
2811
+ delete props.onEntered;
2812
+ delete props.onExit;
2813
+ delete props.onExiting;
2814
+ delete props.onExited;
2815
+ return /*#__PURE__*/React__default.createElement(TransitionGroup, props, inProp ? React__default.cloneElement(first, {
2816
+ key: 'first',
2817
+ onEnter: this.handleEnter,
2818
+ onEntering: this.handleEntering,
2819
+ onEntered: this.handleEntered
2820
+ }) : React__default.cloneElement(second, {
2821
+ key: 'second',
2822
+ onEnter: this.handleExit,
2823
+ onEntering: this.handleExiting,
2824
+ onEntered: this.handleExited
2825
+ }));
2826
+ };
2827
+
2828
+ return ReplaceTransition;
2829
+ }(React__default.Component);
2830
+
2831
+ ReplaceTransition.propTypes = process.env.NODE_ENV !== "production" ? {
2832
+ in: propTypes.exports.bool.isRequired,
2833
+ children: function children(props, propName) {
2834
+ if (React__default.Children.count(props[propName]) !== 2) return new Error("\"" + propName + "\" must be exactly two transition components.");
2835
+ return null;
2836
+ }
2837
+ } : {};
2838
+
2839
+ var _leaveRenders, _enterRenders;
2840
+
2841
+ function areChildrenDifferent(oldChildren, newChildren) {
2842
+ if (oldChildren === newChildren) return false;
2843
+
2844
+ if (React__default.isValidElement(oldChildren) && React__default.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {
2845
+ return false;
2846
+ }
2847
+
2848
+ return true;
2849
+ }
2850
+ /**
2851
+ * Enum of modes for SwitchTransition component
2852
+ * @enum { string }
2853
+ */
2854
+
2855
+
2856
+ var modes = {
2857
+ out: 'out-in',
2858
+ in: 'in-out'
2859
+ };
2860
+
2861
+ var callHook = function callHook(element, name, cb) {
2862
+ return function () {
2863
+ var _element$props;
2864
+
2865
+ element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments);
2866
+ cb();
2867
+ };
2868
+ };
2869
+
2870
+ var leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) {
2871
+ var current = _ref.current,
2872
+ changeState = _ref.changeState;
2873
+ return React__default.cloneElement(current, {
2874
+ in: false,
2875
+ onExited: callHook(current, 'onExited', function () {
2876
+ changeState(ENTERING, null);
2877
+ })
2878
+ });
2879
+ }, _leaveRenders[modes.in] = function (_ref2) {
2880
+ var current = _ref2.current,
2881
+ changeState = _ref2.changeState,
2882
+ children = _ref2.children;
2883
+ return [current, React__default.cloneElement(children, {
2884
+ in: true,
2885
+ onEntered: callHook(children, 'onEntered', function () {
2886
+ changeState(ENTERING);
2887
+ })
2888
+ })];
2889
+ }, _leaveRenders);
2890
+ var enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) {
2891
+ var children = _ref3.children,
2892
+ changeState = _ref3.changeState;
2893
+ return React__default.cloneElement(children, {
2894
+ in: true,
2895
+ onEntered: callHook(children, 'onEntered', function () {
2896
+ changeState(ENTERED, React__default.cloneElement(children, {
2897
+ in: true
2898
+ }));
2899
+ })
2900
+ });
2901
+ }, _enterRenders[modes.in] = function (_ref4) {
2902
+ var current = _ref4.current,
2903
+ children = _ref4.children,
2904
+ changeState = _ref4.changeState;
2905
+ return [React__default.cloneElement(current, {
2906
+ in: false,
2907
+ onExited: callHook(current, 'onExited', function () {
2908
+ changeState(ENTERED, React__default.cloneElement(children, {
2909
+ in: true
2910
+ }));
2911
+ })
2912
+ }), React__default.cloneElement(children, {
2913
+ in: true
2914
+ })];
2915
+ }, _enterRenders);
2916
+ /**
2917
+ * A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).
2918
+ * You can use it when you want to control the render between state transitions.
2919
+ * Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.
2920
+ *
2921
+ * If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.
2922
+ * If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.
2923
+ *
2924
+ * **Note**: If you want the animation to happen simultaneously
2925
+ * (that is, to have the old child removed and a new child inserted **at the same time**),
2926
+ * you should use
2927
+ * [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)
2928
+ * instead.
2929
+ *
2930
+ * ```jsx
2931
+ * function App() {
2932
+ * const [state, setState] = useState(false);
2933
+ * return (
2934
+ * <SwitchTransition>
2935
+ * <CSSTransition
2936
+ * key={state ? "Goodbye, world!" : "Hello, world!"}
2937
+ * addEndListener={(node, done) => node.addEventListener("transitionend", done, false)}
2938
+ * classNames='fade'
2939
+ * >
2940
+ * <button onClick={() => setState(state => !state)}>
2941
+ * {state ? "Goodbye, world!" : "Hello, world!"}
2942
+ * </button>
2943
+ * </CSSTransition>
2944
+ * </SwitchTransition>
2945
+ * );
2946
+ * }
2947
+ * ```
2948
+ *
2949
+ * ```css
2950
+ * .fade-enter{
2951
+ * opacity: 0;
2952
+ * }
2953
+ * .fade-exit{
2954
+ * opacity: 1;
2955
+ * }
2956
+ * .fade-enter-active{
2957
+ * opacity: 1;
2958
+ * }
2959
+ * .fade-exit-active{
2960
+ * opacity: 0;
2961
+ * }
2962
+ * .fade-enter-active,
2963
+ * .fade-exit-active{
2964
+ * transition: opacity 500ms;
2965
+ * }
2966
+ * ```
2967
+ */
2968
+
2969
+ var SwitchTransition = /*#__PURE__*/function (_React$Component) {
2970
+ _inheritsLoose(SwitchTransition, _React$Component);
2971
+
2972
+ function SwitchTransition() {
2973
+ var _this;
2974
+
2975
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2976
+ args[_key] = arguments[_key];
2977
+ }
2978
+
2979
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
2980
+ _this.state = {
2981
+ status: ENTERED,
2982
+ current: null
2983
+ };
2984
+ _this.appeared = false;
2985
+
2986
+ _this.changeState = function (status, current) {
2987
+ if (current === void 0) {
2988
+ current = _this.state.current;
2989
+ }
2990
+
2991
+ _this.setState({
2992
+ status: status,
2993
+ current: current
2994
+ });
2995
+ };
2996
+
2997
+ return _this;
2998
+ }
2999
+
3000
+ var _proto = SwitchTransition.prototype;
3001
+
3002
+ _proto.componentDidMount = function componentDidMount() {
3003
+ this.appeared = true;
3004
+ };
3005
+
3006
+ SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
3007
+ if (props.children == null) {
3008
+ return {
3009
+ current: null
3010
+ };
3011
+ }
3012
+
3013
+ if (state.status === ENTERING && props.mode === modes.in) {
3014
+ return {
3015
+ status: ENTERING
3016
+ };
3017
+ }
3018
+
3019
+ if (state.current && areChildrenDifferent(state.current, props.children)) {
3020
+ return {
3021
+ status: EXITING
3022
+ };
3023
+ }
3024
+
3025
+ return {
3026
+ current: React__default.cloneElement(props.children, {
3027
+ in: true
3028
+ })
3029
+ };
3030
+ };
3031
+
3032
+ _proto.render = function render() {
3033
+ var _this$props = this.props,
3034
+ children = _this$props.children,
3035
+ mode = _this$props.mode,
3036
+ _this$state = this.state,
3037
+ status = _this$state.status,
3038
+ current = _this$state.current;
3039
+ var data = {
3040
+ children: children,
3041
+ current: current,
3042
+ changeState: this.changeState,
3043
+ status: status
3044
+ };
3045
+ var component;
3046
+
3047
+ switch (status) {
3048
+ case ENTERING:
3049
+ component = enterRenders[mode](data);
3050
+ break;
3051
+
3052
+ case EXITING:
3053
+ component = leaveRenders[mode](data);
3054
+ break;
3055
+
3056
+ case ENTERED:
3057
+ component = current;
3058
+ }
3059
+
3060
+ return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
3061
+ value: {
3062
+ isMounting: !this.appeared
3063
+ }
3064
+ }, component);
3065
+ };
3066
+
3067
+ return SwitchTransition;
3068
+ }(React__default.Component);
3069
+
3070
+ SwitchTransition.propTypes = process.env.NODE_ENV !== "production" ? {
3071
+ /**
3072
+ * Transition modes.
3073
+ * `out-in`: Current element transitions out first, then when complete, the new element transitions in.
3074
+ * `in-out`: New element transitions in first, then when complete, the current element transitions out.
3075
+ *
3076
+ * @type {'out-in'|'in-out'}
3077
+ */
3078
+ mode: propTypes.exports.oneOf([modes.in, modes.out]),
3079
+
3080
+ /**
3081
+ * Any `Transition` or `CSSTransition` component.
3082
+ */
3083
+ children: propTypes.exports.oneOfType([propTypes.exports.element.isRequired])
3084
+ } : {};
3085
+ SwitchTransition.defaultProps = {
3086
+ mode: modes.out
3087
+ };
3088
+
3089
+ function styleInject(css, ref) {
3090
+ if ( ref === void 0 ) ref = {};
3091
+ var insertAt = ref.insertAt;
3092
+
3093
+ if (!css || typeof document === 'undefined') { return; }
3094
+
3095
+ var head = document.head || document.getElementsByTagName('head')[0];
3096
+ var style = document.createElement('style');
3097
+ style.type = 'text/css';
3098
+
3099
+ if (insertAt === 'top') {
3100
+ if (head.firstChild) {
3101
+ head.insertBefore(style, head.firstChild);
3102
+ } else {
3103
+ head.appendChild(style);
3104
+ }
3105
+ } else {
3106
+ head.appendChild(style);
3107
+ }
3108
+
3109
+ if (style.styleSheet) {
3110
+ style.styleSheet.cssText = css;
3111
+ } else {
3112
+ style.appendChild(document.createTextNode(css));
3113
+ }
3114
+ }
3115
+
3116
+ var css_248z$6 = ".ycn-drawer__item {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n height: 100%;\n will-change: transform;\n background-color: var(--yc-color-base-background);\n}\n.ycn-drawer__item-transition-enter {\n transform: translate(-100%, 0);\n}\n.ycn-drawer__item-transition-enter-active {\n transform: translate(0, 0);\n transition: transform 300ms;\n}\n.ycn-drawer__item-transition-enter-done {\n filter: blur(0px);\n transform: translateZ(0);\n}\n.ycn-drawer__item-transition-exit {\n transform: translate(0, 0);\n}\n.ycn-drawer__item-transition-exit-active {\n transform: translate(-100%, 0);\n transition: transform 300ms;\n}\n.ycn-drawer__item-transition-exit-done {\n visibility: hidden;\n}\n.ycn-drawer__veil {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n background-color: var(--yc-color-sfx-veil);\n}\n.ycn-drawer__veil-transition-enter {\n opacity: 0;\n}\n.ycn-drawer__veil-transition-enter-active {\n opacity: 1;\n transition: opacity 300ms;\n}\n.ycn-drawer__veil-transition-exit {\n opacity: 1;\n}\n.ycn-drawer__veil-transition-exit-active {\n opacity: 0;\n transition: opacity 300ms;\n}\n.ycn-drawer__veil-transition-exit-done {\n visibility: hidden;\n}";
3117
+ styleInject(css_248z$6);
3118
+
3119
+ const b$6 = block('drawer');
3120
+ const TIMEOUT = 300;
3121
+ const DrawerItem = ({ visible, content, className }) => {
3122
+ const itemRef = React__default.useRef(null);
3123
+ return (React__default.createElement(CSSTransition, { in: visible, timeout: TIMEOUT, unmountOnExit: true, classNames: b$6('item-transition'), nodeRef: itemRef },
3124
+ React__default.createElement("div", { ref: itemRef, className: b$6('item', className) }, content)));
3125
+ };
3126
+ const Drawer = ({ className, children, style, onVeilClick, onEscape, preventScrollBody = true, }) => {
3127
+ let someItemVisible = false;
3128
+ React__default.Children.forEach(children, (child) => {
3129
+ const childElem = child;
3130
+ if (childElem.type === DrawerItem) {
3131
+ const childVisible = Boolean(childElem.props.visible);
3132
+ if (childVisible) {
3133
+ someItemVisible = true;
3134
+ }
3135
+ }
3136
+ });
3137
+ React__default.useEffect(() => {
3138
+ function onKeyDown(event) {
3139
+ if (event.key === 'Escape') {
3140
+ onEscape === null || onEscape === void 0 ? void 0 : onEscape();
3141
+ }
3142
+ }
3143
+ if (someItemVisible) {
3144
+ window.addEventListener('keydown', onKeyDown);
3145
+ }
3146
+ return () => {
3147
+ window.removeEventListener('keydown', onKeyDown);
3148
+ };
3149
+ }, [onEscape, someItemVisible]);
3150
+ React__default.useEffect(() => {
3151
+ const prevPreventScrollBody = preventScrollBody;
3152
+ const cleanupPreventScrollBody = () => {
3153
+ document.body.style.paddingRight = '';
3154
+ document.body.style.paddingBottom = '';
3155
+ document.body.style.overflow = '';
3156
+ };
3157
+ const setPreventScrollBody = () => {
3158
+ const vw = window.innerWidth - document.documentElement.clientWidth;
3159
+ const hw = window.innerHeight - document.documentElement.clientHeight;
3160
+ document.body.style.paddingRight = vw + 'px';
3161
+ document.body.style.paddingBottom = hw + 'px';
3162
+ document.body.style.overflow = 'hidden';
3163
+ };
3164
+ if (prevPreventScrollBody) {
3165
+ if (someItemVisible) {
3166
+ setPreventScrollBody();
3167
+ }
3168
+ else {
3169
+ cleanupPreventScrollBody();
3170
+ }
3171
+ }
3172
+ return () => {
3173
+ if (prevPreventScrollBody) {
3174
+ cleanupPreventScrollBody();
3175
+ }
3176
+ };
3177
+ }, [someItemVisible, preventScrollBody]);
3178
+ const containerRef = React__default.useRef(null);
3179
+ const veilRef = React__default.useRef(null);
3180
+ return (React__default.createElement(Transition, { in: someItemVisible, timeout: { enter: 0, exit: TIMEOUT }, mountOnEnter: true, unmountOnExit: true, nodeRef: containerRef }, (state) => {
3181
+ const childrenVisible = someItemVisible && state === 'entered';
3182
+ return (React__default.createElement("div", { ref: containerRef, className: b$6(null, className), style: style },
3183
+ React__default.createElement(CSSTransition, { in: childrenVisible, timeout: TIMEOUT, unmountOnExit: true, classNames: b$6('veil-transition'), nodeRef: veilRef },
3184
+ React__default.createElement("div", { ref: veilRef, className: b$6('veil'), onClick: onVeilClick })),
3185
+ React__default.Children.map(children, (child) => {
3186
+ const childElem = child;
3187
+ if (childElem.type === DrawerItem) {
3188
+ const childVisible = Boolean(childElem.props.visible);
3189
+ return React__default.cloneElement(childElem, Object.assign(Object.assign({}, childElem.props), { visible: childVisible && childrenVisible }));
3190
+ }
3191
+ return child;
3192
+ })));
3193
+ }));
3194
+ };
3195
+
3196
+ var css_248z$5 = ".ycn-logo {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n height: 40px;\n}\n.ycn-logo__logo-btn-place {\n flex-shrink: 0;\n width: var(--aside-header-min-width);\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ycn-logo__btn-logo.yc-button_view_flat.yc-button_size_l {\n --yc-button-height: 38px;\n}\n.ycn-logo__logo {\n font-size: var(--yc-text-body-2-font-size);\n line-height: var(--yc-text-body-2-line-height);\n font-weight: var(--yc-text-body-font-weight);\n vertical-align: middle;\n}\n.ycn-logo__logo-link, .ycn-logo__logo-link:hover, .ycn-logo__logo-link:active, .ycn-logo__logo-link:visited, .ycn-logo__logo-link:focus {\n text-decoration: none;\n outline: none;\n color: inherit;\n}\n.yc-root .ycn-logo__btn-logo.button2_theme_flat.button2_hovered_yes::before {\n background-color: transparent;\n}";
3197
+ styleInject(css_248z$5);
3198
+
3199
+ const b$5 = block('logo');
3200
+ const Logo = ({ text, compact, icon, iconSrc, iconClassName, iconSize = 24, textSize = 15, href = '/', wrapper, onClick, }) => {
3201
+ const hasClickHandler = typeof onClick === 'function';
3202
+ const hasWrapper = typeof wrapper === 'function';
3203
+ const linkProps = hasClickHandler
3204
+ ? {}
3205
+ : {
3206
+ target: '_self',
3207
+ href,
3208
+ };
3209
+ let buttonIcon;
3210
+ if (iconSrc) {
3211
+ buttonIcon = (React__default.createElement(Button.Icon, { className: iconClassName },
3212
+ React__default.createElement("img", { alt: "logo icon", src: iconSrc, width: iconSize, height: iconSize })));
3213
+ }
3214
+ else if (icon) {
3215
+ buttonIcon = React__default.createElement(Icon, { data: icon, size: iconSize, className: iconClassName });
3216
+ }
3217
+ const button = (React__default.createElement(Button, Object.assign({ view: "flat", size: "l", className: b$5('btn-logo'), component: hasWrapper ? 'span' : undefined, onClick: onClick }, linkProps), buttonIcon));
3218
+ let logo;
3219
+ if (typeof text === 'function') {
3220
+ logo = text();
3221
+ }
3222
+ else {
3223
+ logo = (React__default.createElement("div", { className: b$5('logo'), style: { fontSize: textSize } }, text));
3224
+ }
3225
+ return (React__default.createElement("div", { className: b$5() },
3226
+ React__default.createElement("div", { className: b$5('logo-btn-place') }, hasWrapper ? wrapper(button, compact) : button),
3227
+ !compact &&
3228
+ (hasWrapper ? (wrapper(logo, compact)) : (React__default.createElement("a", Object.assign({}, linkProps, { className: b$5('logo-link'), onClick: onClick }), logo)))));
3229
+ };
3230
+
3231
+ var classCallCheck = function (instance, Constructor) {
3232
+ if (!(instance instanceof Constructor)) {
3233
+ throw new TypeError("Cannot call a class as a function");
3234
+ }
3235
+ };
3236
+
3237
+ var createClass = function () {
3238
+ function defineProperties(target, props) {
3239
+ for (var i = 0; i < props.length; i++) {
3240
+ var descriptor = props[i];
3241
+ descriptor.enumerable = descriptor.enumerable || false;
3242
+ descriptor.configurable = true;
3243
+ if ("value" in descriptor) descriptor.writable = true;
3244
+ Object.defineProperty(target, descriptor.key, descriptor);
3245
+ }
3246
+ }
3247
+
3248
+ return function (Constructor, protoProps, staticProps) {
3249
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
3250
+ if (staticProps) defineProperties(Constructor, staticProps);
3251
+ return Constructor;
3252
+ };
3253
+ }();
3254
+
3255
+ var _extends$3 = Object.assign || function (target) {
3256
+ for (var i = 1; i < arguments.length; i++) {
3257
+ var source = arguments[i];
3258
+
3259
+ for (var key in source) {
3260
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
3261
+ target[key] = source[key];
3262
+ }
3263
+ }
3264
+ }
3265
+
3266
+ return target;
3267
+ };
3268
+
3269
+ var inherits = function (subClass, superClass) {
3270
+ if (typeof superClass !== "function" && superClass !== null) {
3271
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
3272
+ }
3273
+
3274
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
3275
+ constructor: {
3276
+ value: subClass,
3277
+ enumerable: false,
3278
+ writable: true,
3279
+ configurable: true
3280
+ }
3281
+ });
3282
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
3283
+ };
3284
+
3285
+ var possibleConstructorReturn = function (self, call) {
3286
+ if (!self) {
3287
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
3288
+ }
3289
+
3290
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
3291
+ };
3292
+
3293
+ var slicedToArray = function () {
3294
+ function sliceIterator(arr, i) {
3295
+ var _arr = [];
3296
+ var _n = true;
3297
+ var _d = false;
3298
+ var _e = undefined;
3299
+
3300
+ try {
3301
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
3302
+ _arr.push(_s.value);
3303
+
3304
+ if (i && _arr.length === i) break;
3305
+ }
3306
+ } catch (err) {
3307
+ _d = true;
3308
+ _e = err;
3309
+ } finally {
3310
+ try {
3311
+ if (!_n && _i["return"]) _i["return"]();
3312
+ } finally {
3313
+ if (_d) throw _e;
3314
+ }
3315
+ }
3316
+
3317
+ return _arr;
3318
+ }
3319
+
3320
+ return function (arr, i) {
3321
+ if (Array.isArray(arr)) {
3322
+ return arr;
3323
+ } else if (Symbol.iterator in Object(arr)) {
3324
+ return sliceIterator(arr, i);
3325
+ } else {
3326
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
3327
+ }
3328
+ };
3329
+ }();
3330
+
3331
+ /**
3332
+ * Detect Element Resize.
3333
+ * https://github.com/sdecima/javascript-detect-element-resize
3334
+ * Sebastian Decima
3335
+ *
3336
+ * Forked from version 0.5.3; includes the following modifications:
3337
+ * 1) Guard against unsafe 'window' and 'document' references (to support SSR).
3338
+ * 2) Defer initialization code via a top-level function wrapper (to support SSR).
3339
+ * 3) Avoid unnecessary reflows by not measuring size for scroll events bubbling from children.
3340
+ * 4) Add nonce for style element.
3341
+ **/
3342
+
3343
+ // Check `document` and `window` in case of server-side rendering
3344
+ var windowObject = void 0;
3345
+ if (typeof window !== 'undefined') {
3346
+ windowObject = window;
3347
+
3348
+ // eslint-disable-next-line no-restricted-globals
3349
+ } else if (typeof self !== 'undefined') {
3350
+ // eslint-disable-next-line no-restricted-globals
3351
+ windowObject = self;
3352
+ } else {
3353
+ windowObject = global;
3354
+ }
3355
+
3356
+ var cancelFrame = null;
3357
+ var requestFrame = null;
3358
+
3359
+ var TIMEOUT_DURATION = 20;
3360
+
3361
+ var clearTimeoutFn = windowObject.clearTimeout;
3362
+ var setTimeoutFn = windowObject.setTimeout;
3363
+
3364
+ var cancelAnimationFrameFn = windowObject.cancelAnimationFrame || windowObject.mozCancelAnimationFrame || windowObject.webkitCancelAnimationFrame;
3365
+
3366
+ var requestAnimationFrameFn = windowObject.requestAnimationFrame || windowObject.mozRequestAnimationFrame || windowObject.webkitRequestAnimationFrame;
3367
+
3368
+ if (cancelAnimationFrameFn == null || requestAnimationFrameFn == null) {
3369
+ // For environments that don't support animation frame,
3370
+ // fallback to a setTimeout based approach.
3371
+ cancelFrame = clearTimeoutFn;
3372
+ requestFrame = function requestAnimationFrameViaSetTimeout(callback) {
3373
+ return setTimeoutFn(callback, TIMEOUT_DURATION);
3374
+ };
3375
+ } else {
3376
+ // Counter intuitively, environments that support animation frames can be trickier.
3377
+ // Chrome's "Throttle non-visible cross-origin iframes" flag can prevent rAFs from being called.
3378
+ // In this case, we should fallback to a setTimeout() implementation.
3379
+ cancelFrame = function cancelFrame(_ref) {
3380
+ var _ref2 = slicedToArray(_ref, 2),
3381
+ animationFrameID = _ref2[0],
3382
+ timeoutID = _ref2[1];
3383
+
3384
+ cancelAnimationFrameFn(animationFrameID);
3385
+ clearTimeoutFn(timeoutID);
3386
+ };
3387
+ requestFrame = function requestAnimationFrameWithSetTimeoutFallback(callback) {
3388
+ var animationFrameID = requestAnimationFrameFn(function animationFrameCallback() {
3389
+ clearTimeoutFn(timeoutID);
3390
+ callback();
3391
+ });
3392
+
3393
+ var timeoutID = setTimeoutFn(function timeoutCallback() {
3394
+ cancelAnimationFrameFn(animationFrameID);
3395
+ callback();
3396
+ }, TIMEOUT_DURATION);
3397
+
3398
+ return [animationFrameID, timeoutID];
3399
+ };
3400
+ }
3401
+
3402
+ function createDetectElementResize(nonce) {
3403
+ var animationKeyframes = void 0;
3404
+ var animationName = void 0;
3405
+ var animationStartEvent = void 0;
3406
+ var animationStyle = void 0;
3407
+ var checkTriggers = void 0;
3408
+ var resetTriggers = void 0;
3409
+ var scrollListener = void 0;
3410
+
3411
+ var attachEvent = typeof document !== 'undefined' && document.attachEvent;
3412
+ if (!attachEvent) {
3413
+ resetTriggers = function resetTriggers(element) {
3414
+ var triggers = element.__resizeTriggers__,
3415
+ expand = triggers.firstElementChild,
3416
+ contract = triggers.lastElementChild,
3417
+ expandChild = expand.firstElementChild;
3418
+ contract.scrollLeft = contract.scrollWidth;
3419
+ contract.scrollTop = contract.scrollHeight;
3420
+ expandChild.style.width = expand.offsetWidth + 1 + 'px';
3421
+ expandChild.style.height = expand.offsetHeight + 1 + 'px';
3422
+ expand.scrollLeft = expand.scrollWidth;
3423
+ expand.scrollTop = expand.scrollHeight;
3424
+ };
3425
+
3426
+ checkTriggers = function checkTriggers(element) {
3427
+ return element.offsetWidth !== element.__resizeLast__.width || element.offsetHeight !== element.__resizeLast__.height;
3428
+ };
3429
+
3430
+ scrollListener = function scrollListener(e) {
3431
+ // Don't measure (which forces) reflow for scrolls that happen inside of children!
3432
+ if (e.target.className && typeof e.target.className.indexOf === 'function' && e.target.className.indexOf('contract-trigger') < 0 && e.target.className.indexOf('expand-trigger') < 0) {
3433
+ return;
3434
+ }
3435
+
3436
+ var element = this;
3437
+ resetTriggers(this);
3438
+ if (this.__resizeRAF__) {
3439
+ cancelFrame(this.__resizeRAF__);
3440
+ }
3441
+ this.__resizeRAF__ = requestFrame(function animationFrame() {
3442
+ if (checkTriggers(element)) {
3443
+ element.__resizeLast__.width = element.offsetWidth;
3444
+ element.__resizeLast__.height = element.offsetHeight;
3445
+ element.__resizeListeners__.forEach(function forEachResizeListener(fn) {
3446
+ fn.call(element, e);
3447
+ });
3448
+ }
3449
+ });
3450
+ };
3451
+
3452
+ /* Detect CSS Animations support to detect element display/re-attach */
3453
+ var animation = false;
3454
+ var keyframeprefix = '';
3455
+ animationStartEvent = 'animationstart';
3456
+ var domPrefixes = 'Webkit Moz O ms'.split(' ');
3457
+ var startEvents = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' ');
3458
+ var pfx = '';
3459
+ {
3460
+ var elm = document.createElement('fakeelement');
3461
+ if (elm.style.animationName !== undefined) {
3462
+ animation = true;
3463
+ }
3464
+
3465
+ if (animation === false) {
3466
+ for (var i = 0; i < domPrefixes.length; i++) {
3467
+ if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) {
3468
+ pfx = domPrefixes[i];
3469
+ keyframeprefix = '-' + pfx.toLowerCase() + '-';
3470
+ animationStartEvent = startEvents[i];
3471
+ animation = true;
3472
+ break;
3473
+ }
3474
+ }
3475
+ }
3476
+ }
3477
+
3478
+ animationName = 'resizeanim';
3479
+ animationKeyframes = '@' + keyframeprefix + 'keyframes ' + animationName + ' { from { opacity: 0; } to { opacity: 0; } } ';
3480
+ animationStyle = keyframeprefix + 'animation: 1ms ' + animationName + '; ';
3481
+ }
3482
+
3483
+ var createStyles = function createStyles(doc) {
3484
+ if (!doc.getElementById('detectElementResize')) {
3485
+ //opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360
3486
+ var css = (animationKeyframes ? animationKeyframes : '') + '.resize-triggers { ' + (animationStyle ? animationStyle : '') + 'visibility: hidden; opacity: 0; } ' + '.resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',
3487
+ head = doc.head || doc.getElementsByTagName('head')[0],
3488
+ style = doc.createElement('style');
3489
+
3490
+ style.id = 'detectElementResize';
3491
+ style.type = 'text/css';
3492
+
3493
+ if (nonce != null) {
3494
+ style.setAttribute('nonce', nonce);
3495
+ }
3496
+
3497
+ if (style.styleSheet) {
3498
+ style.styleSheet.cssText = css;
3499
+ } else {
3500
+ style.appendChild(doc.createTextNode(css));
3501
+ }
3502
+
3503
+ head.appendChild(style);
3504
+ }
3505
+ };
3506
+
3507
+ var addResizeListener = function addResizeListener(element, fn) {
3508
+ if (attachEvent) {
3509
+ element.attachEvent('onresize', fn);
3510
+ } else {
3511
+ if (!element.__resizeTriggers__) {
3512
+ var doc = element.ownerDocument;
3513
+ var elementStyle = windowObject.getComputedStyle(element);
3514
+ if (elementStyle && elementStyle.position === 'static') {
3515
+ element.style.position = 'relative';
3516
+ }
3517
+ createStyles(doc);
3518
+ element.__resizeLast__ = {};
3519
+ element.__resizeListeners__ = [];
3520
+ (element.__resizeTriggers__ = doc.createElement('div')).className = 'resize-triggers';
3521
+ var expandTrigger = doc.createElement('div');
3522
+ expandTrigger.className = 'expand-trigger';
3523
+ expandTrigger.appendChild(doc.createElement('div'));
3524
+ var contractTrigger = doc.createElement('div');
3525
+ contractTrigger.className = 'contract-trigger';
3526
+ element.__resizeTriggers__.appendChild(expandTrigger);
3527
+ element.__resizeTriggers__.appendChild(contractTrigger);
3528
+ element.appendChild(element.__resizeTriggers__);
3529
+ resetTriggers(element);
3530
+ element.addEventListener('scroll', scrollListener, true);
3531
+
3532
+ /* Listen for a css animation to detect element display/re-attach */
3533
+ if (animationStartEvent) {
3534
+ element.__resizeTriggers__.__animationListener__ = function animationListener(e) {
3535
+ if (e.animationName === animationName) {
3536
+ resetTriggers(element);
3537
+ }
3538
+ };
3539
+ element.__resizeTriggers__.addEventListener(animationStartEvent, element.__resizeTriggers__.__animationListener__);
3540
+ }
3541
+ }
3542
+ element.__resizeListeners__.push(fn);
3543
+ }
3544
+ };
3545
+
3546
+ var removeResizeListener = function removeResizeListener(element, fn) {
3547
+ if (attachEvent) {
3548
+ element.detachEvent('onresize', fn);
3549
+ } else {
3550
+ element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
3551
+ if (!element.__resizeListeners__.length) {
3552
+ element.removeEventListener('scroll', scrollListener, true);
3553
+ if (element.__resizeTriggers__.__animationListener__) {
3554
+ element.__resizeTriggers__.removeEventListener(animationStartEvent, element.__resizeTriggers__.__animationListener__);
3555
+ element.__resizeTriggers__.__animationListener__ = null;
3556
+ }
3557
+ try {
3558
+ element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);
3559
+ } catch (e) {
3560
+ // Preact compat; see developit/preact-compat/issues/228
3561
+ }
3562
+ }
3563
+ }
3564
+ };
3565
+
3566
+ return {
3567
+ addResizeListener: addResizeListener,
3568
+ removeResizeListener: removeResizeListener
3569
+ };
3570
+ }
3571
+
3572
+ var AutoSizer = function (_React$PureComponent) {
3573
+ inherits(AutoSizer, _React$PureComponent);
3574
+
3575
+ function AutoSizer() {
3576
+ var _ref;
3577
+
3578
+ var _temp, _this, _ret;
3579
+
3580
+ classCallCheck(this, AutoSizer);
3581
+
3582
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
3583
+ args[_key] = arguments[_key];
3584
+ }
3585
+
3586
+ return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = AutoSizer.__proto__ || Object.getPrototypeOf(AutoSizer)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
3587
+ height: _this.props.defaultHeight || 0,
3588
+ width: _this.props.defaultWidth || 0
3589
+ }, _this._onResize = function () {
3590
+ var _this$props = _this.props,
3591
+ disableHeight = _this$props.disableHeight,
3592
+ disableWidth = _this$props.disableWidth,
3593
+ onResize = _this$props.onResize;
3594
+
3595
+
3596
+ if (_this._parentNode) {
3597
+ // Guard against AutoSizer component being removed from the DOM immediately after being added.
3598
+ // This can result in invalid style values which can result in NaN values if we don't handle them.
3599
+ // See issue #150 for more context.
3600
+
3601
+ var _height = _this._parentNode.offsetHeight || 0;
3602
+ var _width = _this._parentNode.offsetWidth || 0;
3603
+
3604
+ var _style = window.getComputedStyle(_this._parentNode) || {};
3605
+ var paddingLeft = parseInt(_style.paddingLeft, 10) || 0;
3606
+ var paddingRight = parseInt(_style.paddingRight, 10) || 0;
3607
+ var paddingTop = parseInt(_style.paddingTop, 10) || 0;
3608
+ var paddingBottom = parseInt(_style.paddingBottom, 10) || 0;
3609
+
3610
+ var newHeight = _height - paddingTop - paddingBottom;
3611
+ var newWidth = _width - paddingLeft - paddingRight;
3612
+
3613
+ if (!disableHeight && _this.state.height !== newHeight || !disableWidth && _this.state.width !== newWidth) {
3614
+ _this.setState({
3615
+ height: _height - paddingTop - paddingBottom,
3616
+ width: _width - paddingLeft - paddingRight
3617
+ });
3618
+
3619
+ onResize({ height: _height, width: _width });
3620
+ }
3621
+ }
3622
+ }, _this._setRef = function (autoSizer) {
3623
+ _this._autoSizer = autoSizer;
3624
+ }, _temp), possibleConstructorReturn(_this, _ret);
3625
+ }
3626
+
3627
+ createClass(AutoSizer, [{
3628
+ key: 'componentDidMount',
3629
+ value: function componentDidMount() {
3630
+ var nonce = this.props.nonce;
3631
+
3632
+ if (this._autoSizer && this._autoSizer.parentNode && this._autoSizer.parentNode.ownerDocument && this._autoSizer.parentNode.ownerDocument.defaultView && this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement) {
3633
+ // Delay access of parentNode until mount.
3634
+ // This handles edge-cases where the component has already been unmounted before its ref has been set,
3635
+ // As well as libraries like react-lite which have a slightly different lifecycle.
3636
+ this._parentNode = this._autoSizer.parentNode;
3637
+
3638
+ // Defer requiring resize handler in order to support server-side rendering.
3639
+ // See issue #41
3640
+ this._detectElementResize = createDetectElementResize(nonce);
3641
+ this._detectElementResize.addResizeListener(this._parentNode, this._onResize);
3642
+
3643
+ this._onResize();
3644
+ }
3645
+ }
3646
+ }, {
3647
+ key: 'componentWillUnmount',
3648
+ value: function componentWillUnmount() {
3649
+ if (this._detectElementResize && this._parentNode) {
3650
+ this._detectElementResize.removeResizeListener(this._parentNode, this._onResize);
3651
+ }
3652
+ }
3653
+ }, {
3654
+ key: 'render',
3655
+ value: function render() {
3656
+ var _props = this.props,
3657
+ children = _props.children,
3658
+ className = _props.className,
3659
+ disableHeight = _props.disableHeight,
3660
+ disableWidth = _props.disableWidth,
3661
+ style = _props.style;
3662
+ var _state = this.state,
3663
+ height = _state.height,
3664
+ width = _state.width;
3665
+
3666
+ // Outer div should not force width/height since that may prevent containers from shrinking.
3667
+ // Inner component should overflow and use calculated width/height.
3668
+ // See issue #68 for more information.
3669
+
3670
+ var outerStyle = { overflow: 'visible' };
3671
+ var childParams = {};
3672
+
3673
+ // Avoid rendering children before the initial measurements have been collected.
3674
+ // At best this would just be wasting cycles.
3675
+ var bailoutOnChildren = false;
3676
+
3677
+ if (!disableHeight) {
3678
+ if (height === 0) {
3679
+ bailoutOnChildren = true;
3680
+ }
3681
+ outerStyle.height = 0;
3682
+ childParams.height = height;
3683
+ }
3684
+
3685
+ if (!disableWidth) {
3686
+ if (width === 0) {
3687
+ bailoutOnChildren = true;
3688
+ }
3689
+ outerStyle.width = 0;
3690
+ childParams.width = width;
3691
+ }
3692
+
3693
+ return createElement(
3694
+ 'div',
3695
+ {
3696
+ className: className,
3697
+ ref: this._setRef,
3698
+ style: _extends$3({}, outerStyle, style)
3699
+ },
3700
+ !bailoutOnChildren && children(childParams)
3701
+ );
3702
+ }
3703
+ }]);
3704
+ return AutoSizer;
3705
+ }(PureComponent);
3706
+
3707
+ AutoSizer.defaultProps = {
3708
+ onResize: function onResize() {},
3709
+ disableHeight: false,
3710
+ disableWidth: false,
3711
+ style: {}
3712
+ };
3713
+
3714
+ const ICON_SIZE = 24;
3715
+ const ITEM_HEIGHT = 40;
3716
+ const ITEM_TYPE_REGULAR = 'regular';
3717
+ const COLLAPSE_ITEM_ID = 'collapse-item-id';
3718
+ const POPUP_PLACEMENT = ['right-start', 'right-end', 'right'];
3719
+ const POPUP_ITEM_HEIGHT = 28;
3720
+
3721
+ function getItemHeight(item) {
3722
+ switch (item.type) {
3723
+ case 'action':
3724
+ return 50;
3725
+ default:
3726
+ return ITEM_HEIGHT;
3727
+ }
3728
+ }
3729
+ function getItemsHeight(items) {
3730
+ return items.reduce((sum, item) => sum + getItemHeight(item), 0);
3731
+ }
3732
+ const getSelectedItemIndex = (items) => {
3733
+ const index = items.findIndex(({ current }) => Boolean(current));
3734
+ return index === -1 ? undefined : index;
3735
+ };
3736
+
3737
+ var css_248z$4 = ".ycn-item-tooltip.yc-popup {\n animation-name: none;\n box-shadow: none;\n border: none;\n}\n.ycn-item-tooltip__text {\n padding: 6px 12px;\n background-color: var(--yc-color-base-float-heavy);\n color: var(--yc-color-text-light-primary);\n border-radius: 4px;\n}";
3738
+ styleInject(css_248z$4);
3739
+
3740
+ const b$4 = block('item-tooltip');
3741
+ const popupPlacement = ['right'];
3742
+ const ItemTooltip = ({ anchor, text }) => {
3743
+ const anchorRef = React__default.useRef(anchor);
3744
+ React__default.useEffect(() => {
3745
+ anchorRef.current = anchor;
3746
+ }, [anchor]);
3747
+ if (!anchor) {
3748
+ return null;
3749
+ }
3750
+ return (React__default.createElement(Popup, { className: b$4(), open: true, anchorRef: anchorRef, placement: popupPlacement, disableEscapeKeyDown: true, disableOutsideClick: true, disableLayer: true },
3751
+ React__default.createElement("div", { className: b$4('text') }, text)));
3752
+ };
3753
+
3754
+ var css_248z$3 = ".ycn-composite-bar-item {\n --composite-bar-item-action-size: 36px;\n display: flex;\n width: 100%;\n height: 100%;\n align-items: center;\n cursor: pointer;\n}\n.ycn-composite-bar-item__icon {\n color: var(--yc-color-text-misc);\n}\n.ycn-composite-bar-item__icon-place {\n flex-shrink: 0;\n width: var(--aside-header-min-width);\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n}\n.ycn-composite-bar-item__title {\n display: flex;\n overflow: hidden;\n}\n.ycn-composite-bar-item__title-text {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.ycn-composite-bar-item__title-adornment {\n margin: 0 10px;\n}\n.ycn-composite-bar-item__collapse-item {\n display: flex;\n padding: 0 16px;\n align-items: center;\n width: 100%;\n height: 100%;\n cursor: pointer;\n}\n.ycn-composite-bar-item__collapse-item .ycn-composite-bar-item__title-adornment {\n margin-right: 0;\n}\n.ycn-composite-bar-item__collapse-items-popup-content {\n padding: 4px 0;\n}\n.ycn-composite-bar-item__link {\n display: flex;\n width: 100%;\n height: 100%;\n align-items: center;\n}\n.ycn-composite-bar-item__link, .ycn-composite-bar-item__link:hover, .ycn-composite-bar-item__link:active, .ycn-composite-bar-item__link:visited, .ycn-composite-bar-item__link:focus {\n text-decoration: none;\n outline: none;\n color: inherit;\n}\n.ycn-composite-bar-item__btn-icon {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ycn-composite-bar-item_type_action {\n justify-content: center;\n height: var(--composite-bar-item-action-size);\n margin: 0 10px 8px;\n background: var(--yc-color-base-float);\n box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.03), 0px 5px 6px rgba(0, 0, 0, 0.12);\n border-radius: var(--composite-bar-item-action-size);\n transition: transform 0.1s ease-out, background-color 0.15s linear;\n}\n.ycn-composite-bar-item_type_action:focus {\n box-shadow: 0 0 0 2px var(--yc-color-line-misc);\n}\n.ycn-composite-bar-item_type_action:focus:not(:focus-visible) {\n box-shadow: none;\n}\n.ycn-composite-bar-item_type_action:hover {\n background-color: var(--yc-color-base-float-hover);\n}\n.ycn-composite-bar-item_type_action:active {\n box-shadow: 0 1px 2px var(--yc-color-sfx-shadow);\n transition: none;\n transform: scale(0.96);\n}\n.ycn-composite-bar-item_type_action .ycn-composite-bar-item__icon-place {\n width: var(--composite-bar-item-action-size);\n}\n.ycn-composite-bar-item_type_action .ycn-composite-bar-item__title {\n margin-right: 16px;\n}\n.ycn-composite-bar-item:not(.ycn-composite-bar-item_compact).ycn-composite-bar-item_current.ycn-composite-bar-item_type_regular {\n background-color: var(--yc-color-base-selection);\n}\n.ycn-composite-bar-item:not(.ycn-composite-bar-item_compact):not(.ycn-composite-bar-item_current):hover.ycn-composite-bar-item_type_regular {\n background-color: var(--yc-color-base-simple-hover);\n}\n.ycn-composite-bar-item_compact.ycn-composite-bar-item_type_action {\n width: var(--composite-bar-item-action-size);\n}\n.ycn-composite-bar-item_compact.ycn-composite-bar-item_type_action .ycn-composite-bar-item__title {\n margin: 0;\n}\n.ycn-composite-bar-item_compact.ycn-composite-bar-item_current.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon {\n position: relative;\n background-color: transparent;\n}\n.ycn-composite-bar-item_compact.ycn-composite-bar-item_current.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon::before {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: -1;\n width: 38px;\n height: 38px;\n margin-top: -19px;\n margin-left: -19px;\n border-radius: 7px;\n}\n.ycn-composite-bar-item_compact.ycn-composite-bar-item_current.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon::before {\n background-color: var(--yc-color-base-selection);\n}\n.ycn-composite-bar-item_compact:not(.ycn-composite-bar-item_current):hover.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon {\n position: relative;\n background-color: transparent;\n}\n.ycn-composite-bar-item_compact:not(.ycn-composite-bar-item_current):hover.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon::before {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: -1;\n width: 38px;\n height: 38px;\n margin-top: -19px;\n margin-left: -19px;\n border-radius: 7px;\n}\n.ycn-composite-bar-item_compact:not(.ycn-composite-bar-item_current):hover.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon::before {\n background-color: var(--yc-color-base-simple-hover);\n}";
3755
+ styleInject(css_248z$3);
3756
+
3757
+ const b$3 = block('composite-bar-item');
3758
+ function renderItemTitle(item) {
3759
+ let titleNode = React__default.createElement("div", { className: b$3('title-text') }, item.title);
3760
+ if (item.rightAdornment) {
3761
+ titleNode = (React__default.createElement(React__default.Fragment, null,
3762
+ titleNode,
3763
+ React__default.createElement("div", { className: b$3('title-adornment') }, item.rightAdornment)));
3764
+ }
3765
+ return titleNode;
3766
+ }
3767
+ const defaultPopupPlacement = ['right-end'];
3768
+ const defaultPopupOffset = [-20, 8];
3769
+ const Item = ({ item, compact, className, collapseItems, onMouseLeave, onMouseEnter, enableTooltip = true, popupVisible = false, popupAnchor, popupPlacement = defaultPopupPlacement, popupOffset = defaultPopupOffset, renderPopupContent, onClosePopup, }) => {
3770
+ const [tooltipAnchor, setTooltipAnchor] = React__default.useState(null);
3771
+ const [open, toggleOpen] = React__default.useState(false);
3772
+ const ref = React__default.useRef(null);
3773
+ const anchorRef = popupAnchor || ref;
3774
+ const type = item.type || ITEM_TYPE_REGULAR;
3775
+ const current = item.current || false;
3776
+ const tooltipText = item.tooltipText || item.title;
3777
+ const icon = item.icon;
3778
+ const iconSize = item.iconSize || ICON_SIZE;
3779
+ const collapsedItem = item.id === COLLAPSE_ITEM_ID;
3780
+ const onClose = React__default.useCallback((event) => {
3781
+ var _a;
3782
+ if (event instanceof MouseEvent &&
3783
+ event.target &&
3784
+ ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
3785
+ return;
3786
+ }
3787
+ onClosePopup === null || onClosePopup === void 0 ? void 0 : onClosePopup();
3788
+ }, [onClosePopup]);
3789
+ const node = (React__default.createElement("div", { className: b$3({ type, current, compact }, className), ref: ref, onClick: () => {
3790
+ if (typeof item.onItemClick === 'function') {
3791
+ item.onItemClick(item, false);
3792
+ }
3793
+ if (collapsedItem) {
3794
+ toggleOpen(!open);
3795
+ setTooltipAnchor(null);
3796
+ }
3797
+ }, onMouseEnter: () => {
3798
+ if (!compact) {
3799
+ onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter();
3800
+ }
3801
+ }, onMouseLeave: () => {
3802
+ if (!compact) {
3803
+ onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave();
3804
+ }
3805
+ } },
3806
+ React__default.createElement("div", { className: b$3('icon-place') }, compact ? (React__default.createElement(React__default.Fragment, null,
3807
+ React__default.createElement("div", { onMouseEnter: (event) => {
3808
+ if (!open) {
3809
+ setTooltipAnchor(event.currentTarget);
3810
+ }
3811
+ onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter();
3812
+ }, onMouseLeave: () => {
3813
+ setTooltipAnchor(null);
3814
+ onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave();
3815
+ }, className: b$3('btn-icon') }, icon && React__default.createElement(Icon, { data: icon, size: iconSize, className: b$3('icon') })),
3816
+ enableTooltip && React__default.createElement(ItemTooltip, { anchor: tooltipAnchor, text: tooltipText }))) : (icon && React__default.createElement(Icon, { data: icon, size: iconSize, className: b$3('icon') }))),
3817
+ React__default.createElement("div", { className: b$3('title'), title: typeof item.title === 'string' ? item.title : undefined }, renderItemTitle(item)),
3818
+ collapsedItem && (collapseItems === null || collapseItems === void 0 ? void 0 : collapseItems.length) && Boolean(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) && (React__default.createElement(Popup, { placement: POPUP_PLACEMENT, open: open, anchorRef: ref, onClose: () => toggleOpen(false) },
3819
+ React__default.createElement("div", { className: b$3('collapse-items-popup-content') },
3820
+ React__default.createElement(List, { itemClassName: b$3('root-collapse-item'), items: collapseItems, selectedItemIndex: getSelectedItemIndex(collapseItems), itemHeight: POPUP_ITEM_HEIGHT, itemsHeight: collapseItems.length * POPUP_ITEM_HEIGHT, virtualized: false, filterable: false, sortable: false, renderItem: (collapseItem) => {
3821
+ const collapseNode = (React__default.createElement("div", { className: b$3('collapse-item'), onClick: () => {
3822
+ if (typeof collapseItem.onItemClick === 'function') {
3823
+ collapseItem.onItemClick(collapseItem, true);
3824
+ }
3825
+ } }, renderItemTitle(collapseItem)));
3826
+ if (typeof collapseItem.itemWrapper === 'function') {
3827
+ return collapseItem.itemWrapper(collapseNode, collapseItem, true, compact);
3828
+ }
3829
+ return collapseItem.link ? (React__default.createElement("a", { href: collapseItem.link, className: b$3('link') }, collapseNode)) : (collapseNode);
3830
+ } })))),
3831
+ renderPopupContent && Boolean(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) && (React__default.createElement(Popup, { className: b$3('popup'), open: popupVisible, placement: popupPlacement, offset: popupOffset, anchorRef: anchorRef, onClose: onClose }, renderPopupContent()))));
3832
+ if (typeof item.itemWrapper === 'function') {
3833
+ return item.itemWrapper(node, item, false, compact);
3834
+ }
3835
+ return item.link ? (React__default.createElement("a", { href: item.link, className: b$3('link') }, node)) : (node);
3836
+ };
3837
+ Item.displayName = 'Item';
3838
+
3839
+ var _path$2;
3840
+
3841
+ function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
3842
+
3843
+ var SvgDots = function SvgDots(props) {
3844
+ return /*#__PURE__*/React.createElement("svg", _extends$2({
3845
+ xmlns: "http://www.w3.org/2000/svg",
3846
+ width: 16,
3847
+ height: 16,
3848
+ role: "img"
3849
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
3850
+ d: "M14 6.125a1.874 1.874 0 1 1 .001 3.749A1.874 1.874 0 0 1 14 6.125zm-5.906 0a1.874 1.874 0 1 1 0 3.749 1.874 1.874 0 0 1 0-3.749zM2 6.125a1.874 1.874 0 1 1 .001 3.749A1.874 1.874 0 0 1 2 6.125z",
3851
+ fill: "currentColor",
3852
+ fillRule: "evenodd"
3853
+ })));
3854
+ };
3855
+
3856
+ var css_248z$2 = ".ycn-composite-bar {\n flex: 1 0 auto;\n width: 100%;\n min-height: 40px;\n}\n.ycn-composite-bar .ycn-composite-bar__root-menu-item[class] {\n background-color: transparent;\n}";
3857
+ styleInject(css_248z$2);
3858
+
3859
+ const b$2 = block('composite-bar');
3860
+ class CompositeBar extends React__default.Component {
3861
+ constructor() {
3862
+ super(...arguments);
3863
+ this.state = {
3864
+ activeItemIndex: undefined,
3865
+ };
3866
+ this.listRef = React__default.createRef();
3867
+ }
3868
+ render() {
3869
+ const { enableCollapsing, items } = this.props;
3870
+ if (!enableCollapsing) {
3871
+ return React__default.createElement("div", { className: b$2() }, this.renderMenu());
3872
+ }
3873
+ const pinnedItems = items.filter((item) => item.pinned);
3874
+ const afterMoreButtonItems = items.filter((item) => item.afterMoreButton);
3875
+ const minHeight = getItemsHeight(pinnedItems) +
3876
+ getItemsHeight(afterMoreButtonItems) +
3877
+ (pinnedItems.length === items.length ? 0 : ITEM_HEIGHT);
3878
+ return (React__default.createElement("div", { className: b$2({ autosizer: true }), style: { minHeight } }, items.length !== 0 && (React__default.createElement(AutoSizer, null, ({ width, height }) => {
3879
+ const style = {
3880
+ width,
3881
+ height,
3882
+ };
3883
+ return React__default.createElement("div", { style: style }, this.renderAutosizeMenu(height));
3884
+ }))));
3885
+ }
3886
+ renderAutosizeMenu(height) {
3887
+ const { dict, items, compact, onItemClick } = this.props;
3888
+ const afterMoreButtonItems = items.filter((item) => item.afterMoreButton);
3889
+ const extraItemHeight = items.reduce((sum, item) => sum + (getItemHeight(item) - ITEM_HEIGHT), afterMoreButtonItems.length * ITEM_HEIGHT);
3890
+ const capacity = Math.max(1, Math.floor((height - extraItemHeight) / ITEM_HEIGHT));
3891
+ let listItems;
3892
+ let collapseItems = [];
3893
+ const regularItems = items.filter((item) => !item.afterMoreButton);
3894
+ if (capacity === 1) {
3895
+ listItems = regularItems.filter((item) => item.pinned);
3896
+ collapseItems = [...regularItems.filter((item) => !item.pinned)];
3897
+ }
3898
+ else if (capacity < items.length) {
3899
+ const extraCount = regularItems.filter((item, idx) => item.pinned && idx >= capacity - 1).length;
3900
+ const pinnedFlag = regularItems.reduceRight((acc, curr, idx) => {
3901
+ const useExtraCount = !curr.pinned && idx < capacity - 1 && acc.extraCount > 0;
3902
+ acc.flags.unshift(curr.pinned || useExtraCount);
3903
+ return {
3904
+ flags: acc.flags,
3905
+ extraCount: acc.extraCount - Number(useExtraCount),
3906
+ };
3907
+ }, { flags: [], extraCount }).flags;
3908
+ listItems = regularItems.filter((item, idx) => item.pinned || (idx < capacity - 1 && !pinnedFlag[idx]));
3909
+ collapseItems = regularItems.filter((item, idx) => !item.pinned && (idx >= capacity - 1 || pinnedFlag[idx]));
3910
+ }
3911
+ else {
3912
+ listItems = [...regularItems];
3913
+ }
3914
+ if ((collapseItems === null || collapseItems === void 0 ? void 0 : collapseItems.length) === 1) {
3915
+ listItems = listItems.concat(collapseItems);
3916
+ }
3917
+ else if ((collapseItems === null || collapseItems === void 0 ? void 0 : collapseItems.length) > 1) {
3918
+ listItems.push(this.getMoreButtonItem(dict));
3919
+ }
3920
+ if (afterMoreButtonItems.length) {
3921
+ listItems = listItems.concat(afterMoreButtonItems);
3922
+ }
3923
+ return (React__default.createElement(List, { ref: this.listRef, items: listItems, selectedItemIndex: getSelectedItemIndex(listItems), itemHeight: getItemHeight, itemClassName: b$2('root-menu-item'), itemsHeight: getItemsHeight, virtualized: false, filterable: false, sortable: false, onItemClick: onItemClick, renderItem: (item) => (React__default.createElement(Item, { item: item, onMouseLeave: () => {
3924
+ var _a;
3925
+ if (compact) {
3926
+ (_a = this.listRef.current) === null || _a === void 0 ? void 0 : _a.activateItem(undefined);
3927
+ }
3928
+ }, compact: compact, collapseItems: collapseItems })) }));
3929
+ }
3930
+ renderMenu() {
3931
+ const { items, onItemClick, compact } = this.props;
3932
+ return (React__default.createElement(List, { ref: this.listRef, items: items, selectedItemIndex: getSelectedItemIndex(items), itemHeight: getItemHeight, itemClassName: b$2('root-menu-item'), itemsHeight: getItemsHeight, virtualized: false, filterable: false, sortable: false, onItemClick: onItemClick, renderItem: (item) => (React__default.createElement(Item, { item: item, onMouseLeave: () => {
3933
+ var _a;
3934
+ if (compact) {
3935
+ (_a = this.listRef.current) === null || _a === void 0 ? void 0 : _a.activateItem(undefined);
3936
+ }
3937
+ }, compact: compact })) }));
3938
+ }
3939
+ getMoreButtonItem(dict) {
3940
+ var _a;
3941
+ const title = (_a = dict === null || dict === void 0 ? void 0 : dict[Dict.MoreButton]) !== null && _a !== void 0 ? _a : defaultDict[Dict.MoreButton];
3942
+ return {
3943
+ id: COLLAPSE_ITEM_ID,
3944
+ title,
3945
+ icon: SvgDots,
3946
+ iconSize: 16,
3947
+ };
3948
+ }
3949
+ }
3950
+
3951
+ /* Used by renderContent AsideHeader prop */
3952
+ const RenderContent = React__default.memo(({ renderContent, size }) => {
3953
+ return React__default.createElement(React__default.Fragment, null, renderContent({ size }));
3954
+ });
3955
+ RenderContent.displayName = 'RenderContent';
3956
+ const Content = ({ size, className, renderContent }) => {
3957
+ return (React__default.createElement("div", { className: className, style: Object.assign({}, { '--aside-header-size': `${size}px` }) }, typeof renderContent === 'function' && (React__default.createElement(RenderContent, { size: size, renderContent: renderContent }))));
3958
+ };
3959
+
3960
+ var _path$1;
3961
+
3962
+ function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
3963
+
3964
+ var SvgControlMenuButton = function SvgControlMenuButton(props) {
3965
+ return /*#__PURE__*/React.createElement("svg", _extends$1({
3966
+ width: 8,
3967
+ height: 8,
3968
+ fill: "currentColor",
3969
+ xmlns: "http://www.w3.org/2000/svg",
3970
+ role: "img"
3971
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
3972
+ d: "m.72 7.64 6.39-3.2a.5.5 0 0 0 0-.89L.72.36A.5.5 0 0 0 0 .81v6.38c0 .37.4.61.72.45Z"
3973
+ })));
3974
+ };
3975
+
3976
+ var _path;
3977
+
3978
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3979
+
3980
+ var SvgDividerCollapsed = function SvgDividerCollapsed(props) {
3981
+ return /*#__PURE__*/React.createElement("svg", _extends({
3982
+ width: 56,
3983
+ height: 29,
3984
+ fill: "currentColor",
3985
+ xmlns: "http://www.w3.org/2000/svg",
3986
+ role: "img"
3987
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
3988
+ d: "M56 0v29c-.8-1-7-6.1-17.7-8.4L13 15.7A16 16 0 0 1 0 0Z"
3989
+ })));
3990
+ };
3991
+
3992
+ var css_248z$1 = ".yc-root {\n --aside-header-background-color: var(--yc-color-base-info);\n --aside-header-collapse-button-divider-line-color: var(\n --aside-header-header-divider-line-color\n );\n}\n\n.yc-root_theme_light {\n --aside-header-divider-line-color: transparent;\n --aside-header-header-divider-line-color: var(--yc-color-line-generic);\n}\n\n.yc-root_theme_dark {\n --aside-header-divider-line-color: var(--yc-color-base-light-simple-hover);\n --aside-header-header-divider-line-color: var(--yc-color-base-light-simple-hover);\n}\n\n.ycn-aside-header {\n --aside-header-min-width: 56px;\n height: 100%;\n width: 100%;\n position: relative;\n background-color: var(--yc-color-base-background);\n}\n.ycn-aside-header__aside {\n position: sticky;\n top: 0;\n left: 0;\n height: 100vh;\n width: inherit;\n display: flex;\n flex-direction: column;\n background-color: var(--yc-color-base-background);\n z-index: 100;\n box-sizing: border-box;\n}\n.ycn-aside-header__aside::after {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 2;\n width: 1px;\n height: 100%;\n content: \"\";\n background-color: var(--aside-header-divider-line-color);\n}\n.ycn-aside-header__aside-popup-anchor {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n}\n.ycn-aside-header__aside-content {\n --gradient-height: 334px;\n display: flex;\n flex-direction: column;\n overflow-x: hidden;\n width: inherit;\n height: inherit;\n position: relative;\n z-index: 2;\n user-select: none;\n background: linear-gradient(180deg, var(--aside-header-background-color) calc(var(--gradient-height) * 0.33), transparent calc(var(--gradient-height) * 0.88));\n}\n.ycn-aside-header__aside-content::after {\n position: absolute;\n top: 0;\n right: -100px;\n bottom: 0;\n width: 100px;\n content: \"\";\n box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1), 0px 0px 24px rgba(0, 0, 0, 0.08);\n}\n.ycn-aside-header__aside-content > .ycn-aside-header-logo {\n margin: 8px 0;\n}\n.ycn-aside-header_compact .ycn-aside-header__aside-content {\n background: transparent;\n}\n.ycn-aside-header__header {\n --aside-header-header-divider-height: 29px;\n position: relative;\n z-index: 1;\n flex: none;\n box-sizing: border-box;\n width: 100%;\n padding-top: 8px;\n padding-bottom: 22px;\n}\n.ycn-aside-header__header .ycn-aside-header__header-divider {\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: -2;\n display: none;\n color: var(--aside-header-background-color);\n}\n.ycn-aside-header__header::before {\n position: absolute;\n top: 0;\n left: 0;\n z-index: -2;\n display: none;\n width: 100%;\n height: calc(100% - var(--aside-header-header-divider-height));\n content: \"\";\n background-color: var(--aside-header-background-color);\n}\n.ycn-aside-header__header::after {\n position: absolute;\n bottom: 12px;\n left: 0;\n z-index: -2;\n width: 100%;\n height: 1px;\n content: \"\";\n background-color: var(--aside-header-header-divider-line-color);\n}\n.ycn-aside-header_compact .ycn-aside-header__header::before {\n display: block;\n}\n.ycn-aside-header_compact .ycn-aside-header__header::after {\n display: none;\n}\n.ycn-aside-header_compact .ycn-aside-header__header .ycn-aside-header__header-divider {\n display: block;\n}\n.ycn-aside-header__footer {\n flex-shrink: 0;\n width: 100%;\n margin: 8px 0;\n display: flex;\n flex-direction: column;\n}\n.ycn-aside-header__panels {\n z-index: 98;\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n overflow: auto;\n}\n.ycn-aside-header__panel {\n height: 100%;\n}\n.ycn-aside-header__pane-container {\n display: flex;\n outline: none;\n overflow: visible;\n user-select: text;\n flex-direction: row;\n}\n.ycn-aside-header__content {\n width: calc(100% - var(--aside-header-size));\n}\n.ycn-aside-header__collapse-button {\n --yc-button-background-color-hover: transparent;\n overflow: hidden;\n box-sizing: border-box;\n flex: none;\n width: 100%;\n height: 20px;\n border-top: 1px solid var(--aside-header-collapse-button-divider-line-color);\n}\n.ycn-aside-header__collapse-button:not(.ycn-aside-header__collapse-button_compact) .ycn-aside-header__collapse-icon {\n transform: rotate(180deg);\n}\n.ycn-aside-header__collapse-button .ycn-aside-header__collapse-icon {\n color: var(--yc-color-text-secondary);\n}\n.ycn-aside-header__collapse-button:hover .ycn-aside-header__collapse-icon {\n color: var(--yc-color-text-primary);\n}";
3993
+ styleInject(css_248z$1);
3994
+
3995
+ const b$1 = block('aside-header');
3996
+ class AsideHeader extends React__default.Component {
3997
+ constructor(props) {
3998
+ super(props);
3999
+ this.asideRef = React__default.createRef();
4000
+ this.renderFirstPane = (size) => {
4001
+ const { dict, menuItems, panelItems } = this.props;
4002
+ const { compact } = this.state;
4003
+ return (React__default.createElement("div", null,
4004
+ React__default.createElement("div", { className: b$1('aside'), style: { width: size } },
4005
+ React__default.createElement("div", { className: b$1('aside-popup-anchor'), ref: this.asideRef }),
4006
+ React__default.createElement("div", { className: b$1('aside-content') },
4007
+ this.renderHeader(),
4008
+ React__default.createElement(CompositeBar, { items: menuItems, compact: compact, enableCollapsing: true, dict: dict, onItemClick: this.onCompositeBarClick }),
4009
+ this.renderFooter(size),
4010
+ this.renderCollapseButton())),
4011
+ panelItems && this.renderPanels(size)));
4012
+ };
4013
+ this.renderSecondPane = (size) => {
4014
+ return (React__default.createElement(Content, { size: size, renderContent: this.props.renderContent, className: b$1('content') }));
4015
+ };
4016
+ this.renderLogo = () => React__default.createElement(Logo, Object.assign({}, this.props.logo, { compact: this.props.compact }));
4017
+ this.renderHeader = () => (React__default.createElement("div", { className: b$1('header') },
4018
+ this.renderLogo(),
4019
+ React__default.createElement(CompositeBar, { items: this.props.subheaderItems, compact: this.props.compact, enableCollapsing: false }),
4020
+ React__default.createElement(Icon, { data: SvgDividerCollapsed, className: b$1('header-divider'), width: ASIDE_HEADER_COMPACT_WIDTH, height: "29" })));
4021
+ this.renderFooter = (size) => {
4022
+ var _a, _b;
4023
+ const { compact } = this.state;
4024
+ return (React__default.createElement("div", { className: b$1('footer') }, (_b = (_a = this.props).renderFooter) === null || _b === void 0 ? void 0 : _b.call(_a, {
4025
+ size,
4026
+ compact,
4027
+ asideRef: this.asideRef,
4028
+ })));
4029
+ };
4030
+ this.renderPanels = (size) => {
4031
+ const { panelItems } = this.props;
4032
+ return (React__default.createElement(Drawer, { className: b$1('panels'), onVeilClick: this.onCloseDrawer, onEscape: this.onCloseDrawer, style: { left: size } }, panelItems.map((item) => (React__default.createElement(DrawerItem, Object.assign({ key: item.id }, item))))));
4033
+ };
4034
+ this.renderCollapseButton = () => {
4035
+ var _a;
4036
+ const { compact, dict } = this.props;
4037
+ const typeButton = compact ? Dict.ExpandButton : Dict.CollapseButton;
4038
+ return (React__default.createElement(Button, { className: b$1('collapse-button', { compact }), view: "flat", onClick: this.onCollapseButtonClick, title: (_a = dict === null || dict === void 0 ? void 0 : dict[typeButton]) !== null && _a !== void 0 ? _a : defaultDict[typeButton] },
4039
+ React__default.createElement(Icon, { data: SvgControlMenuButton, className: b$1('collapse-icon'), width: "16", height: "10" })));
4040
+ };
4041
+ this.onCollapseButtonClick = () => {
4042
+ var _a, _b;
4043
+ const newCompact = !this.state.compact;
4044
+ this.setState({ compact: newCompact });
4045
+ (_b = (_a = this.props).onChangeCompact) === null || _b === void 0 ? void 0 : _b.call(_a, newCompact);
4046
+ };
4047
+ this.onCloseDrawer = () => {
4048
+ var _a, _b;
4049
+ (_b = (_a = this.props).onClosePanel) === null || _b === void 0 ? void 0 : _b.call(_a);
4050
+ };
4051
+ this.onCompositeBarClick = () => {
4052
+ var _a, _b;
4053
+ (_b = (_a = this.props).onClosePanel) === null || _b === void 0 ? void 0 : _b.call(_a);
4054
+ };
4055
+ this.state = {
4056
+ compact: Boolean(props.compact),
4057
+ };
4058
+ }
4059
+ componentDidUpdate(prevProps) {
4060
+ if (prevProps.compact !== this.props.compact) {
4061
+ this.setState({ compact: Boolean(this.props.compact) });
4062
+ }
4063
+ }
4064
+ render() {
4065
+ const { className } = this.props;
4066
+ const { compact } = this.state;
4067
+ const size = compact ? ASIDE_HEADER_COMPACT_WIDTH : ASIDE_HEADER_EXPANDED_WIDTH;
4068
+ return (React__default.createElement("div", { className: b$1({ compact }, className) },
4069
+ React__default.createElement("div", { className: b$1('pane-container') },
4070
+ this.renderFirstPane(size),
4071
+ this.renderSecondPane(size))));
4072
+ }
4073
+ }
4074
+ AsideHeader.defaultProps = {
4075
+ panelItems: [],
4076
+ subheaderItems: [],
4077
+ menuItems: [],
4078
+ };
4079
+
4080
+ /******************************************************************************
4081
+ Copyright (c) Microsoft Corporation.
4082
+
4083
+ Permission to use, copy, modify, and/or distribute this software for any
4084
+ purpose with or without fee is hereby granted.
4085
+
4086
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
4087
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
4088
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
4089
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
4090
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
4091
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4092
+ PERFORMANCE OF THIS SOFTWARE.
4093
+ ***************************************************************************** */
4094
+
4095
+ function __rest(s, e) {
4096
+ var t = {};
4097
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4098
+ t[p] = s[p];
4099
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
4100
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
4101
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
4102
+ t[p[i]] = s[p[i]];
4103
+ }
4104
+ return t;
4105
+ }
4106
+
4107
+ var css_248z = ".ycn-footer-item {\n width: 100%;\n height: 40px;\n}";
4108
+ styleInject(css_248z);
4109
+
4110
+ const b = block('footer-item');
4111
+ const FooterItem = (_a) => {
4112
+ var { item } = _a, props = __rest(_a, ["item"]);
4113
+ return (React__default.createElement(Item, Object.assign({}, props, { item: Object.assign({ iconSize: ASIDE_HEADER_FOOTER_ICON_SIZE }, item), className: b({ compact: props.compact }) })));
4114
+ };
4115
+
4116
+ export { AsideHeader, Dict, Drawer, DrawerItem, FooterItem };
4117
+ //# sourceMappingURL=index.js.map