dino-validation 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (535) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +1880 -0
  3. package/dist/dv.esm.js +1667 -0
  4. package/dist/dv.esm.js.map +1 -0
  5. package/dist/dv.js +1684 -0
  6. package/dist/dv.js.map +1 -0
  7. package/dist/dv.min.js +12 -0
  8. package/dist/dv.min.js.map +1 -0
  9. package/dist/localization/messages_ar.esm.js +36 -0
  10. package/dist/localization/messages_ar.esm.js.map +1 -0
  11. package/dist/localization/messages_ar.js +42 -0
  12. package/dist/localization/messages_ar.js.map +1 -0
  13. package/dist/localization/messages_ar.min.js +12 -0
  14. package/dist/localization/messages_ar.min.js.map +1 -0
  15. package/dist/localization/messages_az.esm.js +36 -0
  16. package/dist/localization/messages_az.esm.js.map +1 -0
  17. package/dist/localization/messages_az.js +42 -0
  18. package/dist/localization/messages_az.js.map +1 -0
  19. package/dist/localization/messages_az.min.js +12 -0
  20. package/dist/localization/messages_az.min.js.map +1 -0
  21. package/dist/localization/messages_bg.esm.js +36 -0
  22. package/dist/localization/messages_bg.esm.js.map +1 -0
  23. package/dist/localization/messages_bg.js +42 -0
  24. package/dist/localization/messages_bg.js.map +1 -0
  25. package/dist/localization/messages_bg.min.js +12 -0
  26. package/dist/localization/messages_bg.min.js.map +1 -0
  27. package/dist/localization/messages_bn_BD.esm.js +36 -0
  28. package/dist/localization/messages_bn_BD.esm.js.map +1 -0
  29. package/dist/localization/messages_bn_BD.js +42 -0
  30. package/dist/localization/messages_bn_BD.js.map +1 -0
  31. package/dist/localization/messages_bn_BD.min.js +12 -0
  32. package/dist/localization/messages_bn_BD.min.js.map +1 -0
  33. package/dist/localization/messages_ca.esm.js +36 -0
  34. package/dist/localization/messages_ca.esm.js.map +1 -0
  35. package/dist/localization/messages_ca.js +42 -0
  36. package/dist/localization/messages_ca.js.map +1 -0
  37. package/dist/localization/messages_ca.min.js +12 -0
  38. package/dist/localization/messages_ca.min.js.map +1 -0
  39. package/dist/localization/messages_cs.esm.js +36 -0
  40. package/dist/localization/messages_cs.esm.js.map +1 -0
  41. package/dist/localization/messages_cs.js +42 -0
  42. package/dist/localization/messages_cs.js.map +1 -0
  43. package/dist/localization/messages_cs.min.js +12 -0
  44. package/dist/localization/messages_cs.min.js.map +1 -0
  45. package/dist/localization/messages_da.esm.js +35 -0
  46. package/dist/localization/messages_da.esm.js.map +1 -0
  47. package/dist/localization/messages_da.js +41 -0
  48. package/dist/localization/messages_da.js.map +1 -0
  49. package/dist/localization/messages_da.min.js +12 -0
  50. package/dist/localization/messages_da.min.js.map +1 -0
  51. package/dist/localization/messages_de.esm.js +36 -0
  52. package/dist/localization/messages_de.esm.js.map +1 -0
  53. package/dist/localization/messages_de.js +42 -0
  54. package/dist/localization/messages_de.js.map +1 -0
  55. package/dist/localization/messages_de.min.js +12 -0
  56. package/dist/localization/messages_de.min.js.map +1 -0
  57. package/dist/localization/messages_el.esm.js +36 -0
  58. package/dist/localization/messages_el.esm.js.map +1 -0
  59. package/dist/localization/messages_el.js +42 -0
  60. package/dist/localization/messages_el.js.map +1 -0
  61. package/dist/localization/messages_el.min.js +12 -0
  62. package/dist/localization/messages_el.min.js.map +1 -0
  63. package/dist/localization/messages_es.esm.js +36 -0
  64. package/dist/localization/messages_es.esm.js.map +1 -0
  65. package/dist/localization/messages_es.js +42 -0
  66. package/dist/localization/messages_es.js.map +1 -0
  67. package/dist/localization/messages_es.min.js +12 -0
  68. package/dist/localization/messages_es.min.js.map +1 -0
  69. package/dist/localization/messages_es_AR.esm.js +36 -0
  70. package/dist/localization/messages_es_AR.esm.js.map +1 -0
  71. package/dist/localization/messages_es_AR.js +42 -0
  72. package/dist/localization/messages_es_AR.js.map +1 -0
  73. package/dist/localization/messages_es_AR.min.js +12 -0
  74. package/dist/localization/messages_es_AR.min.js.map +1 -0
  75. package/dist/localization/messages_es_PE.esm.js +36 -0
  76. package/dist/localization/messages_es_PE.esm.js.map +1 -0
  77. package/dist/localization/messages_es_PE.js +42 -0
  78. package/dist/localization/messages_es_PE.js.map +1 -0
  79. package/dist/localization/messages_es_PE.min.js +12 -0
  80. package/dist/localization/messages_es_PE.min.js.map +1 -0
  81. package/dist/localization/messages_et.esm.js +36 -0
  82. package/dist/localization/messages_et.esm.js.map +1 -0
  83. package/dist/localization/messages_et.js +42 -0
  84. package/dist/localization/messages_et.js.map +1 -0
  85. package/dist/localization/messages_et.min.js +12 -0
  86. package/dist/localization/messages_et.min.js.map +1 -0
  87. package/dist/localization/messages_eu.esm.js +36 -0
  88. package/dist/localization/messages_eu.esm.js.map +1 -0
  89. package/dist/localization/messages_eu.js +42 -0
  90. package/dist/localization/messages_eu.js.map +1 -0
  91. package/dist/localization/messages_eu.min.js +12 -0
  92. package/dist/localization/messages_eu.min.js.map +1 -0
  93. package/dist/localization/messages_fa.esm.js +36 -0
  94. package/dist/localization/messages_fa.esm.js.map +1 -0
  95. package/dist/localization/messages_fa.js +42 -0
  96. package/dist/localization/messages_fa.js.map +1 -0
  97. package/dist/localization/messages_fa.min.js +12 -0
  98. package/dist/localization/messages_fa.min.js.map +1 -0
  99. package/dist/localization/messages_fi.esm.js +36 -0
  100. package/dist/localization/messages_fi.esm.js.map +1 -0
  101. package/dist/localization/messages_fi.js +42 -0
  102. package/dist/localization/messages_fi.js.map +1 -0
  103. package/dist/localization/messages_fi.min.js +12 -0
  104. package/dist/localization/messages_fi.min.js.map +1 -0
  105. package/dist/localization/messages_fr.esm.js +33 -0
  106. package/dist/localization/messages_fr.esm.js.map +1 -0
  107. package/dist/localization/messages_fr.js +39 -0
  108. package/dist/localization/messages_fr.js.map +1 -0
  109. package/dist/localization/messages_fr.min.js +12 -0
  110. package/dist/localization/messages_fr.min.js.map +1 -0
  111. package/dist/localization/messages_ge.esm.js +36 -0
  112. package/dist/localization/messages_ge.esm.js.map +1 -0
  113. package/dist/localization/messages_ge.js +42 -0
  114. package/dist/localization/messages_ge.js.map +1 -0
  115. package/dist/localization/messages_ge.min.js +12 -0
  116. package/dist/localization/messages_ge.min.js.map +1 -0
  117. package/dist/localization/messages_gl.esm.js +36 -0
  118. package/dist/localization/messages_gl.esm.js.map +1 -0
  119. package/dist/localization/messages_gl.js +42 -0
  120. package/dist/localization/messages_gl.js.map +1 -0
  121. package/dist/localization/messages_gl.min.js +12 -0
  122. package/dist/localization/messages_gl.min.js.map +1 -0
  123. package/dist/localization/messages_he.esm.js +36 -0
  124. package/dist/localization/messages_he.esm.js.map +1 -0
  125. package/dist/localization/messages_he.js +42 -0
  126. package/dist/localization/messages_he.js.map +1 -0
  127. package/dist/localization/messages_he.min.js +12 -0
  128. package/dist/localization/messages_he.min.js.map +1 -0
  129. package/dist/localization/messages_hi.esm.js +36 -0
  130. package/dist/localization/messages_hi.esm.js.map +1 -0
  131. package/dist/localization/messages_hi.js +42 -0
  132. package/dist/localization/messages_hi.js.map +1 -0
  133. package/dist/localization/messages_hi.min.js +12 -0
  134. package/dist/localization/messages_hi.min.js.map +1 -0
  135. package/dist/localization/messages_hr.esm.js +36 -0
  136. package/dist/localization/messages_hr.esm.js.map +1 -0
  137. package/dist/localization/messages_hr.js +42 -0
  138. package/dist/localization/messages_hr.js.map +1 -0
  139. package/dist/localization/messages_hr.min.js +12 -0
  140. package/dist/localization/messages_hr.min.js.map +1 -0
  141. package/dist/localization/messages_hu.esm.js +36 -0
  142. package/dist/localization/messages_hu.esm.js.map +1 -0
  143. package/dist/localization/messages_hu.js +42 -0
  144. package/dist/localization/messages_hu.js.map +1 -0
  145. package/dist/localization/messages_hu.min.js +12 -0
  146. package/dist/localization/messages_hu.min.js.map +1 -0
  147. package/dist/localization/messages_hy_AM.esm.js +36 -0
  148. package/dist/localization/messages_hy_AM.esm.js.map +1 -0
  149. package/dist/localization/messages_hy_AM.js +42 -0
  150. package/dist/localization/messages_hy_AM.js.map +1 -0
  151. package/dist/localization/messages_hy_AM.min.js +12 -0
  152. package/dist/localization/messages_hy_AM.min.js.map +1 -0
  153. package/dist/localization/messages_id.esm.js +36 -0
  154. package/dist/localization/messages_id.esm.js.map +1 -0
  155. package/dist/localization/messages_id.js +42 -0
  156. package/dist/localization/messages_id.js.map +1 -0
  157. package/dist/localization/messages_id.min.js +12 -0
  158. package/dist/localization/messages_id.min.js.map +1 -0
  159. package/dist/localization/messages_is.esm.js +35 -0
  160. package/dist/localization/messages_is.esm.js.map +1 -0
  161. package/dist/localization/messages_is.js +41 -0
  162. package/dist/localization/messages_is.js.map +1 -0
  163. package/dist/localization/messages_is.min.js +12 -0
  164. package/dist/localization/messages_is.min.js.map +1 -0
  165. package/dist/localization/messages_it.esm.js +36 -0
  166. package/dist/localization/messages_it.esm.js.map +1 -0
  167. package/dist/localization/messages_it.js +42 -0
  168. package/dist/localization/messages_it.js.map +1 -0
  169. package/dist/localization/messages_it.min.js +12 -0
  170. package/dist/localization/messages_it.min.js.map +1 -0
  171. package/dist/localization/messages_ja.esm.js +36 -0
  172. package/dist/localization/messages_ja.esm.js.map +1 -0
  173. package/dist/localization/messages_ja.js +42 -0
  174. package/dist/localization/messages_ja.js.map +1 -0
  175. package/dist/localization/messages_ja.min.js +12 -0
  176. package/dist/localization/messages_ja.min.js.map +1 -0
  177. package/dist/localization/messages_ka.esm.js +36 -0
  178. package/dist/localization/messages_ka.esm.js.map +1 -0
  179. package/dist/localization/messages_ka.js +42 -0
  180. package/dist/localization/messages_ka.js.map +1 -0
  181. package/dist/localization/messages_ka.min.js +12 -0
  182. package/dist/localization/messages_ka.min.js.map +1 -0
  183. package/dist/localization/messages_kk.esm.js +36 -0
  184. package/dist/localization/messages_kk.esm.js.map +1 -0
  185. package/dist/localization/messages_kk.js +42 -0
  186. package/dist/localization/messages_kk.js.map +1 -0
  187. package/dist/localization/messages_kk.min.js +12 -0
  188. package/dist/localization/messages_kk.min.js.map +1 -0
  189. package/dist/localization/messages_ko.esm.js +36 -0
  190. package/dist/localization/messages_ko.esm.js.map +1 -0
  191. package/dist/localization/messages_ko.js +42 -0
  192. package/dist/localization/messages_ko.js.map +1 -0
  193. package/dist/localization/messages_ko.min.js +12 -0
  194. package/dist/localization/messages_ko.min.js.map +1 -0
  195. package/dist/localization/messages_lt.esm.js +36 -0
  196. package/dist/localization/messages_lt.esm.js.map +1 -0
  197. package/dist/localization/messages_lt.js +42 -0
  198. package/dist/localization/messages_lt.js.map +1 -0
  199. package/dist/localization/messages_lt.min.js +12 -0
  200. package/dist/localization/messages_lt.min.js.map +1 -0
  201. package/dist/localization/messages_lv.esm.js +36 -0
  202. package/dist/localization/messages_lv.esm.js.map +1 -0
  203. package/dist/localization/messages_lv.js +42 -0
  204. package/dist/localization/messages_lv.js.map +1 -0
  205. package/dist/localization/messages_lv.min.js +12 -0
  206. package/dist/localization/messages_lv.min.js.map +1 -0
  207. package/dist/localization/messages_mk.esm.js +36 -0
  208. package/dist/localization/messages_mk.esm.js.map +1 -0
  209. package/dist/localization/messages_mk.js +42 -0
  210. package/dist/localization/messages_mk.js.map +1 -0
  211. package/dist/localization/messages_mk.min.js +12 -0
  212. package/dist/localization/messages_mk.min.js.map +1 -0
  213. package/dist/localization/messages_my.esm.js +36 -0
  214. package/dist/localization/messages_my.esm.js.map +1 -0
  215. package/dist/localization/messages_my.js +42 -0
  216. package/dist/localization/messages_my.js.map +1 -0
  217. package/dist/localization/messages_my.min.js +12 -0
  218. package/dist/localization/messages_my.min.js.map +1 -0
  219. package/dist/localization/messages_nl.esm.js +36 -0
  220. package/dist/localization/messages_nl.esm.js.map +1 -0
  221. package/dist/localization/messages_nl.js +42 -0
  222. package/dist/localization/messages_nl.js.map +1 -0
  223. package/dist/localization/messages_nl.min.js +12 -0
  224. package/dist/localization/messages_nl.min.js.map +1 -0
  225. package/dist/localization/messages_no.esm.js +36 -0
  226. package/dist/localization/messages_no.esm.js.map +1 -0
  227. package/dist/localization/messages_no.js +42 -0
  228. package/dist/localization/messages_no.js.map +1 -0
  229. package/dist/localization/messages_no.min.js +12 -0
  230. package/dist/localization/messages_no.min.js.map +1 -0
  231. package/dist/localization/messages_pl.esm.js +36 -0
  232. package/dist/localization/messages_pl.esm.js.map +1 -0
  233. package/dist/localization/messages_pl.js +42 -0
  234. package/dist/localization/messages_pl.js.map +1 -0
  235. package/dist/localization/messages_pl.min.js +12 -0
  236. package/dist/localization/messages_pl.min.js.map +1 -0
  237. package/dist/localization/messages_pt_BR.esm.js +36 -0
  238. package/dist/localization/messages_pt_BR.esm.js.map +1 -0
  239. package/dist/localization/messages_pt_BR.js +42 -0
  240. package/dist/localization/messages_pt_BR.js.map +1 -0
  241. package/dist/localization/messages_pt_BR.min.js +12 -0
  242. package/dist/localization/messages_pt_BR.min.js.map +1 -0
  243. package/dist/localization/messages_pt_PT.esm.js +36 -0
  244. package/dist/localization/messages_pt_PT.esm.js.map +1 -0
  245. package/dist/localization/messages_pt_PT.js +42 -0
  246. package/dist/localization/messages_pt_PT.js.map +1 -0
  247. package/dist/localization/messages_pt_PT.min.js +12 -0
  248. package/dist/localization/messages_pt_PT.min.js.map +1 -0
  249. package/dist/localization/messages_ro.esm.js +36 -0
  250. package/dist/localization/messages_ro.esm.js.map +1 -0
  251. package/dist/localization/messages_ro.js +42 -0
  252. package/dist/localization/messages_ro.js.map +1 -0
  253. package/dist/localization/messages_ro.min.js +12 -0
  254. package/dist/localization/messages_ro.min.js.map +1 -0
  255. package/dist/localization/messages_ru.esm.js +36 -0
  256. package/dist/localization/messages_ru.esm.js.map +1 -0
  257. package/dist/localization/messages_ru.js +42 -0
  258. package/dist/localization/messages_ru.js.map +1 -0
  259. package/dist/localization/messages_ru.min.js +12 -0
  260. package/dist/localization/messages_ru.min.js.map +1 -0
  261. package/dist/localization/messages_sd.esm.js +36 -0
  262. package/dist/localization/messages_sd.esm.js.map +1 -0
  263. package/dist/localization/messages_sd.js +42 -0
  264. package/dist/localization/messages_sd.js.map +1 -0
  265. package/dist/localization/messages_sd.min.js +12 -0
  266. package/dist/localization/messages_sd.min.js.map +1 -0
  267. package/dist/localization/messages_si.esm.js +36 -0
  268. package/dist/localization/messages_si.esm.js.map +1 -0
  269. package/dist/localization/messages_si.js +42 -0
  270. package/dist/localization/messages_si.js.map +1 -0
  271. package/dist/localization/messages_si.min.js +12 -0
  272. package/dist/localization/messages_si.min.js.map +1 -0
  273. package/dist/localization/messages_sk.esm.js +35 -0
  274. package/dist/localization/messages_sk.esm.js.map +1 -0
  275. package/dist/localization/messages_sk.js +41 -0
  276. package/dist/localization/messages_sk.js.map +1 -0
  277. package/dist/localization/messages_sk.min.js +12 -0
  278. package/dist/localization/messages_sk.min.js.map +1 -0
  279. package/dist/localization/messages_sl.esm.js +36 -0
  280. package/dist/localization/messages_sl.esm.js.map +1 -0
  281. package/dist/localization/messages_sl.js +42 -0
  282. package/dist/localization/messages_sl.js.map +1 -0
  283. package/dist/localization/messages_sl.min.js +12 -0
  284. package/dist/localization/messages_sl.min.js.map +1 -0
  285. package/dist/localization/messages_sr.esm.js +36 -0
  286. package/dist/localization/messages_sr.esm.js.map +1 -0
  287. package/dist/localization/messages_sr.js +42 -0
  288. package/dist/localization/messages_sr.js.map +1 -0
  289. package/dist/localization/messages_sr.min.js +12 -0
  290. package/dist/localization/messages_sr.min.js.map +1 -0
  291. package/dist/localization/messages_sr_lat.esm.js +36 -0
  292. package/dist/localization/messages_sr_lat.esm.js.map +1 -0
  293. package/dist/localization/messages_sr_lat.js +42 -0
  294. package/dist/localization/messages_sr_lat.js.map +1 -0
  295. package/dist/localization/messages_sr_lat.min.js +12 -0
  296. package/dist/localization/messages_sr_lat.min.js.map +1 -0
  297. package/dist/localization/messages_sv.esm.js +36 -0
  298. package/dist/localization/messages_sv.esm.js.map +1 -0
  299. package/dist/localization/messages_sv.js +42 -0
  300. package/dist/localization/messages_sv.js.map +1 -0
  301. package/dist/localization/messages_sv.min.js +12 -0
  302. package/dist/localization/messages_sv.min.js.map +1 -0
  303. package/dist/localization/messages_th.esm.js +36 -0
  304. package/dist/localization/messages_th.esm.js.map +1 -0
  305. package/dist/localization/messages_th.js +42 -0
  306. package/dist/localization/messages_th.js.map +1 -0
  307. package/dist/localization/messages_th.min.js +12 -0
  308. package/dist/localization/messages_th.min.js.map +1 -0
  309. package/dist/localization/messages_tj.esm.js +36 -0
  310. package/dist/localization/messages_tj.esm.js.map +1 -0
  311. package/dist/localization/messages_tj.js +42 -0
  312. package/dist/localization/messages_tj.js.map +1 -0
  313. package/dist/localization/messages_tj.min.js +12 -0
  314. package/dist/localization/messages_tj.min.js.map +1 -0
  315. package/dist/localization/messages_tr.esm.js +36 -0
  316. package/dist/localization/messages_tr.esm.js.map +1 -0
  317. package/dist/localization/messages_tr.js +42 -0
  318. package/dist/localization/messages_tr.js.map +1 -0
  319. package/dist/localization/messages_tr.min.js +12 -0
  320. package/dist/localization/messages_tr.min.js.map +1 -0
  321. package/dist/localization/messages_uk.esm.js +36 -0
  322. package/dist/localization/messages_uk.esm.js.map +1 -0
  323. package/dist/localization/messages_uk.js +42 -0
  324. package/dist/localization/messages_uk.js.map +1 -0
  325. package/dist/localization/messages_uk.min.js +12 -0
  326. package/dist/localization/messages_uk.min.js.map +1 -0
  327. package/dist/localization/messages_ur.esm.js +36 -0
  328. package/dist/localization/messages_ur.esm.js.map +1 -0
  329. package/dist/localization/messages_ur.js +42 -0
  330. package/dist/localization/messages_ur.js.map +1 -0
  331. package/dist/localization/messages_ur.min.js +12 -0
  332. package/dist/localization/messages_ur.min.js.map +1 -0
  333. package/dist/localization/messages_vi.esm.js +36 -0
  334. package/dist/localization/messages_vi.esm.js.map +1 -0
  335. package/dist/localization/messages_vi.js +42 -0
  336. package/dist/localization/messages_vi.js.map +1 -0
  337. package/dist/localization/messages_vi.min.js +12 -0
  338. package/dist/localization/messages_vi.min.js.map +1 -0
  339. package/dist/localization/messages_zh.esm.js +36 -0
  340. package/dist/localization/messages_zh.esm.js.map +1 -0
  341. package/dist/localization/messages_zh.js +42 -0
  342. package/dist/localization/messages_zh.js.map +1 -0
  343. package/dist/localization/messages_zh.min.js +12 -0
  344. package/dist/localization/messages_zh.min.js.map +1 -0
  345. package/dist/localization/messages_zh_TW.esm.js +36 -0
  346. package/dist/localization/messages_zh_TW.esm.js.map +1 -0
  347. package/dist/localization/messages_zh_TW.js +42 -0
  348. package/dist/localization/messages_zh_TW.js.map +1 -0
  349. package/dist/localization/messages_zh_TW.min.js +12 -0
  350. package/dist/localization/messages_zh_TW.min.js.map +1 -0
  351. package/dist/localization/methods_de.esm.js +25 -0
  352. package/dist/localization/methods_de.esm.js.map +1 -0
  353. package/dist/localization/methods_de.js +31 -0
  354. package/dist/localization/methods_de.js.map +1 -0
  355. package/dist/localization/methods_de.min.js +12 -0
  356. package/dist/localization/methods_de.min.js.map +1 -0
  357. package/dist/localization/methods_es_CL.esm.js +25 -0
  358. package/dist/localization/methods_es_CL.esm.js.map +1 -0
  359. package/dist/localization/methods_es_CL.js +31 -0
  360. package/dist/localization/methods_es_CL.js.map +1 -0
  361. package/dist/localization/methods_es_CL.min.js +12 -0
  362. package/dist/localization/methods_es_CL.min.js.map +1 -0
  363. package/dist/localization/methods_fi.esm.js +25 -0
  364. package/dist/localization/methods_fi.esm.js.map +1 -0
  365. package/dist/localization/methods_fi.js +31 -0
  366. package/dist/localization/methods_fi.js.map +1 -0
  367. package/dist/localization/methods_fi.min.js +12 -0
  368. package/dist/localization/methods_fi.min.js.map +1 -0
  369. package/dist/localization/methods_it.esm.js +25 -0
  370. package/dist/localization/methods_it.esm.js.map +1 -0
  371. package/dist/localization/methods_it.js +31 -0
  372. package/dist/localization/methods_it.js.map +1 -0
  373. package/dist/localization/methods_it.min.js +12 -0
  374. package/dist/localization/methods_it.min.js.map +1 -0
  375. package/dist/localization/methods_nl.esm.js +25 -0
  376. package/dist/localization/methods_nl.esm.js.map +1 -0
  377. package/dist/localization/methods_nl.js +31 -0
  378. package/dist/localization/methods_nl.js.map +1 -0
  379. package/dist/localization/methods_nl.min.js +12 -0
  380. package/dist/localization/methods_nl.min.js.map +1 -0
  381. package/dist/localization/methods_pt.esm.js +22 -0
  382. package/dist/localization/methods_pt.esm.js.map +1 -0
  383. package/dist/localization/methods_pt.js +28 -0
  384. package/dist/localization/methods_pt.js.map +1 -0
  385. package/dist/localization/methods_pt.min.js +12 -0
  386. package/dist/localization/methods_pt.min.js.map +1 -0
  387. package/dist/types/defaults.d.ts +3 -0
  388. package/dist/types/defaults.d.ts.map +1 -0
  389. package/dist/types/eventManager.d.ts +34 -0
  390. package/dist/types/eventManager.d.ts.map +1 -0
  391. package/dist/types/helpers.d.ts +86 -0
  392. package/dist/types/helpers.d.ts.map +1 -0
  393. package/dist/types/index.d.ts +100 -0
  394. package/dist/types/index.d.ts.map +1 -0
  395. package/dist/types/localization/messages_ar.d.ts +2 -0
  396. package/dist/types/localization/messages_ar.d.ts.map +1 -0
  397. package/dist/types/localization/messages_az.d.ts +2 -0
  398. package/dist/types/localization/messages_az.d.ts.map +1 -0
  399. package/dist/types/localization/messages_bg.d.ts +2 -0
  400. package/dist/types/localization/messages_bg.d.ts.map +1 -0
  401. package/dist/types/localization/messages_bn_BD.d.ts +2 -0
  402. package/dist/types/localization/messages_bn_BD.d.ts.map +1 -0
  403. package/dist/types/localization/messages_ca.d.ts +2 -0
  404. package/dist/types/localization/messages_ca.d.ts.map +1 -0
  405. package/dist/types/localization/messages_cs.d.ts +2 -0
  406. package/dist/types/localization/messages_cs.d.ts.map +1 -0
  407. package/dist/types/localization/messages_da.d.ts +2 -0
  408. package/dist/types/localization/messages_da.d.ts.map +1 -0
  409. package/dist/types/localization/messages_de.d.ts +2 -0
  410. package/dist/types/localization/messages_de.d.ts.map +1 -0
  411. package/dist/types/localization/messages_el.d.ts +2 -0
  412. package/dist/types/localization/messages_el.d.ts.map +1 -0
  413. package/dist/types/localization/messages_es.d.ts +2 -0
  414. package/dist/types/localization/messages_es.d.ts.map +1 -0
  415. package/dist/types/localization/messages_es_AR.d.ts +2 -0
  416. package/dist/types/localization/messages_es_AR.d.ts.map +1 -0
  417. package/dist/types/localization/messages_es_PE.d.ts +2 -0
  418. package/dist/types/localization/messages_es_PE.d.ts.map +1 -0
  419. package/dist/types/localization/messages_et.d.ts +2 -0
  420. package/dist/types/localization/messages_et.d.ts.map +1 -0
  421. package/dist/types/localization/messages_eu.d.ts +2 -0
  422. package/dist/types/localization/messages_eu.d.ts.map +1 -0
  423. package/dist/types/localization/messages_fa.d.ts +2 -0
  424. package/dist/types/localization/messages_fa.d.ts.map +1 -0
  425. package/dist/types/localization/messages_fi.d.ts +2 -0
  426. package/dist/types/localization/messages_fi.d.ts.map +1 -0
  427. package/dist/types/localization/messages_fr.d.ts +2 -0
  428. package/dist/types/localization/messages_fr.d.ts.map +1 -0
  429. package/dist/types/localization/messages_ge.d.ts +2 -0
  430. package/dist/types/localization/messages_ge.d.ts.map +1 -0
  431. package/dist/types/localization/messages_gl.d.ts +2 -0
  432. package/dist/types/localization/messages_gl.d.ts.map +1 -0
  433. package/dist/types/localization/messages_he.d.ts +2 -0
  434. package/dist/types/localization/messages_he.d.ts.map +1 -0
  435. package/dist/types/localization/messages_hi.d.ts +2 -0
  436. package/dist/types/localization/messages_hi.d.ts.map +1 -0
  437. package/dist/types/localization/messages_hr.d.ts +2 -0
  438. package/dist/types/localization/messages_hr.d.ts.map +1 -0
  439. package/dist/types/localization/messages_hu.d.ts +2 -0
  440. package/dist/types/localization/messages_hu.d.ts.map +1 -0
  441. package/dist/types/localization/messages_hy_AM.d.ts +2 -0
  442. package/dist/types/localization/messages_hy_AM.d.ts.map +1 -0
  443. package/dist/types/localization/messages_id.d.ts +2 -0
  444. package/dist/types/localization/messages_id.d.ts.map +1 -0
  445. package/dist/types/localization/messages_is.d.ts +2 -0
  446. package/dist/types/localization/messages_is.d.ts.map +1 -0
  447. package/dist/types/localization/messages_it.d.ts +2 -0
  448. package/dist/types/localization/messages_it.d.ts.map +1 -0
  449. package/dist/types/localization/messages_ja.d.ts +2 -0
  450. package/dist/types/localization/messages_ja.d.ts.map +1 -0
  451. package/dist/types/localization/messages_ka.d.ts +2 -0
  452. package/dist/types/localization/messages_ka.d.ts.map +1 -0
  453. package/dist/types/localization/messages_kk.d.ts +2 -0
  454. package/dist/types/localization/messages_kk.d.ts.map +1 -0
  455. package/dist/types/localization/messages_ko.d.ts +2 -0
  456. package/dist/types/localization/messages_ko.d.ts.map +1 -0
  457. package/dist/types/localization/messages_lt.d.ts +2 -0
  458. package/dist/types/localization/messages_lt.d.ts.map +1 -0
  459. package/dist/types/localization/messages_lv.d.ts +2 -0
  460. package/dist/types/localization/messages_lv.d.ts.map +1 -0
  461. package/dist/types/localization/messages_mk.d.ts +2 -0
  462. package/dist/types/localization/messages_mk.d.ts.map +1 -0
  463. package/dist/types/localization/messages_my.d.ts +2 -0
  464. package/dist/types/localization/messages_my.d.ts.map +1 -0
  465. package/dist/types/localization/messages_nl.d.ts +2 -0
  466. package/dist/types/localization/messages_nl.d.ts.map +1 -0
  467. package/dist/types/localization/messages_no.d.ts +2 -0
  468. package/dist/types/localization/messages_no.d.ts.map +1 -0
  469. package/dist/types/localization/messages_pl.d.ts +2 -0
  470. package/dist/types/localization/messages_pl.d.ts.map +1 -0
  471. package/dist/types/localization/messages_pt_BR.d.ts +2 -0
  472. package/dist/types/localization/messages_pt_BR.d.ts.map +1 -0
  473. package/dist/types/localization/messages_pt_PT.d.ts +2 -0
  474. package/dist/types/localization/messages_pt_PT.d.ts.map +1 -0
  475. package/dist/types/localization/messages_ro.d.ts +2 -0
  476. package/dist/types/localization/messages_ro.d.ts.map +1 -0
  477. package/dist/types/localization/messages_ru.d.ts +2 -0
  478. package/dist/types/localization/messages_ru.d.ts.map +1 -0
  479. package/dist/types/localization/messages_sd.d.ts +2 -0
  480. package/dist/types/localization/messages_sd.d.ts.map +1 -0
  481. package/dist/types/localization/messages_si.d.ts +2 -0
  482. package/dist/types/localization/messages_si.d.ts.map +1 -0
  483. package/dist/types/localization/messages_sk.d.ts +2 -0
  484. package/dist/types/localization/messages_sk.d.ts.map +1 -0
  485. package/dist/types/localization/messages_sl.d.ts +2 -0
  486. package/dist/types/localization/messages_sl.d.ts.map +1 -0
  487. package/dist/types/localization/messages_sr.d.ts +2 -0
  488. package/dist/types/localization/messages_sr.d.ts.map +1 -0
  489. package/dist/types/localization/messages_sr_lat.d.ts +2 -0
  490. package/dist/types/localization/messages_sr_lat.d.ts.map +1 -0
  491. package/dist/types/localization/messages_sv.d.ts +2 -0
  492. package/dist/types/localization/messages_sv.d.ts.map +1 -0
  493. package/dist/types/localization/messages_th.d.ts +2 -0
  494. package/dist/types/localization/messages_th.d.ts.map +1 -0
  495. package/dist/types/localization/messages_tj.d.ts +2 -0
  496. package/dist/types/localization/messages_tj.d.ts.map +1 -0
  497. package/dist/types/localization/messages_tr.d.ts +2 -0
  498. package/dist/types/localization/messages_tr.d.ts.map +1 -0
  499. package/dist/types/localization/messages_uk.d.ts +2 -0
  500. package/dist/types/localization/messages_uk.d.ts.map +1 -0
  501. package/dist/types/localization/messages_ur.d.ts +2 -0
  502. package/dist/types/localization/messages_ur.d.ts.map +1 -0
  503. package/dist/types/localization/messages_vi.d.ts +2 -0
  504. package/dist/types/localization/messages_vi.d.ts.map +1 -0
  505. package/dist/types/localization/messages_zh.d.ts +2 -0
  506. package/dist/types/localization/messages_zh.d.ts.map +1 -0
  507. package/dist/types/localization/messages_zh_TW.d.ts +2 -0
  508. package/dist/types/localization/messages_zh_TW.d.ts.map +1 -0
  509. package/dist/types/localization/methods_de.d.ts +2 -0
  510. package/dist/types/localization/methods_de.d.ts.map +1 -0
  511. package/dist/types/localization/methods_es_CL.d.ts +2 -0
  512. package/dist/types/localization/methods_es_CL.d.ts.map +1 -0
  513. package/dist/types/localization/methods_fi.d.ts +2 -0
  514. package/dist/types/localization/methods_fi.d.ts.map +1 -0
  515. package/dist/types/localization/methods_it.d.ts +2 -0
  516. package/dist/types/localization/methods_it.d.ts.map +1 -0
  517. package/dist/types/localization/methods_nl.d.ts +2 -0
  518. package/dist/types/localization/methods_nl.d.ts.map +1 -0
  519. package/dist/types/localization/methods_pt.d.ts +2 -0
  520. package/dist/types/localization/methods_pt.d.ts.map +1 -0
  521. package/dist/types/messages.d.ts +21 -0
  522. package/dist/types/messages.d.ts.map +1 -0
  523. package/dist/types/methods.d.ts +7 -0
  524. package/dist/types/methods.d.ts.map +1 -0
  525. package/dist/types/objectStore.d.ts +9 -0
  526. package/dist/types/objectStore.d.ts.map +1 -0
  527. package/dist/types/rules.d.ts +29 -0
  528. package/dist/types/rules.d.ts.map +1 -0
  529. package/dist/types/types.d.ts +55 -0
  530. package/dist/types/types.d.ts.map +1 -0
  531. package/dist/types/validator.d.ts +120 -0
  532. package/dist/types/validator.d.ts.map +1 -0
  533. package/dist/types/validatorStore.d.ts +3 -0
  534. package/dist/types/validatorStore.d.ts.map +1 -0
  535. package/package.json +61 -0
package/dist/dv.esm.js ADDED
@@ -0,0 +1,1667 @@
1
+ /*!
2
+ * dino-validation v0.1.0
3
+ * https://github.com/cadamsmith/dino-validation
4
+ *
5
+ * Copyright (c) Jörn Zaefferer (jQuery Validation)
6
+ * Copyright (c) 2026 Adam Smith (dino-validation - vanilla JS port)
7
+ *
8
+ * Released under the MIT License
9
+ * https://github.com/cadamsmith/dino-validation/blob/main/LICENSE
10
+ */
11
+
12
+ /**
13
+ * Returns true if the element is visible in the DOM.
14
+ * @param el - element to check visibility
15
+ * @return true if element is visible, false otherwise
16
+ */
17
+ function isVisible(el) {
18
+ return !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length);
19
+ }
20
+ /**
21
+ * Returns the number of truthy properties in an object.
22
+ * @param obj - object to count properties
23
+ * @return count of truthy properties
24
+ */
25
+ function objectLength(obj) {
26
+ let count = 0;
27
+ for (const key in obj) {
28
+ // This check allows counting elements with empty error message as invalid elements
29
+ if (obj[key] !== undefined && obj[key] !== null && obj[key] !== false) {
30
+ count++;
31
+ }
32
+ }
33
+ return count;
34
+ }
35
+ /**
36
+ * Finds all form elements with the specified name attribute.
37
+ * @param form - form element to search within
38
+ * @param name - name attribute to search for
39
+ * @return array of matching elements
40
+ */
41
+ function findByName(form, name) {
42
+ const selector = `[name='${escapeCssMeta(name)}']`;
43
+ const elements = Array.from(form.querySelectorAll(selector));
44
+ if (form.id) {
45
+ const outsideElements = Array.from(document.querySelectorAll(selector)).filter((el) => el.matches(`[form="${escapeCssMeta(form.id)}"]`));
46
+ elements.push(...outsideElements);
47
+ }
48
+ return elements;
49
+ }
50
+ /**
51
+ * Returns true if the element is a radio button or checkbox.
52
+ * @param element - element to check
53
+ * @return true if element is radio or checkbox, false otherwise
54
+ */
55
+ function isCheckableElement(element) {
56
+ return /radio|checkbox/i.test(element.type || '');
57
+ }
58
+ /**
59
+ * Escapes CSS meta-characters in a string for use in CSS selectors.
60
+ * See https://api.jquery.com/category/selectors/ for CSS meta-characters that should be escaped.
61
+ * @param text - text to escape
62
+ * @return escaped text safe for CSS selectors
63
+ */
64
+ function escapeCssMeta(text) {
65
+ if (text === undefined) {
66
+ return '';
67
+ }
68
+ return text.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, '\\$1');
69
+ }
70
+ /**
71
+ * Gets the value of a form element, handling special cases for different input types.
72
+ * @param element - form control element to get value of
73
+ * @param form - current html form being validated
74
+ * @return element value or array of values for checkboxes/radios
75
+ */
76
+ function elementValue(element, form) {
77
+ if (element.type === 'radio' || element.type === 'checkbox') {
78
+ const checked = findByName(form, element.name).filter((el) => el.matches(':checked'));
79
+ return checked.map((el) => el.value);
80
+ }
81
+ if (element.type === 'number' && typeof element.validity !== 'undefined') {
82
+ return element.validity.badInput ? 'NaN' : element.value;
83
+ }
84
+ if (element.type === 'file') {
85
+ return fileInputValue(element);
86
+ }
87
+ return element.value.replace(/\r/g, '');
88
+ }
89
+ /**
90
+ * Get the value of a file input element.
91
+ * @param element - file input element
92
+ * @return file path or file name
93
+ */
94
+ function fileInputValue(element) {
95
+ const value = element.value;
96
+ // Modern browser (chrome & safari)
97
+ if (value.substring(0, 12) === 'C:\\fakepath\\') {
98
+ return value.substring(12);
99
+ }
100
+ // Legacy browsers
101
+ // Unix-based path
102
+ let idx = value.lastIndexOf('/');
103
+ if (idx >= 0) {
104
+ return value.substring(idx + 1);
105
+ }
106
+ // Windows-based path
107
+ idx = value.lastIndexOf('\\');
108
+ if (idx >= 0) {
109
+ return value.substring(idx + 1);
110
+ }
111
+ // Just the file name
112
+ return value;
113
+ }
114
+ /**
115
+ * Formats a string by replacing {0}, {1}, etc. placeholders with provided parameters.
116
+ * @param source - template string with placeholders
117
+ * @param params - parameters to substitute into placeholders
118
+ * @return formatted string or curried function if only source provided
119
+ */
120
+ function format(source, params) {
121
+ // If no params provided, return a curried function
122
+ if (params === undefined) {
123
+ return function (args) {
124
+ return formatString(source, args);
125
+ };
126
+ }
127
+ if (!Array.isArray(params)) {
128
+ params = [params];
129
+ }
130
+ return formatString(source, params);
131
+ }
132
+ /**
133
+ * Internal helper to format a string with parameters.
134
+ * @param source - template string with placeholders
135
+ * @param params - parameters to substitute
136
+ * @return formatted string
137
+ */
138
+ function formatString(source, params) {
139
+ if (!Array.isArray(params)) {
140
+ params = [params];
141
+ }
142
+ params.forEach((param, index) => {
143
+ source = source.replace(new RegExp(`\\{${index}\\}`, 'g'), String(param));
144
+ });
145
+ return source;
146
+ }
147
+ /**
148
+ * Returns the id or name attribute of an element, preferring name for checkable elements.
149
+ * @param element - element to get identifier from
150
+ * @return element id or name
151
+ */
152
+ function idOrName(element) {
153
+ return ((isCheckableElement(element) ? element.name : element.id) || element.name);
154
+ }
155
+ /**
156
+ * Gets the length of a form element's value, handling special cases for selects and checkables.
157
+ * @param element - form control element
158
+ * @param form - html form element
159
+ * @return length of the element's value
160
+ */
161
+ function getValueLength(element, form) {
162
+ const nodeName = element.nodeName.toLowerCase();
163
+ const value = elementValue(element, form);
164
+ if (nodeName === 'select') {
165
+ return element.querySelectorAll('option:checked').length;
166
+ }
167
+ else if (nodeName === 'input' && isCheckableElement(element)) {
168
+ return findByName(form, element.name).filter((el) => el.matches(':checked'))
169
+ .length;
170
+ }
171
+ return value.length;
172
+ }
173
+ /**
174
+ * Returns true if the element has no value or is considered blank.
175
+ * @param element - form control element to check
176
+ * @param form - current form element
177
+ * @return true if element is blank, false otherwise
178
+ */
179
+ function isBlankElement(element, form) {
180
+ const value = elementValue(element, form);
181
+ if (element.nodeName.toLowerCase() === 'select' && element.selectedOptions) {
182
+ const selected = Array.from(element.selectedOptions).map((o) => o.value);
183
+ return selected.length === 0 || !selected[0];
184
+ }
185
+ if (isCheckableElement(element)) {
186
+ return getValueLength(element, form) === 0;
187
+ }
188
+ return value === undefined || value === null || value.length === 0;
189
+ }
190
+ const displayDataMap = new WeakMap();
191
+ /**
192
+ * Shows an element by restoring its original display value.
193
+ * Matches jQuery's .show() behavior.
194
+ * @param element - Element to show
195
+ */
196
+ function showElement(element) {
197
+ const storedDisplay = displayDataMap.get(element);
198
+ if (storedDisplay) {
199
+ element.style.display = storedDisplay;
200
+ displayDataMap.delete(element);
201
+ }
202
+ else {
203
+ element.style.display = '';
204
+ }
205
+ }
206
+ /**
207
+ * Hides an element by setting display to none, storing the original display value.
208
+ * Matches jQuery's .hide() behavior.
209
+ * @param element - Element to hide
210
+ */
211
+ function hideElement(element) {
212
+ if (element.style.display !== 'none') {
213
+ // Store current display value
214
+ displayDataMap.set(element, element.style.display || getComputedStyle(element).display);
215
+ element.style.display = 'none';
216
+ }
217
+ }
218
+
219
+ class ObjectStore {
220
+ constructor(data) {
221
+ this._store = {};
222
+ this._store = data;
223
+ }
224
+ keys() {
225
+ return Object.keys(this._store);
226
+ }
227
+ get(key) {
228
+ return this._store[key];
229
+ }
230
+ set(key, value) {
231
+ this._store[key] = value;
232
+ }
233
+ replace(data) {
234
+ Object.entries(data).forEach(([key, value]) => {
235
+ if (key in this._store) {
236
+ this._store[key] = value;
237
+ }
238
+ });
239
+ }
240
+ }
241
+
242
+ /**
243
+ * Public API for accessing and managing validation methods.
244
+ */
245
+ const store$1 = new ObjectStore({
246
+ required,
247
+ minlength: minLength,
248
+ maxlength: maxLength,
249
+ rangelength: rangeLength,
250
+ min,
251
+ max,
252
+ range,
253
+ email,
254
+ url,
255
+ date,
256
+ dateISO,
257
+ number,
258
+ digits,
259
+ equalTo,
260
+ regex,
261
+ nonalphamin: nonAlphaMin,
262
+ creditcard: creditCard,
263
+ });
264
+ /**
265
+ * Validates that the field has a value (is not blank).
266
+ * @return true if field is not blank
267
+ */
268
+ function required({ blank }) {
269
+ return !blank;
270
+ }
271
+ /**
272
+ * Validates that the field value has at least the minimum length.
273
+ * @return true if blank or length meets minimum
274
+ */
275
+ function minLength({ blank, length, param }) {
276
+ return blank || length >= param;
277
+ }
278
+ /**
279
+ * Validates that the field value does not exceed the maximum length.
280
+ * @return true if blank or length within maximum
281
+ */
282
+ function maxLength({ blank, length, param }) {
283
+ return blank || length <= param;
284
+ }
285
+ /**
286
+ * Validates that the field value length is within a specified range.
287
+ * @return true if blank or length within range
288
+ */
289
+ function rangeLength({ blank, length, param }) {
290
+ return blank || (length >= param[0] && length <= param[1]);
291
+ }
292
+ /**
293
+ * Validates that the field value is greater than or equal to a minimum value.
294
+ * @return true if blank or value meets minimum
295
+ */
296
+ function min({ blank, value, param }) {
297
+ return blank || value >= param;
298
+ }
299
+ /**
300
+ * Validates that the field value is less than or equal to a maximum value.
301
+ * @return true if blank or value within maximum
302
+ */
303
+ function max({ blank, value, param }) {
304
+ return blank || value <= param;
305
+ }
306
+ /**
307
+ * Validates that the field value is within a specified numeric range.
308
+ * @return true if blank or value within range
309
+ */
310
+ function range({ blank, value, param }) {
311
+ if (blank) {
312
+ return true;
313
+ }
314
+ return value >= param[0] && value <= param[1];
315
+ }
316
+ /**
317
+ * Validates that the field value is a valid email address format.
318
+ * @param blank - whether the field is blank
319
+ * @param value - field value
320
+ * @return true if blank or valid email format
321
+ */
322
+ function email({ blank, value }) {
323
+ if (blank) {
324
+ return true;
325
+ }
326
+ const re = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
327
+ return re.test(value);
328
+ }
329
+ /**
330
+ * Validates that the field value is a valid URL format.
331
+ * @param blank - whether the field is blank
332
+ * @param value - field value
333
+ * @return true if blank or valid URL format
334
+ */
335
+ function url({ blank, value }) {
336
+ if (blank) {
337
+ return true;
338
+ }
339
+ const re = /^(?:(?:https?|ftp):)?\/\/(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4])|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+[a-z\u00a1-\uffff]{2,}\.?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i;
340
+ return re.test(value);
341
+ }
342
+ /**
343
+ * Validates that the field value is a valid date string
344
+ * @param blank - whether the field is blank
345
+ * @param value - field value
346
+ * @return true if blank or valid date string
347
+ */
348
+ function date({ blank, value }) {
349
+ if (blank) {
350
+ return true;
351
+ }
352
+ return !/Invalid|NaN/.test(new Date(value).toString());
353
+ }
354
+ /**
355
+ * Validates that the field value is a valid ISO date format (YYYY-MM-DD or YYYY/MM/DD).
356
+ * @param blank - whether the field is blank
357
+ * @param value - field value
358
+ * @return true if blank or valid ISO date format
359
+ */
360
+ function dateISO({ blank, value }) {
361
+ if (blank) {
362
+ return true;
363
+ }
364
+ const re = /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/;
365
+ return re.test(value);
366
+ }
367
+ /**
368
+ * Validates that the field value is a valid number (including decimals and comma-separated thousands).
369
+ * @param blank - whether the field is blank
370
+ * @param value - field value
371
+ * @return true if blank or valid number format
372
+ */
373
+ function number({ blank, value }) {
374
+ if (blank) {
375
+ return true;
376
+ }
377
+ const re = /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:-?\.\d+)?$/;
378
+ return re.test(value);
379
+ }
380
+ /**
381
+ * Validates that the field value contains only digits (no decimals or special characters).
382
+ * @param blank - whether the field is blank
383
+ * @param value - field value
384
+ * @return true if blank or contains only digits
385
+ */
386
+ function digits({ blank, value }) {
387
+ if (blank) {
388
+ return true;
389
+ }
390
+ return /^\d+$/.test(value);
391
+ }
392
+ /**
393
+ * Validates that the field value equals the value of another field (e.g., password confirmation).
394
+ * @return true if values match
395
+ */
396
+ function equalTo({ value, param }) {
397
+ const target = document.querySelector(param);
398
+ return value === target.value;
399
+ }
400
+ /**
401
+ * Validates that the field value matches a regular expression.
402
+ * @return true if blank or value matches pattern
403
+ */
404
+ function regex({ blank, value, param }) {
405
+ if (blank) {
406
+ return true;
407
+ }
408
+ const match = new RegExp(param).exec(value);
409
+ return !!match && match.index === 0 && match[0].length === value.length;
410
+ }
411
+ /**
412
+ * Validates that the field value contains at least a minimum number of non-alphanumeric characters.
413
+ * Used for password strength validation.
414
+ * @return true if blank or value has enough non-alphanumeric characters
415
+ */
416
+ function nonAlphaMin({ blank, value, param }) {
417
+ if (blank || !param) {
418
+ return true;
419
+ }
420
+ const match = value.match(/\W/g);
421
+ return !!match && match.length >= param;
422
+ }
423
+ /**
424
+ * Validates that the field value matches a credit card number.
425
+ * based on https://en.wikipedia.org/wiki/Luhn_algorithm
426
+ * @return true if blank or value is a valid credit card number
427
+ */
428
+ function creditCard({ blank, value }) {
429
+ if (blank) {
430
+ return true;
431
+ }
432
+ const strippedValue = value.replace(/\D/g, '');
433
+ let nCheck = 0;
434
+ let bEven = false;
435
+ // Basing min and max length on
436
+ // https://dev.ean.com/general-info/valid-card-types/
437
+ if (strippedValue.length < 13 || strippedValue.length > 19) {
438
+ return false;
439
+ }
440
+ for (let n = strippedValue.length - 1; n >= 0; n--) {
441
+ const cDigit = strippedValue.charAt(n);
442
+ let nDigit = parseInt(cDigit, 10);
443
+ if (bEven) {
444
+ if ((nDigit *= 2) > 9) {
445
+ nDigit -= 9;
446
+ }
447
+ }
448
+ nCheck += nDigit;
449
+ bEven = !bEven;
450
+ }
451
+ return nCheck % 10 === 0;
452
+ }
453
+
454
+ /**
455
+ * Gets all validation rules for an element from multiple sources.
456
+ * Merges rules from CSS classes, HTML attributes, data attributes, and programmatic settings.
457
+ * @param element - form element to get rules for
458
+ * @param settings - validator rule settings
459
+ * @return {Object} - object containing all validation rules with the required rule first
460
+ */
461
+ function getRules(element, settings) {
462
+ // If nothing is selected, return empty object; can't chain anyway
463
+ if (element == null || element.form == null) {
464
+ return {};
465
+ }
466
+ let data = normalizeRules(Object.assign(Object.assign(Object.assign(Object.assign({}, classRules(element)), attributeRules(element)), dataRules(element)), staticRules(element, settings)));
467
+ // Make sure required is at front
468
+ if (data.required) {
469
+ const param = data.required;
470
+ delete data.required;
471
+ data = Object.assign({ required: param }, data);
472
+ }
473
+ return data;
474
+ }
475
+ /**
476
+ * Default mapping of CSS class names to validation rules.
477
+ * Allows class-based rule declaration like class="required email".
478
+ */
479
+ const classRuleSettings = {
480
+ required: { required: true },
481
+ email: { email: true },
482
+ url: { url: true },
483
+ date: { date: true },
484
+ dateISO: { dateISO: true },
485
+ number: { number: true },
486
+ digits: { digits: true },
487
+ creditcard: { creditcard: true },
488
+ };
489
+ /**
490
+ * Adds or updates validation rules for a CSS class name.
491
+ * @param className - class name to associate with rules
492
+ */
493
+ function addClassRule(className) {
494
+ classRuleSettings[className] = normalizeRule(className);
495
+ }
496
+ /**
497
+ * Normalizes and processes validation rules for an element.
498
+ * Removes false rules, evaluates function parameters, and converts string/number values.
499
+ * @param rules - raw validation rules object
500
+ * @return normalized rules object
501
+ */
502
+ function normalizeRules(rules) {
503
+ Object.entries(rules).forEach(([key, value]) => {
504
+ // Ignore rule when param is explicitly false, eg. required:false
505
+ if (value === false) {
506
+ delete rules[key];
507
+ return;
508
+ }
509
+ if (typeof value === 'object' && 'param' in value && value.param) {
510
+ rules[key] = value.param;
511
+ }
512
+ });
513
+ // Clean number parameters
514
+ ['minlength', 'maxlength'].forEach((ruleKey) => {
515
+ if (rules[ruleKey]) {
516
+ rules[ruleKey] = Number(rules[ruleKey]);
517
+ }
518
+ });
519
+ ['rangelength', 'range'].forEach((ruleKey) => {
520
+ if (rules[ruleKey]) {
521
+ if (Array.isArray(rules[ruleKey])) {
522
+ rules[ruleKey] = [rules[ruleKey][0], rules[ruleKey][1]].map(Number);
523
+ }
524
+ else {
525
+ const parts = rules[ruleKey]
526
+ .toString()
527
+ .replace(/[\[\]]/g, '')
528
+ .split(/[\s,]+/);
529
+ rules[ruleKey] = [parts[0], parts[1]].map(Number);
530
+ }
531
+ }
532
+ });
533
+ return rules;
534
+ }
535
+ /**
536
+ * Extracts validation rules from an element's CSS classes.
537
+ * @param element - element to extract rules from
538
+ * @return validation rules derived from CSS classes
539
+ */
540
+ function classRules(element) {
541
+ let rules = {};
542
+ const classes = element.getAttribute('class');
543
+ if (classes) {
544
+ classes.split(' ').forEach((className) => {
545
+ if (className in classRuleSettings) {
546
+ rules = Object.assign(Object.assign({}, rules), classRuleSettings[className]);
547
+ }
548
+ });
549
+ }
550
+ return rules;
551
+ }
552
+ /**
553
+ * Extracts validation rules from HTML attributes (required, minlength, etc.).
554
+ * @param element - element to extract rules from
555
+ * @return validation rules derived from HTML attributes
556
+ */
557
+ function attributeRules(element) {
558
+ const rules = {};
559
+ const type = element.type;
560
+ for (const method of store$1.keys()) {
561
+ let value = element.getAttribute(method);
562
+ // Support for <input required> in both html5 and older browsers
563
+ if (method === 'required') {
564
+ // Some browsers return an empty string for the required attribute
565
+ // and non-HTML5 browsers might have required="" markup
566
+ if (value === '') {
567
+ value = true;
568
+ }
569
+ // Force non-HTML5 browsers to return bool
570
+ value = !!value;
571
+ }
572
+ normalizeAttributeRule(rules, type, method, value);
573
+ }
574
+ // 'maxlength' may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs
575
+ if (rules.maxlength &&
576
+ /-1|2147483647|524288/.test(rules.maxlength.toString())) {
577
+ delete rules.maxlength;
578
+ }
579
+ return rules;
580
+ }
581
+ /**
582
+ * Extracts validation rules from data attributes (data-rule-required, etc.).
583
+ * @param element - element to extract rules from
584
+ * @return validation rules derived from data attributes
585
+ */
586
+ function dataRules(element) {
587
+ var _a;
588
+ const rules = {};
589
+ const type = element.type;
590
+ for (const method of store$1.keys()) {
591
+ const datasetKey = 'rule' +
592
+ method.charAt(0).toUpperCase() +
593
+ method.substring(1).toLowerCase();
594
+ let value = (_a = element.dataset[datasetKey]) !== null && _a !== void 0 ? _a : null;
595
+ // Cast empty attributes like `data-rule-required` to `true`
596
+ if (value === '' || value === 'true') {
597
+ value = true;
598
+ }
599
+ else if (value === 'false') {
600
+ value = false;
601
+ }
602
+ normalizeAttributeRule(rules, type, method, value);
603
+ }
604
+ return rules;
605
+ }
606
+ /**
607
+ * Gets validation rules defined programmatically in validator settings.
608
+ * @param element - element to get rules for
609
+ * @param settings - Validator rule settings
610
+ * @return validation rules from validator settings
611
+ */
612
+ function staticRules(element, settings) {
613
+ if (!settings || !settings[element.name]) {
614
+ return {};
615
+ }
616
+ return normalizeRule(settings[element.name]) || {};
617
+ }
618
+ /**
619
+ * Normalizes a single attribute rule and adds it to the rules object.
620
+ * Handles type coercion and special cases for different input types.
621
+ * @param rules - rules object to add the rule to
622
+ * @param type - input type attribute value
623
+ * @param method - validation method name
624
+ * @param value - attribute value
625
+ */
626
+ function normalizeAttributeRule(rules, type, method, value) {
627
+ // Convert the value to a number for number inputs, and for text for backwards compatability
628
+ // allows type="date" and others to be compared as strings
629
+ if (/min|max|step/.test(method) &&
630
+ (type === null || /number|range|text/.test(type)) &&
631
+ value !== null) {
632
+ value = Number(value);
633
+ }
634
+ if (value || value === 0) {
635
+ rules[method] = value;
636
+ }
637
+ else if (type === method && type !== 'range') {
638
+ // Exception: the jquery validate 'range' method
639
+ // does not test for the html5 'range' type
640
+ rules[type === 'date' ? 'dateISO' : method] = true;
641
+ }
642
+ }
643
+ /**
644
+ * Converts string-based rule declarations to rule objects.
645
+ * Transforms "required email" to {required: true, email: true}.
646
+ * @param data - rule string or object
647
+ * @return normalized rule object
648
+ */
649
+ function normalizeRule(data) {
650
+ if (typeof data !== 'string') {
651
+ return data;
652
+ }
653
+ const transformed = {};
654
+ data.split(/\s/).forEach((token) => {
655
+ transformed[token] = true;
656
+ });
657
+ return transformed;
658
+ }
659
+
660
+ /**
661
+ * Public API for accessing and managing error messages.
662
+ */
663
+ const store = new ObjectStore({
664
+ required: 'This field is required.',
665
+ email: 'Please enter a valid email address.',
666
+ url: 'Please enter a valid URL.',
667
+ date: 'Please enter a valid date.',
668
+ dateISO: 'Please enter a valid date (ISO).',
669
+ number: 'Please enter a valid number.',
670
+ digits: 'Please enter only digits.',
671
+ equalTo: 'Please enter the same value again.',
672
+ maxlength: 'Please enter no more than {0} characters.',
673
+ minlength: 'Please enter at least {0} characters.',
674
+ rangelength: 'Please enter a value between {0} and {1} characters long.',
675
+ range: 'Please enter a value between {0} and {1}.',
676
+ max: 'Please enter a value less than or equal to {0}.',
677
+ min: 'Please enter a value greater than or equal to {0}.',
678
+ regex: 'Please enter a value that matches the pattern {0}.',
679
+ nonalphamin: 'Please enter at least {0} non-alphabetic characters.',
680
+ creditcard: 'Please enter a valid credit card number.',
681
+ });
682
+ /**
683
+ * Gets the appropriate error message for a validation rule failure.
684
+ * Checks custom messages, data attributes, element title, and default messages in order.
685
+ * @param element - form element that failed validation
686
+ * @param rule - validation rule (string method name or object with method and parameters)
687
+ * @param ignoreTitle - whether to ignore element title
688
+ * @param customMessage - validator settings that may contain custom messages
689
+ * @return formatted error message
690
+ */
691
+ function getMessage(element, rule, ignoreTitle, customMessage) {
692
+ let message = [
693
+ customMessage,
694
+ customDataMessage(element, rule.method),
695
+ (!ignoreTitle && element.title) || undefined,
696
+ store.get(rule.method),
697
+ `<strong>Warning: No message defined for ${element.name}</strong>`,
698
+ ].find((x) => x !== undefined);
699
+ const regex = /\$?\{(\d+)}/g;
700
+ if (/\$?\{(\d+)}/g.test(message)) {
701
+ return format(message.replace(regex, '{$1}'), rule.parameters);
702
+ }
703
+ else {
704
+ return message;
705
+ }
706
+ }
707
+ /**
708
+ * Gets a custom error message from element's data attributes.
709
+ * Checks data-msg-{method} first, then falls back to data-msg.
710
+ * @param element - form element
711
+ * @param method - validation method name
712
+ * @return custom message from data attribute if present
713
+ */
714
+ function customDataMessage(element, method) {
715
+ const dataSetKey = 'msg' + method.charAt(0).toUpperCase() + method.substring(1).toLowerCase();
716
+ if (!(element === null || element === void 0 ? void 0 : element.dataset)) {
717
+ return;
718
+ }
719
+ return element.dataset[dataSetKey] || element.dataset['msg'];
720
+ }
721
+
722
+ const validatorStore = new WeakMap();
723
+
724
+ /**
725
+ * CSS selectors for different types of form elements that should receive validation events
726
+ */
727
+ const EVENT_TARGETS = {
728
+ FOCUS_TARGETS: [
729
+ "[type='text']",
730
+ "[type='password']",
731
+ "[type='file']",
732
+ 'select',
733
+ 'textarea',
734
+ "[type='number']",
735
+ "[type='search']",
736
+ "[type='tel']",
737
+ "[type='url']",
738
+ "[type='email']",
739
+ "[type='datetime']",
740
+ "[type='date']",
741
+ "[type='month']",
742
+ "[type='week']",
743
+ "[type='time']",
744
+ "[type='datetime-local']",
745
+ "[type='range']",
746
+ "[type='color']",
747
+ "[type='radio']",
748
+ "[type='checkbox']",
749
+ 'button',
750
+ "input[type='button']",
751
+ ],
752
+ CLICK_TARGETS: ['select', 'option', "[type='radio']", "[type='checkbox']"],
753
+ };
754
+ /**
755
+ * Manages event delegation for form validation.
756
+ * Handles attaching and removing event listeners with proper delegation logic.
757
+ */
758
+ class FormEventManager {
759
+ constructor(form, settings, validateCallback, focusInvalidCallback, shouldIgnoreElement) {
760
+ this.form = form;
761
+ this.settings = settings;
762
+ this.validateCallback = validateCallback;
763
+ this.focusInvalidCallback = focusInvalidCallback;
764
+ this.shouldIgnoreElement = shouldIgnoreElement;
765
+ this.boundEventHandlers = {
766
+ onFocusIn: null,
767
+ onFocusOut: null,
768
+ onKeyUp: null,
769
+ onClick: null,
770
+ };
771
+ }
772
+ /**
773
+ * Attaches all validation event listeners to the form
774
+ */
775
+ attachEventHandlers() {
776
+ this.boundEventHandlers.onFocusIn = this.createDelegate(EVENT_TARGETS.FOCUS_TARGETS, this.settings.onfocusin);
777
+ this.boundEventHandlers.onFocusOut = this.createDelegate(EVENT_TARGETS.FOCUS_TARGETS, this.settings.onfocusout);
778
+ this.boundEventHandlers.onKeyUp = this.createDelegate(EVENT_TARGETS.FOCUS_TARGETS, this.settings.onkeyup);
779
+ this.boundEventHandlers.onClick = this.createDelegate(EVENT_TARGETS.CLICK_TARGETS, this.settings.onclick);
780
+ this.form.addEventListener('focusin', this.boundEventHandlers.onFocusIn);
781
+ this.form.addEventListener('focusout', this.boundEventHandlers.onFocusOut);
782
+ this.form.addEventListener('keyup', this.boundEventHandlers.onKeyUp);
783
+ this.form.addEventListener('click', this.boundEventHandlers.onClick);
784
+ if (this.settings.onsubmit) {
785
+ this.form.addEventListener('submit', (e) => this.handleSubmitForm(e));
786
+ }
787
+ const invalidHandler = this.settings.invalidHandler;
788
+ if (invalidHandler) {
789
+ this.form.addEventListener('invalid-form', (e) => {
790
+ if (!this.isCustomEvent(e)) {
791
+ return;
792
+ }
793
+ invalidHandler(e);
794
+ });
795
+ }
796
+ }
797
+ triggerInvalidForm(errorList) {
798
+ const event = new CustomEvent('invalid-form', {
799
+ detail: errorList,
800
+ cancelable: true,
801
+ });
802
+ this.form.dispatchEvent(event);
803
+ }
804
+ isCustomEvent(event) {
805
+ return 'detail' in event;
806
+ }
807
+ handleSubmitForm(e) {
808
+ if (this.settings.debug) {
809
+ e.preventDefault();
810
+ }
811
+ const isValid = this.validateCallback();
812
+ if (!isValid) {
813
+ this.focusInvalidCallback();
814
+ e.preventDefault();
815
+ e.stopPropagation();
816
+ }
817
+ }
818
+ /**
819
+ * Removes all validation event listeners from the form
820
+ */
821
+ detachEventHandlers() {
822
+ if (this.boundEventHandlers.onFocusIn) {
823
+ this.form.removeEventListener('focusin', this.boundEventHandlers.onFocusIn);
824
+ }
825
+ if (this.boundEventHandlers.onFocusOut) {
826
+ this.form.removeEventListener('focusout', this.boundEventHandlers.onFocusOut);
827
+ }
828
+ if (this.boundEventHandlers.onKeyUp) {
829
+ this.form.removeEventListener('keyup', this.boundEventHandlers.onKeyUp);
830
+ }
831
+ if (this.boundEventHandlers.onClick) {
832
+ this.form.removeEventListener('click', this.boundEventHandlers.onClick);
833
+ }
834
+ // Clear references
835
+ this.boundEventHandlers.onFocusIn = null;
836
+ this.boundEventHandlers.onFocusOut = null;
837
+ this.boundEventHandlers.onKeyUp = null;
838
+ this.boundEventHandlers.onClick = null;
839
+ }
840
+ /**
841
+ * Creates a delegated event handler for the specified targets and handler
842
+ */
843
+ createDelegate(targets, handler) {
844
+ return (event) => {
845
+ // Skip if handler is disabled (boolean false)
846
+ if (typeof handler === 'boolean') {
847
+ return;
848
+ }
849
+ const element = event.target;
850
+ // Check if element matches any of the target selectors
851
+ if (!element.matches(targets.join(', '))) {
852
+ return;
853
+ }
854
+ // Ensure element belongs to the correct form
855
+ if (!this.isElementInForm(element)) {
856
+ return;
857
+ }
858
+ // Check if element should be ignored based on validator settings
859
+ if (this.shouldIgnoreElement(element)) {
860
+ return;
861
+ }
862
+ // Call the handler with the element and event
863
+ handler(element, event);
864
+ };
865
+ }
866
+ /**
867
+ * Checks if an element belongs to the validator's form
868
+ */
869
+ isElementInForm(element) {
870
+ const elementForm = element.form;
871
+ return this.form === elementForm;
872
+ }
873
+ }
874
+
875
+ const ValidatorDefaults = {
876
+ ignore: ':hidden',
877
+ errorClass: 'error',
878
+ validClass: 'valid',
879
+ errorElement: 'label',
880
+ wrapper: null,
881
+ errorLabelContainer: null,
882
+ errorContainer: null,
883
+ onfocusin: onFocusIn,
884
+ onfocusout: onFocusOut,
885
+ onkeyup: onKeyUp,
886
+ onclick: onClick,
887
+ highlight: highlight,
888
+ unhighlight: unhighlight,
889
+ errorPlacement: null,
890
+ focusCleanup: false,
891
+ rules: {},
892
+ messages: {},
893
+ escapeHtml: false,
894
+ showErrors: null,
895
+ ignoreTitle: false,
896
+ success: null,
897
+ onsubmit: true,
898
+ debug: false,
899
+ invalidHandler: null,
900
+ };
901
+ function onFocusIn(element) {
902
+ this.lastActive = element;
903
+ if (this.settings.focusCleanup) {
904
+ if (typeof this.settings.unhighlight !== 'boolean') {
905
+ this.settings.unhighlight(element, this.errorClasses, this.validClasses);
906
+ }
907
+ this.hideErrors(element);
908
+ }
909
+ }
910
+ function onFocusOut(element) {
911
+ if (isCheckableElement(element)) {
912
+ return;
913
+ }
914
+ if (!(element.name in this.submitted) &&
915
+ isBlankElement(element, this.currentForm)) {
916
+ return;
917
+ }
918
+ this.element(element);
919
+ }
920
+ function onKeyUp(element, event) {
921
+ const keyboardEvent = event;
922
+ if (keyboardEvent.which === 9 &&
923
+ elementValue(element, this.currentForm) === '') {
924
+ return;
925
+ }
926
+ // Avoid revalidate the field when pressing one of the following keys
927
+ // Shift => 16
928
+ // Ctrl => 17
929
+ // Alt => 18
930
+ // Caps lock => 20
931
+ // End => 35
932
+ // Home => 36
933
+ // Left arrow => 37
934
+ // Up arrow => 38
935
+ // Right arrow => 39
936
+ // Down arrow => 40
937
+ // Insert => 45
938
+ // Num lock => 144
939
+ // AltGr key => 225
940
+ const excludedKeys = [16, 17, 18, 20, 35, 36, 37, 38, 39, 40, 45, 144, 225];
941
+ if (excludedKeys.includes(keyboardEvent.keyCode)) {
942
+ return;
943
+ }
944
+ if (!(element.name in this.submitted) && !(element.name in this.invalid)) {
945
+ return;
946
+ }
947
+ this.element(element);
948
+ }
949
+ function onClick(element) {
950
+ // Click on selects, radiobuttons and checkboxes
951
+ if (element.name in this.submitted) {
952
+ this.element(element);
953
+ }
954
+ // Or option elements, check parent select in that case
955
+ else if (element.parentNode && element.parentElement) {
956
+ const name = element.parentElement.getAttribute('name');
957
+ if (name && name in this.submitted) {
958
+ this.element(element.parentNode);
959
+ }
960
+ }
961
+ }
962
+ function highlight(element, errorClasses, validClasses) {
963
+ let targets = [element];
964
+ if (element.type === 'radio') {
965
+ targets = findByName(this.currentForm, element.name);
966
+ }
967
+ targets.forEach((el) => {
968
+ el.classList.add(...errorClasses);
969
+ el.classList.remove(...validClasses);
970
+ });
971
+ }
972
+ function unhighlight(element, errorClasses, validClasses) {
973
+ let targets = [element];
974
+ if (element.type === 'radio') {
975
+ targets = findByName(this.currentForm, element.name);
976
+ }
977
+ targets.forEach((el) => {
978
+ el.classList.remove(...errorClasses);
979
+ el.classList.add(...validClasses);
980
+ });
981
+ }
982
+
983
+ class Validator {
984
+ /**
985
+ * Initializes a new validator instance for the given form with optional configuration settings.
986
+ * @param form - form element to validate
987
+ * @param options - optional user configuration settings
988
+ */
989
+ constructor(form, options) {
990
+ this.submitted = {};
991
+ this.invalid = {};
992
+ this.successList = [];
993
+ this.errorList = [];
994
+ this.errorMap = {};
995
+ this.toShow = [];
996
+ this.toHide = [];
997
+ this.currentElements = [];
998
+ this.labelContainer = null;
999
+ this.containers = [];
1000
+ this.lastActive = null;
1001
+ /** normalized rules */
1002
+ this.rules = {};
1003
+ this.settings = ValidatorDefaults;
1004
+ this.currentForm = form;
1005
+ this.settings = Object.assign(Object.assign({}, this.settings), options);
1006
+ this.normalizeSettings();
1007
+ this.init();
1008
+ }
1009
+ /**
1010
+ * Normalizes Validator settings.
1011
+ * Currently, this only binds function settings to validator instance.
1012
+ */
1013
+ normalizeSettings() {
1014
+ // bind function settings to this validator instance
1015
+ [
1016
+ 'onfocusin',
1017
+ 'onfocusout',
1018
+ 'onkeyup',
1019
+ 'onclick',
1020
+ 'highlight',
1021
+ 'unhighlight',
1022
+ 'errorPlacement',
1023
+ 'invalidHandler',
1024
+ ].forEach((key) => {
1025
+ const setting = this.settings[key];
1026
+ if (setting && typeof setting === 'function') {
1027
+ this.settings[key] = setting.bind(this);
1028
+ }
1029
+ });
1030
+ }
1031
+ /**
1032
+ * Sets up DOM references and attaches event handlers to the form.
1033
+ */
1034
+ init() {
1035
+ if (this.settings.errorLabelContainer) {
1036
+ this.labelContainer = document.querySelector(this.settings.errorLabelContainer);
1037
+ }
1038
+ this.errorContext = this.labelContainer || this.currentForm;
1039
+ const containers = [this.labelContainer];
1040
+ if (this.settings.errorContainer) {
1041
+ containers.push(document.querySelector(this.settings.errorContainer));
1042
+ }
1043
+ this.containers = containers.filter(Boolean);
1044
+ this.rules = {};
1045
+ Object.entries(this.settings.rules).forEach(([key, value]) => {
1046
+ this.rules[key] = normalizeRule(value);
1047
+ });
1048
+ this.eventManager = new FormEventManager(this.currentForm, this.settings, () => this.form(), () => this.focusInvalid(), (element) => this.shouldIgnore(element));
1049
+ this.eventManager.attachEventHandlers();
1050
+ }
1051
+ /**
1052
+ * Resets the validator state.
1053
+ */
1054
+ reset() {
1055
+ this.successList = [];
1056
+ this.errorList = [];
1057
+ this.errorMap = {};
1058
+ this.toShow = [];
1059
+ this.toHide = [];
1060
+ this.currentElements = [];
1061
+ }
1062
+ /**
1063
+ * Validates all form elements.
1064
+ * @return true if the form is valid, false otherwise
1065
+ */
1066
+ form() {
1067
+ this.prepareForm();
1068
+ this.currentElements = this.elements();
1069
+ for (const element of this.currentElements) {
1070
+ this.check(element);
1071
+ }
1072
+ this.submitted = Object.assign(Object.assign({}, this.submitted), this.errorMap);
1073
+ this.invalid = Object.assign({}, this.errorMap);
1074
+ if (!this.valid()) {
1075
+ this.eventManager.triggerInvalidForm(this.errorList);
1076
+ }
1077
+ this.showErrors();
1078
+ return this.valid();
1079
+ }
1080
+ /**
1081
+ * Validates a single element within the form.
1082
+ * @param element - element to validate
1083
+ * @return true if the element is valid, false otherwise
1084
+ */
1085
+ element(element) {
1086
+ const target = this.validationTargetFor(element);
1087
+ if (target === undefined) {
1088
+ delete this.invalid[element.name];
1089
+ return true;
1090
+ }
1091
+ this.prepareElement(target);
1092
+ this.currentElements = [target];
1093
+ const result = this.check(target);
1094
+ if (result) {
1095
+ delete this.invalid[element.name];
1096
+ }
1097
+ else {
1098
+ this.invalid[target.name] = 'Invalid';
1099
+ }
1100
+ if (!this.numberOfInvalids()) {
1101
+ this.toHide.push(...this.containers);
1102
+ }
1103
+ this.showErrors();
1104
+ // add aria-invalid status for screen readers
1105
+ element.setAttribute('aria-invalid', (!result).toString());
1106
+ return result;
1107
+ }
1108
+ prepareElement(element) {
1109
+ this.reset();
1110
+ this.toHide = this.errorsFor(element);
1111
+ }
1112
+ /**
1113
+ * Returns true if there are currently no validation errors.
1114
+ * @return {boolean} - true if there are no validation errors, false otherwise
1115
+ */
1116
+ valid() {
1117
+ return this.size() === 0;
1118
+ }
1119
+ /**
1120
+ * Returns the number of validation errors.
1121
+ * @return number of validation errors
1122
+ */
1123
+ size() {
1124
+ return this.errorList.length;
1125
+ }
1126
+ /**
1127
+ * Returns a list of all form elements that need to be validated.
1128
+ * @return list of form elements
1129
+ */
1130
+ elements() {
1131
+ const rulesCache = {};
1132
+ const selector = 'input, select, textarea';
1133
+ const notSelector = 'input[type="submit"], [type="reset"], [type="image"], [disabled]';
1134
+ const elements = Array.from(this.currentForm.querySelectorAll(selector)).filter((el) => !el.matches(notSelector) && !this.shouldIgnore(el));
1135
+ const formId = this.currentForm.id;
1136
+ if (formId) {
1137
+ const escapedId = escapeCssMeta(formId);
1138
+ const outsideElements = Array.from(document.querySelectorAll(selector)).filter((el) => el.matches(`[form="${escapedId}"]`) &&
1139
+ !el.matches(notSelector) &&
1140
+ !this.shouldIgnore(el));
1141
+ elements.push(...outsideElements);
1142
+ }
1143
+ return elements.filter((el) => {
1144
+ const form = el.form;
1145
+ if (form !== this.currentForm) {
1146
+ return false;
1147
+ }
1148
+ const name = el.name || el.getAttribute('name');
1149
+ if (!name ||
1150
+ name in rulesCache ||
1151
+ !objectLength(getRules(el, this.rules))) {
1152
+ return false;
1153
+ }
1154
+ rulesCache[name] = true;
1155
+ return true;
1156
+ });
1157
+ }
1158
+ /**
1159
+ * Returns an array of currently valid elements from the last validation.
1160
+ * @return list of valid form elements
1161
+ */
1162
+ validElements() {
1163
+ const invalid = this.invalidElements();
1164
+ return this.currentElements.filter((el) => !invalid.includes(el));
1165
+ }
1166
+ /**
1167
+ * Returns an array of currently invalid elements from the last validation.
1168
+ * @return list of invalid form elements
1169
+ */
1170
+ invalidElements() {
1171
+ return this.errorList.map((e) => e.element);
1172
+ }
1173
+ /**
1174
+ * Runs all validation rules against an element and returns true if valid.
1175
+ * @param element - element to validate
1176
+ * @return true if the element is valid, false otherwise
1177
+ */
1178
+ check(element) {
1179
+ var _a;
1180
+ element = this.validationTargetFor(element);
1181
+ const rules = getRules(element, this.rules);
1182
+ const elValue = elementValue(element, this.currentForm);
1183
+ const value = (_a = (Array.isArray(elValue) ? elValue[0] : elValue)) !== null && _a !== void 0 ? _a : '';
1184
+ const values = Array.isArray(elValue) ? elValue : [elValue];
1185
+ const length = getValueLength(element, this.currentForm);
1186
+ const blank = isBlankElement(element, this.currentForm);
1187
+ for (const method in rules) {
1188
+ const rule = { method, parameters: rules[method] };
1189
+ const methodFunc = store$1.get(method);
1190
+ if (!methodFunc) {
1191
+ console.warn(`Validation method "${method}" not found. Skipping.`);
1192
+ continue;
1193
+ }
1194
+ try {
1195
+ const result = methodFunc({
1196
+ blank,
1197
+ value: value,
1198
+ values,
1199
+ length,
1200
+ element,
1201
+ param: rule.parameters,
1202
+ });
1203
+ if (!result) {
1204
+ this.formatAndAdd(element, rule);
1205
+ return false;
1206
+ }
1207
+ }
1208
+ catch (e) {
1209
+ throw e;
1210
+ }
1211
+ }
1212
+ if (objectLength(rules)) {
1213
+ this.successList.push(element);
1214
+ }
1215
+ return true;
1216
+ }
1217
+ /**
1218
+ * Returns all error label elements currently in the DOM.
1219
+ * @return array of error label elements
1220
+ */
1221
+ errors() {
1222
+ const errorClass = this.errorClasses.join('.');
1223
+ return Array.from(this.errorContext.querySelectorAll(`${this.settings.errorElement}.${errorClass}`));
1224
+ }
1225
+ showErrors(errors) {
1226
+ if (errors) {
1227
+ // Add items to error list and map
1228
+ this.errorMap = Object.assign(Object.assign({}, this.errorMap), errors);
1229
+ this.errorList = Object.entries(this.errorMap).map(([name, message]) => ({
1230
+ message,
1231
+ method: message,
1232
+ element: findByName(this.currentForm, name)[0],
1233
+ }));
1234
+ // Remove items from success list
1235
+ this.successList = this.successList.filter((e) => !(e.name in errors));
1236
+ }
1237
+ if (this.settings.showErrors) {
1238
+ return this.settings.showErrors.call(this, this.errorMap, this.errorList);
1239
+ }
1240
+ return this.defaultShowErrors();
1241
+ }
1242
+ defaultShowErrors() {
1243
+ for (const error of this.errorList) {
1244
+ if (this.settings.highlight) {
1245
+ this.settings.highlight(error.element, this.errorClasses, this.validClasses);
1246
+ }
1247
+ this.showLabel(error.element, error.message);
1248
+ }
1249
+ if (this.errorList.length) {
1250
+ this.toShow = this.toShow.concat(this.containers);
1251
+ }
1252
+ if (this.settings.success) {
1253
+ for (const element of this.successList) {
1254
+ this.showLabel(element);
1255
+ }
1256
+ }
1257
+ if (this.settings.unhighlight) {
1258
+ for (const element of this.validElements()) {
1259
+ this.settings.unhighlight(element, this.errorClasses, this.validClasses);
1260
+ }
1261
+ }
1262
+ this.toHide = this.toHide.filter((el) => !this.toShow.includes(el));
1263
+ this.hideErrors();
1264
+ this.addWrapper(...this.toShow).forEach(showElement);
1265
+ }
1266
+ formatAndAdd(element, rule) {
1267
+ const message = this.getMessage(element, rule);
1268
+ this.errorList.push({ message, element, method: rule.method });
1269
+ this.errorMap[element.name] = message;
1270
+ this.submitted[element.name] = message;
1271
+ }
1272
+ prepareForm() {
1273
+ this.reset();
1274
+ this.toHide = this.errors().concat(this.containers);
1275
+ }
1276
+ hideErrors(element) {
1277
+ // we're either hiding all errors, or just the errors for a specific element
1278
+ let targets = this.toHide;
1279
+ if (element) {
1280
+ targets = this.errorsFor(element);
1281
+ }
1282
+ for (const el of targets) {
1283
+ if (!this.containers.includes(el)) {
1284
+ el.innerText = '';
1285
+ }
1286
+ this.addWrapper(el).forEach(hideElement);
1287
+ }
1288
+ }
1289
+ addWrapper(...elements) {
1290
+ const result = Array.isArray(elements) ? elements : [elements];
1291
+ if (!this.settings.wrapper) {
1292
+ return result;
1293
+ }
1294
+ const wrappers = result
1295
+ .map((el) => el.parentElement)
1296
+ .filter((el) => el && el.matches(this.settings.wrapper));
1297
+ result.push(...wrappers);
1298
+ return result;
1299
+ }
1300
+ showLabel(element, message) {
1301
+ var _a;
1302
+ let errors = this.errorsFor(element);
1303
+ const elementID = idOrName(element);
1304
+ const describedBy = element.getAttribute('aria-describedby');
1305
+ if (errors.length) {
1306
+ // Non-label error exists but is not currently associated with element via aria-describedby
1307
+ const labelSelector = `label[for='${escapeCssMeta(elementID)}']`;
1308
+ const nonLabelExists = errors
1309
+ .map((e) => e.closest(labelSelector))
1310
+ .every((e) => e === null);
1311
+ const noDescriberAssociation = () => {
1312
+ var _a, _b;
1313
+ if (describedBy === null) {
1314
+ return true;
1315
+ }
1316
+ const firstErrorId = (_b = (_a = errors[0]) === null || _a === void 0 ? void 0 : _a.getAttribute('id')) !== null && _b !== void 0 ? _b : null;
1317
+ if (firstErrorId === null) {
1318
+ return true;
1319
+ }
1320
+ const split = describedBy.split(' ');
1321
+ return split.indexOf(firstErrorId) === -1;
1322
+ };
1323
+ if (nonLabelExists && noDescriberAssociation()) {
1324
+ const firstErrorId = errors[0].getAttribute('id');
1325
+ this.addErrorAriaDescribedBy(element, firstErrorId);
1326
+ }
1327
+ // Refresh error/success class
1328
+ errors.forEach((el) => {
1329
+ el.classList.remove(this.settings.validClass);
1330
+ el.classList.add(...this.errorClasses);
1331
+ if (this.settings.escapeHtml) {
1332
+ el.innerText = message || '';
1333
+ }
1334
+ else {
1335
+ el.innerHTML = message || '';
1336
+ }
1337
+ });
1338
+ }
1339
+ else {
1340
+ const newError = document.createElement(this.settings.errorElement);
1341
+ newError.setAttribute('id', `${elementID}-error`);
1342
+ newError.classList.add(...this.errorClasses);
1343
+ if (this.settings.escapeHtml) {
1344
+ newError.innerText = message || '';
1345
+ }
1346
+ else {
1347
+ newError.innerHTML = message || '';
1348
+ }
1349
+ // Maintain reference to the element(s) to be placed into the DOM
1350
+ let insert = newError;
1351
+ if (this.settings.wrapper) {
1352
+ const wrapper = document.createElement(this.settings.wrapper);
1353
+ wrapper.appendChild(newError);
1354
+ insert = wrapper;
1355
+ }
1356
+ if (this.labelContainer) {
1357
+ this.labelContainer.appendChild(insert);
1358
+ }
1359
+ else if (this.settings.errorPlacement) {
1360
+ this.settings.errorPlacement(insert, element);
1361
+ }
1362
+ else {
1363
+ element.after(insert);
1364
+ }
1365
+ // Link error back to the element
1366
+ if (newError.matches('label')) {
1367
+ // If the error is a label, then associate using 'for'
1368
+ newError.setAttribute('for', elementID);
1369
+ }
1370
+ // If the element is not a child of an associated label, then it's necessary
1371
+ // to explicitly apply aria-describedby
1372
+ else if (!((_a = newError.parentElement) === null || _a === void 0 ? void 0 : _a.matches(`label[for='${escapeCssMeta(elementID)}']`))) {
1373
+ this.addErrorAriaDescribedBy(element, newError.getAttribute('id'));
1374
+ }
1375
+ errors = [newError];
1376
+ }
1377
+ if (!message && this.settings.success) {
1378
+ errors.forEach((e) => (e.innerText = ''));
1379
+ const successSetting = this.settings.success;
1380
+ if (typeof successSetting === 'string') {
1381
+ errors.forEach((e) => e.classList.add(successSetting));
1382
+ }
1383
+ else {
1384
+ successSetting(errors, element);
1385
+ }
1386
+ }
1387
+ this.toShow.push(...errors);
1388
+ }
1389
+ addErrorAriaDescribedBy(element, errorId) {
1390
+ let describedBy = element.getAttribute('aria-describedby');
1391
+ if (!describedBy) {
1392
+ describedBy = errorId;
1393
+ }
1394
+ else if (!describedBy.match(new RegExp(`\\b${escapeCssMeta(errorId)}\\b`))) {
1395
+ describedBy += ` ${errorId}`;
1396
+ }
1397
+ element.setAttribute('aria-describedby', describedBy);
1398
+ }
1399
+ errorsFor(element) {
1400
+ const name = escapeCssMeta(idOrName(element));
1401
+ const describer = element.getAttribute('aria-describedby');
1402
+ let selector = `label[for='${name}'], label[for='${name}'] *`;
1403
+ if (describer) {
1404
+ const escapedDescriber = escapeCssMeta(describer).replace(/\s+/g, ', #');
1405
+ selector += `, #${escapedDescriber}`;
1406
+ }
1407
+ return this.errors().filter((el) => el.matches(selector));
1408
+ }
1409
+ numberOfInvalids() {
1410
+ return objectLength(this.invalid);
1411
+ }
1412
+ destroy() {
1413
+ this.resetForm();
1414
+ validatorStore.delete(this.currentForm);
1415
+ this.eventManager.detachEventHandlers();
1416
+ }
1417
+ resetForm() {
1418
+ this.invalid = {};
1419
+ this.submitted = {};
1420
+ this.prepareForm();
1421
+ this.hideErrors();
1422
+ this.elements().forEach((el) => el.removeAttribute('aria-invalid'));
1423
+ this.resetElements();
1424
+ }
1425
+ resetElements() {
1426
+ if (this.settings.unhighlight) {
1427
+ for (const element of this.elements()) {
1428
+ this.settings.unhighlight(element, this.errorClasses, []);
1429
+ findByName(this.currentForm, element.name).forEach((el) => el.classList.remove(...this.validClasses));
1430
+ }
1431
+ }
1432
+ else {
1433
+ this.elements().forEach((el) => {
1434
+ el.classList.remove(...this.errorClasses);
1435
+ el.classList.remove(...this.validClasses);
1436
+ });
1437
+ }
1438
+ }
1439
+ validationTargetFor(element) {
1440
+ let targets = [element];
1441
+ if (isCheckableElement(element)) {
1442
+ targets = findByName(this.currentForm, element.name);
1443
+ }
1444
+ return targets.filter((t) => !this.shouldIgnore(t))[0];
1445
+ }
1446
+ /**
1447
+ * Returns true if the element should be skipped from receiving validation.
1448
+ * @param element - element to check
1449
+ * @return true if the element should be skipped, false otherwise
1450
+ */
1451
+ shouldIgnore(element) {
1452
+ if (!this.settings.ignore) {
1453
+ return false;
1454
+ }
1455
+ if (this.settings.ignore === ':hidden') {
1456
+ return !isVisible(element);
1457
+ }
1458
+ return element.matches(this.settings.ignore);
1459
+ }
1460
+ getMessage(element, rule) {
1461
+ if (typeof rule === 'string') {
1462
+ rule = { method: rule };
1463
+ }
1464
+ let customMessage;
1465
+ const msgSettings = this.settings.messages[element.name];
1466
+ if (msgSettings && typeof msgSettings === 'string') {
1467
+ customMessage = msgSettings;
1468
+ }
1469
+ else if (msgSettings && typeof msgSettings === 'object') {
1470
+ customMessage = msgSettings[rule.method];
1471
+ }
1472
+ return getMessage.call(this, element, rule, this.settings.ignoreTitle, customMessage);
1473
+ }
1474
+ focusInvalid() {
1475
+ const lastActive = this.findLastActive();
1476
+ const firstErrorElement = this.errorList.length
1477
+ ? this.errorList[0].element
1478
+ : null;
1479
+ const el = lastActive || firstErrorElement;
1480
+ if (!el || !isVisible(el)) {
1481
+ return;
1482
+ }
1483
+ // Focus the element
1484
+ el.focus();
1485
+ // Manually dispatch "focusin"
1486
+ const focusInEvent = new Event('focusin', { bubbles: true });
1487
+ el.dispatchEvent(focusInEvent);
1488
+ }
1489
+ findLastActive() {
1490
+ const lastActive = this.lastActive;
1491
+ if (!lastActive)
1492
+ return;
1493
+ const matches = this.errorList.filter((n) => n.element.name === lastActive.name);
1494
+ return matches.length === 1 ? lastActive : undefined;
1495
+ }
1496
+ get errorClasses() {
1497
+ return this.settings.errorClass.split(' ').filter(Boolean);
1498
+ }
1499
+ get validClasses() {
1500
+ return this.settings.validClass.split(' ').filter(Boolean);
1501
+ }
1502
+ }
1503
+
1504
+ /**
1505
+ * @fileoverview Core validation library for client-side form validation.
1506
+ * Provides programmatic API for validating forms and form elements.
1507
+ */
1508
+ /**
1509
+ * Creates or retrieves a validator for a form or form element.
1510
+ * If a validator already exists for the element, returns the existing validator.
1511
+ *
1512
+ * @param selector - CSS selector string or HTMLElement to validate
1513
+ * @param [options] - Validation options including rules, messages, and callbacks
1514
+ * @returns Validator instance or undefined if element not found
1515
+ * @example
1516
+ * // Validate a form with rules
1517
+ * dv.validate('#myForm', {
1518
+ * rules: {
1519
+ * email: { required: true, email: true },
1520
+ * password: { required: true, minlength: 8 }
1521
+ * }
1522
+ * });
1523
+ */
1524
+ function validate(selector, options) {
1525
+ if (!selector) {
1526
+ console.warn("No element selected, can't validate.");
1527
+ return;
1528
+ }
1529
+ const element = selector instanceof Element ? selector : document.querySelector(selector);
1530
+ if (!element) {
1531
+ console.warn("No element selected, can't validate.");
1532
+ return;
1533
+ }
1534
+ if (!(element instanceof HTMLFormElement)) {
1535
+ const elementType = element.tagName || 'unknown element';
1536
+ console.warn(`Element must be a form element for validation. Received: ${elementType}`);
1537
+ return;
1538
+ }
1539
+ if (validatorStore.has(element)) {
1540
+ return validatorStore.get(element);
1541
+ }
1542
+ const validator = new Validator(element, options);
1543
+ validatorStore.set(element, validator);
1544
+ return validator;
1545
+ }
1546
+ /**
1547
+ * Validates form or form elements and returns whether they are valid.
1548
+ * Triggers validation and returns the result without submitting the form.
1549
+ *
1550
+ * @param selector - Element(s) to validate:
1551
+ * CSS selector, element, or array of elements
1552
+ * @returns True if all elements are valid, false otherwise
1553
+ * @example
1554
+ * // Check if form is valid
1555
+ * if (dv.valid('#myForm')) {
1556
+ * console.log('Form is valid!');
1557
+ * }
1558
+ *
1559
+ * // Check specific fields
1560
+ * if (dv.valid(['#email', '#password'])) {
1561
+ * console.log('Email and password are valid!');
1562
+ * }
1563
+ */
1564
+ function valid(selector) {
1565
+ var _a, _b;
1566
+ let elements = [];
1567
+ if (typeof selector === 'string') {
1568
+ elements = Array.from(document.querySelectorAll(selector));
1569
+ }
1570
+ else if (selector instanceof HTMLElement) {
1571
+ elements = [selector];
1572
+ }
1573
+ else if (Array.isArray(selector)) {
1574
+ elements = selector;
1575
+ }
1576
+ if (elements[0].matches('form')) {
1577
+ return (_b = (_a = validate(elements[0])) === null || _a === void 0 ? void 0 : _a.form()) !== null && _b !== void 0 ? _b : false;
1578
+ }
1579
+ const errorList = [];
1580
+ let valid = true;
1581
+ const validator = validate(elements[0].form);
1582
+ if (!validator) {
1583
+ return false;
1584
+ }
1585
+ elements.forEach((el) => {
1586
+ valid = validator.element(el) && valid;
1587
+ if (!valid) {
1588
+ errorList.push(...validator.errorList);
1589
+ }
1590
+ });
1591
+ validator.errorList = errorList;
1592
+ return valid;
1593
+ }
1594
+ /**
1595
+ * Gets the validation rules for an element.
1596
+ *
1597
+ * @param selector - CSS selector string or HTMLElement
1598
+ * @returns Object containing validation rules for the element
1599
+ * @example
1600
+ * // Get rules for an input
1601
+ * const emailRules = dv.rules('#email');
1602
+ * console.log(emailRules); // { required: true, email: true }
1603
+ */
1604
+ function rules(selector) {
1605
+ const element = selector instanceof HTMLElement
1606
+ ? selector
1607
+ : document.querySelector(selector);
1608
+ const validator = validate(element.form);
1609
+ if (!validator) {
1610
+ return {};
1611
+ }
1612
+ return getRules(element, validator.rules);
1613
+ }
1614
+ /**
1615
+ * Adds a custom validation method.
1616
+ * The method can be used in validation rules by its name.
1617
+ *
1618
+ * @param name - Name of the validation method
1619
+ * @param method - Validation function that returns true if valid
1620
+ * @param message - Default error message for this validation method
1621
+ * @example
1622
+ * // Add a custom phone validation method
1623
+ * dv.addMethod('phone', function(blank, value, element) {
1624
+ * return blank || /^\d{3}-\d{3}-\d{4}$/.test(value);
1625
+ * }, 'Please enter a valid phone number (xxx-xxx-xxxx)');
1626
+ *
1627
+ * // Use in validation rules
1628
+ * dv.validate('#myForm', {
1629
+ * rules: {
1630
+ * phoneNumber: { phone: true }
1631
+ * }
1632
+ * });
1633
+ */
1634
+ function addMethod(name, method, message) {
1635
+ store$1.set(name, method);
1636
+ if (message) {
1637
+ store.set(name, message);
1638
+ }
1639
+ if (method.length < 3) {
1640
+ addClassRule(name);
1641
+ }
1642
+ }
1643
+ function localize(data) {
1644
+ const firstValue = Object.values(data)[0];
1645
+ if (typeof firstValue === 'string') {
1646
+ store.replace(data);
1647
+ }
1648
+ else {
1649
+ store$1.replace(data);
1650
+ }
1651
+ }
1652
+ /**
1653
+ * Default export containing all validation functions and stores.
1654
+ * @namespace
1655
+ */
1656
+ var index = {
1657
+ validate,
1658
+ valid,
1659
+ rules,
1660
+ addMethod,
1661
+ localize,
1662
+ messages: store,
1663
+ methods: store$1,
1664
+ };
1665
+
1666
+ export { addMethod, index as default, localize, store as messages, store$1 as methods, rules, valid, validate };
1667
+ //# sourceMappingURL=dv.esm.js.map