@jenesei-software/jenesei-kit-react 2.0.0 → 2.0.1

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 (185) hide show
  1. package/build/{AnimatePresence-BByJ67dn.js → AnimatePresence-19yP-TCg.js} +2 -2
  2. package/build/{AnimatePresence-BByJ67dn.js.map → AnimatePresence-19yP-TCg.js.map} +1 -1
  3. package/build/{AnimatePresence-BtUPiqYm.cjs → AnimatePresence-BdBJCJuf.cjs} +2 -2
  4. package/build/{AnimatePresence-BtUPiqYm.cjs.map → AnimatePresence-BdBJCJuf.cjs.map} +1 -1
  5. package/build/area-outside.cjs.js +1 -1
  6. package/build/area-outside.es.js +1 -1
  7. package/build/area-preview.cjs.js +1 -1
  8. package/build/area-preview.es.js +1 -1
  9. package/build/area-skeleton.cjs.js +1 -1
  10. package/build/area-skeleton.es.js +1 -1
  11. package/build/build-info.txt +3 -3
  12. package/build/{button-D8zdhI-0.js → button-BbGiFvok.js} +2 -2
  13. package/build/{button-D8zdhI-0.js.map → button-BbGiFvok.js.map} +1 -1
  14. package/build/{button-C5PgNYns.cjs → button-BuPpgfL_.cjs} +2 -2
  15. package/build/{button-C5PgNYns.cjs.map → button-BuPpgfL_.cjs.map} +1 -1
  16. package/build/{checkbox-Ba0-4wxk.js → checkbox-CXxWDklX.js} +3 -3
  17. package/build/{checkbox-Ba0-4wxk.js.map → checkbox-CXxWDklX.js.map} +1 -1
  18. package/build/{checkbox-BtkbSjHq.cjs → checkbox-qgc_Ntc3.cjs} +2 -2
  19. package/build/{checkbox-BtkbSjHq.cjs.map → checkbox-qgc_Ntc3.cjs.map} +1 -1
  20. package/build/chunk-Dd8m0Ver.cjs +1 -0
  21. package/build/{chunk-D1xtDmiO.js → chunk-cI0lbGMq.js} +7 -7
  22. package/build/{component-6HgOL-7c.js → component-BHyXT2-h.js} +2 -2
  23. package/build/{component-6HgOL-7c.js.map → component-BHyXT2-h.js.map} +1 -1
  24. package/build/component-button.cjs.js +1 -1
  25. package/build/component-button.es.js +1 -1
  26. package/build/component-checkbox.cjs.js +1 -1
  27. package/build/component-checkbox.es.js +1 -1
  28. package/build/component-date-picker.cjs.js +1 -1
  29. package/build/component-date-picker.es.js +1 -1
  30. package/build/component-icon.cjs.js +1 -1
  31. package/build/component-icon.es.js +1 -1
  32. package/build/component-input-otp.cjs.js +1 -1
  33. package/build/component-input-otp.es.js +1 -1
  34. package/build/component-input.cjs.js +1 -1
  35. package/build/component-input.es.js +1 -1
  36. package/build/{component-BjdeqpEq.cjs → component-jsn2T8Hu.cjs} +2 -2
  37. package/build/{component-BjdeqpEq.cjs.map → component-jsn2T8Hu.cjs.map} +1 -1
  38. package/build/component-pagination.cjs.js +1 -1
  39. package/build/component-pagination.es.js +1 -1
  40. package/build/component-popover.cjs.js +1 -1
  41. package/build/component-select.cjs.js +1 -1
  42. package/build/component-select.es.js +1 -1
  43. package/build/component-separator.cjs.js +1 -1
  44. package/build/component-stack.cjs.js +1 -1
  45. package/build/component-stack.es.js +1 -1
  46. package/build/component-textarea.cjs.js +1 -1
  47. package/build/component-textarea.es.js +1 -1
  48. package/build/component-toggle.cjs.js +1 -1
  49. package/build/component-toggle.es.js +1 -1
  50. package/build/component-tooltip.cjs.js +1 -1
  51. package/build/component-typography.cjs.js +1 -1
  52. package/build/components-error.cjs.js +1 -1
  53. package/build/components-error.es.js +1 -1
  54. package/build/{context-app-4_kY3Qcd.js → context-app-CMK9g6MI.js} +4 -4
  55. package/build/{context-app-4_kY3Qcd.js.map → context-app-CMK9g6MI.js.map} +1 -1
  56. package/build/{context-app-DKsS6_WR.cjs → context-app-HhFcx1wY.cjs} +2 -2
  57. package/build/{context-app-DKsS6_WR.cjs.map → context-app-HhFcx1wY.cjs.map} +1 -1
  58. package/build/context-app.cjs.js +1 -1
  59. package/build/context-app.es.js +1 -1
  60. package/build/{context-browser-theme-CPhqqRUP.js → context-browser-theme-Cb6siWO0.js} +2 -2
  61. package/build/{context-browser-theme-CPhqqRUP.js.map → context-browser-theme-Cb6siWO0.js.map} +1 -1
  62. package/build/{context-browser-theme-o9geUlSH.cjs → context-browser-theme-Cso_rAT5.cjs} +2 -2
  63. package/build/{context-browser-theme-o9geUlSH.cjs.map → context-browser-theme-Cso_rAT5.cjs.map} +1 -1
  64. package/build/context-browser-theme.cjs.js +1 -1
  65. package/build/context-browser-theme.es.js +1 -1
  66. package/build/{context-cookie-CvTU44MD.cjs → context-cookie-Btkd2aXy.cjs} +2 -2
  67. package/build/{context-cookie-CvTU44MD.cjs.map → context-cookie-Btkd2aXy.cjs.map} +1 -1
  68. package/build/context-cookie.cjs.js +1 -1
  69. package/build/{context-dialog-CCnhd1EY.cjs → context-dialog-B67-_jMH.cjs} +2 -2
  70. package/build/{context-dialog-CCnhd1EY.cjs.map → context-dialog-B67-_jMH.cjs.map} +1 -1
  71. package/build/{context-dialog-HLeQ5WNn.js → context-dialog-CxGGmBqC.js} +5 -5
  72. package/build/{context-dialog-HLeQ5WNn.js.map → context-dialog-CxGGmBqC.js.map} +1 -1
  73. package/build/context-dialog.cjs.js +1 -1
  74. package/build/context-dialog.es.js +1 -1
  75. package/build/{context-geolocation-ffFFV4kn.cjs → context-geolocation-CV4hV0NX.cjs} +2 -2
  76. package/build/{context-geolocation-ffFFV4kn.cjs.map → context-geolocation-CV4hV0NX.cjs.map} +1 -1
  77. package/build/context-geolocation.cjs.js +1 -1
  78. package/build/{context-local-storage-kmxWNK_4.cjs → context-local-storage-DUKHVPAA.cjs} +2 -2
  79. package/build/{context-local-storage-kmxWNK_4.cjs.map → context-local-storage-DUKHVPAA.cjs.map} +1 -1
  80. package/build/context-local-storage.cjs.js +1 -1
  81. package/build/{context-permission-K3tWOiAx.cjs → context-permission-DrcIwK9y.cjs} +2 -2
  82. package/build/{context-permission-K3tWOiAx.cjs.map → context-permission-DrcIwK9y.cjs.map} +1 -1
  83. package/build/context-permission.cjs.js +1 -1
  84. package/build/{context-screen-width-CEsyIyg6.js → context-screen-width-CFexCIzV.js} +2 -2
  85. package/build/{context-screen-width-CEsyIyg6.js.map → context-screen-width-CFexCIzV.js.map} +1 -1
  86. package/build/{context-screen-width-ind6z7Ny.cjs → context-screen-width-hcRkxzy7.cjs} +2 -2
  87. package/build/{context-screen-width-ind6z7Ny.cjs.map → context-screen-width-hcRkxzy7.cjs.map} +1 -1
  88. package/build/context-screen-width.cjs.js +1 -1
  89. package/build/context-screen-width.es.js +1 -1
  90. package/build/{context-sonner-L0OMEvZE.cjs → context-sonner-4gBa1F7G.cjs} +2 -2
  91. package/build/{context-sonner-L0OMEvZE.cjs.map → context-sonner-4gBa1F7G.cjs.map} +1 -1
  92. package/build/{context-sonner-Bniiz914.js → context-sonner-qDPLFpD5.js} +6 -6
  93. package/build/{context-sonner-Bniiz914.js.map → context-sonner-qDPLFpD5.js.map} +1 -1
  94. package/build/context-sonner.cjs.js +1 -1
  95. package/build/context-sonner.es.js +1 -1
  96. package/build/{date-picker-CQUe3ZXt.cjs → date-picker-CPNNIEa-.cjs} +2 -2
  97. package/build/{date-picker-CQUe3ZXt.cjs.map → date-picker-CPNNIEa-.cjs.map} +1 -1
  98. package/build/{date-picker-z3LcE7Ab.js → date-picker-Uuce_InW.js} +5 -5
  99. package/build/{date-picker-z3LcE7Ab.js.map → date-picker-Uuce_InW.js.map} +1 -1
  100. package/build/{dist-Dq_YJa2q.js → dist-BV0C3tLK.js} +2 -2
  101. package/build/{dist-Dq_YJa2q.js.map → dist-BV0C3tLK.js.map} +1 -1
  102. package/build/{dist-C8r_OdG1.cjs → dist-DswBAjW1.cjs} +2 -2
  103. package/build/{dist-C8r_OdG1.cjs.map → dist-DswBAjW1.cjs.map} +1 -1
  104. package/build/{error--kiPVmoi.cjs → error-DzkkNL2H.cjs} +2 -2
  105. package/build/{error--kiPVmoi.cjs.map → error-DzkkNL2H.cjs.map} +1 -1
  106. package/build/{error-D1UNY-0f.js → error-L2fvWcNv.js} +2 -2
  107. package/build/{error-D1UNY-0f.js.map → error-L2fvWcNv.js.map} +1 -1
  108. package/build/hooks-use-debounced-callback.cjs.js +1 -1
  109. package/build/hooks-use-deep-compare-memoize.cjs.js +1 -1
  110. package/build/hooks-use-deep-compare-memoize.es.js +2 -2
  111. package/build/hooks-use-deep-memo.cjs.js +1 -1
  112. package/build/hooks-use-deep-memo.es.js +2 -2
  113. package/build/hooks-use-merge-refs.cjs.js +1 -1
  114. package/build/hooks-use-overflowing-advanced.cjs.js +1 -1
  115. package/build/hooks-use-overflowing-in-container.cjs.js +1 -1
  116. package/build/hooks-use-overflowing.cjs.js +1 -1
  117. package/build/hooks-use-responsive-layout.cjs.js +1 -1
  118. package/build/hooks-use-responsive-layout.es.js +1 -1
  119. package/build/hooks-use-typography-styles.cjs.js +1 -1
  120. package/build/{icon-CreblPsB.cjs → icon-CoIQwke4.cjs} +2 -2
  121. package/build/{icon-CreblPsB.cjs.map → icon-CoIQwke4.cjs.map} +1 -1
  122. package/build/{icon-BG6R5Lfa.js → icon-DzAWOQJg.js} +2 -2
  123. package/build/{icon-BG6R5Lfa.js.map → icon-DzAWOQJg.js.map} +1 -1
  124. package/build/index.cjs.js +1 -1
  125. package/build/index.es.js +21 -21
  126. package/build/{input-DqMLnOz5.js → input-CV02F03L.js} +2 -2
  127. package/build/{input-DqMLnOz5.js.map → input-CV02F03L.js.map} +1 -1
  128. package/build/{input-otp-DPp3qmvI.js → input-otp-B9cYxJ7X.js} +3 -3
  129. package/build/{input-otp-DPp3qmvI.js.map → input-otp-B9cYxJ7X.js.map} +1 -1
  130. package/build/{input-otp-Z_wz6o6L.cjs → input-otp-BVRCfoRK.cjs} +2 -2
  131. package/build/{input-otp-Z_wz6o6L.cjs.map → input-otp-BVRCfoRK.cjs.map} +1 -1
  132. package/build/{input-CWcWWMCp.cjs → input-zXF5f99Z.cjs} +2 -2
  133. package/build/{input-CWcWWMCp.cjs.map → input-zXF5f99Z.cjs.map} +1 -1
  134. package/build/isEqual-DeC2HFe5.cjs +3 -0
  135. package/build/{isEqual-wc3RBuBi.cjs.map → isEqual-DeC2HFe5.cjs.map} +1 -1
  136. package/build/{isEqual-VCZu3vai.js → isEqual-Qb81B2zH.js} +4 -3
  137. package/build/{isEqual-VCZu3vai.js.map → isEqual-Qb81B2zH.js.map} +1 -1
  138. package/build/{motion-BeQRGZxW.cjs → motion-CAPq8wSn.cjs} +2 -2
  139. package/build/{motion-BeQRGZxW.cjs.map → motion-CAPq8wSn.cjs.map} +1 -1
  140. package/build/{motion-Ot_yGWVJ.js → motion-Dt6TyEjN.js} +3 -3
  141. package/build/{motion-Ot_yGWVJ.js.map → motion-Dt6TyEjN.js.map} +1 -1
  142. package/build/{outside-DJ1B9sBT.cjs → outside-B3nRnDGb.cjs} +2 -2
  143. package/build/{outside-DJ1B9sBT.cjs.map → outside-B3nRnDGb.cjs.map} +1 -1
  144. package/build/{outside-BtjOuCPD.js → outside-DpK1pI8b.js} +2 -2
  145. package/build/{outside-BtjOuCPD.js.map → outside-DpK1pI8b.js.map} +1 -1
  146. package/build/{pagination-BnvQ1aha.cjs → pagination-Dbs4Lrpt.cjs} +2 -2
  147. package/build/{pagination-BnvQ1aha.cjs.map → pagination-Dbs4Lrpt.cjs.map} +1 -1
  148. package/build/{pagination-CpaP3Svg.js → pagination-YXSjZsMZ.js} +5 -5
  149. package/build/{pagination-CpaP3Svg.js.map → pagination-YXSjZsMZ.js.map} +1 -1
  150. package/build/{popover-fte_EMYr.cjs → popover-CgwGn-55.cjs} +2 -2
  151. package/build/{popover-fte_EMYr.cjs.map → popover-CgwGn-55.cjs.map} +1 -1
  152. package/build/{preview-BvJN6QoV.js → preview-C_yFxoFH.js} +4 -4
  153. package/build/{preview-BvJN6QoV.js.map → preview-C_yFxoFH.js.map} +1 -1
  154. package/build/{preview-CG76AiC9.cjs → preview-dT7fmxcc.cjs} +2 -2
  155. package/build/{preview-CG76AiC9.cjs.map → preview-dT7fmxcc.cjs.map} +1 -1
  156. package/build/{proxy-D2Z8K6jr.cjs → proxy-_gZenxVU.cjs} +2 -2
  157. package/build/{proxy-D2Z8K6jr.cjs.map → proxy-_gZenxVU.cjs.map} +1 -1
  158. package/build/{proxy-DTLy-pV-.js → proxy-wCWa57J3.js} +2 -2
  159. package/build/{proxy-DTLy-pV-.js.map → proxy-wCWa57J3.js.map} +1 -1
  160. package/build/{select-BQtWzaxE.cjs → select-B0adRX2_.cjs} +4 -4
  161. package/build/{select-BQtWzaxE.cjs.map → select-B0adRX2_.cjs.map} +1 -1
  162. package/build/{select-B4JeEvIF.js → select-D7EyxR2l.js} +10 -10
  163. package/build/{select-B4JeEvIF.js.map → select-D7EyxR2l.js.map} +1 -1
  164. package/build/{separator-BXoT44nC.cjs → separator-CbeH8Lug.cjs} +2 -2
  165. package/build/{separator-BXoT44nC.cjs.map → separator-CbeH8Lug.cjs.map} +1 -1
  166. package/build/{skeleton-BOfnrUaI.cjs → skeleton-BoVFwt7y.cjs} +2 -2
  167. package/build/{skeleton-BOfnrUaI.cjs.map → skeleton-BoVFwt7y.cjs.map} +1 -1
  168. package/build/{skeleton-Bzr92XmL.js → skeleton-DNwTI6w0.js} +2 -2
  169. package/build/{skeleton-Bzr92XmL.js.map → skeleton-DNwTI6w0.js.map} +1 -1
  170. package/build/style-motion.cjs.js +1 -1
  171. package/build/style-motion.es.js +1 -1
  172. package/build/style-utils.cjs.js +1 -1
  173. package/build/{textarea-BRzorAFw.cjs → textarea-CbZSeqGR.cjs} +2 -2
  174. package/build/{textarea-BRzorAFw.cjs.map → textarea-CbZSeqGR.cjs.map} +1 -1
  175. package/build/{textarea-BssfjUe3.js → textarea-ChkjV_Ha.js} +2 -2
  176. package/build/{textarea-BssfjUe3.js.map → textarea-ChkjV_Ha.js.map} +1 -1
  177. package/build/{toggle-CCfZoBpW.js → toggle-I6YvEX4w.js} +2 -2
  178. package/build/{toggle-CCfZoBpW.js.map → toggle-I6YvEX4w.js.map} +1 -1
  179. package/build/{toggle-BFp9Nmas.cjs → toggle-gYw5FUp-.cjs} +2 -2
  180. package/build/{toggle-BFp9Nmas.cjs.map → toggle-gYw5FUp-.cjs.map} +1 -1
  181. package/build/{typography-whjfut7N.cjs → typography-DcxhX_9e.cjs} +2 -2
  182. package/build/{typography-whjfut7N.cjs.map → typography-DcxhX_9e.cjs.map} +1 -1
  183. package/package.json +1 -5
  184. package/build/chunk-CW3en5xf.cjs +0 -1
  185. package/build/isEqual-wc3RBuBi.cjs +0 -3
@@ -1 +1 @@
1
- {"version":3,"file":"input-otp-DPp3qmvI.js","names":[],"sources":["../src/components/input-otp/component.tsx"],"sourcesContent":["import { ErrorMessage } from '@local/components/error';\nimport { Input } from '@local/components/input';\nimport { CSS_VARS } from '@local/styles/utils';\n\nimport { ClipboardEvent, FocusEvent, KeyboardEvent, useCallback, useRef, useState } from 'react';\n\nimport { IInputOTP } from './component.types';\n\nexport const InputOTP = (props: IInputOTP) => {\n const [otp, setOtp] = useState<string[]>(new Array(props.length).fill(''));\n const inputsRef = useRef<(HTMLInputElement | null)[]>([]);\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n\n const handlePaste = useCallback(\n (index: number, e: ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n\n const pasteData = e.clipboardData.getData('Text');\n const digits = pasteData.replace(/\\D/g, '').split('');\n\n if (!digits.length) return;\n\n setOtp((prevOtp) => {\n const newOtp = [...prevOtp];\n let currentIndex = index;\n\n for (let i = 0; i < digits.length && currentIndex < newOtp.length; i++) {\n newOtp[currentIndex] = digits[i];\n currentIndex++;\n }\n\n const joined = newOtp.join('');\n\n props.onChange?.(joined);\n\n if (newOtp.every((char) => char !== '')) {\n props.onComplete?.(joined);\n }\n\n setTimeout(() => {\n const firstEmpty = newOtp.indexOf('');\n if (firstEmpty !== -1) {\n inputsRef.current[firstEmpty]?.focus();\n } else if (currentIndex < newOtp.length) {\n inputsRef.current[currentIndex]?.focus();\n }\n }, 0);\n\n return newOtp;\n });\n },\n [props],\n );\n\n const handleChange = useCallback(\n (index: number, value: string) => {\n if (!/^\\d*$/.test(value)) return;\n\n setOtp((prevOtp) => {\n const newOtp = [...prevOtp];\n newOtp[index] = value.slice(-1);\n\n if (props.onChange) {\n props.onChange(newOtp.join(''));\n }\n\n if (newOtp.every((char) => char !== '')) {\n props.onComplete?.(newOtp.join(''));\n }\n\n if (value && index < prevOtp.length - 1) {\n setTimeout(() => {\n inputsRef.current[index + 1]?.focus();\n }, 0);\n }\n\n return newOtp;\n });\n },\n [props],\n );\n\n const handleKeyDown = (index: number, e: KeyboardEvent<HTMLInputElement>) => {\n const input = inputsRef.current[index];\n\n if (!input) return;\n\n if (e.key === 'ArrowRight') {\n const nextIndex = index < otp.length - 1 ? index + 1 : 0;\n const nextInput = inputsRef.current[nextIndex];\n\n if (nextInput) {\n nextInput.focus();\n setTimeout(() => nextInput.setSelectionRange(0, nextInput.value.length), 0);\n }\n }\n\n if (e.key === 'ArrowLeft') {\n const prevIndex = index > 0 ? index - 1 : otp.length - 1;\n const prevInput = inputsRef.current[prevIndex];\n\n if (prevInput) {\n prevInput.focus();\n setTimeout(() => prevInput.setSelectionRange(0, prevInput.value.length), 0);\n }\n }\n\n if (e.key === 'Backspace') {\n if (input.value) {\n setTimeout(() => input.setSelectionRange(0, input.value.length), 0);\n } else if (index > 0) {\n setTimeout(() => {\n const prevInput = inputsRef.current[index - 1];\n if (prevInput) {\n prevInput.focus();\n prevInput.setSelectionRange(0, prevInput.value.length);\n }\n }, 0);\n }\n }\n };\n\n const handleFocusInput = useCallback((e: FocusEvent<HTMLInputElement>) => {\n setTimeout(() => e.target.setSelectionRange(0, e.target.value.length), 0);\n }, []);\n return (\n <>\n <div\n className={props.className}\n style={{\n gap: `calc(${CSS_VARS.size[props.size].padding} - 2px)`,\n width: '100%',\n display: 'flex',\n alignItems: 'flex-start',\n ...props.style,\n }}\n id={props.id}\n ref={wrapperRef}\n onBlur={(e) => {\n setTimeout(() => {\n if (wrapperRef.current && !wrapperRef.current.contains(document.activeElement)) {\n props.onBlur?.(e);\n }\n }, 0);\n }}\n onFocus={(e) => {\n setTimeout(() => {\n if (wrapperRef.current?.contains(document.activeElement)) {\n props.onFocus?.(e);\n }\n }, 0);\n }}\n >\n {otp.map((digit, index) => (\n <Input\n isWidthAsHeight\n key={index}\n tabIndex={index + 1}\n ref={(el) => {\n inputsRef.current[index] = el;\n }}\n variety='standard'\n type='text'\n inputMode='numeric'\n maxLength={1}\n value={digit}\n onFocus={handleFocusInput}\n onPaste={(e) => handlePaste(index, e)}\n onChange={(value) => handleChange(index, value)}\n onKeyDown={(e) => handleKeyDown(index, e)}\n genre={props.genre}\n size={props.size}\n sxTypography={props.sxTypography}\n isBold={props.isBold}\n isFullRadius={props.isFullRadius}\n isDisabled={props.isDisabled}\n isHidden={props.isHidden}\n isHiddenBorder={props.isHiddenBorder}\n />\n ))}\n </div>\n {props?.error?.isError && (\n <ErrorMessage\n size={props?.error.size ?? props.size}\n sxTypography={{ size: '16px', weight: '400', ...props?.error.sxTypography }}\n {...props.error}\n />\n )}\n </>\n );\n};\n"],"mappings":";;;;;AAQA,IAAa,IAAA,CAAY,MAAqB;AAC5C,QAAM,CAAC,GAAK,CAAA,IAAU,EAAmB,IAAI,MAAM,EAAM,MAAA,EAAQ,KAAK,EAAA,CAAG,GACnE,IAAY,EAAoC,CAAA,CAAE,GAClD,IAAa,EAA8B,IAAA,GAE3C,IAAc,EAAA,CACjB,GAAe,MAAwC;AACtD,IAAA,EAAE,eAAA;AAGF,UAAM,IADY,EAAE,cAAc,QAAQ,MAAA,EACjB,QAAQ,OAAO,EAAA,EAAI,MAAM,EAAA;AAElD,IAAK,EAAO,UAEZ,EAAA,CAAQ,MAAY;AAClB,YAAM,IAAS,CAAC,GAAG,CAAA;AACnB,UAAI,IAAe;AAEnB,eAAS,IAAI,GAAG,IAAI,EAAO,UAAU,IAAe,EAAO,QAAQ;AACjE,QAAA,EAAO,CAAA,IAAgB,EAAO,CAAA,GAC9B;AAGF,YAAM,IAAS,EAAO,KAAK,EAAA;AAE3B,aAAA,EAAM,WAAW,CAAA,GAE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S;AAAA;MAE7B,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,WAAU;AAAA,MACV,WAAW;AAAA,MACX,OAAO;AAAA,MACP,SAAS;AAAA,MACT,SAAA,CAAU,MAAM,EAAY,GAAO,CAAA;AAAA,MACnC,UAAA,CAAW,MAAU,EAAa,GAAO,CAAA;AAAA,MACzC,WAAA,CAAY,MAAM,EAAc,GAAO,CAAA;AAAA,MACvC,OAAO,EAAM;AAAA,MACb,MAAM,EAAM;AAAA,MACZ,cAAc,EAAM;AAAA,MACpB,QAAQ,EAAM;AAAA,MACd,cAAc,EAAM;AAAA,MACpB,YAAY,EAAM;AAAA,MAClB,UAAU,EAAM;AAAA,MAChB,gBAAgB,EAAM;AAAA,OArBjB,CAAA,CAsBL;AAAA,GAEA,GACL,GAAO,OAAO,WACb,gBAAA,EAAC,GAAD;AAAA,IACE,MAAM,GAAO,MAAM,QAAQ,EAAM;AAAA,IACjC,cAAc;AAAA,MAAE,MAAM;AAAA,MAAQ,QAAQ;AAAA,MAAO,GAAG,GAAO,MAAM;AAAA;IAC7D,GAAI,EAAM;AAAA,GACV,CAAA,EAEH,CAAA"}
1
+ {"version":3,"file":"input-otp-B9cYxJ7X.js","names":[],"sources":["../src/components/input-otp/component.tsx"],"sourcesContent":["import { ErrorMessage } from '@local/components/error';\nimport { Input } from '@local/components/input';\nimport { CSS_VARS } from '@local/styles/utils';\n\nimport { ClipboardEvent, FocusEvent, KeyboardEvent, useCallback, useRef, useState } from 'react';\n\nimport { IInputOTP } from './component.types';\n\nexport const InputOTP = (props: IInputOTP) => {\n const [otp, setOtp] = useState<string[]>(new Array(props.length).fill(''));\n const inputsRef = useRef<(HTMLInputElement | null)[]>([]);\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n\n const handlePaste = useCallback(\n (index: number, e: ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n\n const pasteData = e.clipboardData.getData('Text');\n const digits = pasteData.replace(/\\D/g, '').split('');\n\n if (!digits.length) return;\n\n setOtp((prevOtp) => {\n const newOtp = [...prevOtp];\n let currentIndex = index;\n\n for (let i = 0; i < digits.length && currentIndex < newOtp.length; i++) {\n newOtp[currentIndex] = digits[i];\n currentIndex++;\n }\n\n const joined = newOtp.join('');\n\n props.onChange?.(joined);\n\n if (newOtp.every((char) => char !== '')) {\n props.onComplete?.(joined);\n }\n\n setTimeout(() => {\n const firstEmpty = newOtp.indexOf('');\n if (firstEmpty !== -1) {\n inputsRef.current[firstEmpty]?.focus();\n } else if (currentIndex < newOtp.length) {\n inputsRef.current[currentIndex]?.focus();\n }\n }, 0);\n\n return newOtp;\n });\n },\n [props],\n );\n\n const handleChange = useCallback(\n (index: number, value: string) => {\n if (!/^\\d*$/.test(value)) return;\n\n setOtp((prevOtp) => {\n const newOtp = [...prevOtp];\n newOtp[index] = value.slice(-1);\n\n if (props.onChange) {\n props.onChange(newOtp.join(''));\n }\n\n if (newOtp.every((char) => char !== '')) {\n props.onComplete?.(newOtp.join(''));\n }\n\n if (value && index < prevOtp.length - 1) {\n setTimeout(() => {\n inputsRef.current[index + 1]?.focus();\n }, 0);\n }\n\n return newOtp;\n });\n },\n [props],\n );\n\n const handleKeyDown = (index: number, e: KeyboardEvent<HTMLInputElement>) => {\n const input = inputsRef.current[index];\n\n if (!input) return;\n\n if (e.key === 'ArrowRight') {\n const nextIndex = index < otp.length - 1 ? index + 1 : 0;\n const nextInput = inputsRef.current[nextIndex];\n\n if (nextInput) {\n nextInput.focus();\n setTimeout(() => nextInput.setSelectionRange(0, nextInput.value.length), 0);\n }\n }\n\n if (e.key === 'ArrowLeft') {\n const prevIndex = index > 0 ? index - 1 : otp.length - 1;\n const prevInput = inputsRef.current[prevIndex];\n\n if (prevInput) {\n prevInput.focus();\n setTimeout(() => prevInput.setSelectionRange(0, prevInput.value.length), 0);\n }\n }\n\n if (e.key === 'Backspace') {\n if (input.value) {\n setTimeout(() => input.setSelectionRange(0, input.value.length), 0);\n } else if (index > 0) {\n setTimeout(() => {\n const prevInput = inputsRef.current[index - 1];\n if (prevInput) {\n prevInput.focus();\n prevInput.setSelectionRange(0, prevInput.value.length);\n }\n }, 0);\n }\n }\n };\n\n const handleFocusInput = useCallback((e: FocusEvent<HTMLInputElement>) => {\n setTimeout(() => e.target.setSelectionRange(0, e.target.value.length), 0);\n }, []);\n return (\n <>\n <div\n className={props.className}\n style={{\n gap: `calc(${CSS_VARS.size[props.size].padding} - 2px)`,\n width: '100%',\n display: 'flex',\n alignItems: 'flex-start',\n ...props.style,\n }}\n id={props.id}\n ref={wrapperRef}\n onBlur={(e) => {\n setTimeout(() => {\n if (wrapperRef.current && !wrapperRef.current.contains(document.activeElement)) {\n props.onBlur?.(e);\n }\n }, 0);\n }}\n onFocus={(e) => {\n setTimeout(() => {\n if (wrapperRef.current?.contains(document.activeElement)) {\n props.onFocus?.(e);\n }\n }, 0);\n }}\n >\n {otp.map((digit, index) => (\n <Input\n isWidthAsHeight\n key={index}\n tabIndex={index + 1}\n ref={(el) => {\n inputsRef.current[index] = el;\n }}\n variety='standard'\n type='text'\n inputMode='numeric'\n maxLength={1}\n value={digit}\n onFocus={handleFocusInput}\n onPaste={(e) => handlePaste(index, e)}\n onChange={(value) => handleChange(index, value)}\n onKeyDown={(e) => handleKeyDown(index, e)}\n genre={props.genre}\n size={props.size}\n sxTypography={props.sxTypography}\n isBold={props.isBold}\n isFullRadius={props.isFullRadius}\n isDisabled={props.isDisabled}\n isHidden={props.isHidden}\n isHiddenBorder={props.isHiddenBorder}\n />\n ))}\n </div>\n {props?.error?.isError && (\n <ErrorMessage\n size={props?.error.size ?? props.size}\n sxTypography={{ size: '16px', weight: '400', ...props?.error.sxTypography }}\n {...props.error}\n />\n )}\n </>\n );\n};\n"],"mappings":";;;;;AAQA,IAAa,IAAA,CAAY,MAAqB;AAC5C,QAAM,CAAC,GAAK,CAAA,IAAU,EAAmB,IAAI,MAAM,EAAM,MAAA,EAAQ,KAAK,EAAA,CAAG,GACnE,IAAY,EAAoC,CAAA,CAAE,GACl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js"),I=require("./error--kiPVmoi.cjs"),C=require("./input-CWcWWMCp.cjs");let o=require("react/jsx-runtime"),c=require("react");var j=e=>{const[f,h]=(0,c.useState)(new Array(e.length).fill("")),u=(0,c.useRef)([]),g=(0,c.useRef)(null),m=(0,c.useCallback)((t,i)=>{i.preventDefault();const n=i.clipboardData.getData("Text").replace(/\D/g,"").split("");n.length&&h(s=>{const r=[...s];let l=t;for(let a=0;a<n.length&&l<r.length;a++)r[l]=n[a],l++;const d=r.join("");return e.onChange?.(d),r.every(a=>a!=="")&&e.onComplete?.(d),setTimeout(()=>{const a=r.indexOf("");a!==-1?u.current[a]?.focus():l<r.length&&u.current[l]?.focus()},0),r})},[e]),y=(0,c.useCallback)((t,i)=>{/^\d*$/.test(i)&&h(n=>{const s=[...n];return s[t]=i.slice(-1),e.onChange&&e.onChange(s.join("")),s.every(r=>r!=="")&&e.onComplete?.(s.join("")),i&&t<n.length-1&&setTimeout(()=>{u.current[t+1]?.focus()},0),s})},[e]),T=(t,i)=>{const n=u.current[t];if(n){if(i.key==="ArrowRight"){const s=t<f.length-1?t+1:0,r=u.current[s];r&&(r.focus(),setTimeout(()=>r.setSelectionRange(0,r.value.length),0))}if(i.key==="ArrowLeft"){const s=t>0?t-1:f.length-1,r=u.current[s];r&&(r.focus(),setTimeout(()=>r.setSelectionRange(0,r.value.length),0))}i.key==="Backspace"&&(n.value?setTimeout(()=>n.setSelectionRange(0,n.value.length),0):t>0&&setTimeout(()=>{const s=u.current[t-1];s&&(s.focus(),s.setSelectionRange(0,s.value.length))},0))}},v=(0,c.useCallback)(t=>{setTimeout(()=>t.target.setSelectionRange(0,t.target.value.length),0)},[]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:e.className,style:{gap:`calc(${R.CSS_VARS.size[e.size].padding} - 2px)`,width:"100%",display:"flex",alignItems:"flex-start",...e.style},id:e.id,ref:g,onBlur:t=>{setTimeout(()=>{g.current&&!g.current.contains(document.activeElement)&&e.onBlur?.(t)},0)},onFocus:t=>{setTimeout(()=>{g.current?.contains(document.activeElement)&&e.onFocus?.(t)},0)},children:f.map((t,i)=>(0,o.jsx)(C.Input,{isWidthAsHeight:!0,tabIndex:i+1,ref:n=>{u.current[i]=n},variety:"standard",type:"text",inputMode:"numeric",maxLength:1,value:t,onFocus:v,onPaste:n=>m(i,n),onChange:n=>y(i,n),onKeyDown:n=>T(i,n),genre:e.genre,size:e.size,sxTypography:e.sxTypography,isBold:e.isBold,isFullRadius:e.isFullRadius,isDisabled:e.isDisabled,isHidden:e.isHidden,isHiddenBorder:e.isHiddenBorder},i))}),e?.error?.isError&&(0,o.jsx)(I.ErrorMessage,{size:e?.error.size??e.size,sxTypography:{size:"16px",weight:"400",...e?.error.sxTypography},...e.error})]})};Object.defineProperty(exports,"InputOTP",{enumerable:!0,get:function(){return j}});
1
+ const q=require("./chunk-Dd8m0Ver.cjs"),R=require("./utils-DtinAjAU.cjs"),I=require("./error-DzkkNL2H.cjs"),C=require("./input-zXF5f99Z.cjs");let o=require("react/jsx-runtime"),c=require("react");var j=e=>{const[f,h]=(0,c.useState)(new Array(e.length).fill("")),u=(0,c.useRef)([]),g=(0,c.useRef)(null),m=(0,c.useCallback)((t,i)=>{i.preventDefault();const n=i.clipboardData.getData("Text").replace(/\D/g,"").split("");n.length&&h(s=>{const r=[...s];let l=t;for(let a=0;a<n.length&&l<r.length;a++)r[l]=n[a],l++;const d=r.join("");return e.onChange?.(d),r.every(a=>a!=="")&&e.onComplete?.(d),setTimeout(()=>{const a=r.indexOf("");a!==-1?u.current[a]?.focus():l<r.length&&u.current[l]?.focus()},0),r})},[e]),y=(0,c.useCallback)((t,i)=>{/^\d*$/.test(i)&&h(n=>{const s=[...n];return s[t]=i.slice(-1),e.onChange&&e.onChange(s.join("")),s.every(r=>r!=="")&&e.onComplete?.(s.join("")),i&&t<n.length-1&&setTimeout(()=>{u.current[t+1]?.focus()},0),s})},[e]),T=(t,i)=>{const n=u.current[t];if(n){if(i.key==="ArrowRight"){const s=t<f.length-1?t+1:0,r=u.current[s];r&&(r.focus(),setTimeout(()=>r.setSelectionRange(0,r.value.length),0))}if(i.key==="ArrowLeft"){const s=t>0?t-1:f.length-1,r=u.current[s];r&&(r.focus(),setTimeout(()=>r.setSelectionRange(0,r.value.length),0))}i.key==="Backspace"&&(n.value?setTimeout(()=>n.setSelectionRange(0,n.value.length),0):t>0&&setTimeout(()=>{const s=u.current[t-1];s&&(s.focus(),s.setSelectionRange(0,s.value.length))},0))}},v=(0,c.useCallback)(t=>{setTimeout(()=>t.target.setSelectionRange(0,t.target.value.length),0)},[]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:e.className,style:{gap:`calc(${R.CSS_VARS.size[e.size].padding} - 2px)`,width:"100%",display:"flex",alignItems:"flex-start",...e.style},id:e.id,ref:g,onBlur:t=>{setTimeout(()=>{g.current&&!g.current.contains(document.activeElement)&&e.onBlur?.(t)},0)},onFocus:t=>{setTimeout(()=>{g.current?.contains(document.activeElement)&&e.onFocus?.(t)},0)},children:f.map((t,i)=>(0,o.jsx)(C.Input,{isWidthAsHeight:!0,tabIndex:i+1,ref:n=>{u.current[i]=n},variety:"standard",type:"text",inputMode:"numeric",maxLength:1,value:t,onFocus:v,onPaste:n=>m(i,n),onChange:n=>y(i,n),onKeyDown:n=>T(i,n),genre:e.genre,size:e.size,sxTypography:e.sxTypography,isBold:e.isBold,isFullRadius:e.isFullRadius,isDisabled:e.isDisabled,isHidden:e.isHidden,isHiddenBorder:e.isHiddenBorder},i))}),e?.error?.isError&&(0,o.jsx)(I.ErrorMessage,{size:e?.error.size??e.size,sxTypography:{size:"16px",weight:"400",...e?.error.sxTypography},...e.error})]})};Object.defineProperty(exports,"InputOTP",{enumerable:!0,get:function(){return j}});
2
2
 
3
- //# sourceMappingURL=input-otp-Z_wz6o6L.cjs.map
3
+ //# sourceMappingURL=input-otp-BVRCfoRK.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-otp-Z_wz6o6L.cjs","names":[],"sources":["../src/components/input-otp/component.tsx"],"sourcesContent":["import { ErrorMessage } from '@local/components/error';\nimport { Input } from '@local/components/input';\nimport { CSS_VARS } from '@local/styles/utils';\n\nimport { ClipboardEvent, FocusEvent, KeyboardEvent, useCallback, useRef, useState } from 'react';\n\nimport { IInputOTP } from './component.types';\n\nexport const InputOTP = (props: IInputOTP) => {\n const [otp, setOtp] = useState<string[]>(new Array(props.length).fill(''));\n const inputsRef = useRef<(HTMLInputElement | null)[]>([]);\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n\n const handlePaste = useCallback(\n (index: number, e: ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n\n const pasteData = e.clipboardData.getData('Text');\n const digits = pasteData.replace(/\\D/g, '').split('');\n\n if (!digits.length) return;\n\n setOtp((prevOtp) => {\n const newOtp = [...prevOtp];\n let currentIndex = index;\n\n for (let i = 0; i < digits.length && currentIndex < newOtp.length; i++) {\n newOtp[currentIndex] = digits[i];\n currentIndex++;\n }\n\n const joined = newOtp.join('');\n\n props.onChange?.(joined);\n\n if (newOtp.every((char) => char !== '')) {\n props.onComplete?.(joined);\n }\n\n setTimeout(() => {\n const firstEmpty = newOtp.indexOf('');\n if (firstEmpty !== -1) {\n inputsRef.current[firstEmpty]?.focus();\n } else if (currentIndex < newOtp.length) {\n inputsRef.current[currentIndex]?.focus();\n }\n }, 0);\n\n return newOtp;\n });\n },\n [props],\n );\n\n const handleChange = useCallback(\n (index: number, value: string) => {\n if (!/^\\d*$/.test(value)) return;\n\n setOtp((prevOtp) => {\n const newOtp = [...prevOtp];\n newOtp[index] = value.slice(-1);\n\n if (props.onChange) {\n props.onChange(newOtp.join(''));\n }\n\n if (newOtp.every((char) => char !== '')) {\n props.onComplete?.(newOtp.join(''));\n }\n\n if (value && index < prevOtp.length - 1) {\n setTimeout(() => {\n inputsRef.current[index + 1]?.focus();\n }, 0);\n }\n\n return newOtp;\n });\n },\n [props],\n );\n\n const handleKeyDown = (index: number, e: KeyboardEvent<HTMLInputElement>) => {\n const input = inputsRef.current[index];\n\n if (!input) return;\n\n if (e.key === 'ArrowRight') {\n const nextIndex = index < otp.length - 1 ? index + 1 : 0;\n const nextInput = inputsRef.current[nextIndex];\n\n if (nextInput) {\n nextInput.focus();\n setTimeout(() => nextInput.setSelectionRange(0, nextInput.value.length), 0);\n }\n }\n\n if (e.key === 'ArrowLeft') {\n const prevIndex = index > 0 ? index - 1 : otp.length - 1;\n const prevInput = inputsRef.current[prevIndex];\n\n if (prevInput) {\n prevInput.focus();\n setTimeout(() => prevInput.setSelectionRange(0, prevInput.value.length), 0);\n }\n }\n\n if (e.key === 'Backspace') {\n if (input.value) {\n setTimeout(() => input.setSelectionRange(0, input.value.length), 0);\n } else if (index > 0) {\n setTimeout(() => {\n const prevInput = inputsRef.current[index - 1];\n if (prevInput) {\n prevInput.focus();\n prevInput.setSelectionRange(0, prevInput.value.length);\n }\n }, 0);\n }\n }\n };\n\n const handleFocusInput = useCallback((e: FocusEvent<HTMLInputElement>) => {\n setTimeout(() => e.target.setSelectionRange(0, e.target.value.length), 0);\n }, []);\n return (\n <>\n <div\n className={props.className}\n style={{\n gap: `calc(${CSS_VARS.size[props.size].padding} - 2px)`,\n width: '100%',\n display: 'flex',\n alignItems: 'flex-start',\n ...props.style,\n }}\n id={props.id}\n ref={wrapperRef}\n onBlur={(e) => {\n setTimeout(() => {\n if (wrapperRef.current && !wrapperRef.current.contains(document.activeElement)) {\n props.onBlur?.(e);\n }\n }, 0);\n }}\n onFocus={(e) => {\n setTimeout(() => {\n if (wrapperRef.current?.contains(document.activeElement)) {\n props.onFocus?.(e);\n }\n }, 0);\n }}\n >\n {otp.map((digit, index) => (\n <Input\n isWidthAsHeight\n key={index}\n tabIndex={index + 1}\n ref={(el) => {\n inputsRef.current[index] = el;\n }}\n variety='standard'\n type='text'\n inputMode='numeric'\n maxLength={1}\n value={digit}\n onFocus={handleFocusInput}\n onPaste={(e) => handlePaste(index, e)}\n onChange={(value) => handleChange(index, value)}\n onKeyDown={(e) => handleKeyDown(index, e)}\n genre={props.genre}\n size={props.size}\n sxTypography={props.sxTypography}\n isBold={props.isBold}\n isFullRadius={props.isFullRadius}\n isDisabled={props.isDisabled}\n isHidden={props.isHidden}\n isHiddenBorder={props.isHiddenBorder}\n />\n ))}\n </div>\n {props?.error?.isError && (\n <ErrorMessage\n size={props?.error.size ?? props.size}\n sxTypography={{ size: '16px', weight: '400', ...props?.error.sxTypography }}\n {...props.error}\n />\n )}\n </>\n );\n};\n"],"mappings":"oMAQA,IAAa,EAAY,GAAqB,CAC5C,KAAM,CAAC,EAAK,CAAA,KAAA,EAAA,UAA6B,IAAI,MAAM,EAAM,MAAA,EAAQ,KAAK,EAAA,CAAG,EACnE,KAAA,EAAA,QAAgD,CAAA,CAAE,EAClD,KAAA,EAAA,QAA2C,IAAA,EAE3C,KAAA,EAAA,aAAA,CACH,EAAe,IAAwC,CACtD,EAAE,eAAA,EAGF,MAAM,EADY,EAAE,cAAc,QAAQ,MAAA,EACjB,QAAQ,MAAO,EAAA,EAAI,MAAM,EAAA,EAE7C,EAAO,QAEZ,EAAQ,GAAY,CAClB,MAAM,EAAS,CAAC,GAAG,CAAA,EACnB,IAAI,EAAe,EAEnB,QAAS,EAAI,EAAG,EAAI,EAAO,QAAU,EAAe,EAAO,OAAQ,IACjE,EAAO,CAAA,EAAgB,EAAO,CAAA,EAC9B,IAGF,MAAM,EAAS,EAAO,KAAK,EAAA,EAE3B,OAAA,EAAM,WAAW,CAAA,EAEb,EAAO,MAAO,GAAS,IAAS,EAAA,GAClC,EAAM,aAAa,CAAA,EAGrB,WAAA,IAAiB,CACf,MAAM,EAAa,EAAO,QAAQ,EAAA,EAC9B,IAAe,GACjB,EAAU,QAAQ,CAAA,GAAa,MAAA,EACtB,EAAe,EAAO,QAC/B,EAAU,QAAQ,CAAA,GAAe,MAAA,GAElC,CAAA,EAEI,KAGX,CAAC,CAAA,CAAM,EAGH,KAAA,EAAA,aAAA,CACH,EAAe,IA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":3,"file":"input-otp-BVRCfoRK.cjs","names":[],"sources":["../src/components/input-otp/component.tsx"],"sourcesContent":["import { ErrorMessage } from '@local/components/error';\nimport { Input } from '@local/components/input';\nimport { CSS_VARS } from '@local/styles/utils';\n\nimport { ClipboardEvent, FocusEvent, KeyboardEvent, useCallback, useRef, useState } from 'react';\n\nimport { IInputOTP } from './component.types';\n\nexport const InputOTP = (props: IInputOTP) => {\n const [otp, setOtp] = useState<string[]>(new Array(props.length).fill(''));\n const inputsRef = useRef<(HTMLInputElement | null)[]>([]);\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n\n const handlePaste = useCallback(\n (index: number, e: ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n\n const pasteData = e.clipboardData.getData('Text');\n const digits = pasteData.replace(/\\D/g, '').split('');\n\n if (!digits.length) return;\n\n setOtp((prevOtp) => {\n const newOtp = [...prevOtp];\n let currentIndex = index;\n\n for (let i = 0; i < digits.length && currentIndex < newOtp.length; i++) {\n newOtp[currentIndex] = digits[i];\n currentIndex++;\n }\n\n const joined = newOtp.join('');\n\n props.onChange?.(joined);\n\n if (newOtp.every((char) => char !== '')) {\n props.onComplete?.(joined);\n }\n\n setTimeout(() => {\n const firstEmpty = newOtp.indexOf('');\n if (firstEmpty !== -1) {\n inputsRef.current[firstEmpty]?.focus();\n } else if (currentIndex < newOtp.length) {\n inputsRef.current[currentIndex]?.focus();\n }\n }, 0);\n\n return newOtp;\n });\n },\n [props],\n );\n\n const handleChange = useCallback(\n (index: number, value: string) => {\n if (!/^\\d*$/.test(value)) return;\n\n setOtp((prevOtp) => {\n const newOtp = [...prevOtp];\n newOtp[index] = value.slice(-1);\n\n if (props.onChange) {\n props.onChange(newOtp.join(''));\n }\n\n if (newOtp.every((char) => char !== '')) {\n props.onComplete?.(newOtp.join(''));\n }\n\n if (value && index < prevOtp.length - 1) {\n setTimeout(() => {\n inputsRef.current[index + 1]?.focus();\n }, 0);\n }\n\n return newOtp;\n });\n },\n [props],\n );\n\n const handleKeyDown = (index: number, e: KeyboardEvent<HTMLInputElement>) => {\n const input = inputsRef.current[index];\n\n if (!input) return;\n\n if (e.key === 'ArrowRight') {\n const nextIndex = index < otp.length - 1 ? index + 1 : 0;\n const nextInput = inputsRef.current[nextIndex];\n\n if (nextInput) {\n nextInput.focus();\n setTimeout(() => nextInput.setSelectionRange(0, nextInput.value.length), 0);\n }\n }\n\n if (e.key === 'ArrowLeft') {\n const prevIndex = index > 0 ? index - 1 : otp.length - 1;\n const prevInput = inputsRef.current[prevIndex];\n\n if (prevInput) {\n prevInput.focus();\n setTimeout(() => prevInput.setSelectionRange(0, prevInput.value.length), 0);\n }\n }\n\n if (e.key === 'Backspace') {\n if (input.value) {\n setTimeout(() => input.setSelectionRange(0, input.value.length), 0);\n } else if (index > 0) {\n setTimeout(() => {\n const prevInput = inputsRef.current[index - 1];\n if (prevInput) {\n prevInput.focus();\n prevInput.setSelectionRange(0, prevInput.value.length);\n }\n }, 0);\n }\n }\n };\n\n const handleFocusInput = useCallback((e: FocusEvent<HTMLInputElement>) => {\n setTimeout(() => e.target.setSelectionRange(0, e.target.value.length), 0);\n }, []);\n return (\n <>\n <div\n className={props.className}\n style={{\n gap: `calc(${CSS_VARS.size[props.size].padding} - 2px)`,\n width: '100%',\n display: 'flex',\n alignItems: 'flex-start',\n ...props.style,\n }}\n id={props.id}\n ref={wrapperRef}\n onBlur={(e) => {\n setTimeout(() => {\n if (wrapperRef.current && !wrapperRef.current.contains(document.activeElement)) {\n props.onBlur?.(e);\n }\n }, 0);\n }}\n onFocus={(e) => {\n setTimeout(() => {\n if (wrapperRef.current?.contains(document.activeElement)) {\n props.onFocus?.(e);\n }\n }, 0);\n }}\n >\n {otp.map((digit, index) => (\n <Input\n isWidthAsHeight\n key={index}\n tabIndex={index + 1}\n ref={(el) => {\n inputsRef.current[index] = el;\n }}\n variety='standard'\n type='text'\n inputMode='numeric'\n maxLength={1}\n value={digit}\n onFocus={handleFocusInput}\n onPaste={(e) => handlePaste(index, e)}\n onChange={(value) => handleChange(index, value)}\n onKeyDown={(e) => handleKeyDown(index, e)}\n genre={props.genre}\n size={props.size}\n sxTypography={props.sxTypography}\n isBold={props.isBold}\n isFullRadius={props.isFullRadius}\n isDisabled={props.isDisabled}\n isHidden={props.isHidden}\n isHiddenBorder={props.isHiddenBorder}\n />\n ))}\n </div>\n {props?.error?.isError && (\n <ErrorMessage\n size={props?.error.size ?? props.size}\n sxTypography={{ size: '16px', weight: '400', ...props?.error.sxTypography }}\n {...props.error}\n />\n )}\n </>\n );\n};\n"],"mappings":"oMAQA,IAAa,EAAY,GAAqB,CAC5C,KAAM,CAAC,EAAK,CAAA,KAAA,EAAA,UAA6B,IAAI,MAAM,EAAM,MAAA,EAAQ,KAAK,EAAA,CAAG,EACnE,KAAA,EAAA,QAAgD,CAAA,CAAE,EAClD,KAAA,EAAA,QAA2C,IAAA,EAE3C,KAAA,EAAA,aAAA,CACH,EAAe,IAAwC,CACtD,EAAE,eAAA,EAGF,MAAM,EADY,EAAE,cAAc,QAAQ,MAAA,EACjB,QAAQ,MAAO,EAAA,EAAI,MAAM,EAAA,EAE7C,EAAO,QAEZ,EAAQ,GAAY,CAClB,MAAM,EAAS,CAAC,GAAG,CAAA,EACnB,IAAI,EAAe,EAEnB,QAAS,EAAI,EAAG,EAAI,EAAO,QAAU,EAAe,EAAO,OAAQ,IACjE,EAAO,CAAA,EAAgB,EAAO,CAAA,EAC9B,IAGF,MAAM,EAAS,EAAO,KAAK,EAAA,EAE3B,OAAA,EAAM,WAAW,CAAA,EAEb,EAAO,MAAO,GAAS,IAAS,EAAA,GAClC,EAAM,aAAa,CAAA,EAGrB,WAAA,IAAiB,CACf,MAAM,EAAa,EAAO,QAAQ,EAAA,EAC9B,IAAe,GACjB,EAAU,QAAQ,CAAA,GAAa,MAAA,EACtB,EAAe,EAAO,QAC/B,EAAU,QAAQ,CAAA,GAAe,MAAA,GAElC,CAAA,EAEI,KAGX,CAAC,CAAA,CAAM,EAGH,KAAA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AA,CAEH,CAAA"}
@@ -1,4 +1,4 @@
1
- const Te=require("./chunk-CW3en5xf.cjs"),C=require("./utils-DtinAjAU.cjs"),ue=require("./functions-Dwo54amB.cjs"),Me=require("./hooks-use-merge-refs.cjs.js"),ke=require("./hooks-use-typography-styles.cjs.js"),je=require("./error--kiPVmoi.cjs");let H=require("react/jsx-runtime"),_=require("react");_=Te.__toESM(_,1);function se(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(a[n[r]]=e[n[r]]);return a}var ae;(function(e){e.event="event",e.props="prop"})(ae||(ae={}));function $(){}function Pe(e){var t,a=void 0;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];return t&&n.length===t.length&&n.every(function(i,f){return i===t[f]})||(t=n,a=e.apply(void 0,n)),a}}function p(e){return!!(e||"").match(/\d/)}function U(e){return e==null}function We(e){return typeof e=="number"&&isNaN(e)}function xe(e){return U(e)||We(e)||typeof e=="number"&&!isFinite(e)}function ye(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function qe(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}function Ke(e,t,a){var n=qe(a),r=e.search(/[1-9]/);return r=r===-1?e.length:r,e.substring(0,r)+e.substring(r,e.length).replace(n,"$1"+t)}function me(e){var t=(0,_.useRef)(e);return t.current=e,(0,_.useRef)(function(){for(var a=[],n=arguments.length;n--;)a[n]=arguments[n];return t.current.apply(t,a)}).current}function ve(e,t){t===void 0&&(t=!0);var a=e[0]==="-",n=a&&t;e=e.replace("-","");var r=e.split(".");return{beforeDecimal:r[0],afterDecimal:r[1]||"",hasNegation:a,addNegation:n}}function ze(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var a=e.split("."),n=a[0].replace(/^0+/,"")||"0",r=a[1]||"";return(t?"-":"")+n+(r?"."+r:"")}function be(e,t,a){for(var n="",r=a?"0":"",i=0;i<=t-1;i++)n+=e[i]||r;return n}function he(e,t){return Array(t+1).join(e)}function we(e){var t=e+"",a=t[0]==="-"?"-":"";a&&(t=t.substring(1));var n=t.split(/[eE]/g),r=n[0],i=n[1];if(i=Number(i),!i)return a+r;r=r.replace(".","");var f=1+i,s=r.length;return f<0?r="0."+he("0",Math.abs(f))+r:f>=s?r=r+he("0",f-s):r=(r.substring(0,f)||"0")+"."+r.substring(f),a+r}function Se(e,t,a){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||a)&&t,r=ve(e),i=r.beforeDecimal,f=r.afterDecimal,s=r.hasNegation,v=parseFloat("0."+(f||"0")),h=(f.length<=t?"0."+f:v.toFixed(t)).split("."),d=i;i&&Number(h[0])&&(d=i.split("").reverse().reduce(function(u,w,m){return u.length>m?(Number(u[0])+Number(w)).toString()+u.substring(1,u.length):w+u},h[0]));var o=be(h[1]||"",t,a),g=s?"-":"",y=n?".":"";return""+g+d+y+o}function Y(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var a=e.createTextRange();return a.move("character",t),a.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var Ae=Pe(function(e,t){for(var a=0,n=0,r=e.length,i=t.length;e[a]===t[a]&&a<r;)a++;for(;e[r-1-n]===t[i-1-n]&&i-n>a&&r-n>a;)n++;return{from:{start:a,end:r-n},to:{start:a,end:i-n}}}),He=function(e,t){var a=Math.min(e.selectionStart,t);return{from:{start:a,end:e.selectionEnd},to:{start:a,end:t}}};function $e(e,t,a){return Math.min(Math.max(e,t),a)}function ce(e){return Math.max(e.selectionStart,e.selectionEnd)}function Ue(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Ve(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function _e(e,t){return e===void 0&&(e=" "),typeof e=="string"?e:e[t]||" "}function Ze(e){var t=e.currentValue,a=e.formattedValue,n=e.currentValueIndex,r=e.formattedValueIndex;return t[n]===a[r]}function Ge(e,t,a,n,r,i,f){f===void 0&&(f=Ze);var s=r.findIndex(function(R){return R}),v=e.slice(0,s);!t&&!a.startsWith(v)&&(t=v,a=v+a,n=n+v.length);for(var h=a.length,d=e.length,o={},g=new Array(h),y=0;y<h;y++){g[y]=-1;for(var u=0,w=d;u<w;u++)if(f({currentValue:a,lastValue:t,formattedValue:e,currentValueIndex:y,formattedValueIndex:u})&&o[u]!==!0){g[y]=u,o[u]=!0;break}}for(var m=n;m<h&&(g[m]===-1||!i(a[m]));)m++;var A=m===h||g[m]===-1?d:g[m];for(m=n-1;m>0&&g[m]===-1;)m--;var B=m===-1||g[m]===-1?0:g[m]+1;return B>A?A:n-B<A-n?B:A}function oe(e,t,a,n){var r=e.length;if(t=$e(t,0,r),n==="left"){for(;t>=0&&!a[t];)t--;t===-1&&(t=a.indexOf(!0))}else{for(;t<=r&&!a[t];)t++;t>r&&(t=a.lastIndexOf(!0))}return t===-1&&(t=r),t}function Je(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),a=0,n=t.length;a<n;a++)t[a]=!!(p(e[a])||p(e[a-1]));return t}function Ne(e,t,a,n,r,i){i===void 0&&(i=$);var f=me(function(u,w){var m,A;return xe(u)?(A="",m=""):typeof u=="number"||w?(A=typeof u=="number"?we(u):u,m=n(A)):(A=r(u,void 0),m=n(A)),{formattedValue:m,numAsString:A}}),s=(0,_.useState)(function(){return f(U(e)?t:e,a)}),v=s[0],h=s[1],d=me(function(u,w){u.formattedValue!==v.formattedValue&&h({formattedValue:u.formattedValue,numAsString:u.value}),i(u,w)}),o=e,g=a;U(e)&&(o=v.numAsString,g=!0);var y=f(o,g);return(0,_.useMemo)(function(){h(y)},[y.formattedValue]),(0,_.useEffect)(function(){if(!U(t)&&U(e)&&v.formattedValue!==""){var u=parseFloat(v.numAsString);d({formattedValue:v.formattedValue,value:v.numAsString,floatValue:isNaN(u)?void 0:u},{event:void 0,source:ae.props})}},[]),[v,d]}function Qe(e){return e.replace(/[^0-9]/g,"")}function Xe(e){return e}function Re(e){var t=e.type;t===void 0&&(t="text");var a=e.displayType;a===void 0&&(a="input");var n=e.customInput,r=e.renderText,i=e.getInputRef,f=e.format;f===void 0&&(f=Xe);var s=e.removeFormatting;s===void 0&&(s=Qe);var v=e.defaultValue,h=e.valueIsNumericString,d=e.onValueChange,o=e.isAllowed,g=e.onChange;g===void 0&&(g=$);var y=e.onKeyDown;y===void 0&&(y=$);var u=e.onMouseUp;u===void 0&&(u=$);var w=e.onFocus;w===void 0&&(w=$);var m=e.onBlur;m===void 0&&(m=$);var A=e.value,B=e.getCaretBoundary;B===void 0&&(B=Je);var R=e.isValidInputCharacter;R===void 0&&(R=p);var E=e.isCharacterSame,k=se(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),q=Ne(A,v,!!h,f,s,d),K=q[0],N=K.formattedValue,P=K.numAsString,Z=q[1],W=(0,_.useRef)(),G=(0,_.useRef)({formattedValue:N,numAsString:P}),J=function(l,c){G.current={formattedValue:l.formattedValue,numAsString:l.value},Z(l,c)},ee=(0,_.useState)(!1),re=ee[0],x=ee[1],S=(0,_.useRef)(null),D=(0,_.useRef)({setCaretTimeout:null,focusTimeout:null});(0,_.useEffect)(function(){return x(!0),function(){clearTimeout(D.current.setCaretTimeout),clearTimeout(D.current.focusTimeout)}},[]);var O=f,T=function(l,c){var b=parseFloat(c);return{formattedValue:l,value:c,floatValue:isNaN(b)?void 0:b}},L=function(l,c,b){l.selectionStart===0&&l.selectionEnd===l.value.length||(Y(l,c),D.current.setCaretTimeout=setTimeout(function(){l.value===b&&l.selectionStart!==c&&Y(l,c)},0))},M=function(l,c,b){return oe(l,c,B(l),b)},te=function(l,c,b){var F=B(c),j=Ge(c,N,l,b,F,R,E);return j=oe(c,j,F),j},ne=function(l){var c=l.formattedValue;c===void 0&&(c="");var b=l.input,F=l.source,j=l.event,I=l.numAsString,V;if(b){var z=l.inputValue||b.value,Q=ce(b);b.value=c,V=te(z,c,Q),V!==void 0&&L(b,V,c)}c!==N&&J(T(c,I),{event:j,source:F})};(0,_.useEffect)(function(){var l=G.current,c=l.formattedValue,b=l.numAsString;(N!==c||P!==b)&&J(T(N,P),{event:void 0,source:ae.props})},[N,P]);var ie=S.current?ce(S.current):void 0;(typeof window<"u"?_.useLayoutEffect:_.useEffect)(function(){var l=S.current;if(N!==G.current.formattedValue&&l){var c=te(G.current.formattedValue,N,ie);l.value=N,L(l,c,N)}},[N]);var fe=function(l,c,b){var F=c.target,j=W.current?He(W.current,F.selectionEnd):Ae(N,l),I=Object.assign(Object.assign({},j),{lastValue:N}),V=s(l,I),z=O(V);if(V=s(z,void 0),o&&!o(T(z,V))){var Q=c.target,X=te(l,N,ce(Q));return Q.value=N,L(Q,X,N),!1}return ne({formattedValue:z,numAsString:V,inputValue:l,event:c,source:b,input:c.target}),!0},de=function(l,c){c===void 0&&(c=0),W.current={selectionStart:l.selectionStart,selectionEnd:l.selectionEnd+c}},Ie=function(l){var c=l.target.value;fe(c,l,ae.event)&&g(l),W.current=void 0},De=function(l){var c=l.target,b=l.key,F=c.selectionStart,j=c.selectionEnd,I=c.value;I===void 0&&(I="");var V;b==="ArrowLeft"||b==="Backspace"?V=Math.max(F-1,0):b==="ArrowRight"?V=Math.min(F+1,I.length):b==="Delete"&&(V=F);var z=0;b==="Delete"&&F===j&&(z=1);var Q=b==="ArrowLeft"||b==="ArrowRight";if(V===void 0||F!==j&&!Q){y(l),de(c,z);return}var X=V;Q?(X=M(I,V,b==="ArrowLeft"?"left":"right"),X!==V&&l.preventDefault()):b==="Delete"&&!R(I[V])?X=M(I,V,"right"):b==="Backspace"&&!R(I[V])&&(X=M(I,V,"left")),X!==V&&L(c,X,I),y(l),de(c,z)},Le=function(l){var c=l.target,b=function(){var F=c.selectionStart,j=c.selectionEnd,I=c.value;if(I===void 0&&(I=""),F===j){var V=M(I,F);V!==F&&L(c,V,I)}};b(),requestAnimationFrame(function(){b()}),u(l),de(c)},Ee=function(l){l.persist&&l.persist();var c=l.target,b=l.currentTarget;S.current=c,D.current.focusTimeout=setTimeout(function(){var F=c.selectionStart,j=c.selectionEnd,I=c.value;I===void 0&&(I="");var V=M(I,F);V!==F&&!(F===0&&j===I.length)&&L(c,V,I),w(Object.assign(Object.assign({},l),{currentTarget:b}))},0)},Fe=function(l){S.current=null,clearTimeout(D.current.focusTimeout),clearTimeout(D.current.setCaretTimeout),m(l)},Be=re&&Ue()?"numeric":void 0,ge=Object.assign({inputMode:Be},k,{type:t,value:N,onChange:Ie,onKeyDown:De,onMouseUp:Le,onFocus:Ee,onBlur:Fe});if(a==="text")return r?_.default.createElement(_.default.Fragment,null,r(N,k)||null):_.default.createElement("span",Object.assign({},k,{ref:i}),N);if(n){var Oe=n;return _.default.createElement(Oe,Object.assign({},ge,{ref:i}))}return _.default.createElement("input",Object.assign({},ge,{ref:i}))}function Ce(e,t){var a=t.decimalScale,n=t.fixedDecimalScale,r=t.prefix;r===void 0&&(r="");var i=t.suffix;i===void 0&&(i="");var f=t.allowNegative,s=t.thousandsGroupStyle;if(s===void 0&&(s="thousand"),e===""||e==="-")return e;var v=le(t),h=v.thousandSeparator,d=v.decimalSeparator,o=a!==0&&e.indexOf(".")!==-1||a&&n,g=ve(e,f),y=g.beforeDecimal,u=g.afterDecimal,w=g.addNegation;return a!==void 0&&(u=be(u,a,!!n)),h&&(y=Ke(y,h,s)),r&&(y=r+y),i&&(u=u+i),w&&(y="-"+y),e=y+(o&&d||"")+u,e}function le(e){var t=e.decimalSeparator;t===void 0&&(t=".");var a=e.thousandSeparator,n=e.allowedDecimalSeparators;return a===!0&&(a=","),n||(n=[t,"."]),{decimalSeparator:t,thousandSeparator:a,allowedDecimalSeparators:n}}function Ye(e,t){e===void 0&&(e="");var a=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),r=a.test(e),i=n.test(e);return e=e.replace(/-/g,""),r&&!i&&t&&(e="-"+e),e}function pe(e,t){return new RegExp("(^-)|[0-9]|"+ye(e),t?"g":void 0)}function et(e,t,a){return e===""?!0:!t?.match(/\d/)&&!a?.match(/\d/)&&typeof e=="string"&&!isNaN(Number(e))}function tt(e,t,a){var n;t===void 0&&(t=Ve(e));var r=a.allowNegative,i=a.prefix;i===void 0&&(i="");var f=a.suffix;f===void 0&&(f="");var s=a.decimalScale,v=t.from,h=t.to,d=h.start,o=h.end,g=le(a),y=g.allowedDecimalSeparators,u=g.decimalSeparator,w=e[o]===u;if(p(e)&&(e===i||e===f)&&t.lastValue==="")return e;if(o-d===1&&y.indexOf(e[d])!==-1){var m=s===0?"":u;e=e.substring(0,d)+m+e.substring(d+1,e.length)}var A=function(S,D,O){var T=!1,L=!1;i.startsWith("-")?T=!1:S.startsWith("--")?(T=!1,L=!0):f.startsWith("-")&&S.length===f.length?T=!1:S[0]==="-"&&(T=!0);var M=T?1:0;return L&&(M=2),M&&(S=S.substring(M),D-=M,O-=M),{value:S,start:D,end:O,hasNegation:T}},B=A(e,d,o),R=B.hasNegation;n=B,e=n.value,d=n.start,o=n.end;var E=A(t.lastValue,v.start,v.end),k=E.start,q=E.end,K=E.value,N=e.substring(d,o);e.length&&K.length&&(k>K.length-f.length||q<i.length)&&!(N&&f.startsWith(N))&&(e=K);var P=0;e.startsWith(i)?P+=i.length:d<i.length&&(P=d),e=e.substring(P),o-=P;var Z=e.length,W=e.length-f.length;e.endsWith(f)?Z=W:(o>W||o>e.length-f.length)&&(Z=o),e=e.substring(0,Z),e=Ye(R?"-"+e:e,r),e=(e.match(pe(u,!0))||[]).join("");var G=e.indexOf(u);e=e.replace(new RegExp(ye(u),"g"),function(S,D){return D===G?".":""});var J=ve(e,r),ee=J.beforeDecimal,re=J.afterDecimal,x=J.addNegation;return h.end-h.start<v.end-v.start&&ee===""&&w&&!parseFloat(re)&&(e=x?"-":""),e}function at(e,t){var a=t.prefix;a===void 0&&(a="");var n=t.suffix;n===void 0&&(n="");var r=Array.from({length:e.length+1}).map(function(){return!0}),i=e[0]==="-";r.fill(!1,0,Math.min(a.length+(i?1:0),e.length));var f=e.length;return r.fill(!1,f-n.length+1,f+1),r}function rt(e){var t=le(e),a=t.thousandSeparator,n=t.decimalSeparator,r=e.prefix;r===void 0&&(r="");var i=e.allowNegative;if(i===void 0&&(i=!0),a===n)throw new Error(`
1
+ const Te=require("./chunk-Dd8m0Ver.cjs"),C=require("./utils-DtinAjAU.cjs"),ue=require("./functions-Dwo54amB.cjs"),Me=require("./hooks-use-merge-refs.cjs.js"),ke=require("./hooks-use-typography-styles.cjs.js"),je=require("./error-DzkkNL2H.cjs");let H=require("react/jsx-runtime"),_=require("react");_=Te.__toESM(_,1);function se(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(a[n[r]]=e[n[r]]);return a}var ae;(function(e){e.event="event",e.props="prop"})(ae||(ae={}));function $(){}function Pe(e){var t,a=void 0;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];return t&&n.length===t.length&&n.every(function(i,f){return i===t[f]})||(t=n,a=e.apply(void 0,n)),a}}function p(e){return!!(e||"").match(/\d/)}function U(e){return e==null}function We(e){return typeof e=="number"&&isNaN(e)}function xe(e){return U(e)||We(e)||typeof e=="number"&&!isFinite(e)}function ye(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function qe(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}function Ke(e,t,a){var n=qe(a),r=e.search(/[1-9]/);return r=r===-1?e.length:r,e.substring(0,r)+e.substring(r,e.length).replace(n,"$1"+t)}function me(e){var t=(0,_.useRef)(e);return t.current=e,(0,_.useRef)(function(){for(var a=[],n=arguments.length;n--;)a[n]=arguments[n];return t.current.apply(t,a)}).current}function ve(e,t){t===void 0&&(t=!0);var a=e[0]==="-",n=a&&t;e=e.replace("-","");var r=e.split(".");return{beforeDecimal:r[0],afterDecimal:r[1]||"",hasNegation:a,addNegation:n}}function ze(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var a=e.split("."),n=a[0].replace(/^0+/,"")||"0",r=a[1]||"";return(t?"-":"")+n+(r?"."+r:"")}function be(e,t,a){for(var n="",r=a?"0":"",i=0;i<=t-1;i++)n+=e[i]||r;return n}function he(e,t){return Array(t+1).join(e)}function we(e){var t=e+"",a=t[0]==="-"?"-":"";a&&(t=t.substring(1));var n=t.split(/[eE]/g),r=n[0],i=n[1];if(i=Number(i),!i)return a+r;r=r.replace(".","");var f=1+i,s=r.length;return f<0?r="0."+he("0",Math.abs(f))+r:f>=s?r=r+he("0",f-s):r=(r.substring(0,f)||"0")+"."+r.substring(f),a+r}function Se(e,t,a){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||a)&&t,r=ve(e),i=r.beforeDecimal,f=r.afterDecimal,s=r.hasNegation,v=parseFloat("0."+(f||"0")),h=(f.length<=t?"0."+f:v.toFixed(t)).split("."),d=i;i&&Number(h[0])&&(d=i.split("").reverse().reduce(function(u,w,m){return u.length>m?(Number(u[0])+Number(w)).toString()+u.substring(1,u.length):w+u},h[0]));var o=be(h[1]||"",t,a),g=s?"-":"",y=n?".":"";return""+g+d+y+o}function Y(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var a=e.createTextRange();return a.move("character",t),a.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var Ae=Pe(function(e,t){for(var a=0,n=0,r=e.length,i=t.length;e[a]===t[a]&&a<r;)a++;for(;e[r-1-n]===t[i-1-n]&&i-n>a&&r-n>a;)n++;return{from:{start:a,end:r-n},to:{start:a,end:i-n}}}),He=function(e,t){var a=Math.min(e.selectionStart,t);return{from:{start:a,end:e.selectionEnd},to:{start:a,end:t}}};function $e(e,t,a){return Math.min(Math.max(e,t),a)}function ce(e){return Math.max(e.selectionStart,e.selectionEnd)}function Ue(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Ve(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function _e(e,t){return e===void 0&&(e=" "),typeof e=="string"?e:e[t]||" "}function Ze(e){var t=e.currentValue,a=e.formattedValue,n=e.currentValueIndex,r=e.formattedValueIndex;return t[n]===a[r]}function Ge(e,t,a,n,r,i,f){f===void 0&&(f=Ze);var s=r.findIndex(function(R){return R}),v=e.slice(0,s);!t&&!a.startsWith(v)&&(t=v,a=v+a,n=n+v.length);for(var h=a.length,d=e.length,o={},g=new Array(h),y=0;y<h;y++){g[y]=-1;for(var u=0,w=d;u<w;u++)if(f({currentValue:a,lastValue:t,formattedValue:e,currentValueIndex:y,formattedValueIndex:u})&&o[u]!==!0){g[y]=u,o[u]=!0;break}}for(var m=n;m<h&&(g[m]===-1||!i(a[m]));)m++;var A=m===h||g[m]===-1?d:g[m];for(m=n-1;m>0&&g[m]===-1;)m--;var B=m===-1||g[m]===-1?0:g[m]+1;return B>A?A:n-B<A-n?B:A}function oe(e,t,a,n){var r=e.length;if(t=$e(t,0,r),n==="left"){for(;t>=0&&!a[t];)t--;t===-1&&(t=a.indexOf(!0))}else{for(;t<=r&&!a[t];)t++;t>r&&(t=a.lastIndexOf(!0))}return t===-1&&(t=r),t}function Je(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),a=0,n=t.length;a<n;a++)t[a]=!!(p(e[a])||p(e[a-1]));return t}function Ne(e,t,a,n,r,i){i===void 0&&(i=$);var f=me(function(u,w){var m,A;return xe(u)?(A="",m=""):typeof u=="number"||w?(A=typeof u=="number"?we(u):u,m=n(A)):(A=r(u,void 0),m=n(A)),{formattedValue:m,numAsString:A}}),s=(0,_.useState)(function(){return f(U(e)?t:e,a)}),v=s[0],h=s[1],d=me(function(u,w){u.formattedValue!==v.formattedValue&&h({formattedValue:u.formattedValue,numAsString:u.value}),i(u,w)}),o=e,g=a;U(e)&&(o=v.numAsString,g=!0);var y=f(o,g);return(0,_.useMemo)(function(){h(y)},[y.formattedValue]),(0,_.useEffect)(function(){if(!U(t)&&U(e)&&v.formattedValue!==""){var u=parseFloat(v.numAsString);d({formattedValue:v.formattedValue,value:v.numAsString,floatValue:isNaN(u)?void 0:u},{event:void 0,source:ae.props})}},[]),[v,d]}function Qe(e){return e.replace(/[^0-9]/g,"")}function Xe(e){return e}function Re(e){var t=e.type;t===void 0&&(t="text");var a=e.displayType;a===void 0&&(a="input");var n=e.customInput,r=e.renderText,i=e.getInputRef,f=e.format;f===void 0&&(f=Xe);var s=e.removeFormatting;s===void 0&&(s=Qe);var v=e.defaultValue,h=e.valueIsNumericString,d=e.onValueChange,o=e.isAllowed,g=e.onChange;g===void 0&&(g=$);var y=e.onKeyDown;y===void 0&&(y=$);var u=e.onMouseUp;u===void 0&&(u=$);var w=e.onFocus;w===void 0&&(w=$);var m=e.onBlur;m===void 0&&(m=$);var A=e.value,B=e.getCaretBoundary;B===void 0&&(B=Je);var R=e.isValidInputCharacter;R===void 0&&(R=p);var E=e.isCharacterSame,k=se(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),q=Ne(A,v,!!h,f,s,d),K=q[0],N=K.formattedValue,P=K.numAsString,Z=q[1],W=(0,_.useRef)(),G=(0,_.useRef)({formattedValue:N,numAsString:P}),J=function(l,c){G.current={formattedValue:l.formattedValue,numAsString:l.value},Z(l,c)},ee=(0,_.useState)(!1),re=ee[0],x=ee[1],S=(0,_.useRef)(null),D=(0,_.useRef)({setCaretTimeout:null,focusTimeout:null});(0,_.useEffect)(function(){return x(!0),function(){clearTimeout(D.current.setCaretTimeout),clearTimeout(D.current.focusTimeout)}},[]);var O=f,T=function(l,c){var b=parseFloat(c);return{formattedValue:l,value:c,floatValue:isNaN(b)?void 0:b}},L=function(l,c,b){l.selectionStart===0&&l.selectionEnd===l.value.length||(Y(l,c),D.current.setCaretTimeout=setTimeout(function(){l.value===b&&l.selectionStart!==c&&Y(l,c)},0))},M=function(l,c,b){return oe(l,c,B(l),b)},te=function(l,c,b){var F=B(c),j=Ge(c,N,l,b,F,R,E);return j=oe(c,j,F),j},ne=function(l){var c=l.formattedValue;c===void 0&&(c="");var b=l.input,F=l.source,j=l.event,I=l.numAsString,V;if(b){var z=l.inputValue||b.value,Q=ce(b);b.value=c,V=te(z,c,Q),V!==void 0&&L(b,V,c)}c!==N&&J(T(c,I),{event:j,source:F})};(0,_.useEffect)(function(){var l=G.current,c=l.formattedValue,b=l.numAsString;(N!==c||P!==b)&&J(T(N,P),{event:void 0,source:ae.props})},[N,P]);var ie=S.current?ce(S.current):void 0;(typeof window<"u"?_.useLayoutEffect:_.useEffect)(function(){var l=S.current;if(N!==G.current.formattedValue&&l){var c=te(G.current.formattedValue,N,ie);l.value=N,L(l,c,N)}},[N]);var fe=function(l,c,b){var F=c.target,j=W.current?He(W.current,F.selectionEnd):Ae(N,l),I=Object.assign(Object.assign({},j),{lastValue:N}),V=s(l,I),z=O(V);if(V=s(z,void 0),o&&!o(T(z,V))){var Q=c.target,X=te(l,N,ce(Q));return Q.value=N,L(Q,X,N),!1}return ne({formattedValue:z,numAsString:V,inputValue:l,event:c,source:b,input:c.target}),!0},de=function(l,c){c===void 0&&(c=0),W.current={selectionStart:l.selectionStart,selectionEnd:l.selectionEnd+c}},Ie=function(l){var c=l.target.value;fe(c,l,ae.event)&&g(l),W.current=void 0},De=function(l){var c=l.target,b=l.key,F=c.selectionStart,j=c.selectionEnd,I=c.value;I===void 0&&(I="");var V;b==="ArrowLeft"||b==="Backspace"?V=Math.max(F-1,0):b==="ArrowRight"?V=Math.min(F+1,I.length):b==="Delete"&&(V=F);var z=0;b==="Delete"&&F===j&&(z=1);var Q=b==="ArrowLeft"||b==="ArrowRight";if(V===void 0||F!==j&&!Q){y(l),de(c,z);return}var X=V;Q?(X=M(I,V,b==="ArrowLeft"?"left":"right"),X!==V&&l.preventDefault()):b==="Delete"&&!R(I[V])?X=M(I,V,"right"):b==="Backspace"&&!R(I[V])&&(X=M(I,V,"left")),X!==V&&L(c,X,I),y(l),de(c,z)},Le=function(l){var c=l.target,b=function(){var F=c.selectionStart,j=c.selectionEnd,I=c.value;if(I===void 0&&(I=""),F===j){var V=M(I,F);V!==F&&L(c,V,I)}};b(),requestAnimationFrame(function(){b()}),u(l),de(c)},Ee=function(l){l.persist&&l.persist();var c=l.target,b=l.currentTarget;S.current=c,D.current.focusTimeout=setTimeout(function(){var F=c.selectionStart,j=c.selectionEnd,I=c.value;I===void 0&&(I="");var V=M(I,F);V!==F&&!(F===0&&j===I.length)&&L(c,V,I),w(Object.assign(Object.assign({},l),{currentTarget:b}))},0)},Fe=function(l){S.current=null,clearTimeout(D.current.focusTimeout),clearTimeout(D.current.setCaretTimeout),m(l)},Be=re&&Ue()?"numeric":void 0,ge=Object.assign({inputMode:Be},k,{type:t,value:N,onChange:Ie,onKeyDown:De,onMouseUp:Le,onFocus:Ee,onBlur:Fe});if(a==="text")return r?_.default.createElement(_.default.Fragment,null,r(N,k)||null):_.default.createElement("span",Object.assign({},k,{ref:i}),N);if(n){var Oe=n;return _.default.createElement(Oe,Object.assign({},ge,{ref:i}))}return _.default.createElement("input",Object.assign({},ge,{ref:i}))}function Ce(e,t){var a=t.decimalScale,n=t.fixedDecimalScale,r=t.prefix;r===void 0&&(r="");var i=t.suffix;i===void 0&&(i="");var f=t.allowNegative,s=t.thousandsGroupStyle;if(s===void 0&&(s="thousand"),e===""||e==="-")return e;var v=le(t),h=v.thousandSeparator,d=v.decimalSeparator,o=a!==0&&e.indexOf(".")!==-1||a&&n,g=ve(e,f),y=g.beforeDecimal,u=g.afterDecimal,w=g.addNegation;return a!==void 0&&(u=be(u,a,!!n)),h&&(y=Ke(y,h,s)),r&&(y=r+y),i&&(u=u+i),w&&(y="-"+y),e=y+(o&&d||"")+u,e}function le(e){var t=e.decimalSeparator;t===void 0&&(t=".");var a=e.thousandSeparator,n=e.allowedDecimalSeparators;return a===!0&&(a=","),n||(n=[t,"."]),{decimalSeparator:t,thousandSeparator:a,allowedDecimalSeparators:n}}function Ye(e,t){e===void 0&&(e="");var a=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),r=a.test(e),i=n.test(e);return e=e.replace(/-/g,""),r&&!i&&t&&(e="-"+e),e}function pe(e,t){return new RegExp("(^-)|[0-9]|"+ye(e),t?"g":void 0)}function et(e,t,a){return e===""?!0:!t?.match(/\d/)&&!a?.match(/\d/)&&typeof e=="string"&&!isNaN(Number(e))}function tt(e,t,a){var n;t===void 0&&(t=Ve(e));var r=a.allowNegative,i=a.prefix;i===void 0&&(i="");var f=a.suffix;f===void 0&&(f="");var s=a.decimalScale,v=t.from,h=t.to,d=h.start,o=h.end,g=le(a),y=g.allowedDecimalSeparators,u=g.decimalSeparator,w=e[o]===u;if(p(e)&&(e===i||e===f)&&t.lastValue==="")return e;if(o-d===1&&y.indexOf(e[d])!==-1){var m=s===0?"":u;e=e.substring(0,d)+m+e.substring(d+1,e.length)}var A=function(S,D,O){var T=!1,L=!1;i.startsWith("-")?T=!1:S.startsWith("--")?(T=!1,L=!0):f.startsWith("-")&&S.length===f.length?T=!1:S[0]==="-"&&(T=!0);var M=T?1:0;return L&&(M=2),M&&(S=S.substring(M),D-=M,O-=M),{value:S,start:D,end:O,hasNegation:T}},B=A(e,d,o),R=B.hasNegation;n=B,e=n.value,d=n.start,o=n.end;var E=A(t.lastValue,v.start,v.end),k=E.start,q=E.end,K=E.value,N=e.substring(d,o);e.length&&K.length&&(k>K.length-f.length||q<i.length)&&!(N&&f.startsWith(N))&&(e=K);var P=0;e.startsWith(i)?P+=i.length:d<i.length&&(P=d),e=e.substring(P),o-=P;var Z=e.length,W=e.length-f.length;e.endsWith(f)?Z=W:(o>W||o>e.length-f.length)&&(Z=o),e=e.substring(0,Z),e=Ye(R?"-"+e:e,r),e=(e.match(pe(u,!0))||[]).join("");var G=e.indexOf(u);e=e.replace(new RegExp(ye(u),"g"),function(S,D){return D===G?".":""});var J=ve(e,r),ee=J.beforeDecimal,re=J.afterDecimal,x=J.addNegation;return h.end-h.start<v.end-v.start&&ee===""&&w&&!parseFloat(re)&&(e=x?"-":""),e}function at(e,t){var a=t.prefix;a===void 0&&(a="");var n=t.suffix;n===void 0&&(n="");var r=Array.from({length:e.length+1}).map(function(){return!0}),i=e[0]==="-";r.fill(!1,0,Math.min(a.length+(i?1:0),e.length));var f=e.length;return r.fill(!1,f-n.length+1,f+1),r}function rt(e){var t=le(e),a=t.thousandSeparator,n=t.decimalSeparator,r=e.prefix;r===void 0&&(r="");var i=e.allowNegative;if(i===void 0&&(i=!0),a===n)throw new Error(`
2
2
  Decimal separator can't be same as thousand separator.
3
3
  thousandSeparator: `+a+` (thousandSeparator = {true} is same as thousandSeparator = ",")
4
4
  decimalSeparator: `+n+` (default value for decimalSeparator is .)
@@ -8,4 +8,4 @@ const Te=require("./chunk-CW3en5xf.cjs"),C=require("./utils-DtinAjAU.cjs"),ue=re
8
8
  allowNegative: `+i+`
9
9
  `),i=!1),Object.assign(Object.assign({},e),{allowNegative:i})}function nt(e){e=rt(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,a=e.allowNegative,n=e.allowLeadingZeros,r=e.onKeyDown;r===void 0&&(r=$);var i=e.onBlur;i===void 0&&(i=$);var f=e.thousandSeparator,s=e.decimalScale,v=e.fixedDecimalScale,h=e.prefix;h===void 0&&(h="");var d=e.defaultValue,o=e.value,g=e.valueIsNumericString,y=e.onValueChange,u=se(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),w=le(e),m=w.decimalSeparator,A=w.allowedDecimalSeparators,B=function(x){return Ce(x,e)},R=function(x,S){return tt(x,S,e)},E=U(o)?d:o,k=g??et(E,h,t);U(o)?U(d)||(k=k||typeof d=="number"):k=k||typeof o=="number";var q=function(x){return xe(x)?x:(typeof x=="number"&&(x=we(x)),k&&typeof s=="number"?Se(x,s,!!v):x)},K=Ne(q(o),q(d),!!k,B,R,y),N=K[0],P=N.numAsString,Z=N.formattedValue,W=K[1],G=function(x){var S=x.target,D=x.key,O=S.selectionStart,T=S.selectionEnd,L=S.value;if(L===void 0&&(L=""),(D==="Backspace"||D==="Delete")&&T<h.length&&L!=="-"){x.preventDefault();return}if(O!==T){r(x);return}D==="Backspace"&&L[0]==="-"&&O===h.length+1&&a&&Y(S,1),s&&v&&(D==="Backspace"&&L[O-1]===m?(Y(S,O-1),x.preventDefault()):D==="Delete"&&L[O]===m&&x.preventDefault()),A?.includes(D)&&L[O]===m&&Y(S,O+1);var M=f===!0?",":f;D==="Backspace"&&L[O-1]===M&&Y(S,O-1),D==="Delete"&&L[O]===M&&Y(S,O+1),r(x)},J=function(x){var S=P;S.match(/\d/g)||(S=""),n||(S=ze(S)),v&&s&&(S=Se(S,s,v)),S!==P&&W({formattedValue:Ce(S,e),value:S,floatValue:parseFloat(S)},{event:x,source:ae.event}),i(x)},ee=function(x){return x===m?!0:p(x)},re=function(x){var S=x.currentValue,D=x.lastValue,O=x.formattedValue,T=x.currentValueIndex,L=x.formattedValueIndex,M=S[T],te=O[L],ne=Ae(D,S).to,ie=function(fe){return R(fe).indexOf(".")+h.length};return o===0&&v&&s&&S[ne.start]===m&&ie(S)<T&&ie(O)>L?!1:T>=ne.start&&T<ne.end&&A&&A.includes(M)&&te===m?!0:M===te};return Object.assign(Object.assign({},u),{value:Z,valueIsNumericString:!1,isValidInputCharacter:ee,isCharacterSame:re,onValueChange:W,format:B,removeFormatting:R,getCaretBoundary:function(x){return at(x,e)},onKeyDown:G,onBlur:J})}function it(e){var t=nt(e);return _.default.createElement(Re,Object.assign({},t))}function ut(e,t){var a=t.format,n=t.allowEmptyFormatting,r=t.mask,i=t.patternChar;if(i===void 0&&(i="#"),e===""&&!n)return"";for(var f=0,s=a.split(""),v=0,h=a.length;v<h;v++)a[v]===i&&(s[v]=e[f]||_e(r,f),f+=1);return s.join("")}function ot(e,t,a){t===void 0&&(t=Ve(e));var n=a.format,r=a.patternChar;r===void 0&&(r="#");var i=t.from,f=t.to,s=t.lastValue;s===void 0&&(s="");var v=function(m){return n[m]===r},h=function(m,A){for(var B="",R=0;R<m.length;R++)v(A+R)&&p(m[R])&&(B+=m[R]);return B},d=function(m){return m.replace(/[^0-9]/g,"")};if(!n.match(/\d/))return d(e);if((s===""||i.end-i.start===s.length)&&e.length===n.length){for(var o="",g=0;g<e.length;g++)if(v(g))p(e[g])&&(o+=e[g]);else if(e[g]!==n[g])return d(e);return o}var y=s.substring(0,i.start),u=e.substring(f.start,f.end),w=s.substring(i.end);return""+h(y,0)+d(u)+h(w,i.end)}function lt(e,t){var a=t.format,n=t.mask,r=t.patternChar;r===void 0&&(r="#");var i=Array.from({length:e.length+1}).map(function(){return!0}),f=0,s=-1,v={};a.split("").forEach(function(g,y){var u=void 0;g===r&&(f++,u=_e(n,f-1),s===-1&&e[y]===u&&(s=y)),v[y]=u});for(var h=function(g){return a[g]===r&&e[g]!==v[g]},d=0,o=i.length;d<o;d++)i[d]=d===s||h(d)||h(d-1);return i[a.indexOf(r)]=!0,i}function ft(e){var t=e.mask;if(t&&(t==="string"?t:t.toString()).match(/\d/g))throw new Error("Mask "+t+" should not contain numeric character;")}function dt(e,t){return e===""?!0:!t?.match(/\d/)&&typeof e=="string"&&(!!e.match(/^\d+$/)||e==="")}function ct(e){e.mask,e.allowEmptyFormatting;var t=e.format,a=e.inputMode;a===void 0&&(a="numeric");var n=e.onKeyDown;n===void 0&&(n=$);var r=e.patternChar;r===void 0&&(r="#");var i=e.value,f=e.defaultValue,s=e.valueIsNumericString,v=se(e,["mask","allowEmptyFormatting","format","inputMode","onKeyDown","patternChar","value","defaultValue","valueIsNumericString"]);ft(e);var h=function(u){return lt(u,e)},d=function(u){var w=u.key,m=u.target,A=m.selectionStart,B=m.selectionEnd,R=m.value;if(A!==B){n(u);return}var E=A;if(w==="Backspace"||w==="Delete"){var k="right";if(w==="Backspace"){for(;E>0&&t[E-1]!==r;)E--;k="left"}else{for(var q=t.length;E<q&&t[E]!==r;)E++;k="right"}E=oe(R,E,h(R),k)}else t[E]!==r&&w!=="ArrowLeft"&&w!=="ArrowRight"&&(E=oe(R,E+1,h(R),"right"));E!==A&&Y(m,E),n(u)},o=U(i)?f:i,g=s??dt(o,t),y=Object.assign(Object.assign({},e),{valueIsNumericString:g});return Object.assign(Object.assign({},v),{value:i,defaultValue:f,valueIsNumericString:g,inputMode:a,format:function(u){return ut(u,y)},removeFormatting:function(u,w){return ot(u,w,y)},getCaretBoundary:h,onKeyDown:d})}function st(e){var t=ct(e);return _.default.createElement(Re,Object.assign({},t))}var vt=e=>{const t=(0,_.useCallback)(d=>{if(e.variety==="standard"){const o=typeof d=="string"?d:d.value,g=e.isNoSpaces?o.replace(/\s+/g,""):o;e.onChange?.(g)}(e.variety==="pattern"||e.variety==="numeric")&&typeof d!="string"&&e.onChange?.(d)},[e]),{className:a,style:n}=ke.useTypographyStyles({sx:{family:e.isNiceNumber?"Roboto Mono":e.sxTypography?.family,size:16,weight:e.isBold?"700":"400",height:"1",...e?.sxTypography}}),{className:r,style:i}=(0,_.useMemo)(()=>{const d=ue.setClasses([C.CSS_CLASS.component.input.wrapper,C.CSS_CLASS.transition.color,e.error?.isError&&C.CSS_CLASS.isError,C.CSS_CLASS.control[e.isDisabled?"none":e.control??"boxShadow"],e.isWidthAsHeight&&C.CSS_CLASS.component.input.wrapperIsWidthAsHeight,e.isZeroRadius&&C.CSS_CLASS.component.input.wrapperIsZeroRadius,e.isHidden&&C.CSS_CLASS.component.input.wrapperIsHidden,e.isHiddenBorder&&C.CSS_CLASS.component.input.wrapperIsHiddenBorder,e.isFullRadius&&C.CSS_CLASS.component.input.wrapperIsFullRadius,e.isWidthAsHeight&&C.CSS_CLASS.component.input.wrapperIsWidthAsHeight,e.isMinWidthAsContent&&C.CSS_CLASS.component.input.wrapperIsMinWidthAsContent,e.isCenter&&C.CSS_CLASS.component.input.wrapperIsCenter,e.className]),o={};return o[C.CSS_VARS_RAW.component.input.height]=C.CSS_VARS.size[e.size].height,o[C.CSS_VARS_RAW.component.input.radius]=C.CSS_VARS.size[e.size].radius,o[C.CSS_VARS_RAW.component.input.borderColor]=C.CSS_VARS.genre.input[e.genre].border,o[C.CSS_VARS_RAW.component.input.background]=C.CSS_VARS.genre.input[e.genre].background,e.postfixChildren?.left&&(o[C.CSS_VARS_RAW.component.input.postfixLeft]=e.postfixChildren?.left),e.postfixChildren?.right&&(o[C.CSS_VARS_RAW.component.input.postfixRight]=e.postfixChildren?.right),e.postfixChildren?.width&&(o[C.CSS_VARS_RAW.component.input.postfixWidth]=e.postfixChildren?.width),e.prefixChildren?.left&&(o[C.CSS_VARS_RAW.component.input.prefixLeft]=e.prefixChildren?.left),e.prefixChildren?.right&&(o[C.CSS_VARS_RAW.component.input.prefixRight]=e.prefixChildren?.right),e.prefixChildren?.width&&(o[C.CSS_VARS_RAW.component.input.prefixWidth]=e.prefixChildren?.width),{className:d,style:ue.setStyles([Object.keys(o).length?o:void 0,e.style])}},[e.className,e.isWidthAsHeight,e.size,e.style,e.isDisabled,e.isHidden,e.isFullRadius,e.isHiddenBorder,e.isMinWidthAsContent,e.isZeroRadius,e.genre,e.postfixChildren?.left,e.postfixChildren?.right,e.postfixChildren?.width,e.prefixChildren?.left,e.prefixChildren?.right,e.prefixChildren?.width,e.control,e.isCenter,e.error?.isError]),{className:f,style:s}=(0,_.useMemo)(()=>{const d=ue.setClasses([C.CSS_CLASS.component.input.root,C.CSS_CLASS.transition.color,a,e.prefixChildren&&C.CSS_CLASS.component.input.hasPrefix,e.postfixChildren&&C.CSS_CLASS.component.input.hasPostfix]),o={};return o[C.CSS_VARS_RAW.component.input.color]=C.CSS_VARS.genre.input[e.genre].color,o[C.CSS_VARS_RAW.component.input.placeholderColor]=C.CSS_VARS.genre.input[e.genre].placeholder,o[C.CSS_VARS_RAW.component.input.padding]=C.CSS_VARS.size[e.size].padding,{className:d,style:ue.setStyles([e.style,n,Object.keys(o).length?o:void 0])}},[e.size,e.style,e.genre,a,n,e.postfixChildren,e.prefixChildren]),v=(0,_.useRef)(null),h=Me.useMergeRefs([v,e.ref]);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)("div",{className:r,style:i,children:[e.prefixChildren&&(0,H.jsx)("div",{onMouseDown:d=>{e.prefixChildren?.isFocusInput&&(d.preventDefault(),v.current?.focus())},className:C.CSS_CLASS.component.input.prefix,children:e.prefixChildren.children}),e.variety==="pattern"?(0,H.jsx)(st,{className:f,style:s,disabled:e.isDisabled,readOnly:e.isReadOnly,required:e.isRequired,defaultValue:e.defaultValue===null?"":e.defaultValue,value:e.value===null?"":e.value,placeholder:e.placeholder,onValueChange:d=>t(d),onBlur:e.onBlur,onFocus:e.onFocus,onPaste:e.onPaste,onKeyDown:e.onKeyDown,name:e.name,"aria-label":e.ariaLabel??e.name,id:e.id,inputMode:e.inputMode,maxLength:e.maxLength,minLength:e.minLength,tabIndex:e.tabIndex,getInputRef:h,...e.propsPattern}):e.variety==="numeric"?(0,H.jsx)(it,{className:f,style:s,disabled:e.isDisabled,readOnly:e.isReadOnly,required:e.isRequired,defaultValue:e.defaultValue===null?"":e.defaultValue,value:e.value===null?"":e.value,placeholder:e.placeholder,onValueChange:d=>t(d),onBlur:e.onBlur,onFocus:e.onFocus,onPaste:e.onPaste,onKeyDown:e.onKeyDown,name:e.name,"aria-label":e.ariaLabel??e.name,id:e.id,inputMode:e.inputMode,maxLength:e.maxLength,minLength:e.minLength,tabIndex:e.tabIndex,getInputRef:h,...e.propsNumeric}):(0,H.jsx)("input",{className:f,style:s,inputMode:e.inputMode,maxLength:e.maxLength,minLength:e.minLength,ref:h,disabled:e.isDisabled,readOnly:e.isReadOnly,required:e.isRequired,defaultValue:e.defaultValue===null?"":e.defaultValue,value:e.value===null?"":e.value,placeholder:e.placeholder,type:e.type,autoComplete:e.autoComplete,onInput:d=>{const o=d.target;t(o.value)},onBlur:e.onBlur,onFocus:e.onFocus,onPaste:e.onPaste,onKeyDown:e.onKeyDown,name:e.name,"aria-label":e.ariaLabel??e.name,id:e.id,tabIndex:e.tabIndex,min:e.min,max:e.max,step:e.step}),e.postfixChildren&&(0,H.jsx)("div",{onMouseDown:d=>{e.postfixChildren?.isFocusInput&&(d.preventDefault(),v?.current?.focus())},className:C.CSS_CLASS.component.input.postfix,children:e.postfixChildren.children})]}),e?.error?.isError&&(0,H.jsx)(je.ErrorMessage,{size:e?.error.size??e.size,sxTypography:{size:16,weight:"400",...e?.error.sxTypography},...e.error})]})};Object.defineProperty(exports,"Input",{enumerable:!0,get:function(){return vt}});
10
10
 
11
- //# sourceMappingURL=input-CWcWWMCp.cjs.map
11
+ //# sourceMappingURL=input-zXF5f99Z.cjs.map