linear-react-components-ui 1.1.26-beta.7 → 1.1.26-beta.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 (602) hide show
  1. package/lib/@types/Align.d.ts +2 -0
  2. package/lib/@types/ButtonTypes.d.ts +1 -0
  3. package/lib/@types/ColorStyles.d.ts +1 -0
  4. package/lib/@types/DataCombo.d.ts +1 -0
  5. package/lib/@types/Icon.d.ts +2 -0
  6. package/lib/@types/LabelStyles.d.ts +1 -0
  7. package/lib/@types/Period.d.ts +4 -0
  8. package/lib/@types/PermissionAttr.d.ts +12 -0
  9. package/lib/@types/PointerEvents.d.ts +1 -0
  10. package/lib/@types/Position.d.ts +1 -0
  11. package/lib/@types/PositionAlert.d.ts +1 -0
  12. package/lib/@types/Size.d.ts +1 -0
  13. package/lib/@types/SizePixels.d.ts +1 -0
  14. package/lib/@types/StorageMock.d.ts +3 -0
  15. package/lib/alerts/AlertContainer.d.ts +12 -0
  16. package/lib/alerts/AlertContainer.js +70 -0
  17. package/lib/alerts/AlertProvider.d.ts +3 -0
  18. package/lib/alerts/AlertProvider.js +46 -0
  19. package/lib/alerts/BaseAlert.d.ts +3 -0
  20. package/lib/alerts/BaseAlert.js +20 -0
  21. package/lib/alerts/Message.d.ts +3 -0
  22. package/lib/alerts/Message.js +94 -0
  23. package/lib/alerts/alert.spec.d.ts +0 -0
  24. package/lib/alerts/helpers.d.ts +3 -0
  25. package/lib/alerts/helpers.js +5 -0
  26. package/lib/alerts/index.d.ts +4 -0
  27. package/lib/alerts/index.js +6 -0
  28. package/lib/alerts/types.d.ts +47 -0
  29. package/lib/alerts/withAlert.d.ts +4 -0
  30. package/lib/alerts/withAlert.js +14 -0
  31. package/lib/assets/BaseAlert.css +1 -0
  32. package/lib/assets/Content.css +1 -0
  33. package/lib/assets/DefaultFile.css +1 -0
  34. package/lib/assets/Drawer.css +1 -0
  35. package/lib/assets/InputTextBase.css +1 -0
  36. package/lib/assets/button.css +1 -0
  37. package/lib/assets/gridlayout.css +1 -0
  38. package/lib/assets/index.css +1 -0
  39. package/lib/assets/index10.css +1 -0
  40. package/lib/assets/index11.css +1 -0
  41. package/lib/assets/index12.css +1 -0
  42. package/lib/assets/index13.css +1 -0
  43. package/lib/assets/index14.css +1 -0
  44. package/lib/assets/index15.css +1 -0
  45. package/lib/assets/index16.css +1 -0
  46. package/lib/assets/index17.css +1 -0
  47. package/lib/assets/index18.css +1 -0
  48. package/lib/assets/index19.css +1 -0
  49. package/lib/assets/index2.css +1 -0
  50. package/lib/assets/index20.css +1 -0
  51. package/lib/assets/index21.css +1 -0
  52. package/lib/assets/index22.css +1 -0
  53. package/lib/assets/index23.css +1 -0
  54. package/lib/assets/index24.css +1 -0
  55. package/lib/assets/index25.css +1 -0
  56. package/lib/assets/index26.css +1 -0
  57. package/lib/assets/index27.css +1 -0
  58. package/lib/assets/index28.css +1 -0
  59. package/lib/assets/index3.css +1 -0
  60. package/lib/assets/index4.css +1 -0
  61. package/lib/assets/index5.css +1 -0
  62. package/lib/assets/index6.css +1 -0
  63. package/lib/assets/index7.css +1 -0
  64. package/lib/assets/index8.css +1 -0
  65. package/lib/assets/index9.css +1 -0
  66. package/lib/assets/label.css +1 -0
  67. package/lib/assets/noPermission.css +1 -0
  68. package/lib/assets/panel.css +1 -0
  69. package/lib/assets/progressbar.css +1 -0
  70. package/lib/assets/radio.css +1 -0
  71. package/lib/assets/skeleton.css +1 -0
  72. package/lib/assets/table.css +1 -0
  73. package/lib/assets/tabs.css +1 -0
  74. package/lib/assets/toolbar.css +1 -0
  75. package/lib/assets/withDropdown.css +1 -0
  76. package/lib/avatar/avatar.spec.d.ts +1 -0
  77. package/lib/avatar/index.d.ts +6 -0
  78. package/lib/avatar/index.js +55 -0
  79. package/lib/avatar/types.d.ts +27 -0
  80. package/lib/badge/badge.spec.d.ts +1 -0
  81. package/lib/badge/index.d.ts +3 -0
  82. package/lib/badge/index.js +28 -0
  83. package/lib/badge/types.d.ts +10 -0
  84. package/lib/buttons/ActivateButton.d.ts +3 -0
  85. package/lib/buttons/ActivateButton.js +11 -0
  86. package/lib/buttons/AddButton.d.ts +3 -0
  87. package/lib/buttons/AddButton.js +14 -0
  88. package/lib/buttons/Button.d.ts +6 -0
  89. package/lib/buttons/Button.js +19 -0
  90. package/lib/buttons/ButtonGroups.d.ts +6 -0
  91. package/lib/buttons/ButtonGroups.js +12 -0
  92. package/lib/buttons/CancelButton.d.ts +3 -0
  93. package/lib/buttons/CancelButton.js +16 -0
  94. package/lib/buttons/DangerButton.d.ts +3 -0
  95. package/lib/buttons/DangerButton.js +17 -0
  96. package/lib/buttons/DefaultButton.d.ts +6 -0
  97. package/lib/buttons/DefaultButton.js +95 -0
  98. package/lib/buttons/DestroyButton.d.ts +3 -0
  99. package/lib/buttons/DestroyButton.js +23 -0
  100. package/lib/buttons/EditButton.d.ts +3 -0
  101. package/lib/buttons/EditButton.js +11 -0
  102. package/lib/buttons/InactivateButton.d.ts +3 -0
  103. package/lib/buttons/InactivateButton.js +11 -0
  104. package/lib/buttons/InfoButton.d.ts +3 -0
  105. package/lib/buttons/InfoButton.js +17 -0
  106. package/lib/buttons/PrimaryButton.d.ts +3 -0
  107. package/lib/buttons/PrimaryButton.js +17 -0
  108. package/lib/buttons/RestoreButton.d.ts +3 -0
  109. package/lib/buttons/RestoreButton.js +11 -0
  110. package/lib/buttons/SaveButton.d.ts +3 -0
  111. package/lib/buttons/SaveButton.js +16 -0
  112. package/lib/buttons/SuccessButton.d.ts +3 -0
  113. package/lib/buttons/SuccessButton.js +17 -0
  114. package/lib/buttons/WarningButton.d.ts +3 -0
  115. package/lib/buttons/WarningButton.js +17 -0
  116. package/lib/buttons/button_container/index.d.ts +10 -0
  117. package/lib/buttons/button_container/index.js +23 -0
  118. package/lib/buttons/buttons.spec.d.ts +0 -0
  119. package/lib/buttons/index.d.ts +17 -0
  120. package/lib/buttons/index.js +33 -0
  121. package/lib/buttons/split_button/index.d.ts +3 -0
  122. package/lib/buttons/split_button/index.js +58 -0
  123. package/lib/buttons/types.d.ts +46 -0
  124. package/lib/calendar/DangerCalendar.d.ts +3 -0
  125. package/lib/calendar/DangerCalendar.js +20 -0
  126. package/lib/calendar/InfoCalendar.d.ts +3 -0
  127. package/lib/calendar/InfoCalendar.js +20 -0
  128. package/lib/calendar/PrimaryCalendar.d.ts +3 -0
  129. package/lib/calendar/PrimaryCalendar.js +20 -0
  130. package/lib/calendar/SuccessCalendar.d.ts +3 -0
  131. package/lib/calendar/SuccessCalendar.js +20 -0
  132. package/lib/calendar/WarningCalendar.d.ts +3 -0
  133. package/lib/calendar/WarningCalendar.js +20 -0
  134. package/lib/calendar/base/Day.d.ts +3 -0
  135. package/lib/calendar/base/Day.js +37 -0
  136. package/lib/calendar/base/Month.d.ts +3 -0
  137. package/lib/calendar/base/Month.js +28 -0
  138. package/lib/calendar/base/Week.d.ts +3 -0
  139. package/lib/calendar/base/Week.js +24 -0
  140. package/lib/calendar/base/helpers.d.ts +59 -0
  141. package/lib/calendar/base/helpers.js +100 -0
  142. package/lib/calendar/base/index.d.ts +3 -0
  143. package/lib/calendar/base/index.js +137 -0
  144. package/lib/calendar/calendar.spec.d.ts +0 -0
  145. package/lib/calendar/index.d.ts +8 -0
  146. package/lib/calendar/index.js +14 -0
  147. package/lib/calendar/types.d.ts +27 -0
  148. package/lib/checkbox/checkbox.spec.d.ts +1 -0
  149. package/lib/checkbox/index.d.ts +9 -0
  150. package/lib/checkbox/index.js +32 -0
  151. package/lib/checkbox/types.d.ts +45 -0
  152. package/lib/chunks/compiler-runtime.Cu50tn6L.js +54 -0
  153. package/lib/chunks/index.Df3kt2LQ.js +667 -0
  154. package/lib/chunks/index.aw0XaUkg.js +266 -0
  155. package/lib/chunks/jsx-runtime.D1SHvdVE.js +282 -0
  156. package/lib/chunks/lodash.CIAK_hAg.js +3684 -0
  157. package/lib/chunks/moment.DMLRxgRE.js +2589 -0
  158. package/lib/chunks/tabs.BvKfeA6Y.js +244 -0
  159. package/lib/chunks/v1.Ds1rkxUj.js +49 -0
  160. package/lib/dialog/Alert.d.ts +3 -0
  161. package/lib/dialog/Alert.js +24 -0
  162. package/lib/dialog/Custom.d.ts +3 -0
  163. package/lib/dialog/Custom.js +47 -0
  164. package/lib/dialog/Error.d.ts +3 -0
  165. package/lib/dialog/Error.js +24 -0
  166. package/lib/dialog/Information.d.ts +3 -0
  167. package/lib/dialog/Information.js +24 -0
  168. package/lib/dialog/Question.d.ts +3 -0
  169. package/lib/dialog/Question.js +47 -0
  170. package/lib/dialog/Warning.d.ts +3 -0
  171. package/lib/dialog/Warning.js +24 -0
  172. package/lib/dialog/base/Content.d.ts +3 -0
  173. package/lib/dialog/base/Content.js +15 -0
  174. package/lib/dialog/base/Footer.d.ts +3 -0
  175. package/lib/dialog/base/Footer.js +10 -0
  176. package/lib/dialog/base/Header.d.ts +3 -0
  177. package/lib/dialog/base/Header.js +8 -0
  178. package/lib/dialog/base/index.d.ts +10 -0
  179. package/lib/dialog/base/index.js +10 -0
  180. package/lib/dialog/base/style.d.ts +7 -0
  181. package/lib/dialog/dialog.spec.d.ts +0 -0
  182. package/lib/dialog/form/index.d.ts +5 -0
  183. package/lib/dialog/form/index.js +16 -0
  184. package/lib/dialog/index.d.ts +9 -0
  185. package/lib/dialog/index.js +16 -0
  186. package/lib/dialog/types.d.ts +107 -0
  187. package/lib/dialog/wizard/index.d.ts +9 -0
  188. package/lib/dialog/wizard/index.js +15 -0
  189. package/lib/dialog/wizard/progressbar.d.ts +11 -0
  190. package/lib/dialog/wizard/progressbar.js +98 -0
  191. package/lib/dialog/wizard/step.d.ts +2 -0
  192. package/lib/dialog/wizard/step.js +6 -0
  193. package/lib/dialog/wizard/useWizard.d.ts +2 -0
  194. package/lib/dialog/wizard/useWizard.js +45 -0
  195. package/lib/dialog/wizard/wizard.spec.d.ts +0 -0
  196. package/lib/drawer/Content.d.ts +3 -0
  197. package/lib/drawer/Content.js +18 -0
  198. package/lib/drawer/Drawer.d.ts +4 -0
  199. package/lib/drawer/Drawer.js +75 -0
  200. package/lib/drawer/Drawer.spec.d.ts +1 -0
  201. package/lib/drawer/Header.d.ts +3 -0
  202. package/lib/drawer/Header.js +56 -0
  203. package/lib/drawer/helpers.d.ts +4 -0
  204. package/lib/drawer/helpers.js +5 -0
  205. package/lib/drawer/index.d.ts +5 -0
  206. package/lib/drawer/index.js +10 -0
  207. package/lib/drawer/types.d.ts +37 -0
  208. package/lib/dropdown/Popup.d.ts +3 -0
  209. package/lib/dropdown/Popup.js +51 -0
  210. package/lib/dropdown/dropdown.spec.d.ts +1 -0
  211. package/lib/dropdown/helper.d.ts +2 -0
  212. package/lib/dropdown/helper.js +8 -0
  213. package/lib/dropdown/types.d.ts +45 -0
  214. package/lib/dropdown/withDropdown.d.ts +9 -0
  215. package/lib/dropdown/withDropdown.js +80 -0
  216. package/lib/fieldset/fieldset.spec.d.ts +1 -0
  217. package/lib/fieldset/index.d.ts +3 -0
  218. package/lib/fieldset/index.js +70 -0
  219. package/lib/fieldset/types.d.ts +27 -0
  220. package/lib/form/Field.d.ts +2 -0
  221. package/lib/form/Field.js +98 -0
  222. package/lib/form/FieldArray.d.ts +2 -0
  223. package/lib/form/FieldArray.js +68 -0
  224. package/lib/form/FieldNumber.d.ts +2 -0
  225. package/lib/form/FieldNumber.js +48 -0
  226. package/lib/form/FieldPeriod.d.ts +2 -0
  227. package/lib/form/FieldPeriod.js +95 -0
  228. package/lib/form/form.spec.d.ts +0 -0
  229. package/lib/form/helpers.d.ts +8 -0
  230. package/lib/form/helpers.js +28 -0
  231. package/lib/form/index.d.ts +8 -0
  232. package/lib/form/index.js +150 -0
  233. package/lib/form/types.d.ts +233 -0
  234. package/lib/form/withFieldHOC.d.ts +4 -0
  235. package/lib/form/withFieldHOC.js +62 -0
  236. package/lib/form/withFormSecurity.d.ts +6 -0
  237. package/lib/form/withFormSecurity.js +30 -0
  238. package/lib/gridlayout/GridCol.d.ts +3 -0
  239. package/lib/gridlayout/GridCol.js +27 -0
  240. package/lib/gridlayout/GridRow.d.ts +3 -0
  241. package/lib/gridlayout/GridRow.js +26 -0
  242. package/lib/gridlayout/gridLayout.spec.d.ts +1 -0
  243. package/lib/gridlayout/index.d.ts +4 -0
  244. package/lib/gridlayout/index.js +6 -0
  245. package/lib/gridlayout/types.d.ts +17 -0
  246. package/lib/hint/helpers.d.ts +1 -0
  247. package/lib/hint/helpers.js +12 -0
  248. package/lib/hint/hint.spec.d.ts +1 -0
  249. package/lib/hint/index.d.ts +3 -0
  250. package/lib/hint/index.js +30 -0
  251. package/lib/hint/types.d.ts +11 -0
  252. package/lib/icons/helper.d.ts +635 -0
  253. package/lib/icons/helper.js +637 -0
  254. package/lib/icons/icons.spec.d.ts +1 -0
  255. package/lib/icons/index.d.ts +6 -0
  256. package/lib/icons/index.js +66 -0
  257. package/lib/icons/types.d.ts +46 -0
  258. package/lib/index.d.ts +10 -0
  259. package/lib/index.js +28 -0
  260. package/lib/inputs/base/InputTextBase.d.ts +3 -0
  261. package/lib/inputs/base/InputTextBase.js +183 -0
  262. package/lib/inputs/base/Label.d.ts +6 -0
  263. package/lib/inputs/base/Label.js +30 -0
  264. package/lib/inputs/base/base.spec.d.ts +1 -0
  265. package/lib/inputs/base/helpers.d.ts +10 -0
  266. package/lib/inputs/base/helpers.js +30 -0
  267. package/lib/inputs/base/types.d.ts +98 -0
  268. package/lib/inputs/color/color_input.spec.d.ts +0 -0
  269. package/lib/inputs/color/index.d.ts +3 -0
  270. package/lib/inputs/color/index.js +57 -0
  271. package/lib/inputs/color/types.d.ts +16 -0
  272. package/lib/inputs/date/Dialog.d.ts +3 -0
  273. package/lib/inputs/date/Dialog.js +17 -0
  274. package/lib/inputs/date/Dropdown.d.ts +3 -0
  275. package/lib/inputs/date/Dropdown.js +19 -0
  276. package/lib/inputs/date/date.spec.d.ts +1 -0
  277. package/lib/inputs/date/helpers.d.ts +5 -0
  278. package/lib/inputs/date/helpers.js +10 -0
  279. package/lib/inputs/date/index.d.ts +3 -0
  280. package/lib/inputs/date/index.js +136 -0
  281. package/lib/inputs/date/types.d.ts +56 -0
  282. package/lib/inputs/errorMessage/error.spec.d.ts +1 -0
  283. package/lib/inputs/errorMessage/index.d.ts +4 -0
  284. package/lib/inputs/errorMessage/index.js +24 -0
  285. package/lib/inputs/file/DefaultFile.d.ts +3 -0
  286. package/lib/inputs/file/DefaultFile.js +68 -0
  287. package/lib/inputs/file/DragDropFile.d.ts +3 -0
  288. package/lib/inputs/file/DragDropFile.js +135 -0
  289. package/lib/inputs/file/File.d.ts +3 -0
  290. package/lib/inputs/file/File.js +31 -0
  291. package/lib/inputs/file/FileButtonSettings.d.ts +3 -0
  292. package/lib/inputs/file/FileButtonSettings.js +24 -0
  293. package/lib/inputs/file/filefield.spec.d.ts +1 -0
  294. package/lib/inputs/file/helpers.d.ts +2 -0
  295. package/lib/inputs/file/helpers.js +11 -0
  296. package/lib/inputs/file/index.d.ts +5 -0
  297. package/lib/inputs/file/index.js +8 -0
  298. package/lib/inputs/file/types.d.ts +49 -0
  299. package/lib/inputs/inputHOC.d.ts +4 -0
  300. package/lib/inputs/inputHOC.js +42 -0
  301. package/lib/inputs/mask/BaseMask.d.ts +3 -0
  302. package/lib/inputs/mask/BaseMask.js +2672 -0
  303. package/lib/inputs/mask/Cnpj.d.ts +6 -0
  304. package/lib/inputs/mask/Cnpj.js +46 -0
  305. package/lib/inputs/mask/Cpf.d.ts +6 -0
  306. package/lib/inputs/mask/Cpf.js +48 -0
  307. package/lib/inputs/mask/Phone.d.ts +3 -0
  308. package/lib/inputs/mask/Phone.js +13 -0
  309. package/lib/inputs/mask/ZipCode.d.ts +3 -0
  310. package/lib/inputs/mask/ZipCode.js +11 -0
  311. package/lib/inputs/mask/helpers.d.ts +52 -0
  312. package/lib/inputs/mask/helpers.js +63 -0
  313. package/lib/inputs/mask/index.d.ts +7 -0
  314. package/lib/inputs/mask/index.js +12 -0
  315. package/lib/inputs/mask/input_mask.spec.d.ts +0 -0
  316. package/lib/inputs/mask/types.d.ts +73 -0
  317. package/lib/inputs/multiSelect/ActionButtons.d.ts +3 -0
  318. package/lib/inputs/multiSelect/ActionButtons.js +39 -0
  319. package/lib/inputs/multiSelect/Dropdown.d.ts +3 -0
  320. package/lib/inputs/multiSelect/Dropdown.js +98 -0
  321. package/lib/inputs/multiSelect/helper.d.ts +3 -0
  322. package/lib/inputs/multiSelect/helper.js +8 -0
  323. package/lib/inputs/multiSelect/index.d.ts +3 -0
  324. package/lib/inputs/multiSelect/index.js +180 -0
  325. package/lib/inputs/multiSelect/multiSelect.spec.d.ts +1 -0
  326. package/lib/inputs/multiSelect/types.d.ts +57 -0
  327. package/lib/inputs/number/BaseNumber.d.ts +3 -0
  328. package/lib/inputs/number/BaseNumber.js +59 -0
  329. package/lib/inputs/number/Currency.d.ts +3 -0
  330. package/lib/inputs/number/Currency.js +22 -0
  331. package/lib/inputs/number/Decimal.d.ts +3 -0
  332. package/lib/inputs/number/Decimal.js +11 -0
  333. package/lib/inputs/number/format_number.d.ts +3 -0
  334. package/lib/inputs/number/format_number.js +9 -0
  335. package/lib/inputs/number/index.d.ts +6 -0
  336. package/lib/inputs/number/index.js +34 -0
  337. package/lib/inputs/number/numberfield.spec.d.ts +1 -0
  338. package/lib/inputs/number/types.d.ts +28 -0
  339. package/lib/inputs/period/Dialog.d.ts +3 -0
  340. package/lib/inputs/period/Dialog.js +18 -0
  341. package/lib/inputs/period/Dropdown.d.ts +3 -0
  342. package/lib/inputs/period/Dropdown.js +18 -0
  343. package/lib/inputs/period/PeriodList.d.ts +3 -0
  344. package/lib/inputs/period/PeriodList.js +43 -0
  345. package/lib/inputs/period/helper.d.ts +11 -0
  346. package/lib/inputs/period/helper.js +39 -0
  347. package/lib/inputs/period/index.d.ts +3 -0
  348. package/lib/inputs/period/index.js +213 -0
  349. package/lib/inputs/period/types.d.ts +69 -0
  350. package/lib/inputs/search/index.d.ts +3 -0
  351. package/lib/inputs/search/index.js +104 -0
  352. package/lib/inputs/search/search_input.spec.d.ts +1 -0
  353. package/lib/inputs/select/ActionButtons.d.ts +3 -0
  354. package/lib/inputs/select/ActionButtons.js +28 -0
  355. package/lib/inputs/select/Dropdown.d.ts +3 -0
  356. package/lib/inputs/select/Dropdown.js +70 -0
  357. package/lib/inputs/select/helper.d.ts +11 -0
  358. package/lib/inputs/select/helper.js +48 -0
  359. package/lib/inputs/select/index.d.ts +3 -0
  360. package/lib/inputs/select/index.js +27 -0
  361. package/lib/inputs/select/multiple/Selecteds.d.ts +3 -0
  362. package/lib/inputs/select/multiple/Selecteds.js +25 -0
  363. package/lib/inputs/select/multiple/index.d.ts +3 -0
  364. package/lib/inputs/select/multiple/index.js +126 -0
  365. package/lib/inputs/select/select.spec.d.ts +1 -0
  366. package/lib/inputs/select/simple/index.d.ts +3 -0
  367. package/lib/inputs/select/simple/index.js +156 -0
  368. package/lib/inputs/select/types.d.ts +117 -0
  369. package/lib/inputs/text/index.d.ts +3 -0
  370. package/lib/inputs/text/index.js +11 -0
  371. package/lib/inputs/text/textfield.spec.d.ts +1 -0
  372. package/lib/inputs/text/types.d.ts +21 -0
  373. package/lib/inputs/textarea/index.d.ts +3 -0
  374. package/lib/inputs/textarea/index.js +16 -0
  375. package/lib/inputs/textarea/textarea.spec.d.ts +1 -0
  376. package/lib/inputs/textarea/types.d.ts +7 -0
  377. package/lib/inputs/types.d.ts +151 -0
  378. package/lib/internals/colorStyles.d.ts +8 -0
  379. package/lib/internals/colorStyles.js +10 -0
  380. package/lib/internals/constants.d.ts +9 -0
  381. package/lib/internals/constants.js +12 -0
  382. package/lib/internals/types.d.ts +22 -0
  383. package/lib/internals/withTooltip.d.ts +8 -0
  384. package/lib/internals/withTooltip.js +122 -0
  385. package/lib/labelMessages/index.d.ts +3 -0
  386. package/lib/labelMessages/index.js +53 -0
  387. package/lib/labelMessages/labelMessages.spec.d.ts +1 -0
  388. package/lib/labelMessages/types.d.ts +16 -0
  389. package/lib/labels/DangerLabel.d.ts +3 -0
  390. package/lib/labels/DangerLabel.js +20 -0
  391. package/lib/labels/DefaultLabel.d.ts +6 -0
  392. package/lib/labels/DefaultLabel.js +55 -0
  393. package/lib/labels/InfoLabel.d.ts +3 -0
  394. package/lib/labels/InfoLabel.js +20 -0
  395. package/lib/labels/PrimaryLabel.d.ts +3 -0
  396. package/lib/labels/PrimaryLabel.js +20 -0
  397. package/lib/labels/SuccessLabel.d.ts +3 -0
  398. package/lib/labels/SuccessLabel.js +20 -0
  399. package/lib/labels/WarningLabel.d.ts +3 -0
  400. package/lib/labels/WarningLabel.js +20 -0
  401. package/lib/labels/index.d.ts +9 -0
  402. package/lib/labels/index.js +17 -0
  403. package/lib/labels/label.spec.d.ts +1 -0
  404. package/lib/labels/label_container/index.d.ts +10 -0
  405. package/lib/labels/label_container/index.js +18 -0
  406. package/lib/labels/types.d.ts +22 -0
  407. package/lib/list/Header.d.ts +3 -0
  408. package/lib/list/Header.js +20 -0
  409. package/lib/list/Item.d.ts +6 -0
  410. package/lib/list/Item.js +14 -0
  411. package/lib/list/Separator.d.ts +2 -0
  412. package/lib/list/Separator.js +10 -0
  413. package/lib/list/helpers.d.ts +9 -0
  414. package/lib/list/helpers.js +10 -0
  415. package/lib/list/index.d.ts +7 -0
  416. package/lib/list/index.js +104 -0
  417. package/lib/list/list.spec.d.ts +1 -0
  418. package/lib/list/types.d.ts +69 -0
  419. package/lib/menus/float/MenuItem.d.ts +3 -0
  420. package/lib/menus/float/MenuItem.js +55 -0
  421. package/lib/menus/float/SubMenuContainer.d.ts +29 -0
  422. package/lib/menus/float/float-menu.spec.d.ts +0 -0
  423. package/lib/menus/float/helpers.d.ts +4 -0
  424. package/lib/menus/float/helpers.js +5 -0
  425. package/lib/menus/float/index.d.ts +6 -0
  426. package/lib/menus/float/index.js +113 -0
  427. package/lib/menus/float/types.d.ts +26 -0
  428. package/lib/menus/index.d.ts +2 -0
  429. package/lib/menus/index.js +4 -0
  430. package/lib/menus/sidenav/ExpandMenu.d.ts +3 -0
  431. package/lib/menus/sidenav/ExpandMenu.js +19 -0
  432. package/lib/menus/sidenav/MenuLink.d.ts +6 -0
  433. package/lib/menus/sidenav/MenuLink.js +24 -0
  434. package/lib/menus/sidenav/NavMenuGroup.d.ts +3 -0
  435. package/lib/menus/sidenav/NavMenuGroup.js +22 -0
  436. package/lib/menus/sidenav/NavMenuItem.d.ts +6 -0
  437. package/lib/menus/sidenav/NavMenuItem.js +136 -0
  438. package/lib/menus/sidenav/NavSubMenuItem.d.ts +3 -0
  439. package/lib/menus/sidenav/NavSubMenuItem.js +39 -0
  440. package/lib/menus/sidenav/helpers.d.ts +6 -0
  441. package/lib/menus/sidenav/helpers.js +10 -0
  442. package/lib/menus/sidenav/index.d.ts +8 -0
  443. package/lib/menus/sidenav/index.js +150 -0
  444. package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +3 -0
  445. package/lib/menus/sidenav/popup_menu_search/EmptyList.js +23 -0
  446. package/lib/menus/sidenav/popup_menu_search/index.d.ts +4 -0
  447. package/lib/menus/sidenav/popup_menu_search/index.js +56 -0
  448. package/lib/menus/sidenav/sidenav.spec.d.ts +1 -0
  449. package/lib/menus/sidenav/types.d.ts +85 -0
  450. package/lib/noPermission/index.d.ts +2 -0
  451. package/lib/noPermission/index.js +16 -0
  452. package/lib/panel/Content.d.ts +3 -0
  453. package/lib/panel/Content.js +55 -0
  454. package/lib/panel/DangerPanel.d.ts +3 -0
  455. package/lib/panel/DangerPanel.js +12 -0
  456. package/lib/panel/Default.d.ts +3 -0
  457. package/lib/panel/Default.js +68 -0
  458. package/lib/panel/Header.d.ts +3 -0
  459. package/lib/panel/Header.js +58 -0
  460. package/lib/panel/InfoPanel.d.ts +3 -0
  461. package/lib/panel/InfoPanel.js +12 -0
  462. package/lib/panel/PrimaryPanel.d.ts +3 -0
  463. package/lib/panel/PrimaryPanel.js +12 -0
  464. package/lib/panel/SuccessPanel.d.ts +3 -0
  465. package/lib/panel/SuccessPanel.js +12 -0
  466. package/lib/panel/ToolBar.d.ts +3 -0
  467. package/lib/panel/ToolBar.js +19 -0
  468. package/lib/panel/WarningPanel.d.ts +3 -0
  469. package/lib/panel/WarningPanel.js +12 -0
  470. package/lib/panel/helpers.d.ts +5 -0
  471. package/lib/panel/helpers.js +15 -0
  472. package/lib/panel/index.d.ts +10 -0
  473. package/lib/panel/index.js +19 -0
  474. package/lib/panel/panel.spec.d.ts +0 -0
  475. package/lib/panel/types.d.ts +43 -0
  476. package/lib/permissionValidations.d.ts +12 -0
  477. package/lib/permissionValidations.js +46 -0
  478. package/lib/popover/PopoverText.d.ts +4 -0
  479. package/lib/popover/PopoverText.js +14 -0
  480. package/lib/popover/PopoverTitle.d.ts +3 -0
  481. package/lib/popover/PopoverTitle.js +12 -0
  482. package/lib/popover/index.d.ts +6 -0
  483. package/lib/popover/index.js +39 -0
  484. package/lib/popover/popover.spec.d.ts +1 -0
  485. package/lib/popover/types.d.ts +31 -0
  486. package/lib/progress/Bar.d.ts +3 -0
  487. package/lib/progress/Bar.js +51 -0
  488. package/lib/progress/index.d.ts +5 -0
  489. package/lib/progress/index.js +26 -0
  490. package/lib/progress/progress.spec.d.ts +1 -0
  491. package/lib/progress/types.d.ts +34 -0
  492. package/lib/radio/index.d.ts +8 -0
  493. package/lib/radio/index.js +112 -0
  494. package/lib/radio/radio.spec.d.ts +1 -0
  495. package/lib/radio/types.d.ts +25 -0
  496. package/lib/shortcuts/index.d.ts +3 -0
  497. package/lib/shortcuts/index.js +22 -0
  498. package/lib/shortcuts/shortcuts.spec.d.ts +0 -0
  499. package/lib/shortcuts/types.d.ts +9 -0
  500. package/lib/skeleton/SkeletonContainer.d.ts +3 -0
  501. package/lib/skeleton/SkeletonContainer.js +19 -0
  502. package/lib/skeleton/index.d.ts +5 -0
  503. package/lib/skeleton/index.js +49 -0
  504. package/lib/skeleton/types.d.ts +18 -0
  505. package/lib/spinner/SpinnerLoading.d.ts +3 -0
  506. package/lib/spinner/SpinnerLoading.js +55 -0
  507. package/lib/spinner/index.d.ts +3 -0
  508. package/lib/spinner/index.js +51 -0
  509. package/lib/spinner/spinner.spec.d.ts +1 -0
  510. package/lib/spinner/types.d.ts +17 -0
  511. package/lib/split/Split.d.ts +3 -0
  512. package/lib/split/Split.js +193 -0
  513. package/lib/split/SplitSide.d.ts +3 -0
  514. package/lib/split/SplitSide.js +27 -0
  515. package/lib/split/helpers.d.ts +8 -0
  516. package/lib/split/helpers.js +5 -0
  517. package/lib/split/index.d.ts +4 -0
  518. package/lib/split/index.js +6 -0
  519. package/lib/split/split.spec.d.ts +0 -0
  520. package/lib/split/types.d.ts +31 -0
  521. package/lib/table/Body.d.ts +3 -0
  522. package/lib/table/Body.js +46 -0
  523. package/lib/table/Header.d.ts +3 -0
  524. package/lib/table/Header.js +52 -0
  525. package/lib/table/HeaderColumn.d.ts +3 -0
  526. package/lib/table/HeaderColumn.js +43 -0
  527. package/lib/table/Row.d.ts +3 -0
  528. package/lib/table/Row.js +53 -0
  529. package/lib/table/RowColumn.d.ts +3 -0
  530. package/lib/table/RowColumn.js +58 -0
  531. package/lib/table/helpers.d.ts +7 -0
  532. package/lib/table/helpers.js +9 -0
  533. package/lib/table/index.d.ts +9 -0
  534. package/lib/table/index.js +106 -0
  535. package/lib/table/table.spec.d.ts +1 -0
  536. package/lib/table/types.d.ts +94 -0
  537. package/lib/tabs/DropdownTabs.d.ts +3 -0
  538. package/lib/tabs/DropdownTabs.js +84 -0
  539. package/lib/tabs/Menu.d.ts +3 -0
  540. package/lib/tabs/Menu.js +38 -0
  541. package/lib/tabs/MenuTabs.d.ts +4 -0
  542. package/lib/tabs/MenuTabs.js +64 -0
  543. package/lib/tabs/Panel.d.ts +3 -0
  544. package/lib/tabs/Panel.js +62 -0
  545. package/lib/tabs/context.d.ts +4 -0
  546. package/lib/tabs/context.js +64 -0
  547. package/lib/tabs/index.d.ts +5 -0
  548. package/lib/tabs/index.js +73 -0
  549. package/lib/tabs/tabHelpers.d.ts +9 -0
  550. package/lib/tabs/tabHelpers.js +48 -0
  551. package/lib/tabs/tabs.spec.d.ts +0 -0
  552. package/lib/tabs/types.d.ts +95 -0
  553. package/lib/tabs/useTabs.d.ts +1 -0
  554. package/lib/tabs/useTabs.js +8 -0
  555. package/lib/textContent/index.d.ts +18 -0
  556. package/lib/textContent/index.js +33 -0
  557. package/lib/textContent/textContent.spec.d.ts +1 -0
  558. package/lib/toolbar/ButtonBar.d.ts +3 -0
  559. package/lib/toolbar/ButtonBar.js +67 -0
  560. package/lib/toolbar/LabelBar.d.ts +3 -0
  561. package/lib/toolbar/LabelBar.js +51 -0
  562. package/lib/toolbar/Separator.d.ts +2 -0
  563. package/lib/toolbar/Separator.js +10 -0
  564. package/lib/toolbar/ToolBarGroup.d.ts +3 -0
  565. package/lib/toolbar/ToolBarGroup.js +16 -0
  566. package/lib/toolbar/helpers.d.ts +3 -0
  567. package/lib/toolbar/helpers.js +5 -0
  568. package/lib/toolbar/index.d.ts +8 -0
  569. package/lib/toolbar/index.js +39 -0
  570. package/lib/toolbar/toolbar.spec.d.ts +1 -0
  571. package/lib/toolbar/types.d.ts +43 -0
  572. package/lib/tooltip/index.d.ts +4 -0
  573. package/lib/tooltip/index.js +39 -0
  574. package/lib/tooltip/tooltip.spec.d.ts +1 -0
  575. package/lib/tooltip/types.d.ts +15 -0
  576. package/lib/treetable/Body.d.ts +2 -0
  577. package/lib/treetable/Body.js +34 -0
  578. package/lib/treetable/Header.d.ts +2 -0
  579. package/lib/treetable/Header.js +30 -0
  580. package/lib/treetable/Row.d.ts +3 -0
  581. package/lib/treetable/Row.js +220 -0
  582. package/lib/treetable/helpers.d.ts +13 -0
  583. package/lib/treetable/helpers.js +17 -0
  584. package/lib/treetable/index.d.ts +4 -0
  585. package/lib/treetable/index.js +28 -0
  586. package/lib/treeview/Header.d.ts +3 -0
  587. package/lib/treeview/Header.js +16 -0
  588. package/lib/treeview/Node.d.ts +3 -0
  589. package/lib/treeview/Node.js +206 -0
  590. package/lib/treeview/constants.d.ts +3 -0
  591. package/lib/treeview/constants.js +5 -0
  592. package/lib/treeview/index.d.ts +6 -0
  593. package/lib/treeview/index.js +268 -0
  594. package/lib/treeview/treeview.spec.d.ts +0 -0
  595. package/lib/treeview/types.d.ts +106 -0
  596. package/lib/uitour/helpers.d.ts +7 -0
  597. package/lib/uitour/helpers.js +9 -0
  598. package/lib/uitour/index.d.ts +4 -0
  599. package/lib/uitour/index.js +187 -0
  600. package/lib/uitour/types.d.ts +35 -0
  601. package/lib/uitour/uitour.spec.d.ts +0 -0
  602. package/package.json +1 -1
@@ -0,0 +1,2672 @@
1
+ import { j as pt } from "../../chunks/jsx-runtime.D1SHvdVE.js";
2
+ import R, { useRef as J, useState as N, useCallback as U, useEffect as w } from "react";
3
+ import { P as h } from "../../chunks/index.Df3kt2LQ.js";
4
+ import dt from "../base/InputTextBase.js";
5
+ import { numberToPtBR as ct, formatOnlyNumbers as Q, numberToEnUS as ft } from "../number/format_number.js";
6
+ import { actionsOnPermissionDenied as kt, OPTIONS_ON_DENIED as P } from "../../permissionValidations.js";
7
+ import { getMaskOptions as mt } from "./helpers.js";
8
+ function T(u) {
9
+ return typeof u == "string" || u instanceof String;
10
+ }
11
+ function tt(u) {
12
+ var t;
13
+ return typeof u == "object" && u != null && (u == null || (t = u.constructor) == null ? void 0 : t.name) === "Object";
14
+ }
15
+ function it(u, t) {
16
+ return Array.isArray(t) ? it(u, (e, s) => t.includes(s)) : Object.entries(u).reduce((e, s) => {
17
+ let [i, n] = s;
18
+ return t(n, i) && (e[i] = n), e;
19
+ }, {});
20
+ }
21
+ const o = {
22
+ NONE: "NONE",
23
+ LEFT: "LEFT",
24
+ FORCE_LEFT: "FORCE_LEFT",
25
+ RIGHT: "RIGHT",
26
+ FORCE_RIGHT: "FORCE_RIGHT"
27
+ };
28
+ function gt(u) {
29
+ switch (u) {
30
+ case o.LEFT:
31
+ return o.FORCE_LEFT;
32
+ case o.RIGHT:
33
+ return o.FORCE_RIGHT;
34
+ default:
35
+ return u;
36
+ }
37
+ }
38
+ function $(u) {
39
+ return u.replace(/([.*+?^=!:${}()|[\]/\\])/g, "\\$1");
40
+ }
41
+ function H(u, t) {
42
+ if (t === u) return !0;
43
+ const e = Array.isArray(t), s = Array.isArray(u);
44
+ let i;
45
+ if (e && s) {
46
+ if (t.length != u.length) return !1;
47
+ for (i = 0; i < t.length; i++) if (!H(t[i], u[i])) return !1;
48
+ return !0;
49
+ }
50
+ if (e != s) return !1;
51
+ if (t && u && typeof t == "object" && typeof u == "object") {
52
+ const n = t instanceof Date, a = u instanceof Date;
53
+ if (n && a) return t.getTime() == u.getTime();
54
+ if (n != a) return !1;
55
+ const r = t instanceof RegExp, l = u instanceof RegExp;
56
+ if (r && l) return t.toString() == u.toString();
57
+ if (r != l) return !1;
58
+ const p = Object.keys(t);
59
+ for (i = 0; i < p.length; i++) if (!Object.prototype.hasOwnProperty.call(u, p[i])) return !1;
60
+ for (i = 0; i < p.length; i++) if (!H(u[p[i]], t[p[i]])) return !1;
61
+ return !0;
62
+ } else if (t && u && typeof t == "function" && typeof u == "function")
63
+ return t.toString() === u.toString();
64
+ return !1;
65
+ }
66
+ class _t {
67
+ /** Current input value */
68
+ /** Current cursor position */
69
+ /** Old input value */
70
+ /** Old selection */
71
+ constructor(t) {
72
+ for (Object.assign(this, t); this.value.slice(0, this.startChangePos) !== this.oldValue.slice(0, this.startChangePos); )
73
+ --this.oldSelection.start;
74
+ if (this.insertedCount)
75
+ for (; this.value.slice(this.cursorPos) !== this.oldValue.slice(this.oldSelection.end); )
76
+ this.value.length - this.cursorPos < this.oldValue.length - this.oldSelection.end ? ++this.oldSelection.end : ++this.cursorPos;
77
+ }
78
+ /** Start changing position */
79
+ get startChangePos() {
80
+ return Math.min(this.cursorPos, this.oldSelection.start);
81
+ }
82
+ /** Inserted symbols count */
83
+ get insertedCount() {
84
+ return this.cursorPos - this.startChangePos;
85
+ }
86
+ /** Inserted symbols */
87
+ get inserted() {
88
+ return this.value.substr(this.startChangePos, this.insertedCount);
89
+ }
90
+ /** Removed symbols count */
91
+ get removedCount() {
92
+ return Math.max(this.oldSelection.end - this.startChangePos || // for Delete
93
+ this.oldValue.length - this.value.length, 0);
94
+ }
95
+ /** Removed symbols */
96
+ get removed() {
97
+ return this.oldValue.substr(this.startChangePos, this.removedCount);
98
+ }
99
+ /** Unchanged head symbols */
100
+ get head() {
101
+ return this.value.substring(0, this.startChangePos);
102
+ }
103
+ /** Unchanged tail symbols */
104
+ get tail() {
105
+ return this.value.substring(this.startChangePos + this.insertedCount);
106
+ }
107
+ /** Remove direction */
108
+ get removeDirection() {
109
+ return !this.removedCount || this.insertedCount ? o.NONE : (this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos) && // if not range removed (event with backspace)
110
+ this.oldSelection.end === this.oldSelection.start ? o.RIGHT : o.LEFT;
111
+ }
112
+ }
113
+ function d(u, t) {
114
+ return new d.InputMask(u, t);
115
+ }
116
+ function nt(u) {
117
+ if (u == null) throw new Error("mask property should be defined");
118
+ return u instanceof RegExp ? d.MaskedRegExp : T(u) ? d.MaskedPattern : u === Date ? d.MaskedDate : u === Number ? d.MaskedNumber : Array.isArray(u) || u === Array ? d.MaskedDynamic : d.Masked && u.prototype instanceof d.Masked ? u : d.Masked && u instanceof d.Masked ? u.constructor : u instanceof Function ? d.MaskedFunction : (console.warn("Mask not found for mask", u), d.Masked);
119
+ }
120
+ function L(u) {
121
+ if (!u) throw new Error("Options in not defined");
122
+ if (d.Masked) {
123
+ if (u.prototype instanceof d.Masked) return {
124
+ mask: u
125
+ };
126
+ const {
127
+ mask: t = void 0,
128
+ ...e
129
+ } = u instanceof d.Masked ? {
130
+ mask: u
131
+ } : tt(u) && u.mask instanceof d.Masked ? u : {};
132
+ if (t) {
133
+ const s = t.mask;
134
+ return {
135
+ ...it(t, (i, n) => !n.startsWith("_")),
136
+ mask: t.constructor,
137
+ _mask: s,
138
+ ...e
139
+ };
140
+ }
141
+ }
142
+ return tt(u) ? {
143
+ ...u
144
+ } : {
145
+ mask: u
146
+ };
147
+ }
148
+ function D(u) {
149
+ if (d.Masked && u instanceof d.Masked) return u;
150
+ const t = L(u), e = nt(t.mask);
151
+ if (!e) throw new Error("Masked class is not found for provided mask " + t.mask + ", appropriate module needs to be imported manually before creating mask.");
152
+ return t.mask === e && delete t.mask, t._mask && (t.mask = t._mask, delete t._mask), new e(t);
153
+ }
154
+ d.createMask = D;
155
+ class W {
156
+ /** */
157
+ /** */
158
+ /** */
159
+ /** Safely returns selection start */
160
+ get selectionStart() {
161
+ let t;
162
+ try {
163
+ t = this._unsafeSelectionStart;
164
+ } catch {
165
+ }
166
+ return t ?? this.value.length;
167
+ }
168
+ /** Safely returns selection end */
169
+ get selectionEnd() {
170
+ let t;
171
+ try {
172
+ t = this._unsafeSelectionEnd;
173
+ } catch {
174
+ }
175
+ return t ?? this.value.length;
176
+ }
177
+ /** Safely sets element selection */
178
+ select(t, e) {
179
+ if (!(t == null || e == null || t === this.selectionStart && e === this.selectionEnd))
180
+ try {
181
+ this._unsafeSelect(t, e);
182
+ } catch {
183
+ }
184
+ }
185
+ /** */
186
+ get isActive() {
187
+ return !1;
188
+ }
189
+ /** */
190
+ /** */
191
+ /** */
192
+ }
193
+ d.MaskElement = W;
194
+ const et = 90, vt = 89;
195
+ class z extends W {
196
+ /** HTMLElement to use mask on */
197
+ constructor(t) {
198
+ super(), this.input = t, this._onKeydown = this._onKeydown.bind(this), this._onInput = this._onInput.bind(this), this._onBeforeinput = this._onBeforeinput.bind(this), this._onCompositionEnd = this._onCompositionEnd.bind(this);
199
+ }
200
+ get rootElement() {
201
+ var t, e, s;
202
+ return (t = (e = (s = this.input).getRootNode) == null ? void 0 : e.call(s)) != null ? t : document;
203
+ }
204
+ /** Is element in focus */
205
+ get isActive() {
206
+ return this.input === this.rootElement.activeElement;
207
+ }
208
+ /** Binds HTMLElement events to mask internal events */
209
+ bindEvents(t) {
210
+ this.input.addEventListener("keydown", this._onKeydown), this.input.addEventListener("input", this._onInput), this.input.addEventListener("beforeinput", this._onBeforeinput), this.input.addEventListener("compositionend", this._onCompositionEnd), this.input.addEventListener("drop", t.drop), this.input.addEventListener("click", t.click), this.input.addEventListener("focus", t.focus), this.input.addEventListener("blur", t.commit), this._handlers = t;
211
+ }
212
+ _onKeydown(t) {
213
+ if (this._handlers.redo && (t.keyCode === et && t.shiftKey && (t.metaKey || t.ctrlKey) || t.keyCode === vt && t.ctrlKey))
214
+ return t.preventDefault(), this._handlers.redo(t);
215
+ if (this._handlers.undo && t.keyCode === et && (t.metaKey || t.ctrlKey))
216
+ return t.preventDefault(), this._handlers.undo(t);
217
+ t.isComposing || this._handlers.selectionChange(t);
218
+ }
219
+ _onBeforeinput(t) {
220
+ if (t.inputType === "historyUndo" && this._handlers.undo)
221
+ return t.preventDefault(), this._handlers.undo(t);
222
+ if (t.inputType === "historyRedo" && this._handlers.redo)
223
+ return t.preventDefault(), this._handlers.redo(t);
224
+ }
225
+ _onCompositionEnd(t) {
226
+ this._handlers.input(t);
227
+ }
228
+ _onInput(t) {
229
+ t.isComposing || this._handlers.input(t);
230
+ }
231
+ /** Unbinds HTMLElement events to mask internal events */
232
+ unbindEvents() {
233
+ this.input.removeEventListener("keydown", this._onKeydown), this.input.removeEventListener("input", this._onInput), this.input.removeEventListener("beforeinput", this._onBeforeinput), this.input.removeEventListener("compositionend", this._onCompositionEnd), this.input.removeEventListener("drop", this._handlers.drop), this.input.removeEventListener("click", this._handlers.click), this.input.removeEventListener("focus", this._handlers.focus), this.input.removeEventListener("blur", this._handlers.commit), this._handlers = {};
234
+ }
235
+ }
236
+ d.HTMLMaskElement = z;
237
+ class Et extends z {
238
+ /** InputElement to use mask on */
239
+ constructor(t) {
240
+ super(t), this.input = t;
241
+ }
242
+ /** Returns InputElement selection start */
243
+ get _unsafeSelectionStart() {
244
+ return this.input.selectionStart != null ? this.input.selectionStart : this.value.length;
245
+ }
246
+ /** Returns InputElement selection end */
247
+ get _unsafeSelectionEnd() {
248
+ return this.input.selectionEnd;
249
+ }
250
+ /** Sets InputElement selection */
251
+ _unsafeSelect(t, e) {
252
+ this.input.setSelectionRange(t, e);
253
+ }
254
+ get value() {
255
+ return this.input.value;
256
+ }
257
+ set value(t) {
258
+ this.input.value = t;
259
+ }
260
+ }
261
+ d.HTMLMaskElement = z;
262
+ class at extends z {
263
+ /** Returns HTMLElement selection start */
264
+ get _unsafeSelectionStart() {
265
+ const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, i = e && e.focusOffset;
266
+ return i == null || s == null || s < i ? s : i;
267
+ }
268
+ /** Returns HTMLElement selection end */
269
+ get _unsafeSelectionEnd() {
270
+ const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, i = e && e.focusOffset;
271
+ return i == null || s == null || s > i ? s : i;
272
+ }
273
+ /** Sets HTMLElement selection */
274
+ _unsafeSelect(t, e) {
275
+ if (!this.rootElement.createRange) return;
276
+ const s = this.rootElement.createRange();
277
+ s.setStart(this.input.firstChild || this.input, t), s.setEnd(this.input.lastChild || this.input, e);
278
+ const i = this.rootElement, n = i.getSelection && i.getSelection();
279
+ n && (n.removeAllRanges(), n.addRange(s));
280
+ }
281
+ /** HTMLElement value */
282
+ get value() {
283
+ return this.input.textContent || "";
284
+ }
285
+ set value(t) {
286
+ this.input.textContent = t;
287
+ }
288
+ }
289
+ d.HTMLContenteditableMaskElement = at;
290
+ class G {
291
+ constructor() {
292
+ this.states = [], this.currentIndex = 0;
293
+ }
294
+ get currentState() {
295
+ return this.states[this.currentIndex];
296
+ }
297
+ get isEmpty() {
298
+ return this.states.length === 0;
299
+ }
300
+ push(t) {
301
+ this.currentIndex < this.states.length - 1 && (this.states.length = this.currentIndex + 1), this.states.push(t), this.states.length > G.MAX_LENGTH && this.states.shift(), this.currentIndex = this.states.length - 1;
302
+ }
303
+ go(t) {
304
+ return this.currentIndex = Math.min(Math.max(this.currentIndex + t, 0), this.states.length - 1), this.currentState;
305
+ }
306
+ undo() {
307
+ return this.go(-1);
308
+ }
309
+ redo() {
310
+ return this.go(1);
311
+ }
312
+ clear() {
313
+ this.states.length = 0, this.currentIndex = 0;
314
+ }
315
+ }
316
+ G.MAX_LENGTH = 100;
317
+ class Ct {
318
+ /**
319
+ View element
320
+ */
321
+ /** Internal {@link Masked} model */
322
+ constructor(t, e) {
323
+ this.el = t instanceof W ? t : t.isContentEditable && t.tagName !== "INPUT" && t.tagName !== "TEXTAREA" ? new at(t) : new Et(t), this.masked = D(e), this._listeners = {}, this._value = "", this._unmaskedValue = "", this._rawInputValue = "", this.history = new G(), this._saveSelection = this._saveSelection.bind(this), this._onInput = this._onInput.bind(this), this._onChange = this._onChange.bind(this), this._onDrop = this._onDrop.bind(this), this._onFocus = this._onFocus.bind(this), this._onClick = this._onClick.bind(this), this._onUndo = this._onUndo.bind(this), this._onRedo = this._onRedo.bind(this), this.alignCursor = this.alignCursor.bind(this), this.alignCursorFriendly = this.alignCursorFriendly.bind(this), this._bindEvents(), this.updateValue(), this._onChange();
324
+ }
325
+ maskEquals(t) {
326
+ var e;
327
+ return t == null || ((e = this.masked) == null ? void 0 : e.maskEquals(t));
328
+ }
329
+ /** Masked */
330
+ get mask() {
331
+ return this.masked.mask;
332
+ }
333
+ set mask(t) {
334
+ if (this.maskEquals(t)) return;
335
+ if (!(t instanceof d.Masked) && this.masked.constructor === nt(t)) {
336
+ this.masked.updateOptions({
337
+ mask: t
338
+ });
339
+ return;
340
+ }
341
+ const e = t instanceof d.Masked ? t : D({
342
+ mask: t
343
+ });
344
+ e.unmaskedValue = this.masked.unmaskedValue, this.masked = e;
345
+ }
346
+ /** Raw value */
347
+ get value() {
348
+ return this._value;
349
+ }
350
+ set value(t) {
351
+ this.value !== t && (this.masked.value = t, this.updateControl("auto"));
352
+ }
353
+ /** Unmasked value */
354
+ get unmaskedValue() {
355
+ return this._unmaskedValue;
356
+ }
357
+ set unmaskedValue(t) {
358
+ this.unmaskedValue !== t && (this.masked.unmaskedValue = t, this.updateControl("auto"));
359
+ }
360
+ /** Raw input value */
361
+ get rawInputValue() {
362
+ return this._rawInputValue;
363
+ }
364
+ set rawInputValue(t) {
365
+ this.rawInputValue !== t && (this.masked.rawInputValue = t, this.updateControl(), this.alignCursor());
366
+ }
367
+ /** Typed unmasked value */
368
+ get typedValue() {
369
+ return this.masked.typedValue;
370
+ }
371
+ set typedValue(t) {
372
+ this.masked.typedValueEquals(t) || (this.masked.typedValue = t, this.updateControl("auto"));
373
+ }
374
+ /** Display value */
375
+ get displayValue() {
376
+ return this.masked.displayValue;
377
+ }
378
+ /** Starts listening to element events */
379
+ _bindEvents() {
380
+ this.el.bindEvents({
381
+ selectionChange: this._saveSelection,
382
+ input: this._onInput,
383
+ drop: this._onDrop,
384
+ click: this._onClick,
385
+ focus: this._onFocus,
386
+ commit: this._onChange,
387
+ undo: this._onUndo,
388
+ redo: this._onRedo
389
+ });
390
+ }
391
+ /** Stops listening to element events */
392
+ _unbindEvents() {
393
+ this.el && this.el.unbindEvents();
394
+ }
395
+ /** Fires custom event */
396
+ _fireEvent(t, e) {
397
+ const s = this._listeners[t];
398
+ s && s.forEach((i) => i(e));
399
+ }
400
+ /** Current selection start */
401
+ get selectionStart() {
402
+ return this._cursorChanging ? this._changingCursorPos : this.el.selectionStart;
403
+ }
404
+ /** Current cursor position */
405
+ get cursorPos() {
406
+ return this._cursorChanging ? this._changingCursorPos : this.el.selectionEnd;
407
+ }
408
+ set cursorPos(t) {
409
+ !this.el || !this.el.isActive || (this.el.select(t, t), this._saveSelection());
410
+ }
411
+ /** Stores current selection */
412
+ _saveSelection() {
413
+ this.displayValue !== this.el.value && console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."), this._selection = {
414
+ start: this.selectionStart,
415
+ end: this.cursorPos
416
+ };
417
+ }
418
+ /** Syncronizes model value from view */
419
+ updateValue() {
420
+ this.masked.value = this.el.value, this._value = this.masked.value, this._unmaskedValue = this.masked.unmaskedValue, this._rawInputValue = this.masked.rawInputValue;
421
+ }
422
+ /** Syncronizes view from model value, fires change events */
423
+ updateControl(t) {
424
+ const e = this.masked.unmaskedValue, s = this.masked.value, i = this.masked.rawInputValue, n = this.displayValue, a = this.unmaskedValue !== e || this.value !== s || this._rawInputValue !== i;
425
+ this._unmaskedValue = e, this._value = s, this._rawInputValue = i, this.el.value !== n && (this.el.value = n), t === "auto" ? this.alignCursor() : t != null && (this.cursorPos = t), a && this._fireChangeEvents(), !this._historyChanging && (a || this.history.isEmpty) && this.history.push({
426
+ unmaskedValue: e,
427
+ selection: {
428
+ start: this.selectionStart,
429
+ end: this.cursorPos
430
+ }
431
+ });
432
+ }
433
+ /** Updates options with deep equal check, recreates {@link Masked} model if mask type changes */
434
+ updateOptions(t) {
435
+ const {
436
+ mask: e,
437
+ ...s
438
+ } = t, i = !this.maskEquals(e), n = this.masked.optionsIsChanged(s);
439
+ i && (this.mask = e), n && this.masked.updateOptions(s), (i || n) && this.updateControl();
440
+ }
441
+ /** Updates cursor */
442
+ updateCursor(t) {
443
+ t != null && (this.cursorPos = t, this._delayUpdateCursor(t));
444
+ }
445
+ /** Delays cursor update to support mobile browsers */
446
+ _delayUpdateCursor(t) {
447
+ this._abortUpdateCursor(), this._changingCursorPos = t, this._cursorChanging = setTimeout(() => {
448
+ this.el && (this.cursorPos = this._changingCursorPos, this._abortUpdateCursor());
449
+ }, 10);
450
+ }
451
+ /** Fires custom events */
452
+ _fireChangeEvents() {
453
+ this._fireEvent("accept", this._inputEvent), this.masked.isComplete && this._fireEvent("complete", this._inputEvent);
454
+ }
455
+ /** Aborts delayed cursor update */
456
+ _abortUpdateCursor() {
457
+ this._cursorChanging && (clearTimeout(this._cursorChanging), delete this._cursorChanging);
458
+ }
459
+ /** Aligns cursor to nearest available position */
460
+ alignCursor() {
461
+ this.cursorPos = this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos, o.LEFT));
462
+ }
463
+ /** Aligns cursor only if selection is empty */
464
+ alignCursorFriendly() {
465
+ this.selectionStart === this.cursorPos && this.alignCursor();
466
+ }
467
+ /** Adds listener on custom event */
468
+ on(t, e) {
469
+ return this._listeners[t] || (this._listeners[t] = []), this._listeners[t].push(e), this;
470
+ }
471
+ /** Removes custom event listener */
472
+ off(t, e) {
473
+ if (!this._listeners[t]) return this;
474
+ if (!e)
475
+ return delete this._listeners[t], this;
476
+ const s = this._listeners[t].indexOf(e);
477
+ return s >= 0 && this._listeners[t].splice(s, 1), this;
478
+ }
479
+ /** Handles view input event */
480
+ _onInput(t) {
481
+ this._inputEvent = t, this._abortUpdateCursor();
482
+ const e = new _t({
483
+ // new state
484
+ value: this.el.value,
485
+ cursorPos: this.cursorPos,
486
+ // old state
487
+ oldValue: this.displayValue,
488
+ oldSelection: this._selection
489
+ }), s = this.masked.rawInputValue, i = this.masked.splice(e.startChangePos, e.removed.length, e.inserted, e.removeDirection, {
490
+ input: !0,
491
+ raw: !0
492
+ }).offset, n = s === this.masked.rawInputValue ? e.removeDirection : o.NONE;
493
+ let a = this.masked.nearestInputPos(e.startChangePos + i, n);
494
+ n !== o.NONE && (a = this.masked.nearestInputPos(a, o.NONE)), this.updateControl(a), delete this._inputEvent;
495
+ }
496
+ /** Handles view change event and commits model value */
497
+ _onChange() {
498
+ this.displayValue !== this.el.value && this.updateValue(), this.masked.doCommit(), this.updateControl(), this._saveSelection();
499
+ }
500
+ /** Handles view drop event, prevents by default */
501
+ _onDrop(t) {
502
+ t.preventDefault(), t.stopPropagation();
503
+ }
504
+ /** Restore last selection on focus */
505
+ _onFocus(t) {
506
+ this.alignCursorFriendly();
507
+ }
508
+ /** Restore last selection on focus */
509
+ _onClick(t) {
510
+ this.alignCursorFriendly();
511
+ }
512
+ _onUndo() {
513
+ this._applyHistoryState(this.history.undo());
514
+ }
515
+ _onRedo() {
516
+ this._applyHistoryState(this.history.redo());
517
+ }
518
+ _applyHistoryState(t) {
519
+ t && (this._historyChanging = !0, this.unmaskedValue = t.unmaskedValue, this.el.select(t.selection.start, t.selection.end), this._saveSelection(), this._historyChanging = !1);
520
+ }
521
+ /** Unbind view events and removes element reference */
522
+ destroy() {
523
+ this._unbindEvents(), this._listeners.length = 0, delete this.el;
524
+ }
525
+ }
526
+ d.InputMask = Ct;
527
+ class c {
528
+ /** Inserted symbols */
529
+ /** Additional offset if any changes occurred before tail */
530
+ /** Raw inserted is used by dynamic mask */
531
+ /** Can skip chars */
532
+ static normalize(t) {
533
+ return Array.isArray(t) ? t : [t, new c()];
534
+ }
535
+ constructor(t) {
536
+ Object.assign(this, {
537
+ inserted: "",
538
+ rawInserted: "",
539
+ tailShift: 0,
540
+ skip: !1
541
+ }, t);
542
+ }
543
+ /** Aggregate changes */
544
+ aggregate(t) {
545
+ return this.inserted += t.inserted, this.rawInserted += t.rawInserted, this.tailShift += t.tailShift, this.skip = this.skip || t.skip, this;
546
+ }
547
+ /** Total offset considering all changes */
548
+ get offset() {
549
+ return this.tailShift + this.inserted.length;
550
+ }
551
+ get consumed() {
552
+ return !!this.rawInserted || this.skip;
553
+ }
554
+ equals(t) {
555
+ return this.inserted === t.inserted && this.tailShift === t.tailShift && this.rawInserted === t.rawInserted && this.skip === t.skip;
556
+ }
557
+ }
558
+ d.ChangeDetails = c;
559
+ class B {
560
+ /** Tail value as string */
561
+ /** Tail start position */
562
+ /** Start position */
563
+ constructor(t, e, s) {
564
+ t === void 0 && (t = ""), e === void 0 && (e = 0), this.value = t, this.from = e, this.stop = s;
565
+ }
566
+ toString() {
567
+ return this.value;
568
+ }
569
+ extend(t) {
570
+ this.value += String(t);
571
+ }
572
+ appendTo(t) {
573
+ return t.append(this.toString(), {
574
+ tail: !0
575
+ }).aggregate(t._appendPlaceholder());
576
+ }
577
+ get state() {
578
+ return {
579
+ value: this.value,
580
+ from: this.from,
581
+ stop: this.stop
582
+ };
583
+ }
584
+ set state(t) {
585
+ Object.assign(this, t);
586
+ }
587
+ unshift(t) {
588
+ if (!this.value.length || t != null && this.from >= t) return "";
589
+ const e = this.value[0];
590
+ return this.value = this.value.slice(1), e;
591
+ }
592
+ shift() {
593
+ if (!this.value.length) return "";
594
+ const t = this.value[this.value.length - 1];
595
+ return this.value = this.value.slice(0, -1), t;
596
+ }
597
+ }
598
+ class _ {
599
+ /** */
600
+ /** */
601
+ /** Transforms value before mask processing */
602
+ /** Transforms each char before mask processing */
603
+ /** Validates if value is acceptable */
604
+ /** Does additional processing at the end of editing */
605
+ /** Format typed value to string */
606
+ /** Parse string to get typed value */
607
+ /** Enable characters overwriting */
608
+ /** */
609
+ /** */
610
+ /** */
611
+ /** */
612
+ constructor(t) {
613
+ this._value = "", this._update({
614
+ ..._.DEFAULTS,
615
+ ...t
616
+ }), this._initialized = !0;
617
+ }
618
+ /** Sets and applies new options */
619
+ updateOptions(t) {
620
+ this.optionsIsChanged(t) && this.withValueRefresh(this._update.bind(this, t));
621
+ }
622
+ /** Sets new options */
623
+ _update(t) {
624
+ Object.assign(this, t);
625
+ }
626
+ /** Mask state */
627
+ get state() {
628
+ return {
629
+ _value: this.value,
630
+ _rawInputValue: this.rawInputValue
631
+ };
632
+ }
633
+ set state(t) {
634
+ this._value = t._value;
635
+ }
636
+ /** Resets value */
637
+ reset() {
638
+ this._value = "";
639
+ }
640
+ get value() {
641
+ return this._value;
642
+ }
643
+ set value(t) {
644
+ this.resolve(t, {
645
+ input: !0
646
+ });
647
+ }
648
+ /** Resolve new value */
649
+ resolve(t, e) {
650
+ e === void 0 && (e = {
651
+ input: !0
652
+ }), this.reset(), this.append(t, e, ""), this.doCommit();
653
+ }
654
+ get unmaskedValue() {
655
+ return this.value;
656
+ }
657
+ set unmaskedValue(t) {
658
+ this.resolve(t, {});
659
+ }
660
+ get typedValue() {
661
+ return this.parse ? this.parse(this.value, this) : this.unmaskedValue;
662
+ }
663
+ set typedValue(t) {
664
+ this.format ? this.value = this.format(t, this) : this.unmaskedValue = String(t);
665
+ }
666
+ /** Value that includes raw user input */
667
+ get rawInputValue() {
668
+ return this.extractInput(0, this.displayValue.length, {
669
+ raw: !0
670
+ });
671
+ }
672
+ set rawInputValue(t) {
673
+ this.resolve(t, {
674
+ raw: !0
675
+ });
676
+ }
677
+ get displayValue() {
678
+ return this.value;
679
+ }
680
+ get isComplete() {
681
+ return !0;
682
+ }
683
+ get isFilled() {
684
+ return this.isComplete;
685
+ }
686
+ /** Finds nearest input position in direction */
687
+ nearestInputPos(t, e) {
688
+ return t;
689
+ }
690
+ totalInputPositions(t, e) {
691
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), Math.min(this.displayValue.length, e - t);
692
+ }
693
+ /** Extracts value in range considering flags */
694
+ extractInput(t, e, s) {
695
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), this.displayValue.slice(t, e);
696
+ }
697
+ /** Extracts tail in range */
698
+ extractTail(t, e) {
699
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), new B(this.extractInput(t, e), t);
700
+ }
701
+ /** Appends tail */
702
+ appendTail(t) {
703
+ return T(t) && (t = new B(String(t))), t.appendTo(this);
704
+ }
705
+ /** Appends char */
706
+ _appendCharRaw(t, e) {
707
+ return t ? (this._value += t, new c({
708
+ inserted: t,
709
+ rawInserted: t
710
+ })) : new c();
711
+ }
712
+ /** Appends char */
713
+ _appendChar(t, e, s) {
714
+ e === void 0 && (e = {});
715
+ const i = this.state;
716
+ let n;
717
+ if ([t, n] = this.doPrepareChar(t, e), t && (n = n.aggregate(this._appendCharRaw(t, e)), !n.rawInserted && this.autofix === "pad")) {
718
+ const a = this.state;
719
+ this.state = i;
720
+ let r = this.pad(e);
721
+ const l = this._appendCharRaw(t, e);
722
+ r = r.aggregate(l), l.rawInserted || r.equals(n) ? n = r : this.state = a;
723
+ }
724
+ if (n.inserted) {
725
+ let a, r = this.doValidate(e) !== !1;
726
+ if (r && s != null) {
727
+ const l = this.state;
728
+ if (this.overwrite === !0) {
729
+ a = s.state;
730
+ for (let k = 0; k < n.rawInserted.length; ++k)
731
+ s.unshift(this.displayValue.length - n.tailShift);
732
+ }
733
+ let p = this.appendTail(s);
734
+ if (r = p.rawInserted.length === s.toString().length, !(r && p.inserted) && this.overwrite === "shift") {
735
+ this.state = l, a = s.state;
736
+ for (let k = 0; k < n.rawInserted.length; ++k)
737
+ s.shift();
738
+ p = this.appendTail(s), r = p.rawInserted.length === s.toString().length;
739
+ }
740
+ r && p.inserted && (this.state = l);
741
+ }
742
+ r || (n = new c(), this.state = i, s && a && (s.state = a));
743
+ }
744
+ return n;
745
+ }
746
+ /** Appends optional placeholder at the end */
747
+ _appendPlaceholder() {
748
+ return new c();
749
+ }
750
+ /** Appends optional eager placeholder at the end */
751
+ _appendEager() {
752
+ return new c();
753
+ }
754
+ /** Appends symbols considering flags */
755
+ append(t, e, s) {
756
+ if (!T(t)) throw new Error("value should be string");
757
+ const i = T(s) ? new B(String(s)) : s;
758
+ e != null && e.tail && (e._beforeTailState = this.state);
759
+ let n;
760
+ [t, n] = this.doPrepare(t, e);
761
+ for (let a = 0; a < t.length; ++a) {
762
+ const r = this._appendChar(t[a], e, i);
763
+ if (!r.rawInserted && !this.doSkipInvalid(t[a], e, i)) break;
764
+ n.aggregate(r);
765
+ }
766
+ return (this.eager === !0 || this.eager === "append") && e != null && e.input && t && n.aggregate(this._appendEager()), i != null && (n.tailShift += this.appendTail(i).tailShift), n;
767
+ }
768
+ remove(t, e) {
769
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), this._value = this.displayValue.slice(0, t) + this.displayValue.slice(e), new c();
770
+ }
771
+ /** Calls function and reapplies current value */
772
+ withValueRefresh(t) {
773
+ if (this._refreshing || !this._initialized) return t();
774
+ this._refreshing = !0;
775
+ const e = this.rawInputValue, s = this.value, i = t();
776
+ return this.rawInputValue = e, this.value && this.value !== s && s.indexOf(this.value) === 0 && (this.append(s.slice(this.displayValue.length), {}, ""), this.doCommit()), delete this._refreshing, i;
777
+ }
778
+ runIsolated(t) {
779
+ if (this._isolated || !this._initialized) return t(this);
780
+ this._isolated = !0;
781
+ const e = this.state, s = t(this);
782
+ return this.state = e, delete this._isolated, s;
783
+ }
784
+ doSkipInvalid(t, e, s) {
785
+ return !!this.skipInvalid;
786
+ }
787
+ /** Prepares string before mask processing */
788
+ doPrepare(t, e) {
789
+ return e === void 0 && (e = {}), c.normalize(this.prepare ? this.prepare(t, this, e) : t);
790
+ }
791
+ /** Prepares each char before mask processing */
792
+ doPrepareChar(t, e) {
793
+ return e === void 0 && (e = {}), c.normalize(this.prepareChar ? this.prepareChar(t, this, e) : t);
794
+ }
795
+ /** Validates if value is acceptable */
796
+ doValidate(t) {
797
+ return (!this.validate || this.validate(this.value, this, t)) && (!this.parent || this.parent.doValidate(t));
798
+ }
799
+ /** Does additional processing at the end of editing */
800
+ doCommit() {
801
+ this.commit && this.commit(this.value, this);
802
+ }
803
+ splice(t, e, s, i, n) {
804
+ s === void 0 && (s = ""), i === void 0 && (i = o.NONE), n === void 0 && (n = {
805
+ input: !0
806
+ });
807
+ const a = t + e, r = this.extractTail(a), l = this.eager === !0 || this.eager === "remove";
808
+ let p;
809
+ l && (i = gt(i), p = this.extractInput(0, a, {
810
+ raw: !0
811
+ }));
812
+ let k = t;
813
+ const m = new c();
814
+ if (i !== o.NONE && (k = this.nearestInputPos(t, e > 1 && t !== 0 && !l ? o.NONE : i), m.tailShift = k - t), m.aggregate(this.remove(k)), l && i !== o.NONE && p === this.rawInputValue)
815
+ if (i === o.FORCE_LEFT) {
816
+ let g;
817
+ for (; p === this.rawInputValue && (g = this.displayValue.length); )
818
+ m.aggregate(new c({
819
+ tailShift: -1
820
+ })).aggregate(this.remove(g - 1));
821
+ } else i === o.FORCE_RIGHT && r.unshift();
822
+ return m.aggregate(this.append(s, n, r));
823
+ }
824
+ maskEquals(t) {
825
+ return this.mask === t;
826
+ }
827
+ optionsIsChanged(t) {
828
+ return !H(this, t);
829
+ }
830
+ typedValueEquals(t) {
831
+ const e = this.typedValue;
832
+ return t === e || _.EMPTY_VALUES.includes(t) && _.EMPTY_VALUES.includes(e) || (this.format ? this.format(t, this) === this.format(this.typedValue, this) : !1);
833
+ }
834
+ pad(t) {
835
+ return new c();
836
+ }
837
+ }
838
+ _.DEFAULTS = {
839
+ skipInvalid: !0
840
+ };
841
+ _.EMPTY_VALUES = [void 0, null, ""];
842
+ d.Masked = _;
843
+ class O {
844
+ /** */
845
+ constructor(t, e) {
846
+ t === void 0 && (t = []), e === void 0 && (e = 0), this.chunks = t, this.from = e;
847
+ }
848
+ toString() {
849
+ return this.chunks.map(String).join("");
850
+ }
851
+ extend(t) {
852
+ if (!String(t)) return;
853
+ t = T(t) ? new B(String(t)) : t;
854
+ const e = this.chunks[this.chunks.length - 1], s = e && // if stops are same or tail has no stop
855
+ (e.stop === t.stop || t.stop == null) && // if tail chunk goes just after last chunk
856
+ t.from === e.from + e.toString().length;
857
+ if (t instanceof B)
858
+ s ? e.extend(t.toString()) : this.chunks.push(t);
859
+ else if (t instanceof O) {
860
+ if (t.stop == null) {
861
+ let i;
862
+ for (; t.chunks.length && t.chunks[0].stop == null; )
863
+ i = t.chunks.shift(), i.from += t.from, this.extend(i);
864
+ }
865
+ t.toString() && (t.stop = t.blockIndex, this.chunks.push(t));
866
+ }
867
+ }
868
+ appendTo(t) {
869
+ if (!(t instanceof d.MaskedPattern))
870
+ return new B(this.toString()).appendTo(t);
871
+ const e = new c();
872
+ for (let s = 0; s < this.chunks.length; ++s) {
873
+ const i = this.chunks[s], n = t._mapPosToBlock(t.displayValue.length), a = i.stop;
874
+ let r;
875
+ if (a != null && // if block not found or stop is behind lastBlock
876
+ (!n || n.index <= a) && ((i instanceof O || // for continuous block also check if stop is exist
877
+ t._stops.indexOf(a) >= 0) && e.aggregate(t._appendPlaceholder(a)), r = i instanceof O && t._blocks[a]), r) {
878
+ const l = r.appendTail(i);
879
+ e.aggregate(l);
880
+ const p = i.toString().slice(l.rawInserted.length);
881
+ p && e.aggregate(t.append(p, {
882
+ tail: !0
883
+ }));
884
+ } else
885
+ e.aggregate(t.append(i.toString(), {
886
+ tail: !0
887
+ }));
888
+ }
889
+ return e;
890
+ }
891
+ get state() {
892
+ return {
893
+ chunks: this.chunks.map((t) => t.state),
894
+ from: this.from,
895
+ stop: this.stop,
896
+ blockIndex: this.blockIndex
897
+ };
898
+ }
899
+ set state(t) {
900
+ const {
901
+ chunks: e,
902
+ ...s
903
+ } = t;
904
+ Object.assign(this, s), this.chunks = e.map((i) => {
905
+ const n = "chunks" in i ? new O() : new B();
906
+ return n.state = i, n;
907
+ });
908
+ }
909
+ unshift(t) {
910
+ if (!this.chunks.length || t != null && this.from >= t) return "";
911
+ const e = t != null ? t - this.from : t;
912
+ let s = 0;
913
+ for (; s < this.chunks.length; ) {
914
+ const i = this.chunks[s], n = i.unshift(e);
915
+ if (i.toString()) {
916
+ if (!n) break;
917
+ ++s;
918
+ } else
919
+ this.chunks.splice(s, 1);
920
+ if (n) return n;
921
+ }
922
+ return "";
923
+ }
924
+ shift() {
925
+ if (!this.chunks.length) return "";
926
+ let t = this.chunks.length - 1;
927
+ for (; 0 <= t; ) {
928
+ const e = this.chunks[t], s = e.shift();
929
+ if (e.toString()) {
930
+ if (!s) break;
931
+ --t;
932
+ } else
933
+ this.chunks.splice(t, 1);
934
+ if (s) return s;
935
+ }
936
+ return "";
937
+ }
938
+ }
939
+ class At {
940
+ constructor(t, e) {
941
+ this.masked = t, this._log = [];
942
+ const {
943
+ offset: s,
944
+ index: i
945
+ } = t._mapPosToBlock(e) || (e < 0 ? (
946
+ // first
947
+ {
948
+ index: 0,
949
+ offset: 0
950
+ }
951
+ ) : (
952
+ // last
953
+ {
954
+ index: this.masked._blocks.length,
955
+ offset: 0
956
+ }
957
+ ));
958
+ this.offset = s, this.index = i, this.ok = !1;
959
+ }
960
+ get block() {
961
+ return this.masked._blocks[this.index];
962
+ }
963
+ get pos() {
964
+ return this.masked._blockStartPos(this.index) + this.offset;
965
+ }
966
+ get state() {
967
+ return {
968
+ index: this.index,
969
+ offset: this.offset,
970
+ ok: this.ok
971
+ };
972
+ }
973
+ set state(t) {
974
+ Object.assign(this, t);
975
+ }
976
+ pushState() {
977
+ this._log.push(this.state);
978
+ }
979
+ popState() {
980
+ const t = this._log.pop();
981
+ return t && (this.state = t), t;
982
+ }
983
+ bindBlock() {
984
+ this.block || (this.index < 0 && (this.index = 0, this.offset = 0), this.index >= this.masked._blocks.length && (this.index = this.masked._blocks.length - 1, this.offset = this.block.displayValue.length));
985
+ }
986
+ _pushLeft(t) {
987
+ for (this.pushState(), this.bindBlock(); 0 <= this.index; --this.index, this.offset = ((e = this.block) == null ? void 0 : e.displayValue.length) || 0) {
988
+ var e;
989
+ if (t()) return this.ok = !0;
990
+ }
991
+ return this.ok = !1;
992
+ }
993
+ _pushRight(t) {
994
+ for (this.pushState(), this.bindBlock(); this.index < this.masked._blocks.length; ++this.index, this.offset = 0)
995
+ if (t()) return this.ok = !0;
996
+ return this.ok = !1;
997
+ }
998
+ pushLeftBeforeFilled() {
999
+ return this._pushLeft(() => {
1000
+ if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(this.offset, o.FORCE_LEFT), this.offset !== 0))
1001
+ return !0;
1002
+ });
1003
+ }
1004
+ pushLeftBeforeInput() {
1005
+ return this._pushLeft(() => {
1006
+ if (!this.block.isFixed)
1007
+ return this.offset = this.block.nearestInputPos(this.offset, o.LEFT), !0;
1008
+ });
1009
+ }
1010
+ pushLeftBeforeRequired() {
1011
+ return this._pushLeft(() => {
1012
+ if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
1013
+ return this.offset = this.block.nearestInputPos(this.offset, o.LEFT), !0;
1014
+ });
1015
+ }
1016
+ pushRightBeforeFilled() {
1017
+ return this._pushRight(() => {
1018
+ if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(this.offset, o.FORCE_RIGHT), this.offset !== this.block.value.length))
1019
+ return !0;
1020
+ });
1021
+ }
1022
+ pushRightBeforeInput() {
1023
+ return this._pushRight(() => {
1024
+ if (!this.block.isFixed)
1025
+ return this.offset = this.block.nearestInputPos(this.offset, o.NONE), !0;
1026
+ });
1027
+ }
1028
+ pushRightBeforeRequired() {
1029
+ return this._pushRight(() => {
1030
+ if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
1031
+ return this.offset = this.block.nearestInputPos(this.offset, o.NONE), !0;
1032
+ });
1033
+ }
1034
+ }
1035
+ class ut {
1036
+ /** */
1037
+ /** */
1038
+ /** */
1039
+ /** */
1040
+ /** */
1041
+ /** */
1042
+ constructor(t) {
1043
+ Object.assign(this, t), this._value = "", this.isFixed = !0;
1044
+ }
1045
+ get value() {
1046
+ return this._value;
1047
+ }
1048
+ get unmaskedValue() {
1049
+ return this.isUnmasking ? this.value : "";
1050
+ }
1051
+ get rawInputValue() {
1052
+ return this._isRawInput ? this.value : "";
1053
+ }
1054
+ get displayValue() {
1055
+ return this.value;
1056
+ }
1057
+ reset() {
1058
+ this._isRawInput = !1, this._value = "";
1059
+ }
1060
+ remove(t, e) {
1061
+ return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), this._value = this._value.slice(0, t) + this._value.slice(e), this._value || (this._isRawInput = !1), new c();
1062
+ }
1063
+ nearestInputPos(t, e) {
1064
+ e === void 0 && (e = o.NONE);
1065
+ const s = 0, i = this._value.length;
1066
+ switch (e) {
1067
+ case o.LEFT:
1068
+ case o.FORCE_LEFT:
1069
+ return s;
1070
+ case o.NONE:
1071
+ case o.RIGHT:
1072
+ case o.FORCE_RIGHT:
1073
+ default:
1074
+ return i;
1075
+ }
1076
+ }
1077
+ totalInputPositions(t, e) {
1078
+ return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), this._isRawInput ? e - t : 0;
1079
+ }
1080
+ extractInput(t, e, s) {
1081
+ return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), s === void 0 && (s = {}), s.raw && this._isRawInput && this._value.slice(t, e) || "";
1082
+ }
1083
+ get isComplete() {
1084
+ return !0;
1085
+ }
1086
+ get isFilled() {
1087
+ return !!this._value;
1088
+ }
1089
+ _appendChar(t, e) {
1090
+ if (e === void 0 && (e = {}), this.isFilled) return new c();
1091
+ const s = this.eager === !0 || this.eager === "append", n = this.char === t && (this.isUnmasking || e.input || e.raw) && (!e.raw || !s) && !e.tail, a = new c({
1092
+ inserted: this.char,
1093
+ rawInserted: n ? this.char : ""
1094
+ });
1095
+ return this._value = this.char, this._isRawInput = n && (e.raw || e.input), a;
1096
+ }
1097
+ _appendEager() {
1098
+ return this._appendChar(this.char, {
1099
+ tail: !0
1100
+ });
1101
+ }
1102
+ _appendPlaceholder() {
1103
+ const t = new c();
1104
+ return this.isFilled || (this._value = t.inserted = this.char), t;
1105
+ }
1106
+ extractTail() {
1107
+ return new B("");
1108
+ }
1109
+ appendTail(t) {
1110
+ return T(t) && (t = new B(String(t))), t.appendTo(this);
1111
+ }
1112
+ append(t, e, s) {
1113
+ const i = this._appendChar(t[0], e);
1114
+ return s != null && (i.tailShift += this.appendTail(s).tailShift), i;
1115
+ }
1116
+ doCommit() {
1117
+ }
1118
+ get state() {
1119
+ return {
1120
+ _value: this._value,
1121
+ _rawInputValue: this.rawInputValue
1122
+ };
1123
+ }
1124
+ set state(t) {
1125
+ this._value = t._value, this._isRawInput = !!t._rawInputValue;
1126
+ }
1127
+ pad(t) {
1128
+ return this._appendPlaceholder();
1129
+ }
1130
+ }
1131
+ class K {
1132
+ /** */
1133
+ /** */
1134
+ /** */
1135
+ /** */
1136
+ /** */
1137
+ /** */
1138
+ /** */
1139
+ /** */
1140
+ constructor(t) {
1141
+ const {
1142
+ parent: e,
1143
+ isOptional: s,
1144
+ placeholderChar: i,
1145
+ displayChar: n,
1146
+ lazy: a,
1147
+ eager: r,
1148
+ ...l
1149
+ } = t;
1150
+ this.masked = D(l), Object.assign(this, {
1151
+ parent: e,
1152
+ isOptional: s,
1153
+ placeholderChar: i,
1154
+ displayChar: n,
1155
+ lazy: a,
1156
+ eager: r
1157
+ });
1158
+ }
1159
+ reset() {
1160
+ this.isFilled = !1, this.masked.reset();
1161
+ }
1162
+ remove(t, e) {
1163
+ return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), t === 0 && e >= 1 ? (this.isFilled = !1, this.masked.remove(t, e)) : new c();
1164
+ }
1165
+ get value() {
1166
+ return this.masked.value || (this.isFilled && !this.isOptional ? this.placeholderChar : "");
1167
+ }
1168
+ get unmaskedValue() {
1169
+ return this.masked.unmaskedValue;
1170
+ }
1171
+ get rawInputValue() {
1172
+ return this.masked.rawInputValue;
1173
+ }
1174
+ get displayValue() {
1175
+ return this.masked.value && this.displayChar || this.value;
1176
+ }
1177
+ get isComplete() {
1178
+ return !!this.masked.value || this.isOptional;
1179
+ }
1180
+ _appendChar(t, e) {
1181
+ if (e === void 0 && (e = {}), this.isFilled) return new c();
1182
+ const s = this.masked.state;
1183
+ let i = this.masked._appendChar(t, this.currentMaskFlags(e));
1184
+ return i.inserted && this.doValidate(e) === !1 && (i = new c(), this.masked.state = s), !i.inserted && !this.isOptional && !this.lazy && !e.input && (i.inserted = this.placeholderChar), i.skip = !i.inserted && !this.isOptional, this.isFilled = !!i.inserted, i;
1185
+ }
1186
+ append(t, e, s) {
1187
+ return this.masked.append(t, this.currentMaskFlags(e), s);
1188
+ }
1189
+ _appendPlaceholder() {
1190
+ return this.isFilled || this.isOptional ? new c() : (this.isFilled = !0, new c({
1191
+ inserted: this.placeholderChar
1192
+ }));
1193
+ }
1194
+ _appendEager() {
1195
+ return new c();
1196
+ }
1197
+ extractTail(t, e) {
1198
+ return this.masked.extractTail(t, e);
1199
+ }
1200
+ appendTail(t) {
1201
+ return this.masked.appendTail(t);
1202
+ }
1203
+ extractInput(t, e, s) {
1204
+ return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), this.masked.extractInput(t, e, s);
1205
+ }
1206
+ nearestInputPos(t, e) {
1207
+ e === void 0 && (e = o.NONE);
1208
+ const s = 0, i = this.value.length, n = Math.min(Math.max(t, s), i);
1209
+ switch (e) {
1210
+ case o.LEFT:
1211
+ case o.FORCE_LEFT:
1212
+ return this.isComplete ? n : s;
1213
+ case o.RIGHT:
1214
+ case o.FORCE_RIGHT:
1215
+ return this.isComplete ? n : i;
1216
+ case o.NONE:
1217
+ default:
1218
+ return n;
1219
+ }
1220
+ }
1221
+ totalInputPositions(t, e) {
1222
+ return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), this.value.slice(t, e).length;
1223
+ }
1224
+ doValidate(t) {
1225
+ return this.masked.doValidate(this.currentMaskFlags(t)) && (!this.parent || this.parent.doValidate(this.currentMaskFlags(t)));
1226
+ }
1227
+ doCommit() {
1228
+ this.masked.doCommit();
1229
+ }
1230
+ get state() {
1231
+ return {
1232
+ _value: this.value,
1233
+ _rawInputValue: this.rawInputValue,
1234
+ masked: this.masked.state,
1235
+ isFilled: this.isFilled
1236
+ };
1237
+ }
1238
+ set state(t) {
1239
+ this.masked.state = t.masked, this.isFilled = t.isFilled;
1240
+ }
1241
+ currentMaskFlags(t) {
1242
+ var e;
1243
+ return {
1244
+ ...t,
1245
+ _beforeTailState: (t == null || (e = t._beforeTailState) == null ? void 0 : e.masked) || t?._beforeTailState
1246
+ };
1247
+ }
1248
+ pad(t) {
1249
+ return new c();
1250
+ }
1251
+ }
1252
+ K.DEFAULT_DEFINITIONS = {
1253
+ 0: /\d/,
1254
+ a: /[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
1255
+ // http://stackoverflow.com/a/22075070
1256
+ "*": /./
1257
+ };
1258
+ class Ft extends _ {
1259
+ /** */
1260
+ /** Enable characters overwriting */
1261
+ /** */
1262
+ /** */
1263
+ /** */
1264
+ updateOptions(t) {
1265
+ super.updateOptions(t);
1266
+ }
1267
+ _update(t) {
1268
+ const e = t.mask;
1269
+ e && (t.validate = (s) => s.search(e) >= 0), super._update(t);
1270
+ }
1271
+ }
1272
+ d.MaskedRegExp = Ft;
1273
+ class v extends _ {
1274
+ /** */
1275
+ /** */
1276
+ /** Single char for empty input */
1277
+ /** Single char for filled input */
1278
+ /** Show placeholder only when needed */
1279
+ /** Enable characters overwriting */
1280
+ /** */
1281
+ /** */
1282
+ /** */
1283
+ constructor(t) {
1284
+ super({
1285
+ ...v.DEFAULTS,
1286
+ ...t,
1287
+ definitions: Object.assign({}, K.DEFAULT_DEFINITIONS, t?.definitions)
1288
+ });
1289
+ }
1290
+ updateOptions(t) {
1291
+ super.updateOptions(t);
1292
+ }
1293
+ _update(t) {
1294
+ t.definitions = Object.assign({}, this.definitions, t.definitions), super._update(t), this._rebuildMask();
1295
+ }
1296
+ _rebuildMask() {
1297
+ const t = this.definitions;
1298
+ this._blocks = [], this.exposeBlock = void 0, this._stops = [], this._maskedBlocks = {};
1299
+ const e = this.mask;
1300
+ if (!e || !t) return;
1301
+ let s = !1, i = !1;
1302
+ for (let n = 0; n < e.length; ++n) {
1303
+ if (this.blocks) {
1304
+ const p = e.slice(n), k = Object.keys(this.blocks).filter((g) => p.indexOf(g) === 0);
1305
+ k.sort((g, E) => E.length - g.length);
1306
+ const m = k[0];
1307
+ if (m) {
1308
+ const {
1309
+ expose: g,
1310
+ repeat: E,
1311
+ ...M
1312
+ } = L(this.blocks[m]), F = {
1313
+ lazy: this.lazy,
1314
+ eager: this.eager,
1315
+ placeholderChar: this.placeholderChar,
1316
+ displayChar: this.displayChar,
1317
+ overwrite: this.overwrite,
1318
+ autofix: this.autofix,
1319
+ ...M,
1320
+ repeat: E,
1321
+ parent: this
1322
+ }, b = E != null ? new d.RepeatBlock(
1323
+ F
1324
+ /* TODO */
1325
+ ) : D(F);
1326
+ b && (this._blocks.push(b), g && (this.exposeBlock = b), this._maskedBlocks[m] || (this._maskedBlocks[m] = []), this._maskedBlocks[m].push(this._blocks.length - 1)), n += m.length - 1;
1327
+ continue;
1328
+ }
1329
+ }
1330
+ let a = e[n], r = a in t;
1331
+ if (a === v.STOP_CHAR) {
1332
+ this._stops.push(this._blocks.length);
1333
+ continue;
1334
+ }
1335
+ if (a === "{" || a === "}") {
1336
+ s = !s;
1337
+ continue;
1338
+ }
1339
+ if (a === "[" || a === "]") {
1340
+ i = !i;
1341
+ continue;
1342
+ }
1343
+ if (a === v.ESCAPE_CHAR) {
1344
+ if (++n, a = e[n], !a) break;
1345
+ r = !1;
1346
+ }
1347
+ const l = r ? new K({
1348
+ isOptional: i,
1349
+ lazy: this.lazy,
1350
+ eager: this.eager,
1351
+ placeholderChar: this.placeholderChar,
1352
+ displayChar: this.displayChar,
1353
+ ...L(t[a]),
1354
+ parent: this
1355
+ }) : new ut({
1356
+ char: a,
1357
+ eager: this.eager,
1358
+ isUnmasking: s
1359
+ });
1360
+ this._blocks.push(l);
1361
+ }
1362
+ }
1363
+ get state() {
1364
+ return {
1365
+ ...super.state,
1366
+ _blocks: this._blocks.map((t) => t.state)
1367
+ };
1368
+ }
1369
+ set state(t) {
1370
+ if (!t) {
1371
+ this.reset();
1372
+ return;
1373
+ }
1374
+ const {
1375
+ _blocks: e,
1376
+ ...s
1377
+ } = t;
1378
+ this._blocks.forEach((i, n) => i.state = e[n]), super.state = s;
1379
+ }
1380
+ reset() {
1381
+ super.reset(), this._blocks.forEach((t) => t.reset());
1382
+ }
1383
+ get isComplete() {
1384
+ return this.exposeBlock ? this.exposeBlock.isComplete : this._blocks.every((t) => t.isComplete);
1385
+ }
1386
+ get isFilled() {
1387
+ return this._blocks.every((t) => t.isFilled);
1388
+ }
1389
+ get isFixed() {
1390
+ return this._blocks.every((t) => t.isFixed);
1391
+ }
1392
+ get isOptional() {
1393
+ return this._blocks.every((t) => t.isOptional);
1394
+ }
1395
+ doCommit() {
1396
+ this._blocks.forEach((t) => t.doCommit()), super.doCommit();
1397
+ }
1398
+ get unmaskedValue() {
1399
+ return this.exposeBlock ? this.exposeBlock.unmaskedValue : this._blocks.reduce((t, e) => t += e.unmaskedValue, "");
1400
+ }
1401
+ set unmaskedValue(t) {
1402
+ if (this.exposeBlock) {
1403
+ const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1404
+ this.exposeBlock.unmaskedValue = t, this.appendTail(e), this.doCommit();
1405
+ } else super.unmaskedValue = t;
1406
+ }
1407
+ get value() {
1408
+ return this.exposeBlock ? this.exposeBlock.value : (
1409
+ // TODO return _value when not in change?
1410
+ this._blocks.reduce((t, e) => t += e.value, "")
1411
+ );
1412
+ }
1413
+ set value(t) {
1414
+ if (this.exposeBlock) {
1415
+ const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1416
+ this.exposeBlock.value = t, this.appendTail(e), this.doCommit();
1417
+ } else super.value = t;
1418
+ }
1419
+ get typedValue() {
1420
+ return this.exposeBlock ? this.exposeBlock.typedValue : super.typedValue;
1421
+ }
1422
+ set typedValue(t) {
1423
+ if (this.exposeBlock) {
1424
+ const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1425
+ this.exposeBlock.typedValue = t, this.appendTail(e), this.doCommit();
1426
+ } else super.typedValue = t;
1427
+ }
1428
+ get displayValue() {
1429
+ return this._blocks.reduce((t, e) => t += e.displayValue, "");
1430
+ }
1431
+ appendTail(t) {
1432
+ return super.appendTail(t).aggregate(this._appendPlaceholder());
1433
+ }
1434
+ _appendEager() {
1435
+ var t;
1436
+ const e = new c();
1437
+ let s = (t = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : t.index;
1438
+ if (s == null) return e;
1439
+ this._blocks[s].isFilled && ++s;
1440
+ for (let i = s; i < this._blocks.length; ++i) {
1441
+ const n = this._blocks[i]._appendEager();
1442
+ if (!n.inserted) break;
1443
+ e.aggregate(n);
1444
+ }
1445
+ return e;
1446
+ }
1447
+ _appendCharRaw(t, e) {
1448
+ e === void 0 && (e = {});
1449
+ const s = this._mapPosToBlock(this.displayValue.length), i = new c();
1450
+ if (!s) return i;
1451
+ for (let a = s.index, r; r = this._blocks[a]; ++a) {
1452
+ var n;
1453
+ const l = r._appendChar(t, {
1454
+ ...e,
1455
+ _beforeTailState: (n = e._beforeTailState) == null || (n = n._blocks) == null ? void 0 : n[a]
1456
+ });
1457
+ if (i.aggregate(l), l.consumed) break;
1458
+ }
1459
+ return i;
1460
+ }
1461
+ extractTail(t, e) {
1462
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1463
+ const s = new O();
1464
+ return t === e || this._forEachBlocksInRange(t, e, (i, n, a, r) => {
1465
+ const l = i.extractTail(a, r);
1466
+ l.stop = this._findStopBefore(n), l.from = this._blockStartPos(n), l instanceof O && (l.blockIndex = n), s.extend(l);
1467
+ }), s;
1468
+ }
1469
+ extractInput(t, e, s) {
1470
+ if (t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), s === void 0 && (s = {}), t === e) return "";
1471
+ let i = "";
1472
+ return this._forEachBlocksInRange(t, e, (n, a, r, l) => {
1473
+ i += n.extractInput(r, l, s);
1474
+ }), i;
1475
+ }
1476
+ _findStopBefore(t) {
1477
+ let e;
1478
+ for (let s = 0; s < this._stops.length; ++s) {
1479
+ const i = this._stops[s];
1480
+ if (i <= t) e = i;
1481
+ else break;
1482
+ }
1483
+ return e;
1484
+ }
1485
+ /** Appends placeholder depending on laziness */
1486
+ _appendPlaceholder(t) {
1487
+ const e = new c();
1488
+ if (this.lazy && t == null) return e;
1489
+ const s = this._mapPosToBlock(this.displayValue.length);
1490
+ if (!s) return e;
1491
+ const i = s.index, n = t ?? this._blocks.length;
1492
+ return this._blocks.slice(i, n).forEach((a) => {
1493
+ if (!a.lazy || t != null) {
1494
+ var r;
1495
+ e.aggregate(a._appendPlaceholder((r = a._blocks) == null ? void 0 : r.length));
1496
+ }
1497
+ }), e;
1498
+ }
1499
+ /** Finds block in pos */
1500
+ _mapPosToBlock(t) {
1501
+ let e = "";
1502
+ for (let s = 0; s < this._blocks.length; ++s) {
1503
+ const i = this._blocks[s], n = e.length;
1504
+ if (e += i.displayValue, t <= e.length)
1505
+ return {
1506
+ index: s,
1507
+ offset: t - n
1508
+ };
1509
+ }
1510
+ }
1511
+ _blockStartPos(t) {
1512
+ return this._blocks.slice(0, t).reduce((e, s) => e += s.displayValue.length, 0);
1513
+ }
1514
+ _forEachBlocksInRange(t, e, s) {
1515
+ e === void 0 && (e = this.displayValue.length);
1516
+ const i = this._mapPosToBlock(t);
1517
+ if (i) {
1518
+ const n = this._mapPosToBlock(e), a = n && i.index === n.index, r = i.offset, l = n && a ? n.offset : this._blocks[i.index].displayValue.length;
1519
+ if (s(this._blocks[i.index], i.index, r, l), n && !a) {
1520
+ for (let p = i.index + 1; p < n.index; ++p)
1521
+ s(this._blocks[p], p, 0, this._blocks[p].displayValue.length);
1522
+ s(this._blocks[n.index], n.index, 0, n.offset);
1523
+ }
1524
+ }
1525
+ }
1526
+ remove(t, e) {
1527
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1528
+ const s = super.remove(t, e);
1529
+ return this._forEachBlocksInRange(t, e, (i, n, a, r) => {
1530
+ s.aggregate(i.remove(a, r));
1531
+ }), s;
1532
+ }
1533
+ nearestInputPos(t, e) {
1534
+ if (e === void 0 && (e = o.NONE), !this._blocks.length) return 0;
1535
+ const s = new At(this, t);
1536
+ if (e === o.NONE)
1537
+ return s.pushRightBeforeInput() || (s.popState(), s.pushLeftBeforeInput()) ? s.pos : this.displayValue.length;
1538
+ if (e === o.LEFT || e === o.FORCE_LEFT) {
1539
+ if (e === o.LEFT) {
1540
+ if (s.pushRightBeforeFilled(), s.ok && s.pos === t) return t;
1541
+ s.popState();
1542
+ }
1543
+ if (s.pushLeftBeforeInput(), s.pushLeftBeforeRequired(), s.pushLeftBeforeFilled(), e === o.LEFT) {
1544
+ if (s.pushRightBeforeInput(), s.pushRightBeforeRequired(), s.ok && s.pos <= t || (s.popState(), s.ok && s.pos <= t)) return s.pos;
1545
+ s.popState();
1546
+ }
1547
+ return s.ok ? s.pos : e === o.FORCE_LEFT ? 0 : (s.popState(), s.ok || (s.popState(), s.ok) ? s.pos : 0);
1548
+ }
1549
+ return e === o.RIGHT || e === o.FORCE_RIGHT ? (s.pushRightBeforeInput(), s.pushRightBeforeRequired(), s.pushRightBeforeFilled() ? s.pos : e === o.FORCE_RIGHT ? this.displayValue.length : (s.popState(), s.ok || (s.popState(), s.ok) ? s.pos : this.nearestInputPos(t, o.LEFT))) : t;
1550
+ }
1551
+ totalInputPositions(t, e) {
1552
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1553
+ let s = 0;
1554
+ return this._forEachBlocksInRange(t, e, (i, n, a, r) => {
1555
+ s += i.totalInputPositions(a, r);
1556
+ }), s;
1557
+ }
1558
+ /** Get block by name */
1559
+ maskedBlock(t) {
1560
+ return this.maskedBlocks(t)[0];
1561
+ }
1562
+ /** Get all blocks by name */
1563
+ maskedBlocks(t) {
1564
+ const e = this._maskedBlocks[t];
1565
+ return e ? e.map((s) => this._blocks[s]) : [];
1566
+ }
1567
+ pad(t) {
1568
+ const e = new c();
1569
+ return this._forEachBlocksInRange(0, this.displayValue.length, (s) => e.aggregate(s.pad(t))), e;
1570
+ }
1571
+ }
1572
+ v.DEFAULTS = {
1573
+ ..._.DEFAULTS,
1574
+ lazy: !0,
1575
+ placeholderChar: "_"
1576
+ };
1577
+ v.STOP_CHAR = "`";
1578
+ v.ESCAPE_CHAR = "\\";
1579
+ v.InputDefinition = K;
1580
+ v.FixedDefinition = ut;
1581
+ d.MaskedPattern = v;
1582
+ class j extends v {
1583
+ /**
1584
+ Optionally sets max length of pattern.
1585
+ Used when pattern length is longer then `to` param length. Pads zeros at start in this case.
1586
+ */
1587
+ /** Min bound */
1588
+ /** Max bound */
1589
+ get _matchFrom() {
1590
+ return this.maxLength - String(this.from).length;
1591
+ }
1592
+ constructor(t) {
1593
+ super(t);
1594
+ }
1595
+ updateOptions(t) {
1596
+ super.updateOptions(t);
1597
+ }
1598
+ _update(t) {
1599
+ const {
1600
+ to: e = this.to || 0,
1601
+ from: s = this.from || 0,
1602
+ maxLength: i = this.maxLength || 0,
1603
+ autofix: n = this.autofix,
1604
+ ...a
1605
+ } = t;
1606
+ this.to = e, this.from = s, this.maxLength = Math.max(String(e).length, i), this.autofix = n;
1607
+ const r = String(this.from).padStart(this.maxLength, "0"), l = String(this.to).padStart(this.maxLength, "0");
1608
+ let p = 0;
1609
+ for (; p < l.length && l[p] === r[p]; ) ++p;
1610
+ a.mask = l.slice(0, p).replace(/0/g, "\\0") + "0".repeat(this.maxLength - p), super._update(a);
1611
+ }
1612
+ get isComplete() {
1613
+ return super.isComplete && !!this.value;
1614
+ }
1615
+ boundaries(t) {
1616
+ let e = "", s = "";
1617
+ const [, i, n] = t.match(/^(\D*)(\d*)(\D*)/) || [];
1618
+ return n && (e = "0".repeat(i.length) + n, s = "9".repeat(i.length) + n), e = e.padEnd(this.maxLength, "0"), s = s.padEnd(this.maxLength, "9"), [e, s];
1619
+ }
1620
+ doPrepareChar(t, e) {
1621
+ e === void 0 && (e = {});
1622
+ let s;
1623
+ return [t, s] = super.doPrepareChar(t.replace(/\D/g, ""), e), t || (s.skip = !this.isComplete), [t, s];
1624
+ }
1625
+ _appendCharRaw(t, e) {
1626
+ if (e === void 0 && (e = {}), !this.autofix || this.value.length + 1 > this.maxLength) return super._appendCharRaw(t, e);
1627
+ const s = String(this.from).padStart(this.maxLength, "0"), i = String(this.to).padStart(this.maxLength, "0"), [n, a] = this.boundaries(this.value + t);
1628
+ return Number(a) < this.from ? super._appendCharRaw(s[this.value.length], e) : Number(n) > this.to ? !e.tail && this.autofix === "pad" && this.value.length + 1 < this.maxLength ? super._appendCharRaw(s[this.value.length], e).aggregate(this._appendCharRaw(t, e)) : super._appendCharRaw(i[this.value.length], e) : super._appendCharRaw(t, e);
1629
+ }
1630
+ doValidate(t) {
1631
+ const e = this.value;
1632
+ if (e.search(/[^0]/) === -1 && e.length <= this._matchFrom) return !0;
1633
+ const [i, n] = this.boundaries(e);
1634
+ return this.from <= Number(n) && Number(i) <= this.to && super.doValidate(t);
1635
+ }
1636
+ pad(t) {
1637
+ const e = new c();
1638
+ if (this.value.length === this.maxLength) return e;
1639
+ const s = this.value, i = this.maxLength - this.value.length;
1640
+ if (i) {
1641
+ this.reset();
1642
+ for (let n = 0; n < i; ++n)
1643
+ e.aggregate(super._appendCharRaw("0", t));
1644
+ s.split("").forEach((n) => this._appendCharRaw(n));
1645
+ }
1646
+ return e;
1647
+ }
1648
+ }
1649
+ d.MaskedRange = j;
1650
+ const xt = "d{.}`m{.}`Y";
1651
+ class I extends v {
1652
+ static extractPatternOptions(t) {
1653
+ const {
1654
+ mask: e,
1655
+ pattern: s,
1656
+ ...i
1657
+ } = t;
1658
+ return {
1659
+ ...i,
1660
+ mask: T(e) ? e : s
1661
+ };
1662
+ }
1663
+ /** Pattern mask for date according to {@link MaskedDate#format} */
1664
+ /** Start date */
1665
+ /** End date */
1666
+ /** Format typed value to string */
1667
+ /** Parse string to get typed value */
1668
+ constructor(t) {
1669
+ super(I.extractPatternOptions({
1670
+ ...I.DEFAULTS,
1671
+ ...t
1672
+ }));
1673
+ }
1674
+ updateOptions(t) {
1675
+ super.updateOptions(t);
1676
+ }
1677
+ _update(t) {
1678
+ const {
1679
+ mask: e,
1680
+ pattern: s,
1681
+ blocks: i,
1682
+ ...n
1683
+ } = {
1684
+ ...I.DEFAULTS,
1685
+ ...t
1686
+ }, a = Object.assign({}, I.GET_DEFAULT_BLOCKS());
1687
+ t.min && (a.Y.from = t.min.getFullYear()), t.max && (a.Y.to = t.max.getFullYear()), t.min && t.max && a.Y.from === a.Y.to && (a.m.from = t.min.getMonth() + 1, a.m.to = t.max.getMonth() + 1, a.m.from === a.m.to && (a.d.from = t.min.getDate(), a.d.to = t.max.getDate())), Object.assign(a, this.blocks, i), super._update({
1688
+ ...n,
1689
+ mask: T(e) ? e : s,
1690
+ blocks: a
1691
+ });
1692
+ }
1693
+ doValidate(t) {
1694
+ const e = this.date;
1695
+ return super.doValidate(t) && (!this.isComplete || this.isDateExist(this.value) && e != null && (this.min == null || this.min <= e) && (this.max == null || e <= this.max));
1696
+ }
1697
+ /** Checks if date is exists */
1698
+ isDateExist(t) {
1699
+ return this.format(this.parse(t, this), this).indexOf(t) >= 0;
1700
+ }
1701
+ /** Parsed Date */
1702
+ get date() {
1703
+ return this.typedValue;
1704
+ }
1705
+ set date(t) {
1706
+ this.typedValue = t;
1707
+ }
1708
+ get typedValue() {
1709
+ return this.isComplete ? super.typedValue : null;
1710
+ }
1711
+ set typedValue(t) {
1712
+ super.typedValue = t;
1713
+ }
1714
+ maskEquals(t) {
1715
+ return t === Date || super.maskEquals(t);
1716
+ }
1717
+ optionsIsChanged(t) {
1718
+ return super.optionsIsChanged(I.extractPatternOptions(t));
1719
+ }
1720
+ }
1721
+ I.GET_DEFAULT_BLOCKS = () => ({
1722
+ d: {
1723
+ mask: j,
1724
+ from: 1,
1725
+ to: 31,
1726
+ maxLength: 2
1727
+ },
1728
+ m: {
1729
+ mask: j,
1730
+ from: 1,
1731
+ to: 12,
1732
+ maxLength: 2
1733
+ },
1734
+ Y: {
1735
+ mask: j,
1736
+ from: 1900,
1737
+ to: 9999
1738
+ }
1739
+ });
1740
+ I.DEFAULTS = {
1741
+ ...v.DEFAULTS,
1742
+ mask: Date,
1743
+ pattern: xt,
1744
+ format: (u, t) => {
1745
+ if (!u) return "";
1746
+ const e = String(u.getDate()).padStart(2, "0"), s = String(u.getMonth() + 1).padStart(2, "0"), i = u.getFullYear();
1747
+ return [e, s, i].join(".");
1748
+ },
1749
+ parse: (u, t) => {
1750
+ const [e, s, i] = u.split(".").map(Number);
1751
+ return new Date(i, s - 1, e);
1752
+ }
1753
+ };
1754
+ d.MaskedDate = I;
1755
+ class q extends _ {
1756
+ constructor(t) {
1757
+ super({
1758
+ ...q.DEFAULTS,
1759
+ ...t
1760
+ }), this.currentMask = void 0;
1761
+ }
1762
+ updateOptions(t) {
1763
+ super.updateOptions(t);
1764
+ }
1765
+ _update(t) {
1766
+ super._update(t), "mask" in t && (this.exposeMask = void 0, this.compiledMasks = Array.isArray(t.mask) ? t.mask.map((e) => {
1767
+ const {
1768
+ expose: s,
1769
+ ...i
1770
+ } = L(e), n = D({
1771
+ overwrite: this._overwrite,
1772
+ eager: this._eager,
1773
+ skipInvalid: this._skipInvalid,
1774
+ ...i
1775
+ });
1776
+ return s && (this.exposeMask = n), n;
1777
+ }) : []);
1778
+ }
1779
+ _appendCharRaw(t, e) {
1780
+ e === void 0 && (e = {});
1781
+ const s = this._applyDispatch(t, e);
1782
+ return this.currentMask && s.aggregate(this.currentMask._appendChar(t, this.currentMaskFlags(e))), s;
1783
+ }
1784
+ _applyDispatch(t, e, s) {
1785
+ t === void 0 && (t = ""), e === void 0 && (e = {}), s === void 0 && (s = "");
1786
+ const i = e.tail && e._beforeTailState != null ? e._beforeTailState._value : this.value, n = this.rawInputValue, a = e.tail && e._beforeTailState != null ? e._beforeTailState._rawInputValue : n, r = n.slice(a.length), l = this.currentMask, p = new c(), k = l?.state;
1787
+ return this.currentMask = this.doDispatch(t, {
1788
+ ...e
1789
+ }, s), this.currentMask && (this.currentMask !== l ? (this.currentMask.reset(), a && (this.currentMask.append(a, {
1790
+ raw: !0
1791
+ }), p.tailShift = this.currentMask.value.length - i.length), r && (p.tailShift += this.currentMask.append(r, {
1792
+ raw: !0,
1793
+ tail: !0
1794
+ }).tailShift)) : k && (this.currentMask.state = k)), p;
1795
+ }
1796
+ _appendPlaceholder() {
1797
+ const t = this._applyDispatch();
1798
+ return this.currentMask && t.aggregate(this.currentMask._appendPlaceholder()), t;
1799
+ }
1800
+ _appendEager() {
1801
+ const t = this._applyDispatch();
1802
+ return this.currentMask && t.aggregate(this.currentMask._appendEager()), t;
1803
+ }
1804
+ appendTail(t) {
1805
+ const e = new c();
1806
+ return t && e.aggregate(this._applyDispatch("", {}, t)), e.aggregate(this.currentMask ? this.currentMask.appendTail(t) : super.appendTail(t));
1807
+ }
1808
+ currentMaskFlags(t) {
1809
+ var e, s;
1810
+ return {
1811
+ ...t,
1812
+ _beforeTailState: ((e = t._beforeTailState) == null ? void 0 : e.currentMaskRef) === this.currentMask && ((s = t._beforeTailState) == null ? void 0 : s.currentMask) || t._beforeTailState
1813
+ };
1814
+ }
1815
+ doDispatch(t, e, s) {
1816
+ return e === void 0 && (e = {}), s === void 0 && (s = ""), this.dispatch(t, this, e, s);
1817
+ }
1818
+ doValidate(t) {
1819
+ return super.doValidate(t) && (!this.currentMask || this.currentMask.doValidate(this.currentMaskFlags(t)));
1820
+ }
1821
+ doPrepare(t, e) {
1822
+ e === void 0 && (e = {});
1823
+ let [s, i] = super.doPrepare(t, e);
1824
+ if (this.currentMask) {
1825
+ let n;
1826
+ [s, n] = super.doPrepare(s, this.currentMaskFlags(e)), i = i.aggregate(n);
1827
+ }
1828
+ return [s, i];
1829
+ }
1830
+ doPrepareChar(t, e) {
1831
+ e === void 0 && (e = {});
1832
+ let [s, i] = super.doPrepareChar(t, e);
1833
+ if (this.currentMask) {
1834
+ let n;
1835
+ [s, n] = super.doPrepareChar(s, this.currentMaskFlags(e)), i = i.aggregate(n);
1836
+ }
1837
+ return [s, i];
1838
+ }
1839
+ reset() {
1840
+ var t;
1841
+ (t = this.currentMask) == null || t.reset(), this.compiledMasks.forEach((e) => e.reset());
1842
+ }
1843
+ get value() {
1844
+ return this.exposeMask ? this.exposeMask.value : this.currentMask ? this.currentMask.value : "";
1845
+ }
1846
+ set value(t) {
1847
+ this.exposeMask ? (this.exposeMask.value = t, this.currentMask = this.exposeMask, this._applyDispatch()) : super.value = t;
1848
+ }
1849
+ get unmaskedValue() {
1850
+ return this.exposeMask ? this.exposeMask.unmaskedValue : this.currentMask ? this.currentMask.unmaskedValue : "";
1851
+ }
1852
+ set unmaskedValue(t) {
1853
+ this.exposeMask ? (this.exposeMask.unmaskedValue = t, this.currentMask = this.exposeMask, this._applyDispatch()) : super.unmaskedValue = t;
1854
+ }
1855
+ get typedValue() {
1856
+ return this.exposeMask ? this.exposeMask.typedValue : this.currentMask ? this.currentMask.typedValue : "";
1857
+ }
1858
+ set typedValue(t) {
1859
+ if (this.exposeMask) {
1860
+ this.exposeMask.typedValue = t, this.currentMask = this.exposeMask, this._applyDispatch();
1861
+ return;
1862
+ }
1863
+ let e = String(t);
1864
+ this.currentMask && (this.currentMask.typedValue = t, e = this.currentMask.unmaskedValue), this.unmaskedValue = e;
1865
+ }
1866
+ get displayValue() {
1867
+ return this.currentMask ? this.currentMask.displayValue : "";
1868
+ }
1869
+ get isComplete() {
1870
+ var t;
1871
+ return !!((t = this.currentMask) != null && t.isComplete);
1872
+ }
1873
+ get isFilled() {
1874
+ var t;
1875
+ return !!((t = this.currentMask) != null && t.isFilled);
1876
+ }
1877
+ remove(t, e) {
1878
+ const s = new c();
1879
+ return this.currentMask && s.aggregate(this.currentMask.remove(t, e)).aggregate(this._applyDispatch()), s;
1880
+ }
1881
+ get state() {
1882
+ var t;
1883
+ return {
1884
+ ...super.state,
1885
+ _rawInputValue: this.rawInputValue,
1886
+ compiledMasks: this.compiledMasks.map((e) => e.state),
1887
+ currentMaskRef: this.currentMask,
1888
+ currentMask: (t = this.currentMask) == null ? void 0 : t.state
1889
+ };
1890
+ }
1891
+ set state(t) {
1892
+ const {
1893
+ compiledMasks: e,
1894
+ currentMaskRef: s,
1895
+ currentMask: i,
1896
+ ...n
1897
+ } = t;
1898
+ e && this.compiledMasks.forEach((a, r) => a.state = e[r]), s != null && (this.currentMask = s, this.currentMask.state = i), super.state = n;
1899
+ }
1900
+ extractInput(t, e, s) {
1901
+ return this.currentMask ? this.currentMask.extractInput(t, e, s) : "";
1902
+ }
1903
+ extractTail(t, e) {
1904
+ return this.currentMask ? this.currentMask.extractTail(t, e) : super.extractTail(t, e);
1905
+ }
1906
+ doCommit() {
1907
+ this.currentMask && this.currentMask.doCommit(), super.doCommit();
1908
+ }
1909
+ nearestInputPos(t, e) {
1910
+ return this.currentMask ? this.currentMask.nearestInputPos(t, e) : super.nearestInputPos(t, e);
1911
+ }
1912
+ get overwrite() {
1913
+ return this.currentMask ? this.currentMask.overwrite : this._overwrite;
1914
+ }
1915
+ set overwrite(t) {
1916
+ this._overwrite = t;
1917
+ }
1918
+ get eager() {
1919
+ return this.currentMask ? this.currentMask.eager : this._eager;
1920
+ }
1921
+ set eager(t) {
1922
+ this._eager = t;
1923
+ }
1924
+ get skipInvalid() {
1925
+ return this.currentMask ? this.currentMask.skipInvalid : this._skipInvalid;
1926
+ }
1927
+ set skipInvalid(t) {
1928
+ this._skipInvalid = t;
1929
+ }
1930
+ get autofix() {
1931
+ return this.currentMask ? this.currentMask.autofix : this._autofix;
1932
+ }
1933
+ set autofix(t) {
1934
+ this._autofix = t;
1935
+ }
1936
+ maskEquals(t) {
1937
+ return Array.isArray(t) ? this.compiledMasks.every((e, s) => {
1938
+ if (!t[s]) return;
1939
+ const {
1940
+ mask: i,
1941
+ ...n
1942
+ } = t[s];
1943
+ return H(e, n) && e.maskEquals(i);
1944
+ }) : super.maskEquals(t);
1945
+ }
1946
+ typedValueEquals(t) {
1947
+ var e;
1948
+ return !!((e = this.currentMask) != null && e.typedValueEquals(t));
1949
+ }
1950
+ }
1951
+ q.DEFAULTS = {
1952
+ ..._.DEFAULTS,
1953
+ dispatch: (u, t, e, s) => {
1954
+ if (!t.compiledMasks.length) return;
1955
+ const i = t.rawInputValue, n = t.compiledMasks.map((a, r) => {
1956
+ const l = t.currentMask === a, p = l ? a.displayValue.length : a.nearestInputPos(a.displayValue.length, o.FORCE_LEFT);
1957
+ return a.rawInputValue !== i ? (a.reset(), a.append(i, {
1958
+ raw: !0
1959
+ })) : l || a.remove(p), a.append(u, t.currentMaskFlags(e)), a.appendTail(s), {
1960
+ index: r,
1961
+ weight: a.rawInputValue.length,
1962
+ totalInputPositions: a.totalInputPositions(0, Math.max(p, a.nearestInputPos(a.displayValue.length, o.FORCE_LEFT)))
1963
+ };
1964
+ });
1965
+ return n.sort((a, r) => r.weight - a.weight || r.totalInputPositions - a.totalInputPositions), t.compiledMasks[n[0].index];
1966
+ }
1967
+ };
1968
+ d.MaskedDynamic = q;
1969
+ class Y extends v {
1970
+ constructor(t) {
1971
+ super({
1972
+ ...Y.DEFAULTS,
1973
+ ...t
1974
+ });
1975
+ }
1976
+ updateOptions(t) {
1977
+ super.updateOptions(t);
1978
+ }
1979
+ _update(t) {
1980
+ const {
1981
+ enum: e,
1982
+ ...s
1983
+ } = t;
1984
+ if (e) {
1985
+ const i = e.map((r) => r.length), n = Math.min(...i), a = Math.max(...i) - n;
1986
+ s.mask = "*".repeat(n), a && (s.mask += "[" + "*".repeat(a) + "]"), this.enum = e;
1987
+ }
1988
+ super._update(s);
1989
+ }
1990
+ _appendCharRaw(t, e) {
1991
+ e === void 0 && (e = {});
1992
+ const s = Math.min(this.nearestInputPos(0, o.FORCE_RIGHT), this.value.length), i = this.enum.filter((n) => this.matchValue(n, this.unmaskedValue + t, s));
1993
+ if (i.length) {
1994
+ i.length === 1 && this._forEachBlocksInRange(0, this.value.length, (a, r) => {
1995
+ const l = i[0][r];
1996
+ r >= this.value.length || l === a.value || (a.reset(), a._appendChar(l, e));
1997
+ });
1998
+ const n = super._appendCharRaw(i[0][this.value.length], e);
1999
+ return i.length === 1 && i[0].slice(this.unmaskedValue.length).split("").forEach((a) => n.aggregate(super._appendCharRaw(a))), n;
2000
+ }
2001
+ return new c({
2002
+ skip: !this.isComplete
2003
+ });
2004
+ }
2005
+ extractTail(t, e) {
2006
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), new B("", t);
2007
+ }
2008
+ remove(t, e) {
2009
+ if (t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), t === e) return new c();
2010
+ const s = Math.min(super.nearestInputPos(0, o.FORCE_RIGHT), this.value.length);
2011
+ let i;
2012
+ for (i = t; i >= 0 && !(this.enum.filter((r) => this.matchValue(r, this.value.slice(s, i), s)).length > 1); --i)
2013
+ ;
2014
+ const n = super.remove(i, e);
2015
+ return n.tailShift += i - t, n;
2016
+ }
2017
+ get isComplete() {
2018
+ return this.enum.indexOf(this.value) >= 0;
2019
+ }
2020
+ }
2021
+ Y.DEFAULTS = {
2022
+ ...v.DEFAULTS,
2023
+ matchValue: (u, t, e) => u.indexOf(t, e) === e
2024
+ };
2025
+ d.MaskedEnum = Y;
2026
+ class yt extends _ {
2027
+ /** */
2028
+ /** Enable characters overwriting */
2029
+ /** */
2030
+ /** */
2031
+ /** */
2032
+ updateOptions(t) {
2033
+ super.updateOptions(t);
2034
+ }
2035
+ _update(t) {
2036
+ super._update({
2037
+ ...t,
2038
+ validate: t.mask
2039
+ });
2040
+ }
2041
+ }
2042
+ d.MaskedFunction = yt;
2043
+ var rt;
2044
+ class A extends _ {
2045
+ /** Single char */
2046
+ /** Single char */
2047
+ /** Array of single chars */
2048
+ /** */
2049
+ /** */
2050
+ /** Digits after point */
2051
+ /** Flag to remove leading and trailing zeros in the end of editing */
2052
+ /** Flag to pad trailing zeros after point in the end of editing */
2053
+ /** Enable characters overwriting */
2054
+ /** */
2055
+ /** */
2056
+ /** */
2057
+ /** Format typed value to string */
2058
+ /** Parse string to get typed value */
2059
+ constructor(t) {
2060
+ super({
2061
+ ...A.DEFAULTS,
2062
+ ...t
2063
+ });
2064
+ }
2065
+ updateOptions(t) {
2066
+ super.updateOptions(t);
2067
+ }
2068
+ _update(t) {
2069
+ super._update(t), this._updateRegExps();
2070
+ }
2071
+ _updateRegExps() {
2072
+ const t = "^" + (this.allowNegative ? "[+|\\-]?" : ""), e = "\\d*", s = (this.scale ? "(" + $(this.radix) + "\\d{0," + this.scale + "})?" : "") + "$";
2073
+ this._numberRegExp = new RegExp(t + e + s), this._mapToRadixRegExp = new RegExp("[" + this.mapToRadix.map($).join("") + "]", "g"), this._thousandsSeparatorRegExp = new RegExp($(this.thousandsSeparator), "g");
2074
+ }
2075
+ _removeThousandsSeparators(t) {
2076
+ return t.replace(this._thousandsSeparatorRegExp, "");
2077
+ }
2078
+ _insertThousandsSeparators(t) {
2079
+ const e = t.split(this.radix);
2080
+ return e[0] = e[0].replace(/\B(?=(\d{3})+(?!\d))/g, this.thousandsSeparator), e.join(this.radix);
2081
+ }
2082
+ doPrepareChar(t, e) {
2083
+ e === void 0 && (e = {});
2084
+ const [s, i] = super.doPrepareChar(this._removeThousandsSeparators(this.scale && this.mapToRadix.length && /*
2085
+ radix should be mapped when
2086
+ 1) input is done from keyboard = flags.input && flags.raw
2087
+ 2) unmasked value is set = !flags.input && !flags.raw
2088
+ and should not be mapped when
2089
+ 1) value is set = flags.input && !flags.raw
2090
+ 2) raw value is set = !flags.input && flags.raw
2091
+ */
2092
+ (e.input && e.raw || !e.input && !e.raw) ? t.replace(this._mapToRadixRegExp, this.radix) : t), e);
2093
+ return t && !s && (i.skip = !0), s && !this.allowPositive && !this.value && s !== "-" && i.aggregate(this._appendChar("-")), [s, i];
2094
+ }
2095
+ _separatorsCount(t, e) {
2096
+ e === void 0 && (e = !1);
2097
+ let s = 0;
2098
+ for (let i = 0; i < t; ++i)
2099
+ this._value.indexOf(this.thousandsSeparator, i) === i && (++s, e && (t += this.thousandsSeparator.length));
2100
+ return s;
2101
+ }
2102
+ _separatorsCountFromSlice(t) {
2103
+ return t === void 0 && (t = this._value), this._separatorsCount(this._removeThousandsSeparators(t).length, !0);
2104
+ }
2105
+ extractInput(t, e, s) {
2106
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), [t, e] = this._adjustRangeWithSeparators(t, e), this._removeThousandsSeparators(super.extractInput(t, e, s));
2107
+ }
2108
+ _appendCharRaw(t, e) {
2109
+ e === void 0 && (e = {});
2110
+ const s = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, i = this._separatorsCountFromSlice(s);
2111
+ this._value = this._removeThousandsSeparators(this.value);
2112
+ const n = this._value;
2113
+ this._value += t;
2114
+ const a = this.number;
2115
+ let r = !isNaN(a), l = !1;
2116
+ if (r) {
2117
+ let g;
2118
+ this.min != null && this.min < 0 && this.number < this.min && (g = this.min), this.max != null && this.max > 0 && this.number > this.max && (g = this.max), g != null && (this.autofix ? (this._value = this.format(g, this).replace(A.UNMASKED_RADIX, this.radix), l || (l = n === this._value && !e.tail)) : r = !1), r && (r = !!this._value.match(this._numberRegExp));
2119
+ }
2120
+ let p;
2121
+ r ? p = new c({
2122
+ inserted: this._value.slice(n.length),
2123
+ rawInserted: l ? "" : t,
2124
+ skip: l
2125
+ }) : (this._value = n, p = new c()), this._value = this._insertThousandsSeparators(this._value);
2126
+ const k = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, m = this._separatorsCountFromSlice(k);
2127
+ return p.tailShift += (m - i) * this.thousandsSeparator.length, p;
2128
+ }
2129
+ _findSeparatorAround(t) {
2130
+ if (this.thousandsSeparator) {
2131
+ const e = t - this.thousandsSeparator.length + 1, s = this.value.indexOf(this.thousandsSeparator, e);
2132
+ if (s <= t) return s;
2133
+ }
2134
+ return -1;
2135
+ }
2136
+ _adjustRangeWithSeparators(t, e) {
2137
+ const s = this._findSeparatorAround(t);
2138
+ s >= 0 && (t = s);
2139
+ const i = this._findSeparatorAround(e);
2140
+ return i >= 0 && (e = i + this.thousandsSeparator.length), [t, e];
2141
+ }
2142
+ remove(t, e) {
2143
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), [t, e] = this._adjustRangeWithSeparators(t, e);
2144
+ const s = this.value.slice(0, t), i = this.value.slice(e), n = this._separatorsCount(s.length);
2145
+ this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(s + i));
2146
+ const a = this._separatorsCountFromSlice(s);
2147
+ return new c({
2148
+ tailShift: (a - n) * this.thousandsSeparator.length
2149
+ });
2150
+ }
2151
+ nearestInputPos(t, e) {
2152
+ if (!this.thousandsSeparator) return t;
2153
+ switch (e) {
2154
+ case o.NONE:
2155
+ case o.LEFT:
2156
+ case o.FORCE_LEFT: {
2157
+ const s = this._findSeparatorAround(t - 1);
2158
+ if (s >= 0) {
2159
+ const i = s + this.thousandsSeparator.length;
2160
+ if (t < i || this.value.length <= i || e === o.FORCE_LEFT)
2161
+ return s;
2162
+ }
2163
+ break;
2164
+ }
2165
+ case o.RIGHT:
2166
+ case o.FORCE_RIGHT: {
2167
+ const s = this._findSeparatorAround(t);
2168
+ if (s >= 0)
2169
+ return s + this.thousandsSeparator.length;
2170
+ }
2171
+ }
2172
+ return t;
2173
+ }
2174
+ doCommit() {
2175
+ if (this.value) {
2176
+ const t = this.number;
2177
+ let e = t;
2178
+ this.min != null && (e = Math.max(e, this.min)), this.max != null && (e = Math.min(e, this.max)), e !== t && (this.unmaskedValue = this.format(e, this));
2179
+ let s = this.value;
2180
+ this.normalizeZeros && (s = this._normalizeZeros(s)), this.padFractionalZeros && this.scale > 0 && (s = this._padFractionalZeros(s)), this._value = s;
2181
+ }
2182
+ super.doCommit();
2183
+ }
2184
+ _normalizeZeros(t) {
2185
+ const e = this._removeThousandsSeparators(t).split(this.radix);
2186
+ return e[0] = e[0].replace(/^(\D*)(0*)(\d*)/, (s, i, n, a) => i + a), t.length && !/\d$/.test(e[0]) && (e[0] = e[0] + "0"), e.length > 1 && (e[1] = e[1].replace(/0*$/, ""), e[1].length || (e.length = 1)), this._insertThousandsSeparators(e.join(this.radix));
2187
+ }
2188
+ _padFractionalZeros(t) {
2189
+ if (!t) return t;
2190
+ const e = t.split(this.radix);
2191
+ return e.length < 2 && e.push(""), e[1] = e[1].padEnd(this.scale, "0"), e.join(this.radix);
2192
+ }
2193
+ doSkipInvalid(t, e, s) {
2194
+ e === void 0 && (e = {});
2195
+ const i = this.scale === 0 && t !== this.thousandsSeparator && (t === this.radix || t === A.UNMASKED_RADIX || this.mapToRadix.includes(t));
2196
+ return super.doSkipInvalid(t, e, s) && !i;
2197
+ }
2198
+ get unmaskedValue() {
2199
+ return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix, A.UNMASKED_RADIX);
2200
+ }
2201
+ set unmaskedValue(t) {
2202
+ super.unmaskedValue = t;
2203
+ }
2204
+ get typedValue() {
2205
+ return this.parse(this.unmaskedValue, this);
2206
+ }
2207
+ set typedValue(t) {
2208
+ this.rawInputValue = this.format(t, this).replace(A.UNMASKED_RADIX, this.radix);
2209
+ }
2210
+ /** Parsed Number */
2211
+ get number() {
2212
+ return this.typedValue;
2213
+ }
2214
+ set number(t) {
2215
+ this.typedValue = t;
2216
+ }
2217
+ get allowNegative() {
2218
+ return this.min != null && this.min < 0 || this.max != null && this.max < 0;
2219
+ }
2220
+ get allowPositive() {
2221
+ return this.min != null && this.min > 0 || this.max != null && this.max > 0;
2222
+ }
2223
+ typedValueEquals(t) {
2224
+ return (super.typedValueEquals(t) || A.EMPTY_VALUES.includes(t) && A.EMPTY_VALUES.includes(this.typedValue)) && !(t === 0 && this.value === "");
2225
+ }
2226
+ }
2227
+ rt = A;
2228
+ A.UNMASKED_RADIX = ".";
2229
+ A.EMPTY_VALUES = [..._.EMPTY_VALUES, 0];
2230
+ A.DEFAULTS = {
2231
+ ..._.DEFAULTS,
2232
+ mask: Number,
2233
+ radix: ",",
2234
+ thousandsSeparator: "",
2235
+ mapToRadix: [rt.UNMASKED_RADIX],
2236
+ min: Number.MIN_SAFE_INTEGER,
2237
+ max: Number.MAX_SAFE_INTEGER,
2238
+ scale: 2,
2239
+ normalizeZeros: !0,
2240
+ padFractionalZeros: !1,
2241
+ parse: Number,
2242
+ format: (u) => u.toLocaleString("en-US", {
2243
+ useGrouping: !1,
2244
+ maximumFractionDigits: 20
2245
+ })
2246
+ };
2247
+ d.MaskedNumber = A;
2248
+ const X = {
2249
+ MASKED: "value",
2250
+ UNMASKED: "unmaskedValue",
2251
+ TYPED: "typedValue"
2252
+ };
2253
+ function lt(u, t, e) {
2254
+ t === void 0 && (t = X.MASKED), e === void 0 && (e = X.MASKED);
2255
+ const s = D(u);
2256
+ return (i) => s.runIsolated((n) => (n[t] = i, n[e]));
2257
+ }
2258
+ function St(u, t, e, s) {
2259
+ return lt(t, e, s)(u);
2260
+ }
2261
+ d.PIPE_TYPE = X;
2262
+ d.createPipe = lt;
2263
+ d.pipe = St;
2264
+ class Vt extends v {
2265
+ get repeatFrom() {
2266
+ var t;
2267
+ return (t = Array.isArray(this.repeat) ? this.repeat[0] : this.repeat === 1 / 0 ? 0 : this.repeat) != null ? t : 0;
2268
+ }
2269
+ get repeatTo() {
2270
+ var t;
2271
+ return (t = Array.isArray(this.repeat) ? this.repeat[1] : this.repeat) != null ? t : 1 / 0;
2272
+ }
2273
+ constructor(t) {
2274
+ super(t);
2275
+ }
2276
+ updateOptions(t) {
2277
+ super.updateOptions(t);
2278
+ }
2279
+ _update(t) {
2280
+ var e, s, i;
2281
+ const {
2282
+ repeat: n,
2283
+ ...a
2284
+ } = L(t);
2285
+ this._blockOpts = Object.assign({}, this._blockOpts, a);
2286
+ const r = D(this._blockOpts);
2287
+ this.repeat = (e = (s = n ?? r.repeat) != null ? s : this.repeat) != null ? e : 1 / 0, super._update({
2288
+ mask: "m".repeat(Math.max(this.repeatTo === 1 / 0 && ((i = this._blocks) == null ? void 0 : i.length) || 0, this.repeatFrom)),
2289
+ blocks: {
2290
+ m: r
2291
+ },
2292
+ eager: r.eager,
2293
+ overwrite: r.overwrite,
2294
+ skipInvalid: r.skipInvalid,
2295
+ lazy: r.lazy,
2296
+ placeholderChar: r.placeholderChar,
2297
+ displayChar: r.displayChar
2298
+ });
2299
+ }
2300
+ _allocateBlock(t) {
2301
+ if (t < this._blocks.length) return this._blocks[t];
2302
+ if (this.repeatTo === 1 / 0 || this._blocks.length < this.repeatTo)
2303
+ return this._blocks.push(D(this._blockOpts)), this.mask += "m", this._blocks[this._blocks.length - 1];
2304
+ }
2305
+ _appendCharRaw(t, e) {
2306
+ e === void 0 && (e = {});
2307
+ const s = new c();
2308
+ for (
2309
+ let l = (i = (n = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : n.index) != null ? i : Math.max(this._blocks.length - 1, 0), p, k;
2310
+ // try to get a block or
2311
+ // try to allocate a new block if not allocated already
2312
+ p = (a = this._blocks[l]) != null ? a : k = !k && this._allocateBlock(l);
2313
+ ++l
2314
+ ) {
2315
+ var i, n, a, r;
2316
+ const m = p._appendChar(t, {
2317
+ ...e,
2318
+ _beforeTailState: (r = e._beforeTailState) == null || (r = r._blocks) == null ? void 0 : r[l]
2319
+ });
2320
+ if (m.skip && k) {
2321
+ this._blocks.pop(), this.mask = this.mask.slice(1);
2322
+ break;
2323
+ }
2324
+ if (s.aggregate(m), m.consumed) break;
2325
+ }
2326
+ return s;
2327
+ }
2328
+ _trimEmptyTail(t, e) {
2329
+ var s, i;
2330
+ t === void 0 && (t = 0);
2331
+ const n = Math.max(((s = this._mapPosToBlock(t)) == null ? void 0 : s.index) || 0, this.repeatFrom, 0);
2332
+ let a;
2333
+ e != null && (a = (i = this._mapPosToBlock(e)) == null ? void 0 : i.index), a == null && (a = this._blocks.length - 1);
2334
+ let r = 0;
2335
+ for (let l = a; n <= l && !this._blocks[l].unmaskedValue; --l, ++r)
2336
+ ;
2337
+ r && (this._blocks.splice(a - r + 1, r), this.mask = this.mask.slice(r));
2338
+ }
2339
+ reset() {
2340
+ super.reset(), this._trimEmptyTail();
2341
+ }
2342
+ remove(t, e) {
2343
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
2344
+ const s = super.remove(t, e);
2345
+ return this._trimEmptyTail(t, e), s;
2346
+ }
2347
+ totalInputPositions(t, e) {
2348
+ return t === void 0 && (t = 0), e == null && this.repeatTo === 1 / 0 ? 1 / 0 : super.totalInputPositions(t, e);
2349
+ }
2350
+ get state() {
2351
+ return super.state;
2352
+ }
2353
+ set state(t) {
2354
+ this._blocks.length = t._blocks.length, this.mask = this.mask.slice(0, this._blocks.length), super.state = t;
2355
+ }
2356
+ }
2357
+ d.RepeatBlock = Vt;
2358
+ try {
2359
+ globalThis.IMask = d;
2360
+ } catch {
2361
+ }
2362
+ const ht = {
2363
+ // common
2364
+ mask: h.oneOfType([h.array, h.func, h.string, h.instanceOf(RegExp), h.oneOf([Date, Number, d.Masked]), h.instanceOf(d.Masked)]),
2365
+ value: h.any,
2366
+ unmask: h.oneOfType([h.bool, h.oneOf(["typed"])]),
2367
+ prepare: h.func,
2368
+ prepareChar: h.func,
2369
+ validate: h.func,
2370
+ commit: h.func,
2371
+ overwrite: h.oneOfType([h.bool, h.oneOf(["shift"])]),
2372
+ eager: h.oneOfType([h.bool, h.oneOf(["append", "remove"])]),
2373
+ skipInvalid: h.bool,
2374
+ // events
2375
+ onAccept: h.func,
2376
+ onComplete: h.func,
2377
+ // pattern
2378
+ placeholderChar: h.string,
2379
+ displayChar: h.string,
2380
+ lazy: h.bool,
2381
+ definitions: h.object,
2382
+ blocks: h.object,
2383
+ // enum
2384
+ enum: h.arrayOf(h.string),
2385
+ // range
2386
+ maxLength: h.number,
2387
+ from: h.number,
2388
+ to: h.number,
2389
+ // date
2390
+ pattern: h.string,
2391
+ format: h.func,
2392
+ parse: h.func,
2393
+ autofix: h.oneOfType([h.bool, h.oneOf(["pad"])]),
2394
+ // number
2395
+ radix: h.string,
2396
+ thousandsSeparator: h.string,
2397
+ mapToRadix: h.arrayOf(h.string),
2398
+ scale: h.number,
2399
+ normalizeZeros: h.bool,
2400
+ padFractionalZeros: h.bool,
2401
+ min: h.oneOfType([h.number, h.instanceOf(Date)]),
2402
+ max: h.oneOfType([h.number, h.instanceOf(Date)]),
2403
+ // dynamic
2404
+ dispatch: h.func,
2405
+ // ref
2406
+ inputRef: h.oneOfType([h.func, h.shape({
2407
+ current: h.object
2408
+ })])
2409
+ }, ot = Object.keys(ht).filter((u) => u !== "value"), Bt = ["value", "unmask", "onAccept", "onComplete", "inputRef"], bt = ot.filter((u) => Bt.indexOf(u) < 0);
2410
+ function It(u) {
2411
+ var t;
2412
+ const e = (t = class extends R.Component {
2413
+ constructor(n) {
2414
+ super(n), this._inputRef = this._inputRef.bind(this);
2415
+ }
2416
+ componentDidMount() {
2417
+ this.props.mask && this.initMask();
2418
+ }
2419
+ componentDidUpdate() {
2420
+ const n = this.props, a = this._extractMaskOptionsFromProps(n);
2421
+ if (a.mask)
2422
+ this.maskRef ? (this.maskRef.updateOptions(a), "value" in n && n.value !== void 0 && (this.maskValue = n.value)) : this.initMask(a);
2423
+ else if (this.destroyMask(), "value" in n && n.value !== void 0) {
2424
+ var r;
2425
+ (r = this.element) != null && r.isContentEditable && this.element.tagName !== "INPUT" && this.element.tagName !== "TEXTAREA" ? this.element.textContent = n.value : this.element.value = n.value;
2426
+ }
2427
+ }
2428
+ componentWillUnmount() {
2429
+ this.destroyMask();
2430
+ }
2431
+ _inputRef(n) {
2432
+ this.element = n, this.props.inputRef && (Object.prototype.hasOwnProperty.call(this.props.inputRef, "current") ? this.props.inputRef.current = n : this.props.inputRef(n));
2433
+ }
2434
+ initMask(n) {
2435
+ n === void 0 && (n = this._extractMaskOptionsFromProps(this.props)), this.maskRef = d(this.element, n).on("accept", this._onAccept.bind(this)).on("complete", this._onComplete.bind(this)), "value" in this.props && this.props.value !== void 0 && (this.maskValue = this.props.value);
2436
+ }
2437
+ destroyMask() {
2438
+ this.maskRef && (this.maskRef.destroy(), delete this.maskRef);
2439
+ }
2440
+ _extractMaskOptionsFromProps(n) {
2441
+ const {
2442
+ ...a
2443
+ } = n;
2444
+ return Object.keys(a).filter((r) => bt.indexOf(r) < 0).forEach((r) => {
2445
+ delete a[r];
2446
+ }), a;
2447
+ }
2448
+ _extractNonMaskProps(n) {
2449
+ const {
2450
+ ...a
2451
+ } = n;
2452
+ return ot.forEach((r) => {
2453
+ r !== "maxLength" && delete a[r];
2454
+ }), "defaultValue" in a || (a.defaultValue = n.mask ? "" : a.value), delete a.value, a;
2455
+ }
2456
+ get maskValue() {
2457
+ return this.maskRef ? this.props.unmask === "typed" ? this.maskRef.typedValue : this.props.unmask ? this.maskRef.unmaskedValue : this.maskRef.value : "";
2458
+ }
2459
+ set maskValue(n) {
2460
+ this.maskRef && (n = n == null && this.props.unmask !== "typed" ? "" : n, this.props.unmask === "typed" ? this.maskRef.typedValue = n : this.props.unmask ? this.maskRef.unmaskedValue = n : this.maskRef.value = n);
2461
+ }
2462
+ _onAccept(n) {
2463
+ this.props.onAccept && this.maskRef && this.props.onAccept(this.maskValue, this.maskRef, n);
2464
+ }
2465
+ _onComplete(n) {
2466
+ this.props.onComplete && this.maskRef && this.props.onComplete(this.maskValue, this.maskRef, n);
2467
+ }
2468
+ render() {
2469
+ return R.createElement(u, {
2470
+ ...this._extractNonMaskProps(this.props),
2471
+ inputRef: this._inputRef
2472
+ });
2473
+ }
2474
+ }, t.displayName = void 0, t.propTypes = void 0, t), s = u.displayName || u.name || "Component";
2475
+ return e.displayName = "IMask(" + s + ")", e.propTypes = ht, R.forwardRef((i, n) => R.createElement(e, {
2476
+ ...i,
2477
+ ref: n
2478
+ }));
2479
+ }
2480
+ const Dt = It((u) => {
2481
+ let {
2482
+ inputRef: t,
2483
+ ...e
2484
+ } = u;
2485
+ return R.createElement("input", {
2486
+ ...e,
2487
+ ref: t
2488
+ });
2489
+ }), Mt = (u, t) => R.createElement(Dt, {
2490
+ ...u,
2491
+ ref: t
2492
+ });
2493
+ R.forwardRef(Mt);
2494
+ function Tt(u, t) {
2495
+ let {
2496
+ onAccept: e,
2497
+ onComplete: s,
2498
+ ref: i = J(null),
2499
+ defaultValue: n,
2500
+ defaultUnmaskedValue: a,
2501
+ defaultTypedValue: r
2502
+ } = t === void 0 ? {} : t;
2503
+ const l = J(null), [p, k] = N({}), [m, g] = N(""), [E, M] = N(""), [F, b] = N(), V = U(() => {
2504
+ var f;
2505
+ (f = l.current) == null || f.destroy(), l.current = null;
2506
+ }, []), x = U(() => {
2507
+ const f = l.current;
2508
+ f && (k({
2509
+ value: f.value,
2510
+ unmaskedValue: f.unmaskedValue,
2511
+ typedValue: f.typedValue
2512
+ }), b(f.typedValue), M(f.unmaskedValue), g(f.value));
2513
+ }, []), y = U((f) => {
2514
+ const C = l.current;
2515
+ C && (x(), e?.(C.value, C, f));
2516
+ }, [e]), Z = U((f) => l.current && s?.(l.current.value, l.current, f), [s]);
2517
+ return w(() => {
2518
+ const {
2519
+ value: f,
2520
+ ...C
2521
+ } = p, S = l.current;
2522
+ !S || m === void 0 || (f !== m && (S.value = m, S.value !== m && y()), k(C));
2523
+ }, [m]), w(() => {
2524
+ const {
2525
+ unmaskedValue: f,
2526
+ ...C
2527
+ } = p, S = l.current;
2528
+ !S || E === void 0 || (f !== E && (S.unmaskedValue = E, S.unmaskedValue !== E && y()), k(C));
2529
+ }, [E]), w(() => {
2530
+ const {
2531
+ typedValue: f,
2532
+ ...C
2533
+ } = p, S = l.current;
2534
+ !S || F === void 0 || (f !== F && (S.typedValue = F, S.masked.typedValueEquals(F) || y()), k(C));
2535
+ }, [F]), w(() => {
2536
+ const f = i.current;
2537
+ if (!f || !(u != null && u.mask)) return V();
2538
+ const C = l.current;
2539
+ C ? C?.updateOptions(u) : f && u != null && u.mask && (l.current = d(f, u), x(), n !== void 0 && g(n), a !== void 0 && M(a), r !== void 0 && b(r));
2540
+ }, [u, V, y]), w(() => {
2541
+ if (!l.current) return;
2542
+ const f = l.current;
2543
+ return f.on("accept", y), f.on("complete", Z), () => {
2544
+ f.off("accept", y), f.off("complete", Z);
2545
+ };
2546
+ }, [y, Z]), w(() => V, [V]), {
2547
+ ref: i,
2548
+ maskRef: l,
2549
+ value: m,
2550
+ setValue: g,
2551
+ unmaskedValue: E,
2552
+ setUnmaskedValue: M,
2553
+ typedValue: F,
2554
+ setTypedValue: b
2555
+ };
2556
+ }
2557
+ const st = (u, t) => {
2558
+ if (u.returnFormattedValueOnBlur || u.returnFormattedValueOnKeyDown) {
2559
+ const {
2560
+ name: e
2561
+ } = t.target, s = u.defaultValue || "";
2562
+ return {
2563
+ ...t,
2564
+ target: {
2565
+ value: ft(s),
2566
+ name: e
2567
+ }
2568
+ };
2569
+ }
2570
+ return t;
2571
+ }, wt = (u, t, e) => u.isNumeric ? {} : {
2572
+ onBlur: (s) => {
2573
+ if (e.unmaskedValue.trim().length && u.autoCompleteMask) {
2574
+ const i = e.unmaskedValue, n = e.mask.toString().replace(/\D+/g, "").length;
2575
+ if (n > i.length)
2576
+ switch (u.autoCompleteMask) {
2577
+ case "left":
2578
+ t(i.padStart(n, "0"));
2579
+ break;
2580
+ case "right":
2581
+ t(i.padEnd(n, "0"));
2582
+ break;
2583
+ default:
2584
+ t(i);
2585
+ break;
2586
+ }
2587
+ }
2588
+ if (u.onBlur) {
2589
+ const {
2590
+ value: i
2591
+ } = s.target, n = Q(i), a = {
2592
+ ...s,
2593
+ target: {
2594
+ ...s.target,
2595
+ value: n
2596
+ }
2597
+ }, r = st(u, a);
2598
+ u.onBlur(r);
2599
+ }
2600
+ },
2601
+ onKeyDown: (s) => {
2602
+ if (u.onKeyDown) {
2603
+ const {
2604
+ value: i
2605
+ } = s.target, n = Q(i), a = {
2606
+ ...s,
2607
+ target: {
2608
+ value: n
2609
+ }
2610
+ }, r = st(u, a);
2611
+ u.onKeyDown(r);
2612
+ }
2613
+ }
2614
+ }, Rt = [P.disabled, P.unvisible, P.readOnly, P.hideContent], zt = ({
2615
+ value: u,
2616
+ defaultValue: t,
2617
+ inputRef: e,
2618
+ onChange: s,
2619
+ onComplete: i,
2620
+ permissionAttr: n,
2621
+ mask: a,
2622
+ ...r
2623
+ }) => {
2624
+ const l = kt(Rt, n), {
2625
+ disabled: p,
2626
+ readOnly: k
2627
+ } = l, m = p || k, g = mt({
2628
+ mask: a,
2629
+ ...r
2630
+ }), {
2631
+ ref: E,
2632
+ setValue: M,
2633
+ setTypedValue: F,
2634
+ maskRef: b
2635
+ } = Tt(g, {
2636
+ defaultValue: t,
2637
+ onAccept: (V, x) => {
2638
+ if (!m && s) {
2639
+ const y = {
2640
+ target: {
2641
+ name: x.el.input.name,
2642
+ value: x.unmaskedValue,
2643
+ maskedValue: x.value,
2644
+ typedValue: x.typedValue
2645
+ }
2646
+ };
2647
+ s(y);
2648
+ }
2649
+ },
2650
+ onComplete: (V, x) => {
2651
+ if (!m && i) {
2652
+ const y = {
2653
+ target: {
2654
+ name: x.el.input.name,
2655
+ value: x.unmaskedValue,
2656
+ maskedValue: x.value,
2657
+ typedValue: x.typedValue
2658
+ }
2659
+ };
2660
+ i(y);
2661
+ }
2662
+ }
2663
+ });
2664
+ return w(() => {
2665
+ typeof u == "number" && (String(u).trim().length > 0 ? F(u) : F(0)), M(ct(u) ?? "");
2666
+ }, [u]), /* @__PURE__ */ pt.jsx(dt, { inputRef: (V) => {
2667
+ E.current = V, e && (typeof e == "object" ? e.current = V : e(V));
2668
+ }, permissionAttr: n, ...r, ...wt(r, M, b.current) });
2669
+ };
2670
+ export {
2671
+ zt as default
2672
+ };