@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,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var reactDom = require('react-dom');
6
+ var require$$1 = require('react-dom');
7
7
 
8
8
  function _arrayLikeToArray(r, a) {
9
9
  (null == a || a > r.length) && (a = r.length);
@@ -64,14 +64,6 @@ function _createForOfIteratorHelper(r, e) {
64
64
  }
65
65
  };
66
66
  }
67
- function _defineProperty(e, r, t) {
68
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
69
- value: t,
70
- enumerable: true,
71
- configurable: true,
72
- writable: true
73
- }) : e[r] = t, e;
74
- }
75
67
  function _extends() {
76
68
  return _extends = Object.assign ? Object.assign.bind() : function (n) {
77
69
  for (var e = 1; e < arguments.length; e++) {
@@ -117,27 +109,6 @@ function _nonIterableRest() {
117
109
  function _nonIterableSpread() {
118
110
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
119
111
  }
120
- function ownKeys(e, r) {
121
- var t = Object.keys(e);
122
- if (Object.getOwnPropertySymbols) {
123
- var o = Object.getOwnPropertySymbols(e);
124
- r && (o = o.filter(function (r) {
125
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
126
- })), t.push.apply(t, o);
127
- }
128
- return t;
129
- }
130
- function _objectSpread2(e) {
131
- for (var r = 1; r < arguments.length; r++) {
132
- var t = null != arguments[r] ? arguments[r] : {};
133
- r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
134
- _defineProperty(e, r, t[r]);
135
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
136
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
137
- });
138
- }
139
- return e;
140
- }
141
112
  function _objectWithoutProperties(e, t) {
142
113
  if (null == e) return {};
143
114
  var o,
@@ -164,29 +135,6 @@ function _slicedToArray(r, e) {
164
135
  function _toConsumableArray(r) {
165
136
  return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
166
137
  }
167
- function _toPrimitive(t, r) {
168
- if ("object" != typeof t || !t) return t;
169
- var e = t[Symbol.toPrimitive];
170
- if (void 0 !== e) {
171
- var i = e.call(t, r);
172
- if ("object" != typeof i) return i;
173
- throw new TypeError("@@toPrimitive must return a primitive value.");
174
- }
175
- return ("string" === r ? String : Number)(t);
176
- }
177
- function _toPropertyKey(t) {
178
- var i = _toPrimitive(t, "string");
179
- return "symbol" == typeof i ? i : i + "";
180
- }
181
- function _typeof(o) {
182
- "@babel/helpers - typeof";
183
-
184
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
185
- return typeof o;
186
- } : function (o) {
187
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
188
- }, _typeof(o);
189
- }
190
138
  function _unsupportedIterableToArray(r, a) {
191
139
  if (r) {
192
140
  if ("string" == typeof r) return _arrayLikeToArray(r, a);
@@ -738,279 +686,2127 @@ function requireStyle () {
738
686
  var styleExports = requireStyle();
739
687
  var _JSXStyle = /*@__PURE__*/getDefaultExportFromCjs(styleExports);
740
688
 
741
- var defaultFont = {
742
- sans: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
743
- mono: 'Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace',
744
- prism: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,"Liberation Mono", "Courier New", monospace'
745
- };
746
- var defaultBreakpoints = {
747
- xs: {
748
- min: '0',
749
- max: '650px'
750
- },
751
- sm: {
752
- min: '650px',
753
- max: '900px'
754
- },
755
- md: {
756
- min: '900px',
757
- max: '1280px'
758
- },
759
- lg: {
760
- min: '1280px',
761
- max: '1920px'
762
- },
763
- xl: {
764
- min: '1920px',
765
- max: '10000px'
766
- }
767
- };
768
- var defaultLayout = {
769
- gap: '16pt',
770
- gapNegative: '-16pt',
771
- gapHalf: '8pt',
772
- gapHalfNegative: '-8pt',
773
- gapQuarter: '4pt',
774
- gapQuarterNegative: '-4pt',
775
- pageMargin: '16pt',
776
- pageWidth: '750pt',
777
- pageWidthWithMargin: '782pt',
778
- breakpointMobile: defaultBreakpoints.xs.max,
779
- breakpointTablet: defaultBreakpoints.sm.max,
780
- radius: '6px',
781
- unit: '16px'
782
- };
689
+ var dist = {};
783
690
 
784
- var palette$1 = {
785
- accents_1: '#fafafa',
786
- accents_2: '#eaeaea',
787
- accents_3: '#999',
788
- accents_4: '#888',
789
- accents_5: '#666',
790
- accents_6: '#444',
791
- accents_7: '#333',
792
- accents_8: '#111',
793
- background: '#fff',
794
- foreground: '#000',
795
- selection: '#79ffe1',
796
- secondary: '#666',
797
- code: '#f81ce5',
798
- border: '#eaeaea',
799
- error: '#e00',
800
- errorLight: '#ff1a1a',
801
- errorLighter: '#f7d4d6',
802
- errorDark: '#c50000',
803
- success: '#0070f3',
804
- successLight: '#3291ff',
805
- successLighter: '#d3e5ff',
806
- successDark: '#0761d1',
807
- warning: '#f5a623',
808
- warningLight: '#f7b955',
809
- warningLighter: '#ffefcf',
810
- warningDark: '#ab570a',
811
- cyan: '#50e3c2',
812
- cyanLighter: '#aaffec',
813
- cyanLight: '#79ffe1',
814
- cyanDark: '#29bc9b',
815
- violet: '#7928ca',
816
- violetLighter: '#e3d7fc',
817
- violetLight: '#8a63d2',
818
- violetDark: '#4c2889',
819
- purple: '#f81ce5',
820
- alert: '#ff0080',
821
- magenta: '#eb367f',
822
- link: '#0070f3'
823
- };
824
- var expressiveness$1 = {
825
- linkStyle: 'none',
826
- linkHoverStyle: 'none',
827
- dropdownBoxShadow: '0 4px 4px 0 rgba(0, 0, 0, 0.02)',
828
- scrollerStart: 'rgba(255, 255, 255, 1)',
829
- scrollerEnd: 'rgba(255, 255, 255, 0)',
830
- shadowSmall: '0 5px 10px rgba(0, 0, 0, 0.12)',
831
- shadowMedium: '0 8px 30px rgba(0, 0, 0, 0.12)',
832
- shadowLarge: '0 30px 60px rgba(0, 0, 0, 0.12)',
833
- portalOpacity: 0.25
834
- };
835
- var font$1 = defaultFont;
836
- var breakpoints$1 = defaultBreakpoints;
837
- var layout$1 = defaultLayout;
838
- var themes$1 = {
839
- type: 'light',
840
- font: font$1,
841
- layout: layout$1,
842
- palette: palette$1,
843
- breakpoints: breakpoints$1,
844
- expressiveness: expressiveness$1
845
- };
691
+ var hasRequiredDist;
846
692
 
847
- var palette = {
848
- accents_1: '#111',
849
- accents_2: '#333',
850
- accents_3: '#444',
851
- accents_4: '#666',
852
- accents_5: '#888',
853
- accents_6: '#999',
854
- accents_7: '#eaeaea',
855
- accents_8: '#fafafa',
856
- background: '#000',
857
- foreground: '#fff',
858
- selection: '#f81ce5',
859
- secondary: '#888',
860
- code: '#79ffe1',
861
- border: '#333',
862
- error: '#e00',
863
- errorLighter: '#f7d4d6',
864
- errorLight: '#ff1a1a',
865
- errorDark: '#c50000',
866
- success: '#0070f3',
867
- successLighter: '#d3e5ff',
868
- successLight: '#3291ff',
869
- successDark: '#0761d1',
870
- warning: '#f5a623',
871
- warningLighter: '#ffefcf',
872
- warningLight: '#f7b955',
873
- warningDark: '#ab570a',
874
- cyan: '#50e3c2',
875
- cyanLighter: '#aaffec',
876
- cyanLight: '#79ffe1',
877
- cyanDark: '#29bc9b',
878
- violet: '#7928ca',
879
- violetLighter: '#e3d7fc',
880
- violetLight: '#8a63d2',
881
- violetDark: '#4c2889',
882
- purple: '#f81ce5',
883
- alert: '#ff0080',
884
- magenta: '#eb367f',
885
- link: '#3291ff'
886
- };
887
- var expressiveness = {
888
- linkStyle: 'none',
889
- linkHoverStyle: 'none',
890
- dropdownBoxShadow: '0 0 0 1px #333',
891
- scrollerStart: 'rgba(255, 255, 255, 1)',
892
- scrollerEnd: 'rgba(255, 255, 255, 0)',
893
- shadowSmall: '0 0 0 1px #333',
894
- shadowMedium: '0 0 0 1px #333',
895
- shadowLarge: '0 0 0 1px #333',
896
- portalOpacity: 0.75
897
- };
898
- var font = defaultFont;
899
- var breakpoints = defaultBreakpoints;
900
- var layout = defaultLayout;
901
- var themes = {
902
- type: 'dark',
903
- font: font,
904
- layout: layout,
905
- palette: palette,
906
- breakpoints: breakpoints,
907
- expressiveness: expressiveness
908
- };
693
+ function requireDist () {
694
+ if (hasRequiredDist) return dist;
695
+ hasRequiredDist = 1;
909
696
 
910
- var isObject = function isObject(target) {
911
- return target && _typeof(target) === 'object';
912
- };
913
- var _deepDuplicable = function deepDuplicable(source, target) {
914
- if (!isObject(target) || !isObject(source)) return source;
915
- var sourceKeys = Object.keys(source);
916
- var result = {};
917
- for (var _i = 0, _sourceKeys = sourceKeys; _i < _sourceKeys.length; _i++) {
918
- var key = _sourceKeys[_i];
919
- var sourceValue = source[key];
920
- var targetValue = target[key];
921
- if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
922
- result[key] = targetValue.concat(sourceValue);
923
- } else if (isObject(sourceValue) && isObject(targetValue)) {
924
- result[key] = _deepDuplicable(sourceValue, _objectSpread2({}, targetValue));
925
- } else if (targetValue) {
926
- result[key] = targetValue;
927
- } else {
928
- result[key] = sourceValue;
929
- }
930
- }
931
- return result;
932
- };
933
- var getPresets = function getPresets() {
934
- return [themes$1, themes];
935
- };
936
- var getPresetStaticTheme = function getPresetStaticTheme() {
937
- return themes$1;
938
- };
939
- var isAvailableThemeType = function isAvailableThemeType(type) {
940
- if (!type) return false;
941
- var presetThemes = getPresets();
942
- var hasType = presetThemes.find(function (theme) {
943
- return theme.type === type;
944
- });
945
- return !hasType;
946
- };
947
- var isPresetTheme = function isPresetTheme(themeOrType) {
948
- if (!themeOrType) return false;
949
- var isType = typeof themeOrType === 'string';
950
- var type = isType ? themeOrType : themeOrType.type;
951
- return !isAvailableThemeType(type);
952
- };
953
- var hasUserCustomTheme = function hasUserCustomTheme() {
954
- var themes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
955
- return !!themes.find(function (item) {
956
- return isAvailableThemeType(item.type);
957
- });
958
- };
959
- var create = function create(base, custom) {
960
- if (!isAvailableThemeType(custom.type)) {
961
- throw new Error('Duplicate or unavailable theme type');
962
- }
963
- return _deepDuplicable(base, custom);
964
- };
965
- var createFromDark = function createFromDark(custom) {
966
- return create(themes, custom);
967
- };
968
- var createFromLight = function createFromLight(custom) {
969
- return create(themes$1, custom);
970
- };
971
- var Themes = {
972
- isPresetTheme: isPresetTheme,
973
- isAvailableThemeType: isAvailableThemeType,
974
- hasUserCustomTheme: hasUserCustomTheme,
975
- getPresets: getPresets,
976
- getPresetStaticTheme: getPresetStaticTheme,
977
- create: create,
978
- createFromDark: createFromDark,
979
- createFromLight: createFromLight
980
- };
697
+ var React$1 = React;
698
+ var reactDom = require$$1;
981
699
 
982
- /* "use client" */
700
+ function _arrayLikeToArray(r, a) {
701
+ (null == a || a > r.length) && (a = r.length);
702
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
703
+ return n;
704
+ }
705
+ function _arrayWithHoles(r) {
706
+ if (Array.isArray(r)) return r;
707
+ }
708
+ function _arrayWithoutHoles(r) {
709
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
710
+ }
711
+ function _defineProperty(e, r, t) {
712
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
713
+ value: t,
714
+ enumerable: true,
715
+ configurable: true,
716
+ writable: true
717
+ }) : e[r] = t, e;
718
+ }
719
+ function _extends() {
720
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
721
+ for (var e = 1; e < arguments.length; e++) {
722
+ var t = arguments[e];
723
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
724
+ }
725
+ return n;
726
+ }, _extends.apply(null, arguments);
727
+ }
728
+ function _iterableToArray(r) {
729
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
730
+ }
731
+ function _iterableToArrayLimit(r, l) {
732
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
733
+ if (null != t) {
734
+ var e,
735
+ n,
736
+ i,
737
+ u,
738
+ a = [],
739
+ f = true,
740
+ o = false;
741
+ try {
742
+ if (i = (t = t.call(r)).next, 0 === l) {
743
+ if (Object(t) !== t) return;
744
+ f = !1;
745
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
746
+ } catch (r) {
747
+ o = true, n = r;
748
+ } finally {
749
+ try {
750
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
751
+ } finally {
752
+ if (o) throw n;
753
+ }
754
+ }
755
+ return a;
756
+ }
757
+ }
758
+ function _nonIterableRest() {
759
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
760
+ }
761
+ function _nonIterableSpread() {
762
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
763
+ }
764
+ function ownKeys(e, r) {
765
+ var t = Object.keys(e);
766
+ if (Object.getOwnPropertySymbols) {
767
+ var o = Object.getOwnPropertySymbols(e);
768
+ r && (o = o.filter(function (r) {
769
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
770
+ })), t.push.apply(t, o);
771
+ }
772
+ return t;
773
+ }
774
+ function _objectSpread2(e) {
775
+ for (var r = 1; r < arguments.length; r++) {
776
+ var t = null != arguments[r] ? arguments[r] : {};
777
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
778
+ _defineProperty(e, r, t[r]);
779
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
780
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
781
+ });
782
+ }
783
+ return e;
784
+ }
785
+ function _objectWithoutProperties(e, t) {
786
+ if (null == e) return {};
787
+ var o,
788
+ r,
789
+ i = _objectWithoutPropertiesLoose(e, t);
790
+ if (Object.getOwnPropertySymbols) {
791
+ var n = Object.getOwnPropertySymbols(e);
792
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
793
+ }
794
+ return i;
795
+ }
796
+ function _objectWithoutPropertiesLoose(r, e) {
797
+ if (null == r) return {};
798
+ var t = {};
799
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
800
+ if (-1 !== e.indexOf(n)) continue;
801
+ t[n] = r[n];
802
+ }
803
+ return t;
804
+ }
805
+ function _slicedToArray(r, e) {
806
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
807
+ }
808
+ function _toConsumableArray(r) {
809
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
810
+ }
811
+ function _toPrimitive(t, r) {
812
+ if ("object" != typeof t || !t) return t;
813
+ var e = t[Symbol.toPrimitive];
814
+ if (void 0 !== e) {
815
+ var i = e.call(t, r);
816
+ if ("object" != typeof i) return i;
817
+ throw new TypeError("@@toPrimitive must return a primitive value.");
818
+ }
819
+ return ("string" === r ? String : Number)(t);
820
+ }
821
+ function _toPropertyKey(t) {
822
+ var i = _toPrimitive(t, "string");
823
+ return "symbol" == typeof i ? i : i + "";
824
+ }
825
+ function _typeof(o) {
826
+ "@babel/helpers - typeof";
827
+
828
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
829
+ return typeof o;
830
+ } : function (o) {
831
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
832
+ }, _typeof(o);
833
+ }
834
+ function _unsupportedIterableToArray(r, a) {
835
+ if (r) {
836
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
837
+ var t = {}.toString.call(r).slice(8, -1);
838
+ 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;
839
+ }
840
+ }
983
841
 
984
- var defaultTheme = Themes.getPresetStaticTheme();
985
- var ThemeContext = /*#__PURE__*/React.createContext(defaultTheme);
986
- var useTheme = function useTheme() {
987
- return React.useContext(ThemeContext);
988
- };
842
+ var defaultToastLayout = {
843
+ padding: '12px 16px',
844
+ margin: '8px 0',
845
+ width: '420px',
846
+ maxWidth: '90vw',
847
+ maxHeight: '75px',
848
+ placement: 'bottomRight'
849
+ };
850
+ var defaultParams = {
851
+ toasts: [],
852
+ toastLayout: defaultToastLayout,
853
+ updateToastLayout: function updateToastLayout(t) {
854
+ return t;
855
+ },
856
+ updateToasts: function updateToasts(t) {
857
+ return t;
858
+ },
859
+ lastUpdateToastId: null,
860
+ updateLastToastId: function updateLastToastId() {
861
+ return null;
862
+ }
863
+ };
864
+ var HUIContent = /*#__PURE__*/React$1.createContext(defaultParams);
865
+ var useHUIContext = function useHUIContext() {
866
+ return React$1.useContext(HUIContent);
867
+ };
989
868
 
990
- var useCurrentState = function useCurrentState(initialState) {
991
- var _useState = React.useState(function () {
992
- return typeof initialState === 'function' ? initialState() : initialState;
993
- }),
994
- _useState2 = _slicedToArray(_useState, 2),
995
- state = _useState2[0],
996
- setState = _useState2[1];
997
- var ref = React.useRef(initialState);
998
- React.useEffect(function () {
999
- ref.current = state;
1000
- }, [state]);
1001
- var setValue = function setValue(val) {
1002
- var result = typeof val === 'function' ? val(ref.current) : val;
1003
- ref.current = result;
1004
- setState(result);
1005
- };
1006
- return [state, setValue, ref];
1007
- };
869
+ var defaultFont = {
870
+ sans: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
871
+ mono: 'Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace',
872
+ prism: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,"Liberation Mono", "Courier New", monospace'
873
+ };
874
+ var defaultBreakpoints = {
875
+ xs: {
876
+ min: '0',
877
+ max: '650px'
878
+ },
879
+ sm: {
880
+ min: '650px',
881
+ max: '900px'
882
+ },
883
+ md: {
884
+ min: '900px',
885
+ max: '1280px'
886
+ },
887
+ lg: {
888
+ min: '1280px',
889
+ max: '1920px'
890
+ },
891
+ xl: {
892
+ min: '1920px',
893
+ max: '10000px'
894
+ }
895
+ };
896
+ var defaultLayout = {
897
+ gap: '16pt',
898
+ gapNegative: '-16pt',
899
+ gapHalf: '8pt',
900
+ gapHalfNegative: '-8pt',
901
+ gapQuarter: '4pt',
902
+ gapQuarterNegative: '-4pt',
903
+ pageMargin: '16pt',
904
+ pageWidth: '750pt',
905
+ pageWidthWithMargin: '782pt',
906
+ breakpointMobile: defaultBreakpoints.xs.max,
907
+ breakpointTablet: defaultBreakpoints.sm.max,
908
+ radius: '6px',
909
+ unit: '16px'
910
+ };
911
+
912
+ var palette$1 = {
913
+ accents_1: '#fafafa',
914
+ accents_2: '#eaeaea',
915
+ accents_3: '#999',
916
+ accents_4: '#888',
917
+ accents_5: '#666',
918
+ accents_6: '#444',
919
+ accents_7: '#333',
920
+ accents_8: '#111',
921
+ background: '#fff',
922
+ foreground: '#000',
923
+ selection: '#79ffe1',
924
+ secondary: '#666',
925
+ code: '#f81ce5',
926
+ border: '#eaeaea',
927
+ error: '#e00',
928
+ errorLight: '#ff1a1a',
929
+ errorLighter: '#f7d4d6',
930
+ errorDark: '#c50000',
931
+ success: '#0070f3',
932
+ successLight: '#3291ff',
933
+ successLighter: '#d3e5ff',
934
+ successDark: '#0761d1',
935
+ warning: '#f5a623',
936
+ warningLight: '#f7b955',
937
+ warningLighter: '#ffefcf',
938
+ warningDark: '#ab570a',
939
+ cyan: '#50e3c2',
940
+ cyanLighter: '#aaffec',
941
+ cyanLight: '#79ffe1',
942
+ cyanDark: '#29bc9b',
943
+ violet: '#7928ca',
944
+ violetLighter: '#e3d7fc',
945
+ violetLight: '#8a63d2',
946
+ violetDark: '#4c2889',
947
+ purple: '#f81ce5',
948
+ alert: '#ff0080',
949
+ magenta: '#eb367f',
950
+ link: '#0070f3'
951
+ };
952
+ var expressiveness$1 = {
953
+ linkStyle: 'none',
954
+ linkHoverStyle: 'none',
955
+ dropdownBoxShadow: '0 4px 4px 0 rgba(0, 0, 0, 0.02)',
956
+ scrollerStart: 'rgba(255, 255, 255, 1)',
957
+ scrollerEnd: 'rgba(255, 255, 255, 0)',
958
+ shadowSmall: '0 5px 10px rgba(0, 0, 0, 0.12)',
959
+ shadowMedium: '0 8px 30px rgba(0, 0, 0, 0.12)',
960
+ shadowLarge: '0 30px 60px rgba(0, 0, 0, 0.12)',
961
+ portalOpacity: 0.25
962
+ };
963
+ var font$1 = defaultFont;
964
+ var breakpoints$1 = defaultBreakpoints;
965
+ var layout$1 = defaultLayout;
966
+ var themes$1 = {
967
+ type: 'light',
968
+ font: font$1,
969
+ layout: layout$1,
970
+ palette: palette$1,
971
+ breakpoints: breakpoints$1,
972
+ expressiveness: expressiveness$1
973
+ };
974
+
975
+ var palette = {
976
+ accents_1: '#111',
977
+ accents_2: '#333',
978
+ accents_3: '#444',
979
+ accents_4: '#666',
980
+ accents_5: '#888',
981
+ accents_6: '#999',
982
+ accents_7: '#eaeaea',
983
+ accents_8: '#fafafa',
984
+ background: '#000',
985
+ foreground: '#fff',
986
+ selection: '#f81ce5',
987
+ secondary: '#888',
988
+ code: '#79ffe1',
989
+ border: '#333',
990
+ error: '#e00',
991
+ errorLighter: '#f7d4d6',
992
+ errorLight: '#ff1a1a',
993
+ errorDark: '#c50000',
994
+ success: '#0070f3',
995
+ successLighter: '#d3e5ff',
996
+ successLight: '#3291ff',
997
+ successDark: '#0761d1',
998
+ warning: '#f5a623',
999
+ warningLighter: '#ffefcf',
1000
+ warningLight: '#f7b955',
1001
+ warningDark: '#ab570a',
1002
+ cyan: '#50e3c2',
1003
+ cyanLighter: '#aaffec',
1004
+ cyanLight: '#79ffe1',
1005
+ cyanDark: '#29bc9b',
1006
+ violet: '#7928ca',
1007
+ violetLighter: '#e3d7fc',
1008
+ violetLight: '#8a63d2',
1009
+ violetDark: '#4c2889',
1010
+ purple: '#f81ce5',
1011
+ alert: '#ff0080',
1012
+ magenta: '#eb367f',
1013
+ link: '#3291ff'
1014
+ };
1015
+ var expressiveness = {
1016
+ linkStyle: 'none',
1017
+ linkHoverStyle: 'none',
1018
+ dropdownBoxShadow: '0 0 0 1px #333',
1019
+ scrollerStart: 'rgba(255, 255, 255, 1)',
1020
+ scrollerEnd: 'rgba(255, 255, 255, 0)',
1021
+ shadowSmall: '0 0 0 1px #333',
1022
+ shadowMedium: '0 0 0 1px #333',
1023
+ shadowLarge: '0 0 0 1px #333',
1024
+ portalOpacity: 0.75
1025
+ };
1026
+ var font = defaultFont;
1027
+ var breakpoints = defaultBreakpoints;
1028
+ var layout = defaultLayout;
1029
+ var themes = {
1030
+ type: 'dark',
1031
+ font: font,
1032
+ layout: layout,
1033
+ palette: palette,
1034
+ breakpoints: breakpoints,
1035
+ expressiveness: expressiveness
1036
+ };
1037
+
1038
+ var isObject = function isObject(target) {
1039
+ return target && _typeof(target) === 'object';
1040
+ };
1041
+ var _deepDuplicable = function deepDuplicable(source, target) {
1042
+ if (!isObject(target) || !isObject(source)) return source;
1043
+ var sourceKeys = Object.keys(source);
1044
+ var result = {};
1045
+ for (var _i = 0, _sourceKeys = sourceKeys; _i < _sourceKeys.length; _i++) {
1046
+ var key = _sourceKeys[_i];
1047
+ var sourceValue = source[key];
1048
+ var targetValue = target[key];
1049
+ if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
1050
+ result[key] = targetValue.concat(sourceValue);
1051
+ } else if (isObject(sourceValue) && isObject(targetValue)) {
1052
+ result[key] = _deepDuplicable(sourceValue, _objectSpread2({}, targetValue));
1053
+ } else if (targetValue) {
1054
+ result[key] = targetValue;
1055
+ } else {
1056
+ result[key] = sourceValue;
1057
+ }
1058
+ }
1059
+ return result;
1060
+ };
1061
+ var getPresets = function getPresets() {
1062
+ return [themes$1, themes];
1063
+ };
1064
+ var getPresetStaticTheme = function getPresetStaticTheme() {
1065
+ return themes$1;
1066
+ };
1067
+ var isAvailableThemeType = function isAvailableThemeType(type) {
1068
+ if (!type) return false;
1069
+ var presetThemes = getPresets();
1070
+ var hasType = presetThemes.find(function (theme) {
1071
+ return theme.type === type;
1072
+ });
1073
+ return !hasType;
1074
+ };
1075
+ var isPresetTheme = function isPresetTheme(themeOrType) {
1076
+ if (!themeOrType) return false;
1077
+ var isType = typeof themeOrType === 'string';
1078
+ var type = isType ? themeOrType : themeOrType.type;
1079
+ return !isAvailableThemeType(type);
1080
+ };
1081
+ var hasUserCustomTheme = function hasUserCustomTheme() {
1082
+ var themes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1083
+ return !!themes.find(function (item) {
1084
+ return isAvailableThemeType(item.type);
1085
+ });
1086
+ };
1087
+ var create = function create(base, custom) {
1088
+ if (!isAvailableThemeType(custom.type)) {
1089
+ throw new Error('Duplicate or unavailable theme type');
1090
+ }
1091
+ return _deepDuplicable(base, custom);
1092
+ };
1093
+ var createFromDark = function createFromDark(custom) {
1094
+ return create(themes, custom);
1095
+ };
1096
+ var createFromLight = function createFromLight(custom) {
1097
+ return create(themes$1, custom);
1098
+ };
1099
+ var Themes = {
1100
+ isPresetTheme: isPresetTheme,
1101
+ isAvailableThemeType: isAvailableThemeType,
1102
+ hasUserCustomTheme: hasUserCustomTheme,
1103
+ getPresets: getPresets,
1104
+ getPresetStaticTheme: getPresetStaticTheme,
1105
+ create: create,
1106
+ createFromDark: createFromDark,
1107
+ createFromLight: createFromLight
1108
+ };
1109
+
1110
+ /* "use client" */
1111
+
1112
+ var defaultTheme = Themes.getPresetStaticTheme();
1113
+ var ThemeContext = /*#__PURE__*/React$1.createContext(defaultTheme);
1114
+ var useTheme = function useTheme() {
1115
+ return React$1.useContext(ThemeContext);
1116
+ };
1117
+
1118
+ /* "use client" */
1119
+
1120
+ var defaultAllThemesConfig = {
1121
+ themes: Themes.getPresets()
1122
+ };
1123
+ var AllThemesContext = /*#__PURE__*/React$1.createContext(defaultAllThemesConfig);
1124
+ var useAllThemes = function useAllThemes() {
1125
+ return React$1.useContext(AllThemesContext);
1126
+ };
1127
+
1128
+ var ThemeProvider = function ThemeProvider(_ref) {
1129
+ var children = _ref.children,
1130
+ themeType = _ref.themeType,
1131
+ _ref$themes = _ref.themes,
1132
+ themes = _ref$themes === void 0 ? [] : _ref$themes;
1133
+ var _React$useState = React$1.useState({
1134
+ themes: Themes.getPresets()
1135
+ }),
1136
+ _React$useState2 = _slicedToArray(_React$useState, 2),
1137
+ allThemes = _React$useState2[0],
1138
+ setAllThemes = _React$useState2[1];
1139
+ var currentTheme = React$1.useMemo(function () {
1140
+ var theme = allThemes.themes.find(function (item) {
1141
+ return item.type === themeType;
1142
+ });
1143
+ if (theme) return theme;
1144
+ return Themes.getPresetStaticTheme();
1145
+ }, [allThemes, themeType]);
1146
+ React$1.useEffect(function () {
1147
+ if (!(themes !== null && themes !== void 0 && themes.length)) return;
1148
+ setAllThemes(function (last) {
1149
+ var safeThemes = themes.filter(function (item) {
1150
+ return Themes.isAvailableThemeType(item.type);
1151
+ });
1152
+ var nextThemes = Themes.getPresets().concat(safeThemes);
1153
+ return _objectSpread2(_objectSpread2({}, last), {}, {
1154
+ themes: nextThemes
1155
+ });
1156
+ });
1157
+ }, [themes]);
1158
+ return /*#__PURE__*/React$1.createElement(AllThemesContext.Provider, {
1159
+ value: allThemes
1160
+ }, /*#__PURE__*/React$1.createElement(ThemeContext.Provider, {
1161
+ value: currentTheme
1162
+ }, children));
1163
+ };
1164
+
1165
+ var useCurrentState = function useCurrentState(initialState) {
1166
+ var _useState = React$1.useState(function () {
1167
+ return typeof initialState === 'function' ? initialState() : initialState;
1168
+ }),
1169
+ _useState2 = _slicedToArray(_useState, 2),
1170
+ state = _useState2[0],
1171
+ setState = _useState2[1];
1172
+ var ref = React$1.useRef(initialState);
1173
+ React$1.useEffect(function () {
1174
+ ref.current = state;
1175
+ }, [state]);
1176
+ var setValue = function setValue(val) {
1177
+ var result = typeof val === 'function' ? val(ref.current) : val;
1178
+ ref.current = result;
1179
+ setState(result);
1180
+ };
1181
+ return [state, setValue, ref];
1182
+ };
1183
+
1184
+ function getDefaultExportFromCjs (x) {
1185
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1186
+ }
1187
+
1188
+ var index = {};
1189
+
1190
+ var hasRequiredIndex;
1191
+
1192
+ function requireIndex () {
1193
+ if (hasRequiredIndex) return index;
1194
+ hasRequiredIndex = 1;
1195
+ var React$1$1 = React$1;
1196
+
1197
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
1198
+
1199
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1$1);
1200
+
1201
+ /*
1202
+ Based on Glamor's sheet
1203
+ https://github.com/threepointone/glamor/blob/667b480d31b3721a905021b26e1290ce92ca2879/src/sheet.js
1204
+ */ function _defineProperties(target, props) {
1205
+ for(var i = 0; i < props.length; i++){
1206
+ var descriptor = props[i];
1207
+ descriptor.enumerable = descriptor.enumerable || false;
1208
+ descriptor.configurable = true;
1209
+ if ("value" in descriptor) descriptor.writable = true;
1210
+ Object.defineProperty(target, descriptor.key, descriptor);
1211
+ }
1212
+ }
1213
+ function _createClass(Constructor, protoProps, staticProps) {
1214
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1215
+ return Constructor;
1216
+ }
1217
+ var isProd = typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production";
1218
+ var isString = function(o) {
1219
+ return Object.prototype.toString.call(o) === "[object String]";
1220
+ };
1221
+ var StyleSheet = /*#__PURE__*/ function() {
1222
+ function StyleSheet(param) {
1223
+ var ref = param === void 0 ? {} : param, _name = ref.name, name = _name === void 0 ? "stylesheet" : _name, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? isProd : _optimizeForSpeed;
1224
+ invariant$1(isString(name), "`name` must be a string");
1225
+ this._name = name;
1226
+ this._deletedRulePlaceholder = "#" + name + "-deleted-rule____{}";
1227
+ invariant$1(typeof optimizeForSpeed === "boolean", "`optimizeForSpeed` must be a boolean");
1228
+ this._optimizeForSpeed = optimizeForSpeed;
1229
+ this._serverSheet = undefined;
1230
+ this._tags = [];
1231
+ this._injected = false;
1232
+ this._rulesCount = 0;
1233
+ var node = typeof window !== "undefined" && document.querySelector('meta[property="csp-nonce"]');
1234
+ this._nonce = node ? node.getAttribute("content") : null;
1235
+ }
1236
+ var _proto = StyleSheet.prototype;
1237
+ _proto.setOptimizeForSpeed = function setOptimizeForSpeed(bool) {
1238
+ invariant$1(typeof bool === "boolean", "`setOptimizeForSpeed` accepts a boolean");
1239
+ invariant$1(this._rulesCount === 0, "optimizeForSpeed cannot be when rules have already been inserted");
1240
+ this.flush();
1241
+ this._optimizeForSpeed = bool;
1242
+ this.inject();
1243
+ };
1244
+ _proto.isOptimizeForSpeed = function isOptimizeForSpeed() {
1245
+ return this._optimizeForSpeed;
1246
+ };
1247
+ _proto.inject = function inject() {
1248
+ var _this = this;
1249
+ invariant$1(!this._injected, "sheet already injected");
1250
+ this._injected = true;
1251
+ if (typeof window !== "undefined" && this._optimizeForSpeed) {
1252
+ this._tags[0] = this.makeStyleTag(this._name);
1253
+ this._optimizeForSpeed = "insertRule" in this.getSheet();
1254
+ if (!this._optimizeForSpeed) {
1255
+ if (!isProd) {
1256
+ console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode.");
1257
+ }
1258
+ this.flush();
1259
+ this._injected = true;
1260
+ }
1261
+ return;
1262
+ }
1263
+ this._serverSheet = {
1264
+ cssRules: [],
1265
+ insertRule: function(rule, index) {
1266
+ if (typeof index === "number") {
1267
+ _this._serverSheet.cssRules[index] = {
1268
+ cssText: rule
1269
+ };
1270
+ } else {
1271
+ _this._serverSheet.cssRules.push({
1272
+ cssText: rule
1273
+ });
1274
+ }
1275
+ return index;
1276
+ },
1277
+ deleteRule: function(index) {
1278
+ _this._serverSheet.cssRules[index] = null;
1279
+ }
1280
+ };
1281
+ };
1282
+ _proto.getSheetForTag = function getSheetForTag(tag) {
1283
+ if (tag.sheet) {
1284
+ return tag.sheet;
1285
+ }
1286
+ // this weirdness brought to you by firefox
1287
+ for(var i = 0; i < document.styleSheets.length; i++){
1288
+ if (document.styleSheets[i].ownerNode === tag) {
1289
+ return document.styleSheets[i];
1290
+ }
1291
+ }
1292
+ };
1293
+ _proto.getSheet = function getSheet() {
1294
+ return this.getSheetForTag(this._tags[this._tags.length - 1]);
1295
+ };
1296
+ _proto.insertRule = function insertRule(rule, index) {
1297
+ invariant$1(isString(rule), "`insertRule` accepts only strings");
1298
+ if (typeof window === "undefined") {
1299
+ if (typeof index !== "number") {
1300
+ index = this._serverSheet.cssRules.length;
1301
+ }
1302
+ this._serverSheet.insertRule(rule, index);
1303
+ return this._rulesCount++;
1304
+ }
1305
+ if (this._optimizeForSpeed) {
1306
+ var sheet = this.getSheet();
1307
+ if (typeof index !== "number") {
1308
+ index = sheet.cssRules.length;
1309
+ }
1310
+ // this weirdness for perf, and chrome's weird bug
1311
+ // https://stackoverflow.com/questions/20007992/chrome-suddenly-stopped-accepting-insertrule
1312
+ try {
1313
+ sheet.insertRule(rule, index);
1314
+ } catch (error) {
1315
+ if (!isProd) {
1316
+ console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
1317
+ }
1318
+ return -1;
1319
+ }
1320
+ } else {
1321
+ var insertionPoint = this._tags[index];
1322
+ this._tags.push(this.makeStyleTag(this._name, rule, insertionPoint));
1323
+ }
1324
+ return this._rulesCount++;
1325
+ };
1326
+ _proto.replaceRule = function replaceRule(index, rule) {
1327
+ if (this._optimizeForSpeed || typeof window === "undefined") {
1328
+ var sheet = typeof window !== "undefined" ? this.getSheet() : this._serverSheet;
1329
+ if (!rule.trim()) {
1330
+ rule = this._deletedRulePlaceholder;
1331
+ }
1332
+ if (!sheet.cssRules[index]) {
1333
+ // @TBD Should we throw an error?
1334
+ return index;
1335
+ }
1336
+ sheet.deleteRule(index);
1337
+ try {
1338
+ sheet.insertRule(rule, index);
1339
+ } catch (error) {
1340
+ if (!isProd) {
1341
+ console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
1342
+ }
1343
+ // In order to preserve the indices we insert a deleteRulePlaceholder
1344
+ sheet.insertRule(this._deletedRulePlaceholder, index);
1345
+ }
1346
+ } else {
1347
+ var tag = this._tags[index];
1348
+ invariant$1(tag, "old rule at index `" + index + "` not found");
1349
+ tag.textContent = rule;
1350
+ }
1351
+ return index;
1352
+ };
1353
+ _proto.deleteRule = function deleteRule(index) {
1354
+ if (typeof window === "undefined") {
1355
+ this._serverSheet.deleteRule(index);
1356
+ return;
1357
+ }
1358
+ if (this._optimizeForSpeed) {
1359
+ this.replaceRule(index, "");
1360
+ } else {
1361
+ var tag = this._tags[index];
1362
+ invariant$1(tag, "rule at index `" + index + "` not found");
1363
+ tag.parentNode.removeChild(tag);
1364
+ this._tags[index] = null;
1365
+ }
1366
+ };
1367
+ _proto.flush = function flush() {
1368
+ this._injected = false;
1369
+ this._rulesCount = 0;
1370
+ if (typeof window !== "undefined") {
1371
+ this._tags.forEach(function(tag) {
1372
+ return tag && tag.parentNode.removeChild(tag);
1373
+ });
1374
+ this._tags = [];
1375
+ } else {
1376
+ // simpler on server
1377
+ this._serverSheet.cssRules = [];
1378
+ }
1379
+ };
1380
+ _proto.cssRules = function cssRules() {
1381
+ var _this = this;
1382
+ if (typeof window === "undefined") {
1383
+ return this._serverSheet.cssRules;
1384
+ }
1385
+ return this._tags.reduce(function(rules, tag) {
1386
+ if (tag) {
1387
+ rules = rules.concat(Array.prototype.map.call(_this.getSheetForTag(tag).cssRules, function(rule) {
1388
+ return rule.cssText === _this._deletedRulePlaceholder ? null : rule;
1389
+ }));
1390
+ } else {
1391
+ rules.push(null);
1392
+ }
1393
+ return rules;
1394
+ }, []);
1395
+ };
1396
+ _proto.makeStyleTag = function makeStyleTag(name, cssString, relativeToTag) {
1397
+ if (cssString) {
1398
+ invariant$1(isString(cssString), "makeStyleTag accepts only strings as second parameter");
1399
+ }
1400
+ var tag = document.createElement("style");
1401
+ if (this._nonce) tag.setAttribute("nonce", this._nonce);
1402
+ tag.type = "text/css";
1403
+ tag.setAttribute("data-" + name, "");
1404
+ if (cssString) {
1405
+ tag.appendChild(document.createTextNode(cssString));
1406
+ }
1407
+ var head = document.head || document.getElementsByTagName("head")[0];
1408
+ if (relativeToTag) {
1409
+ head.insertBefore(tag, relativeToTag);
1410
+ } else {
1411
+ head.appendChild(tag);
1412
+ }
1413
+ return tag;
1414
+ };
1415
+ _createClass(StyleSheet, [
1416
+ {
1417
+ key: "length",
1418
+ get: function get() {
1419
+ return this._rulesCount;
1420
+ }
1421
+ }
1422
+ ]);
1423
+ return StyleSheet;
1424
+ }();
1425
+ function invariant$1(condition, message) {
1426
+ if (!condition) {
1427
+ throw new Error("StyleSheet: " + message + ".");
1428
+ }
1429
+ }
1430
+
1431
+ function hash(str) {
1432
+ var _$hash = 5381, i = str.length;
1433
+ while(i){
1434
+ _$hash = _$hash * 33 ^ str.charCodeAt(--i);
1435
+ }
1436
+ /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
1437
+ * integers. Since we want the results to be always positive, convert the
1438
+ * signed int to an unsigned by doing an unsigned bitshift. */ return _$hash >>> 0;
1439
+ }
1440
+ var stringHash = hash;
1441
+
1442
+ var sanitize = function(rule) {
1443
+ return rule.replace(/\/style/gi, "\\/style");
1444
+ };
1445
+ var cache = {};
1446
+ /**
1447
+ * computeId
1448
+ *
1449
+ * Compute and memoize a jsx id from a basedId and optionally props.
1450
+ */ function computeId(baseId, props) {
1451
+ if (!props) {
1452
+ return "jsx-" + baseId;
1453
+ }
1454
+ var propsToString = String(props);
1455
+ var key = baseId + propsToString;
1456
+ if (!cache[key]) {
1457
+ cache[key] = "jsx-" + stringHash(baseId + "-" + propsToString);
1458
+ }
1459
+ return cache[key];
1460
+ }
1461
+ /**
1462
+ * computeSelector
1463
+ *
1464
+ * Compute and memoize dynamic selectors.
1465
+ */ function computeSelector(id, css) {
1466
+ var selectoPlaceholderRegexp = /__jsx-style-dynamic-selector/g;
1467
+ // Sanitize SSR-ed CSS.
1468
+ // Client side code doesn't need to be sanitized since we use
1469
+ // document.createTextNode (dev) and the CSSOM api sheet.insertRule (prod).
1470
+ if (typeof window === "undefined") {
1471
+ css = sanitize(css);
1472
+ }
1473
+ var idcss = id + css;
1474
+ if (!cache[idcss]) {
1475
+ cache[idcss] = css.replace(selectoPlaceholderRegexp, id);
1476
+ }
1477
+ return cache[idcss];
1478
+ }
1479
+
1480
+ function mapRulesToStyle(cssRules, options) {
1481
+ if (options === void 0) options = {};
1482
+ return cssRules.map(function(args) {
1483
+ var id = args[0];
1484
+ var css = args[1];
1485
+ return /*#__PURE__*/ React__default["default"].createElement("style", {
1486
+ id: "__" + id,
1487
+ // Avoid warnings upon render with a key
1488
+ key: "__" + id,
1489
+ nonce: options.nonce ? options.nonce : undefined,
1490
+ dangerouslySetInnerHTML: {
1491
+ __html: css
1492
+ }
1493
+ });
1494
+ });
1495
+ }
1496
+ var StyleSheetRegistry = /*#__PURE__*/ function() {
1497
+ function StyleSheetRegistry(param) {
1498
+ var ref = param === void 0 ? {} : param, _styleSheet = ref.styleSheet, styleSheet = _styleSheet === void 0 ? null : _styleSheet, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? false : _optimizeForSpeed;
1499
+ this._sheet = styleSheet || new StyleSheet({
1500
+ name: "styled-jsx",
1501
+ optimizeForSpeed: optimizeForSpeed
1502
+ });
1503
+ this._sheet.inject();
1504
+ if (styleSheet && typeof optimizeForSpeed === "boolean") {
1505
+ this._sheet.setOptimizeForSpeed(optimizeForSpeed);
1506
+ this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
1507
+ }
1508
+ this._fromServer = undefined;
1509
+ this._indices = {};
1510
+ this._instancesCounts = {};
1511
+ }
1512
+ var _proto = StyleSheetRegistry.prototype;
1513
+ _proto.add = function add(props) {
1514
+ var _this = this;
1515
+ if (undefined === this._optimizeForSpeed) {
1516
+ this._optimizeForSpeed = Array.isArray(props.children);
1517
+ this._sheet.setOptimizeForSpeed(this._optimizeForSpeed);
1518
+ this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
1519
+ }
1520
+ if (typeof window !== "undefined" && !this._fromServer) {
1521
+ this._fromServer = this.selectFromServer();
1522
+ this._instancesCounts = Object.keys(this._fromServer).reduce(function(acc, tagName) {
1523
+ acc[tagName] = 0;
1524
+ return acc;
1525
+ }, {});
1526
+ }
1527
+ var ref = this.getIdAndRules(props), styleId = ref.styleId, rules = ref.rules;
1528
+ // Deduping: just increase the instances count.
1529
+ if (styleId in this._instancesCounts) {
1530
+ this._instancesCounts[styleId] += 1;
1531
+ return;
1532
+ }
1533
+ var indices = rules.map(function(rule) {
1534
+ return _this._sheet.insertRule(rule);
1535
+ })// Filter out invalid rules
1536
+ .filter(function(index) {
1537
+ return index !== -1;
1538
+ });
1539
+ this._indices[styleId] = indices;
1540
+ this._instancesCounts[styleId] = 1;
1541
+ };
1542
+ _proto.remove = function remove(props) {
1543
+ var _this = this;
1544
+ var styleId = this.getIdAndRules(props).styleId;
1545
+ invariant(styleId in this._instancesCounts, "styleId: `" + styleId + "` not found");
1546
+ this._instancesCounts[styleId] -= 1;
1547
+ if (this._instancesCounts[styleId] < 1) {
1548
+ var tagFromServer = this._fromServer && this._fromServer[styleId];
1549
+ if (tagFromServer) {
1550
+ tagFromServer.parentNode.removeChild(tagFromServer);
1551
+ delete this._fromServer[styleId];
1552
+ } else {
1553
+ this._indices[styleId].forEach(function(index) {
1554
+ return _this._sheet.deleteRule(index);
1555
+ });
1556
+ delete this._indices[styleId];
1557
+ }
1558
+ delete this._instancesCounts[styleId];
1559
+ }
1560
+ };
1561
+ _proto.update = function update(props, nextProps) {
1562
+ this.add(nextProps);
1563
+ this.remove(props);
1564
+ };
1565
+ _proto.flush = function flush() {
1566
+ this._sheet.flush();
1567
+ this._sheet.inject();
1568
+ this._fromServer = undefined;
1569
+ this._indices = {};
1570
+ this._instancesCounts = {};
1571
+ };
1572
+ _proto.cssRules = function cssRules() {
1573
+ var _this = this;
1574
+ var fromServer = this._fromServer ? Object.keys(this._fromServer).map(function(styleId) {
1575
+ return [
1576
+ styleId,
1577
+ _this._fromServer[styleId]
1578
+ ];
1579
+ }) : [];
1580
+ var cssRules = this._sheet.cssRules();
1581
+ return fromServer.concat(Object.keys(this._indices).map(function(styleId) {
1582
+ return [
1583
+ styleId,
1584
+ _this._indices[styleId].map(function(index) {
1585
+ return cssRules[index].cssText;
1586
+ }).join(_this._optimizeForSpeed ? "" : "\n")
1587
+ ];
1588
+ })// filter out empty rules
1589
+ .filter(function(rule) {
1590
+ return Boolean(rule[1]);
1591
+ }));
1592
+ };
1593
+ _proto.styles = function styles(options) {
1594
+ return mapRulesToStyle(this.cssRules(), options);
1595
+ };
1596
+ _proto.getIdAndRules = function getIdAndRules(props) {
1597
+ var css = props.children, dynamic = props.dynamic, id = props.id;
1598
+ if (dynamic) {
1599
+ var styleId = computeId(id, dynamic);
1600
+ return {
1601
+ styleId: styleId,
1602
+ rules: Array.isArray(css) ? css.map(function(rule) {
1603
+ return computeSelector(styleId, rule);
1604
+ }) : [
1605
+ computeSelector(styleId, css)
1606
+ ]
1607
+ };
1608
+ }
1609
+ return {
1610
+ styleId: computeId(id),
1611
+ rules: Array.isArray(css) ? css : [
1612
+ css
1613
+ ]
1614
+ };
1615
+ };
1616
+ /**
1617
+ * selectFromServer
1618
+ *
1619
+ * Collects style tags from the document with id __jsx-XXX
1620
+ */ _proto.selectFromServer = function selectFromServer() {
1621
+ var elements = Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]'));
1622
+ return elements.reduce(function(acc, element) {
1623
+ var id = element.id.slice(2);
1624
+ acc[id] = element;
1625
+ return acc;
1626
+ }, {});
1627
+ };
1628
+ return StyleSheetRegistry;
1629
+ }();
1630
+ function invariant(condition, message) {
1631
+ if (!condition) {
1632
+ throw new Error("StyleSheetRegistry: " + message + ".");
1633
+ }
1634
+ }
1635
+ var StyleSheetContext = /*#__PURE__*/ React$1$1.createContext(null);
1636
+ StyleSheetContext.displayName = "StyleSheetContext";
1637
+ function createStyleRegistry() {
1638
+ return new StyleSheetRegistry();
1639
+ }
1640
+ function StyleRegistry(param) {
1641
+ var configuredRegistry = param.registry, children = param.children;
1642
+ var rootRegistry = React$1$1.useContext(StyleSheetContext);
1643
+ var ref = React$1$1.useState(function() {
1644
+ return rootRegistry || configuredRegistry || createStyleRegistry();
1645
+ }), registry = ref[0];
1646
+ return /*#__PURE__*/ React__default["default"].createElement(StyleSheetContext.Provider, {
1647
+ value: registry
1648
+ }, children);
1649
+ }
1650
+ function useStyleRegistry() {
1651
+ return React$1$1.useContext(StyleSheetContext);
1652
+ }
1653
+
1654
+ // Opt-into the new `useInsertionEffect` API in React 18, fallback to `useLayoutEffect`.
1655
+ // https://github.com/reactwg/react-18/discussions/110
1656
+ var useInsertionEffect = React__default["default"].useInsertionEffect || React$1$1.useLayoutEffect;
1657
+ var defaultRegistry = typeof window !== "undefined" ? createStyleRegistry() : undefined;
1658
+ function JSXStyle(props) {
1659
+ var registry = defaultRegistry ? defaultRegistry : useStyleRegistry();
1660
+ var insertionEffectCalled = React$1$1.useRef(false);
1661
+ // `registry` might not exist while server-side rendering
1662
+ if (!registry) {
1663
+ return null;
1664
+ }
1665
+ if (typeof window === "undefined") {
1666
+ registry.add(props);
1667
+ return null;
1668
+ }
1669
+ useInsertionEffect(function() {
1670
+ // ReactDOM removes all DOM during hydration in certain cases
1671
+ if (!document.head) {
1672
+ return;
1673
+ }
1674
+ registry.add(props);
1675
+ insertionEffectCalled.current = true;
1676
+ return function() {
1677
+ insertionEffectCalled.current = false;
1678
+ registry.remove(props);
1679
+ };
1680
+ }, [
1681
+ props.id,
1682
+ String(props.dynamic)
1683
+ ]);
1684
+ React$1$1.useLayoutEffect(function() {
1685
+ if (!document.head || insertionEffectCalled.current) {
1686
+ return;
1687
+ }
1688
+ registry.add(props);
1689
+ return function() {
1690
+ registry.remove(props);
1691
+ };
1692
+ // props.children can be string[], will be striped since id is identical
1693
+ }, [
1694
+ props.id,
1695
+ String(props.dynamic)
1696
+ ]);
1697
+ return null;
1698
+ }
1699
+ JSXStyle.dynamic = function(info) {
1700
+ return info.map(function(tagInfo) {
1701
+ var baseId = tagInfo[0];
1702
+ var props = tagInfo[1];
1703
+ return computeId(baseId, props);
1704
+ }).join(" ");
1705
+ };
1706
+
1707
+ index.StyleRegistry = StyleRegistry;
1708
+ index.createStyleRegistry = createStyleRegistry;
1709
+ index.style = JSXStyle;
1710
+ index.useStyleRegistry = useStyleRegistry;
1711
+ return index;
1712
+ }
1713
+
1714
+ var style;
1715
+ var hasRequiredStyle;
1716
+
1717
+ function requireStyle () {
1718
+ if (hasRequiredStyle) return style;
1719
+ hasRequiredStyle = 1;
1720
+ style = requireIndex().style;
1721
+ return style;
1722
+ }
1723
+
1724
+ var styleExports = requireStyle();
1725
+ var _JSXStyle = /*@__PURE__*/getDefaultExportFromCjs(styleExports);
1726
+
1727
+ /* "use client" */
1728
+
1729
+ var getId = function getId() {
1730
+ return Math.random().toString(32).slice(2, 10);
1731
+ };
1732
+ var isBrowser = function isBrowser() {
1733
+ return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
1734
+ };
1735
+
1736
+ var useSSR = function useSSR() {
1737
+ var _useState = React$1.useState(false),
1738
+ _useState2 = _slicedToArray(_useState, 2),
1739
+ browser = _useState2[0],
1740
+ setBrowser = _useState2[1];
1741
+ React$1.useEffect(function () {
1742
+ setBrowser(isBrowser());
1743
+ }, []);
1744
+ return {
1745
+ isBrowser: browser,
1746
+ isServer: !browser
1747
+ };
1748
+ };
1749
+
1750
+ var createElement = function createElement(id) {
1751
+ var el = document.createElement('div');
1752
+ el.setAttribute('id', id);
1753
+ return el;
1754
+ };
1755
+ var usePortal = function usePortal() {
1756
+ var selectId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getId();
1757
+ var getContainer = arguments.length > 1 ? arguments[1] : undefined;
1758
+ var id = "helpdice-ui-".concat(selectId);
1759
+ var _useSSR = useSSR(),
1760
+ isBrowser = _useSSR.isBrowser;
1761
+ var _useState = React$1.useState(isBrowser ? createElement(id) : null),
1762
+ _useState2 = _slicedToArray(_useState, 2),
1763
+ elSnapshot = _useState2[0],
1764
+ setElSnapshot = _useState2[1];
1765
+ React$1.useEffect(function () {
1766
+ var customContainer = getContainer ? getContainer() : null;
1767
+ var parentElement = customContainer || document.body;
1768
+ var hasElement = parentElement.querySelector("#".concat(id));
1769
+ var el = hasElement || createElement(id);
1770
+ if (!hasElement) {
1771
+ parentElement.appendChild(el);
1772
+ }
1773
+ setElSnapshot(el);
1774
+ }, []);
1775
+ return elSnapshot;
1776
+ };
1777
+
1778
+ var _excluded$2 = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
1779
+ var CssTransition = function CssTransition(_ref) {
1780
+ var children = _ref.children,
1781
+ _ref$className = _ref.className,
1782
+ className = _ref$className === void 0 ? '' : _ref$className,
1783
+ _ref$visible = _ref.visible,
1784
+ visible = _ref$visible === void 0 ? false : _ref$visible,
1785
+ _ref$enterTime = _ref.enterTime,
1786
+ enterTime = _ref$enterTime === void 0 ? 60 : _ref$enterTime,
1787
+ _ref$leaveTime = _ref.leaveTime,
1788
+ leaveTime = _ref$leaveTime === void 0 ? 60 : _ref$leaveTime,
1789
+ _ref$clearTime = _ref.clearTime,
1790
+ clearTime = _ref$clearTime === void 0 ? 60 : _ref$clearTime,
1791
+ _ref$name = _ref.name,
1792
+ name = _ref$name === void 0 ? 'transition' : _ref$name,
1793
+ props = _objectWithoutProperties(_ref, _excluded$2);
1794
+ var _useState = React$1.useState(''),
1795
+ _useState2 = _slicedToArray(_useState, 2),
1796
+ classes = _useState2[0],
1797
+ setClasses = _useState2[1];
1798
+ var _useState3 = React$1.useState(visible),
1799
+ _useState4 = _slicedToArray(_useState3, 2),
1800
+ renderable = _useState4[0],
1801
+ setRenderable = _useState4[1];
1802
+ React$1.useEffect(function () {
1803
+ var statusClassName = visible ? 'enter' : 'leave';
1804
+ var time = visible ? enterTime : leaveTime;
1805
+ if (visible && !renderable) {
1806
+ setRenderable(true);
1807
+ }
1808
+ setClasses("".concat(name, "-").concat(statusClassName));
1809
+
1810
+ // set class to active
1811
+ var timer = setTimeout(function () {
1812
+ setClasses("".concat(name, "-").concat(statusClassName, " ").concat(name, "-").concat(statusClassName, "-active"));
1813
+ clearTimeout(timer);
1814
+ }, time);
1815
+
1816
+ // remove classess when animation over
1817
+ var clearClassesTimer = setTimeout(function () {
1818
+ if (!visible) {
1819
+ setClasses('');
1820
+ setRenderable(false);
1821
+ }
1822
+ clearTimeout(clearClassesTimer);
1823
+ }, time + clearTime);
1824
+ return function () {
1825
+ clearTimeout(timer);
1826
+ clearTimeout(clearClassesTimer);
1827
+ };
1828
+ }, [visible, renderable]);
1829
+ if (! /*#__PURE__*/React$1.isValidElement(children) || !renderable) return null;
1830
+ var propsTransition = _objectSpread2(_objectSpread2({}, props), {}, {
1831
+ className: "".concat(children.props.className, " ").concat(className, " ").concat(classes)
1832
+ });
1833
+ return /*#__PURE__*/React$1.cloneElement(children, propsTransition);
1834
+ };
1835
+ CssTransition.displayName = 'CssTransition';
1836
+
1837
+ var tuple = function tuple() {
1838
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1839
+ args[_key] = arguments[_key];
1840
+ }
1841
+ return args;
1842
+ };
1843
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'abort', 'secondary-light', 'success-light', 'warning-light', 'error-light');
1844
+ tuple('default', 'secondary', 'success', 'warning', 'error');
1845
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite');
1846
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite', 'alert', 'purple', 'violet', 'cyan');
1847
+ tuple('default', 'silent', 'prevent');
1848
+ tuple('hover', 'click');
1849
+ tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
1850
+ tuple('start', 'center', 'end', 'left', 'right');
1851
+
1852
+ var makeToastActions = function makeToastActions(actions, cancelHandle) {
1853
+ var handler = function handler(event, userHandler) {
1854
+ userHandler && userHandler(event, cancelHandle);
1855
+ };
1856
+ if (!actions || !actions.length) return null;
1857
+ return actions.map(function (action, index) {
1858
+ return /*#__PURE__*/React$1.createElement("button", {
1859
+ color: action.passive ? 'default' : 'secondary',
1860
+ key: "action-".concat(index),
1861
+ onClick: function onClick(event) {
1862
+ return handler(event, action.handler);
1863
+ }
1864
+ }, action.name);
1865
+ });
1866
+ };
1867
+ var getColors = function getColors(palette, type) {
1868
+ var colors = {
1869
+ "default": palette.background,
1870
+ secondary: palette.secondary,
1871
+ success: palette.success,
1872
+ warning: palette.warning,
1873
+ error: palette.error
1874
+ };
1875
+ var isDefault = !type || type === 'default';
1876
+ if (isDefault) return {
1877
+ bgColor: colors["default"],
1878
+ color: palette.foreground
1879
+ };
1880
+ /**
1881
+ * Prevent main color change in special types.
1882
+ * The color will only follow the theme when it is in the default type.
1883
+ */
1884
+ return {
1885
+ bgColor: colors[type],
1886
+ color: 'white'
1887
+ };
1888
+ };
1889
+ tuple('topLeft', 'topRight', 'bottomLeft', 'bottomRight');
1890
+ var isTopPlacement = function isTopPlacement(placement) {
1891
+ return "".concat(placement).toLowerCase().startsWith('top');
1892
+ };
1893
+ var isLeftPlacement = function isLeftPlacement(placement) {
1894
+ return "".concat(placement).toLowerCase().endsWith('left');
1895
+ };
1896
+ var getTranslateByPlacement = function getTranslateByPlacement(placement) {
1897
+ var translateInByPlacement = {
1898
+ topLeft: 'translate(-60px, -60px)',
1899
+ topRight: 'translate(60px, -60px)',
1900
+ bottomLeft: 'translate(-60px, 60px)',
1901
+ bottomRight: 'translate(60px, 60px)'
1902
+ };
1903
+ var translateOutByPlacement = {
1904
+ topLeft: 'translate(-50px, 15px) scale(0.85)',
1905
+ topRight: 'translate(50px, 15px) scale(0.85)',
1906
+ bottomLeft: 'translate(-50px, -15px) scale(0.85)',
1907
+ bottomRight: 'translate(50px, -15px) scale(0.85)'
1908
+ };
1909
+ return {
1910
+ enter: translateInByPlacement[placement],
1911
+ leave: translateOutByPlacement[placement]
1912
+ };
1913
+ };
1914
+
1915
+ var ToastItem = /*#__PURE__*/React$1.memo(function (_ref) {
1916
+ var toast = _ref.toast,
1917
+ layout = _ref.layout;
1918
+ var theme = useTheme();
1919
+ var _useMemo = React$1.useMemo(function () {
1920
+ return getColors(theme.palette, toast.type);
1921
+ }, [theme.palette, toast.type]),
1922
+ color = _useMemo.color,
1923
+ bgColor = _useMemo.bgColor;
1924
+ var isReactNode = typeof toast.text !== 'string';
1925
+ var padding = layout.padding,
1926
+ margin = layout.margin,
1927
+ maxHeight = layout.maxHeight,
1928
+ maxWidth = layout.maxWidth,
1929
+ width = layout.width,
1930
+ placement = layout.placement;
1931
+ var _useMemo2 = React$1.useMemo(function () {
1932
+ return getTranslateByPlacement(placement);
1933
+ }, [placement]),
1934
+ enter = _useMemo2.enter,
1935
+ leave = _useMemo2.leave;
1936
+ return /*#__PURE__*/React$1.createElement(CssTransition, {
1937
+ name: "toast",
1938
+ visible: toast.visible,
1939
+ clearTime: 350
1940
+ }, /*#__PURE__*/React$1.createElement("div", {
1941
+ key: toast.id,
1942
+ 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"
1943
+ }, isReactNode ? toast.text : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("div", {
1944
+ 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"
1945
+ }, toast.text), /*#__PURE__*/React$1.createElement("div", {
1946
+ 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"
1947
+ }, makeToastActions(toast.actions, toast.cancel))), /*#__PURE__*/React$1.createElement(_JSXStyle, {
1948
+ id: "1407001838",
1949
+ dynamic: [width, maxWidth, maxHeight, theme.palette.foreground, bgColor, color, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, enter, margin, padding, margin, padding, leave]
1950
+ }, ".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, ";}"))));
1951
+ });
1952
+
1953
+ /* "use client" */
1954
+
1955
+ var classObjectToString = function classObjectToString(className) {
1956
+ var keys = Object.keys(className);
1957
+ var len = keys.length;
1958
+ var str = '';
1959
+ for (var index = 0; index < len; index++) {
1960
+ var key = keys[index];
1961
+ var val = className[keys[index]];
1962
+ if (!val) continue;
1963
+ str = str ? "".concat(str, " ").concat(String(key)) : String(key);
1964
+ }
1965
+ return str;
1966
+ };
1967
+ var isObjectClassName = function isObjectClassName(value) {
1968
+ return _typeof(value) === 'object' && !Array.isArray(value);
1969
+ };
1970
+ var useClasses = function useClasses() {
1971
+ var len = arguments.length;
1972
+ var classes = '';
1973
+ if (len === 0) return classes;
1974
+ for (var index = 0; index < len; index++) {
1975
+ var val = index < 0 || arguments.length <= index ? undefined : arguments[index];
1976
+ if (!val) continue;
1977
+ if (isObjectClassName(val)) {
1978
+ classes += " ".concat(classObjectToString(val));
1979
+ } else {
1980
+ classes += " ".concat(String(val).trim());
1981
+ }
1982
+ }
1983
+ return classes.trim();
1984
+ };
1985
+
1986
+ var ToastContainer = function ToastContainer() {
1987
+ var theme = useTheme();
1988
+ var portal = usePortal('toast');
1989
+ var _useCurrentState = useCurrentState(false),
1990
+ _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
1991
+ setHovering = _useCurrentState2[1],
1992
+ hoveringRef = _useCurrentState2[2];
1993
+ var _useHUIContext = useHUIContext(),
1994
+ toasts = _useHUIContext.toasts,
1995
+ updateToasts = _useHUIContext.updateToasts,
1996
+ toastLayout = _useHUIContext.toastLayout,
1997
+ lastUpdateToastId = _useHUIContext.lastUpdateToastId;
1998
+ var memoizedLayout = React$1.useMemo(function () {
1999
+ return toastLayout;
2000
+ }, [toastLayout]);
2001
+ var toastElements = React$1.useMemo(function () {
2002
+ return toasts.map(function (toast) {
2003
+ return /*#__PURE__*/React$1.createElement(ToastItem, {
2004
+ toast: toast,
2005
+ layout: memoizedLayout,
2006
+ key: toast._internalIdent
2007
+ });
2008
+ });
2009
+ }, [toasts, memoizedLayout]);
2010
+ var classNames = React$1.useMemo(function () {
2011
+ return useClasses('toasts', {
2012
+ top: isTopPlacement(toastLayout.placement),
2013
+ left: isLeftPlacement(toastLayout.placement)
2014
+ });
2015
+ }, [memoizedLayout]);
2016
+ var hoverHandler = function hoverHandler(isHovering) {
2017
+ setHovering(isHovering);
2018
+ if (isHovering) {
2019
+ return updateToasts(function (last) {
2020
+ return last.map(function (toast) {
2021
+ if (!toast.visible) return toast;
2022
+ toast._timeout && window.clearTimeout(toast._timeout);
2023
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
2024
+ timeout: null
2025
+ });
2026
+ });
2027
+ });
2028
+ }
2029
+ updateToasts(function (last) {
2030
+ return last.map(function (toast, index) {
2031
+ if (!toast.visible) return toast;
2032
+ toast._timeout && window.clearTimeout(toast._timeout);
2033
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
2034
+ _timeout: function () {
2035
+ var timer = window.setTimeout(function () {
2036
+ toast.cancel();
2037
+ window.clearTimeout(timer);
2038
+ }, toast.delay + index * 100);
2039
+ return timer;
2040
+ }()
2041
+ });
2042
+ });
2043
+ });
2044
+ };
2045
+ React$1.useEffect(function () {
2046
+ var index = toasts.findIndex(function (r) {
2047
+ return r._internalIdent === lastUpdateToastId;
2048
+ });
2049
+ var toast = toasts[index];
2050
+ if (!toast || toast.visible || !hoveringRef.current) return;
2051
+ var hasVisible = toasts.find(function (r, i) {
2052
+ return i < index && r.visible;
2053
+ });
2054
+ if (hasVisible || !hoveringRef.current) return;
2055
+ hoverHandler(false);
2056
+ }, [toasts, lastUpdateToastId]);
2057
+ React$1.useEffect(function () {
2058
+ var timeout = null;
2059
+ var timer = window.setInterval(function () {
2060
+ if (toasts.length === 0) return;
2061
+ timeout = window.setTimeout(function () {
2062
+ var allInvisible = !toasts.find(function (r) {
2063
+ return r.visible;
2064
+ });
2065
+ allInvisible && updateToasts(function () {
2066
+ return [];
2067
+ });
2068
+ timeout && clearTimeout(timeout);
2069
+ }, 350);
2070
+ }, 5000);
2071
+ return function () {
2072
+ timer && clearInterval(timer);
2073
+ timeout && clearTimeout(timeout);
2074
+ };
2075
+ }, [toasts]);
2076
+ if (!portal) return null;
2077
+ if (!toasts || toasts.length === 0) return null;
2078
+ return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React$1.createElement("div", {
2079
+ onMouseEnter: function onMouseEnter() {
2080
+ return hoverHandler(true);
2081
+ },
2082
+ onMouseLeave: function onMouseLeave() {
2083
+ return hoverHandler(false);
2084
+ },
2085
+ className: _JSXStyle.dynamic([["622610754", [theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.layout.gap]]]) + " " + (classNames || "")
2086
+ }, toastElements, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2087
+ id: "622610754",
2088
+ dynamic: [theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.layout.gap]
2089
+ }, ".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);
2090
+ };
2091
+
2092
+ var HuiProvider = function HuiProvider(_ref) {
2093
+ var themes = _ref.themes,
2094
+ themeType = _ref.themeType,
2095
+ children = _ref.children;
2096
+ var _React$useState = React$1.useState(''),
2097
+ _React$useState2 = _slicedToArray(_React$useState, 2),
2098
+ lastUpdateToastId = _React$useState2[0],
2099
+ setLastUpdateToastId = _React$useState2[1];
2100
+ var _useCurrentState = useCurrentState([]),
2101
+ _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
2102
+ toasts = _useCurrentState2[0],
2103
+ setToasts = _useCurrentState2[1],
2104
+ toastsRef = _useCurrentState2[2];
2105
+ var _useCurrentState3 = useCurrentState(defaultToastLayout),
2106
+ _useCurrentState4 = _slicedToArray(_useCurrentState3, 3),
2107
+ toastLayout = _useCurrentState4[0],
2108
+ setToastLayout = _useCurrentState4[1],
2109
+ toastLayoutRef = _useCurrentState4[2];
2110
+ var updateToasts = function updateToasts(fn) {
2111
+ var nextToasts = fn(toastsRef.current);
2112
+ setToasts(nextToasts);
2113
+ };
2114
+ var updateToastLayout = function updateToastLayout(fn) {
2115
+ var nextLayout = fn(toastLayoutRef.current);
2116
+ setToastLayout(nextLayout);
2117
+ };
2118
+ var updateLastToastId = function updateLastToastId(fn) {
2119
+ setLastUpdateToastId(fn());
2120
+ };
2121
+ var initialValue = React$1.useMemo(function () {
2122
+ return {
2123
+ toasts: toasts,
2124
+ toastLayout: toastLayout,
2125
+ updateToasts: updateToasts,
2126
+ lastUpdateToastId: lastUpdateToastId,
2127
+ updateToastLayout: updateToastLayout,
2128
+ updateLastToastId: updateLastToastId
2129
+ };
2130
+ }, [toasts, toastLayout, lastUpdateToastId]);
2131
+ return /*#__PURE__*/React$1.createElement(HUIContent.Provider, {
2132
+ value: initialValue
2133
+ }, /*#__PURE__*/React$1.createElement(ThemeProvider, {
2134
+ themes: themes,
2135
+ themeType: themeType
2136
+ }, children, /*#__PURE__*/React$1.createElement(ToastContainer, null)));
2137
+ };
2138
+
2139
+ // import flush from 'styled-jsx'
2140
+
2141
+ // export type FlushToReact = <T>(opts?: { nonce?: string }) => Array<ReactElement<T>>
2142
+
2143
+ // export type FlushToHTML = (opts?: { nonce?: string }) => string
2144
+
2145
+ var CssBaseline = function CssBaseline(_ref) {
2146
+ var children = _ref.children;
2147
+ var theme = useTheme();
2148
+ return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2149
+ id: "3647548829",
2150
+ 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]
2151
+ }, "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, ";}")));
2152
+ };
2153
+ var MemoCssBaseline = /*#__PURE__*/React$1.memo(CssBaseline);
2154
+
2155
+ var getElementOffset = function getElementOffset(el) {
2156
+ if (!el) return {
2157
+ top: 0,
2158
+ left: 0
2159
+ };
2160
+ var _el$getBoundingClient = el.getBoundingClientRect(),
2161
+ top = _el$getBoundingClient.top,
2162
+ left = _el$getBoundingClient.left;
2163
+ return {
2164
+ top: top,
2165
+ left: left
2166
+ };
2167
+ };
2168
+ var defaultRect$1 = {
2169
+ top: -1e3,
2170
+ left: -1e3,
2171
+ right: -1e3,
2172
+ width: 0,
2173
+ height: 0,
2174
+ elementTop: -1e3
2175
+ };
2176
+ var getRectFromDOMWithContainer = function getRectFromDOMWithContainer(domRect, getContainer) {
2177
+ if (!domRect) return defaultRect$1;
2178
+ var container = getContainer ? getContainer() : null;
2179
+ var scrollElement = container || document.documentElement;
2180
+ var _getElementOffset = getElementOffset(container),
2181
+ offsetTop = _getElementOffset.top,
2182
+ offsetLeft = _getElementOffset.left;
2183
+ return _objectSpread2(_objectSpread2({}, domRect), {}, {
2184
+ width: domRect.width || domRect.right - domRect.left,
2185
+ height: domRect.height || domRect.top - domRect.bottom,
2186
+ top: domRect.bottom + scrollElement.scrollTop - offsetTop,
2187
+ left: domRect.left + scrollElement.scrollLeft - offsetLeft,
2188
+ elementTop: domRect.top + scrollElement.scrollTop - offsetTop
2189
+ });
2190
+ };
2191
+ var isUnplacedRect = function isUnplacedRect(rect) {
2192
+ if (!rect) return true;
2193
+ return rect.top === defaultRect$1.top && rect.left === defaultRect$1.left;
2194
+ };
2195
+ var getRefRect = function getRefRect(ref, getContainer) {
2196
+ if (!ref || !ref.current) return defaultRect$1;
2197
+ var rect = ref.current.getBoundingClientRect();
2198
+ return getRectFromDOMWithContainer(rect, getContainer);
2199
+ };
2200
+ var getEventRect = function getEventRect(event, getContainer) {
2201
+ var _event$target;
2202
+ var rect = event === null || event === void 0 || (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.getBoundingClientRect();
2203
+ if (!rect) return defaultRect$1;
2204
+ return getRectFromDOMWithContainer(rect, getContainer);
2205
+ };
2206
+ var isRefTarget = function isRefTarget(eventOrRef) {
2207
+ return typeof (eventOrRef === null || eventOrRef === void 0 ? void 0 : eventOrRef.target) === 'undefined';
2208
+ };
2209
+ var useRect = function useRect(initialState) {
2210
+ var _useState = React$1.useState(initialState || defaultRect$1),
2211
+ _useState2 = _slicedToArray(_useState, 2),
2212
+ rect = _useState2[0],
2213
+ setRect = _useState2[1];
2214
+ var updateRect = function updateRect(eventOrRef, getContainer) {
2215
+ if (isRefTarget(eventOrRef)) return setRect(getRefRect(eventOrRef, getContainer));
2216
+ setRect(getEventRect(eventOrRef, getContainer));
2217
+ };
2218
+ return {
2219
+ rect: rect,
2220
+ setRect: updateRect
2221
+ };
2222
+ };
2223
+
2224
+ var defaultToast = {
2225
+ delay: 2000,
2226
+ type: 'default'
2227
+ };
2228
+ var useToasts = function useToasts(layout) {
2229
+ var _useHUIContext = useHUIContext(),
2230
+ updateToasts = _useHUIContext.updateToasts,
2231
+ toasts = _useHUIContext.toasts,
2232
+ updateToastLayout = _useHUIContext.updateToastLayout,
2233
+ updateLastToastId = _useHUIContext.updateLastToastId;
2234
+ React$1.useEffect(function () {
2235
+ if (!layout) return;
2236
+ updateToastLayout(function () {
2237
+ return layout ? _objectSpread2(_objectSpread2({}, defaultToastLayout), layout) : defaultToastLayout;
2238
+ });
2239
+ }, []);
2240
+ var _cancel = function cancel(internalId) {
2241
+ updateToasts(function (currentToasts) {
2242
+ return currentToasts.map(function (item) {
2243
+ if (item._internalIdent !== internalId) return item;
2244
+ return _objectSpread2(_objectSpread2({}, item), {}, {
2245
+ visible: false
2246
+ });
2247
+ });
2248
+ });
2249
+ updateLastToastId(function () {
2250
+ return internalId;
2251
+ });
2252
+ };
2253
+ var removeAll = function removeAll() {
2254
+ updateToasts(function (last) {
2255
+ return last.map(function (toast) {
2256
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
2257
+ visible: false
2258
+ });
2259
+ });
2260
+ });
2261
+ };
2262
+ var findToastOneByID = function findToastOneByID(id) {
2263
+ return toasts.find(function (t) {
2264
+ return t.id === id;
2265
+ });
2266
+ };
2267
+ var removeToastOneByID = function removeToastOneByID(id) {
2268
+ updateToasts(function (last) {
2269
+ return last.map(function (toast) {
2270
+ if (toast.id !== id) return toast;
2271
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
2272
+ visible: false
2273
+ });
2274
+ });
2275
+ });
2276
+ };
2277
+ var setToast = function setToast(toast) {
2278
+ var internalIdent = "toast-".concat(getId());
2279
+ var delay = toast.delay || defaultToast.delay;
2280
+ if (toast.id) {
2281
+ var hasIdent = toasts.find(function (t) {
2282
+ return t.id === toast.id;
2283
+ });
2284
+ if (hasIdent) {
2285
+ throw new Error('Toast: Already have the same key: "ident"');
2286
+ }
2287
+ }
2288
+ updateToasts(function (last) {
2289
+ var newToast = {
2290
+ delay: delay,
2291
+ text: toast.text,
2292
+ visible: true,
2293
+ type: toast.type || defaultToast.type,
2294
+ id: toast.id || internalIdent,
2295
+ actions: toast.actions || [],
2296
+ _internalIdent: internalIdent,
2297
+ _timeout: window.setTimeout(function () {
2298
+ _cancel(internalIdent);
2299
+ if (newToast._timeout) {
2300
+ window.clearTimeout(newToast._timeout);
2301
+ newToast._timeout = null;
2302
+ }
2303
+ }, delay),
2304
+ cancel: function cancel() {
2305
+ return _cancel(internalIdent);
2306
+ }
2307
+ };
2308
+ return [].concat(_toConsumableArray(last), [newToast]);
2309
+ });
2310
+ };
2311
+ return {
2312
+ toasts: toasts,
2313
+ setToast: setToast,
2314
+ removeAll: removeAll,
2315
+ findToastOneByID: findToastOneByID,
2316
+ removeToastOneByID: removeToastOneByID
2317
+ };
2318
+ };
2319
+
2320
+ tuple('xs', 'sm', 'md', 'lg', 'xl', 'mobile');
2321
+ tuple('up', 'down', 'default');
2322
+ var defaultResponsiveOptions = {
2323
+ match: 'default'
2324
+ };
2325
+ var makeQueries = function makeQueries(bp, up, down) {
2326
+ var queryString = function queryString(item) {
2327
+ var upQuery = "(min-width: ".concat(item.min, ")");
2328
+ var downQuery = "(max-width: ".concat(item.max, ")");
2329
+ return up ? upQuery : down ? downQuery : "".concat(upQuery, " and ").concat(downQuery);
2330
+ };
2331
+ var xs = queryString(bp.xs);
2332
+ return {
2333
+ xs: xs,
2334
+ mobile: xs,
2335
+ sm: queryString(bp.sm),
2336
+ md: queryString(bp.md),
2337
+ lg: queryString(bp.lg),
2338
+ xl: queryString(bp.xl)
2339
+ };
2340
+ };
2341
+ var useMediaQuery = function useMediaQuery(breakpoint) {
2342
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultResponsiveOptions;
2343
+ var _options$match = options.match,
2344
+ matchType = _options$match === void 0 ? 'default' : _options$match,
2345
+ _options$ssrMatchMedi = options.ssrMatchMedia,
2346
+ ssrMatchMedia = _options$ssrMatchMedi === void 0 ? null : _options$ssrMatchMedi;
2347
+ var supportMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
2348
+ var theme = useTheme();
2349
+ var mediaQueries = React$1.useMemo(function () {
2350
+ var up = matchType === 'up';
2351
+ var down = matchType === 'down';
2352
+ return makeQueries(theme.breakpoints, up, down);
2353
+ }, [theme.breakpoints, options]);
2354
+ var query = React$1.useMemo(function () {
2355
+ return mediaQueries[breakpoint];
2356
+ }, [mediaQueries, breakpoint]);
2357
+ var matchQuery = function matchQuery(q) {
2358
+ return window.matchMedia(q);
2359
+ };
2360
+
2361
+ /**
2362
+ * Do nothing in the server-side rendering.
2363
+ * If server match query fucntion is simulated, return user-defined value first.
2364
+ */
2365
+ var _useState = React$1.useState(function () {
2366
+ if (supportMedia) return matchQuery(query).matches;
2367
+ if (ssrMatchMedia && typeof ssrMatchMedia === 'function') {
2368
+ return ssrMatchMedia(query).matches;
2369
+ }
2370
+ return false;
2371
+ }),
2372
+ _useState2 = _slicedToArray(_useState, 2),
2373
+ state = _useState2[0],
2374
+ setState = _useState2[1];
2375
+ React$1.useEffect(function () {
2376
+ if (!supportMedia) return;
2377
+ var queryList = matchQuery(query);
2378
+ var update = function update() {
2379
+ return setState(matchQuery(query).matches);
2380
+ };
2381
+ update();
2382
+
2383
+ /**
2384
+ * addListener is deprecated. EventTarget.addEventListener is recommended.
2385
+ * But in some old browsers, MediaQueryList does not inherit from EventTarget.
2386
+ */
2387
+ queryList.addListener(update);
2388
+ return function () {
2389
+ queryList.removeListener(update);
2390
+ };
2391
+ }, [supportMedia]);
2392
+ return state;
2393
+ };
2394
+
2395
+ /* "use client" */
2396
+
2397
+ var usePrevious = function usePrevious(state) {
2398
+ var ref = React$1.useRef(null);
2399
+ React$1.useEffect(function () {
2400
+ ref.current = state;
2401
+ });
2402
+ return ref ? ref.current : null;
2403
+ };
2404
+
2405
+ var _excluded$1 = ["rect", "visible", "hoverHeightRatio", "hoverWidthRatio", "activeOpacity", "className"];
2406
+ var Highlight = function Highlight(_ref) {
2407
+ var rect = _ref.rect,
2408
+ visible = _ref.visible,
2409
+ _ref$hoverHeightRatio = _ref.hoverHeightRatio,
2410
+ hoverHeightRatio = _ref$hoverHeightRatio === void 0 ? 1 : _ref$hoverHeightRatio,
2411
+ _ref$hoverWidthRatio = _ref.hoverWidthRatio,
2412
+ hoverWidthRatio = _ref$hoverWidthRatio === void 0 ? 1 : _ref$hoverWidthRatio,
2413
+ _ref$activeOpacity = _ref.activeOpacity,
2414
+ activeOpacity = _ref$activeOpacity === void 0 ? 0.8 : _ref$activeOpacity,
2415
+ className = _ref.className,
2416
+ props = _objectWithoutProperties(_ref, _excluded$1);
2417
+ var theme = useTheme();
2418
+ var ref = React$1.useRef(null);
2419
+ var isFirstVisible = usePrevious(isUnplacedRect(rect));
2420
+ var position = React$1.useMemo(function () {
2421
+ var width = rect.width * hoverWidthRatio;
2422
+ var height = rect.height * hoverHeightRatio;
2423
+ return {
2424
+ width: "".concat(width, "px"),
2425
+ left: "".concat(rect.left + (rect.width - width) / 2, "px"),
2426
+ height: "".concat(height, "px"),
2427
+ top: "".concat(rect.elementTop + (rect.height - height) / 2, "px"),
2428
+ transition: isFirstVisible ? 'opacity' : 'opacity, width, left, top'
2429
+ };
2430
+ }, [rect, hoverWidthRatio, hoverHeightRatio]);
2431
+ return /*#__PURE__*/React$1.createElement("div", _extends({
2432
+ ref: ref
2433
+ }, props, {
2434
+ 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) || "")
2435
+ }), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2436
+ id: "603024321",
2437
+ dynamic: [theme.palette.accents_2, position.width, position.left, position.height, position.top, visible ? activeOpacity : 0, position.transition]
2438
+ }, ".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, ";}")));
2439
+ };
2440
+
2441
+ var Ellipsis = function Ellipsis(_ref) {
2442
+ var children = _ref.children,
2443
+ height = _ref.height;
2444
+ return /*#__PURE__*/React$1.createElement("span", {
2445
+ className: _JSXStyle.dynamic([["822089635", [height]]])
2446
+ }, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2447
+ id: "822089635",
2448
+ dynamic: [height]
2449
+ }, "span.__jsx-style-dynamic-selector{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:".concat(height, ";min-width:0;}")));
2450
+ };
2451
+ var ellipsis = /*#__PURE__*/React$1.memo(Ellipsis);
2452
+
2453
+ var getRealShape = function getRealShape(el) {
2454
+ var defaultShape = {
2455
+ width: 0,
2456
+ height: 0
2457
+ };
2458
+ if (!el || typeof window === 'undefined') return defaultShape;
2459
+ var rect = el.getBoundingClientRect();
2460
+ var _window$getComputedSt = window.getComputedStyle(el),
2461
+ width = _window$getComputedSt.width,
2462
+ height = _window$getComputedSt.height;
2463
+ var getCSSStyleVal = function getCSSStyleVal(str, parentNum) {
2464
+ if (!str) return 0;
2465
+ var strVal = str.includes('px') ? +str.split('px')[0] : str.includes('%') ? +str.split('%')[0] * parentNum * 0.01 : str;
2466
+ return Number.isNaN(+strVal) ? 0 : +strVal;
2467
+ };
2468
+ return {
2469
+ width: getCSSStyleVal("".concat(width), rect.width),
2470
+ height: getCSSStyleVal("".concat(height), rect.height)
2471
+ };
2472
+ };
2473
+ var useRealShape = function useRealShape(ref) {
2474
+ var _useState = React$1.useState({
2475
+ width: 0,
2476
+ height: 0
2477
+ }),
2478
+ _useState2 = _slicedToArray(_useState, 2),
2479
+ state = _useState2[0],
2480
+ setState = _useState2[1];
2481
+ var update = function update() {
2482
+ var _getRealShape = getRealShape(ref.current),
2483
+ width = _getRealShape.width,
2484
+ height = _getRealShape.height;
2485
+ setState({
2486
+ width: width,
2487
+ height: height
2488
+ });
2489
+ };
2490
+ React$1.useEffect(function () {
2491
+ return update();
2492
+ }, [ref.current]);
2493
+ return [state, update];
2494
+ };
2495
+
2496
+ var Expand = function Expand(_ref) {
2497
+ var _ref$isExpanded = _ref.isExpanded,
2498
+ isExpanded = _ref$isExpanded === void 0 ? false : _ref$isExpanded,
2499
+ _ref$delay = _ref.delay,
2500
+ delay = _ref$delay === void 0 ? 200 : _ref$delay,
2501
+ children = _ref.children;
2502
+ var _useState = React$1.useState(isExpanded ? 'auto' : '0'),
2503
+ _useState2 = _slicedToArray(_useState, 2),
2504
+ height = _useState2[0],
2505
+ setHeight = _useState2[1];
2506
+ var _useState3 = React$1.useState(isExpanded),
2507
+ _useState4 = _slicedToArray(_useState3, 2),
2508
+ selfExpanded = _useState4[0],
2509
+ setSelfExpanded = _useState4[1];
2510
+ var _useState5 = React$1.useState(isExpanded),
2511
+ _useState6 = _slicedToArray(_useState5, 2),
2512
+ visible = _useState6[0],
2513
+ setVisible = _useState6[1];
2514
+ var contentRef = React$1.useRef(null);
2515
+ var entryTimer = React$1.useRef();
2516
+ var leaveTimer = React$1.useRef();
2517
+ var resetTimer = React$1.useRef();
2518
+ var _useRealShape = useRealShape(contentRef),
2519
+ _useRealShape2 = _slicedToArray(_useRealShape, 2),
2520
+ state = _useRealShape2[0],
2521
+ updateShape = _useRealShape2[1];
2522
+ var classes = useClasses('container', {
2523
+ expanded: selfExpanded
2524
+ });
2525
+ React$1.useEffect(function () {
2526
+ return setHeight("".concat(state.height, "px"));
2527
+ }, [state.height]);
2528
+ React$1.useEffect(function () {
2529
+ // show element or reset height.
2530
+ // force an update once manually, even if the element does not change.
2531
+ // (the height of the element might be "auto")
2532
+ if (isExpanded) {
2533
+ setVisible(isExpanded);
2534
+ } else {
2535
+ updateShape();
2536
+ setHeight("".concat(state.height, "px"));
2537
+ }
2538
+
2539
+ // show expand animation
2540
+ entryTimer.current = window.setTimeout(function () {
2541
+ setSelfExpanded(isExpanded);
2542
+ clearTimeout(entryTimer.current);
2543
+ }, 30);
2544
+
2545
+ // Reset height after animation
2546
+ if (isExpanded) {
2547
+ resetTimer.current = window.setTimeout(function () {
2548
+ setHeight('auto');
2549
+ clearTimeout(resetTimer.current);
2550
+ }, delay);
2551
+ } else {
2552
+ leaveTimer.current = window.setTimeout(function () {
2553
+ setVisible(isExpanded);
2554
+ clearTimeout(leaveTimer.current);
2555
+ }, delay / 2);
2556
+ }
2557
+ return function () {
2558
+ clearTimeout(entryTimer.current);
2559
+ clearTimeout(leaveTimer.current);
2560
+ clearTimeout(resetTimer.current);
2561
+ };
2562
+ }, [isExpanded]);
2563
+ return /*#__PURE__*/React$1.createElement("div", {
2564
+ className: _JSXStyle.dynamic([["1918690829", [visible ? 'visible' : 'hidden', delay, height]]]) + " " + (classes || "")
2565
+ }, /*#__PURE__*/React$1.createElement("div", {
2566
+ ref: contentRef,
2567
+ className: _JSXStyle.dynamic([["1918690829", [visible ? 'visible' : 'hidden', delay, height]]]) + " " + "content"
2568
+ }, children), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2569
+ id: "1918690829",
2570
+ dynamic: [visible ? 'visible' : 'hidden', delay, height]
2571
+ }, ".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;}")));
2572
+ };
2573
+ Expand.displayName = 'Expand';
2574
+
2575
+ /* "use client" */
2576
+
2577
+ var useResize = function useResize(callback) {
2578
+ var immediatelyInvoke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2579
+ React$1.useEffect(function () {
2580
+ var fn = function fn() {
2581
+ return callback();
2582
+ };
2583
+ if (immediatelyInvoke) {
2584
+ fn();
2585
+ }
2586
+ window.addEventListener('resize', fn);
2587
+ return function () {
2588
+ return window.removeEventListener('resize', fn);
2589
+ };
2590
+ }, []);
2591
+ };
2592
+
2593
+ /* "use client" */
2594
+
2595
+ var useClickAnyWhere = function useClickAnyWhere(handler) {
2596
+ React$1.useEffect(function () {
2597
+ var callback = function callback(event) {
2598
+ return handler(event);
2599
+ };
2600
+ document.addEventListener('click', callback);
2601
+ return function () {
2602
+ return document.removeEventListener('click', callback);
2603
+ };
2604
+ }, [handler]);
2605
+ };
2606
+
2607
+ /* "use client" */
2608
+
2609
+ var useDOMObserver = function useDOMObserver(ref) {
2610
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
2611
+ var config = {
2612
+ attributes: false,
2613
+ childList: true,
2614
+ subtree: true
2615
+ };
2616
+ React$1.useEffect(function () {
2617
+ if (!ref || !ref.current) return;
2618
+ var unmount = false;
2619
+ var done = function done() {
2620
+ if (unmount) return;
2621
+ callback.apply(void 0, arguments);
2622
+ };
2623
+ var observer = new MutationObserver(done);
2624
+ observer.observe(ref.current, config);
2625
+ return function () {
2626
+ unmount = true;
2627
+ observer.disconnect();
2628
+ };
2629
+ }, [ref]);
2630
+ };
2631
+
2632
+ var warningStack = {};
2633
+ var useWarning = function useWarning(message, component) {
2634
+ var tag = ' ';
2635
+ var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
2636
+ if (typeof console === 'undefined') return;
2637
+ if (warningStack[log]) return;
2638
+ warningStack[log] = true;
2639
+ if (process.env.NODE_ENV !== 'production') {
2640
+ return console.error(log);
2641
+ }
2642
+ console.warn(log);
2643
+ };
2644
+
2645
+ var defaultRect = {
2646
+ top: -1e3,
2647
+ left: -1e3,
2648
+ right: -1e3,
2649
+ width: 0
2650
+ };
2651
+ var Dropdown = /*#__PURE__*/React$1.memo(function (_ref) {
2652
+ var children = _ref.children,
2653
+ parent = _ref.parent,
2654
+ visible = _ref.visible,
2655
+ disableMatchWidth = _ref.disableMatchWidth,
2656
+ getPopupContainer = _ref.getPopupContainer;
2657
+ var el = usePortal('dropdown', getPopupContainer);
2658
+ var _useState = React$1.useState(defaultRect),
2659
+ _useState2 = _slicedToArray(_useState, 2),
2660
+ rect = _useState2[0],
2661
+ setRect = _useState2[1];
2662
+ var classes = useClasses('dropdown', disableMatchWidth ? 'disable-match' : 'width-match');
2663
+ if (!parent) return null;
2664
+
2665
+ /* istanbul ignore next */
2666
+ if (process.env.NODE_ENV !== 'production') {
2667
+ if (getPopupContainer && getPopupContainer()) {
2668
+ var _el = getPopupContainer();
2669
+ var style = window.getComputedStyle(_el);
2670
+ if (style.position === 'static') {
2671
+ useWarning('The element specified by "getPopupContainer" must have "position" set.');
2672
+ }
2673
+ }
2674
+ }
2675
+ var updateRect = function updateRect() {
2676
+ var _getRefRect = getRefRect(parent, getPopupContainer),
2677
+ top = _getRefRect.top,
2678
+ left = _getRefRect.left,
2679
+ right = _getRefRect.right,
2680
+ nativeWidth = _getRefRect.width;
2681
+ setRect({
2682
+ top: top,
2683
+ left: left,
2684
+ right: right,
2685
+ width: nativeWidth
2686
+ });
2687
+ };
2688
+ useResize(updateRect);
2689
+ useClickAnyWhere(function () {
2690
+ var _getRefRect2 = getRefRect(parent, getPopupContainer),
2691
+ top = _getRefRect2.top,
2692
+ left = _getRefRect2.left;
2693
+ var shouldUpdatePosition = top !== rect.top || left !== rect.left;
2694
+ if (!shouldUpdatePosition) return;
2695
+ updateRect();
2696
+ });
2697
+ useDOMObserver(parent, function () {
2698
+ updateRect();
2699
+ });
2700
+ React$1.useEffect(function () {
2701
+ if (!parent || !parent.current) return;
2702
+ parent.current.addEventListener('mouseenter', updateRect);
2703
+ /* istanbul ignore next */
2704
+ return function () {
2705
+ if (!parent || !parent.current) return;
2706
+ parent.current.removeEventListener('mouseenter', updateRect);
2707
+ };
2708
+ }, [parent]);
2709
+ var clickHandler = function clickHandler(event) {
2710
+ event.stopPropagation();
2711
+ event.nativeEvent.stopImmediatePropagation();
2712
+ event.preventDefault();
2713
+ };
2714
+ var mouseDownHandler = function mouseDownHandler(event) {
2715
+ event.preventDefault();
2716
+ };
2717
+ if (!el) return null;
2718
+ return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React$1.createElement(CssTransition, {
2719
+ visible: visible
2720
+ }, /*#__PURE__*/React$1.createElement("div", {
2721
+ onClick: clickHandler,
2722
+ onMouseDown: mouseDownHandler,
2723
+ className: _JSXStyle.dynamic([["1644673105", [rect.top + 2, rect.left, rect.width, rect.width]]]) + " " + (classes || "")
2724
+ }, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2725
+ id: "1644673105",
2726
+ dynamic: [rect.top + 2, rect.left, rect.width, rect.width]
2727
+ }, ".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);
2728
+ });
2729
+
2730
+ var _excluded = ["children", "onClick", "visible", "width", "onContentClick", "backdropClassName", "positionClassName", "layerClassName"];
2731
+ var Backdrop = /*#__PURE__*/React$1.memo(function (_ref) {
2732
+ var children = _ref.children,
2733
+ _ref$onClick = _ref.onClick,
2734
+ onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
2735
+ _ref$visible = _ref.visible,
2736
+ visible = _ref$visible === void 0 ? false : _ref$visible,
2737
+ width = _ref.width,
2738
+ _ref$onContentClick = _ref.onContentClick,
2739
+ onContentClick = _ref$onContentClick === void 0 ? function () {} : _ref$onContentClick,
2740
+ _ref$backdropClassNam = _ref.backdropClassName,
2741
+ backdropClassName = _ref$backdropClassNam === void 0 ? '' : _ref$backdropClassNam,
2742
+ _ref$positionClassNam = _ref.positionClassName,
2743
+ positionClassName = _ref$positionClassNam === void 0 ? '' : _ref$positionClassNam,
2744
+ _ref$layerClassName = _ref.layerClassName,
2745
+ layerClassName = _ref$layerClassName === void 0 ? '' : _ref$layerClassName,
2746
+ props = _objectWithoutProperties(_ref, _excluded);
2747
+ var theme = useTheme();
2748
+ var _useCurrentState = useCurrentState(false),
2749
+ _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
2750
+ setIsContentMouseDown = _useCurrentState2[1],
2751
+ IsContentMouseDownRef = _useCurrentState2[2];
2752
+ var clickHandler = function clickHandler(event) {
2753
+ if (IsContentMouseDownRef.current) return;
2754
+ onClick && onClick(event);
2755
+ };
2756
+ var mouseUpHandler = function mouseUpHandler() {
2757
+ if (!IsContentMouseDownRef.current) return;
2758
+ var timer = setTimeout(function () {
2759
+ setIsContentMouseDown(false);
2760
+ clearTimeout(timer);
2761
+ }, 0);
2762
+ };
2763
+ return /*#__PURE__*/React$1.createElement(CssTransition, {
2764
+ name: "backdrop-wrapper",
2765
+ visible: visible,
2766
+ clearTime: 300
2767
+ }, /*#__PURE__*/React$1.createElement("div", _extends({
2768
+ onClick: clickHandler,
2769
+ onMouseUp: mouseUpHandler
2770
+ }, props, {
2771
+ className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (props && props.className != null && props.className || useClasses('backdrop', backdropClassName) || "")
2772
+ }), /*#__PURE__*/React$1.createElement("div", {
2773
+ className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (useClasses('layer', layerClassName) || "")
2774
+ }), /*#__PURE__*/React$1.createElement("div", {
2775
+ onClick: onContentClick,
2776
+ onMouseDown: function onMouseDown() {
2777
+ return setIsContentMouseDown(true);
2778
+ },
2779
+ className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (useClasses('position', positionClassName) || "")
2780
+ }, children), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2781
+ id: "2021762493",
2782
+ dynamic: [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]
2783
+ }, ".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;}"))));
2784
+ });
2785
+ Backdrop.displayName = 'Backdrop';
2786
+
2787
+ dist.Backdrop = Backdrop;
2788
+ dist.CssBaseline = MemoCssBaseline;
2789
+ dist.CssTransition = CssTransition;
2790
+ dist.Dropdown = Dropdown;
2791
+ dist.Ellipsis = ellipsis;
2792
+ dist.Expand = Expand;
2793
+ dist.Highlight = Highlight;
2794
+ dist.Themes = Themes;
2795
+ dist.UiProvider = HuiProvider;
2796
+ dist.useAllThemes = useAllThemes;
2797
+ dist.useClasses = useClasses;
2798
+ dist.useCurrentState = useCurrentState;
2799
+ dist.useMediaQuery = useMediaQuery;
2800
+ dist.useRect = useRect;
2801
+ dist.useTheme = useTheme;
2802
+ dist.useToasts = useToasts;
2803
+ return dist;
2804
+ }
2805
+
2806
+ var distExports = /*@__PURE__*/ requireDist();
1008
2807
 
1009
2808
  /* "use client" */
1010
2809
 
1011
- var getId = function getId() {
1012
- return Math.random().toString(32).slice(2, 10);
1013
- };
1014
2810
  var pickChildByProps = function pickChildByProps(children, key, value) {
1015
2811
  var target = [];
1016
2812
  var isArray = Array.isArray(value);
@@ -1033,9 +2829,6 @@ var pickChildByProps = function pickChildByProps(children, key, value) {
1033
2829
  var targetChildren = target.length >= 0 ? target : undefined;
1034
2830
  return [withoutPropChildren, targetChildren];
1035
2831
  };
1036
- var isBrowser = function isBrowser() {
1037
- return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
1038
- };
1039
2832
  var isCSSNumberValue = function isCSSNumberValue(value) {
1040
2833
  return value !== undefined && !Number.isNaN(+value);
1041
2834
  };
@@ -1070,337 +2863,6 @@ var useSelectContext = function useSelectContext() {
1070
2863
  return React.useContext(SelectContext);
1071
2864
  };
1072
2865
 
1073
- var useSSR = function useSSR() {
1074
- var _useState = React.useState(false),
1075
- _useState2 = _slicedToArray(_useState, 2),
1076
- browser = _useState2[0],
1077
- setBrowser = _useState2[1];
1078
- React.useEffect(function () {
1079
- setBrowser(isBrowser());
1080
- }, []);
1081
- return {
1082
- isBrowser: browser,
1083
- isServer: !browser
1084
- };
1085
- };
1086
-
1087
- var createElement = function createElement(id) {
1088
- var el = document.createElement('div');
1089
- el.setAttribute('id', id);
1090
- return el;
1091
- };
1092
- var usePortal = function usePortal() {
1093
- var selectId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getId();
1094
- var getContainer = arguments.length > 1 ? arguments[1] : undefined;
1095
- var id = "helpdice-ui-".concat(selectId);
1096
- var _useSSR = useSSR(),
1097
- isBrowser = _useSSR.isBrowser;
1098
- var _useState = React.useState(isBrowser ? createElement(id) : null),
1099
- _useState2 = _slicedToArray(_useState, 2),
1100
- elSnapshot = _useState2[0],
1101
- setElSnapshot = _useState2[1];
1102
- React.useEffect(function () {
1103
- var customContainer = getContainer ? getContainer() : null;
1104
- var parentElement = customContainer || document.body;
1105
- var hasElement = parentElement.querySelector("#".concat(id));
1106
- var el = hasElement || createElement(id);
1107
- if (!hasElement) {
1108
- parentElement.appendChild(el);
1109
- }
1110
- setElSnapshot(el);
1111
- }, []);
1112
- return elSnapshot;
1113
- };
1114
-
1115
- /* "use client" */
1116
-
1117
- var useResize = function useResize(callback) {
1118
- var immediatelyInvoke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1119
- React.useEffect(function () {
1120
- var fn = function fn() {
1121
- return callback();
1122
- };
1123
- if (immediatelyInvoke) {
1124
- fn();
1125
- }
1126
- window.addEventListener('resize', fn);
1127
- return function () {
1128
- return window.removeEventListener('resize', fn);
1129
- };
1130
- }, []);
1131
- };
1132
-
1133
- var _excluded$6 = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
1134
- var CssTransition = function CssTransition(_ref) {
1135
- var children = _ref.children,
1136
- _ref$className = _ref.className,
1137
- className = _ref$className === void 0 ? '' : _ref$className,
1138
- _ref$visible = _ref.visible,
1139
- visible = _ref$visible === void 0 ? false : _ref$visible,
1140
- _ref$enterTime = _ref.enterTime,
1141
- enterTime = _ref$enterTime === void 0 ? 60 : _ref$enterTime,
1142
- _ref$leaveTime = _ref.leaveTime,
1143
- leaveTime = _ref$leaveTime === void 0 ? 60 : _ref$leaveTime,
1144
- _ref$clearTime = _ref.clearTime,
1145
- clearTime = _ref$clearTime === void 0 ? 60 : _ref$clearTime,
1146
- _ref$name = _ref.name,
1147
- name = _ref$name === void 0 ? 'transition' : _ref$name,
1148
- props = _objectWithoutProperties(_ref, _excluded$6);
1149
- var _useState = React.useState(''),
1150
- _useState2 = _slicedToArray(_useState, 2),
1151
- classes = _useState2[0],
1152
- setClasses = _useState2[1];
1153
- var _useState3 = React.useState(visible),
1154
- _useState4 = _slicedToArray(_useState3, 2),
1155
- renderable = _useState4[0],
1156
- setRenderable = _useState4[1];
1157
- React.useEffect(function () {
1158
- var statusClassName = visible ? 'enter' : 'leave';
1159
- var time = visible ? enterTime : leaveTime;
1160
- if (visible && !renderable) {
1161
- setRenderable(true);
1162
- }
1163
- setClasses("".concat(name, "-").concat(statusClassName));
1164
-
1165
- // set class to active
1166
- var timer = setTimeout(function () {
1167
- setClasses("".concat(name, "-").concat(statusClassName, " ").concat(name, "-").concat(statusClassName, "-active"));
1168
- clearTimeout(timer);
1169
- }, time);
1170
-
1171
- // remove classess when animation over
1172
- var clearClassesTimer = setTimeout(function () {
1173
- if (!visible) {
1174
- setClasses('');
1175
- setRenderable(false);
1176
- }
1177
- clearTimeout(clearClassesTimer);
1178
- }, time + clearTime);
1179
- return function () {
1180
- clearTimeout(timer);
1181
- clearTimeout(clearClassesTimer);
1182
- };
1183
- }, [visible, renderable]);
1184
- if (! /*#__PURE__*/React.isValidElement(children) || !renderable) return null;
1185
- var propsTransition = _objectSpread2(_objectSpread2({}, props), {}, {
1186
- className: "".concat(children.props.className, " ").concat(className, " ").concat(classes)
1187
- });
1188
- return /*#__PURE__*/React.cloneElement(children, propsTransition);
1189
- };
1190
- CssTransition.displayName = 'CssTransition';
1191
-
1192
- /* "use client" */
1193
-
1194
- var useClickAnyWhere = function useClickAnyWhere(handler) {
1195
- React.useEffect(function () {
1196
- var callback = function callback(event) {
1197
- return handler(event);
1198
- };
1199
- document.addEventListener('click', callback);
1200
- return function () {
1201
- return document.removeEventListener('click', callback);
1202
- };
1203
- }, [handler]);
1204
- };
1205
-
1206
- /* "use client" */
1207
-
1208
- var useDOMObserver = function useDOMObserver(ref) {
1209
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
1210
- var config = {
1211
- attributes: false,
1212
- childList: true,
1213
- subtree: true
1214
- };
1215
- React.useEffect(function () {
1216
- if (!ref || !ref.current) return;
1217
- var unmount = false;
1218
- var done = function done() {
1219
- if (unmount) return;
1220
- callback.apply(void 0, arguments);
1221
- };
1222
- var observer = new MutationObserver(done);
1223
- observer.observe(ref.current, config);
1224
- return function () {
1225
- unmount = true;
1226
- observer.disconnect();
1227
- };
1228
- }, [ref]);
1229
- };
1230
-
1231
- var warningStack = {};
1232
- var useWarning = function useWarning(message, component) {
1233
- var tag = component ? " [".concat(component, "]") : ' ';
1234
- var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
1235
- if (typeof console === 'undefined') return;
1236
- if (warningStack[log]) return;
1237
- warningStack[log] = true;
1238
- if (process.env.NODE_ENV !== 'production') {
1239
- return console.error(log);
1240
- }
1241
- console.warn(log);
1242
- };
1243
-
1244
- var getElementOffset = function getElementOffset(el) {
1245
- if (!el) return {
1246
- top: 0,
1247
- left: 0
1248
- };
1249
- var _el$getBoundingClient = el.getBoundingClientRect(),
1250
- top = _el$getBoundingClient.top,
1251
- left = _el$getBoundingClient.left;
1252
- return {
1253
- top: top,
1254
- left: left
1255
- };
1256
- };
1257
- var defaultRect$1 = {
1258
- top: -1e3,
1259
- left: -1e3,
1260
- right: -1e3,
1261
- width: 0,
1262
- height: 0,
1263
- elementTop: -1e3
1264
- };
1265
- var getRectFromDOMWithContainer = function getRectFromDOMWithContainer(domRect, getContainer) {
1266
- if (!domRect) return defaultRect$1;
1267
- var container = getContainer ? getContainer() : null;
1268
- var scrollElement = container || document.documentElement;
1269
- var _getElementOffset = getElementOffset(container),
1270
- offsetTop = _getElementOffset.top,
1271
- offsetLeft = _getElementOffset.left;
1272
- return _objectSpread2(_objectSpread2({}, domRect), {}, {
1273
- width: domRect.width || domRect.right - domRect.left,
1274
- height: domRect.height || domRect.top - domRect.bottom,
1275
- top: domRect.bottom + scrollElement.scrollTop - offsetTop,
1276
- left: domRect.left + scrollElement.scrollLeft - offsetLeft,
1277
- elementTop: domRect.top + scrollElement.scrollTop - offsetTop
1278
- });
1279
- };
1280
- var getRefRect = function getRefRect(ref, getContainer) {
1281
- if (!ref || !ref.current) return defaultRect$1;
1282
- var rect = ref.current.getBoundingClientRect();
1283
- return getRectFromDOMWithContainer(rect, getContainer);
1284
- };
1285
-
1286
- /* "use client" */
1287
-
1288
- var classObjectToString = function classObjectToString(className) {
1289
- var keys = Object.keys(className);
1290
- var len = keys.length;
1291
- var str = '';
1292
- for (var index = 0; index < len; index++) {
1293
- var key = keys[index];
1294
- var val = className[keys[index]];
1295
- if (!val) continue;
1296
- str = str ? "".concat(str, " ").concat(String(key)) : String(key);
1297
- }
1298
- return str;
1299
- };
1300
- var isObjectClassName = function isObjectClassName(value) {
1301
- return _typeof(value) === 'object' && !Array.isArray(value);
1302
- };
1303
- var useClasses = function useClasses() {
1304
- var len = arguments.length;
1305
- var classes = '';
1306
- if (len === 0) return classes;
1307
- for (var index = 0; index < len; index++) {
1308
- var val = index < 0 || arguments.length <= index ? undefined : arguments[index];
1309
- if (!val) continue;
1310
- if (isObjectClassName(val)) {
1311
- classes += " ".concat(classObjectToString(val));
1312
- } else {
1313
- classes += " ".concat(String(val).trim());
1314
- }
1315
- }
1316
- return classes.trim();
1317
- };
1318
-
1319
- var defaultRect = {
1320
- top: -1e3,
1321
- left: -1e3,
1322
- right: -1e3,
1323
- width: 0
1324
- };
1325
- var Dropdown = /*#__PURE__*/React.memo(function (_ref) {
1326
- var children = _ref.children,
1327
- parent = _ref.parent,
1328
- visible = _ref.visible,
1329
- disableMatchWidth = _ref.disableMatchWidth,
1330
- getPopupContainer = _ref.getPopupContainer;
1331
- var el = usePortal('dropdown', getPopupContainer);
1332
- var _useState = React.useState(defaultRect),
1333
- _useState2 = _slicedToArray(_useState, 2),
1334
- rect = _useState2[0],
1335
- setRect = _useState2[1];
1336
- var classes = useClasses('dropdown', disableMatchWidth ? 'disable-match' : 'width-match');
1337
- if (!parent) return null;
1338
-
1339
- /* istanbul ignore next */
1340
- if (process.env.NODE_ENV !== 'production') {
1341
- if (getPopupContainer && getPopupContainer()) {
1342
- var _el = getPopupContainer();
1343
- var style = window.getComputedStyle(_el);
1344
- if (style.position === 'static') {
1345
- useWarning('The element specified by "getPopupContainer" must have "position" set.');
1346
- }
1347
- }
1348
- }
1349
- var updateRect = function updateRect() {
1350
- var _getRefRect = getRefRect(parent, getPopupContainer),
1351
- top = _getRefRect.top,
1352
- left = _getRefRect.left,
1353
- right = _getRefRect.right,
1354
- nativeWidth = _getRefRect.width;
1355
- setRect({
1356
- top: top,
1357
- left: left,
1358
- right: right,
1359
- width: nativeWidth
1360
- });
1361
- };
1362
- useResize(updateRect);
1363
- useClickAnyWhere(function () {
1364
- var _getRefRect2 = getRefRect(parent, getPopupContainer),
1365
- top = _getRefRect2.top,
1366
- left = _getRefRect2.left;
1367
- var shouldUpdatePosition = top !== rect.top || left !== rect.left;
1368
- if (!shouldUpdatePosition) return;
1369
- updateRect();
1370
- });
1371
- useDOMObserver(parent, function () {
1372
- updateRect();
1373
- });
1374
- React.useEffect(function () {
1375
- if (!parent || !parent.current) return;
1376
- parent.current.addEventListener('mouseenter', updateRect);
1377
- /* istanbul ignore next */
1378
- return function () {
1379
- if (!parent || !parent.current) return;
1380
- parent.current.removeEventListener('mouseenter', updateRect);
1381
- };
1382
- }, [parent]);
1383
- var clickHandler = function clickHandler(event) {
1384
- event.stopPropagation();
1385
- event.nativeEvent.stopImmediatePropagation();
1386
- event.preventDefault();
1387
- };
1388
- var mouseDownHandler = function mouseDownHandler(event) {
1389
- event.preventDefault();
1390
- };
1391
- if (!el) return null;
1392
- return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React.createElement(CssTransition, {
1393
- visible: visible
1394
- }, /*#__PURE__*/React.createElement("div", {
1395
- onClick: clickHandler,
1396
- onMouseDown: mouseDownHandler,
1397
- className: _JSXStyle.dynamic([["1644673105", [rect.top + 2, rect.left, rect.width, rect.width]]]) + " " + (classes || "")
1398
- }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
1399
- id: "1644673105",
1400
- dynamic: [rect.top + 2, rect.left, rect.width, rect.width]
1401
- }, ".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);
1402
- });
1403
-
1404
2866
  var SelectDropdown = /*#__PURE__*/React.forwardRef(function (_ref, dropdownRef) {
1405
2867
  var visible = _ref.visible,
1406
2868
  children = _ref.children,
@@ -1410,15 +2872,15 @@ var SelectDropdown = /*#__PURE__*/React.forwardRef(function (_ref, dropdownRef)
1410
2872
  dropdownStyle = _ref$dropdownStyle === void 0 ? {} : _ref$dropdownStyle,
1411
2873
  disableMatchWidth = _ref.disableMatchWidth,
1412
2874
  getPopupContainer = _ref.getPopupContainer;
1413
- var theme = useTheme();
2875
+ var theme = distExports.useTheme();
1414
2876
  var internalDropdownRef = React.useRef(null);
1415
2877
  var _useSelectContext = useSelectContext(),
1416
2878
  ref = _useSelectContext.ref;
1417
- var classes = useClasses('select-dropdown', className);
2879
+ var classes = distExports.useClasses('select-dropdown', className);
1418
2880
  React.useImperativeHandle(dropdownRef, function () {
1419
2881
  return internalDropdownRef.current;
1420
2882
  });
1421
- return /*#__PURE__*/React.createElement(Dropdown, {
2883
+ return /*#__PURE__*/React.createElement(distExports.Dropdown, {
1422
2884
  parent: ref,
1423
2885
  visible: visible,
1424
2886
  disableMatchWidth: disableMatchWidth,
@@ -1528,7 +2990,7 @@ var withScale = function withScale(Render) {
1528
2990
  var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref0, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31;
1529
2991
  var children = _ref.children,
1530
2992
  props = _objectWithoutProperties(_ref, _excluded$5);
1531
- var _useTheme = useTheme(),
2993
+ var _useTheme = distExports.useTheme(),
1532
2994
  layout = _useTheme.layout;
1533
2995
  var paddingLeft = props.paddingLeft,
1534
2996
  pl = props.pl,
@@ -1649,7 +3111,7 @@ var GridBasicItem = function GridBasicItem(_ref) {
1649
3111
  _ref$className = _ref.className,
1650
3112
  className = _ref$className === void 0 ? '' : _ref$className,
1651
3113
  props = _objectWithoutProperties(_ref, _excluded$4);
1652
- var theme = useTheme();
3114
+ var theme = distExports.useTheme();
1653
3115
  var _useScale = useScale(),
1654
3116
  SCALES = _useScale.SCALES;
1655
3117
  var classes = React.useMemo(function () {
@@ -1680,7 +3142,7 @@ var GridBasicItem = function GridBasicItem(_ref) {
1680
3142
  };
1681
3143
  }, [xs, sm, md, lg, xl]);
1682
3144
  return /*#__PURE__*/React.createElement("div", _extends({}, props, {
1683
- className: _JSXStyle.dynamic([["568430467", [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]]]) + " " + (props && props.className != null && props.className || useClasses('item', classes, className) || "")
3145
+ className: _JSXStyle.dynamic([["568430467", [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]]]) + " " + (props && props.className != null && props.className || distExports.useClasses('item', classes, className) || "")
1684
3146
  }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
1685
3147
  id: "568430467",
1686
3148
  dynamic: [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]
@@ -1705,7 +3167,7 @@ var GridComponent = function GridComponent(_ref) {
1705
3167
  },
1706
3168
  resolveClassName = _styles$className.className,
1707
3169
  styles = _styles$className.styles;
1708
- var classes = useClasses(resolveClassName, className);
3170
+ var classes = distExports.useClasses(resolveClassName, className);
1709
3171
  return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
1710
3172
  className: classes
1711
3173
  }, props), children, styles);
@@ -1738,7 +3200,7 @@ var GridContainerComponent = function GridContainerComponent(_ref) {
1738
3200
  },
1739
3201
  resolveClassName = _styles$className.className,
1740
3202
  styles = _styles$className.styles;
1741
- var classes = useClasses(resolveClassName, className);
3203
+ var classes = distExports.useClasses(resolveClassName, className);
1742
3204
  return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
1743
3205
  className: classes
1744
3206
  }, props), children, styles);
@@ -1750,7 +3212,7 @@ Grid.Container = GridContainer;
1750
3212
 
1751
3213
  var SelectIconClear = function SelectIconClear(_ref) {
1752
3214
  var onClick = _ref.onClick;
1753
- var theme = useTheme();
3215
+ var theme = distExports.useTheme();
1754
3216
  var clickHandler = function clickHandler(event) {
1755
3217
  event.preventDefault();
1756
3218
  event.stopPropagation();
@@ -1786,7 +3248,7 @@ var SelectMultipleValue = function SelectMultipleValue(_ref) {
1786
3248
  var disabled = _ref.disabled,
1787
3249
  onClear = _ref.onClear,
1788
3250
  children = _ref.children;
1789
- var theme = useTheme();
3251
+ var theme = distExports.useTheme();
1790
3252
  return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement("div", {
1791
3253
  className: _JSXStyle.dynamic([["3357578496", [theme.layout.radius, theme.palette.accents_2, disabled ? theme.palette.accents_4 : theme.palette.accents_6]]]) + " " + "item"
1792
3254
  }, children, !!onClear && /*#__PURE__*/React.createElement(MemoSelectIconClear, {
@@ -1835,18 +3297,6 @@ var getColors = function getColors(palette, status) {
1835
3297
  return colors[status];
1836
3298
  };
1837
3299
 
1838
- var Ellipsis = function Ellipsis(_ref) {
1839
- var children = _ref.children,
1840
- height = _ref.height;
1841
- return /*#__PURE__*/React.createElement("span", {
1842
- className: _JSXStyle.dynamic([["822089635", [height]]])
1843
- }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
1844
- id: "822089635",
1845
- dynamic: [height]
1846
- }, "span.__jsx-style-dynamic-selector{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:".concat(height, ";min-width:0;}")));
1847
- };
1848
- var Ellipsis$1 = /*#__PURE__*/React.memo(Ellipsis);
1849
-
1850
3300
  var SelectInput = /*#__PURE__*/React.forwardRef(function (_ref, inputRef) {
1851
3301
  var visible = _ref.visible,
1852
3302
  onBlur = _ref.onBlur,
@@ -1908,7 +3358,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
1908
3358
  _ref$onDropdownVisibl = _ref.onDropdownVisibleChange,
1909
3359
  onDropdownVisibleChange = _ref$onDropdownVisibl === void 0 ? function () {} : _ref$onDropdownVisibl,
1910
3360
  props = _objectWithoutProperties(_ref, _excluded$1);
1911
- var theme = useTheme();
3361
+ var theme = distExports.useTheme();
1912
3362
  var _useScale = useScale(),
1913
3363
  SCALES = _useScale.SCALES;
1914
3364
  var ref = React.useRef(null);
@@ -1922,7 +3372,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
1922
3372
  _useState4 = _slicedToArray(_useState3, 2),
1923
3373
  selectFocus = _useState4[0],
1924
3374
  setSelectFocus = _useState4[1];
1925
- var _useCurrentState = useCurrentState(function () {
3375
+ var _useCurrentState = distExports.useCurrentState(function () {
1926
3376
  if (!multiple) return init;
1927
3377
  if (Array.isArray(init)) return init;
1928
3378
  return typeof init === 'undefined' ? [] : [init];
@@ -2023,12 +3473,12 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
2023
3473
  updateVisible(false);
2024
3474
  setSelectFocus(false);
2025
3475
  };
2026
- var classes = useClasses('select', {
3476
+ var classes = distExports.useClasses('select', {
2027
3477
  active: selectFocus || visible,
2028
3478
  multiple: multiple
2029
3479
  }, className);
2030
3480
  return /*#__PURE__*/React.createElement("div", {
2031
- className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
3481
+ className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
2032
3482
  }, label && /*#__PURE__*/React.createElement("label", {
2033
3483
  style: {
2034
3484
  display: 'block',
@@ -2036,7 +3486,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
2036
3486
  fontSize: '14px',
2037
3487
  fontWeight: 'light'
2038
3488
  },
2039
- className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
3489
+ className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
2040
3490
  }, label), /*#__PURE__*/React.createElement(SelectContext.Provider, {
2041
3491
  value: initialValue
2042
3492
  }, /*#__PURE__*/React.createElement("div", _extends({
@@ -2044,7 +3494,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
2044
3494
  onClick: clickHandler,
2045
3495
  onMouseDown: mouseDownHandler
2046
3496
  }, props, {
2047
- className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + (props && props.className != null && props.className || classes || "")
3497
+ className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + (props && props.className != null && props.className || classes || "")
2048
3498
  }), /*#__PURE__*/React.createElement(SelectInput, {
2049
3499
  ref: inputRef,
2050
3500
  visible: visible,
@@ -2053,11 +3503,11 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
2053
3503
  return setSelectFocus(true);
2054
3504
  }
2055
3505
  }), isEmpty && /*#__PURE__*/React.createElement("span", {
2056
- className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value placeholder"
2057
- }, /*#__PURE__*/React.createElement(Ellipsis$1, {
3506
+ className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value placeholder"
3507
+ }, /*#__PURE__*/React.createElement(distExports.Ellipsis, {
2058
3508
  height: "var(--select-height)"
2059
3509
  }, placeholder)), value && !multiple && /*#__PURE__*/React.createElement("span", {
2060
- className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value"
3510
+ className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value"
2061
3511
  }, selectedChild), value && multiple && /*#__PURE__*/React.createElement(Grid.Container, {
2062
3512
  gap: 0.5
2063
3513
  }, selectedChild), /*#__PURE__*/React.createElement(SelectDropdown, {
@@ -2068,17 +3518,30 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
2068
3518
  disableMatchWidth: disableMatchWidth,
2069
3519
  getPopupContainer: getPopupContainer
2070
3520
  }, children), !pure && /*#__PURE__*/React.createElement("div", {
2071
- className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "icon"
3521
+ className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "icon"
2072
3522
  }, /*#__PURE__*/React.createElement(Icon, {
2073
- className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
3523
+ className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
2074
3524
  })))), /*#__PURE__*/React.createElement(_JSXStyle, {
2075
- id: "3282295248",
3525
+ id: "2996243684",
2076
3526
  dynamic: [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]
2077
3527
  }, ".select.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;position:relative;cursor:".concat(disabled ? 'not-allowed' : 'pointer', ";max-width:90vw;overflow:hidden;-webkit-transition:border 150ms ease-in 0s,color 200ms ease-out 0s, box-shadow 200ms ease 0s;transition:border 150ms ease-in 0s,color 200ms ease-out 0s, box-shadow 200ms ease 0s;border:1px solid ").concat(border, ";border-radius:").concat(theme.layout.radius, ";background-color:").concat(disabled ? theme.palette.accents_1 : theme.palette.background, ";--select-font-size:").concat(SCALES.font(0.875), ";--select-height:").concat(SCALES.height(2.25), ";min-width:11.5em;width:").concat(SCALES.width(1, 'initial'), ";height:var(--select-height);padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0.334), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0.667), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.multiple.__jsx-style-dynamic-selector{height:auto;min-height:var(--select-height);padding:").concat(SCALES.pt(0.334), " ").concat(SCALES.pr(0.334), " ").concat(SCALES.pb(0.334), " ").concat(SCALES.pl(0.667), ";}.select.active.__jsx-style-dynamic-selector,.select.__jsx-style-dynamic-selector:hover{border-color:").concat(disabled ? theme.palette.border : borderActive, ";}.select.active.icon.__jsx-style-dynamic-selector,.select.__jsx-style-dynamic-selector:hover .icon.__jsx-style-dynamic-selector{color:").concat(disabled ? theme.palette.accents_5 : borderActive, ";}.value.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex:1;-ms-flex:1;flex:1;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1;padding:0;margin-right:1.25em;font-size:var(--select-font-size);color:").concat(disabled ? theme.palette.accents_4 : theme.palette.foreground, ";width:calc(100% - 1.25em);}.value.__jsx-style-dynamic-selector>div,.value.__jsx-style-dynamic-selector>div:hover{border-radius:0;background-color:transparent;padding:0;margin:0;color:inherit;}.placeholder.__jsx-style-dynamic-selector{color:").concat(placeholderColor, ";}.icon.__jsx-style-dynamic-selector{position:absolute;right:").concat(theme.layout.gapQuarter, ";font-size:var(--select-font-size);top:50%;bottom:0;-webkit-transform:translateY(-50%) rotate(").concat(visible ? '180' : '0', "deg);-ms-transform:translateY(-50%) rotate(").concat(visible ? '180' : '0', "deg);transform:translateY(-50%) rotate(").concat(visible ? '180' : '0', "deg);pointer-events:none;-webkit-transition:-webkit-transform 200ms ease;-webkit-transition:transform 200ms ease;transition:transform 200ms ease;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:").concat(iconBorder, ";}")));
2078
3528
  });
2079
3529
  SelectComponent.displayName = 'Select';
2080
3530
  var Select = withScale(SelectComponent);
2081
3531
 
3532
+ var warningStack = {};
3533
+ var useWarning = function useWarning(message, component) {
3534
+ var tag = " [".concat(component, "]") ;
3535
+ var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
3536
+ if (typeof console === 'undefined') return;
3537
+ if (warningStack[log]) return;
3538
+ warningStack[log] = true;
3539
+ if (process.env.NODE_ENV !== 'production') {
3540
+ return console.error(log);
3541
+ }
3542
+ console.warn(log);
3543
+ };
3544
+
2082
3545
  var _excluded = ["value", "className", "children", "disabled", "divider", "label", "preventAllEvents"];
2083
3546
  var SelectOptionComponent = function SelectOptionComponent(_ref) {
2084
3547
  var identValue = _ref.value,
@@ -2094,7 +3557,7 @@ var SelectOptionComponent = function SelectOptionComponent(_ref) {
2094
3557
  _ref$preventAllEvents = _ref.preventAllEvents,
2095
3558
  preventAllEvents = _ref$preventAllEvents === void 0 ? false : _ref$preventAllEvents,
2096
3559
  props = _objectWithoutProperties(_ref, _excluded);
2097
- var theme = useTheme();
3560
+ var theme = distExports.useTheme();
2098
3561
  var _useScale = useScale(),
2099
3562
  SCALES = _useScale.SCALES;
2100
3563
  var _useSelectContext = useSelectContext(),
@@ -2107,7 +3570,7 @@ var SelectOptionComponent = function SelectOptionComponent(_ref) {
2107
3570
  var isLabel = React.useMemo(function () {
2108
3571
  return label || divider;
2109
3572
  }, [label, divider]);
2110
- var classes = useClasses('option', {
3573
+ var classes = distExports.useClasses('option', {
2111
3574
  divider: divider,
2112
3575
  label: label
2113
3576
  }, className);
@@ -2145,7 +3608,7 @@ var SelectOptionComponent = function SelectOptionComponent(_ref) {
2145
3608
  onClick: clickHandler
2146
3609
  }, props, {
2147
3610
  className: _JSXStyle.dynamic([["199367556", [bgColor, color, isDisabled ? 'not-allowed' : 'pointer', SCALES.font(0.75), SCALES.width(1, '100%'), SCALES.height(2.25), SCALES.pt(0), SCALES.pr(0.667), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBgColor, theme.palette.accents_7, theme.palette.border, SCALES.width(1, '100%'), SCALES.height(1, 0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0.5), SCALES.mr(0), SCALES.mb(0.5), SCALES.ml(0), theme.palette.accents_7, theme.palette.border, SCALES.font(0.875), SCALES.width(1, '100%')]]]) + " " + (props && props.className != null && props.className || classes || "")
2148
- }), /*#__PURE__*/React.createElement(Ellipsis$1, {
3611
+ }), /*#__PURE__*/React.createElement(distExports.Ellipsis, {
2149
3612
  height: SCALES.height(2.25)
2150
3613
  }, children), /*#__PURE__*/React.createElement(_JSXStyle, {
2151
3614
  id: "199367556",