@helpdice/ui 1.7.5 → 1.7.8

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