@pedidopago/ui 1.7.26 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/dist/components/Alert/alert.test.js +1 -85
  2. package/dist/components/Alert/index.js +1 -63
  3. package/dist/components/Alert/styles.js +1 -32
  4. package/dist/components/Avatar/avatar.test.js +1 -67
  5. package/dist/components/Avatar/index.js +1 -94
  6. package/dist/components/Avatar/styles.js +1 -51
  7. package/dist/components/Badge/badge.test.js +1 -71
  8. package/dist/components/Badge/index.js +2 -43
  9. package/dist/components/Badge/styles.js +1 -33
  10. package/dist/components/Button/Button.test.js +1 -154
  11. package/dist/components/Button/index.js +1 -87
  12. package/dist/components/Button/styles.js +1 -112
  13. package/dist/components/Card/card.test.js +1 -30
  14. package/dist/components/Card/index.js +1 -44
  15. package/dist/components/Card/styles.js +1 -16
  16. package/dist/components/CheckboxInput/checkbox-input.test.js +1 -170
  17. package/dist/components/CheckboxInput/components/MultipleCheckbox.js +1 -205
  18. package/dist/components/CheckboxInput/index.js +1 -94
  19. package/dist/components/CheckboxInput/styles.js +1 -34
  20. package/dist/components/ChoiceList/index.d.ts +6 -0
  21. package/dist/components/ChoiceList/index.d.ts.map +1 -0
  22. package/dist/components/ChoiceList/index.js +1 -0
  23. package/dist/components/ChoiceList/styles.d.ts +22 -0
  24. package/dist/components/ChoiceList/styles.d.ts.map +1 -0
  25. package/dist/components/ChoiceList/styles.js +1 -0
  26. package/dist/components/ChoiceList/types.d.ts +24 -0
  27. package/dist/components/ChoiceList/types.d.ts.map +1 -0
  28. package/dist/components/ChoiceList/types.js +1 -0
  29. package/dist/components/CollapseCard/ExpandButton/index.js +1 -40
  30. package/dist/components/CollapseCard/ExpandButton/styles.js +1 -16
  31. package/dist/components/CollapseCard/expand-button.test.js +1 -161
  32. package/dist/components/CollapseCard/index.js +1 -98
  33. package/dist/components/CollapseCard/styles.js +1 -26
  34. package/dist/components/ColorPicker/colorpicker.test.js +1 -64
  35. package/dist/components/ColorPicker/components/ColorHue.js +1 -44
  36. package/dist/components/ColorPicker/components/ColorInput.js +1 -63
  37. package/dist/components/ColorPicker/components/ColorPickerBox.js +1 -52
  38. package/dist/components/ColorPicker/components/ColorPointer.js +1 -25
  39. package/dist/components/ColorPicker/components/ColorSelector.js +1 -107
  40. package/dist/components/ColorPicker/hooks/useCachedCallback.js +1 -16
  41. package/dist/components/ColorPicker/hooks/useHsva.js +1 -53
  42. package/dist/components/ColorPicker/index.js +1 -93
  43. package/dist/components/ColorPicker/styles.js +1 -46
  44. package/dist/components/ColorPicker/utils/checkers.js +1 -55
  45. package/dist/components/ColorPicker/utils/conversors.js +2 -243
  46. package/dist/components/ColorPicker/utils/parsers.js +10 -108
  47. package/dist/components/ComposeIcon/index.js +2 -48
  48. package/dist/components/ComposeIcon/styles.js +1 -53
  49. package/dist/components/DateInput/DateInput-example.js +7 -45
  50. package/dist/components/DateInput/components/ModalWrapper/index.js +1 -35
  51. package/dist/components/DateInput/components/ModalWrapper/styles.js +1 -21
  52. package/dist/components/DateInput/dateInput.test.js +2 -43
  53. package/dist/components/DateInput/index.js +2 -104
  54. package/dist/components/DateInput/styles.js +1 -18
  55. package/dist/components/DatePicker/components/DatePickerContent.js +2 -222
  56. package/dist/components/DatePicker/components/DateYearPicker.js +1 -102
  57. package/dist/components/DatePicker/datepicker.test.js +1 -120
  58. package/dist/components/DatePicker/index.js +1 -236
  59. package/dist/components/DatePicker/styles.js +1 -88
  60. package/dist/components/DatePicker/utils/getMonthName.js +1 -11
  61. package/dist/components/Dialog/dialog-example.js +1 -46
  62. package/dist/components/Dialog/dialog.test.js +1 -68
  63. package/dist/components/Dialog/index.js +2 -100
  64. package/dist/components/Dialog/styles.js +1 -31
  65. package/dist/components/Dropzone/dropzone.test.js +1 -69
  66. package/dist/components/Dropzone/index.js +1 -289
  67. package/dist/components/Dropzone/styles.js +1 -75
  68. package/dist/components/Dropzone/utils/accepts.js +2 -27
  69. package/dist/components/EmojiPicker/Emote/index.js +2 -24
  70. package/dist/components/EmojiPicker/Emote/styles.js +1 -27
  71. package/dist/components/EmojiPicker/EmotePickerData/constants.js +1 -51
  72. package/dist/components/EmojiPicker/EmotePickerData/index.js +2 -159
  73. package/dist/components/EmojiPicker/EmotePickerData/styles.js +1 -57
  74. package/dist/components/EmojiPicker/EmotePickerData/utils.js +1 -41
  75. package/dist/components/EmojiPicker/Example/EmotePickerExample.js +1 -43
  76. package/dist/components/EmojiPicker/animation.js +1 -43
  77. package/dist/components/EmojiPicker/index.js +1 -169
  78. package/dist/components/EmojiPicker/styles.js +1 -21
  79. package/dist/components/Flex/flex.test.js +1 -336
  80. package/dist/components/Flex/index.js +1 -49
  81. package/dist/components/Flex/styles.js +1 -25
  82. package/dist/components/Grid/grid.test.js +1 -134
  83. package/dist/components/Grid/index.js +1 -51
  84. package/dist/components/Grid/styles.js +1 -48
  85. package/dist/components/Icon/data/beauty.js +2 -206
  86. package/dist/components/Icon/data/dash.js +2 -2
  87. package/dist/components/Icon/data/ecommerce.js +2 -94
  88. package/dist/components/Icon/data/form.js +2 -248
  89. package/dist/components/Icon/data/health.js +2 -255
  90. package/dist/components/Icon/data/illustrations.js +2 -318
  91. package/dist/components/Icon/data/men.js +2 -52
  92. package/dist/components/Icon/data/payment.js +2 -94
  93. package/dist/components/Icon/data/pedidoPago.js +2 -45
  94. package/dist/components/Icon/data/physicalPerfomance.js +2 -283
  95. package/dist/components/Icon/data/social.js +2 -24
  96. package/dist/components/Icon/data/status.js +2 -115
  97. package/dist/components/Icon/data/summer.js +2 -52
  98. package/dist/components/Icon/data/woman.js +2 -80
  99. package/dist/components/Icon/icon.test.js +1 -57
  100. package/dist/components/Icon/index.js +1 -53
  101. package/dist/components/Icon/scripts/build.js +9 -104
  102. package/dist/components/Icon/scripts/extractor.js +2 -33
  103. package/dist/components/Icon/scripts/run-build.js +2 -7
  104. package/dist/components/Icon/scripts/writers.js +3 -34
  105. package/dist/components/Icon/styles.js +1 -22
  106. package/dist/components/Icon/utils/allIcons.js +1 -28
  107. package/dist/components/Icon/utils/iconExists.js +1 -13
  108. package/dist/components/IconItem/IconItem.test.js +1 -58
  109. package/dist/components/IconItem/index.js +1 -52
  110. package/dist/components/IconItem/styles.js +1 -43
  111. package/dist/components/Illustration/illustration.test.js +4 -50
  112. package/dist/components/Illustration/index.js +2 -65
  113. package/dist/components/Illustration/styles.js +1 -65
  114. package/dist/components/ImageItem/imageFake.js +1 -25
  115. package/dist/components/ImageItem/index.js +2 -66
  116. package/dist/components/ImageItem/input.test.js +1 -85
  117. package/dist/components/ImageItem/styles.js +1 -61
  118. package/dist/components/Input/index.js +1 -163
  119. package/dist/components/Input/input.test.js +1 -120
  120. package/dist/components/Input/styles.js +1 -177
  121. package/dist/components/Label/index.js +1 -45
  122. package/dist/components/Label/label.test.js +1 -83
  123. package/dist/components/Label/styles.js +1 -21
  124. package/dist/components/List/index.js +1 -39
  125. package/dist/components/List/list.test.js +1 -64
  126. package/dist/components/List/styles.js +1 -23
  127. package/dist/components/Modal/ModalExample.js +1 -70
  128. package/dist/components/Modal/index.js +1 -145
  129. package/dist/components/Modal/modal.test.js +1 -179
  130. package/dist/components/Modal/styles.js +1 -33
  131. package/dist/components/MultipleSelect/MultipleSelect.test.js +1 -334
  132. package/dist/components/MultipleSelect/animations.js +1 -25
  133. package/dist/components/MultipleSelect/components/InputWrapper/index.js +1 -26
  134. package/dist/components/MultipleSelect/components/OptionsArea/index.js +1 -244
  135. package/dist/components/MultipleSelect/components/OptionsArea/styles.js +1 -68
  136. package/dist/components/MultipleSelect/components/SelectArea/ButtonsArea.js +1 -27
  137. package/dist/components/MultipleSelect/components/SelectArea/SelectAreaWrapper.js +1 -37
  138. package/dist/components/MultipleSelect/components/SelectArea/SelectedOptionsArea.js +1 -49
  139. package/dist/components/MultipleSelect/components/SelectArea/index.js +1 -100
  140. package/dist/components/MultipleSelect/components/SelectArea/styles.js +1 -36
  141. package/dist/components/MultipleSelect/components/index.js +1 -38
  142. package/dist/components/MultipleSelect/index.js +1 -209
  143. package/dist/components/NewSelect/Examples/constants.js +1 -56
  144. package/dist/components/NewSelect/Examples/index.js +1 -161
  145. package/dist/components/NewSelect/components/Chip/index.js +1 -36
  146. package/dist/components/NewSelect/components/Chip/styles.js +1 -24
  147. package/dist/components/NewSelect/components/OptionsSelect/styles.js +1 -21
  148. package/dist/components/NewSelect/components/SelectInputSearch/index.js +1 -24
  149. package/dist/components/NewSelect/components/SelectItem/index.js +1 -22
  150. package/dist/components/NewSelect/components/SelectItem/styles.js +1 -24
  151. package/dist/components/NewSelect/index.js +1 -18
  152. package/dist/components/NewSelect/multiple/index.js +1 -246
  153. package/dist/components/NewSelect/newSelect.test.js +1 -108
  154. package/dist/components/NewSelect/single/index.js +1 -183
  155. package/dist/components/NewSelect/styles.js +1 -44
  156. package/dist/components/Observer/index.js +1 -59
  157. package/dist/components/Observer/observer.test.js +2 -43
  158. package/dist/components/Pagination/hooks/usePagination.js +1 -57
  159. package/dist/components/Pagination/index.js +1 -174
  160. package/dist/components/Pagination/pagination.test.js +1 -118
  161. package/dist/components/Pagination/styles.js +1 -78
  162. package/dist/components/Progress/Circle/index.js +1 -102
  163. package/dist/components/Progress/Circle/styles.js +1 -69
  164. package/dist/components/Progress/Linear/index.js +1 -62
  165. package/dist/components/Progress/Linear/styles.js +1 -66
  166. package/dist/components/Progress/getSteps.js +1 -17
  167. package/dist/components/Progress/index.js +1 -39
  168. package/dist/components/Progress/progress.test.js +1 -109
  169. package/dist/components/Radio/components/RadioGroup/index.d.ts +5 -0
  170. package/dist/components/Radio/components/RadioGroup/index.d.ts.map +1 -0
  171. package/dist/components/Radio/components/RadioGroup/index.js +1 -0
  172. package/dist/components/Radio/components/RadioGroup/styles.d.ts +19 -0
  173. package/dist/components/Radio/components/RadioGroup/styles.d.ts.map +1 -0
  174. package/dist/components/Radio/components/RadioGroup/styles.js +1 -0
  175. package/dist/components/Radio/components/RadioGroup/types.d.ts +17 -0
  176. package/dist/components/Radio/components/RadioGroup/types.d.ts.map +1 -0
  177. package/dist/components/Radio/components/RadioGroup/types.js +1 -0
  178. package/dist/components/Radio/index.d.ts +5 -0
  179. package/dist/components/Radio/index.d.ts.map +1 -0
  180. package/dist/components/Radio/index.js +1 -0
  181. package/dist/components/Radio/styles.d.ts +10 -0
  182. package/dist/components/Radio/styles.d.ts.map +1 -0
  183. package/dist/components/Radio/styles.js +1 -0
  184. package/dist/components/Radio/types.d.ts +6 -0
  185. package/dist/components/Radio/types.d.ts.map +1 -0
  186. package/dist/components/Radio/types.js +1 -0
  187. package/dist/components/Rating/index.js +1 -133
  188. package/dist/components/Rating/rating.test.js +1 -63
  189. package/dist/components/Rating/styles.js +1 -27
  190. package/dist/components/ReactPortal/index.js +1 -43
  191. package/dist/components/ReactPortal/reactPortal.test.js +1 -21
  192. package/dist/components/ReactPortal/utils/createWrapperAndApprendToBody.js +1 -12
  193. package/dist/components/Select/components/OptionsSelect/index.js +1 -73
  194. package/dist/components/Select/components/OptionsSelect/styles.js +1 -21
  195. package/dist/components/Select/index.js +4 -247
  196. package/dist/components/Select/select.test.js +1 -58
  197. package/dist/components/Select/styles.js +1 -46
  198. package/dist/components/Skeleton/index.js +1 -28
  199. package/dist/components/Skeleton/skeleton.test.js +1 -90
  200. package/dist/components/Skeleton/styles.js +1 -27
  201. package/dist/components/Slider/SliderExample.js +1 -52
  202. package/dist/components/Slider/components/SliderPointer.js +1 -39
  203. package/dist/components/Slider/components/SliderRail.js +1 -116
  204. package/dist/components/Slider/components/SliderSelector.js +1 -173
  205. package/dist/components/Slider/hooks/useEventCallback.js +1 -16
  206. package/dist/components/Slider/index.js +1 -137
  207. package/dist/components/Slider/slider.test.js +1 -121
  208. package/dist/components/Slider/styles.js +1 -69
  209. package/dist/components/Spinner/index.js +1 -26
  210. package/dist/components/Spinner/spinner.test.js +1 -45
  211. package/dist/components/Spinner/styles.js +1 -23
  212. package/dist/components/Steps/components/StepIcon/index.js +1 -50
  213. package/dist/components/Steps/components/StepIcon/styles.js +1 -42
  214. package/dist/components/Steps/components/StepIcon/utils.js +1 -22
  215. package/dist/components/Steps/index.js +1 -116
  216. package/dist/components/Steps/steps.test.js +1 -53
  217. package/dist/components/Steps/styles.js +1 -96
  218. package/dist/components/Steps/utils.js +1 -15
  219. package/dist/components/Switch/index.js +1 -73
  220. package/dist/components/Switch/styles.js +1 -58
  221. package/dist/components/Switch/switch.test.js +2 -115
  222. package/dist/components/Table/components/MenuItem.js +1 -59
  223. package/dist/components/Table/components/TableSkeleton.js +1 -39
  224. package/dist/components/Table/components/animations.js +1 -24
  225. package/dist/components/Table/index.js +2 -253
  226. package/dist/components/Table/styles.js +1 -49
  227. package/dist/components/Table/table.test.js +1 -114
  228. package/dist/components/Tabs/TabsExample.js +1 -64
  229. package/dist/components/Tabs/components/Tab.js +1 -49
  230. package/dist/components/Tabs/components/TabPanel.js +1 -25
  231. package/dist/components/Tabs/components/Tabs.js +1 -107
  232. package/dist/components/Tabs/index.js +1 -26
  233. package/dist/components/Tabs/styles.js +1 -61
  234. package/dist/components/Tabs/tabs.test.js +1 -146
  235. package/dist/components/Tag/index.js +1 -53
  236. package/dist/components/Tag/styles.js +1 -34
  237. package/dist/components/Tag/tag.test.js +1 -64
  238. package/dist/components/TextAreaInput/index.js +1 -74
  239. package/dist/components/TextAreaInput/styles.js +1 -53
  240. package/dist/components/TextAreaInput/text-area-input.test.js +1 -81
  241. package/dist/components/Thumbnail/index.js +1 -125
  242. package/dist/components/Thumbnail/styles.js +1 -47
  243. package/dist/components/Thumbnail/thumbnail.test.js +1 -66
  244. package/dist/components/Thumbnail/utils/index.js +1 -27
  245. package/dist/components/Thumbnail/utils/validate-file-size.js +1 -10
  246. package/dist/components/Thumbnail/utils/validate-file-type.js +1 -9
  247. package/dist/components/TimeInput/constants.js +1 -29
  248. package/dist/components/TimeInput/index.js +1 -288
  249. package/dist/components/TimeInput/styles.js +1 -34
  250. package/dist/components/TimeInput/utils.js +1 -94
  251. package/dist/components/Timeline/components/Timeline.js +1 -17
  252. package/dist/components/Timeline/components/TimelineContent.js +1 -61
  253. package/dist/components/Timeline/components/TimelineItem.js +1 -25
  254. package/dist/components/Timeline/components/TimelineSeparator.js +1 -20
  255. package/dist/components/Timeline/index.js +1 -33
  256. package/dist/components/Timeline/styles.js +1 -37
  257. package/dist/components/Timeline/timeline.test.js +1 -138
  258. package/dist/components/Toast/button-example.js +1 -31
  259. package/dist/components/Toast/components/Toast.js +1 -79
  260. package/dist/components/Toast/contexts/ToastProvider.js +1 -72
  261. package/dist/components/Toast/hooks/useToast.js +1 -18
  262. package/dist/components/Toast/index.js +1 -111
  263. package/dist/components/Toast/styles.js +1 -36
  264. package/dist/components/Toast/toast.test.js +1 -129
  265. package/dist/components/Tooltip/components/TooltipLabel.js +1 -71
  266. package/dist/components/Tooltip/example.js +1 -27
  267. package/dist/components/Tooltip/index.js +1 -187
  268. package/dist/components/Tooltip/styles.js +1 -20
  269. package/dist/components/Typography/index.js +1 -37
  270. package/dist/components/Typography/styles.js +1 -15
  271. package/dist/components/Typography/typography.test.js +1 -288
  272. package/dist/index.d.ts +5 -2
  273. package/dist/index.d.ts.map +1 -1
  274. package/dist/index.js +1 -548
  275. package/dist/shared/animations/opacityAnimation.js +1 -21
  276. package/dist/shared/assets/emotes.js +1 -1
  277. package/dist/shared/components/FocusLock/index.js +5 -86
  278. package/dist/shared/formatters/format-number.js +5 -41
  279. package/dist/shared/global.js +1 -8
  280. package/dist/shared/hooks/devices.js +1 -14
  281. package/dist/shared/hooks/useBreakpoints.js +2 -95
  282. package/dist/shared/hooks/useDebounce.js +1 -35
  283. package/dist/shared/hooks/useDevices.js +2 -42
  284. package/dist/shared/hooks/useDisableBodyScroll.js +5 -52
  285. package/dist/shared/hooks/useDraggableScroll/index.js +5 -65
  286. package/dist/shared/hooks/useKeyPress.js +1 -18
  287. package/dist/shared/hooks/useObserver.js +2 -29
  288. package/dist/shared/hooks/useOnClickOutside.js +1 -30
  289. package/dist/shared/hooks/useReposition/index.js +2 -53
  290. package/dist/shared/hooks/useSystemTheme.js +1 -38
  291. package/dist/shared/hooks/useWindowSize.js +1 -36
  292. package/dist/shared/tests/test-utils.js +1 -31
  293. package/dist/shared/theme/button-example.js +1 -31
  294. package/dist/shared/theme/contexts/ThemeContext.js +1 -90
  295. package/dist/shared/theme/hooks/useColorMode.js +1 -18
  296. package/dist/shared/theme/hooks/useColorModeValue.js +1 -13
  297. package/dist/shared/theme/hooks/useTheme.js +1 -17
  298. package/dist/shared/theme/index.js +1 -67
  299. package/dist/shared/theme/objects/breakpoints.js +1 -15
  300. package/dist/shared/theme/objects/colors.js +1 -177
  301. package/dist/shared/theme/objects/shadows.js +1 -19
  302. package/dist/shared/theme/objects/sizes.js +6 -33
  303. package/dist/shared/theme/objects/spaces.js +1 -75
  304. package/dist/shared/theme/objects/transitions.js +1 -10
  305. package/dist/shared/theme/objects/typography.js +1 -20
  306. package/dist/shared/theme/objects/z-indexes.js +1 -20
  307. package/dist/shared/theme/theme.js +1 -36
  308. package/dist/shared/theme/theme.test.js +1 -94
  309. package/dist/shared/theme/utils/extendTheme.js +1 -25
  310. package/dist/shared/theme/utils/localStorageController.js +1 -21
  311. package/dist/styled.d.js +1 -3
  312. package/dist/utils/GenerateKey.js +3 -18
  313. package/dist/utils/brightnessColorChange.js +2 -17
  314. package/dist/utils/colorCheck.js +6 -64
  315. package/dist/utils/colorFunctions.js +1 -39
  316. package/dist/utils/colorToGray.js +2 -64
  317. package/dist/utils/customColorMode.js +1 -11
  318. package/dist/utils/file.js +5 -124
  319. package/dist/utils/formatters/bytes.js +2 -17
  320. package/dist/utils/formatters/capitalize.js +2 -11
  321. package/dist/utils/formatters/cep.js +3 -18
  322. package/dist/utils/formatters/cnpj.js +4 -38
  323. package/dist/utils/formatters/color.js +12 -101
  324. package/dist/utils/formatters/cpf.js +16 -85
  325. package/dist/utils/formatters/credit-card.js +5 -54
  326. package/dist/utils/formatters/email.js +1 -8
  327. package/dist/utils/formatters/index.js +1 -170
  328. package/dist/utils/formatters/name.js +4 -31
  329. package/dist/utils/formatters/number.js +5 -14
  330. package/dist/utils/formatters/passport.js +5 -33
  331. package/dist/utils/formatters/phone.js +17 -214
  332. package/dist/utils/formatters/price.js +3 -21
  333. package/dist/utils/formatters/rg.js +3 -18
  334. package/dist/utils/formatters/strings.js +4 -27
  335. package/dist/utils/fuctionsColors.js +1 -39
  336. package/dist/utils/generateUUID.js +1 -13
  337. package/dist/utils/getColorValue.js +2 -23
  338. package/dist/utils/getSvg.js +1 -17
  339. package/dist/utils/getValuesBySize.js +1 -9
  340. package/dist/utils/invertColor.js +4 -40
  341. package/package.json +2 -1
@@ -1,22 +1,7 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.generateKey = generateKey;
7
- exports.s4 = s4;
8
- /**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.generateKey=generateKey,exports.s4=s4;/**
9
2
  * Generates a random hexadecimal string with length 4.
10
3
  * @returns hexadecimal string.
11
- */
12
- function s4() {
13
- return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
14
- }
15
-
16
- /**
4
+ */function s4(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}/**
17
5
  * Generates a unique key using Date and pseudo random numbers.
18
6
  * @returns A unique key.
19
- */
20
- function generateKey() {
21
- return "".concat(Date.now().toString(16), "-").concat(s4()).concat(s4()).concat(s4(), "-").concat(s4()).concat(s4()).concat(s4());
22
- }
7
+ */function generateKey(){return"".concat(Date.now().toString(16),"-").concat(s4()).concat(s4()).concat(s4(),"-").concat(s4()).concat(s4()).concat(s4())}
@@ -1,22 +1,7 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.brightnessColorChange = brightnessColorChange;
7
- /**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.brightnessColorChange=brightnessColorChange;/**
8
2
  * Change the brightness of a color
9
3
  * @param color : color to change;
10
4
  * @param percent : percent of brightness;
11
5
  * @returns : new color with changed brightness;
12
6
  * @see https://stackoverflow.com/questions/5560248/programmatically-lighten-or-darken-a-hex-color-or-rgb-and-blend-colors
13
- */
14
- function brightnessColorChange(color, percent) {
15
- var f = parseInt(color.slice(1), 16);
16
- var t = percent < 0 ? 0 : 255;
17
- var p = percent < 0 ? percent * -1 : percent;
18
- var R = f >> 16;
19
- var G = f >> 8 & 0x00ff;
20
- var B = f & 0x0000ff;
21
- return '#' + (0x1000000 + (Math.round((t - R) * p) + R) * 0x10000 + (Math.round((t - G) * p) + G) * 0x100 + (Math.round((t - B) * p) + B)).toString(16).slice(1);
22
- }
7
+ */function brightnessColorChange(color,percent){var f=parseInt(color.slice(1),16),t=0>percent?0:255,p=0>percent?-1*percent:percent,R=f>>16,G=255&f>>8,B=255&f;return"#"+(16777216+65536*(Math.round((t-R)*p)+R)+256*(Math.round((t-G)*p)+G)+(Math.round((t-B)*p)+B)).toString(16).slice(1)}
@@ -1,83 +1,25 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.stripThemeColors = exports.parseHslColorToString = exports.parseHexColorToRgba = exports.isRgbHslColor = exports.isHexColor = void 0;
7
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- /**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.stripThemeColors=exports.parseHslColorToString=exports.parseHexColorToRgba=exports.isRgbHslColor=exports.isHexColor=void 0;function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}/**
14
2
  * Verifies if the provided color is a valid hex color.
15
3
  * @param color : color value;
16
4
  * @returns : true if color is valid, false otherwise;
17
5
  * @see https://stackoverflow.com/questions/8027423/how-to-check-if-a-string-is-a-valid-hex-color-representation/8027444#8027444
18
- */
19
- var isHexColor = function isHexColor(color) {
20
- var hexColorWithSixLetters = /^#[0-9A-F]{6}$/i;
21
- var hexColorWithThreeLetters = /^#([0-9A-F]{3}){1,2}$/i;
22
- return hexColorWithSixLetters.test(color) || hexColorWithThreeLetters.test(color);
23
- };
24
-
25
- /**
6
+ */var isHexColor=function(color){return /^#[0-9A-F]{6}$/i.test(color)||/^#([0-9A-F]{3}){1,2}$/i.test(color)};/**
26
7
  * Verifies if the provided color is a valid rgb or hsl color.
27
8
  * @param color : color value;
28
9
  * @returns : true if color is valid, false otherwise;
29
10
  * @see https://stackoverflow.com/questions/2353211/hsl-to-rgb-color-conversion
30
- */
31
- exports.isHexColor = isHexColor;
32
- var isRgbHslColor = function isRgbHslColor(color) {
33
- var regexModel = /^(rgb|hsl)(a?)[(]\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*(?:,\s*([\d.]+)\s*)?[)]$/;
34
- return regexModel.test(color);
35
- };
36
-
37
- /**
11
+ */exports.isHexColor=isHexColor;var isRgbHslColor=function(color){return /^(rgb|hsl)(a?)[(]\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*(?:,\s*([\d.]+)\s*)?[)]$/.test(color)};/**
38
12
  * Verifies if the provided color is a valid theme color and returns the theme color value.
39
13
  * @param color : theme color tag value;
40
14
  * @param themeColors : theme colors object;
41
15
  * @returns : theme color value if color is valid, null otherwise;
42
- */
43
- exports.isRgbHslColor = isRgbHslColor;
44
- var stripThemeColors = function stripThemeColors(color, themeColors) {
45
- var splitColor = color.split('.');
46
- var colorCategory = splitColor[0];
47
- var colorVariant = splitColor[1];
48
- if (themeColors[colorCategory]) {
49
- if (themeColors[colorCategory][colorVariant]) {
50
- return themeColors[colorCategory][colorVariant];
51
- }
52
- }
53
- return null;
54
- };
55
-
56
- /**
16
+ */exports.isRgbHslColor=isRgbHslColor;var stripThemeColors=function(color,themeColors){var splitColor=color.split("."),colorCategory=splitColor[0],colorVariant=splitColor[1];return themeColors[colorCategory]&&themeColors[colorCategory][colorVariant]?themeColors[colorCategory][colorVariant]:null};/**
57
17
  * Convert a hex color to rgba color.
58
18
  * @param color : hex color value;
59
19
  * @param opacity : opacity value;
60
20
  * @returns : rgba color value;
61
- */
62
- exports.stripThemeColors = stripThemeColors;
63
- var parseHexColorToRgba = function parseHexColorToRgba(color, opacity) {
64
- if (isHexColor(color)) {
65
- return "rgba(".concat(parseInt(color.slice(1, 3), 16), ", ").concat(parseInt(color.slice(3, 5), 16), ", ").concat(parseInt(color.slice(5, 7), 16), ", ").concat(opacity, ")");
66
- }
67
- return 'rgba(0, 0, 0, 0)';
68
- };
69
-
70
- /**
21
+ */exports.stripThemeColors=stripThemeColors;var parseHexColorToRgba=function(color,opacity){return isHexColor(color)?"rgba(".concat(parseInt(color.slice(1,3),16),", ").concat(parseInt(color.slice(3,5),16),", ").concat(parseInt(color.slice(5,7),16),", ").concat(opacity,")"):"rgba(0, 0, 0, 0)"};/**
71
22
  * Convert a hsl array color to string
72
23
  * @param color : hsl color array;
73
24
  * @returns : hsl color value;
74
- */
75
- exports.parseHexColorToRgba = parseHexColorToRgba;
76
- var parseHslColorToString = function parseHslColorToString(color) {
77
- var _color = _slicedToArray(color, 3),
78
- h = _color[0],
79
- s = _color[1],
80
- l = _color[2];
81
- return "hsl(".concat(h, ", ").concat(s, "%, ").concat(l, "%)");
82
- };
83
- exports.parseHslColorToString = parseHslColorToString;
25
+ */exports.parseHexColorToRgba=parseHexColorToRgba;var parseHslColorToString=function(color){var _color=_slicedToArray(color,3),h=_color[0],s=_color[1],l=_color[2];return"hsl(".concat(h,", ").concat(s,"%, ").concat(l,"%)")};exports.parseHslColorToString=parseHslColorToString;
@@ -1,39 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.focusFunction = focusFunction;
7
- exports.hoverFunction = hoverFunction;
8
- function hoverFunction(col) {
9
- var amt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -20;
10
- var usePound = false;
11
- if (col[0] === '#') {
12
- col = col.slice(1);
13
- usePound = true;
14
- }
15
- var num = parseInt(col, 16);
16
- var r = (num >> 16) + amt;
17
- if (r > 255) r = 255;else if (r < 0) r = 0;
18
- var b = (num >> 8 & 0x00ff) + amt;
19
- if (b > 255) b = 255;else if (b < 0) b = 0;
20
- var g = (num & 0x0000ff) + amt;
21
- if (g > 255) g = 255;else if (g < 0) g = 0;
22
- return (usePound ? '#' : '') + (g | b << 8 | r << 16).toString(16);
23
- }
24
- function focusFunction(col) {
25
- var amt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -35;
26
- var usePound = false;
27
- if (col[0] === '#') {
28
- col = col.slice(1);
29
- usePound = true;
30
- }
31
- var num = parseInt(col, 16);
32
- var r = (num >> 16) + amt;
33
- if (r > 255) r = 255;else if (r < 0) r = 0;
34
- var b = (num >> 8 & 0x00ff) + amt;
35
- if (b > 255) b = 255;else if (b < 0) b = 0;
36
- var g = (num & 0x0000ff) + amt;
37
- if (g > 255) g = 255;else if (g < 0) g = 0;
38
- return (usePound ? '#' : '') + (g | b << 8 | r << 16).toString(16);
39
- }
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.focusFunction=focusFunction,exports.hoverFunction=hoverFunction;function hoverFunction(col){var amt=1<arguments.length&&void 0!==arguments[1]?arguments[1]:-20,usePound=!1;"#"===col[0]&&(col=col.slice(1),usePound=!0);var num=parseInt(col,16),r=(num>>16)+amt;255<r?r=255:0>r&&(r=0);var b=(255&num>>8)+amt;255<b?b=255:0>b&&(b=0);var g=(255&num)+amt;return 255<g?g=255:0>g&&(g=0),(usePound?"#":"")+(g|b<<8|r<<16).toString(16)}function focusFunction(col){var amt=1<arguments.length&&void 0!==arguments[1]?arguments[1]:-35,usePound=!1;"#"===col[0]&&(col=col.slice(1),usePound=!0);var num=parseInt(col,16),r=(num>>16)+amt;255<r?r=255:0>r&&(r=0);var b=(255&num>>8)+amt;255<b?b=255:0>b&&(b=0);var g=(255&num)+amt;return 255<g?g=255:0>g&&(g=0),(usePound?"#":"")+(g|b<<8|r<<16).toString(16)}
@@ -1,64 +1,2 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.convertColor = convertColor;
7
- exports.numberToHex = numberToHex;
8
- exports.parseHslColorToString = void 0;
9
- exports.rgbToHex = rgbToHex;
10
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
13
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
15
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
- function numberToHex(c) {
17
- var hex = c.toString(16);
18
- return hex.length === 1 ? '0' + hex : hex;
19
- }
20
- function rgbToHex(color) {
21
- return '#' + numberToHex(color[0]) + numberToHex(color[1]) + numberToHex(color[2]);
22
- }
23
- function convertColor(color) {
24
- var hex = typeof color === 'string' ? color : rgbToHex(color);
25
- var r = parseInt(hex.substr(1, 2), 16) / 255; // Grab the hex representation of red (chars 1-2) and convert to decimal (base 10).
26
- var g = parseInt(hex.substr(3, 2), 16) / 255;
27
- var b = parseInt(hex.substr(5, 2), 16) / 255;
28
- var equal0 = r === g && g === b;
29
- var max = Math.max(r, g, b);
30
- var min = Math.min(r, g, b);
31
- var h = (max + min) / 2;
32
- var d = max - min;
33
- switch (max) {
34
- case r:
35
- h = (g - b) / d + (g < b ? 6 : 0);
36
- break;
37
- case g:
38
- h = (b - r) / d + 2;
39
- break;
40
- case b:
41
- h = (r - g) / d + 4;
42
- break;
43
- }
44
- h /= 6;
45
- h = Math.round(h * 360);
46
- if (equal0) h = 0;
47
- return {
48
- neutral1: [h - 4, 14, 93],
49
- neutral2: [h - 5, 13, 82],
50
- neutral3: [h - 3, 13, 68],
51
- neutral4: [h - 1, 13, 50],
52
- neutral5: [h + 1, 12, 39],
53
- neutral6: [h + 1, 12, 31],
54
- black: [h - 1, 12, 23]
55
- };
56
- }
57
- var parseHslColorToString = function parseHslColorToString(color) {
58
- var _color = _slicedToArray(color, 3),
59
- h = _color[0],
60
- s = _color[1],
61
- l = _color[2];
62
- return "hsl(".concat(h, ",").concat(s, "%,").concat(l, "%)");
63
- };
64
- exports.parseHslColorToString = parseHslColorToString;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.convertColor=convertColor,exports.numberToHex=numberToHex,exports.parseHslColorToString=void 0,exports.rgbToHex=rgbToHex;function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function numberToHex(c){var hex=c.toString(16);return 1===hex.length?"0"+hex:hex}function rgbToHex(color){return"#"+numberToHex(color[0])+numberToHex(color[1])+numberToHex(color[2])}function convertColor(color){var hex="string"==typeof color?color:rgbToHex(color),r=parseInt(hex.substr(1,2),16)/255,g=parseInt(hex.substr(3,2),16)/255,b=parseInt(hex.substr(5,2),16)/255,max=Math.max(r,g,b),min=Math.min(r,g,b),h=(max+min)/2,d=max-min;// Grab the hex representation of red (chars 1-2) and convert to decimal (base 10).
2
+ return max===r?h=(g-b)/d+(g<b?6:0):max===g?h=(b-r)/d+2:max===b?h=(r-g)/d+4:void 0,h/=6,h=Math.round(360*h),r===g&&g===b&&(h=0),{neutral1:[h-4,14,93],neutral2:[h-5,13,82],neutral3:[h-3,13,68],neutral4:[h-1,13,50],neutral5:[h+1,12,39],neutral6:[h+1,12,31],black:[h-1,12,23]}}var parseHslColorToString=function(color){var _color=_slicedToArray(color,3),h=_color[0],s=_color[1],l=_color[2];return"hsl(".concat(h,",").concat(s,"%,").concat(l,"%)")};exports.parseHslColorToString=parseHslColorToString;
@@ -1,11 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.customColorMode = customColorMode;
7
- var _react = require("@emotion/react");
8
- function customColorMode(light, dark) {
9
- var theme = (0, _react.useTheme)();
10
- return theme.colorMode === 'dark' ? dark : light;
11
- }
1
+ "use strict";var _react=require("@emotion/react");Object.defineProperty(exports,"__esModule",{value:!0}),exports.customColorMode=customColorMode;function customColorMode(light,dark){var theme=(0,_react.useTheme)();return"dark"===theme.colorMode?dark:light}
@@ -1,137 +1,18 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.convertFileToBase64 = convertFileToBase64;
7
- exports.downloadUrlToFile = downloadUrlToFile;
8
- exports.filesToBase64 = filesToBase64;
9
- exports.urlToBase64 = urlToBase64;
10
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
11
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
12
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
13
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
14
- /**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.convertFileToBase64=convertFileToBase64,exports.downloadUrlToFile=downloadUrlToFile,exports.filesToBase64=filesToBase64,exports.urlToBase64=urlToBase64;function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key]}function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return defineProperty(generator,"_invoke",{value:makeInvokeMethod(innerFn,self,context)}),generator}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)}}catch(err){return{type:"throw",arg:err}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}function defineIteratorMethods(prototype){["next","throw","return"].forEach(function(method){define(prototype,method,function(arg){return this._invoke(method,arg)})})}function AsyncIterator(generator,PromiseImpl){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==_typeof(value)&&hasOwn.call(value,"__await")?PromiseImpl.resolve(value.__await).then(function(value){invoke("next",value,resolve,reject)},function(err){invoke("throw",err,resolve,reject)}):PromiseImpl.resolve(value).then(function(unwrapped){result.value=unwrapped,resolve(result)},function(error){return invoke("throw",error,resolve,reject)})}reject(record.arg)}var previousPromise;defineProperty(this,"_invoke",{value:function value(method,arg){function callInvokeWithMethodAndArg(){return new PromiseImpl(function(resolve,reject){invoke(method,arg,resolve,reject)})}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(innerFn,self,context){var state="suspendedStart";return function(method,arg){if("executing"==state)throw new Error("Generator is already running");if("completed"==state){if("throw"===method)throw arg;return doneResult()}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if("suspendedStart"==state)throw state="completed",context.arg;context.dispatchException(context.arg)}else"return"===context.method&&context.abrupt("return",context.arg);state="executing";var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?"completed":"suspendedYield",record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done}}"throw"===record.type&&(state="completed",context.method="throw",context.arg=record.arg)}}}function maybeInvokeDelegate(delegate,context){var methodName=context.method,method=delegate.iterator[methodName];if(void 0===method)return context.delegate=null,"throw"===methodName&&delegate.iterator.return&&(context.method="return",context.arg=void 0,maybeInvokeDelegate(delegate,context),"throw"===context.method)||"return"!==methodName&&(context.method="throw",context.arg=new TypeError("The iterator does not provide a '"+methodName+"' method")),ContinueSentinel;var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=void 0),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel)}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry)}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0)}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i<iterable.length;)if(hasOwn.call(iterable,i))return next.value=iterable[i],next.done=!1,next;return next.value=void 0,next.done=!0,next};return next.next=next}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return exports};var exports={},Op=Object.prototype,hasOwn=Op.hasOwnProperty,defineProperty=Object.defineProperty||function(obj,key,desc){obj[key]=desc.value},$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";try{define({},"")}catch(err){define=function(obj,key,value){return obj[key]=value}}exports.wrap=wrap;var ContinueSentinel={},IteratorPrototype={};define(IteratorPrototype,iteratorSymbol,function(){return this});var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);return GeneratorFunction.prototype=GeneratorFunctionPrototype,defineProperty(Gp,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),defineProperty(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,toStringTagSymbol,"GeneratorFunction"),exports.isGeneratorFunction=function(genFun){var ctor="function"==typeof genFun&&genFun.constructor;return!!ctor&&(ctor===GeneratorFunction||"GeneratorFunction"===(ctor.displayName||ctor.name))},exports.mark=function(genFun){return Object.setPrototypeOf?Object.setPrototypeOf(genFun,GeneratorFunctionPrototype):(genFun.__proto__=GeneratorFunctionPrototype,define(genFun,toStringTagSymbol,"GeneratorFunction")),genFun.prototype=Object.create(Gp),genFun},exports.awrap=function(arg){return{__await:arg}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,asyncIteratorSymbol,function(){return this}),exports.AsyncIterator=AsyncIterator,exports.async=function(innerFn,outerFn,self,tryLocsList,PromiseImpl){void 0===PromiseImpl&&(PromiseImpl=Promise);var iter=new AsyncIterator(wrap(innerFn,outerFn,self,tryLocsList),PromiseImpl);return exports.isGeneratorFunction(outerFn)?iter:iter.next().then(function(result){return result.done?result.value:iter.next()})},defineIteratorMethods(Gp),define(Gp,toStringTagSymbol,"Generator"),define(Gp,iteratorSymbol,function(){return this}),define(Gp,"toString",function(){return"[object Generator]"}),exports.keys=function(val){var object=Object(val),keys=[];for(var key in object)keys.push(key);return keys.reverse(),function next(){for(;keys.length;){var key=keys.pop();if(key in object)return next.value=key,next.done=!1,next}return next.done=!0,next}},exports.values=values,Context.prototype={constructor:Context,reset:function reset(skipTempReset){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!skipTempReset)for(var name in this)"t"===name.charAt(0)&&hasOwn.call(this,name)&&!isNaN(+name.slice(1))&&(this[name]=void 0)},stop:function stop(){this.done=!0;var rootRecord=this.tryEntries[0].completion;if("throw"===rootRecord.type)throw rootRecord.arg;return this.rval},dispatchException:function dispatchException(exception){function handle(loc,caught){return record.type="throw",record.arg=exception,context.next=loc,caught&&(context.method="next",context.arg=void 0),!!caught}if(this.done)throw exception;for(var context=this,i=this.tryEntries.length-1;0<=i;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(!hasCatch){if(!hasFinally)throw new Error("try statement without catch or finally");if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0)}}},abrupt:function abrupt(type,arg){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev<entry.finallyLoc){var finallyEntry=entry;break}finallyEntry&&("break"===type||"continue"===type)&&finallyEntry.tryLoc<=arg&&arg<=finallyEntry.finallyLoc&&(finallyEntry=null);var record=finallyEntry?finallyEntry.completion:{};return record.type=type,record.arg=arg,finallyEntry?(this.method="next",this.next=finallyEntry.finallyLoc,ContinueSentinel):this.complete(record)},complete:function complete(record,afterLoc){if("throw"===record.type)throw record.arg;return"break"===record.type||"continue"===record.type?this.next=record.arg:"return"===record.type?(this.rval=this.arg=record.arg,this.method="return",this.next="end"):"normal"===record.type&&afterLoc&&(this.next=afterLoc),ContinueSentinel},finish:function finish(finallyLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel},catch:function _catch(tryLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry)}return thrown}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=void 0),ContinueSentinel}},exports}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}var gen=fn.apply(self,args);_next(void 0)})}}/**
15
2
  * Converts an array of File objects to an array of base64-encoded files with additional information.
16
3
  * @param {File[]} files Array of File objects.
17
4
  * @returns {Promise<FormattedFile[]>} Promise that resolves with an array of FormattedFile objects.
18
- */
19
- function filesToBase64(files) {
20
- return Promise.all(files.map(function (file) {
21
- return convertFileToBase64(file);
22
- }));
23
- }
24
-
25
- /**
5
+ */function filesToBase64(files){return Promise.all(files.map(function(file){return convertFileToBase64(file)}))}/**
26
6
  * Converts a single File object to a base64-encoded file with additional information.
27
7
  * @param {File} file File object to be converted.
28
8
  * @returns {Promise<FormattedFile>} Promise that resolves with a FormattedFile object.
29
- */
30
- function convertFileToBase64(file) {
31
- return new Promise(function (resolve, reject) {
32
- var reader = new FileReader();
33
- reader.readAsDataURL(file);
34
- reader.onload = function () {
35
- return resolve({
36
- url: reader.result,
37
- name: file.name,
38
- type: file.type,
39
- size: file.size,
40
- file: file
41
- });
42
- };
43
- reader.onerror = function (error) {
44
- return reject(error);
45
- };
46
- });
47
- }
48
-
49
- /**
9
+ */function convertFileToBase64(file){return new Promise(function(resolve,reject){var reader=new FileReader;reader.readAsDataURL(file),reader.onload=function(){return resolve({url:reader.result,name:file.name,type:file.type,size:file.size,file:file})},reader.onerror=function(error){return reject(error)}})}/**
50
10
  * Downloads a file from a given URL and converts it to a base64-encoded file with additional information.
51
11
  * @param {string} url URL of the file to be downloaded.
52
12
  * @param {string} name Optional name of the downloaded file.
53
13
  * @returns {Promise<FormattedFile | null>} Promise that resolves with a FormattedFile object or null if the URL is not valid.
54
- */
55
- function urlToBase64(_x, _x2) {
56
- return _urlToBase.apply(this, arguments);
57
- }
58
- /**
14
+ */function urlToBase64(){return _urlToBase.apply(this,arguments)}/**
59
15
  * Downloads a file from a given URL and opens the download prompt.
60
16
  * @param {string} url URL of the file to be downloaded.
61
17
  * @returns {Promise<boolean>} Promise that resolves with a boolean indicating whether the download was successful.
62
- */
63
- function _urlToBase() {
64
- _urlToBase = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(url, name) {
65
- var blob, file;
66
- return _regeneratorRuntime().wrap(function _callee$(_context) {
67
- while (1) switch (_context.prev = _context.next) {
68
- case 0:
69
- if (url) {
70
- _context.next = 2;
71
- break;
72
- }
73
- return _context.abrupt("return", Promise.resolve(null));
74
- case 2:
75
- _context.prev = 2;
76
- _context.next = 5;
77
- return fetch(url).then(function (res) {
78
- return res.blob();
79
- });
80
- case 5:
81
- blob = _context.sent;
82
- file = new File([blob], name || 'file', {
83
- type: blob.type
84
- });
85
- return _context.abrupt("return", convertFileToBase64(file));
86
- case 10:
87
- _context.prev = 10;
88
- _context.t0 = _context["catch"](2);
89
- // eslint-disable-next-line no-console
90
- console.error(_context.t0);
91
- return _context.abrupt("return", null);
92
- case 14:
93
- case "end":
94
- return _context.stop();
95
- }
96
- }, _callee, null, [[2, 10]]);
97
- }));
98
- return _urlToBase.apply(this, arguments);
99
- }
100
- function downloadUrlToFile(_x3) {
101
- return _downloadUrlToFile.apply(this, arguments);
102
- }
103
- function _downloadUrlToFile() {
104
- _downloadUrlToFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(url) {
105
- var _url$split$pop;
106
- var blob, fileName, urlBlob, link;
107
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
108
- while (1) switch (_context2.prev = _context2.next) {
109
- case 0:
110
- _context2.next = 2;
111
- return fetch(url).then(function (res) {
112
- return res.blob();
113
- });
114
- case 2:
115
- blob = _context2.sent;
116
- if (blob) {
117
- _context2.next = 5;
118
- break;
119
- }
120
- return _context2.abrupt("return", false);
121
- case 5:
122
- fileName = decodeURI(((_url$split$pop = url.split('/').pop()) === null || _url$split$pop === void 0 ? void 0 : _url$split$pop.split('.')[0]) || 'file');
123
- urlBlob = window.URL.createObjectURL(blob);
124
- link = document.createElement('a');
125
- link.href = urlBlob;
126
- link.download = fileName;
127
- link.click();
128
- window.URL.revokeObjectURL(urlBlob);
129
- return _context2.abrupt("return", true);
130
- case 13:
131
- case "end":
132
- return _context2.stop();
133
- }
134
- }, _callee2);
135
- }));
136
- return _downloadUrlToFile.apply(this, arguments);
137
- }
18
+ */function _urlToBase(){return _urlToBase=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(url,name){var blob,file;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:if(url){_context.next=2;break}return _context.abrupt("return",Promise.resolve(null));case 2:return _context.prev=2,_context.next=5,fetch(url).then(function(res){return res.blob()});case 5:return blob=_context.sent,file=new File([blob],name||"file",{type:blob.type}),_context.abrupt("return",convertFileToBase64(file));case 10:return _context.prev=10,_context.t0=_context["catch"](2),console.error(_context.t0),_context.abrupt("return",null);case 14:case"end":return _context.stop();}},_callee,null,[[2,10]])})),_urlToBase.apply(this,arguments)}function downloadUrlToFile(_x3){return _downloadUrlToFile.apply(this,arguments)}function _downloadUrlToFile(){return _downloadUrlToFile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(url){var _url$split$pop,blob,fileName,urlBlob,link;return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:return _context2.next=2,fetch(url).then(function(res){return res.blob()});case 2:if(blob=_context2.sent,blob){_context2.next=5;break}return _context2.abrupt("return",!1);case 5:return fileName=decodeURI((null===(_url$split$pop=url.split("/").pop())||void 0===_url$split$pop?void 0:_url$split$pop.split(".")[0])||"file"),urlBlob=window.URL.createObjectURL(blob),link=document.createElement("a"),link.href=urlBlob,link.download=fileName,link.click(),window.URL.revokeObjectURL(urlBlob),_context2.abrupt("return",!0);case 13:case"end":return _context2.stop();}},_callee2)})),_downloadUrlToFile.apply(this,arguments)}
@@ -1,21 +1,6 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.formatBytes = formatBytes;
7
- /**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatBytes=formatBytes;/**
8
2
  * This function takes in a number of bytes and an optional number of decimal places and converts the number of bytes into a more readable format.
9
3
  * @param {number} bytes - The number of bytes to be formatted.
10
4
  * @param {number} decimals - Optional number of decimal places to round the result to. Default value is 2.
11
5
  * @returns {string} - A string representing the formatted bytes with the appropriate unit (e.g. "10.24 KB").
12
- */
13
- function formatBytes(bytes) {
14
- var decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
15
- if (!+bytes) return '0 Bytes';
16
- var unit = 1024;
17
- var dm = decimals < 0 ? 0 : decimals;
18
- var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
19
- var sizeIndex = Math.floor(Math.log(bytes) / Math.log(unit));
20
- return "".concat(parseFloat((bytes / Math.pow(unit, sizeIndex)).toFixed(dm)), " ").concat(sizes[sizeIndex]);
21
- }
6
+ */function formatBytes(bytes){var decimals=1<arguments.length&&arguments[1]!==void 0?arguments[1]:2;if(!+bytes)return"0 Bytes";var unit=1024,dm=0>decimals?0:decimals,sizeIndex=Math.floor(Math.log(bytes)/Math.log(unit));return"".concat(parseFloat((bytes/Math.pow(unit,sizeIndex)).toFixed(dm))," ").concat(["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][sizeIndex])}
@@ -1,14 +1,5 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.capitalize = capitalize;
7
- /**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.capitalize=capitalize;/**
8
2
  * This function takes in a string and returns a new string with the first letter capitalized.
9
3
  * @param {string} string - The string to be capitalized.
10
4
  * @returns {string} - A new string with the first letter capitalized.
11
- */
12
- function capitalize(string) {
13
- return string.charAt(0).toUpperCase() + string.slice(1);
14
- }
5
+ */function capitalize(string){return string.charAt(0).toUpperCase()+string.slice(1)}
@@ -1,24 +1,9 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.formatCep = formatCep;
7
- exports.sanitizeCep = sanitizeCep;
8
- /**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatCep=formatCep,exports.sanitizeCep=sanitizeCep;/**
9
2
  * This function takes in a string representing a Brazilian postal code (CEP) and returns a formatted string in the standard CEP format (e.g. "12345-678").
10
3
  * @param {string} cep - The string representing the Brazilian postal code (CEP).
11
4
  * @returns {string} - A formatted string in the standard CEP format.
12
- */
13
- function formatCep(cep) {
14
- return cep.replace(/\D/g, '').replace(/(\d{5})(\d)/, '$1-$2').replace(/(-\d{3})\d+?$/, '$1');
15
- }
16
-
17
- /**
5
+ */function formatCep(cep){return cep.replace(/\D/g,"").replace(/(\d{5})(\d)/,"$1-$2").replace(/(-\d{3})\d+?$/,"$1")}/**
18
6
  * This function takes in a string representing a Brazilian postal code (CEP) and returns a sanitized string without any non-numeric characters, with a maximum length of 8 characters.
19
7
  * @param {string} cep - The string representing the Brazilian postal code (CEP).
20
8
  * @returns {string} - A sanitized string without any non-numeric characters, with a maximum length of 8 characters.
21
- */
22
- function sanitizeCep(cep) {
23
- return cep ? cep.replace(/\D/g, '').substring(0, 8) : '';
24
- }
9
+ */function sanitizeCep(cep){return cep?cep.replace(/\D/g,"").substring(0,8):""}
@@ -1,47 +1,13 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.formatCnpj = formatCnpj;
7
- exports.sanitizeCNPJ = sanitizeCNPJ;
8
- exports.validateCNPJ = validateCNPJ;
9
- /**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatCnpj=formatCnpj,exports.sanitizeCNPJ=sanitizeCNPJ,exports.validateCNPJ=validateCNPJ;/**
10
2
  * This function takes in a string representing a Brazilian CNPJ number and returns a formatted string in the standard CNPJ format (e.g. "12.345.678/0001-90").
11
3
  * @param {string} text - The string representing the Brazilian CNPJ number.
12
4
  * @returns {string} - A formatted string in the standard CNPJ format.
13
- */
14
- function formatCnpj(text) {
15
- return text.replace(/^(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})$/, '$1.$2.$3/$4-$5');
16
- }
17
-
18
- /**
5
+ */function formatCnpj(text){return text.replace(/^(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})$/,"$1.$2.$3/$4-$5")}/**
19
6
  * This function takes in a string representing a Brazilian CNPJ number and returns a sanitized string without any non-numeric characters, with a maximum length of 14 characters.
20
7
  * @param {string} cnpj - The string representing the Brazilian CNPJ number.
21
8
  * @returns {string} - A sanitized string without any non-numeric characters, with a maximum length of 14 characters.
22
- */
23
- function sanitizeCNPJ(cnpj) {
24
- return cnpj ? cnpj.replace(/\D/g, '').substring(0, 14) : '';
25
- }
26
-
27
- /**
9
+ */function sanitizeCNPJ(cnpj){return cnpj?cnpj.replace(/\D/g,"").substring(0,14):""}/**
28
10
  * This function takes in a string representing a Brazilian CNPJ number and returns a boolean indicating whether the number is valid or not.
29
11
  * @param {string} cnpj - The string representing the Brazilian CNPJ number.
30
12
  * @returns {boolean} - A boolean indicating whether the CNPJ number is valid or not.
31
- */
32
- function validateCNPJ(cnpj) {
33
- var sanitizedCnpj = sanitizeCNPJ(cnpj);
34
- if (sanitizedCnpj.length === 14) {
35
- var digits = [0, 0];
36
- for (var i = 0; i < 12; i++) {
37
- digits[0] += Number(sanitizedCnpj[11 - i]) * (i % 8 + 2);
38
- digits[1] += Number(sanitizedCnpj[11 - i]) * ((i + 1) % 8 + 2);
39
- }
40
- digits[0] = digits[0] % 11;
41
- if (digits[0] > 1) digits[0] = 11 - digits[0];else digits[0] = 0;
42
- digits[1] = (digits[1] + digits[0] * 2) % 11;
43
- if (digits[1] > 1) digits[1] = 11 - digits[1];else digits[1] = 0;
44
- return sanitizedCnpj[12] === digits[0].toString() && sanitizedCnpj[13] === digits[1].toString();
45
- }
46
- return false;
47
- }
13
+ */function validateCNPJ(cnpj){var sanitizedCnpj=sanitizeCNPJ(cnpj);if(14===sanitizedCnpj.length){for(var digits=[0,0],i=0;12>i;i++)digits[0]+=+sanitizedCnpj[11-i]*(i%8+2),digits[1]+=+sanitizedCnpj[11-i]*((i+1)%8+2);return digits[0]%=11,digits[0]=1<digits[0]?11-digits[0]:0,digits[1]=(digits[1]+2*digits[0])%11,digits[1]=1<digits[1]?11-digits[1]:0,sanitizedCnpj[12]===digits[0].toString()&&sanitizedCnpj[13]===digits[1].toString()}return!1}