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