@cleartrip/ct-design-horizontal-scroll 4.0.0 → 5.0.0

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 (45) hide show
  1. package/README.md +85 -0
  2. package/dist/HorizontalScroll.d.ts +3 -3
  3. package/dist/HorizontalScroll.d.ts.map +1 -1
  4. package/dist/HorizontalScroll.native.d.ts +5 -0
  5. package/dist/HorizontalScroll.native.d.ts.map +1 -0
  6. package/dist/constants.d.ts +10 -0
  7. package/dist/constants.d.ts.map +1 -0
  8. package/dist/ct-design-horizontal-scroll.browser.cjs.js +14 -1
  9. package/dist/ct-design-horizontal-scroll.browser.cjs.js.map +1 -1
  10. package/dist/ct-design-horizontal-scroll.browser.esm.js +14 -1
  11. package/dist/ct-design-horizontal-scroll.browser.esm.js.map +1 -1
  12. package/dist/ct-design-horizontal-scroll.cjs.js +43 -127
  13. package/dist/ct-design-horizontal-scroll.cjs.js.map +1 -1
  14. package/dist/ct-design-horizontal-scroll.esm.js +43 -126
  15. package/dist/ct-design-horizontal-scroll.esm.js.map +1 -1
  16. package/dist/ct-design-horizontal-scroll.umd.js +1686 -181
  17. package/dist/ct-design-horizontal-scroll.umd.js.map +1 -1
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.native.d.ts +4 -0
  21. package/dist/index.native.d.ts.map +1 -0
  22. package/dist/style.d.ts +40 -0
  23. package/dist/style.d.ts.map +1 -0
  24. package/dist/type.d.ts +21 -27
  25. package/dist/type.d.ts.map +1 -1
  26. package/package.json +31 -11
  27. package/src/HorizontalScroll.native.tsx +80 -0
  28. package/src/HorizontalScroll.tsx +62 -0
  29. package/src/constants.ts +10 -0
  30. package/src/index.native.ts +3 -0
  31. package/src/index.ts +3 -0
  32. package/src/style.ts +86 -0
  33. package/src/type.ts +67 -0
  34. package/dist/StyledHorizontalScroll/StyledHorizontalScroll.d.ts +0 -6
  35. package/dist/StyledHorizontalScroll/StyledHorizontalScroll.d.ts.map +0 -1
  36. package/dist/StyledHorizontalScroll/index.d.ts +0 -2
  37. package/dist/StyledHorizontalScroll/index.d.ts.map +0 -1
  38. package/dist/StyledLeftShadow/StyledLeftShadow.d.ts +0 -11
  39. package/dist/StyledLeftShadow/StyledLeftShadow.d.ts.map +0 -1
  40. package/dist/StyledLeftShadow/index.d.ts +0 -2
  41. package/dist/StyledLeftShadow/index.d.ts.map +0 -1
  42. package/dist/StyledRightShadow/StyledRightShadow.d.ts +0 -11
  43. package/dist/StyledRightShadow/StyledRightShadow.d.ts.map +0 -1
  44. package/dist/StyledRightShadow/index.d.ts +0 -2
  45. package/dist/StyledRightShadow/index.d.ts.map +0 -1
@@ -1,205 +1,1710 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react'), require('@cleartrip/ct-design-container'), require('styled-components'), require('@cleartrip/ct-design-icons'), require('@cleartrip/ct-design-theme'), require('@cleartrip/ct-design-common-utils')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react', '@cleartrip/ct-design-container', 'styled-components', '@cleartrip/ct-design-icons', '@cleartrip/ct-design-theme', '@cleartrip/ct-design-common-utils'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CTDesignSystemHorizontalScroll = {}, global.jsxRuntime, global.React, global.ctDesignContainer, global.styled, global.ctDesignIcons, global.ctDesignTheme, global.ctDesignCommonUtils));
5
- })(this, (function (exports, jsxRuntime, react, ctDesignContainer, styled, ctDesignIcons, ctDesignTheme, ctDesignCommonUtils) { 'use strict';
6
-
7
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
-
9
- var styled__default = /*#__PURE__*/_interopDefault(styled);
10
-
11
- /******************************************************************************
12
- Copyright (c) Microsoft Corporation.
13
-
14
- Permission to use, copy, modify, and/or distribute this software for any
15
- purpose with or without fee is hereby granted.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
18
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
19
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
20
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
21
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23
- PERFORMANCE OF THIS SOFTWARE.
24
- ***************************************************************************** */
25
- /* global Reflect, Promise, SuppressedError, Symbol */
26
-
27
- var __assign = function () {
28
- __assign = Object.assign || function __assign(t) {
29
- for (var s, i = 1, n = arguments.length; i < n; i++) {
30
- s = arguments[i];
31
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react'), require('@cleartrip/ct-design-container'), require('@cleartrip/ct-design-use-merge-refs'), require('@cleartrip/ct-design-style-manager')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react', '@cleartrip/ct-design-container', '@cleartrip/ct-design-use-merge-refs', '@cleartrip/ct-design-style-manager'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CTDesignSystemHorizontalScroll = {}, global.jsxRuntime, global.React, global.ctDesignContainer, global.useMergeRefs, global.ctDesignStyleManager));
5
+ })(this, (function (exports, jsxRuntime, react, ctDesignContainer, useMergeRefs, ctDesignStyleManager) { 'use strict';
6
+
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
+
9
+ var useMergeRefs__default = /*#__PURE__*/_interopDefault(useMergeRefs);
10
+
11
+ var isDevelopment$1 = false;
12
+
13
+ /*
14
+
15
+ Based off glamor's StyleSheet, thanks Sunil ❤️
16
+
17
+ high performance StyleSheet for css-in-js systems
18
+
19
+ - uses multiple style tags behind the scenes for millions of rules
20
+ - uses `insertRule` for appending in production for *much* faster performance
21
+
22
+ // usage
23
+
24
+ import { StyleSheet } from '@emotion/sheet'
25
+
26
+ let styleSheet = new StyleSheet({ key: '', container: document.head })
27
+
28
+ styleSheet.insert('#box { border: 1px solid red; }')
29
+ - appends a css rule into the stylesheet
30
+
31
+ styleSheet.flush()
32
+ - empties the stylesheet of all its contents
33
+
34
+ */
35
+
36
+ function sheetForTag(tag) {
37
+ if (tag.sheet) {
38
+ return tag.sheet;
39
+ } // this weirdness brought to you by firefox
40
+
41
+ /* istanbul ignore next */
42
+
43
+ for (var i = 0; i < document.styleSheets.length; i++) {
44
+ if (document.styleSheets[i].ownerNode === tag) {
45
+ return document.styleSheets[i];
46
+ }
47
+ } // this function should always return with a value
48
+ // TS can't understand it though so we make it stop complaining here
49
+
50
+ return undefined;
51
+ }
52
+ function createStyleElement(options) {
53
+ var tag = document.createElement('style');
54
+ tag.setAttribute('data-emotion', options.key);
55
+ if (options.nonce !== undefined) {
56
+ tag.setAttribute('nonce', options.nonce);
57
+ }
58
+ tag.appendChild(document.createTextNode(''));
59
+ tag.setAttribute('data-s', '');
60
+ return tag;
61
+ }
62
+ var StyleSheet = /*#__PURE__*/function () {
63
+ // Using Node instead of HTMLElement since container may be a ShadowRoot
64
+ function StyleSheet(options) {
65
+ var _this = this;
66
+ this._insertTag = function (tag) {
67
+ var before;
68
+ if (_this.tags.length === 0) {
69
+ if (_this.insertionPoint) {
70
+ before = _this.insertionPoint.nextSibling;
71
+ } else if (_this.prepend) {
72
+ before = _this.container.firstChild;
73
+ } else {
74
+ before = _this.before;
75
+ }
76
+ } else {
77
+ before = _this.tags[_this.tags.length - 1].nextSibling;
32
78
  }
33
- return t;
79
+ _this.container.insertBefore(tag, before);
80
+ _this.tags.push(tag);
34
81
  };
35
- return __assign.apply(this, arguments);
82
+ this.isSpeedy = options.speedy === undefined ? !isDevelopment$1 : options.speedy;
83
+ this.tags = [];
84
+ this.ctr = 0;
85
+ this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
86
+
87
+ this.key = options.key;
88
+ this.container = options.container;
89
+ this.prepend = options.prepend;
90
+ this.insertionPoint = options.insertionPoint;
91
+ this.before = null;
92
+ }
93
+ var _proto = StyleSheet.prototype;
94
+ _proto.hydrate = function hydrate(nodes) {
95
+ nodes.forEach(this._insertTag);
36
96
  };
37
- function __makeTemplateObject(cooked, raw) {
38
- if (Object.defineProperty) {
39
- Object.defineProperty(cooked, "raw", {
40
- value: raw
41
- });
97
+ _proto.insert = function insert(rule) {
98
+ // the max length is how many rules we have per style tag, it's 65000 in speedy mode
99
+ // it's 1 in dev because we insert source maps that map a single rule to a location
100
+ // and you can only have one source map per style tag
101
+ if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
102
+ this._insertTag(createStyleElement(this));
103
+ }
104
+ var tag = this.tags[this.tags.length - 1];
105
+ if (this.isSpeedy) {
106
+ var sheet = sheetForTag(tag);
107
+ try {
108
+ // this is the ultrafast version, works across browsers
109
+ // the big drawback is that the css won't be editable in devtools
110
+ sheet.insertRule(rule, sheet.cssRules.length);
111
+ } catch (e) {}
42
112
  } else {
43
- cooked.raw = raw;
113
+ tag.appendChild(document.createTextNode(rule));
44
114
  }
45
- return cooked;
46
- }
47
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
48
- var e = new Error(message);
49
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
115
+ this.ctr++;
116
+ };
117
+ _proto.flush = function flush() {
118
+ this.tags.forEach(function (tag) {
119
+ var _tag$parentNode;
120
+ return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
121
+ });
122
+ this.tags = [];
123
+ this.ctr = 0;
50
124
  };
125
+ return StyleSheet;
126
+ }();
51
127
 
52
- var StyledRightShadow = styled__default.default.div(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-end;\n\theight: 100%;\n\twidth: ", ";\n\tz-index: 10;\n\tbackground: ", ";\n\t\t", "\n"], ["\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-end;\n\theight: 100%;\n\twidth: ", ";\n\tz-index: 10;\n\tbackground: ", ";\n\t\t", "\n"])), function (_a) {
53
- var width = _a.width;
54
- return width || '64px';
55
- }, function (_a) {
56
- var shadowGradientStyle = _a.shadowGradientStyle;
57
- return (shadowGradientStyle === null || shadowGradientStyle === void 0 ? void 0 : shadowGradientStyle.right) || "linear-gradient(270deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%)";
58
- }, function (_a) {
59
- var css = _a.css;
60
- return css && styled.css(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n\t", "\n "], ["\n\t", "\n "])), css);
61
- });
62
- var templateObject_1$2, templateObject_2$2;
63
-
64
- var StyledLeftShadow = styled__default.default.div(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n height: 100%;\n width: ", ";\n z-index: 10;\n background: ", ";\n ", "\n"], ["\n position: absolute;\n left: 0;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n height: 100%;\n width: ", ";\n z-index: 10;\n background: ", ";\n ", "\n"])), function (_a) {
65
- var width = _a.width;
66
- return width || '64px';
67
- }, function (_a) {
68
- var shadowGradientStyle = _a.shadowGradientStyle;
69
- return (shadowGradientStyle === null || shadowGradientStyle === void 0 ? void 0 : shadowGradientStyle.left) || "linear-gradient(90deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%)";
70
- }, function (_a) {
71
- var css = _a.css;
72
- return css && styled.css(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n\t", "\n "], ["\n\t", "\n "])), css);
73
- });
74
- var templateObject_1$1, templateObject_2$1;
128
+ var stylisExports = {};
129
+ var stylis = {
130
+ get exports(){ return stylisExports; },
131
+ set exports(v){ stylisExports = v; },
132
+ };
75
133
 
76
- var StyledHorizontalScroll = styled__default.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\tdisplay: flex;\n\twhite-space: no-wrap;\n\toverflow-x: auto;\n scroll-behavior: smooth;\n\t-webkit-tap-highlight-color: transparent;\n\tscrollbar-width: none; /* Firefox */\n\t-ms-overflow-style: none; /* Internet Explorer 10+ */\n\n\t&::-webkit-scrollbar {\n\t\t/* WebKit */\n\t\tdisplay: none;\n\t}\n\t", "\n"], ["\n\tdisplay: flex;\n\twhite-space: no-wrap;\n\toverflow-x: auto;\n scroll-behavior: smooth;\n\t-webkit-tap-highlight-color: transparent;\n\tscrollbar-width: none; /* Firefox */\n\t-ms-overflow-style: none; /* Internet Explorer 10+ */\n\n\t&::-webkit-scrollbar {\n\t\t/* WebKit */\n\t\tdisplay: none;\n\t}\n\t", "\n"])), function (_a) {
77
- var css = _a.css;
78
- return css && styled.css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t", "\n "], ["\n\t", "\n "])), css);
79
- });
80
- var templateObject_1, templateObject_2;
81
-
82
- exports.ARROW_SIZE = void 0;
83
- (function (ARROW_SIZE) {
84
- ARROW_SIZE["SM"] = "sm";
85
- ARROW_SIZE["MD"] = "md";
86
- ARROW_SIZE["LG"] = "lg";
87
- })(exports.ARROW_SIZE || (exports.ARROW_SIZE = {}));
88
- exports.ARROW_DIRECTION = void 0;
89
- (function (ARROW_DIRECTION) {
90
- ARROW_DIRECTION["LEFT"] = "LEFT";
91
- ARROW_DIRECTION["RIGHT"] = "RIGHT";
92
- })(exports.ARROW_DIRECTION || (exports.ARROW_DIRECTION = {}));
93
-
94
- var HOVER_TYPE;
95
- (function (HOVER_TYPE) {
96
- HOVER_TYPE["ENTER"] = "ENTER";
97
- HOVER_TYPE["LEAVE"] = "LEAVE";
98
- })(HOVER_TYPE || (HOVER_TYPE = {}));
99
- var ITooltipV2BorderSize;
100
- (function (ITooltipV2BorderSize) {
101
- ITooltipV2BorderSize["XS"] = "xs";
102
- ITooltipV2BorderSize["SM"] = "sm";
103
- ITooltipV2BorderSize["MD"] = "md";
104
- ITooltipV2BorderSize["LG"] = "lg";
105
- ITooltipV2BorderSize["XL"] = "xl";
106
- })(ITooltipV2BorderSize || (ITooltipV2BorderSize = {}));
107
- var ITooltipV2Position;
108
- (function (ITooltipV2Position) {
109
- ITooltipV2Position["AUTO"] = "auto";
110
- ITooltipV2Position["LEFT"] = "left";
111
- ITooltipV2Position["RIGHT"] = "right";
112
- ITooltipV2Position["TOP"] = "top";
113
- ITooltipV2Position["BOTTOM"] = "bottom";
114
- })(ITooltipV2Position || (ITooltipV2Position = {}));
115
-
116
- var FLEX_RIGHT_PRECISION = 5;
117
- var HorizontalScroll = function (_a) {
118
- var children = _a.children, showShadow = _a.showShadow, showArrow = _a.showArrow, className = _a.className, containerClassname = _a.containerClassname, childrenClassname = _a.childrenClassname, shadowWidth = _a.shadowWidth, _b = _a.arrowSize, arrowSize = _b === void 0 ? exports.ARROW_SIZE.MD : _b, shadowGradientStyle = _a.shadowGradientStyle, _c = _a.styleConfig, styleConfig = _c === void 0 ? {} : _c;
119
- var _d = shadowWidth || {}, leftShadowWidth = _d.left, rightShadowWidth = _d.right;
120
- var theme = ctDesignTheme.useTheme();
121
- var childrenContainer = styleConfig.childrenContainer, leftChevron = styleConfig.leftChevron, leftShadowContainer = styleConfig.leftShadowContainer, leftShadowWrapper = styleConfig.leftShadowWrapper, rightChevron = styleConfig.rightChevron, rightShadowContainer = styleConfig.rightShadowContainer, rightShadowWrapper = styleConfig.rightShadowWrapper, root = styleConfig.root, scrollWrapper = styleConfig.scrollWrapper;
122
- var _e = react.useState(false), isHovering = _e[0], setIsHovering = _e[1];
123
- var _f = react.useState({
124
- left: false,
125
- right: false,
126
- }), shadowDirection = _f[0], setShadowDirection = _f[1];
127
- var horizontalScrollRef = react.useRef(null);
128
- var parentContainerRef = react.useRef(null);
129
- var childContainerRef = react.useRef(null);
130
- var updateArrowIcons = function () {
131
- if (horizontalScrollRef.current && childContainerRef.current) {
132
- var _a = horizontalScrollRef.current.getBoundingClientRect(), horizontalScrollRight = _a.right, horizontalScrollLeft = _a.left;
133
- var _b = childContainerRef.current.getBoundingClientRect(), childContainerRight = _b.right, childContainerLeft = _b.left;
134
- if (childContainerLeft - horizontalScrollLeft < -FLEX_RIGHT_PRECISION) {
135
- setShadowDirection(function (prevState) { return (__assign(__assign({}, prevState), { left: true })); });
136
- }
137
- else {
138
- setShadowDirection(function (prevState) { return (__assign(__assign({}, prevState), { left: false })); });
139
- }
140
- if (childContainerRight - horizontalScrollRight > FLEX_RIGHT_PRECISION) {
141
- setShadowDirection(function (prevState) { return (__assign(__assign({}, prevState), { right: true })); });
142
- }
143
- else {
144
- setShadowDirection(function (prevState) { return (__assign(__assign({}, prevState), { right: false })); });
145
- }
146
- }
134
+ (function (module, exports) {
135
+ (function (e, r) {
136
+ r(exports) ;
137
+ })(this, function (e) {
138
+
139
+ var r = "-ms-";
140
+ var a = "-moz-";
141
+ var c = "-webkit-";
142
+ var n = "comm";
143
+ var t = "rule";
144
+ var s = "decl";
145
+ var i = "@page";
146
+ var u = "@media";
147
+ var o = "@import";
148
+ var f = "@charset";
149
+ var l = "@viewport";
150
+ var p = "@supports";
151
+ var h = "@document";
152
+ var v = "@namespace";
153
+ var d = "@keyframes";
154
+ var b = "@font-face";
155
+ var w = "@counter-style";
156
+ var m = "@font-feature-values";
157
+ var g = "@layer";
158
+ var k = Math.abs;
159
+ var $ = String.fromCharCode;
160
+ var x = Object.assign;
161
+ function E(e, r) {
162
+ return M(e, 0) ^ 45 ? (((r << 2 ^ M(e, 0)) << 2 ^ M(e, 1)) << 2 ^ M(e, 2)) << 2 ^ M(e, 3) : 0;
163
+ }
164
+ function y(e) {
165
+ return e.trim();
166
+ }
167
+ function T(e, r) {
168
+ return (e = r.exec(e)) ? e[0] : e;
169
+ }
170
+ function A(e, r, a) {
171
+ return e.replace(r, a);
172
+ }
173
+ function O(e, r) {
174
+ return e.indexOf(r);
175
+ }
176
+ function M(e, r) {
177
+ return e.charCodeAt(r) | 0;
178
+ }
179
+ function C(e, r, a) {
180
+ return e.slice(r, a);
181
+ }
182
+ function R(e) {
183
+ return e.length;
184
+ }
185
+ function S(e) {
186
+ return e.length;
187
+ }
188
+ function z(e, r) {
189
+ return r.push(e), e;
190
+ }
191
+ function N(e, r) {
192
+ return e.map(r).join("");
193
+ }
194
+ e.line = 1;
195
+ e.column = 1;
196
+ e.length = 0;
197
+ e.position = 0;
198
+ e.character = 0;
199
+ e.characters = "";
200
+ function P(r, a, c, n, t, s, i) {
201
+ return {
202
+ value: r,
203
+ root: a,
204
+ parent: c,
205
+ type: n,
206
+ props: t,
207
+ children: s,
208
+ line: e.line,
209
+ column: e.column,
210
+ length: i,
211
+ return: ""
147
212
  };
148
- react.useEffect(function () {
149
- var _a;
150
- setTimeout(updateArrowIcons, 200);
151
- var callback = ctDesignCommonUtils.debounce(updateArrowIcons, 200);
152
- (_a = parentContainerRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('scroll', callback);
153
- return function () {
154
- var _a;
155
- (_a = parentContainerRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', callback);
156
- };
157
- }, []);
158
- var onHover = react.useCallback(function (type) { return function () {
159
- if (type === HOVER_TYPE.ENTER) {
160
- setIsHovering(true);
213
+ }
214
+ function j(e, r) {
215
+ return x(P("", null, null, "", null, null, 0), e, {
216
+ length: -e.length
217
+ }, r);
218
+ }
219
+ function U() {
220
+ return e.character;
221
+ }
222
+ function _() {
223
+ e.character = e.position > 0 ? M(e.characters, --e.position) : 0;
224
+ if (e.column--, e.character === 10) e.column = 1, e.line--;
225
+ return e.character;
226
+ }
227
+ function F() {
228
+ e.character = e.position < e.length ? M(e.characters, e.position++) : 0;
229
+ if (e.column++, e.character === 10) e.column = 1, e.line++;
230
+ return e.character;
231
+ }
232
+ function I() {
233
+ return M(e.characters, e.position);
234
+ }
235
+ function L() {
236
+ return e.position;
237
+ }
238
+ function D(r, a) {
239
+ return C(e.characters, r, a);
240
+ }
241
+ function Y(e) {
242
+ switch (e) {
243
+ case 0:
244
+ case 9:
245
+ case 10:
246
+ case 13:
247
+ case 32:
248
+ return 5;
249
+ case 33:
250
+ case 43:
251
+ case 44:
252
+ case 47:
253
+ case 62:
254
+ case 64:
255
+ case 126:
256
+ case 59:
257
+ case 123:
258
+ case 125:
259
+ return 4;
260
+ case 58:
261
+ return 3;
262
+ case 34:
263
+ case 39:
264
+ case 40:
265
+ case 91:
266
+ return 2;
267
+ case 41:
268
+ case 93:
269
+ return 1;
270
+ }
271
+ return 0;
272
+ }
273
+ function K(r) {
274
+ return e.line = e.column = 1, e.length = R(e.characters = r), e.position = 0, [];
275
+ }
276
+ function V(r) {
277
+ return e.characters = "", r;
278
+ }
279
+ function W(r) {
280
+ return y(D(e.position - 1, q(r === 91 ? r + 2 : r === 40 ? r + 1 : r)));
281
+ }
282
+ function B(e) {
283
+ return V(H(K(e)));
284
+ }
285
+ function G(r) {
286
+ while (e.character = I()) if (e.character < 33) F();else break;
287
+ return Y(r) > 2 || Y(e.character) > 3 ? "" : " ";
288
+ }
289
+ function H(r) {
290
+ while (F()) switch (Y(e.character)) {
291
+ case 0:
292
+ z(Q(e.position - 1), r);
293
+ break;
294
+ case 2:
295
+ z(W(e.character), r);
296
+ break;
297
+ default:
298
+ z($(e.character), r);
299
+ }
300
+ return r;
301
+ }
302
+ function Z(r, a) {
303
+ while (--a && F()) if (e.character < 48 || e.character > 102 || e.character > 57 && e.character < 65 || e.character > 70 && e.character < 97) break;
304
+ return D(r, L() + (a < 6 && I() == 32 && F() == 32));
305
+ }
306
+ function q(r) {
307
+ while (F()) switch (e.character) {
308
+ case r:
309
+ return e.position;
310
+ case 34:
311
+ case 39:
312
+ if (r !== 34 && r !== 39) q(e.character);
313
+ break;
314
+ case 40:
315
+ if (r === 41) q(r);
316
+ break;
317
+ case 92:
318
+ F();
319
+ break;
320
+ }
321
+ return e.position;
322
+ }
323
+ function J(r, a) {
324
+ while (F()) if (r + e.character === 47 + 10) break;else if (r + e.character === 42 + 42 && I() === 47) break;
325
+ return "/*" + D(a, e.position - 1) + "*" + $(r === 47 ? r : F());
326
+ }
327
+ function Q(r) {
328
+ while (!Y(I())) F();
329
+ return D(r, e.position);
330
+ }
331
+ function X(e) {
332
+ return V(ee("", null, null, null, [""], e = K(e), 0, [0], e));
333
+ }
334
+ function ee(e, r, a, c, n, t, s, i, u) {
335
+ var o = 0;
336
+ var f = 0;
337
+ var l = s;
338
+ var p = 0;
339
+ var h = 0;
340
+ var v = 0;
341
+ var d = 1;
342
+ var b = 1;
343
+ var w = 1;
344
+ var m = 0;
345
+ var g = "";
346
+ var k = n;
347
+ var x = t;
348
+ var E = c;
349
+ var y = g;
350
+ while (b) switch (v = m, m = F()) {
351
+ case 40:
352
+ if (v != 108 && M(y, l - 1) == 58) {
353
+ if (O(y += A(W(m), "&", "&\f"), "&\f") != -1) w = -1;
354
+ break;
161
355
  }
162
- else {
163
- setIsHovering(false);
356
+ case 34:
357
+ case 39:
358
+ case 91:
359
+ y += W(m);
360
+ break;
361
+ case 9:
362
+ case 10:
363
+ case 13:
364
+ case 32:
365
+ y += G(v);
366
+ break;
367
+ case 92:
368
+ y += Z(L() - 1, 7);
369
+ continue;
370
+ case 47:
371
+ switch (I()) {
372
+ case 42:
373
+ case 47:
374
+ z(ae(J(F(), L()), r, a), u);
375
+ break;
376
+ default:
377
+ y += "/";
164
378
  }
165
- }; }, []);
166
- var onArrowClick = function (arrowDirection) { return function () {
167
- if (parentContainerRef.current && horizontalScrollRef.current) {
168
- var parentContainerElement = parentContainerRef.current;
169
- var horizontalScrollWidth = horizontalScrollRef.current.getBoundingClientRect().width;
170
- if (arrowDirection === exports.ARROW_DIRECTION.RIGHT) {
171
- parentContainerElement.scrollLeft = parentContainerElement.scrollLeft + horizontalScrollWidth / 2;
172
- }
173
- else {
174
- parentContainerElement.scrollLeft = parentContainerElement.scrollLeft - horizontalScrollWidth / 2;
379
+ break;
380
+ case 123 * d:
381
+ i[o++] = R(y) * w;
382
+ case 125 * d:
383
+ case 59:
384
+ case 0:
385
+ switch (m) {
386
+ case 0:
387
+ case 125:
388
+ b = 0;
389
+ case 59 + f:
390
+ if (w == -1) y = A(y, /\f/g, "");
391
+ if (h > 0 && R(y) - l) z(h > 32 ? ce(y + ";", c, a, l - 1) : ce(A(y, " ", "") + ";", c, a, l - 2), u);
392
+ break;
393
+ case 59:
394
+ y += ";";
395
+ default:
396
+ z(E = re(y, r, a, o, f, n, i, g, k = [], x = [], l), t);
397
+ if (m === 123) if (f === 0) ee(y, r, E, E, k, t, l, i, x);else switch (p === 99 && M(y, 3) === 110 ? 100 : p) {
398
+ case 100:
399
+ case 108:
400
+ case 109:
401
+ case 115:
402
+ ee(e, E, E, c && z(re(e, E, E, 0, 0, n, i, g, n, k = [], l), x), n, x, l, i, c ? k : x);
403
+ break;
404
+ default:
405
+ ee(y, E, E, E, [""], x, 0, i, x);
175
406
  }
176
407
  }
177
- }; };
178
- var arrowDimension = react.useMemo(function () {
179
- switch (arrowSize) {
180
- case exports.ARROW_SIZE.SM: {
181
- return theme.size[6];
182
- }
183
- case exports.ARROW_SIZE.MD: {
184
- return theme.size[6];
408
+ o = f = h = 0, d = w = 1, g = y = "", l = s;
409
+ break;
410
+ case 58:
411
+ l = 1 + R(y), h = v;
412
+ default:
413
+ if (d < 1) if (m == 123) --d;else if (m == 125 && d++ == 0 && _() == 125) continue;
414
+ switch (y += $(m), m * d) {
415
+ case 38:
416
+ w = f > 0 ? 1 : (y += "\f", -1);
417
+ break;
418
+ case 44:
419
+ i[o++] = (R(y) - 1) * w, w = 1;
420
+ break;
421
+ case 64:
422
+ if (I() === 45) y += W(F());
423
+ p = I(), f = l = R(g = y += Q(L())), m++;
424
+ break;
425
+ case 45:
426
+ if (v === 45 && R(y) == 2) d = 0;
427
+ }
428
+ }
429
+ return t;
430
+ }
431
+ function re(e, r, a, c, n, s, i, u, o, f, l) {
432
+ var p = n - 1;
433
+ var h = n === 0 ? s : [""];
434
+ var v = S(h);
435
+ for (var d = 0, b = 0, w = 0; d < c; ++d) for (var m = 0, g = C(e, p + 1, p = k(b = i[d])), $ = e; m < v; ++m) if ($ = y(b > 0 ? h[m] + " " + g : A(g, /&\f/g, h[m]))) o[w++] = $;
436
+ return P(e, r, a, n === 0 ? t : u, o, f, l);
437
+ }
438
+ function ae(e, r, a) {
439
+ return P(e, r, a, n, $(U()), C(e, 2, -2), 0);
440
+ }
441
+ function ce(e, r, a, c) {
442
+ return P(e, r, a, s, C(e, 0, c), C(e, c + 1, -1), c);
443
+ }
444
+ function ne(e, n, t) {
445
+ switch (E(e, n)) {
446
+ case 5103:
447
+ return c + "print-" + e + e;
448
+ case 5737:
449
+ case 4201:
450
+ case 3177:
451
+ case 3433:
452
+ case 1641:
453
+ case 4457:
454
+ case 2921:
455
+ case 5572:
456
+ case 6356:
457
+ case 5844:
458
+ case 3191:
459
+ case 6645:
460
+ case 3005:
461
+ case 6391:
462
+ case 5879:
463
+ case 5623:
464
+ case 6135:
465
+ case 4599:
466
+ case 4855:
467
+ case 4215:
468
+ case 6389:
469
+ case 5109:
470
+ case 5365:
471
+ case 5621:
472
+ case 3829:
473
+ return c + e + e;
474
+ case 4789:
475
+ return a + e + e;
476
+ case 5349:
477
+ case 4246:
478
+ case 4810:
479
+ case 6968:
480
+ case 2756:
481
+ return c + e + a + e + r + e + e;
482
+ case 5936:
483
+ switch (M(e, n + 11)) {
484
+ case 114:
485
+ return c + e + r + A(e, /[svh]\w+-[tblr]{2}/, "tb") + e;
486
+ case 108:
487
+ return c + e + r + A(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e;
488
+ case 45:
489
+ return c + e + r + A(e, /[svh]\w+-[tblr]{2}/, "lr") + e;
490
+ }
491
+ case 6828:
492
+ case 4268:
493
+ case 2903:
494
+ return c + e + r + e + e;
495
+ case 6165:
496
+ return c + e + r + "flex-" + e + e;
497
+ case 5187:
498
+ return c + e + A(e, /(\w+).+(:[^]+)/, c + "box-$1$2" + r + "flex-$1$2") + e;
499
+ case 5443:
500
+ return c + e + r + "flex-item-" + A(e, /flex-|-self/g, "") + (!T(e, /flex-|baseline/) ? r + "grid-row-" + A(e, /flex-|-self/g, "") : "") + e;
501
+ case 4675:
502
+ return c + e + r + "flex-line-pack" + A(e, /align-content|flex-|-self/g, "") + e;
503
+ case 5548:
504
+ return c + e + r + A(e, "shrink", "negative") + e;
505
+ case 5292:
506
+ return c + e + r + A(e, "basis", "preferred-size") + e;
507
+ case 6060:
508
+ return c + "box-" + A(e, "-grow", "") + c + e + r + A(e, "grow", "positive") + e;
509
+ case 4554:
510
+ return c + A(e, /([^-])(transform)/g, "$1" + c + "$2") + e;
511
+ case 6187:
512
+ return A(A(A(e, /(zoom-|grab)/, c + "$1"), /(image-set)/, c + "$1"), e, "") + e;
513
+ case 5495:
514
+ case 3959:
515
+ return A(e, /(image-set\([^]*)/, c + "$1" + "$`$1");
516
+ case 4968:
517
+ return A(A(e, /(.+:)(flex-)?(.*)/, c + "box-pack:$3" + r + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + c + e + e;
518
+ case 4200:
519
+ if (!T(e, /flex-|baseline/)) return r + "grid-column-align" + C(e, n) + e;
520
+ break;
521
+ case 2592:
522
+ case 3360:
523
+ return r + A(e, "template-", "") + e;
524
+ case 4384:
525
+ case 3616:
526
+ if (t && t.some(function (e, r) {
527
+ return n = r, T(e.props, /grid-\w+-end/);
528
+ })) {
529
+ return ~O(e + (t = t[n].value), "span") ? e : r + A(e, "-start", "") + e + r + "grid-row-span:" + (~O(t, "span") ? T(t, /\d+/) : +T(t, /\d+/) - +T(e, /\d+/)) + ";";
530
+ }
531
+ return r + A(e, "-start", "") + e;
532
+ case 4896:
533
+ case 4128:
534
+ return t && t.some(function (e) {
535
+ return T(e.props, /grid-\w+-start/);
536
+ }) ? e : r + A(A(e, "-end", "-span"), "span ", "") + e;
537
+ case 4095:
538
+ case 3583:
539
+ case 4068:
540
+ case 2532:
541
+ return A(e, /(.+)-inline(.+)/, c + "$1$2") + e;
542
+ case 8116:
543
+ case 7059:
544
+ case 5753:
545
+ case 5535:
546
+ case 5445:
547
+ case 5701:
548
+ case 4933:
549
+ case 4677:
550
+ case 5533:
551
+ case 5789:
552
+ case 5021:
553
+ case 4765:
554
+ if (R(e) - 1 - n > 6) switch (M(e, n + 1)) {
555
+ case 109:
556
+ if (M(e, n + 4) !== 45) break;
557
+ case 102:
558
+ return A(e, /(.+:)(.+)-([^]+)/, "$1" + c + "$2-$3" + "$1" + a + (M(e, n + 3) == 108 ? "$3" : "$2-$3")) + e;
559
+ case 115:
560
+ return ~O(e, "stretch") ? ne(A(e, "stretch", "fill-available"), n, t) + e : e;
561
+ }
562
+ break;
563
+ case 5152:
564
+ case 5920:
565
+ return A(e, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function (a, c, n, t, s, i, u) {
566
+ return r + c + ":" + n + u + (t ? r + c + "-span:" + (s ? i : +i - +n) + u : "") + e;
567
+ });
568
+ case 4949:
569
+ if (M(e, n + 6) === 121) return A(e, ":", ":" + c) + e;
570
+ break;
571
+ case 6444:
572
+ switch (M(e, M(e, 14) === 45 ? 18 : 11)) {
573
+ case 120:
574
+ return A(e, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + c + (M(e, 14) === 45 ? "inline-" : "") + "box$3" + "$1" + c + "$2$3" + "$1" + r + "$2box$3") + e;
575
+ case 100:
576
+ return A(e, ":", ":" + r) + e;
577
+ }
578
+ break;
579
+ case 5719:
580
+ case 2647:
581
+ case 2135:
582
+ case 3927:
583
+ case 2391:
584
+ return A(e, "scroll-", "scroll-snap-") + e;
585
+ }
586
+ return e;
587
+ }
588
+ function te(e, r) {
589
+ var a = "";
590
+ var c = S(e);
591
+ for (var n = 0; n < c; n++) a += r(e[n], n, e, r) || "";
592
+ return a;
593
+ }
594
+ function se(e, r, a, c) {
595
+ switch (e.type) {
596
+ case g:
597
+ if (e.children.length) break;
598
+ case o:
599
+ case s:
600
+ return e.return = e.return || e.value;
601
+ case n:
602
+ return "";
603
+ case d:
604
+ return e.return = e.value + "{" + te(e.children, c) + "}";
605
+ case t:
606
+ e.value = e.props.join(",");
607
+ }
608
+ return R(a = te(e.children, c)) ? e.return = e.value + "{" + a + "}" : "";
609
+ }
610
+ function ie(e) {
611
+ var r = S(e);
612
+ return function (a, c, n, t) {
613
+ var s = "";
614
+ for (var i = 0; i < r; i++) s += e[i](a, c, n, t) || "";
615
+ return s;
616
+ };
617
+ }
618
+ function ue(e) {
619
+ return function (r) {
620
+ if (!r.root) if (r = r.return) e(r);
621
+ };
622
+ }
623
+ function oe(e, n, i, u) {
624
+ if (e.length > -1) if (!e.return) switch (e.type) {
625
+ case s:
626
+ e.return = ne(e.value, e.length, i);
627
+ return;
628
+ case d:
629
+ return te([j(e, {
630
+ value: A(e.value, "@", "@" + c)
631
+ })], u);
632
+ case t:
633
+ if (e.length) return N(e.props, function (n) {
634
+ switch (T(n, /(::plac\w+|:read-\w+)/)) {
635
+ case ":read-only":
636
+ case ":read-write":
637
+ return te([j(e, {
638
+ props: [A(n, /:(read-\w+)/, ":" + a + "$1")]
639
+ })], u);
640
+ case "::placeholder":
641
+ return te([j(e, {
642
+ props: [A(n, /:(plac\w+)/, ":" + c + "input-$1")]
643
+ }), j(e, {
644
+ props: [A(n, /:(plac\w+)/, ":" + a + "$1")]
645
+ }), j(e, {
646
+ props: [A(n, /:(plac\w+)/, r + "input-$1")]
647
+ })], u);
648
+ }
649
+ return "";
650
+ });
651
+ }
652
+ }
653
+ function fe(e) {
654
+ switch (e.type) {
655
+ case t:
656
+ e.props = e.props.map(function (r) {
657
+ return N(B(r), function (r, a, c) {
658
+ switch (M(r, 0)) {
659
+ case 12:
660
+ return C(r, 1, R(r));
661
+ case 0:
662
+ case 40:
663
+ case 43:
664
+ case 62:
665
+ case 126:
666
+ return r;
667
+ case 58:
668
+ if (c[++a] === "global") c[a] = "", c[++a] = "\f" + C(c[a], a = 1, -1);
669
+ case 32:
670
+ return a === 1 ? "" : r;
671
+ default:
672
+ switch (a) {
673
+ case 0:
674
+ e = r;
675
+ return S(c) > 1 ? "" : r;
676
+ case a = S(c) - 1:
677
+ case 2:
678
+ return a === 2 ? r + e + e : r + e;
679
+ default:
680
+ return r;
681
+ }
185
682
  }
186
- case exports.ARROW_SIZE.LG: {
187
- return theme.size[10];
683
+ });
684
+ });
685
+ }
686
+ }
687
+ e.CHARSET = f;
688
+ e.COMMENT = n;
689
+ e.COUNTER_STYLE = w;
690
+ e.DECLARATION = s;
691
+ e.DOCUMENT = h;
692
+ e.FONT_FACE = b;
693
+ e.FONT_FEATURE_VALUES = m;
694
+ e.IMPORT = o;
695
+ e.KEYFRAMES = d;
696
+ e.LAYER = g;
697
+ e.MEDIA = u;
698
+ e.MOZ = a;
699
+ e.MS = r;
700
+ e.NAMESPACE = v;
701
+ e.PAGE = i;
702
+ e.RULESET = t;
703
+ e.SUPPORTS = p;
704
+ e.VIEWPORT = l;
705
+ e.WEBKIT = c;
706
+ e.abs = k;
707
+ e.alloc = K;
708
+ e.append = z;
709
+ e.assign = x;
710
+ e.caret = L;
711
+ e.char = U;
712
+ e.charat = M;
713
+ e.combine = N;
714
+ e.comment = ae;
715
+ e.commenter = J;
716
+ e.compile = X;
717
+ e.copy = j;
718
+ e.dealloc = V;
719
+ e.declaration = ce;
720
+ e.delimit = W;
721
+ e.delimiter = q;
722
+ e.escaping = Z;
723
+ e.from = $;
724
+ e.hash = E;
725
+ e.identifier = Q;
726
+ e.indexof = O;
727
+ e.match = T;
728
+ e.middleware = ie;
729
+ e.namespace = fe;
730
+ e.next = F;
731
+ e.node = P;
732
+ e.parse = ee;
733
+ e.peek = I;
734
+ e.prefix = ne;
735
+ e.prefixer = oe;
736
+ e.prev = _;
737
+ e.replace = A;
738
+ e.ruleset = re;
739
+ e.rulesheet = ue;
740
+ e.serialize = te;
741
+ e.sizeof = S;
742
+ e.slice = D;
743
+ e.stringify = se;
744
+ e.strlen = R;
745
+ e.substr = C;
746
+ e.token = Y;
747
+ e.tokenize = B;
748
+ e.tokenizer = H;
749
+ e.trim = y;
750
+ e.whitespace = G;
751
+ Object.defineProperty(e, "__esModule", {
752
+ value: true
753
+ });
754
+ });
755
+ })(stylis, stylisExports);
756
+
757
+ var weakMemoize = function weakMemoize(func) {
758
+ var cache = new WeakMap();
759
+ return function (arg) {
760
+ if (cache.has(arg)) {
761
+ // Use non-null assertion because we just checked that the cache `has` it
762
+ // This allows us to remove `undefined` from the return value
763
+ return cache.get(arg);
764
+ }
765
+ var ret = func(arg);
766
+ cache.set(arg, ret);
767
+ return ret;
768
+ };
769
+ };
770
+
771
+ function memoize(fn) {
772
+ var cache = Object.create(null);
773
+ return function (arg) {
774
+ if (cache[arg] === undefined) cache[arg] = fn(arg);
775
+ return cache[arg];
776
+ };
777
+ }
778
+
779
+ var isBrowser$1 = typeof document !== 'undefined';
780
+ var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
781
+ var previous = 0;
782
+ var character = 0;
783
+ while (true) {
784
+ previous = character;
785
+ character = stylisExports.peek(); // &\f
786
+
787
+ if (previous === 38 && character === 12) {
788
+ points[index] = 1;
789
+ }
790
+ if (stylisExports.token(character)) {
791
+ break;
792
+ }
793
+ stylisExports.next();
794
+ }
795
+ return stylisExports.slice(begin, stylisExports.position);
796
+ };
797
+ var toRules = function toRules(parsed, points) {
798
+ // pretend we've started with a comma
799
+ var index = -1;
800
+ var character = 44;
801
+ do {
802
+ switch (stylisExports.token(character)) {
803
+ case 0:
804
+ // &\f
805
+ if (character === 38 && stylisExports.peek() === 12) {
806
+ // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
807
+ // stylis inserts \f after & to know when & where it should replace this sequence with the context selector
808
+ // and when it should just concatenate the outer and inner selectors
809
+ // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
810
+ points[index] = 1;
811
+ }
812
+ parsed[index] += identifierWithPointTracking(stylisExports.position - 1, points, index);
813
+ break;
814
+ case 2:
815
+ parsed[index] += stylisExports.delimit(character);
816
+ break;
817
+ case 4:
818
+ // comma
819
+ if (character === 44) {
820
+ // colon
821
+ parsed[++index] = stylisExports.peek() === 58 ? '&\f' : '';
822
+ points[index] = parsed[index].length;
823
+ break;
824
+ }
825
+
826
+ // fallthrough
827
+
828
+ default:
829
+ parsed[index] += stylisExports.from(character);
830
+ }
831
+ } while (character = stylisExports.next());
832
+ return parsed;
833
+ };
834
+ var getRules = function getRules(value, points) {
835
+ return stylisExports.dealloc(toRules(stylisExports.alloc(value), points));
836
+ }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
837
+
838
+ var fixedElements = /* #__PURE__ */new WeakMap();
839
+ var compat = function compat(element) {
840
+ if (element.type !== 'rule' || !element.parent ||
841
+ // positive .length indicates that this rule contains pseudo
842
+ // negative .length indicates that this rule has been already prefixed
843
+ element.length < 1) {
844
+ return;
845
+ }
846
+ var value = element.value;
847
+ var parent = element.parent;
848
+ var isImplicitRule = element.column === parent.column && element.line === parent.line;
849
+ while (parent.type !== 'rule') {
850
+ parent = parent.parent;
851
+ if (!parent) return;
852
+ } // short-circuit for the simplest case
853
+
854
+ if (element.props.length === 1 && value.charCodeAt(0) !== 58
855
+ /* colon */ && !fixedElements.get(parent)) {
856
+ return;
857
+ } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
858
+ // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
859
+
860
+ if (isImplicitRule) {
861
+ return;
862
+ }
863
+ fixedElements.set(element, true);
864
+ var points = [];
865
+ var rules = getRules(value, points);
866
+ var parentRules = parent.props;
867
+ for (var i = 0, k = 0; i < rules.length; i++) {
868
+ for (var j = 0; j < parentRules.length; j++, k++) {
869
+ element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
870
+ }
871
+ }
872
+ };
873
+ var removeLabel = function removeLabel(element) {
874
+ if (element.type === 'decl') {
875
+ var value = element.value;
876
+ if (
877
+ // charcode for l
878
+ value.charCodeAt(0) === 108 &&
879
+ // charcode for b
880
+ value.charCodeAt(2) === 98) {
881
+ // this ignores label
882
+ element["return"] = '';
883
+ element.value = '';
884
+ }
885
+ }
886
+ };
887
+
888
+ /* eslint-disable no-fallthrough */
889
+
890
+ function prefix(value, length) {
891
+ switch (stylisExports.hash(value, length)) {
892
+ // color-adjust
893
+ case 5103:
894
+ return stylisExports.WEBKIT + 'print-' + value + value;
895
+ // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
896
+
897
+ case 5737:
898
+ case 4201:
899
+ case 3177:
900
+ case 3433:
901
+ case 1641:
902
+ case 4457:
903
+ case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
904
+
905
+ case 5572:
906
+ case 6356:
907
+ case 5844:
908
+ case 3191:
909
+ case 6645:
910
+ case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
911
+
912
+ case 6391:
913
+ case 5879:
914
+ case 5623:
915
+ case 6135:
916
+ case 4599:
917
+ case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
918
+
919
+ case 4215:
920
+ case 6389:
921
+ case 5109:
922
+ case 5365:
923
+ case 5621:
924
+ case 3829:
925
+ return stylisExports.WEBKIT + value + value;
926
+ // appearance, user-select, transform, hyphens, text-size-adjust
927
+
928
+ case 5349:
929
+ case 4246:
930
+ case 4810:
931
+ case 6968:
932
+ case 2756:
933
+ return stylisExports.WEBKIT + value + stylisExports.MOZ + value + stylisExports.MS + value + value;
934
+ // flex, flex-direction
935
+
936
+ case 6828:
937
+ case 4268:
938
+ return stylisExports.WEBKIT + value + stylisExports.MS + value + value;
939
+ // order
940
+
941
+ case 6165:
942
+ return stylisExports.WEBKIT + value + stylisExports.MS + 'flex-' + value + value;
943
+ // align-items
944
+
945
+ case 5187:
946
+ return stylisExports.WEBKIT + value + stylisExports.replace(value, /(\w+).+(:[^]+)/, stylisExports.WEBKIT + 'box-$1$2' + stylisExports.MS + 'flex-$1$2') + value;
947
+ // align-self
948
+
949
+ case 5443:
950
+ return stylisExports.WEBKIT + value + stylisExports.MS + 'flex-item-' + stylisExports.replace(value, /flex-|-self/, '') + value;
951
+ // align-content
952
+
953
+ case 4675:
954
+ return stylisExports.WEBKIT + value + stylisExports.MS + 'flex-line-pack' + stylisExports.replace(value, /align-content|flex-|-self/, '') + value;
955
+ // flex-shrink
956
+
957
+ case 5548:
958
+ return stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, 'shrink', 'negative') + value;
959
+ // flex-basis
960
+
961
+ case 5292:
962
+ return stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, 'basis', 'preferred-size') + value;
963
+ // flex-grow
964
+
965
+ case 6060:
966
+ return stylisExports.WEBKIT + 'box-' + stylisExports.replace(value, '-grow', '') + stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, 'grow', 'positive') + value;
967
+ // transition
968
+
969
+ case 4554:
970
+ return stylisExports.WEBKIT + stylisExports.replace(value, /([^-])(transform)/g, '$1' + stylisExports.WEBKIT + '$2') + value;
971
+ // cursor
972
+
973
+ case 6187:
974
+ return stylisExports.replace(stylisExports.replace(stylisExports.replace(value, /(zoom-|grab)/, stylisExports.WEBKIT + '$1'), /(image-set)/, stylisExports.WEBKIT + '$1'), value, '') + value;
975
+ // background, background-image
976
+
977
+ case 5495:
978
+ case 3959:
979
+ return stylisExports.replace(value, /(image-set\([^]*)/, stylisExports.WEBKIT + '$1' + '$`$1');
980
+ // justify-content
981
+
982
+ case 4968:
983
+ return stylisExports.replace(stylisExports.replace(value, /(.+:)(flex-)?(.*)/, stylisExports.WEBKIT + 'box-pack:$3' + stylisExports.MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + stylisExports.WEBKIT + value + value;
984
+ // (margin|padding)-inline-(start|end)
985
+
986
+ case 4095:
987
+ case 3583:
988
+ case 4068:
989
+ case 2532:
990
+ return stylisExports.replace(value, /(.+)-inline(.+)/, stylisExports.WEBKIT + '$1$2') + value;
991
+ // (min|max)?(width|height|inline-size|block-size)
992
+
993
+ case 8116:
994
+ case 7059:
995
+ case 5753:
996
+ case 5535:
997
+ case 5445:
998
+ case 5701:
999
+ case 4933:
1000
+ case 4677:
1001
+ case 5533:
1002
+ case 5789:
1003
+ case 5021:
1004
+ case 4765:
1005
+ // stretch, max-content, min-content, fill-available
1006
+ if (stylisExports.strlen(value) - 1 - length > 6) switch (stylisExports.charat(value, length + 1)) {
1007
+ // (m)ax-content, (m)in-content
1008
+ case 109:
1009
+ // -
1010
+ if (stylisExports.charat(value, length + 4) !== 45) break;
1011
+ // (f)ill-available, (f)it-content
1012
+
1013
+ case 102:
1014
+ return stylisExports.replace(value, /(.+:)(.+)-([^]+)/, '$1' + stylisExports.WEBKIT + '$2-$3' + '$1' + stylisExports.MOZ + (stylisExports.charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
1015
+ // (s)tretch
1016
+
1017
+ case 115:
1018
+ return ~stylisExports.indexof(value, 'stretch') ? prefix(stylisExports.replace(value, 'stretch', 'fill-available'), length) + value : value;
1019
+ }
1020
+ break;
1021
+ // position: sticky
1022
+
1023
+ case 4949:
1024
+ // (s)ticky?
1025
+ if (stylisExports.charat(value, length + 1) !== 115) break;
1026
+ // display: (flex|inline-flex)
1027
+
1028
+ case 6444:
1029
+ switch (stylisExports.charat(value, stylisExports.strlen(value) - 3 - (~stylisExports.indexof(value, '!important') && 10))) {
1030
+ // stic(k)y
1031
+ case 107:
1032
+ return stylisExports.replace(value, ':', ':' + stylisExports.WEBKIT) + value;
1033
+ // (inline-)?fl(e)x
1034
+
1035
+ case 101:
1036
+ return stylisExports.replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + stylisExports.WEBKIT + (stylisExports.charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + stylisExports.WEBKIT + '$2$3' + '$1' + stylisExports.MS + '$2box$3') + value;
1037
+ }
1038
+ break;
1039
+ // writing-mode
1040
+
1041
+ case 5936:
1042
+ switch (stylisExports.charat(value, length + 11)) {
1043
+ // vertical-l(r)
1044
+ case 114:
1045
+ return stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
1046
+ // vertical-r(l)
1047
+
1048
+ case 108:
1049
+ return stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
1050
+ // horizontal(-)tb
1051
+
1052
+ case 45:
1053
+ return stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
1054
+ }
1055
+ return stylisExports.WEBKIT + value + stylisExports.MS + value + value;
1056
+ }
1057
+ return value;
1058
+ }
1059
+ var prefixer = function prefixer(element, index, children, callback) {
1060
+ if (element.length > -1) if (!element["return"]) switch (element.type) {
1061
+ case stylisExports.DECLARATION:
1062
+ element["return"] = prefix(element.value, element.length);
1063
+ break;
1064
+ case stylisExports.KEYFRAMES:
1065
+ return stylisExports.serialize([stylisExports.copy(element, {
1066
+ value: stylisExports.replace(element.value, '@', '@' + stylisExports.WEBKIT)
1067
+ })], callback);
1068
+ case stylisExports.RULESET:
1069
+ if (element.length) return stylisExports.combine(element.props, function (value) {
1070
+ switch (stylisExports.match(value, /(::plac\w+|:read-\w+)/)) {
1071
+ // :read-(only|write)
1072
+ case ':read-only':
1073
+ case ':read-write':
1074
+ return stylisExports.serialize([stylisExports.copy(element, {
1075
+ props: [stylisExports.replace(value, /:(read-\w+)/, ':' + stylisExports.MOZ + '$1')]
1076
+ })], callback);
1077
+ // :placeholder
1078
+
1079
+ case '::placeholder':
1080
+ return stylisExports.serialize([stylisExports.copy(element, {
1081
+ props: [stylisExports.replace(value, /:(plac\w+)/, ':' + stylisExports.WEBKIT + 'input-$1')]
1082
+ }), stylisExports.copy(element, {
1083
+ props: [stylisExports.replace(value, /:(plac\w+)/, ':' + stylisExports.MOZ + '$1')]
1084
+ }), stylisExports.copy(element, {
1085
+ props: [stylisExports.replace(value, /:(plac\w+)/, stylisExports.MS + 'input-$1')]
1086
+ })], callback);
1087
+ }
1088
+ return '';
1089
+ });
1090
+ }
1091
+ };
1092
+ var getServerStylisCache = isBrowser$1 ? undefined : weakMemoize(function () {
1093
+ return memoize(function () {
1094
+ return {};
1095
+ });
1096
+ });
1097
+ var defaultStylisPlugins = [prefixer];
1098
+ var createCache = function createCache(options) {
1099
+ var key = options.key;
1100
+ if (isBrowser$1 && key === 'css') {
1101
+ var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
1102
+ // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
1103
+ // note this very very intentionally targets all style elements regardless of the key to ensure
1104
+ // that creating a cache works inside of render of a React component
1105
+
1106
+ Array.prototype.forEach.call(ssrStyles, function (node) {
1107
+ // we want to only move elements which have a space in the data-emotion attribute value
1108
+ // because that indicates that it is an Emotion 11 server-side rendered style elements
1109
+ // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
1110
+ // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
1111
+ // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
1112
+ // will not result in the Emotion 10 styles being destroyed
1113
+ var dataEmotionAttribute = node.getAttribute('data-emotion');
1114
+ if (dataEmotionAttribute.indexOf(' ') === -1) {
1115
+ return;
1116
+ }
1117
+ document.head.appendChild(node);
1118
+ node.setAttribute('data-s', '');
1119
+ });
1120
+ }
1121
+ var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
1122
+ var inserted = {};
1123
+ var container;
1124
+ var nodesToHydrate = [];
1125
+ if (isBrowser$1) {
1126
+ container = options.container || document.head;
1127
+ Array.prototype.forEach.call(
1128
+ // this means we will ignore elements which don't have a space in them which
1129
+ // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
1130
+ document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
1131
+ var attrib = node.getAttribute("data-emotion").split(' ');
1132
+ for (var i = 1; i < attrib.length; i++) {
1133
+ inserted[attrib[i]] = true;
1134
+ }
1135
+ nodesToHydrate.push(node);
1136
+ });
1137
+ }
1138
+ var _insert;
1139
+ var omnipresentPlugins = [compat, removeLabel];
1140
+ if (!getServerStylisCache) {
1141
+ var currentSheet;
1142
+ var finalizingPlugins = [stylisExports.stringify, stylisExports.rulesheet(function (rule) {
1143
+ currentSheet.insert(rule);
1144
+ })];
1145
+ var serializer = stylisExports.middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
1146
+ var stylis = function stylis(styles) {
1147
+ return stylisExports.serialize(stylisExports.compile(styles), serializer);
1148
+ };
1149
+ _insert = function insert(selector, serialized, sheet, shouldCache) {
1150
+ currentSheet = sheet;
1151
+ stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
1152
+ if (shouldCache) {
1153
+ cache.inserted[serialized.name] = true;
1154
+ }
1155
+ };
1156
+ } else {
1157
+ var _finalizingPlugins = [stylisExports.stringify];
1158
+ var _serializer = stylisExports.middleware(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));
1159
+ var _stylis = function _stylis(styles) {
1160
+ return stylisExports.serialize(stylisExports.compile(styles), _serializer);
1161
+ };
1162
+ var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
1163
+ var getRules = function getRules(selector, serialized) {
1164
+ var name = serialized.name;
1165
+ if (serverStylisCache[name] === undefined) {
1166
+ serverStylisCache[name] = _stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
1167
+ }
1168
+ return serverStylisCache[name];
1169
+ };
1170
+ _insert = function _insert(selector, serialized, sheet, shouldCache) {
1171
+ var name = serialized.name;
1172
+ var rules = getRules(selector, serialized);
1173
+ if (cache.compat === undefined) {
1174
+ // in regular mode, we don't set the styles on the inserted cache
1175
+ // since we don't need to and that would be wasting memory
1176
+ // we return them so that they are rendered in a style tag
1177
+ if (shouldCache) {
1178
+ cache.inserted[name] = true;
1179
+ }
1180
+ return rules;
1181
+ } else {
1182
+ // in compat mode, we put the styles on the inserted cache so
1183
+ // that emotion-server can pull out the styles
1184
+ // except when we don't want to cache it which was in Global but now
1185
+ // is nowhere but we don't want to do a major right now
1186
+ // and just in case we're going to leave the case here
1187
+ // it's also not affecting client side bundle size
1188
+ // so it's really not a big deal
1189
+ if (shouldCache) {
1190
+ cache.inserted[name] = rules;
1191
+ } else {
1192
+ return rules;
1193
+ }
1194
+ }
1195
+ };
1196
+ }
1197
+ var cache = {
1198
+ key: key,
1199
+ sheet: new StyleSheet({
1200
+ key: key,
1201
+ container: container,
1202
+ nonce: options.nonce,
1203
+ speedy: options.speedy,
1204
+ prepend: options.prepend,
1205
+ insertionPoint: options.insertionPoint
1206
+ }),
1207
+ nonce: options.nonce,
1208
+ inserted: inserted,
1209
+ registered: {},
1210
+ insert: _insert
1211
+ };
1212
+ cache.sheet.hydrate(nodesToHydrate);
1213
+ return cache;
1214
+ };
1215
+
1216
+ /* eslint-disable */
1217
+ // Inspired by https://github.com/garycourt/murmurhash-js
1218
+ // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
1219
+ function murmur2(str) {
1220
+ // 'm' and 'r' are mixing constants generated offline.
1221
+ // They're not really 'magic', they just happen to work well.
1222
+ // const m = 0x5bd1e995;
1223
+ // const r = 24;
1224
+ // Initialize the hash
1225
+ var h = 0; // Mix 4 bytes at a time into the hash
1226
+
1227
+ var k,
1228
+ i = 0,
1229
+ len = str.length;
1230
+ for (; len >= 4; ++i, len -= 4) {
1231
+ k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
1232
+ k = /* Math.imul(k, m): */
1233
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
1234
+ k ^= /* k >>> r: */
1235
+ k >>> 24;
1236
+ h = /* Math.imul(k, m): */
1237
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ /* Math.imul(h, m): */
1238
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
1239
+ } // Handle the last few bytes of the input array
1240
+
1241
+ switch (len) {
1242
+ case 3:
1243
+ h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
1244
+ case 2:
1245
+ h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
1246
+ case 1:
1247
+ h ^= str.charCodeAt(i) & 0xff;
1248
+ h = /* Math.imul(h, m): */
1249
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
1250
+ } // Do a few final mixes of the hash to ensure the last few
1251
+ // bytes are well-incorporated.
1252
+
1253
+ h ^= h >>> 13;
1254
+ h = /* Math.imul(h, m): */
1255
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
1256
+ return ((h ^ h >>> 15) >>> 0).toString(36);
1257
+ }
1258
+
1259
+ var unitlessKeys = {
1260
+ animationIterationCount: 1,
1261
+ aspectRatio: 1,
1262
+ borderImageOutset: 1,
1263
+ borderImageSlice: 1,
1264
+ borderImageWidth: 1,
1265
+ boxFlex: 1,
1266
+ boxFlexGroup: 1,
1267
+ boxOrdinalGroup: 1,
1268
+ columnCount: 1,
1269
+ columns: 1,
1270
+ flex: 1,
1271
+ flexGrow: 1,
1272
+ flexPositive: 1,
1273
+ flexShrink: 1,
1274
+ flexNegative: 1,
1275
+ flexOrder: 1,
1276
+ gridRow: 1,
1277
+ gridRowEnd: 1,
1278
+ gridRowSpan: 1,
1279
+ gridRowStart: 1,
1280
+ gridColumn: 1,
1281
+ gridColumnEnd: 1,
1282
+ gridColumnSpan: 1,
1283
+ gridColumnStart: 1,
1284
+ msGridRow: 1,
1285
+ msGridRowSpan: 1,
1286
+ msGridColumn: 1,
1287
+ msGridColumnSpan: 1,
1288
+ fontWeight: 1,
1289
+ lineHeight: 1,
1290
+ opacity: 1,
1291
+ order: 1,
1292
+ orphans: 1,
1293
+ scale: 1,
1294
+ tabSize: 1,
1295
+ widows: 1,
1296
+ zIndex: 1,
1297
+ zoom: 1,
1298
+ WebkitLineClamp: 1,
1299
+ // SVG-related properties
1300
+ fillOpacity: 1,
1301
+ floodOpacity: 1,
1302
+ stopOpacity: 1,
1303
+ strokeDasharray: 1,
1304
+ strokeDashoffset: 1,
1305
+ strokeMiterlimit: 1,
1306
+ strokeOpacity: 1,
1307
+ strokeWidth: 1
1308
+ };
1309
+
1310
+ var isDevelopment = false;
1311
+ var hyphenateRegex = /[A-Z]|^ms/g;
1312
+ var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
1313
+ var isCustomProperty = function isCustomProperty(property) {
1314
+ return property.charCodeAt(1) === 45;
1315
+ };
1316
+ var isProcessableValue = function isProcessableValue(value) {
1317
+ return value != null && typeof value !== 'boolean';
1318
+ };
1319
+ var processStyleName = /* #__PURE__ */memoize(function (styleName) {
1320
+ return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
1321
+ });
1322
+ var processStyleValue = function processStyleValue(key, value) {
1323
+ switch (key) {
1324
+ case 'animation':
1325
+ case 'animationName':
1326
+ {
1327
+ if (typeof value === 'string') {
1328
+ return value.replace(animationRegex, function (match, p1, p2) {
1329
+ cursor = {
1330
+ name: p1,
1331
+ styles: p2,
1332
+ next: cursor
1333
+ };
1334
+ return p1;
1335
+ });
1336
+ }
1337
+ }
1338
+ }
1339
+ if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
1340
+ return value + 'px';
1341
+ }
1342
+ return value;
1343
+ };
1344
+ var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';
1345
+ function handleInterpolation(mergedProps, registered, interpolation) {
1346
+ if (interpolation == null) {
1347
+ return '';
1348
+ }
1349
+ var componentSelector = interpolation;
1350
+ if (componentSelector.__emotion_styles !== undefined) {
1351
+ return componentSelector;
1352
+ }
1353
+ switch (typeof interpolation) {
1354
+ case 'boolean':
1355
+ {
1356
+ return '';
1357
+ }
1358
+ case 'object':
1359
+ {
1360
+ var keyframes = interpolation;
1361
+ if (keyframes.anim === 1) {
1362
+ cursor = {
1363
+ name: keyframes.name,
1364
+ styles: keyframes.styles,
1365
+ next: cursor
1366
+ };
1367
+ return keyframes.name;
1368
+ }
1369
+ var serializedStyles = interpolation;
1370
+ if (serializedStyles.styles !== undefined) {
1371
+ var next = serializedStyles.next;
1372
+ if (next !== undefined) {
1373
+ // not the most efficient thing ever but this is a pretty rare case
1374
+ // and there will be very few iterations of this generally
1375
+ while (next !== undefined) {
1376
+ cursor = {
1377
+ name: next.name,
1378
+ styles: next.styles,
1379
+ next: cursor
1380
+ };
1381
+ next = next.next;
1382
+ }
1383
+ }
1384
+ var styles = serializedStyles.styles + ";";
1385
+ return styles;
1386
+ }
1387
+ return createStringFromObject(mergedProps, registered, interpolation);
1388
+ }
1389
+ case 'function':
1390
+ {
1391
+ if (mergedProps !== undefined) {
1392
+ var previousCursor = cursor;
1393
+ var result = interpolation(mergedProps);
1394
+ cursor = previousCursor;
1395
+ return handleInterpolation(mergedProps, registered, result);
1396
+ }
1397
+ break;
1398
+ }
1399
+ } // finalize string values (regular strings and functions interpolated into css calls)
1400
+
1401
+ var asString = interpolation;
1402
+ if (registered == null) {
1403
+ return asString;
1404
+ }
1405
+ var cached = registered[asString];
1406
+ return cached !== undefined ? cached : asString;
1407
+ }
1408
+ function createStringFromObject(mergedProps, registered, obj) {
1409
+ var string = '';
1410
+ if (Array.isArray(obj)) {
1411
+ for (var i = 0; i < obj.length; i++) {
1412
+ string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
1413
+ }
1414
+ } else {
1415
+ for (var key in obj) {
1416
+ var value = obj[key];
1417
+ if (typeof value !== 'object') {
1418
+ var asString = value;
1419
+ if (registered != null && registered[asString] !== undefined) {
1420
+ string += key + "{" + registered[asString] + "}";
1421
+ } else if (isProcessableValue(asString)) {
1422
+ string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
1423
+ }
1424
+ } else {
1425
+ if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment) {
1426
+ throw new Error(noComponentSelectorMessage);
1427
+ }
1428
+ if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
1429
+ for (var _i = 0; _i < value.length; _i++) {
1430
+ if (isProcessableValue(value[_i])) {
1431
+ string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
1432
+ }
1433
+ }
1434
+ } else {
1435
+ var interpolated = handleInterpolation(mergedProps, registered, value);
1436
+ switch (key) {
1437
+ case 'animation':
1438
+ case 'animationName':
1439
+ {
1440
+ string += processStyleName(key) + ":" + interpolated + ";";
1441
+ break;
188
1442
  }
189
- default: {
190
- return theme.size[6];
1443
+ default:
1444
+ {
1445
+ string += key + "{" + interpolated + "}";
191
1446
  }
192
1447
  }
193
- }, [arrowSize]);
194
- return (jsxRuntime.jsxs(ctDesignContainer.Container, __assign({ position: 'relative', onMouseEnter: onHover(HOVER_TYPE.ENTER), onMouseLeave: onHover(HOVER_TYPE.LEAVE), className: containerClassname, ref: horizontalScrollRef }, root, { children: [showShadow && shadowDirection.left && (jsxRuntime.jsx(StyledLeftShadow, __assign({ width: leftShadowWidth, shadowGradientStyle: shadowGradientStyle }, leftShadowWrapper, { children: showArrow && isHovering && (jsxRuntime.jsx(ctDesignContainer.Container, __assign({ display: 'flex', justifyContent: 'center', alignItems: 'center', cursor: 'pointer', paddingLeft: theme.spacing[4], onClick: onArrowClick(exports.ARROW_DIRECTION.LEFT) }, leftShadowContainer, { children: jsxRuntime.jsx(ctDesignIcons.LeftChevronWithBoundingBox, __assign({ height: arrowDimension, width: arrowDimension }, leftChevron)) }))) }))), jsxRuntime.jsx(StyledHorizontalScroll, __assign({ ref: parentContainerRef, className: (scrollWrapper === null || scrollWrapper === void 0 ? void 0 : scrollWrapper.className) || className, css: scrollWrapper === null || scrollWrapper === void 0 ? void 0 : scrollWrapper.css }, { children: jsxRuntime.jsx(ctDesignContainer.Container, __assign({ className: (childrenContainer === null || childrenContainer === void 0 ? void 0 : childrenContainer.className) || childrenClassname, ref: childContainerRef, css: childrenContainer === null || childrenContainer === void 0 ? void 0 : childrenContainer.css, display: 'flex' }, { children: children })) })), showShadow && shadowDirection.right && (jsxRuntime.jsx(StyledRightShadow, __assign({ width: rightShadowWidth, shadowGradientStyle: shadowGradientStyle }, rightShadowWrapper, { children: showArrow && isHovering && (jsxRuntime.jsx(ctDesignContainer.Container, __assign({ display: 'flex', justifyContent: 'center', alignItems: 'center', cursor: 'pointer', paddingRight: theme.spacing[4], onClick: onArrowClick(exports.ARROW_DIRECTION.RIGHT) }, rightShadowContainer, { children: jsxRuntime.jsx(ctDesignIcons.RightChevronWithBoundingBox, __assign({ height: arrowDimension, width: arrowDimension }, rightChevron)) }))) })))] })));
1448
+ }
1449
+ }
1450
+ }
1451
+ }
1452
+ return string;
1453
+ }
1454
+ var labelPattern = /label:\s*([^\s;{]+)\s*(;|$)/g; // this is the cursor for keyframes
1455
+ // keyframes are stored on the SerializedStyles object as a linked list
1456
+
1457
+ var cursor;
1458
+ function serializeStyles(args, registered, mergedProps) {
1459
+ if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
1460
+ return args[0];
1461
+ }
1462
+ var stringMode = true;
1463
+ var styles = '';
1464
+ cursor = undefined;
1465
+ var strings = args[0];
1466
+ if (strings == null || strings.raw === undefined) {
1467
+ stringMode = false;
1468
+ styles += handleInterpolation(mergedProps, registered, strings);
1469
+ } else {
1470
+ var asTemplateStringsArr = strings;
1471
+ styles += asTemplateStringsArr[0];
1472
+ } // we start at 1 since we've already handled the first arg
1473
+
1474
+ for (var i = 1; i < args.length; i++) {
1475
+ styles += handleInterpolation(mergedProps, registered, args[i]);
1476
+ if (stringMode) {
1477
+ var templateStringsArr = strings;
1478
+ styles += templateStringsArr[i];
1479
+ }
1480
+ } // using a global regex with .exec is stateful so lastIndex has to be reset each time
1481
+
1482
+ labelPattern.lastIndex = 0;
1483
+ var identifierName = '';
1484
+ var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
1485
+
1486
+ while ((match = labelPattern.exec(styles)) !== null) {
1487
+ identifierName += '-' + match[1];
1488
+ }
1489
+ var name = murmur2(styles) + identifierName;
1490
+ return {
1491
+ name: name,
1492
+ styles: styles,
1493
+ next: cursor
195
1494
  };
196
- HorizontalScroll.defaultProps = {
197
- children: null,
198
- className: '',
1495
+ }
1496
+
1497
+ var isBrowser = typeof document !== 'undefined';
1498
+ function getRegisteredStyles(registered, registeredStyles, classNames) {
1499
+ var rawClassName = '';
1500
+ classNames.split(' ').forEach(function (className) {
1501
+ if (registered[className] !== undefined) {
1502
+ registeredStyles.push(registered[className] + ";");
1503
+ } else if (className) {
1504
+ rawClassName += className + " ";
1505
+ }
1506
+ });
1507
+ return rawClassName;
1508
+ }
1509
+ var registerStyles = function registerStyles(cache, serialized, isStringTag) {
1510
+ var className = cache.key + "-" + serialized.name;
1511
+ if (
1512
+ // we only need to add the styles to the registered cache if the
1513
+ // class name could be used further down
1514
+ // the tree but if it's a string tag, we know it won't
1515
+ // so we don't have to add it to registered cache.
1516
+ // this improves memory usage since we can avoid storing the whole style string
1517
+ (isStringTag === false ||
1518
+ // we need to always store it if we're in compat mode and
1519
+ // in node since emotion-server relies on whether a style is in
1520
+ // the registered cache to know whether a style is global or not
1521
+ // also, note that this check will be dead code eliminated in the browser
1522
+ isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
1523
+ cache.registered[className] = serialized.styles;
1524
+ }
1525
+ };
1526
+ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
1527
+ registerStyles(cache, serialized, isStringTag);
1528
+ var className = cache.key + "-" + serialized.name;
1529
+ if (cache.inserted[serialized.name] === undefined) {
1530
+ var stylesForSSR = '';
1531
+ var current = serialized;
1532
+ do {
1533
+ var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
1534
+ if (!isBrowser && maybeStyles !== undefined) {
1535
+ stylesForSSR += maybeStyles;
1536
+ }
1537
+ current = current.next;
1538
+ } while (current !== undefined);
1539
+ if (!isBrowser && stylesForSSR.length !== 0) {
1540
+ return stylesForSSR;
1541
+ }
1542
+ }
1543
+ };
1544
+
1545
+ function insertWithoutScoping(cache, serialized) {
1546
+ if (cache.inserted[serialized.name] === undefined) {
1547
+ return cache.insert('', serialized, cache.sheet, true);
1548
+ }
1549
+ }
1550
+ function merge(registered, css, className) {
1551
+ var registeredStyles = [];
1552
+ var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
1553
+ if (registeredStyles.length < 2) {
1554
+ return className;
1555
+ }
1556
+ return rawClassName + css(registeredStyles);
1557
+ }
1558
+ var createEmotion = function createEmotion(options) {
1559
+ var cache = createCache(options);
1560
+ cache.sheet.speedy = function (value) {
1561
+ this.isSpeedy = value;
1562
+ };
1563
+ cache.compat = true;
1564
+ var css = function css() {
1565
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1566
+ args[_key] = arguments[_key];
1567
+ }
1568
+ var serialized = serializeStyles(args, cache.registered, undefined);
1569
+ insertStyles(cache, serialized, false);
1570
+ return cache.key + "-" + serialized.name;
1571
+ };
1572
+ var keyframes = function keyframes() {
1573
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1574
+ args[_key2] = arguments[_key2];
1575
+ }
1576
+ var serialized = serializeStyles(args, cache.registered);
1577
+ var animation = "animation-" + serialized.name;
1578
+ insertWithoutScoping(cache, {
1579
+ name: serialized.name,
1580
+ styles: "@keyframes " + animation + "{" + serialized.styles + "}"
1581
+ });
1582
+ return animation;
1583
+ };
1584
+ var injectGlobal = function injectGlobal() {
1585
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
1586
+ args[_key3] = arguments[_key3];
1587
+ }
1588
+ var serialized = serializeStyles(args, cache.registered);
1589
+ insertWithoutScoping(cache, serialized);
199
1590
  };
1591
+ var cx = function cx() {
1592
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
1593
+ args[_key4] = arguments[_key4];
1594
+ }
1595
+ return merge(cache.registered, css, classnames(args));
1596
+ };
1597
+ return {
1598
+ css: css,
1599
+ cx: cx,
1600
+ injectGlobal: injectGlobal,
1601
+ keyframes: keyframes,
1602
+ hydrate: function hydrate(ids) {
1603
+ ids.forEach(function (key) {
1604
+ cache.inserted[key] = true;
1605
+ });
1606
+ },
1607
+ flush: function flush() {
1608
+ cache.registered = {};
1609
+ cache.inserted = {};
1610
+ cache.sheet.flush();
1611
+ },
1612
+ sheet: cache.sheet,
1613
+ cache: cache,
1614
+ getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered),
1615
+ merge: merge.bind(null, cache.registered, css)
1616
+ };
1617
+ };
1618
+ var classnames = function classnames(args) {
1619
+ var cls = '';
1620
+ for (var i = 0; i < args.length; i++) {
1621
+ var arg = args[i];
1622
+ if (arg == null) continue;
1623
+ var toAdd = void 0;
1624
+ switch (typeof arg) {
1625
+ case 'boolean':
1626
+ break;
1627
+ case 'object':
1628
+ {
1629
+ if (Array.isArray(arg)) {
1630
+ toAdd = classnames(arg);
1631
+ } else {
1632
+ toAdd = '';
1633
+ for (var k in arg) {
1634
+ if (arg[k] && k) {
1635
+ toAdd && (toAdd += ' ');
1636
+ toAdd += k;
1637
+ }
1638
+ }
1639
+ }
1640
+ break;
1641
+ }
1642
+ default:
1643
+ {
1644
+ toAdd = arg;
1645
+ }
1646
+ }
1647
+ if (toAdd) {
1648
+ cls && (cls += ' ');
1649
+ cls += toAdd;
1650
+ }
1651
+ }
1652
+ return cls;
1653
+ };
1654
+
1655
+ var _createEmotion = createEmotion({
1656
+ key: 'css'
1657
+ }),
1658
+ css = _createEmotion.css;
1659
+
1660
+ const horizontalScrollStyles = css `
1661
+ display: flex;
1662
+ white-space: no-wrap;
1663
+ overflow-x: auto;
1664
+ scroll-behavior: smooth;
1665
+ -webkit-tap-highlight-color: transparent;
1666
+ scrollbar-width: none; /* Firefox */
1667
+ -ms-overflow-style: none; /* Internet Explorer 10+ */
1668
+
1669
+ &::-webkit-scrollbar {
1670
+ /* WebKit */
1671
+ display: none;
1672
+ }
1673
+ `;
1674
+ const HorizontalScroll = react.forwardRef(({ children, styleConfig = {}, onScroll }, forwardRef) => {
1675
+ const { root, childContainer } = styleConfig;
1676
+ const horizontalScrollRef = react.useRef(null);
1677
+ const parentContainerRef = react.useRef(null);
1678
+ const childContainerRef = react.useRef(null);
1679
+ const combinedParentContainerRef = useMergeRefs__default.default(parentContainerRef, forwardRef);
1680
+ const combinedParenAndChildContainerRef = useMergeRefs__default.default(parentContainerRef, childContainerRef);
1681
+ const rootStyles = ctDesignStyleManager.useWebMergeStyles([...(root || []), horizontalScrollStyles], [root]);
1682
+ const handleScroll = (event) => {
1683
+ onScroll === null || onScroll === void 0 ? void 0 : onScroll({
1684
+ nativeEvent: {
1685
+ contentOffset: { x: event.currentTarget.scrollLeft, y: event.currentTarget.scrollTop },
1686
+ layoutMeasurement: { height: event.currentTarget.clientHeight, width: event.currentTarget.clientWidth },
1687
+ contentSize: { height: event.currentTarget.scrollHeight, width: event.currentTarget.scrollWidth },
1688
+ },
1689
+ });
1690
+ };
1691
+ return (jsxRuntime.jsx("div", { ref: horizontalScrollRef, onScroll: handleScroll, children: jsxRuntime.jsx("div", { ref: combinedParentContainerRef, className: rootStyles, children: jsxRuntime.jsx(ctDesignContainer.Container, { styleConfig: { root: childContainer }, ref: combinedParenAndChildContainerRef, children: children }) }) }));
1692
+ });
1693
+ HorizontalScroll.displayName = 'HorizontalScroll';
1694
+
1695
+ exports.ARROW_DIRECTION = void 0;
1696
+ (function (ARROW_DIRECTION) {
1697
+ ARROW_DIRECTION["LEFT"] = "LEFT";
1698
+ ARROW_DIRECTION["RIGHT"] = "RIGHT";
1699
+ })(exports.ARROW_DIRECTION || (exports.ARROW_DIRECTION = {}));
1700
+ exports.ARROW_SIZE = void 0;
1701
+ (function (ARROW_SIZE) {
1702
+ ARROW_SIZE["SM"] = "sm";
1703
+ ARROW_SIZE["MD"] = "md";
1704
+ ARROW_SIZE["LG"] = "lg";
1705
+ })(exports.ARROW_SIZE || (exports.ARROW_SIZE = {}));
200
1706
 
201
- exports.HorizontalScroll = HorizontalScroll;
202
- exports.StyledHorizontalScroll = StyledHorizontalScroll;
1707
+ exports.HorizontalScroll = HorizontalScroll;
203
1708
 
204
1709
  }));
205
1710
  //# sourceMappingURL=ct-design-horizontal-scroll.umd.js.map