@helpdice/ui 1.7.5 → 1.7.8

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 (304) hide show
  1. package/dist/CurrencyInput/index.js +2981 -0
  2. package/dist/LinearProgress/index.d.ts +2 -0
  3. package/dist/{css-baseline → LinearProgress}/index.js +25 -317
  4. package/dist/LinearProgress/linear-progress.d.ts +9 -0
  5. package/dist/Loadable/index.js +570 -0
  6. package/dist/PhoneInput/index.js +2136 -314
  7. package/dist/Placeholder/index.js +2116 -254
  8. package/dist/auto-complete/index.js +2145 -652
  9. package/dist/avatar/index.js +2119 -333
  10. package/dist/badge/index.js +2117 -331
  11. package/dist/breadcrumbs/index.js +2126 -340
  12. package/dist/button/button.compact.d.ts +2 -0
  13. package/dist/button/index.js +2214 -342
  14. package/dist/button-dropdown/index.js +2120 -291
  15. package/dist/button-group/index.js +2117 -331
  16. package/dist/capacity/index.js +2117 -331
  17. package/dist/card/index.js +2127 -298
  18. package/dist/checkbox/index.js +2119 -290
  19. package/dist/code/index.js +2116 -297
  20. package/dist/collapse/index.js +2117 -475
  21. package/dist/description/index.js +2117 -331
  22. package/dist/display/index.js +2117 -331
  23. package/dist/divider/index.js +2118 -332
  24. package/dist/dot/index.js +2117 -331
  25. package/dist/drawer/index.js +2129 -439
  26. package/dist/fieldset/index.js +2121 -354
  27. package/dist/grid/index.js +2119 -333
  28. package/dist/image/index.js +2122 -336
  29. package/dist/index.d.ts +2 -14
  30. package/dist/index.js +3175 -1879
  31. package/dist/input/index.js +2125 -296
  32. package/dist/keyboard/index.js +2116 -297
  33. package/dist/link/index.js +2117 -331
  34. package/dist/list/index.js +2119 -333
  35. package/dist/loading/index.js +2117 -331
  36. package/dist/menu/index.js +77 -45
  37. package/dist/modal/index.js +2145 -452
  38. package/dist/note/index.js +2117 -331
  39. package/dist/page/index.js +2117 -331
  40. package/dist/pagination/index.js +2118 -351
  41. package/dist/popover/index.js +2123 -354
  42. package/dist/progress/index.js +2117 -331
  43. package/dist/radio/index.js +2120 -334
  44. package/dist/rating/index.js +2118 -332
  45. package/dist/row/index.js +2115 -296
  46. package/dist/select/index.js +2151 -688
  47. package/dist/slider/index.js +2123 -356
  48. package/dist/snippet/index.js +2118 -421
  49. package/dist/spacer/index.js +2115 -296
  50. package/dist/spinner/index.js +2117 -331
  51. package/dist/table/index.js +2341 -754
  52. package/dist/tabs/index.js +2123 -344
  53. package/dist/tag/index.js +2116 -254
  54. package/dist/text/index.js +2116 -297
  55. package/dist/textarea/index.js +2117 -288
  56. package/dist/toggle/index.js +2117 -331
  57. package/dist/tooltip/index.js +2120 -351
  58. package/dist/tree/index.js +2123 -459
  59. package/dist/use-input/index.js +2122 -24
  60. package/dist/use-modal/index.js +2122 -24
  61. package/dist/use-network-status/index.d.ts +2 -0
  62. package/dist/{use-current-state → use-network-status}/index.js +22 -15
  63. package/dist/use-network-status/use-netowork-status.d.ts +4 -0
  64. package/dist/use-scale/index.js +2115 -296
  65. package/dist/use-tabs/index.js +2122 -24
  66. package/dist/user/index.js +2123 -337
  67. package/esm/CurrencyInput/components/CurrencyInput.js +342 -0
  68. package/esm/CurrencyInput/components/CurrencyInputProps.js +1 -0
  69. package/esm/CurrencyInput/components/utils/addSeparators.js +7 -0
  70. package/esm/CurrencyInput/components/utils/cleanValue.js +69 -0
  71. package/esm/CurrencyInput/components/utils/escapeRegExp.js +8 -0
  72. package/esm/CurrencyInput/components/utils/fixedDecimalValue.js +29 -0
  73. package/esm/CurrencyInput/components/utils/formatValue.js +124 -0
  74. package/esm/CurrencyInput/components/utils/getLocaleConfig.js +47 -0
  75. package/esm/CurrencyInput/components/utils/getSuffix.js +10 -0
  76. package/esm/CurrencyInput/components/utils/index.js +8 -0
  77. package/esm/CurrencyInput/components/utils/isNumber.js +3 -0
  78. package/esm/CurrencyInput/components/utils/padTrimValue.js +27 -0
  79. package/esm/CurrencyInput/components/utils/parseAbbrValue.js +43 -0
  80. package/esm/CurrencyInput/components/utils/removeInvalidChars.js +10 -0
  81. package/esm/CurrencyInput/components/utils/removeSeparators.js +10 -0
  82. package/esm/CurrencyInput/components/utils/repositionCursor.js +35 -0
  83. package/esm/CurrencyInput/index.js +4 -0
  84. package/esm/LinearProgress/index.d.ts +2 -0
  85. package/esm/LinearProgress/index.js +2 -0
  86. package/esm/LinearProgress/linear-progress.d.ts +9 -0
  87. package/esm/LinearProgress/linear-progress.js +28 -0
  88. package/esm/Loadable/index.js +2 -0
  89. package/esm/PhoneInput/phone.js +22 -19
  90. package/esm/auto-complete/auto-complete-dropdown.js +1 -3
  91. package/esm/auto-complete/auto-complete-item.js +1 -3
  92. package/esm/auto-complete/auto-complete-searching.js +1 -1
  93. package/esm/auto-complete/auto-complete.js +1 -1
  94. package/esm/avatar/avatar-group.js +1 -2
  95. package/esm/avatar/avatar.js +1 -2
  96. package/esm/badge/badge.js +1 -2
  97. package/esm/breadcrumbs/breadcrumbs-item.js +1 -1
  98. package/esm/breadcrumbs/breadcrumbs-separator.js +1 -1
  99. package/esm/breadcrumbs/breadcrumbs.js +1 -1
  100. package/esm/button/button-icon.js +1 -1
  101. package/esm/button/button.compact.d.ts +2 -0
  102. package/esm/button/button.compact.js +94 -50
  103. package/esm/button/button.js +1 -2
  104. package/esm/button/utils.js +1 -1
  105. package/esm/button-dropdown/button-dropdown-item.js +1 -1
  106. package/esm/button-dropdown/button-dropdown.js +1 -2
  107. package/esm/button-group/button-group.js +1 -2
  108. package/esm/capacity/capacity.js +1 -2
  109. package/esm/card/card-content.js +1 -1
  110. package/esm/card/card-footer.js +1 -2
  111. package/esm/card/card.js +1 -2
  112. package/esm/carousal/Arrow.js +18 -0
  113. package/esm/carousal/Indicator.js +20 -0
  114. package/esm/carousal/Thumbs.js +302 -0
  115. package/esm/carousal/animations.js +162 -0
  116. package/esm/carousal/index.js +683 -0
  117. package/esm/carousal/types.js +1 -0
  118. package/esm/carousal/utils.js +49 -0
  119. package/esm/checkbox/checkbox-group.js +1 -1
  120. package/esm/checkbox/checkbox.icon.js +1 -1
  121. package/esm/checkbox/checkbox.js +1 -2
  122. package/esm/code/code.js +1 -1
  123. package/esm/collapse/collapse-group.js +1 -2
  124. package/esm/collapse/collapse.js +1 -4
  125. package/esm/description/description.js +1 -2
  126. package/esm/display/display.js +1 -2
  127. package/esm/divider/divider.js +1 -2
  128. package/esm/dot/dot.js +1 -2
  129. package/esm/drawer/drawer-wrapper.js +1 -3
  130. package/esm/drawer/drawer.js +1 -1
  131. package/esm/fieldset/fieldset-content.js +1 -1
  132. package/esm/fieldset/fieldset-footer.js +1 -1
  133. package/esm/fieldset/fieldset-group.js +1 -3
  134. package/esm/fieldset/fieldset-title.js +1 -1
  135. package/esm/fieldset/fieldset.js +1 -2
  136. package/esm/grid/basic-item.js +1 -2
  137. package/esm/grid/grid-container.js +1 -1
  138. package/esm/grid/grid.js +1 -1
  139. package/esm/image/image-browser.js +1 -2
  140. package/esm/image/image.js +1 -2
  141. package/esm/image/image.skeleton.js +1 -1
  142. package/esm/index.d.ts +2 -14
  143. package/esm/index.js +5 -9
  144. package/esm/input/input-block-label.js +1 -1
  145. package/esm/input/input-icon-clear.js +1 -2
  146. package/esm/input/input-label.js +1 -1
  147. package/esm/input/input.js +1 -2
  148. package/esm/keyboard/keyboard.js +1 -1
  149. package/esm/link/link.js +1 -2
  150. package/esm/list/list-item.js +1 -2
  151. package/esm/loading/loading.js +1 -2
  152. package/esm/modal/modal-action.js +1 -2
  153. package/esm/modal/modal-actions.js +1 -1
  154. package/esm/modal/modal-content.js +1 -1
  155. package/esm/modal/modal-subtitle.js +1 -1
  156. package/esm/modal/modal-title.js +1 -1
  157. package/esm/modal/modal-wrapper.js +1 -3
  158. package/esm/modal/modal.js +1 -1
  159. package/esm/note/note.js +1 -2
  160. package/esm/page/page-header.js +1 -1
  161. package/esm/page/page.js +1 -1
  162. package/esm/pagination/pagination-item.js +1 -2
  163. package/esm/pagination/pagination.js +1 -1
  164. package/esm/popover/popover-item.js +1 -2
  165. package/esm/popover/popover.js +1 -1
  166. package/esm/progress/progress.js +1 -2
  167. package/esm/radio/radio-description.js +1 -1
  168. package/esm/radio/radio-group.js +1 -1
  169. package/esm/radio/radio.js +1 -2
  170. package/esm/rating/rating.js +1 -2
  171. package/esm/row/row.js +1 -1
  172. package/esm/select/select-dropdown.js +1 -3
  173. package/esm/select/select-icon-clear.js +1 -1
  174. package/esm/select/select-multiple-value.js +1 -1
  175. package/esm/select/select-option.js +1 -3
  176. package/esm/select/select.js +9 -12
  177. package/esm/slider/slider-dot.js +1 -2
  178. package/esm/slider/slider-mark.js +1 -1
  179. package/esm/slider/slider.js +1 -3
  180. package/esm/snippet/snippet.js +1 -3
  181. package/esm/spinner/spinner.js +1 -2
  182. package/esm/table/table-body.js +1 -2
  183. package/esm/table/table-head.js +3 -2
  184. package/esm/tabs/tabs-item.js +1 -2
  185. package/esm/tabs/tabs.js +1 -3
  186. package/esm/tag/tag.js +1 -1
  187. package/esm/text/child.js +1 -1
  188. package/esm/textarea/textarea.js +1 -2
  189. package/esm/toggle/toggle.js +1 -2
  190. package/esm/tooltip/tooltip-content.js +1 -3
  191. package/esm/tooltip/tooltip-icon.js +1 -1
  192. package/esm/tooltip/tooltip.js +1 -1
  193. package/esm/tree/tree-file-icon.js +1 -1
  194. package/esm/tree/tree-file.js +1 -2
  195. package/esm/tree/tree-folder-icon.js +1 -1
  196. package/esm/tree/tree-folder.js +1 -3
  197. package/esm/tree/tree-status-icon.js +1 -1
  198. package/esm/tree/tree.js +1 -1
  199. package/esm/use-input/use-input.js +1 -1
  200. package/esm/use-modal/use-modal.js +1 -1
  201. package/esm/use-network-status/index.d.ts +2 -0
  202. package/esm/use-network-status/index.js +2 -0
  203. package/esm/use-network-status/use-netowork-status.d.ts +4 -0
  204. package/esm/use-network-status/use-netowork-status.js +29 -0
  205. package/esm/use-scale/with-scale.js +1 -1
  206. package/esm/use-tabs/use-tabs.js +1 -1
  207. package/esm/user/user.js +1 -2
  208. package/esm/utils/use-context-state/use-context-state.js +1 -1
  209. package/esm/utils/use-drag.js +1 -1
  210. package/package.json +12 -4
  211. package/dist/css-baseline/css-baseline.d.ts +0 -9
  212. package/dist/css-baseline/index.d.ts +0 -1
  213. package/dist/shared/backdrop.d.ts +0 -14
  214. package/dist/shared/css-transition.d.ts +0 -13
  215. package/dist/shared/dropdown.d.ts +0 -9
  216. package/dist/shared/ellipsis.d.ts +0 -6
  217. package/dist/shared/expand.d.ts +0 -7
  218. package/dist/shared/highlight.d.ts +0 -13
  219. package/dist/ui-provider/index.d.ts +0 -3
  220. package/dist/ui-provider/index.js +0 -2186
  221. package/dist/ui-provider/theme-provider.d.ts +0 -8
  222. package/dist/ui-provider/ui-provider.d.ts +0 -8
  223. package/dist/use-all-themes/all-themes-context.d.ts +0 -7
  224. package/dist/use-all-themes/index.d.ts +0 -3
  225. package/dist/use-all-themes/index.js +0 -311
  226. package/dist/use-classes/index.d.ts +0 -2
  227. package/dist/use-classes/index.js +0 -48
  228. package/dist/use-classes/use-classes.d.ts +0 -4
  229. package/dist/use-current-state/index.d.ts +0 -2
  230. package/dist/use-current-state/use-current-state.d.ts +0 -4
  231. package/dist/use-media-query/index.d.ts +0 -3
  232. package/dist/use-media-query/index.js +0 -444
  233. package/dist/use-media-query/use-media-query.d.ts +0 -12
  234. package/dist/use-theme/index.d.ts +0 -2
  235. package/dist/use-theme/index.js +0 -309
  236. package/dist/use-theme/theme-context.d.ts +0 -4
  237. package/dist/use-toasts/helpers.d.ts +0 -18
  238. package/dist/use-toasts/index.d.ts +0 -3
  239. package/dist/use-toasts/index.js +0 -204
  240. package/dist/use-toasts/toast-container.d.ts +0 -3
  241. package/dist/use-toasts/toast-item.d.ts +0 -8
  242. package/dist/use-toasts/use-toast.d.ts +0 -40
  243. package/dist/utils/use-current-state.d.ts +0 -2
  244. package/dist/utils/use-dom-observer.d.ts +0 -3
  245. package/dist/utils/use-hd-ui-context.d.ts +0 -16
  246. package/dist/utils/use-previous.d.ts +0 -2
  247. package/esm/captcha/index.js +0 -128
  248. package/esm/css-baseline/css-baseline.d.ts +0 -9
  249. package/esm/css-baseline/css-baseline.js +0 -23
  250. package/esm/css-baseline/index.d.ts +0 -1
  251. package/esm/css-baseline/index.js +0 -2
  252. package/esm/shared/backdrop.d.ts +0 -14
  253. package/esm/shared/backdrop.js +0 -66
  254. package/esm/shared/css-transition.d.ts +0 -13
  255. package/esm/shared/css-transition.js +0 -65
  256. package/esm/shared/dropdown.d.ts +0 -9
  257. package/esm/shared/dropdown.js +0 -99
  258. package/esm/shared/ellipsis.d.ts +0 -6
  259. package/esm/shared/ellipsis.js +0 -13
  260. package/esm/shared/expand.d.ts +0 -7
  261. package/esm/shared/expand.js +0 -86
  262. package/esm/shared/highlight.d.ts +0 -13
  263. package/esm/shared/highlight.js +0 -46
  264. package/esm/ui-provider/index.d.ts +0 -3
  265. package/esm/ui-provider/index.js +0 -4
  266. package/esm/ui-provider/theme-provider.d.ts +0 -8
  267. package/esm/ui-provider/theme-provider.js +0 -45
  268. package/esm/ui-provider/ui-provider.d.ts +0 -8
  269. package/esm/ui-provider/ui-provider.js +0 -55
  270. package/esm/use-all-themes/all-themes-context.d.ts +0 -7
  271. package/esm/use-all-themes/all-themes-context.js +0 -11
  272. package/esm/use-all-themes/index.d.ts +0 -3
  273. package/esm/use-all-themes/index.js +0 -2
  274. package/esm/use-classes/index.d.ts +0 -2
  275. package/esm/use-classes/index.js +0 -2
  276. package/esm/use-classes/use-classes.d.ts +0 -4
  277. package/esm/use-classes/use-classes.js +0 -34
  278. package/esm/use-current-state/index.d.ts +0 -2
  279. package/esm/use-current-state/index.js +0 -2
  280. package/esm/use-current-state/use-current-state.d.ts +0 -4
  281. package/esm/use-current-state/use-current-state.js +0 -23
  282. package/esm/use-media-query/index.d.ts +0 -3
  283. package/esm/use-media-query/index.js +0 -2
  284. package/esm/use-media-query/use-media-query.d.ts +0 -12
  285. package/esm/use-media-query/use-media-query.js +0 -81
  286. package/esm/use-theme/index.d.ts +0 -2
  287. package/esm/use-theme/index.js +0 -2
  288. package/esm/use-theme/theme-context.d.ts +0 -4
  289. package/esm/use-theme/theme-context.js +0 -9
  290. package/esm/use-toasts/helpers.d.ts +0 -18
  291. package/esm/use-toasts/helpers.js +0 -68
  292. package/esm/use-toasts/index.d.ts +0 -3
  293. package/esm/use-toasts/index.js +0 -2
  294. package/esm/use-toasts/toast-container.d.ts +0 -3
  295. package/esm/use-toasts/toast-container.js +0 -120
  296. package/esm/use-toasts/toast-item.d.ts +0 -8
  297. package/esm/use-toasts/toast-item.js +0 -45
  298. package/esm/use-toasts/use-toast.d.ts +0 -40
  299. package/esm/use-toasts/use-toast.js +0 -103
  300. package/esm/utils/use-current-state.d.ts +0 -2
  301. package/esm/utils/use-current-state.js +0 -2
  302. package/esm/utils/use-dom-observer.d.ts +0 -3
  303. package/esm/utils/use-hd-ui-context.d.ts +0 -16
  304. package/esm/utils/use-previous.d.ts +0 -2
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
+ var require$$1 = require('react-dom');
6
7
 
7
8
  function _arrayLikeToArray(r, a) {
8
9
  (null == a || a > r.length) && (a = r.length);
@@ -15,14 +16,6 @@ function _arrayWithHoles(r) {
15
16
  function _arrayWithoutHoles(r) {
16
17
  if (Array.isArray(r)) return _arrayLikeToArray(r);
17
18
  }
18
- function _defineProperty(e, r, t) {
19
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
20
- value: t,
21
- enumerable: true,
22
- configurable: true,
23
- writable: true
24
- }) : e[r] = t, e;
25
- }
26
19
  function _extends() {
27
20
  return _extends = Object.assign ? Object.assign.bind() : function (n) {
28
21
  for (var e = 1; e < arguments.length; e++) {
@@ -65,27 +58,6 @@ function _nonIterableRest() {
65
58
  function _nonIterableSpread() {
66
59
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
67
60
  }
68
- function ownKeys(e, r) {
69
- var t = Object.keys(e);
70
- if (Object.getOwnPropertySymbols) {
71
- var o = Object.getOwnPropertySymbols(e);
72
- r && (o = o.filter(function (r) {
73
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
74
- })), t.push.apply(t, o);
75
- }
76
- return t;
77
- }
78
- function _objectSpread2(e) {
79
- for (var r = 1; r < arguments.length; r++) {
80
- var t = null != arguments[r] ? arguments[r] : {};
81
- r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
82
- _defineProperty(e, r, t[r]);
83
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
84
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
85
- });
86
- }
87
- return e;
88
- }
89
61
  function _objectWithoutProperties(e, t) {
90
62
  if (null == e) return {};
91
63
  var o,
@@ -112,29 +84,6 @@ function _slicedToArray(r, e) {
112
84
  function _toConsumableArray(r) {
113
85
  return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
114
86
  }
115
- function _toPrimitive(t, r) {
116
- if ("object" != typeof t || !t) return t;
117
- var e = t[Symbol.toPrimitive];
118
- if (void 0 !== e) {
119
- var i = e.call(t, r);
120
- if ("object" != typeof i) return i;
121
- throw new TypeError("@@toPrimitive must return a primitive value.");
122
- }
123
- return ("string" === r ? String : Number)(t);
124
- }
125
- function _toPropertyKey(t) {
126
- var i = _toPrimitive(t, "string");
127
- return "symbol" == typeof i ? i : i + "";
128
- }
129
- function _typeof(o) {
130
- "@babel/helpers - typeof";
131
-
132
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
133
- return typeof o;
134
- } : function (o) {
135
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
136
- }, _typeof(o);
137
- }
138
87
  function _unsupportedIterableToArray(r, a) {
139
88
  if (r) {
140
89
  if ("string" == typeof r) return _arrayLikeToArray(r, a);
@@ -686,254 +635,2124 @@ function requireStyle () {
686
635
  var styleExports = requireStyle();
687
636
  var _JSXStyle = /*@__PURE__*/getDefaultExportFromCjs(styleExports);
688
637
 
689
- var defaultFont = {
690
- sans: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
691
- mono: 'Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace',
692
- prism: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,"Liberation Mono", "Courier New", monospace'
693
- };
694
- var defaultBreakpoints = {
695
- xs: {
696
- min: '0',
697
- max: '650px'
698
- },
699
- sm: {
700
- min: '650px',
701
- max: '900px'
702
- },
703
- md: {
704
- min: '900px',
705
- max: '1280px'
706
- },
707
- lg: {
708
- min: '1280px',
709
- max: '1920px'
710
- },
711
- xl: {
712
- min: '1920px',
713
- max: '10000px'
714
- }
715
- };
716
- var defaultLayout = {
717
- gap: '16pt',
718
- gapNegative: '-16pt',
719
- gapHalf: '8pt',
720
- gapHalfNegative: '-8pt',
721
- gapQuarter: '4pt',
722
- gapQuarterNegative: '-4pt',
723
- pageMargin: '16pt',
724
- pageWidth: '750pt',
725
- pageWidthWithMargin: '782pt',
726
- breakpointMobile: defaultBreakpoints.xs.max,
727
- breakpointTablet: defaultBreakpoints.sm.max,
728
- radius: '6px',
729
- unit: '16px'
730
- };
638
+ var dist = {};
731
639
 
732
- var palette$1 = {
733
- accents_1: '#fafafa',
734
- accents_2: '#eaeaea',
735
- accents_3: '#999',
736
- accents_4: '#888',
737
- accents_5: '#666',
738
- accents_6: '#444',
739
- accents_7: '#333',
740
- accents_8: '#111',
741
- background: '#fff',
742
- foreground: '#000',
743
- selection: '#79ffe1',
744
- secondary: '#666',
745
- code: '#f81ce5',
746
- border: '#eaeaea',
747
- error: '#e00',
748
- errorLight: '#ff1a1a',
749
- errorLighter: '#f7d4d6',
750
- errorDark: '#c50000',
751
- success: '#0070f3',
752
- successLight: '#3291ff',
753
- successLighter: '#d3e5ff',
754
- successDark: '#0761d1',
755
- warning: '#f5a623',
756
- warningLight: '#f7b955',
757
- warningLighter: '#ffefcf',
758
- warningDark: '#ab570a',
759
- cyan: '#50e3c2',
760
- cyanLighter: '#aaffec',
761
- cyanLight: '#79ffe1',
762
- cyanDark: '#29bc9b',
763
- violet: '#7928ca',
764
- violetLighter: '#e3d7fc',
765
- violetLight: '#8a63d2',
766
- violetDark: '#4c2889',
767
- purple: '#f81ce5',
768
- alert: '#ff0080',
769
- magenta: '#eb367f',
770
- link: '#0070f3'
771
- };
772
- var expressiveness$1 = {
773
- linkStyle: 'none',
774
- linkHoverStyle: 'none',
775
- dropdownBoxShadow: '0 4px 4px 0 rgba(0, 0, 0, 0.02)',
776
- scrollerStart: 'rgba(255, 255, 255, 1)',
777
- scrollerEnd: 'rgba(255, 255, 255, 0)',
778
- shadowSmall: '0 5px 10px rgba(0, 0, 0, 0.12)',
779
- shadowMedium: '0 8px 30px rgba(0, 0, 0, 0.12)',
780
- shadowLarge: '0 30px 60px rgba(0, 0, 0, 0.12)',
781
- portalOpacity: 0.25
782
- };
783
- var font$1 = defaultFont;
784
- var breakpoints$1 = defaultBreakpoints;
785
- var layout$1 = defaultLayout;
786
- var themes$1 = {
787
- type: 'light',
788
- font: font$1,
789
- layout: layout$1,
790
- palette: palette$1,
791
- breakpoints: breakpoints$1,
792
- expressiveness: expressiveness$1
793
- };
640
+ var hasRequiredDist;
794
641
 
795
- var palette = {
796
- accents_1: '#111',
797
- accents_2: '#333',
798
- accents_3: '#444',
799
- accents_4: '#666',
800
- accents_5: '#888',
801
- accents_6: '#999',
802
- accents_7: '#eaeaea',
803
- accents_8: '#fafafa',
804
- background: '#000',
805
- foreground: '#fff',
806
- selection: '#f81ce5',
807
- secondary: '#888',
808
- code: '#79ffe1',
809
- border: '#333',
810
- error: '#e00',
811
- errorLighter: '#f7d4d6',
812
- errorLight: '#ff1a1a',
813
- errorDark: '#c50000',
814
- success: '#0070f3',
815
- successLighter: '#d3e5ff',
816
- successLight: '#3291ff',
817
- successDark: '#0761d1',
818
- warning: '#f5a623',
819
- warningLighter: '#ffefcf',
820
- warningLight: '#f7b955',
821
- warningDark: '#ab570a',
822
- cyan: '#50e3c2',
823
- cyanLighter: '#aaffec',
824
- cyanLight: '#79ffe1',
825
- cyanDark: '#29bc9b',
826
- violet: '#7928ca',
827
- violetLighter: '#e3d7fc',
828
- violetLight: '#8a63d2',
829
- violetDark: '#4c2889',
830
- purple: '#f81ce5',
831
- alert: '#ff0080',
832
- magenta: '#eb367f',
833
- link: '#3291ff'
834
- };
835
- var expressiveness = {
836
- linkStyle: 'none',
837
- linkHoverStyle: 'none',
838
- dropdownBoxShadow: '0 0 0 1px #333',
839
- scrollerStart: 'rgba(255, 255, 255, 1)',
840
- scrollerEnd: 'rgba(255, 255, 255, 0)',
841
- shadowSmall: '0 0 0 1px #333',
842
- shadowMedium: '0 0 0 1px #333',
843
- shadowLarge: '0 0 0 1px #333',
844
- portalOpacity: 0.75
845
- };
846
- var font = defaultFont;
847
- var breakpoints = defaultBreakpoints;
848
- var layout = defaultLayout;
849
- var themes = {
850
- type: 'dark',
851
- font: font,
852
- layout: layout,
853
- palette: palette,
854
- breakpoints: breakpoints,
855
- expressiveness: expressiveness
856
- };
642
+ function requireDist () {
643
+ if (hasRequiredDist) return dist;
644
+ hasRequiredDist = 1;
857
645
 
858
- var isObject = function isObject(target) {
859
- return target && _typeof(target) === 'object';
860
- };
861
- var _deepDuplicable = function deepDuplicable(source, target) {
862
- if (!isObject(target) || !isObject(source)) return source;
863
- var sourceKeys = Object.keys(source);
864
- var result = {};
865
- for (var _i = 0, _sourceKeys = sourceKeys; _i < _sourceKeys.length; _i++) {
866
- var key = _sourceKeys[_i];
867
- var sourceValue = source[key];
868
- var targetValue = target[key];
869
- if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
870
- result[key] = targetValue.concat(sourceValue);
871
- } else if (isObject(sourceValue) && isObject(targetValue)) {
872
- result[key] = _deepDuplicable(sourceValue, _objectSpread2({}, targetValue));
873
- } else if (targetValue) {
874
- result[key] = targetValue;
875
- } else {
876
- result[key] = sourceValue;
877
- }
878
- }
879
- return result;
880
- };
881
- var getPresets = function getPresets() {
882
- return [themes$1, themes];
883
- };
884
- var getPresetStaticTheme = function getPresetStaticTheme() {
885
- return themes$1;
886
- };
887
- var isAvailableThemeType = function isAvailableThemeType(type) {
888
- if (!type) return false;
889
- var presetThemes = getPresets();
890
- var hasType = presetThemes.find(function (theme) {
891
- return theme.type === type;
892
- });
893
- return !hasType;
894
- };
895
- var isPresetTheme = function isPresetTheme(themeOrType) {
896
- if (!themeOrType) return false;
897
- var isType = typeof themeOrType === 'string';
898
- var type = isType ? themeOrType : themeOrType.type;
899
- return !isAvailableThemeType(type);
900
- };
901
- var hasUserCustomTheme = function hasUserCustomTheme() {
902
- var themes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
903
- return !!themes.find(function (item) {
904
- return isAvailableThemeType(item.type);
905
- });
906
- };
907
- var create = function create(base, custom) {
908
- if (!isAvailableThemeType(custom.type)) {
909
- throw new Error('Duplicate or unavailable theme type');
910
- }
911
- return _deepDuplicable(base, custom);
912
- };
913
- var createFromDark = function createFromDark(custom) {
914
- return create(themes, custom);
915
- };
916
- var createFromLight = function createFromLight(custom) {
917
- return create(themes$1, custom);
918
- };
919
- var Themes = {
920
- isPresetTheme: isPresetTheme,
921
- isAvailableThemeType: isAvailableThemeType,
922
- hasUserCustomTheme: hasUserCustomTheme,
923
- getPresets: getPresets,
924
- getPresetStaticTheme: getPresetStaticTheme,
925
- create: create,
926
- createFromDark: createFromDark,
927
- createFromLight: createFromLight
928
- };
646
+ var React$1 = React;
647
+ var reactDom = require$$1;
929
648
 
930
- /* "use client" */
649
+ function _arrayLikeToArray(r, a) {
650
+ (null == a || a > r.length) && (a = r.length);
651
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
652
+ return n;
653
+ }
654
+ function _arrayWithHoles(r) {
655
+ if (Array.isArray(r)) return r;
656
+ }
657
+ function _arrayWithoutHoles(r) {
658
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
659
+ }
660
+ function _defineProperty(e, r, t) {
661
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
662
+ value: t,
663
+ enumerable: true,
664
+ configurable: true,
665
+ writable: true
666
+ }) : e[r] = t, e;
667
+ }
668
+ function _extends() {
669
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
670
+ for (var e = 1; e < arguments.length; e++) {
671
+ var t = arguments[e];
672
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
673
+ }
674
+ return n;
675
+ }, _extends.apply(null, arguments);
676
+ }
677
+ function _iterableToArray(r) {
678
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
679
+ }
680
+ function _iterableToArrayLimit(r, l) {
681
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
682
+ if (null != t) {
683
+ var e,
684
+ n,
685
+ i,
686
+ u,
687
+ a = [],
688
+ f = true,
689
+ o = false;
690
+ try {
691
+ if (i = (t = t.call(r)).next, 0 === l) {
692
+ if (Object(t) !== t) return;
693
+ f = !1;
694
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
695
+ } catch (r) {
696
+ o = true, n = r;
697
+ } finally {
698
+ try {
699
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
700
+ } finally {
701
+ if (o) throw n;
702
+ }
703
+ }
704
+ return a;
705
+ }
706
+ }
707
+ function _nonIterableRest() {
708
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
709
+ }
710
+ function _nonIterableSpread() {
711
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
712
+ }
713
+ function ownKeys(e, r) {
714
+ var t = Object.keys(e);
715
+ if (Object.getOwnPropertySymbols) {
716
+ var o = Object.getOwnPropertySymbols(e);
717
+ r && (o = o.filter(function (r) {
718
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
719
+ })), t.push.apply(t, o);
720
+ }
721
+ return t;
722
+ }
723
+ function _objectSpread2(e) {
724
+ for (var r = 1; r < arguments.length; r++) {
725
+ var t = null != arguments[r] ? arguments[r] : {};
726
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
727
+ _defineProperty(e, r, t[r]);
728
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
729
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
730
+ });
731
+ }
732
+ return e;
733
+ }
734
+ function _objectWithoutProperties(e, t) {
735
+ if (null == e) return {};
736
+ var o,
737
+ r,
738
+ i = _objectWithoutPropertiesLoose(e, t);
739
+ if (Object.getOwnPropertySymbols) {
740
+ var n = Object.getOwnPropertySymbols(e);
741
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
742
+ }
743
+ return i;
744
+ }
745
+ function _objectWithoutPropertiesLoose(r, e) {
746
+ if (null == r) return {};
747
+ var t = {};
748
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
749
+ if (-1 !== e.indexOf(n)) continue;
750
+ t[n] = r[n];
751
+ }
752
+ return t;
753
+ }
754
+ function _slicedToArray(r, e) {
755
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
756
+ }
757
+ function _toConsumableArray(r) {
758
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
759
+ }
760
+ function _toPrimitive(t, r) {
761
+ if ("object" != typeof t || !t) return t;
762
+ var e = t[Symbol.toPrimitive];
763
+ if (void 0 !== e) {
764
+ var i = e.call(t, r);
765
+ if ("object" != typeof i) return i;
766
+ throw new TypeError("@@toPrimitive must return a primitive value.");
767
+ }
768
+ return ("string" === r ? String : Number)(t);
769
+ }
770
+ function _toPropertyKey(t) {
771
+ var i = _toPrimitive(t, "string");
772
+ return "symbol" == typeof i ? i : i + "";
773
+ }
774
+ function _typeof(o) {
775
+ "@babel/helpers - typeof";
931
776
 
932
- var defaultTheme = Themes.getPresetStaticTheme();
933
- var ThemeContext = /*#__PURE__*/React.createContext(defaultTheme);
934
- var useTheme = function useTheme() {
935
- return React.useContext(ThemeContext);
936
- };
777
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
778
+ return typeof o;
779
+ } : function (o) {
780
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
781
+ }, _typeof(o);
782
+ }
783
+ function _unsupportedIterableToArray(r, a) {
784
+ if (r) {
785
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
786
+ var t = {}.toString.call(r).slice(8, -1);
787
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
788
+ }
789
+ }
790
+
791
+ var defaultToastLayout = {
792
+ padding: '12px 16px',
793
+ margin: '8px 0',
794
+ width: '420px',
795
+ maxWidth: '90vw',
796
+ maxHeight: '75px',
797
+ placement: 'bottomRight'
798
+ };
799
+ var defaultParams = {
800
+ toasts: [],
801
+ toastLayout: defaultToastLayout,
802
+ updateToastLayout: function updateToastLayout(t) {
803
+ return t;
804
+ },
805
+ updateToasts: function updateToasts(t) {
806
+ return t;
807
+ },
808
+ lastUpdateToastId: null,
809
+ updateLastToastId: function updateLastToastId() {
810
+ return null;
811
+ }
812
+ };
813
+ var HUIContent = /*#__PURE__*/React$1.createContext(defaultParams);
814
+ var useHUIContext = function useHUIContext() {
815
+ return React$1.useContext(HUIContent);
816
+ };
817
+
818
+ var defaultFont = {
819
+ sans: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
820
+ mono: 'Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace',
821
+ prism: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,"Liberation Mono", "Courier New", monospace'
822
+ };
823
+ var defaultBreakpoints = {
824
+ xs: {
825
+ min: '0',
826
+ max: '650px'
827
+ },
828
+ sm: {
829
+ min: '650px',
830
+ max: '900px'
831
+ },
832
+ md: {
833
+ min: '900px',
834
+ max: '1280px'
835
+ },
836
+ lg: {
837
+ min: '1280px',
838
+ max: '1920px'
839
+ },
840
+ xl: {
841
+ min: '1920px',
842
+ max: '10000px'
843
+ }
844
+ };
845
+ var defaultLayout = {
846
+ gap: '16pt',
847
+ gapNegative: '-16pt',
848
+ gapHalf: '8pt',
849
+ gapHalfNegative: '-8pt',
850
+ gapQuarter: '4pt',
851
+ gapQuarterNegative: '-4pt',
852
+ pageMargin: '16pt',
853
+ pageWidth: '750pt',
854
+ pageWidthWithMargin: '782pt',
855
+ breakpointMobile: defaultBreakpoints.xs.max,
856
+ breakpointTablet: defaultBreakpoints.sm.max,
857
+ radius: '6px',
858
+ unit: '16px'
859
+ };
860
+
861
+ var palette$1 = {
862
+ accents_1: '#fafafa',
863
+ accents_2: '#eaeaea',
864
+ accents_3: '#999',
865
+ accents_4: '#888',
866
+ accents_5: '#666',
867
+ accents_6: '#444',
868
+ accents_7: '#333',
869
+ accents_8: '#111',
870
+ background: '#fff',
871
+ foreground: '#000',
872
+ selection: '#79ffe1',
873
+ secondary: '#666',
874
+ code: '#f81ce5',
875
+ border: '#eaeaea',
876
+ error: '#e00',
877
+ errorLight: '#ff1a1a',
878
+ errorLighter: '#f7d4d6',
879
+ errorDark: '#c50000',
880
+ success: '#0070f3',
881
+ successLight: '#3291ff',
882
+ successLighter: '#d3e5ff',
883
+ successDark: '#0761d1',
884
+ warning: '#f5a623',
885
+ warningLight: '#f7b955',
886
+ warningLighter: '#ffefcf',
887
+ warningDark: '#ab570a',
888
+ cyan: '#50e3c2',
889
+ cyanLighter: '#aaffec',
890
+ cyanLight: '#79ffe1',
891
+ cyanDark: '#29bc9b',
892
+ violet: '#7928ca',
893
+ violetLighter: '#e3d7fc',
894
+ violetLight: '#8a63d2',
895
+ violetDark: '#4c2889',
896
+ purple: '#f81ce5',
897
+ alert: '#ff0080',
898
+ magenta: '#eb367f',
899
+ link: '#0070f3'
900
+ };
901
+ var expressiveness$1 = {
902
+ linkStyle: 'none',
903
+ linkHoverStyle: 'none',
904
+ dropdownBoxShadow: '0 4px 4px 0 rgba(0, 0, 0, 0.02)',
905
+ scrollerStart: 'rgba(255, 255, 255, 1)',
906
+ scrollerEnd: 'rgba(255, 255, 255, 0)',
907
+ shadowSmall: '0 5px 10px rgba(0, 0, 0, 0.12)',
908
+ shadowMedium: '0 8px 30px rgba(0, 0, 0, 0.12)',
909
+ shadowLarge: '0 30px 60px rgba(0, 0, 0, 0.12)',
910
+ portalOpacity: 0.25
911
+ };
912
+ var font$1 = defaultFont;
913
+ var breakpoints$1 = defaultBreakpoints;
914
+ var layout$1 = defaultLayout;
915
+ var themes$1 = {
916
+ type: 'light',
917
+ font: font$1,
918
+ layout: layout$1,
919
+ palette: palette$1,
920
+ breakpoints: breakpoints$1,
921
+ expressiveness: expressiveness$1
922
+ };
923
+
924
+ var palette = {
925
+ accents_1: '#111',
926
+ accents_2: '#333',
927
+ accents_3: '#444',
928
+ accents_4: '#666',
929
+ accents_5: '#888',
930
+ accents_6: '#999',
931
+ accents_7: '#eaeaea',
932
+ accents_8: '#fafafa',
933
+ background: '#000',
934
+ foreground: '#fff',
935
+ selection: '#f81ce5',
936
+ secondary: '#888',
937
+ code: '#79ffe1',
938
+ border: '#333',
939
+ error: '#e00',
940
+ errorLighter: '#f7d4d6',
941
+ errorLight: '#ff1a1a',
942
+ errorDark: '#c50000',
943
+ success: '#0070f3',
944
+ successLighter: '#d3e5ff',
945
+ successLight: '#3291ff',
946
+ successDark: '#0761d1',
947
+ warning: '#f5a623',
948
+ warningLighter: '#ffefcf',
949
+ warningLight: '#f7b955',
950
+ warningDark: '#ab570a',
951
+ cyan: '#50e3c2',
952
+ cyanLighter: '#aaffec',
953
+ cyanLight: '#79ffe1',
954
+ cyanDark: '#29bc9b',
955
+ violet: '#7928ca',
956
+ violetLighter: '#e3d7fc',
957
+ violetLight: '#8a63d2',
958
+ violetDark: '#4c2889',
959
+ purple: '#f81ce5',
960
+ alert: '#ff0080',
961
+ magenta: '#eb367f',
962
+ link: '#3291ff'
963
+ };
964
+ var expressiveness = {
965
+ linkStyle: 'none',
966
+ linkHoverStyle: 'none',
967
+ dropdownBoxShadow: '0 0 0 1px #333',
968
+ scrollerStart: 'rgba(255, 255, 255, 1)',
969
+ scrollerEnd: 'rgba(255, 255, 255, 0)',
970
+ shadowSmall: '0 0 0 1px #333',
971
+ shadowMedium: '0 0 0 1px #333',
972
+ shadowLarge: '0 0 0 1px #333',
973
+ portalOpacity: 0.75
974
+ };
975
+ var font = defaultFont;
976
+ var breakpoints = defaultBreakpoints;
977
+ var layout = defaultLayout;
978
+ var themes = {
979
+ type: 'dark',
980
+ font: font,
981
+ layout: layout,
982
+ palette: palette,
983
+ breakpoints: breakpoints,
984
+ expressiveness: expressiveness
985
+ };
986
+
987
+ var isObject = function isObject(target) {
988
+ return target && _typeof(target) === 'object';
989
+ };
990
+ var _deepDuplicable = function deepDuplicable(source, target) {
991
+ if (!isObject(target) || !isObject(source)) return source;
992
+ var sourceKeys = Object.keys(source);
993
+ var result = {};
994
+ for (var _i = 0, _sourceKeys = sourceKeys; _i < _sourceKeys.length; _i++) {
995
+ var key = _sourceKeys[_i];
996
+ var sourceValue = source[key];
997
+ var targetValue = target[key];
998
+ if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
999
+ result[key] = targetValue.concat(sourceValue);
1000
+ } else if (isObject(sourceValue) && isObject(targetValue)) {
1001
+ result[key] = _deepDuplicable(sourceValue, _objectSpread2({}, targetValue));
1002
+ } else if (targetValue) {
1003
+ result[key] = targetValue;
1004
+ } else {
1005
+ result[key] = sourceValue;
1006
+ }
1007
+ }
1008
+ return result;
1009
+ };
1010
+ var getPresets = function getPresets() {
1011
+ return [themes$1, themes];
1012
+ };
1013
+ var getPresetStaticTheme = function getPresetStaticTheme() {
1014
+ return themes$1;
1015
+ };
1016
+ var isAvailableThemeType = function isAvailableThemeType(type) {
1017
+ if (!type) return false;
1018
+ var presetThemes = getPresets();
1019
+ var hasType = presetThemes.find(function (theme) {
1020
+ return theme.type === type;
1021
+ });
1022
+ return !hasType;
1023
+ };
1024
+ var isPresetTheme = function isPresetTheme(themeOrType) {
1025
+ if (!themeOrType) return false;
1026
+ var isType = typeof themeOrType === 'string';
1027
+ var type = isType ? themeOrType : themeOrType.type;
1028
+ return !isAvailableThemeType(type);
1029
+ };
1030
+ var hasUserCustomTheme = function hasUserCustomTheme() {
1031
+ var themes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1032
+ return !!themes.find(function (item) {
1033
+ return isAvailableThemeType(item.type);
1034
+ });
1035
+ };
1036
+ var create = function create(base, custom) {
1037
+ if (!isAvailableThemeType(custom.type)) {
1038
+ throw new Error('Duplicate or unavailable theme type');
1039
+ }
1040
+ return _deepDuplicable(base, custom);
1041
+ };
1042
+ var createFromDark = function createFromDark(custom) {
1043
+ return create(themes, custom);
1044
+ };
1045
+ var createFromLight = function createFromLight(custom) {
1046
+ return create(themes$1, custom);
1047
+ };
1048
+ var Themes = {
1049
+ isPresetTheme: isPresetTheme,
1050
+ isAvailableThemeType: isAvailableThemeType,
1051
+ hasUserCustomTheme: hasUserCustomTheme,
1052
+ getPresets: getPresets,
1053
+ getPresetStaticTheme: getPresetStaticTheme,
1054
+ create: create,
1055
+ createFromDark: createFromDark,
1056
+ createFromLight: createFromLight
1057
+ };
1058
+
1059
+ /* "use client" */
1060
+
1061
+ var defaultTheme = Themes.getPresetStaticTheme();
1062
+ var ThemeContext = /*#__PURE__*/React$1.createContext(defaultTheme);
1063
+ var useTheme = function useTheme() {
1064
+ return React$1.useContext(ThemeContext);
1065
+ };
1066
+
1067
+ /* "use client" */
1068
+
1069
+ var defaultAllThemesConfig = {
1070
+ themes: Themes.getPresets()
1071
+ };
1072
+ var AllThemesContext = /*#__PURE__*/React$1.createContext(defaultAllThemesConfig);
1073
+ var useAllThemes = function useAllThemes() {
1074
+ return React$1.useContext(AllThemesContext);
1075
+ };
1076
+
1077
+ var ThemeProvider = function ThemeProvider(_ref) {
1078
+ var children = _ref.children,
1079
+ themeType = _ref.themeType,
1080
+ _ref$themes = _ref.themes,
1081
+ themes = _ref$themes === void 0 ? [] : _ref$themes;
1082
+ var _React$useState = React$1.useState({
1083
+ themes: Themes.getPresets()
1084
+ }),
1085
+ _React$useState2 = _slicedToArray(_React$useState, 2),
1086
+ allThemes = _React$useState2[0],
1087
+ setAllThemes = _React$useState2[1];
1088
+ var currentTheme = React$1.useMemo(function () {
1089
+ var theme = allThemes.themes.find(function (item) {
1090
+ return item.type === themeType;
1091
+ });
1092
+ if (theme) return theme;
1093
+ return Themes.getPresetStaticTheme();
1094
+ }, [allThemes, themeType]);
1095
+ React$1.useEffect(function () {
1096
+ if (!(themes !== null && themes !== void 0 && themes.length)) return;
1097
+ setAllThemes(function (last) {
1098
+ var safeThemes = themes.filter(function (item) {
1099
+ return Themes.isAvailableThemeType(item.type);
1100
+ });
1101
+ var nextThemes = Themes.getPresets().concat(safeThemes);
1102
+ return _objectSpread2(_objectSpread2({}, last), {}, {
1103
+ themes: nextThemes
1104
+ });
1105
+ });
1106
+ }, [themes]);
1107
+ return /*#__PURE__*/React$1.createElement(AllThemesContext.Provider, {
1108
+ value: allThemes
1109
+ }, /*#__PURE__*/React$1.createElement(ThemeContext.Provider, {
1110
+ value: currentTheme
1111
+ }, children));
1112
+ };
1113
+
1114
+ var useCurrentState = function useCurrentState(initialState) {
1115
+ var _useState = React$1.useState(function () {
1116
+ return typeof initialState === 'function' ? initialState() : initialState;
1117
+ }),
1118
+ _useState2 = _slicedToArray(_useState, 2),
1119
+ state = _useState2[0],
1120
+ setState = _useState2[1];
1121
+ var ref = React$1.useRef(initialState);
1122
+ React$1.useEffect(function () {
1123
+ ref.current = state;
1124
+ }, [state]);
1125
+ var setValue = function setValue(val) {
1126
+ var result = typeof val === 'function' ? val(ref.current) : val;
1127
+ ref.current = result;
1128
+ setState(result);
1129
+ };
1130
+ return [state, setValue, ref];
1131
+ };
1132
+
1133
+ function getDefaultExportFromCjs (x) {
1134
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1135
+ }
1136
+
1137
+ var index = {};
1138
+
1139
+ var hasRequiredIndex;
1140
+
1141
+ function requireIndex () {
1142
+ if (hasRequiredIndex) return index;
1143
+ hasRequiredIndex = 1;
1144
+ var React$1$1 = React$1;
1145
+
1146
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
1147
+
1148
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1$1);
1149
+
1150
+ /*
1151
+ Based on Glamor's sheet
1152
+ https://github.com/threepointone/glamor/blob/667b480d31b3721a905021b26e1290ce92ca2879/src/sheet.js
1153
+ */ function _defineProperties(target, props) {
1154
+ for(var i = 0; i < props.length; i++){
1155
+ var descriptor = props[i];
1156
+ descriptor.enumerable = descriptor.enumerable || false;
1157
+ descriptor.configurable = true;
1158
+ if ("value" in descriptor) descriptor.writable = true;
1159
+ Object.defineProperty(target, descriptor.key, descriptor);
1160
+ }
1161
+ }
1162
+ function _createClass(Constructor, protoProps, staticProps) {
1163
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1164
+ return Constructor;
1165
+ }
1166
+ var isProd = typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production";
1167
+ var isString = function(o) {
1168
+ return Object.prototype.toString.call(o) === "[object String]";
1169
+ };
1170
+ var StyleSheet = /*#__PURE__*/ function() {
1171
+ function StyleSheet(param) {
1172
+ var ref = param === void 0 ? {} : param, _name = ref.name, name = _name === void 0 ? "stylesheet" : _name, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? isProd : _optimizeForSpeed;
1173
+ invariant$1(isString(name), "`name` must be a string");
1174
+ this._name = name;
1175
+ this._deletedRulePlaceholder = "#" + name + "-deleted-rule____{}";
1176
+ invariant$1(typeof optimizeForSpeed === "boolean", "`optimizeForSpeed` must be a boolean");
1177
+ this._optimizeForSpeed = optimizeForSpeed;
1178
+ this._serverSheet = undefined;
1179
+ this._tags = [];
1180
+ this._injected = false;
1181
+ this._rulesCount = 0;
1182
+ var node = typeof window !== "undefined" && document.querySelector('meta[property="csp-nonce"]');
1183
+ this._nonce = node ? node.getAttribute("content") : null;
1184
+ }
1185
+ var _proto = StyleSheet.prototype;
1186
+ _proto.setOptimizeForSpeed = function setOptimizeForSpeed(bool) {
1187
+ invariant$1(typeof bool === "boolean", "`setOptimizeForSpeed` accepts a boolean");
1188
+ invariant$1(this._rulesCount === 0, "optimizeForSpeed cannot be when rules have already been inserted");
1189
+ this.flush();
1190
+ this._optimizeForSpeed = bool;
1191
+ this.inject();
1192
+ };
1193
+ _proto.isOptimizeForSpeed = function isOptimizeForSpeed() {
1194
+ return this._optimizeForSpeed;
1195
+ };
1196
+ _proto.inject = function inject() {
1197
+ var _this = this;
1198
+ invariant$1(!this._injected, "sheet already injected");
1199
+ this._injected = true;
1200
+ if (typeof window !== "undefined" && this._optimizeForSpeed) {
1201
+ this._tags[0] = this.makeStyleTag(this._name);
1202
+ this._optimizeForSpeed = "insertRule" in this.getSheet();
1203
+ if (!this._optimizeForSpeed) {
1204
+ if (!isProd) {
1205
+ console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode.");
1206
+ }
1207
+ this.flush();
1208
+ this._injected = true;
1209
+ }
1210
+ return;
1211
+ }
1212
+ this._serverSheet = {
1213
+ cssRules: [],
1214
+ insertRule: function(rule, index) {
1215
+ if (typeof index === "number") {
1216
+ _this._serverSheet.cssRules[index] = {
1217
+ cssText: rule
1218
+ };
1219
+ } else {
1220
+ _this._serverSheet.cssRules.push({
1221
+ cssText: rule
1222
+ });
1223
+ }
1224
+ return index;
1225
+ },
1226
+ deleteRule: function(index) {
1227
+ _this._serverSheet.cssRules[index] = null;
1228
+ }
1229
+ };
1230
+ };
1231
+ _proto.getSheetForTag = function getSheetForTag(tag) {
1232
+ if (tag.sheet) {
1233
+ return tag.sheet;
1234
+ }
1235
+ // this weirdness brought to you by firefox
1236
+ for(var i = 0; i < document.styleSheets.length; i++){
1237
+ if (document.styleSheets[i].ownerNode === tag) {
1238
+ return document.styleSheets[i];
1239
+ }
1240
+ }
1241
+ };
1242
+ _proto.getSheet = function getSheet() {
1243
+ return this.getSheetForTag(this._tags[this._tags.length - 1]);
1244
+ };
1245
+ _proto.insertRule = function insertRule(rule, index) {
1246
+ invariant$1(isString(rule), "`insertRule` accepts only strings");
1247
+ if (typeof window === "undefined") {
1248
+ if (typeof index !== "number") {
1249
+ index = this._serverSheet.cssRules.length;
1250
+ }
1251
+ this._serverSheet.insertRule(rule, index);
1252
+ return this._rulesCount++;
1253
+ }
1254
+ if (this._optimizeForSpeed) {
1255
+ var sheet = this.getSheet();
1256
+ if (typeof index !== "number") {
1257
+ index = sheet.cssRules.length;
1258
+ }
1259
+ // this weirdness for perf, and chrome's weird bug
1260
+ // https://stackoverflow.com/questions/20007992/chrome-suddenly-stopped-accepting-insertrule
1261
+ try {
1262
+ sheet.insertRule(rule, index);
1263
+ } catch (error) {
1264
+ if (!isProd) {
1265
+ console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
1266
+ }
1267
+ return -1;
1268
+ }
1269
+ } else {
1270
+ var insertionPoint = this._tags[index];
1271
+ this._tags.push(this.makeStyleTag(this._name, rule, insertionPoint));
1272
+ }
1273
+ return this._rulesCount++;
1274
+ };
1275
+ _proto.replaceRule = function replaceRule(index, rule) {
1276
+ if (this._optimizeForSpeed || typeof window === "undefined") {
1277
+ var sheet = typeof window !== "undefined" ? this.getSheet() : this._serverSheet;
1278
+ if (!rule.trim()) {
1279
+ rule = this._deletedRulePlaceholder;
1280
+ }
1281
+ if (!sheet.cssRules[index]) {
1282
+ // @TBD Should we throw an error?
1283
+ return index;
1284
+ }
1285
+ sheet.deleteRule(index);
1286
+ try {
1287
+ sheet.insertRule(rule, index);
1288
+ } catch (error) {
1289
+ if (!isProd) {
1290
+ console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
1291
+ }
1292
+ // In order to preserve the indices we insert a deleteRulePlaceholder
1293
+ sheet.insertRule(this._deletedRulePlaceholder, index);
1294
+ }
1295
+ } else {
1296
+ var tag = this._tags[index];
1297
+ invariant$1(tag, "old rule at index `" + index + "` not found");
1298
+ tag.textContent = rule;
1299
+ }
1300
+ return index;
1301
+ };
1302
+ _proto.deleteRule = function deleteRule(index) {
1303
+ if (typeof window === "undefined") {
1304
+ this._serverSheet.deleteRule(index);
1305
+ return;
1306
+ }
1307
+ if (this._optimizeForSpeed) {
1308
+ this.replaceRule(index, "");
1309
+ } else {
1310
+ var tag = this._tags[index];
1311
+ invariant$1(tag, "rule at index `" + index + "` not found");
1312
+ tag.parentNode.removeChild(tag);
1313
+ this._tags[index] = null;
1314
+ }
1315
+ };
1316
+ _proto.flush = function flush() {
1317
+ this._injected = false;
1318
+ this._rulesCount = 0;
1319
+ if (typeof window !== "undefined") {
1320
+ this._tags.forEach(function(tag) {
1321
+ return tag && tag.parentNode.removeChild(tag);
1322
+ });
1323
+ this._tags = [];
1324
+ } else {
1325
+ // simpler on server
1326
+ this._serverSheet.cssRules = [];
1327
+ }
1328
+ };
1329
+ _proto.cssRules = function cssRules() {
1330
+ var _this = this;
1331
+ if (typeof window === "undefined") {
1332
+ return this._serverSheet.cssRules;
1333
+ }
1334
+ return this._tags.reduce(function(rules, tag) {
1335
+ if (tag) {
1336
+ rules = rules.concat(Array.prototype.map.call(_this.getSheetForTag(tag).cssRules, function(rule) {
1337
+ return rule.cssText === _this._deletedRulePlaceholder ? null : rule;
1338
+ }));
1339
+ } else {
1340
+ rules.push(null);
1341
+ }
1342
+ return rules;
1343
+ }, []);
1344
+ };
1345
+ _proto.makeStyleTag = function makeStyleTag(name, cssString, relativeToTag) {
1346
+ if (cssString) {
1347
+ invariant$1(isString(cssString), "makeStyleTag accepts only strings as second parameter");
1348
+ }
1349
+ var tag = document.createElement("style");
1350
+ if (this._nonce) tag.setAttribute("nonce", this._nonce);
1351
+ tag.type = "text/css";
1352
+ tag.setAttribute("data-" + name, "");
1353
+ if (cssString) {
1354
+ tag.appendChild(document.createTextNode(cssString));
1355
+ }
1356
+ var head = document.head || document.getElementsByTagName("head")[0];
1357
+ if (relativeToTag) {
1358
+ head.insertBefore(tag, relativeToTag);
1359
+ } else {
1360
+ head.appendChild(tag);
1361
+ }
1362
+ return tag;
1363
+ };
1364
+ _createClass(StyleSheet, [
1365
+ {
1366
+ key: "length",
1367
+ get: function get() {
1368
+ return this._rulesCount;
1369
+ }
1370
+ }
1371
+ ]);
1372
+ return StyleSheet;
1373
+ }();
1374
+ function invariant$1(condition, message) {
1375
+ if (!condition) {
1376
+ throw new Error("StyleSheet: " + message + ".");
1377
+ }
1378
+ }
1379
+
1380
+ function hash(str) {
1381
+ var _$hash = 5381, i = str.length;
1382
+ while(i){
1383
+ _$hash = _$hash * 33 ^ str.charCodeAt(--i);
1384
+ }
1385
+ /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
1386
+ * integers. Since we want the results to be always positive, convert the
1387
+ * signed int to an unsigned by doing an unsigned bitshift. */ return _$hash >>> 0;
1388
+ }
1389
+ var stringHash = hash;
1390
+
1391
+ var sanitize = function(rule) {
1392
+ return rule.replace(/\/style/gi, "\\/style");
1393
+ };
1394
+ var cache = {};
1395
+ /**
1396
+ * computeId
1397
+ *
1398
+ * Compute and memoize a jsx id from a basedId and optionally props.
1399
+ */ function computeId(baseId, props) {
1400
+ if (!props) {
1401
+ return "jsx-" + baseId;
1402
+ }
1403
+ var propsToString = String(props);
1404
+ var key = baseId + propsToString;
1405
+ if (!cache[key]) {
1406
+ cache[key] = "jsx-" + stringHash(baseId + "-" + propsToString);
1407
+ }
1408
+ return cache[key];
1409
+ }
1410
+ /**
1411
+ * computeSelector
1412
+ *
1413
+ * Compute and memoize dynamic selectors.
1414
+ */ function computeSelector(id, css) {
1415
+ var selectoPlaceholderRegexp = /__jsx-style-dynamic-selector/g;
1416
+ // Sanitize SSR-ed CSS.
1417
+ // Client side code doesn't need to be sanitized since we use
1418
+ // document.createTextNode (dev) and the CSSOM api sheet.insertRule (prod).
1419
+ if (typeof window === "undefined") {
1420
+ css = sanitize(css);
1421
+ }
1422
+ var idcss = id + css;
1423
+ if (!cache[idcss]) {
1424
+ cache[idcss] = css.replace(selectoPlaceholderRegexp, id);
1425
+ }
1426
+ return cache[idcss];
1427
+ }
1428
+
1429
+ function mapRulesToStyle(cssRules, options) {
1430
+ if (options === void 0) options = {};
1431
+ return cssRules.map(function(args) {
1432
+ var id = args[0];
1433
+ var css = args[1];
1434
+ return /*#__PURE__*/ React__default["default"].createElement("style", {
1435
+ id: "__" + id,
1436
+ // Avoid warnings upon render with a key
1437
+ key: "__" + id,
1438
+ nonce: options.nonce ? options.nonce : undefined,
1439
+ dangerouslySetInnerHTML: {
1440
+ __html: css
1441
+ }
1442
+ });
1443
+ });
1444
+ }
1445
+ var StyleSheetRegistry = /*#__PURE__*/ function() {
1446
+ function StyleSheetRegistry(param) {
1447
+ var ref = param === void 0 ? {} : param, _styleSheet = ref.styleSheet, styleSheet = _styleSheet === void 0 ? null : _styleSheet, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? false : _optimizeForSpeed;
1448
+ this._sheet = styleSheet || new StyleSheet({
1449
+ name: "styled-jsx",
1450
+ optimizeForSpeed: optimizeForSpeed
1451
+ });
1452
+ this._sheet.inject();
1453
+ if (styleSheet && typeof optimizeForSpeed === "boolean") {
1454
+ this._sheet.setOptimizeForSpeed(optimizeForSpeed);
1455
+ this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
1456
+ }
1457
+ this._fromServer = undefined;
1458
+ this._indices = {};
1459
+ this._instancesCounts = {};
1460
+ }
1461
+ var _proto = StyleSheetRegistry.prototype;
1462
+ _proto.add = function add(props) {
1463
+ var _this = this;
1464
+ if (undefined === this._optimizeForSpeed) {
1465
+ this._optimizeForSpeed = Array.isArray(props.children);
1466
+ this._sheet.setOptimizeForSpeed(this._optimizeForSpeed);
1467
+ this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
1468
+ }
1469
+ if (typeof window !== "undefined" && !this._fromServer) {
1470
+ this._fromServer = this.selectFromServer();
1471
+ this._instancesCounts = Object.keys(this._fromServer).reduce(function(acc, tagName) {
1472
+ acc[tagName] = 0;
1473
+ return acc;
1474
+ }, {});
1475
+ }
1476
+ var ref = this.getIdAndRules(props), styleId = ref.styleId, rules = ref.rules;
1477
+ // Deduping: just increase the instances count.
1478
+ if (styleId in this._instancesCounts) {
1479
+ this._instancesCounts[styleId] += 1;
1480
+ return;
1481
+ }
1482
+ var indices = rules.map(function(rule) {
1483
+ return _this._sheet.insertRule(rule);
1484
+ })// Filter out invalid rules
1485
+ .filter(function(index) {
1486
+ return index !== -1;
1487
+ });
1488
+ this._indices[styleId] = indices;
1489
+ this._instancesCounts[styleId] = 1;
1490
+ };
1491
+ _proto.remove = function remove(props) {
1492
+ var _this = this;
1493
+ var styleId = this.getIdAndRules(props).styleId;
1494
+ invariant(styleId in this._instancesCounts, "styleId: `" + styleId + "` not found");
1495
+ this._instancesCounts[styleId] -= 1;
1496
+ if (this._instancesCounts[styleId] < 1) {
1497
+ var tagFromServer = this._fromServer && this._fromServer[styleId];
1498
+ if (tagFromServer) {
1499
+ tagFromServer.parentNode.removeChild(tagFromServer);
1500
+ delete this._fromServer[styleId];
1501
+ } else {
1502
+ this._indices[styleId].forEach(function(index) {
1503
+ return _this._sheet.deleteRule(index);
1504
+ });
1505
+ delete this._indices[styleId];
1506
+ }
1507
+ delete this._instancesCounts[styleId];
1508
+ }
1509
+ };
1510
+ _proto.update = function update(props, nextProps) {
1511
+ this.add(nextProps);
1512
+ this.remove(props);
1513
+ };
1514
+ _proto.flush = function flush() {
1515
+ this._sheet.flush();
1516
+ this._sheet.inject();
1517
+ this._fromServer = undefined;
1518
+ this._indices = {};
1519
+ this._instancesCounts = {};
1520
+ };
1521
+ _proto.cssRules = function cssRules() {
1522
+ var _this = this;
1523
+ var fromServer = this._fromServer ? Object.keys(this._fromServer).map(function(styleId) {
1524
+ return [
1525
+ styleId,
1526
+ _this._fromServer[styleId]
1527
+ ];
1528
+ }) : [];
1529
+ var cssRules = this._sheet.cssRules();
1530
+ return fromServer.concat(Object.keys(this._indices).map(function(styleId) {
1531
+ return [
1532
+ styleId,
1533
+ _this._indices[styleId].map(function(index) {
1534
+ return cssRules[index].cssText;
1535
+ }).join(_this._optimizeForSpeed ? "" : "\n")
1536
+ ];
1537
+ })// filter out empty rules
1538
+ .filter(function(rule) {
1539
+ return Boolean(rule[1]);
1540
+ }));
1541
+ };
1542
+ _proto.styles = function styles(options) {
1543
+ return mapRulesToStyle(this.cssRules(), options);
1544
+ };
1545
+ _proto.getIdAndRules = function getIdAndRules(props) {
1546
+ var css = props.children, dynamic = props.dynamic, id = props.id;
1547
+ if (dynamic) {
1548
+ var styleId = computeId(id, dynamic);
1549
+ return {
1550
+ styleId: styleId,
1551
+ rules: Array.isArray(css) ? css.map(function(rule) {
1552
+ return computeSelector(styleId, rule);
1553
+ }) : [
1554
+ computeSelector(styleId, css)
1555
+ ]
1556
+ };
1557
+ }
1558
+ return {
1559
+ styleId: computeId(id),
1560
+ rules: Array.isArray(css) ? css : [
1561
+ css
1562
+ ]
1563
+ };
1564
+ };
1565
+ /**
1566
+ * selectFromServer
1567
+ *
1568
+ * Collects style tags from the document with id __jsx-XXX
1569
+ */ _proto.selectFromServer = function selectFromServer() {
1570
+ var elements = Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]'));
1571
+ return elements.reduce(function(acc, element) {
1572
+ var id = element.id.slice(2);
1573
+ acc[id] = element;
1574
+ return acc;
1575
+ }, {});
1576
+ };
1577
+ return StyleSheetRegistry;
1578
+ }();
1579
+ function invariant(condition, message) {
1580
+ if (!condition) {
1581
+ throw new Error("StyleSheetRegistry: " + message + ".");
1582
+ }
1583
+ }
1584
+ var StyleSheetContext = /*#__PURE__*/ React$1$1.createContext(null);
1585
+ StyleSheetContext.displayName = "StyleSheetContext";
1586
+ function createStyleRegistry() {
1587
+ return new StyleSheetRegistry();
1588
+ }
1589
+ function StyleRegistry(param) {
1590
+ var configuredRegistry = param.registry, children = param.children;
1591
+ var rootRegistry = React$1$1.useContext(StyleSheetContext);
1592
+ var ref = React$1$1.useState(function() {
1593
+ return rootRegistry || configuredRegistry || createStyleRegistry();
1594
+ }), registry = ref[0];
1595
+ return /*#__PURE__*/ React__default["default"].createElement(StyleSheetContext.Provider, {
1596
+ value: registry
1597
+ }, children);
1598
+ }
1599
+ function useStyleRegistry() {
1600
+ return React$1$1.useContext(StyleSheetContext);
1601
+ }
1602
+
1603
+ // Opt-into the new `useInsertionEffect` API in React 18, fallback to `useLayoutEffect`.
1604
+ // https://github.com/reactwg/react-18/discussions/110
1605
+ var useInsertionEffect = React__default["default"].useInsertionEffect || React$1$1.useLayoutEffect;
1606
+ var defaultRegistry = typeof window !== "undefined" ? createStyleRegistry() : undefined;
1607
+ function JSXStyle(props) {
1608
+ var registry = defaultRegistry ? defaultRegistry : useStyleRegistry();
1609
+ var insertionEffectCalled = React$1$1.useRef(false);
1610
+ // `registry` might not exist while server-side rendering
1611
+ if (!registry) {
1612
+ return null;
1613
+ }
1614
+ if (typeof window === "undefined") {
1615
+ registry.add(props);
1616
+ return null;
1617
+ }
1618
+ useInsertionEffect(function() {
1619
+ // ReactDOM removes all DOM during hydration in certain cases
1620
+ if (!document.head) {
1621
+ return;
1622
+ }
1623
+ registry.add(props);
1624
+ insertionEffectCalled.current = true;
1625
+ return function() {
1626
+ insertionEffectCalled.current = false;
1627
+ registry.remove(props);
1628
+ };
1629
+ }, [
1630
+ props.id,
1631
+ String(props.dynamic)
1632
+ ]);
1633
+ React$1$1.useLayoutEffect(function() {
1634
+ if (!document.head || insertionEffectCalled.current) {
1635
+ return;
1636
+ }
1637
+ registry.add(props);
1638
+ return function() {
1639
+ registry.remove(props);
1640
+ };
1641
+ // props.children can be string[], will be striped since id is identical
1642
+ }, [
1643
+ props.id,
1644
+ String(props.dynamic)
1645
+ ]);
1646
+ return null;
1647
+ }
1648
+ JSXStyle.dynamic = function(info) {
1649
+ return info.map(function(tagInfo) {
1650
+ var baseId = tagInfo[0];
1651
+ var props = tagInfo[1];
1652
+ return computeId(baseId, props);
1653
+ }).join(" ");
1654
+ };
1655
+
1656
+ index.StyleRegistry = StyleRegistry;
1657
+ index.createStyleRegistry = createStyleRegistry;
1658
+ index.style = JSXStyle;
1659
+ index.useStyleRegistry = useStyleRegistry;
1660
+ return index;
1661
+ }
1662
+
1663
+ var style;
1664
+ var hasRequiredStyle;
1665
+
1666
+ function requireStyle () {
1667
+ if (hasRequiredStyle) return style;
1668
+ hasRequiredStyle = 1;
1669
+ style = requireIndex().style;
1670
+ return style;
1671
+ }
1672
+
1673
+ var styleExports = requireStyle();
1674
+ var _JSXStyle = /*@__PURE__*/getDefaultExportFromCjs(styleExports);
1675
+
1676
+ /* "use client" */
1677
+
1678
+ var getId = function getId() {
1679
+ return Math.random().toString(32).slice(2, 10);
1680
+ };
1681
+ var isBrowser = function isBrowser() {
1682
+ return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
1683
+ };
1684
+
1685
+ var useSSR = function useSSR() {
1686
+ var _useState = React$1.useState(false),
1687
+ _useState2 = _slicedToArray(_useState, 2),
1688
+ browser = _useState2[0],
1689
+ setBrowser = _useState2[1];
1690
+ React$1.useEffect(function () {
1691
+ setBrowser(isBrowser());
1692
+ }, []);
1693
+ return {
1694
+ isBrowser: browser,
1695
+ isServer: !browser
1696
+ };
1697
+ };
1698
+
1699
+ var createElement = function createElement(id) {
1700
+ var el = document.createElement('div');
1701
+ el.setAttribute('id', id);
1702
+ return el;
1703
+ };
1704
+ var usePortal = function usePortal() {
1705
+ var selectId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getId();
1706
+ var getContainer = arguments.length > 1 ? arguments[1] : undefined;
1707
+ var id = "helpdice-ui-".concat(selectId);
1708
+ var _useSSR = useSSR(),
1709
+ isBrowser = _useSSR.isBrowser;
1710
+ var _useState = React$1.useState(isBrowser ? createElement(id) : null),
1711
+ _useState2 = _slicedToArray(_useState, 2),
1712
+ elSnapshot = _useState2[0],
1713
+ setElSnapshot = _useState2[1];
1714
+ React$1.useEffect(function () {
1715
+ var customContainer = getContainer ? getContainer() : null;
1716
+ var parentElement = customContainer || document.body;
1717
+ var hasElement = parentElement.querySelector("#".concat(id));
1718
+ var el = hasElement || createElement(id);
1719
+ if (!hasElement) {
1720
+ parentElement.appendChild(el);
1721
+ }
1722
+ setElSnapshot(el);
1723
+ }, []);
1724
+ return elSnapshot;
1725
+ };
1726
+
1727
+ var _excluded$2 = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
1728
+ var CssTransition = function CssTransition(_ref) {
1729
+ var children = _ref.children,
1730
+ _ref$className = _ref.className,
1731
+ className = _ref$className === void 0 ? '' : _ref$className,
1732
+ _ref$visible = _ref.visible,
1733
+ visible = _ref$visible === void 0 ? false : _ref$visible,
1734
+ _ref$enterTime = _ref.enterTime,
1735
+ enterTime = _ref$enterTime === void 0 ? 60 : _ref$enterTime,
1736
+ _ref$leaveTime = _ref.leaveTime,
1737
+ leaveTime = _ref$leaveTime === void 0 ? 60 : _ref$leaveTime,
1738
+ _ref$clearTime = _ref.clearTime,
1739
+ clearTime = _ref$clearTime === void 0 ? 60 : _ref$clearTime,
1740
+ _ref$name = _ref.name,
1741
+ name = _ref$name === void 0 ? 'transition' : _ref$name,
1742
+ props = _objectWithoutProperties(_ref, _excluded$2);
1743
+ var _useState = React$1.useState(''),
1744
+ _useState2 = _slicedToArray(_useState, 2),
1745
+ classes = _useState2[0],
1746
+ setClasses = _useState2[1];
1747
+ var _useState3 = React$1.useState(visible),
1748
+ _useState4 = _slicedToArray(_useState3, 2),
1749
+ renderable = _useState4[0],
1750
+ setRenderable = _useState4[1];
1751
+ React$1.useEffect(function () {
1752
+ var statusClassName = visible ? 'enter' : 'leave';
1753
+ var time = visible ? enterTime : leaveTime;
1754
+ if (visible && !renderable) {
1755
+ setRenderable(true);
1756
+ }
1757
+ setClasses("".concat(name, "-").concat(statusClassName));
1758
+
1759
+ // set class to active
1760
+ var timer = setTimeout(function () {
1761
+ setClasses("".concat(name, "-").concat(statusClassName, " ").concat(name, "-").concat(statusClassName, "-active"));
1762
+ clearTimeout(timer);
1763
+ }, time);
1764
+
1765
+ // remove classess when animation over
1766
+ var clearClassesTimer = setTimeout(function () {
1767
+ if (!visible) {
1768
+ setClasses('');
1769
+ setRenderable(false);
1770
+ }
1771
+ clearTimeout(clearClassesTimer);
1772
+ }, time + clearTime);
1773
+ return function () {
1774
+ clearTimeout(timer);
1775
+ clearTimeout(clearClassesTimer);
1776
+ };
1777
+ }, [visible, renderable]);
1778
+ if (! /*#__PURE__*/React$1.isValidElement(children) || !renderable) return null;
1779
+ var propsTransition = _objectSpread2(_objectSpread2({}, props), {}, {
1780
+ className: "".concat(children.props.className, " ").concat(className, " ").concat(classes)
1781
+ });
1782
+ return /*#__PURE__*/React$1.cloneElement(children, propsTransition);
1783
+ };
1784
+ CssTransition.displayName = 'CssTransition';
1785
+
1786
+ var tuple = function tuple() {
1787
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1788
+ args[_key] = arguments[_key];
1789
+ }
1790
+ return args;
1791
+ };
1792
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'abort', 'secondary-light', 'success-light', 'warning-light', 'error-light');
1793
+ tuple('default', 'secondary', 'success', 'warning', 'error');
1794
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite');
1795
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite', 'alert', 'purple', 'violet', 'cyan');
1796
+ tuple('default', 'silent', 'prevent');
1797
+ tuple('hover', 'click');
1798
+ tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
1799
+ tuple('start', 'center', 'end', 'left', 'right');
1800
+
1801
+ var makeToastActions = function makeToastActions(actions, cancelHandle) {
1802
+ var handler = function handler(event, userHandler) {
1803
+ userHandler && userHandler(event, cancelHandle);
1804
+ };
1805
+ if (!actions || !actions.length) return null;
1806
+ return actions.map(function (action, index) {
1807
+ return /*#__PURE__*/React$1.createElement("button", {
1808
+ color: action.passive ? 'default' : 'secondary',
1809
+ key: "action-".concat(index),
1810
+ onClick: function onClick(event) {
1811
+ return handler(event, action.handler);
1812
+ }
1813
+ }, action.name);
1814
+ });
1815
+ };
1816
+ var getColors = function getColors(palette, type) {
1817
+ var colors = {
1818
+ "default": palette.background,
1819
+ secondary: palette.secondary,
1820
+ success: palette.success,
1821
+ warning: palette.warning,
1822
+ error: palette.error
1823
+ };
1824
+ var isDefault = !type || type === 'default';
1825
+ if (isDefault) return {
1826
+ bgColor: colors["default"],
1827
+ color: palette.foreground
1828
+ };
1829
+ /**
1830
+ * Prevent main color change in special types.
1831
+ * The color will only follow the theme when it is in the default type.
1832
+ */
1833
+ return {
1834
+ bgColor: colors[type],
1835
+ color: 'white'
1836
+ };
1837
+ };
1838
+ tuple('topLeft', 'topRight', 'bottomLeft', 'bottomRight');
1839
+ var isTopPlacement = function isTopPlacement(placement) {
1840
+ return "".concat(placement).toLowerCase().startsWith('top');
1841
+ };
1842
+ var isLeftPlacement = function isLeftPlacement(placement) {
1843
+ return "".concat(placement).toLowerCase().endsWith('left');
1844
+ };
1845
+ var getTranslateByPlacement = function getTranslateByPlacement(placement) {
1846
+ var translateInByPlacement = {
1847
+ topLeft: 'translate(-60px, -60px)',
1848
+ topRight: 'translate(60px, -60px)',
1849
+ bottomLeft: 'translate(-60px, 60px)',
1850
+ bottomRight: 'translate(60px, 60px)'
1851
+ };
1852
+ var translateOutByPlacement = {
1853
+ topLeft: 'translate(-50px, 15px) scale(0.85)',
1854
+ topRight: 'translate(50px, 15px) scale(0.85)',
1855
+ bottomLeft: 'translate(-50px, -15px) scale(0.85)',
1856
+ bottomRight: 'translate(50px, -15px) scale(0.85)'
1857
+ };
1858
+ return {
1859
+ enter: translateInByPlacement[placement],
1860
+ leave: translateOutByPlacement[placement]
1861
+ };
1862
+ };
1863
+
1864
+ var ToastItem = /*#__PURE__*/React$1.memo(function (_ref) {
1865
+ var toast = _ref.toast,
1866
+ layout = _ref.layout;
1867
+ var theme = useTheme();
1868
+ var _useMemo = React$1.useMemo(function () {
1869
+ return getColors(theme.palette, toast.type);
1870
+ }, [theme.palette, toast.type]),
1871
+ color = _useMemo.color,
1872
+ bgColor = _useMemo.bgColor;
1873
+ var isReactNode = typeof toast.text !== 'string';
1874
+ var padding = layout.padding,
1875
+ margin = layout.margin,
1876
+ maxHeight = layout.maxHeight,
1877
+ maxWidth = layout.maxWidth,
1878
+ width = layout.width,
1879
+ placement = layout.placement;
1880
+ var _useMemo2 = React$1.useMemo(function () {
1881
+ return getTranslateByPlacement(placement);
1882
+ }, [placement]),
1883
+ enter = _useMemo2.enter,
1884
+ leave = _useMemo2.leave;
1885
+ return /*#__PURE__*/React$1.createElement(CssTransition, {
1886
+ name: "toast",
1887
+ visible: toast.visible,
1888
+ clearTime: 350
1889
+ }, /*#__PURE__*/React$1.createElement("div", {
1890
+ key: toast.id,
1891
+ className: _JSXStyle.dynamic([["1407001838", [width, maxWidth, maxHeight, theme.palette.foreground, bgColor, color, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, enter, margin, padding, margin, padding, leave]]]) + " " + "toast"
1892
+ }, isReactNode ? toast.text : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("div", {
1893
+ className: _JSXStyle.dynamic([["1407001838", [width, maxWidth, maxHeight, theme.palette.foreground, bgColor, color, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, enter, margin, padding, margin, padding, leave]]]) + " " + "message"
1894
+ }, toast.text), /*#__PURE__*/React$1.createElement("div", {
1895
+ className: _JSXStyle.dynamic([["1407001838", [width, maxWidth, maxHeight, theme.palette.foreground, bgColor, color, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, enter, margin, padding, margin, padding, leave]]]) + " " + "action"
1896
+ }, makeToastActions(toast.actions, toast.cancel))), /*#__PURE__*/React$1.createElement(_JSXStyle, {
1897
+ id: "1407001838",
1898
+ dynamic: [width, maxWidth, maxHeight, theme.palette.foreground, bgColor, color, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, enter, margin, padding, margin, padding, leave]
1899
+ }, ".toast.__jsx-style-dynamic-selector{width:".concat(width, ";max-width:").concat(maxWidth, ";max-height:").concat(maxHeight, ";display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:").concat(theme.palette.foreground, ";background-color:").concat(bgColor, ";color:").concat(color, ";border:0;border-radius:").concat(theme.layout.radius, ";opacity:1;box-shadow:").concat(theme.expressiveness.shadowSmall, ";-webkit-transition:all 350ms cubic-bezier(0.1,0.2,0.1,1);transition:all 350ms cubic-bezier(0.1,0.2,0.1,1);overflow:hidden;}.message.__jsx-style-dynamic-selector{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;font-size:0.875em;display:-webkit-box;word-break:break-all;padding-right:").concat(theme.layout.gapHalf, ";overflow:hidden;max-height:100%;text-overflow:ellipsis;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-height:1.1rem;}.toast-enter.__jsx-style-dynamic-selector{opacity:0;height:0;padding:0;margin:0;-webkit-transform:").concat(enter, ";-ms-transform:").concat(enter, ";transform:").concat(enter, ";}.toast-enter-active.__jsx-style-dynamic-selector{opacity:1;height:auto;margin:").concat(margin, ";padding:").concat(padding, ";-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0);}.toast-leave.__jsx-style-dynamic-selector{opacity:1;-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0);height:auto;margin:").concat(margin, ";padding:").concat(padding, ";}.toast-leave-active.__jsx-style-dynamic-selector{opacity:0;-webkit-transform:").concat(leave, ";-ms-transform:").concat(leave, ";transform:").concat(leave, ";}"))));
1900
+ });
1901
+
1902
+ /* "use client" */
1903
+
1904
+ var classObjectToString = function classObjectToString(className) {
1905
+ var keys = Object.keys(className);
1906
+ var len = keys.length;
1907
+ var str = '';
1908
+ for (var index = 0; index < len; index++) {
1909
+ var key = keys[index];
1910
+ var val = className[keys[index]];
1911
+ if (!val) continue;
1912
+ str = str ? "".concat(str, " ").concat(String(key)) : String(key);
1913
+ }
1914
+ return str;
1915
+ };
1916
+ var isObjectClassName = function isObjectClassName(value) {
1917
+ return _typeof(value) === 'object' && !Array.isArray(value);
1918
+ };
1919
+ var useClasses = function useClasses() {
1920
+ var len = arguments.length;
1921
+ var classes = '';
1922
+ if (len === 0) return classes;
1923
+ for (var index = 0; index < len; index++) {
1924
+ var val = index < 0 || arguments.length <= index ? undefined : arguments[index];
1925
+ if (!val) continue;
1926
+ if (isObjectClassName(val)) {
1927
+ classes += " ".concat(classObjectToString(val));
1928
+ } else {
1929
+ classes += " ".concat(String(val).trim());
1930
+ }
1931
+ }
1932
+ return classes.trim();
1933
+ };
1934
+
1935
+ var ToastContainer = function ToastContainer() {
1936
+ var theme = useTheme();
1937
+ var portal = usePortal('toast');
1938
+ var _useCurrentState = useCurrentState(false),
1939
+ _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
1940
+ setHovering = _useCurrentState2[1],
1941
+ hoveringRef = _useCurrentState2[2];
1942
+ var _useHUIContext = useHUIContext(),
1943
+ toasts = _useHUIContext.toasts,
1944
+ updateToasts = _useHUIContext.updateToasts,
1945
+ toastLayout = _useHUIContext.toastLayout,
1946
+ lastUpdateToastId = _useHUIContext.lastUpdateToastId;
1947
+ var memoizedLayout = React$1.useMemo(function () {
1948
+ return toastLayout;
1949
+ }, [toastLayout]);
1950
+ var toastElements = React$1.useMemo(function () {
1951
+ return toasts.map(function (toast) {
1952
+ return /*#__PURE__*/React$1.createElement(ToastItem, {
1953
+ toast: toast,
1954
+ layout: memoizedLayout,
1955
+ key: toast._internalIdent
1956
+ });
1957
+ });
1958
+ }, [toasts, memoizedLayout]);
1959
+ var classNames = React$1.useMemo(function () {
1960
+ return useClasses('toasts', {
1961
+ top: isTopPlacement(toastLayout.placement),
1962
+ left: isLeftPlacement(toastLayout.placement)
1963
+ });
1964
+ }, [memoizedLayout]);
1965
+ var hoverHandler = function hoverHandler(isHovering) {
1966
+ setHovering(isHovering);
1967
+ if (isHovering) {
1968
+ return updateToasts(function (last) {
1969
+ return last.map(function (toast) {
1970
+ if (!toast.visible) return toast;
1971
+ toast._timeout && window.clearTimeout(toast._timeout);
1972
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
1973
+ timeout: null
1974
+ });
1975
+ });
1976
+ });
1977
+ }
1978
+ updateToasts(function (last) {
1979
+ return last.map(function (toast, index) {
1980
+ if (!toast.visible) return toast;
1981
+ toast._timeout && window.clearTimeout(toast._timeout);
1982
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
1983
+ _timeout: function () {
1984
+ var timer = window.setTimeout(function () {
1985
+ toast.cancel();
1986
+ window.clearTimeout(timer);
1987
+ }, toast.delay + index * 100);
1988
+ return timer;
1989
+ }()
1990
+ });
1991
+ });
1992
+ });
1993
+ };
1994
+ React$1.useEffect(function () {
1995
+ var index = toasts.findIndex(function (r) {
1996
+ return r._internalIdent === lastUpdateToastId;
1997
+ });
1998
+ var toast = toasts[index];
1999
+ if (!toast || toast.visible || !hoveringRef.current) return;
2000
+ var hasVisible = toasts.find(function (r, i) {
2001
+ return i < index && r.visible;
2002
+ });
2003
+ if (hasVisible || !hoveringRef.current) return;
2004
+ hoverHandler(false);
2005
+ }, [toasts, lastUpdateToastId]);
2006
+ React$1.useEffect(function () {
2007
+ var timeout = null;
2008
+ var timer = window.setInterval(function () {
2009
+ if (toasts.length === 0) return;
2010
+ timeout = window.setTimeout(function () {
2011
+ var allInvisible = !toasts.find(function (r) {
2012
+ return r.visible;
2013
+ });
2014
+ allInvisible && updateToasts(function () {
2015
+ return [];
2016
+ });
2017
+ timeout && clearTimeout(timeout);
2018
+ }, 350);
2019
+ }, 5000);
2020
+ return function () {
2021
+ timer && clearInterval(timer);
2022
+ timeout && clearTimeout(timeout);
2023
+ };
2024
+ }, [toasts]);
2025
+ if (!portal) return null;
2026
+ if (!toasts || toasts.length === 0) return null;
2027
+ return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React$1.createElement("div", {
2028
+ onMouseEnter: function onMouseEnter() {
2029
+ return hoverHandler(true);
2030
+ },
2031
+ onMouseLeave: function onMouseLeave() {
2032
+ return hoverHandler(false);
2033
+ },
2034
+ className: _JSXStyle.dynamic([["622610754", [theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.layout.gap]]]) + " " + (classNames || "")
2035
+ }, toastElements, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2036
+ id: "622610754",
2037
+ dynamic: [theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.layout.gap]
2038
+ }, ".toasts.__jsx-style-dynamic-selector{position:fixed;width:auto;max-width:100%;right:".concat(theme.layout.gap, ";bottom:").concat(theme.layout.gap, ";z-index:2000;-webkit-transition:all 400ms ease;transition:all 400ms ease;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.top.__jsx-style-dynamic-selector{bottom:unset;-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse;top:").concat(theme.layout.gap, ";}.left.__jsx-style-dynamic-selector{right:unset;left:").concat(theme.layout.gap, ";}"))), portal);
2039
+ };
2040
+
2041
+ var HuiProvider = function HuiProvider(_ref) {
2042
+ var themes = _ref.themes,
2043
+ themeType = _ref.themeType,
2044
+ children = _ref.children;
2045
+ var _React$useState = React$1.useState(''),
2046
+ _React$useState2 = _slicedToArray(_React$useState, 2),
2047
+ lastUpdateToastId = _React$useState2[0],
2048
+ setLastUpdateToastId = _React$useState2[1];
2049
+ var _useCurrentState = useCurrentState([]),
2050
+ _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
2051
+ toasts = _useCurrentState2[0],
2052
+ setToasts = _useCurrentState2[1],
2053
+ toastsRef = _useCurrentState2[2];
2054
+ var _useCurrentState3 = useCurrentState(defaultToastLayout),
2055
+ _useCurrentState4 = _slicedToArray(_useCurrentState3, 3),
2056
+ toastLayout = _useCurrentState4[0],
2057
+ setToastLayout = _useCurrentState4[1],
2058
+ toastLayoutRef = _useCurrentState4[2];
2059
+ var updateToasts = function updateToasts(fn) {
2060
+ var nextToasts = fn(toastsRef.current);
2061
+ setToasts(nextToasts);
2062
+ };
2063
+ var updateToastLayout = function updateToastLayout(fn) {
2064
+ var nextLayout = fn(toastLayoutRef.current);
2065
+ setToastLayout(nextLayout);
2066
+ };
2067
+ var updateLastToastId = function updateLastToastId(fn) {
2068
+ setLastUpdateToastId(fn());
2069
+ };
2070
+ var initialValue = React$1.useMemo(function () {
2071
+ return {
2072
+ toasts: toasts,
2073
+ toastLayout: toastLayout,
2074
+ updateToasts: updateToasts,
2075
+ lastUpdateToastId: lastUpdateToastId,
2076
+ updateToastLayout: updateToastLayout,
2077
+ updateLastToastId: updateLastToastId
2078
+ };
2079
+ }, [toasts, toastLayout, lastUpdateToastId]);
2080
+ return /*#__PURE__*/React$1.createElement(HUIContent.Provider, {
2081
+ value: initialValue
2082
+ }, /*#__PURE__*/React$1.createElement(ThemeProvider, {
2083
+ themes: themes,
2084
+ themeType: themeType
2085
+ }, children, /*#__PURE__*/React$1.createElement(ToastContainer, null)));
2086
+ };
2087
+
2088
+ // import flush from 'styled-jsx'
2089
+
2090
+ // export type FlushToReact = <T>(opts?: { nonce?: string }) => Array<ReactElement<T>>
2091
+
2092
+ // export type FlushToHTML = (opts?: { nonce?: string }) => string
2093
+
2094
+ var CssBaseline = function CssBaseline(_ref) {
2095
+ var children = _ref.children;
2096
+ var theme = useTheme();
2097
+ return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2098
+ id: "3647548829",
2099
+ dynamic: [theme.palette.background, theme.palette.foreground, theme.palette.background, theme.font.sans, theme.font.sans, theme.palette.link, theme.expressiveness.linkStyle, theme.expressiveness.linkHoverStyle, theme.layout.gapHalf, theme.layout.gapHalf, theme.layout.gapHalf, theme.layout.gap, theme.palette.foreground, theme.palette.code, theme.font.mono, theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.palette.accents_2, theme.layout.radius, theme.font.mono, theme.palette.foreground, theme.palette.accents_2, theme.palette.accents_1, theme.layout.gap, theme.layout.gap, theme.palette.accents_5, theme.palette.accents_1, theme.layout.radius, theme.palette.border, theme.palette.selection, theme.palette.foreground]
2100
+ }, "html,body{background-color:".concat(theme.palette.background, ";color:").concat(theme.palette.foreground, ";}html{font-size:16px;--helpdice-icons-background:").concat(theme.palette.background, ";}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-size:1rem;line-height:1.5;margin:0;padding:0;min-height:100%;position:relative;overflow-x:hidden;font-family:").concat(theme.font.sans, ";}#__next{overflow-x:hidden;}*,*:before,*:after{box-sizing:inherit;text-rendering:geometricPrecision;-webkit-tap-highlight-color:transparent;}p,small{font-weight:400;color:inherit;-webkit-letter-spacing:-0.005625em;-moz-letter-spacing:-0.005625em;-ms-letter-spacing:-0.005625em;letter-spacing:-0.005625em;font-family:").concat(theme.font.sans, ";}p{margin:1em 0;font-size:1em;line-height:1.625em;}small{margin:0;line-height:1.5;font-size:0.875em;}b{font-weight:600;}span{font-size:inherit;color:inherit;font-weight:inherit;}img{max-width:100%;}a{cursor:pointer;font-size:inherit;-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:").concat(theme.palette.link, ";-webkit-text-decoration:").concat(theme.expressiveness.linkStyle, ";text-decoration:").concat(theme.expressiveness.linkStyle, ";}a:hover{-webkit-text-decoration:").concat(theme.expressiveness.linkHoverStyle, ";text-decoration:").concat(theme.expressiveness.linkHoverStyle, ";}ul,ol{padding:0;list-style-type:none;margin:").concat(theme.layout.gapHalf, " ").concat(theme.layout.gapHalf, " ").concat(theme.layout.gapHalf, " ").concat(theme.layout.gap, ";color:").concat(theme.palette.foreground, ";}ol{list-style-type:decimal;}li{margin-bottom:0.625em;font-size:1em;line-height:1.625em;}h1,h2,h3,h4,h5,h6{color:inherit;margin:0 0 0.7rem 0;}h1{font-size:3rem;-webkit-letter-spacing:-0.02em;-moz-letter-spacing:-0.02em;-ms-letter-spacing:-0.02em;letter-spacing:-0.02em;line-height:1.5;font-weight:700;}h2{font-size:2.25rem;-webkit-letter-spacing:-0.02em;-moz-letter-spacing:-0.02em;-ms-letter-spacing:-0.02em;letter-spacing:-0.02em;font-weight:600;}h3{font-size:1.5rem;-webkit-letter-spacing:-0.02em;-moz-letter-spacing:-0.02em;-ms-letter-spacing:-0.02em;letter-spacing:-0.02em;font-weight:600;}h4{font-size:1.25rem;-webkit-letter-spacing:-0.02em;-moz-letter-spacing:-0.02em;-ms-letter-spacing:-0.02em;letter-spacing:-0.02em;font-weight:600;}h5{font-size:1rem;-webkit-letter-spacing:-0.01em;-moz-letter-spacing:-0.01em;-ms-letter-spacing:-0.01em;letter-spacing:-0.01em;font-weight:600;}h6{font-size:0.875rem;-webkit-letter-spacing:-0.005em;-moz-letter-spacing:-0.005em;-ms-letter-spacing:-0.005em;letter-spacing:-0.005em;font-weight:600;}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit;color:inherit;margin:0;}button:focus,input:focus,select:focus,textarea:focus{outline:none;}code{color:").concat(theme.palette.code, ";font-family:").concat(theme.font.mono, ";font-size:0.9em;white-space:pre-wrap;}code:before,code:after{content:'\\`';}pre{padding:calc(").concat(theme.layout.gap, " * 0.9) ").concat(theme.layout.gap, ";margin:").concat(theme.layout.gap, " 0;border:1px solid ").concat(theme.palette.accents_2, ";border-radius:").concat(theme.layout.radius, ";font-family:").concat(theme.font.mono, ";white-space:pre;overflow:auto;line-height:1.5;text-align:left;font-size:14px;-webkit-overflow-scrolling:touch;}pre code{color:").concat(theme.palette.foreground, ";font-size:1em;line-height:1.25em;white-space:pre;}pre code:before,pre code:after{display:none;}pre p{margin:0;}pre::-webkit-scrollbar{display:none;width:0;height:0;background:transparent;}hr{border-color:").concat(theme.palette.accents_2, ";}details{background-color:").concat(theme.palette.accents_1, ";border:none;}details:focus,details:hover,details:active{outline:none;}summary{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;outline:none;}summary::marker,summary::before,summary::-webkit-details-marker{display:none;}summary::-moz-list-bullet{font-size:0;}summary:focus,summary:hover,summary:active{outline:none;list-style:none;}blockquote{padding:calc(0.667 * ").concat(theme.layout.gap, ") ").concat(theme.layout.gap, ";color:").concat(theme.palette.accents_5, ";background-color:").concat(theme.palette.accents_1, ";border-radius:").concat(theme.layout.radius, ";margin:1.5em 0;border:1px solid ").concat(theme.palette.border, ";}blockquote *:first-child{margin-top:0;}blockquote *:last-child{margin-bottom:0;}::selection{background-color:").concat(theme.palette.selection, ";color:").concat(theme.palette.foreground, ";}")));
2101
+ };
2102
+ var MemoCssBaseline = /*#__PURE__*/React$1.memo(CssBaseline);
2103
+
2104
+ var getElementOffset = function getElementOffset(el) {
2105
+ if (!el) return {
2106
+ top: 0,
2107
+ left: 0
2108
+ };
2109
+ var _el$getBoundingClient = el.getBoundingClientRect(),
2110
+ top = _el$getBoundingClient.top,
2111
+ left = _el$getBoundingClient.left;
2112
+ return {
2113
+ top: top,
2114
+ left: left
2115
+ };
2116
+ };
2117
+ var defaultRect$1 = {
2118
+ top: -1e3,
2119
+ left: -1e3,
2120
+ right: -1e3,
2121
+ width: 0,
2122
+ height: 0,
2123
+ elementTop: -1e3
2124
+ };
2125
+ var getRectFromDOMWithContainer = function getRectFromDOMWithContainer(domRect, getContainer) {
2126
+ if (!domRect) return defaultRect$1;
2127
+ var container = getContainer ? getContainer() : null;
2128
+ var scrollElement = container || document.documentElement;
2129
+ var _getElementOffset = getElementOffset(container),
2130
+ offsetTop = _getElementOffset.top,
2131
+ offsetLeft = _getElementOffset.left;
2132
+ return _objectSpread2(_objectSpread2({}, domRect), {}, {
2133
+ width: domRect.width || domRect.right - domRect.left,
2134
+ height: domRect.height || domRect.top - domRect.bottom,
2135
+ top: domRect.bottom + scrollElement.scrollTop - offsetTop,
2136
+ left: domRect.left + scrollElement.scrollLeft - offsetLeft,
2137
+ elementTop: domRect.top + scrollElement.scrollTop - offsetTop
2138
+ });
2139
+ };
2140
+ var isUnplacedRect = function isUnplacedRect(rect) {
2141
+ if (!rect) return true;
2142
+ return rect.top === defaultRect$1.top && rect.left === defaultRect$1.left;
2143
+ };
2144
+ var getRefRect = function getRefRect(ref, getContainer) {
2145
+ if (!ref || !ref.current) return defaultRect$1;
2146
+ var rect = ref.current.getBoundingClientRect();
2147
+ return getRectFromDOMWithContainer(rect, getContainer);
2148
+ };
2149
+ var getEventRect = function getEventRect(event, getContainer) {
2150
+ var _event$target;
2151
+ var rect = event === null || event === void 0 || (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.getBoundingClientRect();
2152
+ if (!rect) return defaultRect$1;
2153
+ return getRectFromDOMWithContainer(rect, getContainer);
2154
+ };
2155
+ var isRefTarget = function isRefTarget(eventOrRef) {
2156
+ return typeof (eventOrRef === null || eventOrRef === void 0 ? void 0 : eventOrRef.target) === 'undefined';
2157
+ };
2158
+ var useRect = function useRect(initialState) {
2159
+ var _useState = React$1.useState(initialState || defaultRect$1),
2160
+ _useState2 = _slicedToArray(_useState, 2),
2161
+ rect = _useState2[0],
2162
+ setRect = _useState2[1];
2163
+ var updateRect = function updateRect(eventOrRef, getContainer) {
2164
+ if (isRefTarget(eventOrRef)) return setRect(getRefRect(eventOrRef, getContainer));
2165
+ setRect(getEventRect(eventOrRef, getContainer));
2166
+ };
2167
+ return {
2168
+ rect: rect,
2169
+ setRect: updateRect
2170
+ };
2171
+ };
2172
+
2173
+ var defaultToast = {
2174
+ delay: 2000,
2175
+ type: 'default'
2176
+ };
2177
+ var useToasts = function useToasts(layout) {
2178
+ var _useHUIContext = useHUIContext(),
2179
+ updateToasts = _useHUIContext.updateToasts,
2180
+ toasts = _useHUIContext.toasts,
2181
+ updateToastLayout = _useHUIContext.updateToastLayout,
2182
+ updateLastToastId = _useHUIContext.updateLastToastId;
2183
+ React$1.useEffect(function () {
2184
+ if (!layout) return;
2185
+ updateToastLayout(function () {
2186
+ return layout ? _objectSpread2(_objectSpread2({}, defaultToastLayout), layout) : defaultToastLayout;
2187
+ });
2188
+ }, []);
2189
+ var _cancel = function cancel(internalId) {
2190
+ updateToasts(function (currentToasts) {
2191
+ return currentToasts.map(function (item) {
2192
+ if (item._internalIdent !== internalId) return item;
2193
+ return _objectSpread2(_objectSpread2({}, item), {}, {
2194
+ visible: false
2195
+ });
2196
+ });
2197
+ });
2198
+ updateLastToastId(function () {
2199
+ return internalId;
2200
+ });
2201
+ };
2202
+ var removeAll = function removeAll() {
2203
+ updateToasts(function (last) {
2204
+ return last.map(function (toast) {
2205
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
2206
+ visible: false
2207
+ });
2208
+ });
2209
+ });
2210
+ };
2211
+ var findToastOneByID = function findToastOneByID(id) {
2212
+ return toasts.find(function (t) {
2213
+ return t.id === id;
2214
+ });
2215
+ };
2216
+ var removeToastOneByID = function removeToastOneByID(id) {
2217
+ updateToasts(function (last) {
2218
+ return last.map(function (toast) {
2219
+ if (toast.id !== id) return toast;
2220
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
2221
+ visible: false
2222
+ });
2223
+ });
2224
+ });
2225
+ };
2226
+ var setToast = function setToast(toast) {
2227
+ var internalIdent = "toast-".concat(getId());
2228
+ var delay = toast.delay || defaultToast.delay;
2229
+ if (toast.id) {
2230
+ var hasIdent = toasts.find(function (t) {
2231
+ return t.id === toast.id;
2232
+ });
2233
+ if (hasIdent) {
2234
+ throw new Error('Toast: Already have the same key: "ident"');
2235
+ }
2236
+ }
2237
+ updateToasts(function (last) {
2238
+ var newToast = {
2239
+ delay: delay,
2240
+ text: toast.text,
2241
+ visible: true,
2242
+ type: toast.type || defaultToast.type,
2243
+ id: toast.id || internalIdent,
2244
+ actions: toast.actions || [],
2245
+ _internalIdent: internalIdent,
2246
+ _timeout: window.setTimeout(function () {
2247
+ _cancel(internalIdent);
2248
+ if (newToast._timeout) {
2249
+ window.clearTimeout(newToast._timeout);
2250
+ newToast._timeout = null;
2251
+ }
2252
+ }, delay),
2253
+ cancel: function cancel() {
2254
+ return _cancel(internalIdent);
2255
+ }
2256
+ };
2257
+ return [].concat(_toConsumableArray(last), [newToast]);
2258
+ });
2259
+ };
2260
+ return {
2261
+ toasts: toasts,
2262
+ setToast: setToast,
2263
+ removeAll: removeAll,
2264
+ findToastOneByID: findToastOneByID,
2265
+ removeToastOneByID: removeToastOneByID
2266
+ };
2267
+ };
2268
+
2269
+ tuple('xs', 'sm', 'md', 'lg', 'xl', 'mobile');
2270
+ tuple('up', 'down', 'default');
2271
+ var defaultResponsiveOptions = {
2272
+ match: 'default'
2273
+ };
2274
+ var makeQueries = function makeQueries(bp, up, down) {
2275
+ var queryString = function queryString(item) {
2276
+ var upQuery = "(min-width: ".concat(item.min, ")");
2277
+ var downQuery = "(max-width: ".concat(item.max, ")");
2278
+ return up ? upQuery : down ? downQuery : "".concat(upQuery, " and ").concat(downQuery);
2279
+ };
2280
+ var xs = queryString(bp.xs);
2281
+ return {
2282
+ xs: xs,
2283
+ mobile: xs,
2284
+ sm: queryString(bp.sm),
2285
+ md: queryString(bp.md),
2286
+ lg: queryString(bp.lg),
2287
+ xl: queryString(bp.xl)
2288
+ };
2289
+ };
2290
+ var useMediaQuery = function useMediaQuery(breakpoint) {
2291
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultResponsiveOptions;
2292
+ var _options$match = options.match,
2293
+ matchType = _options$match === void 0 ? 'default' : _options$match,
2294
+ _options$ssrMatchMedi = options.ssrMatchMedia,
2295
+ ssrMatchMedia = _options$ssrMatchMedi === void 0 ? null : _options$ssrMatchMedi;
2296
+ var supportMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
2297
+ var theme = useTheme();
2298
+ var mediaQueries = React$1.useMemo(function () {
2299
+ var up = matchType === 'up';
2300
+ var down = matchType === 'down';
2301
+ return makeQueries(theme.breakpoints, up, down);
2302
+ }, [theme.breakpoints, options]);
2303
+ var query = React$1.useMemo(function () {
2304
+ return mediaQueries[breakpoint];
2305
+ }, [mediaQueries, breakpoint]);
2306
+ var matchQuery = function matchQuery(q) {
2307
+ return window.matchMedia(q);
2308
+ };
2309
+
2310
+ /**
2311
+ * Do nothing in the server-side rendering.
2312
+ * If server match query fucntion is simulated, return user-defined value first.
2313
+ */
2314
+ var _useState = React$1.useState(function () {
2315
+ if (supportMedia) return matchQuery(query).matches;
2316
+ if (ssrMatchMedia && typeof ssrMatchMedia === 'function') {
2317
+ return ssrMatchMedia(query).matches;
2318
+ }
2319
+ return false;
2320
+ }),
2321
+ _useState2 = _slicedToArray(_useState, 2),
2322
+ state = _useState2[0],
2323
+ setState = _useState2[1];
2324
+ React$1.useEffect(function () {
2325
+ if (!supportMedia) return;
2326
+ var queryList = matchQuery(query);
2327
+ var update = function update() {
2328
+ return setState(matchQuery(query).matches);
2329
+ };
2330
+ update();
2331
+
2332
+ /**
2333
+ * addListener is deprecated. EventTarget.addEventListener is recommended.
2334
+ * But in some old browsers, MediaQueryList does not inherit from EventTarget.
2335
+ */
2336
+ queryList.addListener(update);
2337
+ return function () {
2338
+ queryList.removeListener(update);
2339
+ };
2340
+ }, [supportMedia]);
2341
+ return state;
2342
+ };
2343
+
2344
+ /* "use client" */
2345
+
2346
+ var usePrevious = function usePrevious(state) {
2347
+ var ref = React$1.useRef(null);
2348
+ React$1.useEffect(function () {
2349
+ ref.current = state;
2350
+ });
2351
+ return ref ? ref.current : null;
2352
+ };
2353
+
2354
+ var _excluded$1 = ["rect", "visible", "hoverHeightRatio", "hoverWidthRatio", "activeOpacity", "className"];
2355
+ var Highlight = function Highlight(_ref) {
2356
+ var rect = _ref.rect,
2357
+ visible = _ref.visible,
2358
+ _ref$hoverHeightRatio = _ref.hoverHeightRatio,
2359
+ hoverHeightRatio = _ref$hoverHeightRatio === void 0 ? 1 : _ref$hoverHeightRatio,
2360
+ _ref$hoverWidthRatio = _ref.hoverWidthRatio,
2361
+ hoverWidthRatio = _ref$hoverWidthRatio === void 0 ? 1 : _ref$hoverWidthRatio,
2362
+ _ref$activeOpacity = _ref.activeOpacity,
2363
+ activeOpacity = _ref$activeOpacity === void 0 ? 0.8 : _ref$activeOpacity,
2364
+ className = _ref.className,
2365
+ props = _objectWithoutProperties(_ref, _excluded$1);
2366
+ var theme = useTheme();
2367
+ var ref = React$1.useRef(null);
2368
+ var isFirstVisible = usePrevious(isUnplacedRect(rect));
2369
+ var position = React$1.useMemo(function () {
2370
+ var width = rect.width * hoverWidthRatio;
2371
+ var height = rect.height * hoverHeightRatio;
2372
+ return {
2373
+ width: "".concat(width, "px"),
2374
+ left: "".concat(rect.left + (rect.width - width) / 2, "px"),
2375
+ height: "".concat(height, "px"),
2376
+ top: "".concat(rect.elementTop + (rect.height - height) / 2, "px"),
2377
+ transition: isFirstVisible ? 'opacity' : 'opacity, width, left, top'
2378
+ };
2379
+ }, [rect, hoverWidthRatio, hoverHeightRatio]);
2380
+ return /*#__PURE__*/React$1.createElement("div", _extends({
2381
+ ref: ref
2382
+ }, props, {
2383
+ className: _JSXStyle.dynamic([["603024321", [theme.palette.accents_2, position.width, position.left, position.height, position.top, visible ? activeOpacity : 0, position.transition]]]) + " " + (props && props.className != null && props.className || useClasses('highlight', className) || "")
2384
+ }), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2385
+ id: "603024321",
2386
+ dynamic: [theme.palette.accents_2, position.width, position.left, position.height, position.top, visible ? activeOpacity : 0, position.transition]
2387
+ }, ".highlight.__jsx-style-dynamic-selector{background:".concat(theme.palette.accents_2, ";position:absolute;border-radius:5px;width:").concat(position.width, ";left:").concat(position.left, ";height:").concat(position.height, ";top:").concat(position.top, ";opacity:").concat(visible ? activeOpacity : 0, ";-webkit-transition:0.15s ease;transition:0.15s ease;-webkit-transition-property:").concat(position.transition, ";transition-property:").concat(position.transition, ";}")));
2388
+ };
2389
+
2390
+ var Ellipsis = function Ellipsis(_ref) {
2391
+ var children = _ref.children,
2392
+ height = _ref.height;
2393
+ return /*#__PURE__*/React$1.createElement("span", {
2394
+ className: _JSXStyle.dynamic([["822089635", [height]]])
2395
+ }, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2396
+ id: "822089635",
2397
+ dynamic: [height]
2398
+ }, "span.__jsx-style-dynamic-selector{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:".concat(height, ";min-width:0;}")));
2399
+ };
2400
+ var ellipsis = /*#__PURE__*/React$1.memo(Ellipsis);
2401
+
2402
+ var getRealShape = function getRealShape(el) {
2403
+ var defaultShape = {
2404
+ width: 0,
2405
+ height: 0
2406
+ };
2407
+ if (!el || typeof window === 'undefined') return defaultShape;
2408
+ var rect = el.getBoundingClientRect();
2409
+ var _window$getComputedSt = window.getComputedStyle(el),
2410
+ width = _window$getComputedSt.width,
2411
+ height = _window$getComputedSt.height;
2412
+ var getCSSStyleVal = function getCSSStyleVal(str, parentNum) {
2413
+ if (!str) return 0;
2414
+ var strVal = str.includes('px') ? +str.split('px')[0] : str.includes('%') ? +str.split('%')[0] * parentNum * 0.01 : str;
2415
+ return Number.isNaN(+strVal) ? 0 : +strVal;
2416
+ };
2417
+ return {
2418
+ width: getCSSStyleVal("".concat(width), rect.width),
2419
+ height: getCSSStyleVal("".concat(height), rect.height)
2420
+ };
2421
+ };
2422
+ var useRealShape = function useRealShape(ref) {
2423
+ var _useState = React$1.useState({
2424
+ width: 0,
2425
+ height: 0
2426
+ }),
2427
+ _useState2 = _slicedToArray(_useState, 2),
2428
+ state = _useState2[0],
2429
+ setState = _useState2[1];
2430
+ var update = function update() {
2431
+ var _getRealShape = getRealShape(ref.current),
2432
+ width = _getRealShape.width,
2433
+ height = _getRealShape.height;
2434
+ setState({
2435
+ width: width,
2436
+ height: height
2437
+ });
2438
+ };
2439
+ React$1.useEffect(function () {
2440
+ return update();
2441
+ }, [ref.current]);
2442
+ return [state, update];
2443
+ };
2444
+
2445
+ var Expand = function Expand(_ref) {
2446
+ var _ref$isExpanded = _ref.isExpanded,
2447
+ isExpanded = _ref$isExpanded === void 0 ? false : _ref$isExpanded,
2448
+ _ref$delay = _ref.delay,
2449
+ delay = _ref$delay === void 0 ? 200 : _ref$delay,
2450
+ children = _ref.children;
2451
+ var _useState = React$1.useState(isExpanded ? 'auto' : '0'),
2452
+ _useState2 = _slicedToArray(_useState, 2),
2453
+ height = _useState2[0],
2454
+ setHeight = _useState2[1];
2455
+ var _useState3 = React$1.useState(isExpanded),
2456
+ _useState4 = _slicedToArray(_useState3, 2),
2457
+ selfExpanded = _useState4[0],
2458
+ setSelfExpanded = _useState4[1];
2459
+ var _useState5 = React$1.useState(isExpanded),
2460
+ _useState6 = _slicedToArray(_useState5, 2),
2461
+ visible = _useState6[0],
2462
+ setVisible = _useState6[1];
2463
+ var contentRef = React$1.useRef(null);
2464
+ var entryTimer = React$1.useRef();
2465
+ var leaveTimer = React$1.useRef();
2466
+ var resetTimer = React$1.useRef();
2467
+ var _useRealShape = useRealShape(contentRef),
2468
+ _useRealShape2 = _slicedToArray(_useRealShape, 2),
2469
+ state = _useRealShape2[0],
2470
+ updateShape = _useRealShape2[1];
2471
+ var classes = useClasses('container', {
2472
+ expanded: selfExpanded
2473
+ });
2474
+ React$1.useEffect(function () {
2475
+ return setHeight("".concat(state.height, "px"));
2476
+ }, [state.height]);
2477
+ React$1.useEffect(function () {
2478
+ // show element or reset height.
2479
+ // force an update once manually, even if the element does not change.
2480
+ // (the height of the element might be "auto")
2481
+ if (isExpanded) {
2482
+ setVisible(isExpanded);
2483
+ } else {
2484
+ updateShape();
2485
+ setHeight("".concat(state.height, "px"));
2486
+ }
2487
+
2488
+ // show expand animation
2489
+ entryTimer.current = window.setTimeout(function () {
2490
+ setSelfExpanded(isExpanded);
2491
+ clearTimeout(entryTimer.current);
2492
+ }, 30);
2493
+
2494
+ // Reset height after animation
2495
+ if (isExpanded) {
2496
+ resetTimer.current = window.setTimeout(function () {
2497
+ setHeight('auto');
2498
+ clearTimeout(resetTimer.current);
2499
+ }, delay);
2500
+ } else {
2501
+ leaveTimer.current = window.setTimeout(function () {
2502
+ setVisible(isExpanded);
2503
+ clearTimeout(leaveTimer.current);
2504
+ }, delay / 2);
2505
+ }
2506
+ return function () {
2507
+ clearTimeout(entryTimer.current);
2508
+ clearTimeout(leaveTimer.current);
2509
+ clearTimeout(resetTimer.current);
2510
+ };
2511
+ }, [isExpanded]);
2512
+ return /*#__PURE__*/React$1.createElement("div", {
2513
+ className: _JSXStyle.dynamic([["1918690829", [visible ? 'visible' : 'hidden', delay, height]]]) + " " + (classes || "")
2514
+ }, /*#__PURE__*/React$1.createElement("div", {
2515
+ ref: contentRef,
2516
+ className: _JSXStyle.dynamic([["1918690829", [visible ? 'visible' : 'hidden', delay, height]]]) + " " + "content"
2517
+ }, children), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2518
+ id: "1918690829",
2519
+ dynamic: [visible ? 'visible' : 'hidden', delay, height]
2520
+ }, ".container.__jsx-style-dynamic-selector{padding:0;margin:0;height:0;overflow:hidden;visibility:".concat(visible ? 'visible' : 'hidden', ";-webkit-transition:height ").concat(delay, "ms ease;transition:height ").concat(delay, "ms ease;}.expanded.__jsx-style-dynamic-selector{height:").concat(height, ";visibility:visible;}")));
2521
+ };
2522
+ Expand.displayName = 'Expand';
2523
+
2524
+ /* "use client" */
2525
+
2526
+ var useResize = function useResize(callback) {
2527
+ var immediatelyInvoke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2528
+ React$1.useEffect(function () {
2529
+ var fn = function fn() {
2530
+ return callback();
2531
+ };
2532
+ if (immediatelyInvoke) {
2533
+ fn();
2534
+ }
2535
+ window.addEventListener('resize', fn);
2536
+ return function () {
2537
+ return window.removeEventListener('resize', fn);
2538
+ };
2539
+ }, []);
2540
+ };
2541
+
2542
+ /* "use client" */
2543
+
2544
+ var useClickAnyWhere = function useClickAnyWhere(handler) {
2545
+ React$1.useEffect(function () {
2546
+ var callback = function callback(event) {
2547
+ return handler(event);
2548
+ };
2549
+ document.addEventListener('click', callback);
2550
+ return function () {
2551
+ return document.removeEventListener('click', callback);
2552
+ };
2553
+ }, [handler]);
2554
+ };
2555
+
2556
+ /* "use client" */
2557
+
2558
+ var useDOMObserver = function useDOMObserver(ref) {
2559
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
2560
+ var config = {
2561
+ attributes: false,
2562
+ childList: true,
2563
+ subtree: true
2564
+ };
2565
+ React$1.useEffect(function () {
2566
+ if (!ref || !ref.current) return;
2567
+ var unmount = false;
2568
+ var done = function done() {
2569
+ if (unmount) return;
2570
+ callback.apply(void 0, arguments);
2571
+ };
2572
+ var observer = new MutationObserver(done);
2573
+ observer.observe(ref.current, config);
2574
+ return function () {
2575
+ unmount = true;
2576
+ observer.disconnect();
2577
+ };
2578
+ }, [ref]);
2579
+ };
2580
+
2581
+ var warningStack = {};
2582
+ var useWarning = function useWarning(message, component) {
2583
+ var tag = ' ';
2584
+ var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
2585
+ if (typeof console === 'undefined') return;
2586
+ if (warningStack[log]) return;
2587
+ warningStack[log] = true;
2588
+ if (process.env.NODE_ENV !== 'production') {
2589
+ return console.error(log);
2590
+ }
2591
+ console.warn(log);
2592
+ };
2593
+
2594
+ var defaultRect = {
2595
+ top: -1e3,
2596
+ left: -1e3,
2597
+ right: -1e3,
2598
+ width: 0
2599
+ };
2600
+ var Dropdown = /*#__PURE__*/React$1.memo(function (_ref) {
2601
+ var children = _ref.children,
2602
+ parent = _ref.parent,
2603
+ visible = _ref.visible,
2604
+ disableMatchWidth = _ref.disableMatchWidth,
2605
+ getPopupContainer = _ref.getPopupContainer;
2606
+ var el = usePortal('dropdown', getPopupContainer);
2607
+ var _useState = React$1.useState(defaultRect),
2608
+ _useState2 = _slicedToArray(_useState, 2),
2609
+ rect = _useState2[0],
2610
+ setRect = _useState2[1];
2611
+ var classes = useClasses('dropdown', disableMatchWidth ? 'disable-match' : 'width-match');
2612
+ if (!parent) return null;
2613
+
2614
+ /* istanbul ignore next */
2615
+ if (process.env.NODE_ENV !== 'production') {
2616
+ if (getPopupContainer && getPopupContainer()) {
2617
+ var _el = getPopupContainer();
2618
+ var style = window.getComputedStyle(_el);
2619
+ if (style.position === 'static') {
2620
+ useWarning('The element specified by "getPopupContainer" must have "position" set.');
2621
+ }
2622
+ }
2623
+ }
2624
+ var updateRect = function updateRect() {
2625
+ var _getRefRect = getRefRect(parent, getPopupContainer),
2626
+ top = _getRefRect.top,
2627
+ left = _getRefRect.left,
2628
+ right = _getRefRect.right,
2629
+ nativeWidth = _getRefRect.width;
2630
+ setRect({
2631
+ top: top,
2632
+ left: left,
2633
+ right: right,
2634
+ width: nativeWidth
2635
+ });
2636
+ };
2637
+ useResize(updateRect);
2638
+ useClickAnyWhere(function () {
2639
+ var _getRefRect2 = getRefRect(parent, getPopupContainer),
2640
+ top = _getRefRect2.top,
2641
+ left = _getRefRect2.left;
2642
+ var shouldUpdatePosition = top !== rect.top || left !== rect.left;
2643
+ if (!shouldUpdatePosition) return;
2644
+ updateRect();
2645
+ });
2646
+ useDOMObserver(parent, function () {
2647
+ updateRect();
2648
+ });
2649
+ React$1.useEffect(function () {
2650
+ if (!parent || !parent.current) return;
2651
+ parent.current.addEventListener('mouseenter', updateRect);
2652
+ /* istanbul ignore next */
2653
+ return function () {
2654
+ if (!parent || !parent.current) return;
2655
+ parent.current.removeEventListener('mouseenter', updateRect);
2656
+ };
2657
+ }, [parent]);
2658
+ var clickHandler = function clickHandler(event) {
2659
+ event.stopPropagation();
2660
+ event.nativeEvent.stopImmediatePropagation();
2661
+ event.preventDefault();
2662
+ };
2663
+ var mouseDownHandler = function mouseDownHandler(event) {
2664
+ event.preventDefault();
2665
+ };
2666
+ if (!el) return null;
2667
+ return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React$1.createElement(CssTransition, {
2668
+ visible: visible
2669
+ }, /*#__PURE__*/React$1.createElement("div", {
2670
+ onClick: clickHandler,
2671
+ onMouseDown: mouseDownHandler,
2672
+ className: _JSXStyle.dynamic([["1644673105", [rect.top + 2, rect.left, rect.width, rect.width]]]) + " " + (classes || "")
2673
+ }, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2674
+ id: "1644673105",
2675
+ dynamic: [rect.top + 2, rect.left, rect.width, rect.width]
2676
+ }, ".dropdown.__jsx-style-dynamic-selector{position:absolute;top:".concat(rect.top + 2, "px;left:").concat(rect.left, "px;z-index:1100;}.width-match.__jsx-style-dynamic-selector{width:").concat(rect.width, "px;}.disable-match.__jsx-style-dynamic-selector{min-width:").concat(rect.width, "px;}")))), el);
2677
+ });
2678
+
2679
+ var _excluded = ["children", "onClick", "visible", "width", "onContentClick", "backdropClassName", "positionClassName", "layerClassName"];
2680
+ var Backdrop = /*#__PURE__*/React$1.memo(function (_ref) {
2681
+ var children = _ref.children,
2682
+ _ref$onClick = _ref.onClick,
2683
+ onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
2684
+ _ref$visible = _ref.visible,
2685
+ visible = _ref$visible === void 0 ? false : _ref$visible,
2686
+ width = _ref.width,
2687
+ _ref$onContentClick = _ref.onContentClick,
2688
+ onContentClick = _ref$onContentClick === void 0 ? function () {} : _ref$onContentClick,
2689
+ _ref$backdropClassNam = _ref.backdropClassName,
2690
+ backdropClassName = _ref$backdropClassNam === void 0 ? '' : _ref$backdropClassNam,
2691
+ _ref$positionClassNam = _ref.positionClassName,
2692
+ positionClassName = _ref$positionClassNam === void 0 ? '' : _ref$positionClassNam,
2693
+ _ref$layerClassName = _ref.layerClassName,
2694
+ layerClassName = _ref$layerClassName === void 0 ? '' : _ref$layerClassName,
2695
+ props = _objectWithoutProperties(_ref, _excluded);
2696
+ var theme = useTheme();
2697
+ var _useCurrentState = useCurrentState(false),
2698
+ _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
2699
+ setIsContentMouseDown = _useCurrentState2[1],
2700
+ IsContentMouseDownRef = _useCurrentState2[2];
2701
+ var clickHandler = function clickHandler(event) {
2702
+ if (IsContentMouseDownRef.current) return;
2703
+ onClick && onClick(event);
2704
+ };
2705
+ var mouseUpHandler = function mouseUpHandler() {
2706
+ if (!IsContentMouseDownRef.current) return;
2707
+ var timer = setTimeout(function () {
2708
+ setIsContentMouseDown(false);
2709
+ clearTimeout(timer);
2710
+ }, 0);
2711
+ };
2712
+ return /*#__PURE__*/React$1.createElement(CssTransition, {
2713
+ name: "backdrop-wrapper",
2714
+ visible: visible,
2715
+ clearTime: 300
2716
+ }, /*#__PURE__*/React$1.createElement("div", _extends({
2717
+ onClick: clickHandler,
2718
+ onMouseUp: mouseUpHandler
2719
+ }, props, {
2720
+ className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (props && props.className != null && props.className || useClasses('backdrop', backdropClassName) || "")
2721
+ }), /*#__PURE__*/React$1.createElement("div", {
2722
+ className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (useClasses('layer', layerClassName) || "")
2723
+ }), /*#__PURE__*/React$1.createElement("div", {
2724
+ onClick: onContentClick,
2725
+ onMouseDown: function onMouseDown() {
2726
+ return setIsContentMouseDown(true);
2727
+ },
2728
+ className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (useClasses('position', positionClassName) || "")
2729
+ }, children), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2730
+ id: "2021762493",
2731
+ dynamic: [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]
2732
+ }, ".backdrop.__jsx-style-dynamic-selector{position:fixed;top:0;left:0;right:0;bottom:0;overflow:auto;z-index:1000;-webkit-overflow-scrolling:touch;box-sizing:border-box;text-align:center;}.position.__jsx-style-dynamic-selector{position:relative;z-index:1001;outline:none;max-width:90%;width:".concat(width, ";margin:20px auto;vertical-align:middle;display:inline-block;}.backdrop.__jsx-style-dynamic-selector:before{display:inline-block;width:0;height:100%;vertical-align:middle;content:'';}.layer.__jsx-style-dynamic-selector{position:fixed;top:0;left:0;right:0;bottom:0;width:100%;height:100%;opacity:").concat(theme.expressiveness.portalOpacity, ";background-color:black;-webkit-transition:opacity 0.35s cubic-bezier(0.4,0,0.2,1);transition:opacity 0.35s cubic-bezier(0.4,0,0.2,1);pointer-events:none;z-index:1000;}.backdrop-wrapper-enter.__jsx-style-dynamic-selector .layer.__jsx-style-dynamic-selector{opacity:0;}.backdrop-wrapper-enter-active.__jsx-style-dynamic-selector .layer.__jsx-style-dynamic-selector{opacity:").concat(theme.expressiveness.portalOpacity, ";}.backdrop-wrapper-leave.__jsx-style-dynamic-selector .layer.__jsx-style-dynamic-selector{opacity:").concat(theme.expressiveness.portalOpacity, ";}.backdrop-wrapper-leave-active.__jsx-style-dynamic-selector .layer.__jsx-style-dynamic-selector{opacity:0;}"))));
2733
+ });
2734
+ Backdrop.displayName = 'Backdrop';
2735
+
2736
+ dist.Backdrop = Backdrop;
2737
+ dist.CssBaseline = MemoCssBaseline;
2738
+ dist.CssTransition = CssTransition;
2739
+ dist.Dropdown = Dropdown;
2740
+ dist.Ellipsis = ellipsis;
2741
+ dist.Expand = Expand;
2742
+ dist.Highlight = Highlight;
2743
+ dist.Themes = Themes;
2744
+ dist.UiProvider = HuiProvider;
2745
+ dist.useAllThemes = useAllThemes;
2746
+ dist.useClasses = useClasses;
2747
+ dist.useCurrentState = useCurrentState;
2748
+ dist.useMediaQuery = useMediaQuery;
2749
+ dist.useRect = useRect;
2750
+ dist.useTheme = useTheme;
2751
+ dist.useToasts = useToasts;
2752
+ return dist;
2753
+ }
2754
+
2755
+ var distExports = /*@__PURE__*/ requireDist();
937
2756
 
938
2757
  var TreeFileIcon = function TreeFileIcon(_ref) {
939
2758
  var color = _ref.color,
@@ -941,7 +2760,7 @@ var TreeFileIcon = function TreeFileIcon(_ref) {
941
2760
  width = _ref$width === void 0 ? 22 : _ref$width,
942
2761
  _ref$height = _ref.height,
943
2762
  height = _ref$height === void 0 ? 22 : _ref$height;
944
- var theme = useTheme();
2763
+ var theme = distExports.useTheme();
945
2764
  return /*#__PURE__*/React.createElement("svg", {
946
2765
  viewBox: "0 0 24 24",
947
2766
  width: width,
@@ -1008,39 +2827,6 @@ var stopPropagation = function stopPropagation(event) {
1008
2827
  event.nativeEvent.stopImmediatePropagation();
1009
2828
  };
1010
2829
 
1011
- /* "use client" */
1012
-
1013
- var classObjectToString = function classObjectToString(className) {
1014
- var keys = Object.keys(className);
1015
- var len = keys.length;
1016
- var str = '';
1017
- for (var index = 0; index < len; index++) {
1018
- var key = keys[index];
1019
- var val = className[keys[index]];
1020
- if (!val) continue;
1021
- str = str ? "".concat(str, " ").concat(String(key)) : String(key);
1022
- }
1023
- return str;
1024
- };
1025
- var isObjectClassName = function isObjectClassName(value) {
1026
- return _typeof(value) === 'object' && !Array.isArray(value);
1027
- };
1028
- var useClasses = function useClasses() {
1029
- var len = arguments.length;
1030
- var classes = '';
1031
- if (len === 0) return classes;
1032
- for (var index = 0; index < len; index++) {
1033
- var val = index < 0 || arguments.length <= index ? undefined : arguments[index];
1034
- if (!val) continue;
1035
- if (isObjectClassName(val)) {
1036
- classes += " ".concat(classObjectToString(val));
1037
- } else {
1038
- classes += " ".concat(String(val).trim());
1039
- }
1040
- }
1041
- return classes.trim();
1042
- };
1043
-
1044
2830
  var _excluded$2 = ["name", "parentPath", "level", "extra", "className"];
1045
2831
  var TreeFile = function TreeFile(_ref) {
1046
2832
  var name = _ref.name,
@@ -1052,7 +2838,7 @@ var TreeFile = function TreeFile(_ref) {
1052
2838
  _ref$className = _ref.className,
1053
2839
  className = _ref$className === void 0 ? '' : _ref$className,
1054
2840
  props = _objectWithoutProperties(_ref, _excluded$2);
1055
- var theme = useTheme();
2841
+ var theme = distExports.useTheme();
1056
2842
  var _useTreeContext = useTreeContext(),
1057
2843
  onFileClick = _useTreeContext.onFileClick;
1058
2844
  var currentPath = React.useMemo(function () {
@@ -1065,7 +2851,7 @@ var TreeFile = function TreeFile(_ref) {
1065
2851
  return /*#__PURE__*/React.createElement("div", _extends({
1066
2852
  onClick: clickHandler
1067
2853
  }, props, {
1068
- className: _JSXStyle.dynamic([["4220802947", [level, theme.palette.accents_2, theme.palette.accents_8, theme.palette.accents_5]]]) + " " + (props && props.className != null && props.className || useClasses('file', className) || "")
2854
+ className: _JSXStyle.dynamic([["4220802947", [level, theme.palette.accents_2, theme.palette.accents_8, theme.palette.accents_5]]]) + " " + (props && props.className != null && props.className || distExports.useClasses('file', className) || "")
1069
2855
  }), /*#__PURE__*/React.createElement("div", {
1070
2856
  className: _JSXStyle.dynamic([["4220802947", [level, theme.palette.accents_2, theme.palette.accents_8, theme.palette.accents_5]]]) + " " + "names"
1071
2857
  }, /*#__PURE__*/React.createElement(TreeIndents, {
@@ -1104,135 +2890,13 @@ var setChildrenProps = function setChildrenProps(children, props) {
1104
2890
  });
1105
2891
  };
1106
2892
 
1107
- var getRealShape = function getRealShape(el) {
1108
- var defaultShape = {
1109
- width: 0,
1110
- height: 0
1111
- };
1112
- if (!el || typeof window === 'undefined') return defaultShape;
1113
- var rect = el.getBoundingClientRect();
1114
- var _window$getComputedSt = window.getComputedStyle(el),
1115
- width = _window$getComputedSt.width,
1116
- height = _window$getComputedSt.height;
1117
- var getCSSStyleVal = function getCSSStyleVal(str, parentNum) {
1118
- if (!str) return 0;
1119
- var strVal = str.includes('px') ? +str.split('px')[0] : str.includes('%') ? +str.split('%')[0] * parentNum * 0.01 : str;
1120
- return Number.isNaN(+strVal) ? 0 : +strVal;
1121
- };
1122
- return {
1123
- width: getCSSStyleVal("".concat(width), rect.width),
1124
- height: getCSSStyleVal("".concat(height), rect.height)
1125
- };
1126
- };
1127
- var useRealShape = function useRealShape(ref) {
1128
- var _useState = React.useState({
1129
- width: 0,
1130
- height: 0
1131
- }),
1132
- _useState2 = _slicedToArray(_useState, 2),
1133
- state = _useState2[0],
1134
- setState = _useState2[1];
1135
- var update = function update() {
1136
- var _getRealShape = getRealShape(ref.current),
1137
- width = _getRealShape.width,
1138
- height = _getRealShape.height;
1139
- setState({
1140
- width: width,
1141
- height: height
1142
- });
1143
- };
1144
- React.useEffect(function () {
1145
- return update();
1146
- }, [ref.current]);
1147
- return [state, update];
1148
- };
1149
-
1150
- var Expand = function Expand(_ref) {
1151
- var _ref$isExpanded = _ref.isExpanded,
1152
- isExpanded = _ref$isExpanded === void 0 ? false : _ref$isExpanded,
1153
- _ref$delay = _ref.delay,
1154
- delay = _ref$delay === void 0 ? 200 : _ref$delay,
1155
- children = _ref.children;
1156
- var _useState = React.useState(isExpanded ? 'auto' : '0'),
1157
- _useState2 = _slicedToArray(_useState, 2),
1158
- height = _useState2[0],
1159
- setHeight = _useState2[1];
1160
- var _useState3 = React.useState(isExpanded),
1161
- _useState4 = _slicedToArray(_useState3, 2),
1162
- selfExpanded = _useState4[0],
1163
- setSelfExpanded = _useState4[1];
1164
- var _useState5 = React.useState(isExpanded),
1165
- _useState6 = _slicedToArray(_useState5, 2),
1166
- visible = _useState6[0],
1167
- setVisible = _useState6[1];
1168
- var contentRef = React.useRef(null);
1169
- var entryTimer = React.useRef();
1170
- var leaveTimer = React.useRef();
1171
- var resetTimer = React.useRef();
1172
- var _useRealShape = useRealShape(contentRef),
1173
- _useRealShape2 = _slicedToArray(_useRealShape, 2),
1174
- state = _useRealShape2[0],
1175
- updateShape = _useRealShape2[1];
1176
- var classes = useClasses('container', {
1177
- expanded: selfExpanded
1178
- });
1179
- React.useEffect(function () {
1180
- return setHeight("".concat(state.height, "px"));
1181
- }, [state.height]);
1182
- React.useEffect(function () {
1183
- // show element or reset height.
1184
- // force an update once manually, even if the element does not change.
1185
- // (the height of the element might be "auto")
1186
- if (isExpanded) {
1187
- setVisible(isExpanded);
1188
- } else {
1189
- updateShape();
1190
- setHeight("".concat(state.height, "px"));
1191
- }
1192
-
1193
- // show expand animation
1194
- entryTimer.current = window.setTimeout(function () {
1195
- setSelfExpanded(isExpanded);
1196
- clearTimeout(entryTimer.current);
1197
- }, 30);
1198
-
1199
- // Reset height after animation
1200
- if (isExpanded) {
1201
- resetTimer.current = window.setTimeout(function () {
1202
- setHeight('auto');
1203
- clearTimeout(resetTimer.current);
1204
- }, delay);
1205
- } else {
1206
- leaveTimer.current = window.setTimeout(function () {
1207
- setVisible(isExpanded);
1208
- clearTimeout(leaveTimer.current);
1209
- }, delay / 2);
1210
- }
1211
- return function () {
1212
- clearTimeout(entryTimer.current);
1213
- clearTimeout(leaveTimer.current);
1214
- clearTimeout(resetTimer.current);
1215
- };
1216
- }, [isExpanded]);
1217
- return /*#__PURE__*/React.createElement("div", {
1218
- className: _JSXStyle.dynamic([["1918690829", [visible ? 'visible' : 'hidden', delay, height]]]) + " " + (classes || "")
1219
- }, /*#__PURE__*/React.createElement("div", {
1220
- ref: contentRef,
1221
- className: _JSXStyle.dynamic([["1918690829", [visible ? 'visible' : 'hidden', delay, height]]]) + " " + "content"
1222
- }, children), /*#__PURE__*/React.createElement(_JSXStyle, {
1223
- id: "1918690829",
1224
- dynamic: [visible ? 'visible' : 'hidden', delay, height]
1225
- }, ".container.__jsx-style-dynamic-selector{padding:0;margin:0;height:0;overflow:hidden;visibility:".concat(visible ? 'visible' : 'hidden', ";-webkit-transition:height ").concat(delay, "ms ease;transition:height ").concat(delay, "ms ease;}.expanded.__jsx-style-dynamic-selector{height:").concat(height, ";visibility:visible;}")));
1226
- };
1227
- Expand.displayName = 'Expand';
1228
-
1229
2893
  var TreeFolderIcon = function TreeFolderIcon(_ref) {
1230
2894
  var color = _ref.color,
1231
2895
  _ref$width = _ref.width,
1232
2896
  width = _ref$width === void 0 ? 22 : _ref$width,
1233
2897
  _ref$height = _ref.height,
1234
2898
  height = _ref$height === void 0 ? 22 : _ref$height;
1235
- var theme = useTheme();
2899
+ var theme = distExports.useTheme();
1236
2900
  return /*#__PURE__*/React.createElement("svg", {
1237
2901
  viewBox: "0 0 24 24",
1238
2902
  width: width,
@@ -1262,7 +2926,7 @@ var TreeStatusIcon = function TreeStatusIcon(_ref) {
1262
2926
  height = _ref$height === void 0 ? 12 : _ref$height,
1263
2927
  _ref$active = _ref.active,
1264
2928
  active = _ref$active === void 0 ? false : _ref$active;
1265
- var theme = useTheme();
2929
+ var theme = distExports.useTheme();
1266
2930
  return /*#__PURE__*/React.createElement("svg", {
1267
2931
  viewBox: "0 0 24 24",
1268
2932
  width: width,
@@ -1307,7 +2971,7 @@ var _TreeFolder = function TreeFolder(_ref) {
1307
2971
  extra = _ref.extra,
1308
2972
  className = _ref.className,
1309
2973
  props = _objectWithoutProperties(_ref, _excluded$1);
1310
- var theme = useTheme();
2974
+ var theme = distExports.useTheme();
1311
2975
  var _useTreeContext = useTreeContext(),
1312
2976
  initialExpand = _useTreeContext.initialExpand,
1313
2977
  isImperative = _useTreeContext.isImperative;
@@ -1332,7 +2996,7 @@ var _TreeFolder = function TreeFolder(_ref) {
1332
2996
  return /*#__PURE__*/React.createElement("div", _extends({
1333
2997
  onClick: clickHandler
1334
2998
  }, props, {
1335
- className: _JSXStyle.dynamic([["1983983326", [parentLevel, theme.palette.accents_2, theme.palette.background, theme.palette.accents_8, theme.palette.accents_5]]]) + " " + (props && props.className != null && props.className || useClasses('folder', className) || "")
2999
+ className: _JSXStyle.dynamic([["1983983326", [parentLevel, theme.palette.accents_2, theme.palette.background, theme.palette.accents_8, theme.palette.accents_5]]]) + " " + (props && props.className != null && props.className || distExports.useClasses('folder', className) || "")
1336
3000
  }), /*#__PURE__*/React.createElement("div", {
1337
3001
  className: _JSXStyle.dynamic([["1983983326", [parentLevel, theme.palette.accents_2, theme.palette.background, theme.palette.accents_8, theme.palette.accents_5]]]) + " " + "names"
1338
3002
  }, /*#__PURE__*/React.createElement(TreeIndents, {
@@ -1347,7 +3011,7 @@ var _TreeFolder = function TreeFolder(_ref) {
1347
3011
  className: _JSXStyle.dynamic([["1983983326", [parentLevel, theme.palette.accents_2, theme.palette.background, theme.palette.accents_8, theme.palette.accents_5]]]) + " " + "name"
1348
3012
  }, name, extra && /*#__PURE__*/React.createElement("span", {
1349
3013
  className: _JSXStyle.dynamic([["1983983326", [parentLevel, theme.palette.accents_2, theme.palette.background, theme.palette.accents_8, theme.palette.accents_5]]]) + " " + "extra"
1350
- }, extra))), /*#__PURE__*/React.createElement(Expand, {
3014
+ }, extra))), /*#__PURE__*/React.createElement(distExports.Expand, {
1351
3015
  isExpanded: expanded
1352
3016
  }, /*#__PURE__*/React.createElement("div", {
1353
3017
  onClick: stopPropagation,
@@ -1419,7 +3083,7 @@ var Tree = function Tree(_ref) {
1419
3083
  return /*#__PURE__*/React.createElement(TreeContext.Provider, {
1420
3084
  value: initialValue
1421
3085
  }, /*#__PURE__*/React.createElement("div", _extends({}, props, {
1422
- className: "jsx-2273069862" + " " + (props && props.className != null && props.className || useClasses('tree', className) || "")
3086
+ className: "jsx-2273069862" + " " + (props && props.className != null && props.className || distExports.useClasses('tree', className) || "")
1423
3087
  }), customChildren, /*#__PURE__*/React.createElement(_JSXStyle, {
1424
3088
  id: "2273069862"
1425
3089
  }, ".tree.jsx-2273069862{padding-left:1.625rem;}")));