altcha 2.3.0 → 3.0.0-beta.2

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 (497) hide show
  1. package/LICENSE.txt +1 -1
  2. package/README.md +201 -204
  3. package/dist/external/altcha.css +1 -0
  4. package/dist/external/altcha.js +6825 -0
  5. package/dist/external/altcha.min.js +1 -0
  6. package/dist/external/altcha.umd.cjs +6831 -0
  7. package/dist/external/altcha.umd.min.cjs +1 -0
  8. package/dist/external/index.d.ts +1 -0
  9. package/dist/i18n/419.d.ts +1 -0
  10. package/dist/i18n/af.d.ts +1 -0
  11. package/dist/i18n/af.js +22 -0
  12. package/dist/i18n/af.umd.cjs +27 -0
  13. package/dist/i18n/africa.d.ts +1 -0
  14. package/{dist_i18n → dist/i18n}/africa.js +52 -97
  15. package/dist/i18n/africa.umd.cjs +159 -0
  16. package/dist/i18n/all.d.ts +1 -0
  17. package/{dist_i18n → dist/i18n}/all.js +487 -299
  18. package/dist/i18n/all.umd.cjs +1347 -0
  19. package/dist/i18n/am.d.ts +1 -0
  20. package/dist/i18n/am.js +22 -0
  21. package/dist/i18n/am.umd.cjs +27 -0
  22. package/dist/i18n/americas.d.ts +1 -0
  23. package/{dist_i18n → dist/i18n}/americas.js +24 -85
  24. package/dist/i18n/americas.umd.cjs +71 -0
  25. package/dist/i18n/ar.d.ts +1 -0
  26. package/dist/i18n/ar.js +22 -0
  27. package/dist/i18n/ar.umd.cjs +27 -0
  28. package/dist/i18n/asia.d.ts +1 -0
  29. package/{dist_i18n → dist/i18n}/asia.js +199 -158
  30. package/dist/i18n/asia.umd.cjs +533 -0
  31. package/dist/i18n/az.d.ts +1 -0
  32. package/dist/i18n/az.js +22 -0
  33. package/dist/i18n/az.umd.cjs +27 -0
  34. package/dist/i18n/be.d.ts +1 -0
  35. package/dist/i18n/be.js +22 -0
  36. package/dist/i18n/be.umd.cjs +27 -0
  37. package/dist/i18n/bg.d.ts +1 -0
  38. package/dist/i18n/bg.js +22 -0
  39. package/dist/i18n/bg.umd.cjs +27 -0
  40. package/dist/i18n/bn.d.ts +1 -0
  41. package/dist/i18n/bn.js +22 -0
  42. package/dist/i18n/bn.umd.cjs +27 -0
  43. package/dist/i18n/br.d.ts +1 -0
  44. package/dist/i18n/bs.d.ts +1 -0
  45. package/dist/i18n/bs.js +22 -0
  46. package/dist/i18n/bs.umd.cjs +27 -0
  47. package/dist/i18n/ca.d.ts +1 -0
  48. package/dist/i18n/ca.js +22 -0
  49. package/dist/i18n/ca.umd.cjs +27 -0
  50. package/dist/i18n/cn.d.ts +1 -0
  51. package/dist/i18n/cs.d.ts +1 -0
  52. package/dist/i18n/cs.js +22 -0
  53. package/dist/i18n/cs.umd.cjs +27 -0
  54. package/dist/i18n/da.d.ts +1 -0
  55. package/dist/i18n/da.js +22 -0
  56. package/dist/i18n/da.umd.cjs +27 -0
  57. package/dist/i18n/de.d.ts +1 -0
  58. package/dist/i18n/de.js +22 -0
  59. package/dist/i18n/de.umd.cjs +27 -0
  60. package/dist/i18n/el.d.ts +1 -0
  61. package/dist/i18n/el.js +22 -0
  62. package/dist/i18n/el.umd.cjs +27 -0
  63. package/dist/i18n/en.d.ts +1 -0
  64. package/dist/i18n/en.js +22 -0
  65. package/dist/i18n/en.umd.cjs +27 -0
  66. package/dist/i18n/es-419.js +22 -0
  67. package/dist/i18n/es-419.umd.cjs +27 -0
  68. package/dist/i18n/es-es.js +22 -0
  69. package/dist/i18n/es-es.umd.cjs +27 -0
  70. package/dist/i18n/es.d.ts +1 -0
  71. package/dist/i18n/et.d.ts +1 -0
  72. package/dist/i18n/et.js +22 -0
  73. package/dist/i18n/et.umd.cjs +27 -0
  74. package/dist/i18n/eu.d.ts +1 -0
  75. package/dist/i18n/eu.js +22 -0
  76. package/dist/i18n/eu.umd.cjs +27 -0
  77. package/dist/i18n/europe.d.ts +1 -0
  78. package/{dist_i18n → dist/i18n}/europe.js +283 -209
  79. package/dist/i18n/europe.umd.cjs +819 -0
  80. package/dist/i18n/fa.d.ts +1 -0
  81. package/dist/i18n/fa.js +22 -0
  82. package/dist/i18n/fa.umd.cjs +27 -0
  83. package/dist/i18n/fi.d.ts +1 -0
  84. package/dist/i18n/fi.js +22 -0
  85. package/dist/i18n/fi.umd.cjs +27 -0
  86. package/dist/i18n/fr-ca.js +22 -0
  87. package/dist/i18n/fr-ca.umd.cjs +27 -0
  88. package/dist/i18n/fr-fr.js +22 -0
  89. package/dist/i18n/fr-fr.umd.cjs +27 -0
  90. package/dist/i18n/fr.d.ts +1 -0
  91. package/dist/i18n/ga.d.ts +1 -0
  92. package/dist/i18n/ga.js +22 -0
  93. package/dist/i18n/ga.umd.cjs +27 -0
  94. package/dist/i18n/he.d.ts +1 -0
  95. package/dist/i18n/he.js +22 -0
  96. package/dist/i18n/he.umd.cjs +27 -0
  97. package/dist/i18n/hi.d.ts +1 -0
  98. package/dist/i18n/hi.js +22 -0
  99. package/dist/i18n/hi.umd.cjs +27 -0
  100. package/dist/i18n/hk.d.ts +1 -0
  101. package/dist/i18n/hr.d.ts +1 -0
  102. package/dist/i18n/hr.js +22 -0
  103. package/dist/i18n/hr.umd.cjs +27 -0
  104. package/dist/i18n/hu.d.ts +1 -0
  105. package/dist/i18n/hu.js +22 -0
  106. package/dist/i18n/hu.umd.cjs +27 -0
  107. package/dist/i18n/hy.d.ts +1 -0
  108. package/dist/i18n/hy.js +22 -0
  109. package/dist/i18n/hy.umd.cjs +27 -0
  110. package/dist/i18n/id.d.ts +1 -0
  111. package/dist/i18n/id.js +22 -0
  112. package/dist/i18n/id.umd.cjs +27 -0
  113. package/dist/i18n/is.d.ts +1 -0
  114. package/dist/i18n/is.js +22 -0
  115. package/dist/i18n/is.umd.cjs +27 -0
  116. package/dist/i18n/it.d.ts +1 -0
  117. package/dist/i18n/it.js +22 -0
  118. package/dist/i18n/it.umd.cjs +27 -0
  119. package/dist/i18n/ja.d.ts +1 -0
  120. package/dist/i18n/ja.js +22 -0
  121. package/dist/i18n/ja.umd.cjs +27 -0
  122. package/dist/i18n/ka.d.ts +1 -0
  123. package/dist/i18n/ka.js +22 -0
  124. package/dist/i18n/ka.umd.cjs +27 -0
  125. package/dist/i18n/kk.d.ts +1 -0
  126. package/dist/i18n/kk.js +22 -0
  127. package/dist/i18n/kk.umd.cjs +27 -0
  128. package/dist/i18n/ko.d.ts +1 -0
  129. package/dist/i18n/ko.js +22 -0
  130. package/dist/i18n/ko.umd.cjs +27 -0
  131. package/dist/i18n/lb.d.ts +1 -0
  132. package/dist/i18n/lb.js +22 -0
  133. package/dist/i18n/lb.umd.cjs +27 -0
  134. package/dist/i18n/lt.d.ts +1 -0
  135. package/dist/i18n/lt.js +22 -0
  136. package/dist/i18n/lt.umd.cjs +27 -0
  137. package/dist/i18n/lv.d.ts +1 -0
  138. package/dist/i18n/lv.js +22 -0
  139. package/dist/i18n/lv.umd.cjs +27 -0
  140. package/dist/i18n/me.d.ts +1 -0
  141. package/dist/i18n/me.js +22 -0
  142. package/dist/i18n/me.umd.cjs +27 -0
  143. package/dist/i18n/mk.d.ts +1 -0
  144. package/dist/i18n/mk.js +22 -0
  145. package/dist/i18n/mk.umd.cjs +27 -0
  146. package/dist/i18n/mr.d.ts +1 -0
  147. package/dist/i18n/mr.js +22 -0
  148. package/dist/i18n/mr.umd.cjs +27 -0
  149. package/dist/i18n/mt.d.ts +1 -0
  150. package/dist/i18n/mt.js +22 -0
  151. package/dist/i18n/mt.umd.cjs +27 -0
  152. package/dist/i18n/nb.d.ts +1 -0
  153. package/dist/i18n/nb.js +22 -0
  154. package/dist/i18n/nb.umd.cjs +27 -0
  155. package/dist/i18n/nl.d.ts +1 -0
  156. package/dist/i18n/nl.js +22 -0
  157. package/dist/i18n/nl.umd.cjs +27 -0
  158. package/dist/i18n/pl.d.ts +1 -0
  159. package/dist/i18n/pl.js +22 -0
  160. package/dist/i18n/pl.umd.cjs +27 -0
  161. package/dist/i18n/pt-br.js +22 -0
  162. package/dist/i18n/pt-br.umd.cjs +27 -0
  163. package/dist/i18n/pt-pt.js +22 -0
  164. package/dist/i18n/pt-pt.umd.cjs +27 -0
  165. package/dist/i18n/pt.d.ts +1 -0
  166. package/dist/i18n/ro.d.ts +1 -0
  167. package/dist/i18n/ro.js +22 -0
  168. package/dist/i18n/ro.umd.cjs +27 -0
  169. package/dist/i18n/ru.d.ts +1 -0
  170. package/dist/i18n/ru.js +22 -0
  171. package/dist/i18n/ru.umd.cjs +27 -0
  172. package/dist/i18n/sk.d.ts +1 -0
  173. package/dist/i18n/sk.js +22 -0
  174. package/dist/i18n/sk.umd.cjs +27 -0
  175. package/dist/i18n/sl.d.ts +1 -0
  176. package/dist/i18n/sl.js +22 -0
  177. package/dist/i18n/sl.umd.cjs +27 -0
  178. package/dist/i18n/sq.d.ts +1 -0
  179. package/dist/i18n/sq.js +22 -0
  180. package/dist/i18n/sq.umd.cjs +27 -0
  181. package/dist/i18n/sr.d.ts +1 -0
  182. package/dist/i18n/sr.js +22 -0
  183. package/dist/i18n/sr.umd.cjs +27 -0
  184. package/dist/i18n/sv.d.ts +1 -0
  185. package/dist/i18n/sv.js +22 -0
  186. package/dist/i18n/sv.umd.cjs +27 -0
  187. package/dist/i18n/sw.d.ts +1 -0
  188. package/dist/i18n/sw.js +22 -0
  189. package/dist/i18n/sw.umd.cjs +27 -0
  190. package/dist/i18n/ta.d.ts +1 -0
  191. package/dist/i18n/ta.js +22 -0
  192. package/dist/i18n/ta.umd.cjs +27 -0
  193. package/dist/i18n/te.d.ts +1 -0
  194. package/dist/i18n/te.js +22 -0
  195. package/dist/i18n/te.umd.cjs +27 -0
  196. package/dist/i18n/th.d.ts +1 -0
  197. package/dist/i18n/th.js +22 -0
  198. package/dist/i18n/th.umd.cjs +27 -0
  199. package/dist/i18n/tk.d.ts +1 -0
  200. package/dist/i18n/tk.js +22 -0
  201. package/dist/i18n/tk.umd.cjs +27 -0
  202. package/dist/i18n/tr.d.ts +1 -0
  203. package/dist/i18n/tr.js +22 -0
  204. package/dist/i18n/tr.umd.cjs +27 -0
  205. package/dist/i18n/tw.d.ts +1 -0
  206. package/dist/i18n/uk.d.ts +1 -0
  207. package/dist/i18n/uk.js +22 -0
  208. package/dist/i18n/uk.umd.cjs +27 -0
  209. package/dist/i18n/ur.d.ts +1 -0
  210. package/dist/i18n/ur.js +22 -0
  211. package/dist/i18n/ur.umd.cjs +27 -0
  212. package/dist/i18n/uz.d.ts +1 -0
  213. package/dist/i18n/uz.js +22 -0
  214. package/dist/i18n/uz.umd.cjs +27 -0
  215. package/dist/i18n/vi.d.ts +1 -0
  216. package/dist/i18n/vi.js +22 -0
  217. package/dist/i18n/vi.umd.cjs +27 -0
  218. package/dist/i18n/yo.d.ts +1 -0
  219. package/dist/i18n/yo.js +22 -0
  220. package/dist/i18n/yo.umd.cjs +27 -0
  221. package/dist/i18n/zh-cn.js +22 -0
  222. package/dist/i18n/zh-cn.umd.cjs +27 -0
  223. package/dist/i18n/zh-hk.js +22 -0
  224. package/dist/i18n/zh-hk.umd.cjs +27 -0
  225. package/dist/i18n/zh-tw.js +22 -0
  226. package/dist/i18n/zh-tw.umd.cjs +27 -0
  227. package/dist/lib/index.d.ts +468 -0
  228. package/dist/lib/index.js +1416 -0
  229. package/dist/lib/index.min.js +1 -0
  230. package/dist/lib/index.umd.cjs +1420 -0
  231. package/dist/lib/index.umd.min.cjs +1 -0
  232. package/dist/main/altcha.i18n.js +8565 -0
  233. package/dist/main/altcha.i18n.min.js +1 -0
  234. package/dist/main/altcha.i18n.umd.cjs +8568 -0
  235. package/dist/main/altcha.i18n.umd.min.cjs +1 -0
  236. package/dist/main/altcha.js +7223 -0
  237. package/dist/main/altcha.min.js +1 -0
  238. package/dist/main/altcha.umd.cjs +7226 -0
  239. package/dist/main/altcha.umd.min.cjs +1 -0
  240. package/dist/plugins/obfuscation.plugin.d.ts +1 -0
  241. package/dist/plugins/obfuscation.plugin.js +320 -0
  242. package/dist/plugins/obfuscation.plugin.min.js +1 -0
  243. package/dist/plugins/obfuscation.plugin.umd.cjs +325 -0
  244. package/dist/plugins/obfuscation.plugin.umd.min.cjs +1 -0
  245. package/dist/themes/aqua.css +19 -0
  246. package/dist/themes/aqua.min.css +1 -0
  247. package/dist/themes/business.css +15 -0
  248. package/dist/themes/business.min.css +1 -0
  249. package/dist/themes/caramel.css +19 -0
  250. package/dist/themes/caramel.min.css +1 -0
  251. package/dist/themes/cupcake.css +16 -0
  252. package/dist/themes/cupcake.min.css +1 -0
  253. package/dist/themes/cyberpunk.css +24 -0
  254. package/dist/themes/cyberpunk.min.css +1 -0
  255. package/dist/themes/lime.css +14 -0
  256. package/dist/themes/lime.min.css +1 -0
  257. package/dist/themes/wireframe.css +17 -0
  258. package/dist/themes/wireframe.min.css +1 -0
  259. package/dist/types/generic.d.ts +25 -0
  260. package/dist/types/generic.js +1 -0
  261. package/dist/types/global.d.ts +5 -0
  262. package/dist/types/global.js +1 -0
  263. package/dist/types/index.d.ts +397 -0
  264. package/dist/types/index.js +23 -0
  265. package/dist/types/jsx.d.ts +13 -0
  266. package/dist/types/jsx.js +1 -0
  267. package/dist/types/react.d.ts +35 -0
  268. package/dist/types/react.js +1 -0
  269. package/dist/types/svelte.d.ts +26 -0
  270. package/dist/types/svelte.js +1 -0
  271. package/dist/workers/argon2id.js +786 -0
  272. package/dist/workers/pbkdf2.js +176 -0
  273. package/dist/workers/scrypt.js +739 -0
  274. package/dist/workers/sha.js +160 -0
  275. package/package.json +146 -112
  276. package/dist/altcha.d.ts +0 -183
  277. package/dist/altcha.i18n.d.ts +0 -183
  278. package/dist/altcha.i18n.js +0 -4182
  279. package/dist/altcha.i18n.umd.js +0 -4
  280. package/dist/altcha.js +0 -3105
  281. package/dist/altcha.umd.cjs +0 -4
  282. package/dist_external/altcha.css +0 -1
  283. package/dist_external/altcha.d.ts +0 -183
  284. package/dist_external/altcha.js +0 -3075
  285. package/dist_external/altcha.umd.cjs +0 -3
  286. package/dist_external/worker.js +0 -1
  287. package/dist_i18n/af.d.ts +0 -1
  288. package/dist_i18n/af.js +0 -94
  289. package/dist_i18n/af.umd.cjs +0 -1
  290. package/dist_i18n/africa.d.ts +0 -1
  291. package/dist_i18n/africa.umd.cjs +0 -1
  292. package/dist_i18n/all.d.ts +0 -1
  293. package/dist_i18n/all.umd.cjs +0 -1
  294. package/dist_i18n/am.d.ts +0 -1
  295. package/dist_i18n/am.js +0 -94
  296. package/dist_i18n/am.umd.cjs +0 -1
  297. package/dist_i18n/americas.d.ts +0 -1
  298. package/dist_i18n/americas.umd.cjs +0 -1
  299. package/dist_i18n/ar.d.ts +0 -1
  300. package/dist_i18n/ar.js +0 -94
  301. package/dist_i18n/ar.umd.cjs +0 -1
  302. package/dist_i18n/asia.d.ts +0 -1
  303. package/dist_i18n/asia.umd.cjs +0 -1
  304. package/dist_i18n/az.d.ts +0 -1
  305. package/dist_i18n/az.js +0 -94
  306. package/dist_i18n/az.umd.cjs +0 -1
  307. package/dist_i18n/be.d.ts +0 -1
  308. package/dist_i18n/be.js +0 -94
  309. package/dist_i18n/be.umd.cjs +0 -1
  310. package/dist_i18n/bg.d.ts +0 -1
  311. package/dist_i18n/bg.js +0 -94
  312. package/dist_i18n/bg.umd.cjs +0 -1
  313. package/dist_i18n/bn.d.ts +0 -1
  314. package/dist_i18n/bn.js +0 -94
  315. package/dist_i18n/bn.umd.cjs +0 -1
  316. package/dist_i18n/bs.d.ts +0 -1
  317. package/dist_i18n/bs.js +0 -94
  318. package/dist_i18n/bs.umd.cjs +0 -1
  319. package/dist_i18n/ca.d.ts +0 -1
  320. package/dist_i18n/ca.js +0 -94
  321. package/dist_i18n/ca.umd.cjs +0 -1
  322. package/dist_i18n/cs.d.ts +0 -1
  323. package/dist_i18n/cs.js +0 -94
  324. package/dist_i18n/cs.umd.cjs +0 -1
  325. package/dist_i18n/da.d.ts +0 -1
  326. package/dist_i18n/da.js +0 -94
  327. package/dist_i18n/da.umd.cjs +0 -1
  328. package/dist_i18n/de.d.ts +0 -1
  329. package/dist_i18n/de.js +0 -94
  330. package/dist_i18n/de.umd.cjs +0 -1
  331. package/dist_i18n/el.d.ts +0 -1
  332. package/dist_i18n/el.js +0 -94
  333. package/dist_i18n/el.umd.cjs +0 -1
  334. package/dist_i18n/en.d.ts +0 -1
  335. package/dist_i18n/en.js +0 -94
  336. package/dist_i18n/en.umd.cjs +0 -1
  337. package/dist_i18n/es-419.d.ts +0 -1
  338. package/dist_i18n/es-419.js +0 -94
  339. package/dist_i18n/es-419.umd.cjs +0 -1
  340. package/dist_i18n/es-es.d.ts +0 -1
  341. package/dist_i18n/es-es.js +0 -94
  342. package/dist_i18n/es-es.umd.cjs +0 -1
  343. package/dist_i18n/et.d.ts +0 -1
  344. package/dist_i18n/et.js +0 -94
  345. package/dist_i18n/et.umd.cjs +0 -1
  346. package/dist_i18n/eu.d.ts +0 -1
  347. package/dist_i18n/eu.js +0 -94
  348. package/dist_i18n/eu.umd.cjs +0 -1
  349. package/dist_i18n/europe.d.ts +0 -1
  350. package/dist_i18n/europe.umd.cjs +0 -1
  351. package/dist_i18n/fa.d.ts +0 -1
  352. package/dist_i18n/fa.js +0 -94
  353. package/dist_i18n/fa.umd.cjs +0 -1
  354. package/dist_i18n/fi.d.ts +0 -1
  355. package/dist_i18n/fi.js +0 -94
  356. package/dist_i18n/fi.umd.cjs +0 -1
  357. package/dist_i18n/fr-ca.d.ts +0 -1
  358. package/dist_i18n/fr-ca.js +0 -94
  359. package/dist_i18n/fr-ca.umd.cjs +0 -1
  360. package/dist_i18n/fr-fr.d.ts +0 -1
  361. package/dist_i18n/fr-fr.js +0 -94
  362. package/dist_i18n/fr-fr.umd.cjs +0 -1
  363. package/dist_i18n/ga.d.ts +0 -1
  364. package/dist_i18n/ga.js +0 -94
  365. package/dist_i18n/ga.umd.cjs +0 -1
  366. package/dist_i18n/he.d.ts +0 -1
  367. package/dist_i18n/he.js +0 -94
  368. package/dist_i18n/he.umd.cjs +0 -1
  369. package/dist_i18n/hi.d.ts +0 -1
  370. package/dist_i18n/hi.js +0 -94
  371. package/dist_i18n/hi.umd.cjs +0 -1
  372. package/dist_i18n/hr.d.ts +0 -1
  373. package/dist_i18n/hr.js +0 -94
  374. package/dist_i18n/hr.umd.cjs +0 -1
  375. package/dist_i18n/hu.d.ts +0 -1
  376. package/dist_i18n/hu.js +0 -94
  377. package/dist_i18n/hu.umd.cjs +0 -1
  378. package/dist_i18n/hy.d.ts +0 -1
  379. package/dist_i18n/hy.js +0 -94
  380. package/dist_i18n/hy.umd.cjs +0 -1
  381. package/dist_i18n/id.d.ts +0 -1
  382. package/dist_i18n/id.js +0 -94
  383. package/dist_i18n/id.umd.cjs +0 -1
  384. package/dist_i18n/is.d.ts +0 -1
  385. package/dist_i18n/is.js +0 -94
  386. package/dist_i18n/is.umd.cjs +0 -1
  387. package/dist_i18n/it.d.ts +0 -1
  388. package/dist_i18n/it.js +0 -94
  389. package/dist_i18n/it.umd.cjs +0 -1
  390. package/dist_i18n/ja.d.ts +0 -1
  391. package/dist_i18n/ja.js +0 -94
  392. package/dist_i18n/ja.umd.cjs +0 -1
  393. package/dist_i18n/ka.d.ts +0 -1
  394. package/dist_i18n/ka.js +0 -94
  395. package/dist_i18n/ka.umd.cjs +0 -1
  396. package/dist_i18n/kk.d.ts +0 -1
  397. package/dist_i18n/kk.js +0 -94
  398. package/dist_i18n/kk.umd.cjs +0 -1
  399. package/dist_i18n/ko.d.ts +0 -1
  400. package/dist_i18n/ko.js +0 -94
  401. package/dist_i18n/ko.umd.cjs +0 -1
  402. package/dist_i18n/lb.d.ts +0 -1
  403. package/dist_i18n/lb.js +0 -94
  404. package/dist_i18n/lb.umd.cjs +0 -1
  405. package/dist_i18n/lt.d.ts +0 -1
  406. package/dist_i18n/lt.js +0 -94
  407. package/dist_i18n/lt.umd.cjs +0 -1
  408. package/dist_i18n/lv.d.ts +0 -1
  409. package/dist_i18n/lv.js +0 -94
  410. package/dist_i18n/lv.umd.cjs +0 -1
  411. package/dist_i18n/me.d.ts +0 -1
  412. package/dist_i18n/me.js +0 -94
  413. package/dist_i18n/me.umd.cjs +0 -1
  414. package/dist_i18n/mk.d.ts +0 -1
  415. package/dist_i18n/mk.js +0 -94
  416. package/dist_i18n/mk.umd.cjs +0 -1
  417. package/dist_i18n/mr.d.ts +0 -1
  418. package/dist_i18n/mr.js +0 -94
  419. package/dist_i18n/mr.umd.cjs +0 -1
  420. package/dist_i18n/mt.d.ts +0 -1
  421. package/dist_i18n/mt.js +0 -94
  422. package/dist_i18n/mt.umd.cjs +0 -1
  423. package/dist_i18n/nb.d.ts +0 -1
  424. package/dist_i18n/nb.js +0 -95
  425. package/dist_i18n/nb.umd.cjs +0 -1
  426. package/dist_i18n/nl.d.ts +0 -1
  427. package/dist_i18n/nl.js +0 -94
  428. package/dist_i18n/nl.umd.cjs +0 -1
  429. package/dist_i18n/pl.d.ts +0 -1
  430. package/dist_i18n/pl.js +0 -94
  431. package/dist_i18n/pl.umd.cjs +0 -1
  432. package/dist_i18n/pt-br.d.ts +0 -1
  433. package/dist_i18n/pt-br.js +0 -94
  434. package/dist_i18n/pt-br.umd.cjs +0 -1
  435. package/dist_i18n/pt-pt.d.ts +0 -1
  436. package/dist_i18n/pt-pt.js +0 -94
  437. package/dist_i18n/pt-pt.umd.cjs +0 -1
  438. package/dist_i18n/ro.d.ts +0 -1
  439. package/dist_i18n/ro.js +0 -94
  440. package/dist_i18n/ro.umd.cjs +0 -1
  441. package/dist_i18n/ru.d.ts +0 -1
  442. package/dist_i18n/ru.js +0 -94
  443. package/dist_i18n/ru.umd.cjs +0 -1
  444. package/dist_i18n/sk.d.ts +0 -1
  445. package/dist_i18n/sk.js +0 -94
  446. package/dist_i18n/sk.umd.cjs +0 -1
  447. package/dist_i18n/sl.d.ts +0 -1
  448. package/dist_i18n/sl.js +0 -94
  449. package/dist_i18n/sl.umd.cjs +0 -1
  450. package/dist_i18n/sq.d.ts +0 -1
  451. package/dist_i18n/sq.js +0 -94
  452. package/dist_i18n/sq.umd.cjs +0 -1
  453. package/dist_i18n/sr.d.ts +0 -1
  454. package/dist_i18n/sr.js +0 -94
  455. package/dist_i18n/sr.umd.cjs +0 -1
  456. package/dist_i18n/sv.d.ts +0 -1
  457. package/dist_i18n/sv.js +0 -94
  458. package/dist_i18n/sv.umd.cjs +0 -1
  459. package/dist_i18n/sw.d.ts +0 -1
  460. package/dist_i18n/sw.js +0 -94
  461. package/dist_i18n/sw.umd.cjs +0 -1
  462. package/dist_i18n/ta.d.ts +0 -1
  463. package/dist_i18n/ta.js +0 -94
  464. package/dist_i18n/ta.umd.cjs +0 -1
  465. package/dist_i18n/te.d.ts +0 -1
  466. package/dist_i18n/te.js +0 -94
  467. package/dist_i18n/te.umd.cjs +0 -1
  468. package/dist_i18n/th.d.ts +0 -1
  469. package/dist_i18n/th.js +0 -94
  470. package/dist_i18n/th.umd.cjs +0 -1
  471. package/dist_i18n/tk.d.ts +0 -1
  472. package/dist_i18n/tk.js +0 -94
  473. package/dist_i18n/tk.umd.cjs +0 -1
  474. package/dist_i18n/tr.d.ts +0 -1
  475. package/dist_i18n/tr.js +0 -94
  476. package/dist_i18n/tr.umd.cjs +0 -1
  477. package/dist_i18n/uk.d.ts +0 -1
  478. package/dist_i18n/uk.js +0 -94
  479. package/dist_i18n/uk.umd.cjs +0 -1
  480. package/dist_i18n/ur.d.ts +0 -1
  481. package/dist_i18n/ur.js +0 -94
  482. package/dist_i18n/ur.umd.cjs +0 -1
  483. package/dist_i18n/uz.d.ts +0 -1
  484. package/dist_i18n/uz.js +0 -94
  485. package/dist_i18n/uz.umd.cjs +0 -1
  486. package/dist_i18n/vi.d.ts +0 -1
  487. package/dist_i18n/vi.js +0 -94
  488. package/dist_i18n/vi.umd.cjs +0 -1
  489. package/dist_i18n/yo.d.ts +0 -1
  490. package/dist_i18n/yo.js +0 -94
  491. package/dist_i18n/yo.umd.cjs +0 -1
  492. package/dist_i18n/zh-cn.d.ts +0 -1
  493. package/dist_i18n/zh-cn.js +0 -94
  494. package/dist_i18n/zh-cn.umd.cjs +0 -1
  495. package/dist_i18n/zh-tw.d.ts +0 -1
  496. package/dist_i18n/zh-tw.js +0 -94
  497. package/dist_i18n/zh-tw.umd.cjs +0 -1
@@ -0,0 +1,468 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ export interface AltchaGlobal {
4
+ algorithms: Map<string, () => Worker | Promise<Worker>>;
5
+ defaults: Store<Partial<Configuration>>;
6
+ i18n: Store<Record<string, Record<string, string>>>;
7
+ instances: Set<HTMLElement>;
8
+ plugins: Set<new (host: HTMLElement & WidgetMethods) => any>;
9
+ }
10
+ export declare enum AudioState {
11
+ ERROR = "error",
12
+ LOADING = "loading",
13
+ PLAYING = "playing",
14
+ PAUSED = "paused",
15
+ READY = "ready"
16
+ }
17
+ export interface Configuration {
18
+ /**
19
+ * Forces a specific language for audio-based challenges.
20
+ */
21
+ audioChallengeLanguage: string;
22
+ /**
23
+ * Determines when verification triggers automatically.
24
+ * @default 'off'
25
+ */
26
+ auto: "off" | "onfocus" | "onload" | "onsubmit";
27
+ /**
28
+ * Vertical position of the widget when `display` is set to `bar`.
29
+ */
30
+ barPlacement: "bottom" | "top";
31
+ /**
32
+ * The challenge data or the URL to fetch a new challenge from.
33
+ */
34
+ challenge: Challenge | string | null;
35
+ /**
36
+ * A specific code-challenge object. Overrides values provided in the `challenge` property.
37
+ */
38
+ codeChallenge: CodeChallenge | null;
39
+ /**
40
+ * The UI layout used for the code-challenge modal.
41
+ */
42
+ codeChallengeDisplay: "standard" | "overlay" | "bottomsheet";
43
+ /**
44
+ * Defines how credentials (cookies/auth headers) are handled during the challenge request.
45
+ */
46
+ credentials: RequestCredentials | null;
47
+ /**
48
+ * Enables verbose logging in the browser console for debugging.
49
+ */
50
+ debug: boolean;
51
+ /**
52
+ * The minimum verification time in milliseconds (adds an artificial delay if the PoW is faster).
53
+ * @default 500
54
+ */
55
+ minDuration: number;
56
+ /**
57
+ * Prevents the code-challenge modal from stealing focus when opened.
58
+ */
59
+ disableAutoFocus: boolean;
60
+ /**
61
+ * The visual layout mode of the widget.
62
+ */
63
+ display: "standard" | "bar" | "floating" | "overlay" | "invisible";
64
+ /**
65
+ * A custom `fetch` implementation for network requests.
66
+ */
67
+ fetch: typeof fetch;
68
+ /**
69
+ * The element or CSS selector the floating UI attaches to.
70
+ * Defaults to the first `submit` button in the parent form.
71
+ */
72
+ floatingAnchor: string | HTMLElement | null;
73
+ /**
74
+ * Vertical offset (in pixels) between the floating UI and its anchor.
75
+ * @default 12
76
+ */
77
+ floatingOffset: number;
78
+ /**
79
+ * Controls whether the floating widget remains visible after successful verification.
80
+ */
81
+ floatingPersist: boolean | "focus";
82
+ /**
83
+ * Preferred position of the floating widget relative to the anchor.
84
+ */
85
+ floatingPlacement: "auto" | "bottom" | "top";
86
+ /**
87
+ * Hides the "ALTCHA" attribution link.
88
+ */
89
+ hideFooter: boolean;
90
+ /**
91
+ * Hides the ALTCHA logo icon.
92
+ */
93
+ hideLogo: boolean;
94
+ /**
95
+ * The ISO alpha-2 language code for localization (requires corresponding i18n file).
96
+ */
97
+ language: string;
98
+ /**
99
+ * Forces the widget into a failed state with a mock error for UI testing.
100
+ */
101
+ mockError: boolean;
102
+ /**
103
+ * The `name` attribute of the hidden input field containing the payload.
104
+ * @default 'altcha'
105
+ */
106
+ name: string;
107
+ /**
108
+ * CSS selector for an element to be mirrored inside the overlay modal.
109
+ */
110
+ overlayContent: string | null;
111
+ /**
112
+ * Automatically attempts to restart verification with fewer workers if the browser runs out of memory (Argon2 and Scrypt only).
113
+ */
114
+ retryOnOutOfMemoryError: boolean;
115
+ /**
116
+ * Includes other form field values in the server-side verification request.
117
+ */
118
+ serverVerificationFields: boolean;
119
+ /**
120
+ * Includes the user's time zone in the server-side verification request.
121
+ */
122
+ serverVerificationTimeZone: boolean;
123
+ /**
124
+ * When set, the widget will set a configured cookie for the payload instead of sending it as form field.
125
+ */
126
+ setCookie: SetCookieOptions | null;
127
+ /**
128
+ * Mocks a successful verification. Useful for testing environments without network access.
129
+ */
130
+ test: boolean;
131
+ /**
132
+ * The visual style of the interaction element.
133
+ */
134
+ type: "native" | "checkbox" | "switch";
135
+ /**
136
+ * Custom validation message for the HTML5 `setCustomValidity` API.
137
+ */
138
+ validationMessage: string;
139
+ /**
140
+ * A custom verification handler. Overrides the default network-based verification.
141
+ */
142
+ verifyFunction: ((payload: string, code?: string) => Promise<ServerVerificationResult | null>) | null;
143
+ /**
144
+ * The endpoint URL for server-side verification.
145
+ */
146
+ verifyUrl: string | null;
147
+ /**
148
+ * The number of Web Workers to spawn for proof-of-work calculations.
149
+ */
150
+ workers: number;
151
+ }
152
+ export interface Challenge {
153
+ codeChallenge?: CodeChallenge;
154
+ parameters: ChallengeParameters;
155
+ signature?: string;
156
+ }
157
+ export interface ChallengeParameters {
158
+ algorithm: string;
159
+ nonce: string;
160
+ salt: string;
161
+ cost: number;
162
+ keyLength: number;
163
+ keyPrefix: string;
164
+ keySignature?: string;
165
+ memoryCost?: number;
166
+ parallelism?: number;
167
+ expiresAt?: number;
168
+ data?: Record<string, string | number | boolean | null>;
169
+ }
170
+ export interface ChallengeV1 {
171
+ algorithm: string;
172
+ challenge: string;
173
+ codeChallenge?: CodeChallenge;
174
+ salt: string;
175
+ maxnumber?: number;
176
+ maxNumber?: number;
177
+ signature: string;
178
+ }
179
+ export interface CodeChallenge {
180
+ image: string;
181
+ audio?: string;
182
+ length?: number;
183
+ }
184
+ export interface CreateChallengeOptions {
185
+ algorithm: string;
186
+ counter?: number;
187
+ counterMode?: "uint32" | "string";
188
+ cost: number;
189
+ data?: Record<string, string | number | boolean | null>;
190
+ deriveKey: DeriveKeyFunction;
191
+ expiresAt?: number | Date;
192
+ hmacAlgorithm?: HmacAlgorithm;
193
+ hmacKeySignatureSecret?: string;
194
+ hmacSignatureSecret?: string;
195
+ keyLength?: number;
196
+ keyPrefix?: string;
197
+ keyPrefixLength?: number;
198
+ memoryCost?: number;
199
+ parallelism?: number;
200
+ }
201
+ export interface CSSVariables {
202
+ "--altcha-border-color": string;
203
+ "--altcha-border-width": string;
204
+ "--altcha-border-radius": string;
205
+ "--altcha-color-base": string;
206
+ "--altcha-color-base-content": string;
207
+ "--altcha-color-error": string;
208
+ "--altcha-color-error-content": string;
209
+ "--altcha-color-neutral": string;
210
+ "--altcha-color-neutral-content": string;
211
+ "--altcha-color-primary": string;
212
+ "--altcha-color-primary-content": string;
213
+ "--altcha-color-success": string;
214
+ "--altcha-color-success-content": string;
215
+ "--altcha-checkbox-border-color": string;
216
+ "--altcha-checkbox-border-radius": string;
217
+ "--altcha-checkbox-border-width": string;
218
+ "--altcha-checkbox-outline": string;
219
+ "--altcha-checkbox-outline-offset": string;
220
+ "--altcha-checkbox-size": string;
221
+ "--altcha-checkbox-transition-duration": string;
222
+ "--altcha-input-background-color": string;
223
+ "--altcha-input-border-radius": string;
224
+ "--altcha-input-border-width": string;
225
+ "--altcha-max-width": string;
226
+ "--altcha-padding": string;
227
+ "--altcha-popover-arrow-size": string;
228
+ "--altcha-popover-color": string;
229
+ "--altcha-shadow": string;
230
+ "--altcha-spinner-color": string;
231
+ "--altcha-switch-background-color": string;
232
+ "--altcha-switch-border-radius": string;
233
+ "--altcha-switch-height": string;
234
+ "--altcha-switch-padding": string;
235
+ "--altcha-switch-width": string;
236
+ "--altcha-switch-toggle-border-radius": string;
237
+ "--altcha-switch-toggle-color": string;
238
+ "--altcha-switch-toggle-size": string;
239
+ "--altcha-transition-duration": string;
240
+ "--altcha-z-index": string | number;
241
+ "--altcha-z-index-popover": string | number;
242
+ }
243
+ export type DeriveKeyFunction = (parameters: ChallengeParameters, salt: Uint8Array, password: Uint8Array) => Promise<DeriveKeyFunctionResult>;
244
+ export interface DeriveKeyFunctionResult {
245
+ parameters?: Partial<ChallengeParameters>;
246
+ derivedKey: Uint8Array;
247
+ }
248
+ export declare enum HmacAlgorithm {
249
+ SHA_256 = "SHA-256",
250
+ SHA_384 = "SHA-384",
251
+ SHA_512 = "SHA-512"
252
+ }
253
+ export interface Payload {
254
+ challenge: Omit<Challenge, "codeChallenge">;
255
+ solution: Solution;
256
+ }
257
+ export interface PayloadV1 {
258
+ algorithm: string;
259
+ challenge: string;
260
+ number: number;
261
+ salt: string;
262
+ signature?: string;
263
+ took: number;
264
+ }
265
+ export interface SetCookieOptions {
266
+ domain?: string;
267
+ name?: string;
268
+ maxAge?: number;
269
+ path?: string;
270
+ sameSite?: string;
271
+ secure?: boolean;
272
+ }
273
+ export type ServerClassification = "BAD" | "GOOD" | "NEUTRAL";
274
+ export interface ServerSignaturePayload {
275
+ algorithm: string;
276
+ apiKey?: string;
277
+ id?: string;
278
+ signature: string;
279
+ verificationData: string;
280
+ verified: boolean;
281
+ }
282
+ export interface ServerSignatureVerificationData {
283
+ [key: string]: string | unknown;
284
+ classification?: ServerClassification;
285
+ email?: string;
286
+ expire?: number;
287
+ fields?: string[];
288
+ fieldsHash?: string;
289
+ id?: string;
290
+ ipAddress?: string;
291
+ reasons?: string[];
292
+ score?: number;
293
+ time?: number;
294
+ verified?: boolean;
295
+ }
296
+ export interface ServerVerificationResult {
297
+ algorithm?: string;
298
+ apiKey?: string;
299
+ id?: string;
300
+ payload?: string;
301
+ reason?: string;
302
+ score?: number;
303
+ signature?: string;
304
+ verificationData?: string;
305
+ verified?: boolean;
306
+ }
307
+ export interface SolveChallengeOptions {
308
+ challenge: Challenge;
309
+ controller?: AbortController;
310
+ counterStart?: number;
311
+ counterStep?: number;
312
+ counterMode?: "uint32" | "string";
313
+ deriveKey: DeriveKeyFunction;
314
+ timeout?: number;
315
+ }
316
+ export interface Strings {
317
+ ariaLinkLabel: string;
318
+ enterCode: string;
319
+ enterCodeAria: string;
320
+ error: string;
321
+ expired: string;
322
+ footer: string;
323
+ getAudioChallenge: string;
324
+ label: string;
325
+ loading: string;
326
+ reload: string;
327
+ verify: string;
328
+ verificationRequired: string;
329
+ verified: string;
330
+ verifying: string;
331
+ waitAlert: string;
332
+ }
333
+ export declare enum State {
334
+ CODE = "code",
335
+ ERROR = "error",
336
+ VERIFIED = "verified",
337
+ VERIFYING = "verifying",
338
+ UNVERIFIED = "unverified",
339
+ EXPIRED = "expired"
340
+ }
341
+ export interface Solution {
342
+ counter: number;
343
+ derivedKey: string;
344
+ time?: number;
345
+ }
346
+ export type Store<T extends object, K extends keyof T = keyof T> = {
347
+ get: (name: K) => T[K];
348
+ set: <N extends K>(name: N | T, value?: T[N]) => void;
349
+ store: Writable<T>;
350
+ };
351
+ export interface VerifyOptions {
352
+ concurrency?: number;
353
+ controller?: AbortController;
354
+ minDuration?: number;
355
+ }
356
+ export interface VerifyResult {
357
+ challenge?: Challenge;
358
+ payload: string;
359
+ solution?: Solution;
360
+ }
361
+ export interface VerifyServerSignatureResult extends VerifySolutionResult {
362
+ verificationData?: ServerSignatureVerificationData | null;
363
+ }
364
+ export interface VerifySolutionOptions {
365
+ challenge: Challenge;
366
+ counterMode?: "uint32" | "string";
367
+ deriveKey: DeriveKeyFunction;
368
+ hmacAlgorithm?: HmacAlgorithm;
369
+ hmacKeySignatureSecret?: string;
370
+ hmacSignatureSecret: string;
371
+ solution: Solution;
372
+ }
373
+ export interface VerifySolutionResult {
374
+ expired: boolean;
375
+ invalidSignature: boolean | null;
376
+ invalidSolution: boolean | null;
377
+ time: number;
378
+ verified: boolean;
379
+ }
380
+ export interface WidgetAttributes extends Partial<Pick<Configuration, "auto" | "display" | "language" | "name" | "type">> {
381
+ challenge?: string;
382
+ configuration?: string;
383
+ }
384
+ export interface WidgetMethods {
385
+ configure: (config: Partial<Configuration>) => Promise<void>;
386
+ getConfiguration: () => Configuration;
387
+ getState: () => State;
388
+ hide: () => void;
389
+ reset: (newState: State) => void;
390
+ setState: (newState: State, err?: string | null) => void;
391
+ show: () => void;
392
+ updateUI: () => void;
393
+ verify: (options?: VerifyOptions) => Promise<VerifyResult | null>;
394
+ }
395
+ export type Writable<T = Record<string, Record<string, string>>> = {
396
+ set(this: void, value: T): void;
397
+ update(this: void, updater: (value: T) => T): void;
398
+ subscribe(this: void, run: (value: T) => void, invalidate?: () => void): () => void;
399
+ };
400
+ declare function deriveKey(parameters: ChallengeParameters, salt: Uint8Array, password: Uint8Array): Promise<DeriveKeyFunctionResult>;
401
+ declare function deriveKey$1(parameters: ChallengeParameters, salt: Uint8Array, password: Uint8Array): Promise<DeriveKeyFunctionResult>;
402
+ declare function deriveKey$2(parameters: ChallengeParameters, salt: Uint8Array, password: Uint8Array): Promise<DeriveKeyFunctionResult>;
403
+ declare function deriveKey$3(parameters: ChallengeParameters, salt: Uint8Array, password: Uint8Array): Promise<DeriveKeyFunctionResult>;
404
+ /**
405
+ * Creates a new proof-of-work challenge.
406
+ *
407
+ * Generates random nonce and salt, optionally pre-computes a key prefix
408
+ * from a known counter value, and optionally signs the challenge with HMAC.
409
+ */
410
+ export declare function createChallenge(options: CreateChallengeOptions): Promise<Challenge>;
411
+ /**
412
+ * Solves a challenge by brute-forcing counter values until the derived key
413
+ * starts with the required prefix. Returns the solution or null on timeout/abort.
414
+ */
415
+ export declare function solveChallenge(options: SolveChallengeOptions): Promise<Solution | null>;
416
+ /**
417
+ * Solves a challenge using multiple Web Workers in parallel.
418
+ * Each worker tests a different subset of counter values (interleaved by concurrency).
419
+ * Automatically retries with fewer workers on out-of-memory errors.
420
+ */
421
+ export declare function solveChallengeWorkers(options: Omit<SolveChallengeOptions, "deriveKey"> & {
422
+ concurrency: number;
423
+ createWorker: (algorithm: string) => Worker | Promise<Worker>;
424
+ onOutOfMemory?: (concurrency: number) => number | void;
425
+ }): Promise<Solution | null>;
426
+ /**
427
+ * Verifies a submitted solution against a challenge.
428
+ *
429
+ * Checks (in order):
430
+ * 1. Whether the challenge has expired.
431
+ * 2. Whether the challenge has signature parameter.
432
+ * 3. Whether the challenge signature is valid (tamper check).
433
+ * 4. Whether the derived key matches — either via key signature or by re-deriving.
434
+ */
435
+ export declare function verifySolution(options: VerifySolutionOptions): Promise<VerifySolutionResult>;
436
+ export declare function parseVerificationData(data: string, convertToArray?: string[]): ServerSignatureVerificationData | null;
437
+ export declare function verifyFieldsHash(options: {
438
+ formData: FormData | Record<string, unknown>;
439
+ fields: string[];
440
+ fieldsHash: string;
441
+ algorithm?: string;
442
+ }): Promise<boolean>;
443
+ export declare function verifyServerSignature(options: {
444
+ payload: ServerSignaturePayload;
445
+ hmacSecret: string;
446
+ }): Promise<VerifyServerSignatureResult>;
447
+
448
+ declare namespace sha {
449
+ export { deriveKey$3 as deriveKey };
450
+ }
451
+ declare namespace argon2id {
452
+ export { deriveKey };
453
+ }
454
+ declare namespace pbkdf2 {
455
+ export { deriveKey$1 as deriveKey };
456
+ }
457
+ declare namespace scrypt {
458
+ export { deriveKey$2 as deriveKey };
459
+ }
460
+
461
+ export {
462
+ argon2id,
463
+ pbkdf2,
464
+ scrypt,
465
+ sha,
466
+ };
467
+
468
+ export {};