altcha 2.3.0 → 3.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (494) hide show
  1. package/LICENSE.txt +1 -1
  2. package/README.md +149 -204
  3. package/dist/external/altcha.css +1 -0
  4. package/dist/external/altcha.js +6681 -0
  5. package/dist/external/altcha.min.js +1 -0
  6. package/dist/external/altcha.umd.cjs +6687 -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 +465 -299
  18. package/dist/i18n/all.umd.cjs +1325 -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 +177 -158
  30. package/dist/i18n/asia.umd.cjs +511 -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/hr.d.ts +1 -0
  101. package/dist/i18n/hr.js +22 -0
  102. package/dist/i18n/hr.umd.cjs +27 -0
  103. package/dist/i18n/hu.d.ts +1 -0
  104. package/dist/i18n/hu.js +22 -0
  105. package/dist/i18n/hu.umd.cjs +27 -0
  106. package/dist/i18n/hy.d.ts +1 -0
  107. package/dist/i18n/hy.js +22 -0
  108. package/dist/i18n/hy.umd.cjs +27 -0
  109. package/dist/i18n/id.d.ts +1 -0
  110. package/dist/i18n/id.js +22 -0
  111. package/dist/i18n/id.umd.cjs +27 -0
  112. package/dist/i18n/is.d.ts +1 -0
  113. package/dist/i18n/is.js +22 -0
  114. package/dist/i18n/is.umd.cjs +27 -0
  115. package/dist/i18n/it.d.ts +1 -0
  116. package/dist/i18n/it.js +22 -0
  117. package/dist/i18n/it.umd.cjs +27 -0
  118. package/dist/i18n/ja.d.ts +1 -0
  119. package/dist/i18n/ja.js +22 -0
  120. package/dist/i18n/ja.umd.cjs +27 -0
  121. package/dist/i18n/ka.d.ts +1 -0
  122. package/dist/i18n/ka.js +22 -0
  123. package/dist/i18n/ka.umd.cjs +27 -0
  124. package/dist/i18n/kk.d.ts +1 -0
  125. package/dist/i18n/kk.js +22 -0
  126. package/dist/i18n/kk.umd.cjs +27 -0
  127. package/dist/i18n/ko.d.ts +1 -0
  128. package/dist/i18n/ko.js +22 -0
  129. package/dist/i18n/ko.umd.cjs +27 -0
  130. package/dist/i18n/lb.d.ts +1 -0
  131. package/dist/i18n/lb.js +22 -0
  132. package/dist/i18n/lb.umd.cjs +27 -0
  133. package/dist/i18n/lt.d.ts +1 -0
  134. package/dist/i18n/lt.js +22 -0
  135. package/dist/i18n/lt.umd.cjs +27 -0
  136. package/dist/i18n/lv.d.ts +1 -0
  137. package/dist/i18n/lv.js +22 -0
  138. package/dist/i18n/lv.umd.cjs +27 -0
  139. package/dist/i18n/me.d.ts +1 -0
  140. package/dist/i18n/me.js +22 -0
  141. package/dist/i18n/me.umd.cjs +27 -0
  142. package/dist/i18n/mk.d.ts +1 -0
  143. package/dist/i18n/mk.js +22 -0
  144. package/dist/i18n/mk.umd.cjs +27 -0
  145. package/dist/i18n/mr.d.ts +1 -0
  146. package/dist/i18n/mr.js +22 -0
  147. package/dist/i18n/mr.umd.cjs +27 -0
  148. package/dist/i18n/mt.d.ts +1 -0
  149. package/dist/i18n/mt.js +22 -0
  150. package/dist/i18n/mt.umd.cjs +27 -0
  151. package/dist/i18n/nb.d.ts +1 -0
  152. package/dist/i18n/nb.js +22 -0
  153. package/dist/i18n/nb.umd.cjs +27 -0
  154. package/dist/i18n/nl.d.ts +1 -0
  155. package/dist/i18n/nl.js +22 -0
  156. package/dist/i18n/nl.umd.cjs +27 -0
  157. package/dist/i18n/pl.d.ts +1 -0
  158. package/dist/i18n/pl.js +22 -0
  159. package/dist/i18n/pl.umd.cjs +27 -0
  160. package/dist/i18n/pt-br.js +22 -0
  161. package/dist/i18n/pt-br.umd.cjs +27 -0
  162. package/dist/i18n/pt-pt.js +22 -0
  163. package/dist/i18n/pt-pt.umd.cjs +27 -0
  164. package/dist/i18n/pt.d.ts +1 -0
  165. package/dist/i18n/ro.d.ts +1 -0
  166. package/dist/i18n/ro.js +22 -0
  167. package/dist/i18n/ro.umd.cjs +27 -0
  168. package/dist/i18n/ru.d.ts +1 -0
  169. package/dist/i18n/ru.js +22 -0
  170. package/dist/i18n/ru.umd.cjs +27 -0
  171. package/dist/i18n/sk.d.ts +1 -0
  172. package/dist/i18n/sk.js +22 -0
  173. package/dist/i18n/sk.umd.cjs +27 -0
  174. package/dist/i18n/sl.d.ts +1 -0
  175. package/dist/i18n/sl.js +22 -0
  176. package/dist/i18n/sl.umd.cjs +27 -0
  177. package/dist/i18n/sq.d.ts +1 -0
  178. package/dist/i18n/sq.js +22 -0
  179. package/dist/i18n/sq.umd.cjs +27 -0
  180. package/dist/i18n/sr.d.ts +1 -0
  181. package/dist/i18n/sr.js +22 -0
  182. package/dist/i18n/sr.umd.cjs +27 -0
  183. package/dist/i18n/sv.d.ts +1 -0
  184. package/dist/i18n/sv.js +22 -0
  185. package/dist/i18n/sv.umd.cjs +27 -0
  186. package/dist/i18n/sw.d.ts +1 -0
  187. package/dist/i18n/sw.js +22 -0
  188. package/dist/i18n/sw.umd.cjs +27 -0
  189. package/dist/i18n/ta.d.ts +1 -0
  190. package/dist/i18n/ta.js +22 -0
  191. package/dist/i18n/ta.umd.cjs +27 -0
  192. package/dist/i18n/te.d.ts +1 -0
  193. package/dist/i18n/te.js +22 -0
  194. package/dist/i18n/te.umd.cjs +27 -0
  195. package/dist/i18n/th.d.ts +1 -0
  196. package/dist/i18n/th.js +22 -0
  197. package/dist/i18n/th.umd.cjs +27 -0
  198. package/dist/i18n/tk.d.ts +1 -0
  199. package/dist/i18n/tk.js +22 -0
  200. package/dist/i18n/tk.umd.cjs +27 -0
  201. package/dist/i18n/tr.d.ts +1 -0
  202. package/dist/i18n/tr.js +22 -0
  203. package/dist/i18n/tr.umd.cjs +27 -0
  204. package/dist/i18n/tw.d.ts +1 -0
  205. package/dist/i18n/uk.d.ts +1 -0
  206. package/dist/i18n/uk.js +22 -0
  207. package/dist/i18n/uk.umd.cjs +27 -0
  208. package/dist/i18n/ur.d.ts +1 -0
  209. package/dist/i18n/ur.js +22 -0
  210. package/dist/i18n/ur.umd.cjs +27 -0
  211. package/dist/i18n/uz.d.ts +1 -0
  212. package/dist/i18n/uz.js +22 -0
  213. package/dist/i18n/uz.umd.cjs +27 -0
  214. package/dist/i18n/vi.d.ts +1 -0
  215. package/dist/i18n/vi.js +22 -0
  216. package/dist/i18n/vi.umd.cjs +27 -0
  217. package/dist/i18n/yo.d.ts +1 -0
  218. package/dist/i18n/yo.js +22 -0
  219. package/dist/i18n/yo.umd.cjs +27 -0
  220. package/dist/i18n/zh-cn.js +22 -0
  221. package/dist/i18n/zh-cn.umd.cjs +27 -0
  222. package/dist/i18n/zh-tw.js +22 -0
  223. package/dist/i18n/zh-tw.umd.cjs +27 -0
  224. package/dist/lib/index.d.ts +143 -0
  225. package/dist/lib/index.js +1344 -0
  226. package/dist/lib/index.min.js +1 -0
  227. package/dist/lib/index.umd.cjs +1348 -0
  228. package/dist/lib/index.umd.min.cjs +1 -0
  229. package/dist/main/altcha.i18n.js +8389 -0
  230. package/dist/main/altcha.i18n.min.js +1 -0
  231. package/dist/main/altcha.i18n.umd.cjs +8392 -0
  232. package/dist/main/altcha.i18n.umd.min.cjs +1 -0
  233. package/dist/main/altcha.js +7069 -0
  234. package/dist/main/altcha.min.js +1 -0
  235. package/dist/main/altcha.umd.cjs +7072 -0
  236. package/dist/main/altcha.umd.min.cjs +1 -0
  237. package/dist/plugins/obfuscation.plugin.d.ts +1 -0
  238. package/dist/plugins/obfuscation.plugin.js +320 -0
  239. package/dist/plugins/obfuscation.plugin.min.js +1 -0
  240. package/dist/plugins/obfuscation.plugin.umd.cjs +325 -0
  241. package/dist/plugins/obfuscation.plugin.umd.min.cjs +1 -0
  242. package/dist/themes/aqua.css +19 -0
  243. package/dist/themes/aqua.min.css +1 -0
  244. package/dist/themes/business.css +15 -0
  245. package/dist/themes/business.min.css +1 -0
  246. package/dist/themes/caramel.css +19 -0
  247. package/dist/themes/caramel.min.css +1 -0
  248. package/dist/themes/cupcake.css +16 -0
  249. package/dist/themes/cupcake.min.css +1 -0
  250. package/dist/themes/cyberpunk.css +24 -0
  251. package/dist/themes/cyberpunk.min.css +1 -0
  252. package/dist/themes/lime.css +13 -0
  253. package/dist/themes/lime.min.css +1 -0
  254. package/dist/themes/wireframe.css +17 -0
  255. package/dist/themes/wireframe.min.css +1 -0
  256. package/dist/types/generic.d.ts +25 -0
  257. package/dist/types/generic.js +1 -0
  258. package/dist/types/global.d.ts +5 -0
  259. package/dist/types/global.js +1 -0
  260. package/dist/types/index.d.ts +352 -0
  261. package/dist/types/index.js +23 -0
  262. package/dist/types/jsx.d.ts +13 -0
  263. package/dist/types/jsx.js +1 -0
  264. package/dist/types/react.d.ts +35 -0
  265. package/dist/types/react.js +1 -0
  266. package/dist/types/svelte.d.ts +26 -0
  267. package/dist/types/svelte.js +1 -0
  268. package/dist/workers/argon2id.js +786 -0
  269. package/dist/workers/pbkdf2.js +166 -0
  270. package/dist/workers/scrypt.js +739 -0
  271. package/dist/workers/sha.js +160 -0
  272. package/package.json +115 -81
  273. package/dist/altcha.d.ts +0 -183
  274. package/dist/altcha.i18n.d.ts +0 -183
  275. package/dist/altcha.i18n.js +0 -4182
  276. package/dist/altcha.i18n.umd.js +0 -4
  277. package/dist/altcha.js +0 -3105
  278. package/dist/altcha.umd.cjs +0 -4
  279. package/dist_external/altcha.css +0 -1
  280. package/dist_external/altcha.d.ts +0 -183
  281. package/dist_external/altcha.js +0 -3075
  282. package/dist_external/altcha.umd.cjs +0 -3
  283. package/dist_external/worker.js +0 -1
  284. package/dist_i18n/af.d.ts +0 -1
  285. package/dist_i18n/af.js +0 -94
  286. package/dist_i18n/af.umd.cjs +0 -1
  287. package/dist_i18n/africa.d.ts +0 -1
  288. package/dist_i18n/africa.umd.cjs +0 -1
  289. package/dist_i18n/all.d.ts +0 -1
  290. package/dist_i18n/all.umd.cjs +0 -1
  291. package/dist_i18n/am.d.ts +0 -1
  292. package/dist_i18n/am.js +0 -94
  293. package/dist_i18n/am.umd.cjs +0 -1
  294. package/dist_i18n/americas.d.ts +0 -1
  295. package/dist_i18n/americas.umd.cjs +0 -1
  296. package/dist_i18n/ar.d.ts +0 -1
  297. package/dist_i18n/ar.js +0 -94
  298. package/dist_i18n/ar.umd.cjs +0 -1
  299. package/dist_i18n/asia.d.ts +0 -1
  300. package/dist_i18n/asia.umd.cjs +0 -1
  301. package/dist_i18n/az.d.ts +0 -1
  302. package/dist_i18n/az.js +0 -94
  303. package/dist_i18n/az.umd.cjs +0 -1
  304. package/dist_i18n/be.d.ts +0 -1
  305. package/dist_i18n/be.js +0 -94
  306. package/dist_i18n/be.umd.cjs +0 -1
  307. package/dist_i18n/bg.d.ts +0 -1
  308. package/dist_i18n/bg.js +0 -94
  309. package/dist_i18n/bg.umd.cjs +0 -1
  310. package/dist_i18n/bn.d.ts +0 -1
  311. package/dist_i18n/bn.js +0 -94
  312. package/dist_i18n/bn.umd.cjs +0 -1
  313. package/dist_i18n/bs.d.ts +0 -1
  314. package/dist_i18n/bs.js +0 -94
  315. package/dist_i18n/bs.umd.cjs +0 -1
  316. package/dist_i18n/ca.d.ts +0 -1
  317. package/dist_i18n/ca.js +0 -94
  318. package/dist_i18n/ca.umd.cjs +0 -1
  319. package/dist_i18n/cs.d.ts +0 -1
  320. package/dist_i18n/cs.js +0 -94
  321. package/dist_i18n/cs.umd.cjs +0 -1
  322. package/dist_i18n/da.d.ts +0 -1
  323. package/dist_i18n/da.js +0 -94
  324. package/dist_i18n/da.umd.cjs +0 -1
  325. package/dist_i18n/de.d.ts +0 -1
  326. package/dist_i18n/de.js +0 -94
  327. package/dist_i18n/de.umd.cjs +0 -1
  328. package/dist_i18n/el.d.ts +0 -1
  329. package/dist_i18n/el.js +0 -94
  330. package/dist_i18n/el.umd.cjs +0 -1
  331. package/dist_i18n/en.d.ts +0 -1
  332. package/dist_i18n/en.js +0 -94
  333. package/dist_i18n/en.umd.cjs +0 -1
  334. package/dist_i18n/es-419.d.ts +0 -1
  335. package/dist_i18n/es-419.js +0 -94
  336. package/dist_i18n/es-419.umd.cjs +0 -1
  337. package/dist_i18n/es-es.d.ts +0 -1
  338. package/dist_i18n/es-es.js +0 -94
  339. package/dist_i18n/es-es.umd.cjs +0 -1
  340. package/dist_i18n/et.d.ts +0 -1
  341. package/dist_i18n/et.js +0 -94
  342. package/dist_i18n/et.umd.cjs +0 -1
  343. package/dist_i18n/eu.d.ts +0 -1
  344. package/dist_i18n/eu.js +0 -94
  345. package/dist_i18n/eu.umd.cjs +0 -1
  346. package/dist_i18n/europe.d.ts +0 -1
  347. package/dist_i18n/europe.umd.cjs +0 -1
  348. package/dist_i18n/fa.d.ts +0 -1
  349. package/dist_i18n/fa.js +0 -94
  350. package/dist_i18n/fa.umd.cjs +0 -1
  351. package/dist_i18n/fi.d.ts +0 -1
  352. package/dist_i18n/fi.js +0 -94
  353. package/dist_i18n/fi.umd.cjs +0 -1
  354. package/dist_i18n/fr-ca.d.ts +0 -1
  355. package/dist_i18n/fr-ca.js +0 -94
  356. package/dist_i18n/fr-ca.umd.cjs +0 -1
  357. package/dist_i18n/fr-fr.d.ts +0 -1
  358. package/dist_i18n/fr-fr.js +0 -94
  359. package/dist_i18n/fr-fr.umd.cjs +0 -1
  360. package/dist_i18n/ga.d.ts +0 -1
  361. package/dist_i18n/ga.js +0 -94
  362. package/dist_i18n/ga.umd.cjs +0 -1
  363. package/dist_i18n/he.d.ts +0 -1
  364. package/dist_i18n/he.js +0 -94
  365. package/dist_i18n/he.umd.cjs +0 -1
  366. package/dist_i18n/hi.d.ts +0 -1
  367. package/dist_i18n/hi.js +0 -94
  368. package/dist_i18n/hi.umd.cjs +0 -1
  369. package/dist_i18n/hr.d.ts +0 -1
  370. package/dist_i18n/hr.js +0 -94
  371. package/dist_i18n/hr.umd.cjs +0 -1
  372. package/dist_i18n/hu.d.ts +0 -1
  373. package/dist_i18n/hu.js +0 -94
  374. package/dist_i18n/hu.umd.cjs +0 -1
  375. package/dist_i18n/hy.d.ts +0 -1
  376. package/dist_i18n/hy.js +0 -94
  377. package/dist_i18n/hy.umd.cjs +0 -1
  378. package/dist_i18n/id.d.ts +0 -1
  379. package/dist_i18n/id.js +0 -94
  380. package/dist_i18n/id.umd.cjs +0 -1
  381. package/dist_i18n/is.d.ts +0 -1
  382. package/dist_i18n/is.js +0 -94
  383. package/dist_i18n/is.umd.cjs +0 -1
  384. package/dist_i18n/it.d.ts +0 -1
  385. package/dist_i18n/it.js +0 -94
  386. package/dist_i18n/it.umd.cjs +0 -1
  387. package/dist_i18n/ja.d.ts +0 -1
  388. package/dist_i18n/ja.js +0 -94
  389. package/dist_i18n/ja.umd.cjs +0 -1
  390. package/dist_i18n/ka.d.ts +0 -1
  391. package/dist_i18n/ka.js +0 -94
  392. package/dist_i18n/ka.umd.cjs +0 -1
  393. package/dist_i18n/kk.d.ts +0 -1
  394. package/dist_i18n/kk.js +0 -94
  395. package/dist_i18n/kk.umd.cjs +0 -1
  396. package/dist_i18n/ko.d.ts +0 -1
  397. package/dist_i18n/ko.js +0 -94
  398. package/dist_i18n/ko.umd.cjs +0 -1
  399. package/dist_i18n/lb.d.ts +0 -1
  400. package/dist_i18n/lb.js +0 -94
  401. package/dist_i18n/lb.umd.cjs +0 -1
  402. package/dist_i18n/lt.d.ts +0 -1
  403. package/dist_i18n/lt.js +0 -94
  404. package/dist_i18n/lt.umd.cjs +0 -1
  405. package/dist_i18n/lv.d.ts +0 -1
  406. package/dist_i18n/lv.js +0 -94
  407. package/dist_i18n/lv.umd.cjs +0 -1
  408. package/dist_i18n/me.d.ts +0 -1
  409. package/dist_i18n/me.js +0 -94
  410. package/dist_i18n/me.umd.cjs +0 -1
  411. package/dist_i18n/mk.d.ts +0 -1
  412. package/dist_i18n/mk.js +0 -94
  413. package/dist_i18n/mk.umd.cjs +0 -1
  414. package/dist_i18n/mr.d.ts +0 -1
  415. package/dist_i18n/mr.js +0 -94
  416. package/dist_i18n/mr.umd.cjs +0 -1
  417. package/dist_i18n/mt.d.ts +0 -1
  418. package/dist_i18n/mt.js +0 -94
  419. package/dist_i18n/mt.umd.cjs +0 -1
  420. package/dist_i18n/nb.d.ts +0 -1
  421. package/dist_i18n/nb.js +0 -95
  422. package/dist_i18n/nb.umd.cjs +0 -1
  423. package/dist_i18n/nl.d.ts +0 -1
  424. package/dist_i18n/nl.js +0 -94
  425. package/dist_i18n/nl.umd.cjs +0 -1
  426. package/dist_i18n/pl.d.ts +0 -1
  427. package/dist_i18n/pl.js +0 -94
  428. package/dist_i18n/pl.umd.cjs +0 -1
  429. package/dist_i18n/pt-br.d.ts +0 -1
  430. package/dist_i18n/pt-br.js +0 -94
  431. package/dist_i18n/pt-br.umd.cjs +0 -1
  432. package/dist_i18n/pt-pt.d.ts +0 -1
  433. package/dist_i18n/pt-pt.js +0 -94
  434. package/dist_i18n/pt-pt.umd.cjs +0 -1
  435. package/dist_i18n/ro.d.ts +0 -1
  436. package/dist_i18n/ro.js +0 -94
  437. package/dist_i18n/ro.umd.cjs +0 -1
  438. package/dist_i18n/ru.d.ts +0 -1
  439. package/dist_i18n/ru.js +0 -94
  440. package/dist_i18n/ru.umd.cjs +0 -1
  441. package/dist_i18n/sk.d.ts +0 -1
  442. package/dist_i18n/sk.js +0 -94
  443. package/dist_i18n/sk.umd.cjs +0 -1
  444. package/dist_i18n/sl.d.ts +0 -1
  445. package/dist_i18n/sl.js +0 -94
  446. package/dist_i18n/sl.umd.cjs +0 -1
  447. package/dist_i18n/sq.d.ts +0 -1
  448. package/dist_i18n/sq.js +0 -94
  449. package/dist_i18n/sq.umd.cjs +0 -1
  450. package/dist_i18n/sr.d.ts +0 -1
  451. package/dist_i18n/sr.js +0 -94
  452. package/dist_i18n/sr.umd.cjs +0 -1
  453. package/dist_i18n/sv.d.ts +0 -1
  454. package/dist_i18n/sv.js +0 -94
  455. package/dist_i18n/sv.umd.cjs +0 -1
  456. package/dist_i18n/sw.d.ts +0 -1
  457. package/dist_i18n/sw.js +0 -94
  458. package/dist_i18n/sw.umd.cjs +0 -1
  459. package/dist_i18n/ta.d.ts +0 -1
  460. package/dist_i18n/ta.js +0 -94
  461. package/dist_i18n/ta.umd.cjs +0 -1
  462. package/dist_i18n/te.d.ts +0 -1
  463. package/dist_i18n/te.js +0 -94
  464. package/dist_i18n/te.umd.cjs +0 -1
  465. package/dist_i18n/th.d.ts +0 -1
  466. package/dist_i18n/th.js +0 -94
  467. package/dist_i18n/th.umd.cjs +0 -1
  468. package/dist_i18n/tk.d.ts +0 -1
  469. package/dist_i18n/tk.js +0 -94
  470. package/dist_i18n/tk.umd.cjs +0 -1
  471. package/dist_i18n/tr.d.ts +0 -1
  472. package/dist_i18n/tr.js +0 -94
  473. package/dist_i18n/tr.umd.cjs +0 -1
  474. package/dist_i18n/uk.d.ts +0 -1
  475. package/dist_i18n/uk.js +0 -94
  476. package/dist_i18n/uk.umd.cjs +0 -1
  477. package/dist_i18n/ur.d.ts +0 -1
  478. package/dist_i18n/ur.js +0 -94
  479. package/dist_i18n/ur.umd.cjs +0 -1
  480. package/dist_i18n/uz.d.ts +0 -1
  481. package/dist_i18n/uz.js +0 -94
  482. package/dist_i18n/uz.umd.cjs +0 -1
  483. package/dist_i18n/vi.d.ts +0 -1
  484. package/dist_i18n/vi.js +0 -94
  485. package/dist_i18n/vi.umd.cjs +0 -1
  486. package/dist_i18n/yo.d.ts +0 -1
  487. package/dist_i18n/yo.js +0 -94
  488. package/dist_i18n/yo.umd.cjs +0 -1
  489. package/dist_i18n/zh-cn.d.ts +0 -1
  490. package/dist_i18n/zh-cn.js +0 -94
  491. package/dist_i18n/zh-cn.umd.cjs +0 -1
  492. package/dist_i18n/zh-tw.d.ts +0 -1
  493. package/dist_i18n/zh-tw.js +0 -94
  494. package/dist_i18n/zh-tw.umd.cjs +0 -1
package/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Daniel Regeci, BAU Software s.r.o.
3
+ Copyright (c) 2026 Daniel Regeci, BAU Software s.r.o.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -9,43 +9,32 @@ ALTCHA is fully compliant with:
9
9
 
10
10
  For more details, visit [altcha.org](https://altcha.org).
11
11
 
12
- > [!NOTE]
13
- > **Breaking change (v2.3.0)**
14
- >
15
- > As of version **2.3.0**, the obfuscation and other plugins have been removed from the main package and moved to a separate package: `@altcha/plugins`.
16
- >
17
- > If you do not use any plugins, no changes are required.
18
- >
19
- > See the [migration guide for v2.3.0](https://github.com/altcha-org/altcha/blob/main/MIGRATION-v2.3.0.md).
12
+ ## Playground
20
13
 
14
+ Want to see it in action? Visit the official ALTCHA Playground to experiment with widget configurations, fine-tune the Proof-of-Work (PoW) settings, and see how the security mechanisms hold up in real-time.
21
15
 
22
- ## Features
23
-
24
- - **Frictionless Experience**: Uses proof-of-work (PoW) instead of visual puzzles for a seamless user experience.
25
- - **Code Challenge (New in v2)**: Supports accessible code challenges ("enter code from image") with an audio option.
26
- - **Cookie-Free Design**: GDPR-compliant by default—no cookies or tracking.
27
- - **Fully Accessible**: Meets WCAG 2.2 AA-level standards and complies with the European Accessibility Act (EAA).
28
- - **Lightweight**: Minimal bundle size for fast page loads and optimal performance.
29
- - **Self-Hosted**: No dependency on third-party services.
16
+ [Open ALTCHA Playground](https://playground.altcha.org)
30
17
 
31
- ## What’s New in v2
32
-
33
- Version 2 introduces enhanced accessibility, expanded language support, and integration with **ALTCHA Sentinel**—a self-hosted anti-spam solution for websites, apps, and services.
18
+ ## Features
34
19
 
35
- ### Key Improvements in v2
20
+ - **Frictionless Experience**: Eliminates frustrating visual puzzles by using background **Proof-of-Work (PoW)** for a seamless user journey.
21
+ - **Hardware-Resistant Security**: Leverages **Argon2 and Scrypt** memory-bound algorithms to neutralize hardware acceleration (ASICs/GPUs) and sophisticated bot farms.
22
+ - **Accessible Code Challenges**: Provides "Enter code from image" fallbacks with built-in **audio support** for visually impaired users.
23
+ - **Privacy by Design**: Fully **GDPR compliant** and cookie-free—no tracking, no fingerprinting, and no data collection.
24
+ - **Universal Accessibility**: Engineered to exceed **WCAG 2.2 AA** standards, ensuring compliance with the **European Accessibility Act (EAA)**.
25
+ - **Lightweight**: Minimal footprint and zero dependencies, optimized for rapid page loads and high-performance environments.
26
+ - **100% Self-Hosted**: Maintain full sovereignty over your infrastructure with no reliance on third-party API availability.
36
27
 
37
- - **Built-in Internationalization (i18n)** for 50+ languages
38
- - **Improved RTL (right-to-left) language support**
39
- - **Enhanced WCAG accessibility**
40
- - **Support for accessible code challenges** (image + audio options)
41
- - **Overlay UI**
28
+ ## What’s New in v3
42
29
 
43
- ### Migrating from v1
30
+ - **Next-Gen PoW**: Significant performance gains and reduced CPU overhead through an optimized verification mechanism.
31
+ - **Advanced Bot Defense**: Native support for **Argon2 and Scrypt**, raising the cost of attack for automated scripts and specialized hardware.
32
+ - **Modern UI**: Refined styling options, including a suite of new built-in themes and improved CSS custom property support.
33
+ - **Developer Experience**: Improved TypeScript support and streamlined integration.
44
34
 
45
- Version 2 (v2) is fully compatible with v1, and minimal migration steps are required. However, be sure to test your integration after updating.
35
+ ### Migrating from v2
46
36
 
47
- - Translations: v2 introduces a new [built-in internationalization (i18n) system](#internationalization-i18n). The use of the `strings` attribute is now discouraged in favor of this new system.
48
- - [ALTCHA Sentinel](https://altcha.org/docs/v2/sentinel): Sentinel is a new self-hosted solution that replaces the previous SaaS services and the SpamFilter. We recommend migrating to Sentinel for better compliance, enhanced security, unlimited verifications, and an adaptive Captcha with code-challenge support.
37
+ See [MIGRATION-v2.md](/MIGRATION-v2.md).
49
38
 
50
39
  ## Examples
51
40
 
@@ -74,7 +63,7 @@ Explore starter templates for popular frameworks:
74
63
 
75
64
  ## Usage
76
65
 
77
- The ALTCHA widget is distributed as a **Web Component** and [supports all modern browsers](https://developer.mozilla.org/en-US/docs/Web/API/Web_components#browser_compatibility).
66
+ The ALTCHA widget is distributed as a **Web Component**.
78
67
 
79
68
  ### 1. Install ALTCHA
80
69
 
@@ -94,22 +83,11 @@ Or load via `<script>` tag:
94
83
  <script async defer src="/altcha.js" type="module"></script>
95
84
  ```
96
85
 
97
- **CDN**:
98
-
99
- ```html
100
- <script
101
- async
102
- defer
103
- src="https://cdn.jsdelivr.net/gh/altcha-org/altcha@main/dist/altcha.min.js"
104
- type="module"
105
- ></script>
106
- ```
107
-
108
86
  ### 2. Add `<altcha-widget>` to Your Forms
109
87
 
110
88
  ```html
111
89
  <form>
112
- <altcha-widget challengeurl="https://..."></altcha-widget>
90
+ <altcha-widget challenge="https://..."></altcha-widget>
113
91
  </form>
114
92
  ```
115
93
 
@@ -141,61 +119,107 @@ ALTCHA is optimized for performance:
141
119
 
142
120
  | Distribution | Size (GZIPped) |
143
121
  | ---------------------------- | -------------- |
144
- | ALTCHA | 30 kB |
145
- | ALTCHA with all translations | 46 kB |
122
+ | ALTCHA | 31 kB |
123
+ | ALTCHA with all translations | 49 kB |
146
124
  | Cloudflare Turnstile | 85+ kB |
147
125
  | hCaptcha | 250+ kB |
148
126
  | reCAPTCHA | 300+ kB |
149
127
 
150
- When GZIPped, it totals about 30 kB, making ALTCHA’s widget about 90% smaller than reCAPTCHA.
128
+ When GZIPped, it totals about 31 kB, making ALTCHA’s widget about 90% smaller than reCAPTCHA.
151
129
 
152
130
  ## Content Security Policy (CSP)
153
131
 
154
- The default bundle includes styles and workers in a single file. For strict CSP compliance, use scripts from `/dist_external`. Learn more in the [documentation](https://altcha.org/docs/v2/widget-integration).
132
+ The default bundle includes styles and workers in a single file. For strict CSP compliance, use scripts from `/dist/external`. Learn more in the [documentation](https://altcha.org/docs/v2/widget-integration).
155
133
 
156
134
  ## Configuration
157
135
 
158
- Required options (at least one is required):
159
-
160
- - **challengeurl**: Server endpoint to fetch the challenge.
161
- - **challengejson**: Preloaded JSON challenge data (avoids HTTP requests).
162
-
163
- Additional options:
164
-
165
- - **auto**: Automatically verify without user interaction (possible values: `off`, `onfocus`, `onload`, `onsubmit`).
166
- - **credentials**: Whether to include [credentials](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit#credentials) with the challenge request (possible values: `omit`, `same-origin`, `include`).
167
- - **customfetch**: A custom `fetch` function for retrieving the challenge.
168
- Accepts `url: string` and `init: RequestInit` as arguments and must return a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response).
169
- - **delay**: Artificial delay in milliseconds before verification (defaults to 0).
170
- - **disableautofocus**: If true, prevents the code-challenge input from automatically receiving focus on render (defaults to `false`).
171
- - **disablerefetchonexpire**: Whether to disable automatic re-fetch and re-validation when the challenge expires (defaults to `false`).
172
- - **expire**: Challenge expiration duration in milliseconds.
173
- - **floating**: Enable floating UI (possible values: `auto`, `top`, `bottom`).
174
- - **floatinganchor**: CSS selector of the "anchor" to which the floating UI will be attached (defaults to the `button[type="submit"]` in the related form).
175
- - **floatingoffset**: Y offset from the anchor element for the floating UI in pixels (defaults to `12`).
176
- - **floatingpersist**: Whether to "persist" (keep visible) the floating widget after verification (possible values: `true` | `false` | `focus`; defaults to `false`, meaning the widget will hide).
177
- - **hidefooter**: Hide the footer (ALTCHA link).
178
- - **hidelogo**: Hide the ALTCHA logo.
179
- - **id**: The checkbox `id` attribute. Useful for multiple instances of the widget on the same page.
180
- - **language**: The ISO alpha-2 code of the language to use (the language file be imported from `altcha/i18n/*`).
181
- - **maxnumber**: Max number to iterate to (defaults to 1,000,000).
182
- - **name**: Name of the hidden field containing the payload (defaults to "altcha").
183
- - **overlay**: Enables overlay UI mode (automatically sets `auto="onsubmit"`).
184
- - **overlaycontent**: CSS selector of the HTML element to display in the overlay modal before the widget.
185
- - **strings**: JSON-encoded translation strings. Refer to [customization](https://altcha.org/docs/v2/widget-customization).
186
- - **verifyurl**: URL for server-side verification requests. This option is automatically configured with Sentinel. Override this setting only if using a custom server implementation. Supports `fn:function_name` format to call a global JS function instead.
187
- - **workers**: Number of workers to utilize for PoW (defaults to `navigator.hardwareConcurrency || 8`, max value `16`).
188
- - **workerurl**: URL of the Worker script (defaults to `./worker.js`, only works with `external` build).
189
-
190
- Data Obfuscation options:
191
-
192
- - **obfuscated**: The [obfuscated data](https://altcha.org/docs/v2/obfuscation) provided as a base64-encoded string (requires `altcha/obfuscation` plugin). Use only without `challengeurl`/`challengejson`.
193
-
194
- Development / Testing options:
195
-
196
- - **debug**: Print log messages in the console.
197
- - **mockerror**: Causes verification to always fail with a "mock" error.
198
- - **test**: Generates a "mock" challenge within the widget, bypassing the request to `challengeurl`.
136
+ ### Programmatic Configuration
137
+
138
+ The widget provides a global `$altcha` object to manage defaults, register new algorithms, or add custom translations.
139
+
140
+ To update an existing widget instance, use the `.configure()` [method](). This is the preferred way to handle complex objects or functions that cannot be passed via HTML attributes.
141
+
142
+ ```ts
143
+ // Set defaults for all future widget instances:
144
+ $altcha.defaults.set({
145
+ challenge: 'https://api.example.com/challenge',
146
+ debug: true
147
+ });
148
+
149
+ // Update a specific instance dynamically:
150
+ const widget = document.querySelector('altcha-widget');
151
+ widget.configure({
152
+ workers: 2,
153
+ language: 'fr'
154
+ });
155
+ ```
156
+
157
+ ### Attribute Configuration
158
+
159
+ For simple implementations, the widget supports a subset of configuration options directly as HTML attributes. For more advanced properties, use the programmatic approach above.
160
+
161
+ **Supported Attributes:**
162
+
163
+ ```html
164
+ <altcha-widget
165
+ auto="off"
166
+ challenge="https://api.example.com/challenge"
167
+ configuration='{"delay": 500}'
168
+ display="standard"
169
+ language="en"
170
+ name="altcha"
171
+ theme="default"
172
+ type="checkbox"
173
+ workers="4"
174
+ ></altcha-widget>
175
+ ```
176
+
177
+ > [!TIP]
178
+ > The `configuration` attribute accepts a JSON-encoded string, allowing you to pass complex settings directly in your HTML markup.
179
+
180
+ ### Core Settings
181
+
182
+ - **`name`**: The `name` attribute of the hidden input field containing the payload. (Default: `"altcha"`)
183
+ - **`challenge`**: The challenge data or the URL to fetch a new challenge from.
184
+ - **`type`**: Visual style of the interaction element (`'native'`, `'checkbox'`, or `'switch'`).
185
+ - **`language`**: The ISO alpha-2 language code for localization (requires corresponding i18n file).
186
+ - **`workers`**: The number of Web Workers to spawn for proof-of-work calculations.
187
+
188
+ ### Automation & Timing
189
+
190
+ - **`auto`**: Determines when verification triggers automatically (`'off'`, `'onfocus'`, `'onload'`, or `'onsubmit'`).
191
+ - **`minDuration`**: The minimum verification time in milliseconds; adds an artificial delay if the PoW is faster. (Default: `500`)
192
+ - **`retryOnOutOfMemoryError`**: Automatically attempts to restart verification with fewer workers if the browser runs out of memory (Argon2 and Scrypt only).
193
+
194
+ ### UI & Display
195
+
196
+ - **`display`**: The visual layout mode (`'standard'`, `'bar'`, `'floating'`, `'overlay'`, or `'invisible'`).
197
+ - **`barPlacement`**: Vertical position of the widget when `display` is set to `bar` (`'bottom'` or `'top'`).
198
+ - **`hideLogo`**: Hides the ALTCHA logo icon.
199
+ - **`hideFooter`**: Hides the "ALTCHA" attribution link.
200
+ - **`validationMessage`**: Custom validation message for the HTML5 `setCustomValidity` API.
201
+
202
+ ### Floating Widget Settings
203
+
204
+ - **`floatingAnchor`**: The element or CSS selector the floating UI attaches to. Defaults to the first submit button.
205
+ - **`floatingPlacement`**: Preferred position relative to the anchor (`'auto'`, `'bottom'`, or `'top'`).
206
+ - **`floatingOffset`**: Vertical offset in pixels between the UI and its anchor. (Default: `12`)
207
+ - **`floatingPersist`**: Whether the floating widget remains visible after successful verification.
208
+
209
+ ### Modal & Challenge Settings
210
+
211
+ - **`codeChallengeDisplay`**: UI layout for the code-challenge modal (`'standard'`, `'overlay'`, or `'bottomsheet'`).
212
+ - **`overlayContent`**: CSS selector for an element to be mirrored inside the overlay modal.
213
+ - **`audioChallengeLanguage`**: Forces a specific language for audio-based challenges.
214
+ - **`disableAutoFocus`**: Prevents the code-challenge modal from stealing focus when opened.
215
+
216
+ ### Advanced & Debugging
217
+
218
+ - **`debug`**: Enables verbose logging in the browser console.
219
+ - **`test`**: Mocks a successful verification for testing environments.
220
+ - **`mockError`**: Forces the widget into a failed state for UI testing.
221
+ - **`fetch`**: A custom `fetch` implementation for network requests.
222
+ - **`verifyFunction`**: A custom verification handler that overrides default network verification.
199
223
 
200
224
  ## Internationalization (i18n)
201
225
 
@@ -237,14 +261,14 @@ To override the language manually, use the `language` attribute:
237
261
 
238
262
  ### Customizing Translations
239
263
 
240
- You can override default translations by updating the global `altchaI18n` registry (`globalThis.altchaI18n` or `window.altchaI18n`):
264
+ You can override default translations by updating the global `$altcha` registry (`globalThis.$altcha.i18n`):
241
265
 
242
266
  ```js
243
267
  import 'altcha/i18n/de';
244
268
 
245
- globalThis.altchaI18n.set('de', {
246
- ...globalThis.altchaI18n.get('de'),
247
- label: 'Ich bin ein Mensch', // Custom label
269
+ $altcha.i18n.set('de', {
270
+ ...$altcha.i18n.get('de'),
271
+ label: 'Ich bin ein Mensch' // Custom label
248
272
  });
249
273
  ```
250
274
 
@@ -252,106 +276,31 @@ globalThis.altchaI18n.set('de', {
252
276
 
253
277
  For additional verification, ALTCHA supports **image/audio code challenges** (e.g., "Enter the code from the image"). This feature requires [ALTCHA Sentinel](https://altcha.org/docs/v2/sentinel) or a custom server implementation.
254
278
 
255
- ## Plugins
256
-
257
- Extend functionality with plugins:
258
-
259
- ```js
260
- import 'altcha/obfuscation'; // Data obfuscation
261
- import 'altcha/upload'; // File uploads
262
- import 'altcha'; // Main package
263
- ```
279
+ ## Data Obfuscation
264
280
 
265
- Enable plugins per widget:
281
+ [Data obfuscation]() is supported via an official plugin, which must be imported alongside the widget. This is ideal for protecting sensitive information, such as email addresses, from scrapers until the challenge is solved.
266
282
 
267
- ```html
268
- <altcha-widget plugins="upload,obfuscation"></altcha-widget>
269
- ```
283
+ ### Programmatic Usage
270
284
 
271
- ### Available Plugins
285
+ The plugin exports `obfuscate` and `deobfuscate` functions for manual data handling:
272
286
 
273
- - **obfuscation**: Secure sensitive data (emails, phone numbers).
274
- - **upload**: File uploads with ALTCHA Sentinel or a custom backend.
287
+ ```ts
288
+ import { obfuscate } from 'altcha/plugins/obfuscation';
275
289
 
276
- ## Programmatic Configuration
290
+ const obfuscatedData = await obfuscate('mailto:hello@example.com');
291
+ ```
277
292
 
278
- To configure the widget programmatically, use the `configure()` method:
293
+ ### Widget Integration
279
294
 
280
- ```ts
281
- document.querySelector('#altcha').configure({
282
- challenge: {
283
- algorithm: 'SHA-256',
284
- challenge: '...',
285
- salt: '...',
286
- signature: '...',
287
- },
288
- strings: {
289
- label: 'Verify',
290
- },
291
- });
292
- ```
295
+ To use the plugin with the widget, ensure `altcha/plugins/obfuscation` is imported **after** the main library. Use the `data-obfuscated` attribute to provide the Base64-encoded payload:
293
296
 
294
- Available configuration options:
297
+ ```html
298
+ <script>
299
+ import 'altcha';
300
+ import 'altcha/plugins/obfuscation';
301
+ </script>
295
302
 
296
- ```ts
297
- export interface Configure {
298
- auto?: 'off' | 'onfocus' | 'onload' | 'onsubmit';
299
- challenge?: {
300
- codeChallenge?: {
301
- audio?: string;
302
- image: string;
303
- length?: number;
304
- };
305
- algorithm: string;
306
- challenge: string;
307
- maxnumber?: number;
308
- salt: string;
309
- signature: string;
310
- };
311
- challengeurl?: string;
312
- credentials?: 'omit' | 'same-origin' | 'include' | boolean;
313
- customfetch?:
314
- | string
315
- | ((url: string, init?: RequestInit) => Promise<Response>);
316
- debug?: boolean;
317
- delay?: number;
318
- disableautofocus?: boolean;
319
- disablerefetchonexpire?: boolean;
320
- expire?: number;
321
- floating?: 'auto' | 'top' | 'bottom';
322
- floatinganchor?: string;
323
- floatingoffset?: number;
324
- floatingpersist?: boolean | 'focus';
325
- hidefooter?: boolean;
326
- hidelogo?: boolean;
327
- maxnumber?: number;
328
- mockerror?: boolean;
329
- name?: string;
330
- obfuscated?: string;
331
- overlay?: boolean;
332
- refetchonexpire?: boolean; // deprecated, use disablerefetchonexpire
333
- spamfilter?: boolean | 'ipAddress' | SpamFilter; // deprecated
334
- strings?: {
335
- ariaLinkLabel: strin;
336
- enterCode: string;
337
- enterCodeAria: string;
338
- error: string;
339
- expired: string;
340
- footer: string;
341
- getAudioChallenge: string;
342
- label: string;
343
- loading: string;
344
- reload: strin;
345
- verificationRequired: string;
346
- verified: string;
347
- verifying: string;
348
- waitAlert: string;
349
- };
350
- test?: boolean | number | 'delay';
351
- verifyurl?: string;
352
- workers?: number;
353
- workerurl?: string;
354
- }
303
+ <altcha-widget data-obfuscated="${obfuscatedData}" display="floating"></altcha-widget>
355
304
  ```
356
305
 
357
306
  ## Methods
@@ -359,40 +308,40 @@ export interface Configure {
359
308
  - `configure(options)` - Configures the widget with the given options. See Configuration options above.
360
309
  - `getConfiguration()` - Returns the current configuration.
361
310
  - `getState()` - Returns the current `state` of the widget.
362
- - `show()` - Displays the widget (used in floating or overlay mode).
363
- - `hide()` - Hides the widget (used in floating or overlay mode).
311
+ - `show()` - Displays the widget (used in some display modes).
312
+ - `hide()` - Hides the widget (used in some display modes).
364
313
  - `reset(state?, err?)` - Resets the internal `state`, optionally with an error.
365
314
  - `setState(state, err?)` - Manually sets the specified `state`, optionally with an error.
366
- - `setFloatingAnchor(element)` - Sets the anchor element for the floating UI.
367
- - `verify()` - Initiates the verification process.s a "mock" challenge within the widget, bypassing the request to `challengeurl`.
368
-
315
+ - `updateUI()` - Force UI update or reposition, for example for the floating display mode.
316
+ - `verify()` - Initiates the verification process.
369
317
 
370
318
  ## Events
371
319
 
372
- - **code** - Triggers when code-challenge verification is requested.
320
+ - **codechallenge** - Triggers when code-challenge verification is requested.
321
+ - **expired** - Triggers when the challenge expires.
373
322
  - **load** - Triggers when the widget loads. The exported methods become available after this event.
374
- - **sentinelverification** - Triggers upon a verification with ALTCHA Sentinel.
375
- - **serververification** - (Deprecated) Triggers upon a server verification (only in conjunction with `spamfilter`).
323
+ - **outofmemory** - Triggers when an Out-Of-Memory error is received (Argon2 and Scrypt only).
324
+ - **serververification** -Triggers upon a server verification.
376
325
  - **statechange** - Triggers whenever an internal `state` changes.
377
326
  - **verified** - Triggers when the challenge is verified.
378
327
 
379
328
  ```ts
380
329
  enum State {
381
- CODE = 'code',
382
- ERROR = 'error',
383
- VERIFIED = 'verified',
384
- VERIFYING = 'verifying',
385
- UNVERIFIED = 'unverified',
386
- EXPIRED = 'expired',
330
+ CODE = 'code',
331
+ ERROR = 'error',
332
+ VERIFIED = 'verified',
333
+ VERIFYING = 'verifying',
334
+ UNVERIFIED = 'unverified',
335
+ EXPIRED = 'expired'
387
336
  }
388
337
  ```
389
338
 
390
339
  Using events:
391
340
 
392
341
  ```js
393
- document.querySelector('#altcha').addEventListener('statechange', (ev) => {
394
- // See enum State above
395
- console.log('state:', ev.detail.state);
342
+ document.querySelector('altcha-widget').addEventListener('statechange', (ev) => {
343
+ // See enum State above
344
+ console.log('state:', ev.detail.state);
396
345
  });
397
346
  ```
398
347
 
@@ -403,10 +352,6 @@ document.querySelector('#altcha').addEventListener('statechange', (ev) => {
403
352
 
404
353
  See [Contributing Guide](https://github.com/altcha-org/altcha/blob/main/CONTRIBUTING.md) and please follow our [Code of Conduct](https://github.com/altcha-org/altcha/blob/main/CODE_OF_CONDUCT.md).
405
354
 
406
- ## Sponsorship
407
-
408
- This project is sponsored by [BAUSW.com - Digital Construction Site Diary](https://bausw.com/digital-construction-diary/), promoting transparency and trust in construction projects with real-time documentation.
409
-
410
355
  ## License
411
356
 
412
- **MIT**
357
+ MIT
@@ -0,0 +1 @@
1
+ :root{--altcha-border-color:var(--altcha-color-neutral);--altcha-border-width:1px;--altcha-border-radius:6px;--altcha-color-base:light-dark(oklch(100% 0.00011 271.152),oklch(20.904% 0.00002 271.152));--altcha-color-base-content:light-dark(oklch(20.904% 0.00002 271.152),oklch(100% 0.00011 271.152));--altcha-color-error:oklch(51.284% 0.20527 28.678);--altcha-color-error-content:oklch(100% 0.00011 271.152);--altcha-color-neutral:light-dark(oklch(83.591% 0.0001 271.152),oklch(46.04% 0.00005 271.152));--altcha-color-neutral-content:light-dark(oklch(46.76% 0.00005 271.152),oklch(100% 0.00011 271.152));--altcha-color-primary:oklch(40.279% 0.2449 268.131);--altcha-color-primary-content:oklch(100% 0.00011 271.152);--altcha-color-success:oklch(55.748% 0.18968 142.511);--altcha-color-success-content:oklch(100% 0.00011 271.152);--altcha-checkbox-border-color:var(--altcha-color-neutral);--altcha-checkbox-border-radius:5px;--altcha-checkbox-border-width:var(--altcha-border-width);--altcha-checkbox-outline:2px solid var(--altcha-checkbox-outline-color);--altcha-checkbox-outline-color:light-dark(color-mix(in srgb,var(--altcha-color-primary) 20%,transparent),color-mix(in srgb,var(--altcha-color-primary) 60%,transparent));--altcha-checkbox-outline-offset:2px;--altcha-checkbox-size:22px;--altcha-checkbox-transition-duration:var(--altcha-transition-duration);--altcha-input-background-color:var(--altcha-color-base);--altcha-input-border-radius:3px;--altcha-input-border-width:1px;--altcha-input-color:var(--altcha-color-base-content);--altcha-max-width:320px;--altcha-padding:0.75rem;--altcha-popover-arrow-size:6px;--altcha-popover-color:var(--altcha-border-color);--altcha-shadow:drop-shadow(3px 3px 6px oklch(0% 0 0/0.2));--altcha-spinner-color:var(--altcha-color-base-content);--altcha-switch-background-color:var(--altcha-color-neutral);--altcha-switch-border-radius:calc(infinity*1px);--altcha-switch-height:var(--altcha-checkbox-size);--altcha-switch-padding:0.25rem;--altcha-switch-width:calc(var(--altcha-checkbox-size)*1.75);--altcha-switch-toggle-border-radius:100%;--altcha-switch-toggle-color:var(--altcha-color-neutral-content);--altcha-switch-toggle-size:calc(var(--altcha-switch-height) - var(--altcha-switch-padding)*2);--altcha-transition-duration:0.6s;--altcha-z-index:99999999;--altcha-z-index-popover:999999999}.altcha{all:revert-layer;display:none;font-family:inherit;font-size:inherit;position:relative}.altcha[data-visible]{display:block}.altcha *,.altcha-popover,.altcha-popover *{all:revert-layer;box-sizing:border-box;font-family:inherit;font-size:inherit;line-height:1.25}.altcha a,.altcha-popover a{color:currentColor;text-decoration:none}.altcha a:hover,.altcha-popover a:hover{color:currentColor}.altcha-main{align-items:start;background-color:var(--altcha-color-base);border:var(--altcha-border-width,1px) solid var(--altcha-border-color);border-radius:var(--altcha-border-radius,0);color:var(--altcha-color-base-content);display:flex;flex-direction:column;gap:.5rem;justify-content:space-between;max-width:var(--altcha-max-width,100%);padding:var(--altcha-padding)}.altcha-main>*{display:flex;width:100%}.altcha-main>:first-child{flex-grow:1}.altcha-checkbox-wrap{align-items:center;display:flex;flex-direction:row;flex-grow:1;gap:.5rem}.altcha-checkbox-wrap>*{display:flex}.altcha-logo{opacity:.7}.altcha-footer{align-items:center;display:flex;flex-grow:1;font-size:.7rem;gap:.5rem;justify-content:flex-end;opacity:.7}.altcha-error{font-size:.85rem}.altcha-button{align-items:center;background:var(--altcha-color-primary);border:var(--altcha-input-border-width) solid var(--altcha-color-primary);border-radius:var(--altcha-input-border-radius);color:var(--altcha-color-primary-content);cursor:pointer;display:flex;font-size:.9rem;gap:.5rem;padding:.35rem}.altcha-button:focus{border-color:var(--altcha-color-primary);outline:var(--altcha-checkbox-outline);outline-offset:var(--altcha-checkbox-outline-offset)}.altcha-button>.altcha-spinner,.altcha-button>svg{height:20px;width:20px}.altcha-button-secondary{background:transparent;border-color:var(--altcha-color-neutral);color:var(--altcha-color-neutral-content)}.altcha-input{background:var(--altcha-input-background-color);border:var(--altcha-input-border-width) solid var(--altcha-color-neutral);border-radius:var(--altcha-input-border-radius);color:var(--altcha-input-color);flex-grow:1;font-size:1rem;min-width:0;padding:.25rem;width:auto}.altcha-input:focus{border-color:var(--altcha-color-primary);outline:var(--altcha-checkbox-outline);outline-offset:var(--altcha-checkbox-outline-offset)}.altcha-spinner{animation:altcha-rotate .6s linear infinite;border:var(--altcha-checkbox-border-width) solid var(--altcha-spinner-color);border-bottom-color:transparent;border-radius:100%;border-right-color:transparent;opacity:.5}.altcha-popover{background-color:var(--altcha-color-base);border:var(--altcha-border-width) solid var(--altcha-border-color);border-radius:var(--altcha-border-radius);color:var(--altcha-color-base-content);filter:var(--altcha-shadow);left:calc(var(--altcha-padding)/2);max-width:calc(var(--altcha-max-width) - var(--altcha-padding));position:absolute;top:calc(var(--altcha-padding) + var(--altcha-checkbox-size) + var(--altcha-popover-arrow-size));z-index:var(--altcha-z-index-popover)}.altcha-popover-arrow{border-bottom-color:transparent;border:var(--altcha-popover-arrow-size) solid transparent;border-bottom:var(--altcha-popover-arrow-size) solid var(--altcha-popover-color);content:"";height:0;left:calc(var(--altcha-checkbox-size)/2);position:absolute;top:calc(var(--altcha-popover-arrow-size)*-2);width:0}.altcha-popover-content{max-height:100dvh;overflow:auto;padding:var(--altcha-padding)}.altcha-popover[data-top=true][data-display=standard]{bottom:calc(100% - var(--altcha-padding) + var(--altcha-popover-arrow-size));top:auto}.altcha-popover[data-top=true][data-display=standard] .altcha-popover-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-popover-color);bottom:calc(var(--altcha-popover-arrow-size)*-2);top:auto}.altcha-popover[data-variant=error]{--altcha-popover-color:var(--altcha-color-error);background-color:var(--altcha-color-error);border-color:var(--altcha-color-error);color:var(--altcha-color-error-content)}.altcha-popover[data-variant=error] .altcha-popover-content{padding:calc(var(--altcha-padding)/1.5) var(--altcha-padding)}.altcha-popover[data-display=overlay]{animation:altcha-overlay-slidein .5s forwards;top:45%;transform:translate(-50%,-50%)}.altcha-popover[data-display=bottomsheet],.altcha-popover[data-display=overlay]{left:50%;position:fixed;width:var(--altcha-max-width);z-index:var(--altcha-z-index)}.altcha-popover[data-display=bottomsheet]{animation:altcha-bottomsheet-slideup .5s forwards;border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:-100%;top:auto;transform:translate(-50%)}.altcha-popover[data-display=bottomsheet] .altcha-popover-content{padding-bottom:calc(var(--altcha-padding)*2)}.altcha-popover-backdrop{background:var(--altcha-color-base-content);bottom:0;left:0;opacity:.1;position:fixed;right:0;top:0;transition:opacity .5s;z-index:var(--altcha-z-index)}.altcha-popover-close{color:var(--altcha-color-base-content);cursor:pointer;display:inline-block;font-size:1rem;height:1.25rem;line-height:.95;position:absolute;right:0;text-align:center;text-shadow:0 0 1px var(--altcha-color-base);top:-1.5rem;width:1.25rem;z-index:var(--altcha-z-index)}.altcha-popover[data-display=bottomsheet] .altcha-footer,.altcha-popover[data-display=overlay] .altcha-footer{align-items:center;gap:.5rem;justify-content:center;padding-top:1rem}.altcha-popover[data-display=bottomsheet] .altcha-footer svg,.altcha-popover[data-display=overlay] .altcha-footer svg{height:18px;vertical-align:middle;width:18px}.altcha-code-challenge>form{display:flex;flex-direction:column;gap:.5rem}.altcha-code-challenge-title{font-weight:600}.altcha-code-challenge-text{font-size:.85rem}.altcha-code-challenge-image{background:#fff;border:var(--altcha-input-border-width) solid var(--altcha-color-neutral);border-radius:var(--altcha-input-border-radius);height:50px;object-fit:contain}.altcha-code-challenge-row{display:flex;gap:.5rem}.altcha-code-challenge-buttons{align-items:center;display:flex;flex-direction:column;gap:.5rem;justify-content:space-between;margin-top:var(--altcha-padding)}.altcha-code-challenge-buttons button{justify-content:center;width:100%}.altcha-checkbox{cursor:pointer;position:relative}.altcha-checkbox,.altcha-checkbox input{height:var(--altcha-checkbox-size);width:var(--altcha-checkbox-size)}.altcha-checkbox input{appearance:none;background:var(--altcha-input-background-color);border:var(--altcha-checkbox-border-width,2px) solid var(--altcha-checkbox-border-color);border-radius:var(--altcha-checkbox-border-radius);left:0;margin:0;outline:none;padding:0;position:absolute;top:0}.altcha-checkbox input:before{background:var(--altcha-color-neutral);border-radius:var(--altcha-checkbox-border-radius);content:"";display:block;height:100%;transform:scale(0);width:100%}.altcha-checkbox input:focus{outline:var(--altcha-checkbox-outline);outline-offset:var(--altcha-checkbox-outline-offset)}.altcha-checkbox input:checked{background-color:var(--altcha-color-success);border-color:var(--altcha-color-success)}.altcha-checkbox input:checked:before{background-color:var(--altcha-color-success);opacity:0;transform:scale(2.2);transition:all var(--altcha-checkbox-transition-duration) ease;transition-delay:.1s}.altcha-checkbox svg{--altcha-radio-svg-size:calc(var(--altcha-checkbox-size)*0.5);--altcha-radio-svg-offset:calc(var(--altcha-checkbox-size)*0.25);fill:none;height:var(--altcha-radio-svg-size);left:var(--altcha-radio-svg-offset);opacity:0;position:absolute;stroke:currentColor;stroke-dasharray:16px;stroke-dashoffset:16px;stroke-linecap:round;stroke-linejoin:round;stroke-width:2;top:var(--altcha-radio-svg-offset);transform:translateZ(0);width:var(--altcha-radio-svg-size)}.altcha-checkbox input:checked+svg{color:var(--altcha-color-success-content);opacity:1;stroke-dashoffset:0;transition:all var(--altcha-checkbox-transition-duration) ease;transition-delay:.1s}.altcha-checkbox-spinner{display:none;height:var(--altcha-checkbox-size);left:0;position:absolute;top:0;width:var(--altcha-checkbox-size)}.altcha-checkbox[data-loading=true] input{appearance:none;opacity:0;pointer-events:none}.altcha-checkbox[data-loading=true] .altcha-checkbox-spinner{display:block}.altcha-checkbox-native{position:relative}.altcha-checkbox-native,.altcha-checkbox-native input{height:var(--altcha-checkbox-size);width:var(--altcha-checkbox-size)}.altcha-checkbox-native input{margin:0}.altcha-checkbox-native input:focus{outline:var(--altcha-checkbox-outline);outline-offset:var(--altcha-checkbox-outline-offset)}.altcha-checkbox-native-spinner{display:none;height:var(--altcha-checkbox-size);left:0;position:absolute;top:0;width:var(--altcha-checkbox-size)}.altcha-checkbox-native[data-loading=true] input{appearance:none;opacity:0;pointer-events:none}.altcha-checkbox-native[data-loading=true] .altcha-checkbox-native-spinner{display:block}.altcha-switch{align-items:center;background-color:var(--altcha-switch-background-color);border-radius:var(--altcha-switch-border-radius);cursor:pointer;display:flex;height:var(--altcha-switch-height);padding:var(--altcha-switch-padding);position:relative;width:var(--altcha-switch-width)}.altcha-switch:focus-within{outline:var(--altcha-checkbox-outline);outline-offset:var(--altcha-checkbox-outline-offset)}.altcha-switch input{appearance:none;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}.altcha-switch-toggle{align-items:center;background-color:var(--altcha-switch-toggle-color);border-radius:var(--altcha-switch-toggle-border-radius);display:flex;justify-content:center;left:var(--altcha-switch-padding);position:absolute;transition:width .15s ease-out,left .15s ease-out}.altcha-switch-spinner,.altcha-switch-toggle{height:var(--altcha-switch-toggle-size);width:var(--altcha-switch-toggle-size)}.altcha-switch-spinner{display:none}.altcha-switch[data-loading=true]{pointer-events:none}.altcha-switch[data-loading=true] .altcha-switch-spinner{display:block}.altcha-switch[data-loading=true] .altcha-switch-toggle{background-color:transparent;left:calc(50% - var(--altcha-switch-toggle-size)/2)}[data-state=verified] .altcha-switch{--altcha-switch-background-color:var(--altcha-color-success)}[data-state=verified] .altcha-switch-toggle{background-color:var(--altcha-color-success-content)}[data-state=verified] .altcha-switch-toggle,[dir=rtl] .altcha-switch-toggle{left:calc(100% - var(--altcha-switch-height) + var(--altcha-switch-padding))}[dir=rtl][data-state=verified] .altcha-switch-toggle{left:var(--altcha-switch-padding)}.altcha-floating-arrow{border:6px solid transparent;border-bottom:6px solid var(--altcha-border-color);content:"";height:0;left:12px;position:absolute;top:-12px;width:0}.altcha-overlay-backdrop{bottom:0;left:0;position:fixed;right:0;top:0;transition:opacity var(--altcha-transition-duration);z-index:var(--altcha-z-index)}.altcha-overlay-close{color:currentColor;cursor:pointer;display:inline-block;font-size:1rem;height:1rem;line-height:.85;position:absolute;right:0;text-align:center;text-shadow:0 0 1px var(--altcha-color-base);top:-1.5rem;width:1rem;z-index:var(--altcha-z-index)}.altcha[data-display=overlay]{animation:altcha-overlay-slidein var(--altcha-transition-duration) forwards;filter:var(--altcha-shadow);left:50%;opacity:0;position:fixed;top:45%;transform:translate(-50%,-50%);z-index:var(--altcha-z-index)}.altcha[data-display=overlay] .altcha-main{width:var(--altcha-max-width)}.altcha[data-display=floating]{display:none;filter:var(--altcha-shadow);left:var(--altcha-floating-left,-100%);position:fixed;top:var(--altcha-floating-top,-100%);z-index:var(--altcha-z-index)}.altcha[data-display=floating] .altcha-main{width:var(--altcha-max-width)}.altcha[data-display=floating][data-placement=top] .altcha-floating-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-border-color);bottom:-12px;top:auto}.altcha[data-display=floating][data-visible]{display:flex}.altcha[data-display=bar]{bottom:-100%;filter:var(--altcha-shadow);left:0;position:fixed;right:0;transition:bottom var(--altcha-transition-duration),top var(--altcha-transition-duration);z-index:var(--altcha-z-index)}.altcha[data-display=bar] .altcha-main{align-items:center;border-radius:0;border-width:var(--altcha-border-width) 0 0 0;flex-direction:row;max-width:100%!important}.altcha[data-display=bar] .altcha-main>*{width:auto}.altcha[data-display=bar][data-placement=top]{bottom:auto;top:-100%}.altcha[data-display=bar][data-placement=top] .altcha-main{border-width:0 0 var(--altcha-border-width) 0}.altcha[data-display=bar][data-placement=bottom]:not([data-state=unverified]){bottom:0}.altcha[data-display=bar][data-placement=top]:not([data-state=unverified]){top:0}.altcha[data-display=invisible]{display:none}@keyframes altcha-rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes altcha-bottomsheet-slideup{to{bottom:0}}@keyframes altcha-overlay-slidein{to{opacity:1;top:50%}}