altcha 2.2.4 → 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 (503) hide show
  1. package/LICENSE.txt +1 -1
  2. package/README.md +152 -197
  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 -95
  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
  495. package/dist_plugins/analytics.d.ts +0 -1
  496. package/dist_plugins/analytics.js +0 -276
  497. package/dist_plugins/analytics.umd.cjs +0 -1
  498. package/dist_plugins/obfuscation.d.ts +0 -1
  499. package/dist_plugins/obfuscation.js +0 -129
  500. package/dist_plugins/obfuscation.umd.cjs +0 -1
  501. package/dist_plugins/upload.d.ts +0 -1
  502. package/dist_plugins/upload.js +0 -503
  503. package/dist_plugins/upload.umd.cjs +0 -4
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,33 +9,32 @@ ALTCHA is fully compliant with:
9
9
 
10
10
  For more details, visit [altcha.org](https://altcha.org).
11
11
 
12
- ## Features
12
+ ## Playground
13
13
 
14
- - **Frictionless Experience**: Uses proof-of-work (PoW) instead of visual puzzles for a seamless user experience.
15
- - **Code Challenge (New in v2)**: Supports accessible code challenges ("enter code from image") with an audio option.
16
- - **Cookie-Free Design**: GDPR-compliant by default—no cookies or tracking.
17
- - **Fully Accessible**: Meets WCAG 2.2 AA-level standards and complies with the European Accessibility Act (EAA).
18
- - **Lightweight**: Minimal bundle size for fast page loads and optimal performance.
19
- - **Self-Hosted**: No dependency on third-party services.
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.
20
15
 
21
- ## What’s New in v2
16
+ [Open ALTCHA Playground](https://playground.altcha.org)
22
17
 
23
- 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
24
19
 
25
- ### 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.
26
27
 
27
- - **Built-in Internationalization (i18n)** for 50+ languages
28
- - **Improved RTL (right-to-left) language support**
29
- - **Enhanced WCAG accessibility**
30
- - **Support for accessible code challenges** (image + audio options)
31
- - **Overlay UI**
28
+ ## What’s New in v3
32
29
 
33
- ### 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.
34
34
 
35
- 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
36
36
 
37
- - 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.
38
- - [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).
39
38
 
40
39
  ## Examples
41
40
 
@@ -60,11 +59,11 @@ Explore starter templates for popular frameworks:
60
59
 
61
60
  ## Plugins & CMS
62
61
 
63
- - [Libraries and plugins](https://altcha.org/docs/integrations/)
62
+ - [Libraries and plugins](https://altcha.org/docs/v2/libraries/)
64
63
 
65
64
  ## Usage
66
65
 
67
- 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**.
68
67
 
69
68
  ### 1. Install ALTCHA
70
69
 
@@ -84,30 +83,19 @@ Or load via `<script>` tag:
84
83
  <script async defer src="/altcha.js" type="module"></script>
85
84
  ```
86
85
 
87
- **CDN**:
88
-
89
- ```html
90
- <script
91
- async
92
- defer
93
- src="https://cdn.jsdelivr.net/gh/altcha-org/altcha@main/dist/altcha.min.js"
94
- type="module"
95
- ></script>
96
- ```
97
-
98
86
  ### 2. Add `<altcha-widget>` to Your Forms
99
87
 
100
88
  ```html
101
89
  <form>
102
- <altcha-widget challengeurl="https://..."></altcha-widget>
90
+ <altcha-widget challenge="https://..."></altcha-widget>
103
91
  </form>
104
92
  ```
105
93
 
106
- See [configuration options](#configuration) or the [website integration docs](https://altcha.org/docs/website-integration).
94
+ See [configuration options](#configuration) or the [website integration docs](https://altcha.org/docs/v2/widget-integration).
107
95
 
108
96
  ### 3. Integrate with Your Server
109
97
 
110
- Refer to the [server documentation](https://altcha.org/docs/server-integration) for implementation details.
98
+ Refer to the [server documentation](https://altcha.org/docs/v2/server-integration) for implementation details.
111
99
 
112
100
  ## Supported Browsers
113
101
 
@@ -131,61 +119,107 @@ ALTCHA is optimized for performance:
131
119
 
132
120
  | Distribution | Size (GZIPped) |
133
121
  | ---------------------------- | -------------- |
134
- | ALTCHA | 30 kB |
135
- | ALTCHA with all translations | 46 kB |
122
+ | ALTCHA | 31 kB |
123
+ | ALTCHA with all translations | 49 kB |
136
124
  | Cloudflare Turnstile | 85+ kB |
137
125
  | hCaptcha | 250+ kB |
138
126
  | reCAPTCHA | 300+ kB |
139
127
 
140
- 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.
141
129
 
142
130
  ## Content Security Policy (CSP)
143
131
 
144
- 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/website-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).
145
133
 
146
134
  ## Configuration
147
135
 
148
- Required options (at least one is required):
149
-
150
- - **challengeurl**: Server endpoint to fetch the challenge.
151
- - **challengejson**: Preloaded JSON challenge data (avoids HTTP requests).
152
-
153
- Additional options:
154
-
155
- - **auto**: Automatically verify without user interaction (possible values: `off`, `onfocus`, `onload`, `onsubmit`).
156
- - **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`).
157
- - **customfetch**: A custom `fetch` function for retrieving the challenge.
158
- Accepts `url: string` and `init: RequestInit` as arguments and must return a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response).
159
- - **delay**: Artificial delay in milliseconds before verification (defaults to 0).
160
- - **disableautofocus**: If true, prevents the code-challenge input from automatically receiving focus on render (defaults to `false`).
161
- - **disablerefetchonexpire**: Whether to disable automatic re-fetch and re-validation when the challenge expires (defaults to `false`).
162
- - **expire**: Challenge expiration duration in milliseconds.
163
- - **floating**: Enable floating UI (possible values: `auto`, `top`, `bottom`).
164
- - **floatinganchor**: CSS selector of the "anchor" to which the floating UI will be attached (defaults to the `button[type="submit"]` in the related form).
165
- - **floatingoffset**: Y offset from the anchor element for the floating UI in pixels (defaults to `12`).
166
- - **floatingpersist**: Whether to "persist" (keep visible) the floating widget after verification (possible values: `true` | `false` | `focus`; defaults to `false`, meaning the widget will hide).
167
- - **hidefooter**: Hide the footer (ALTCHA link).
168
- - **hidelogo**: Hide the ALTCHA logo.
169
- - **id**: The checkbox `id` attribute. Useful for multiple instances of the widget on the same page.
170
- - **language**: The ISO alpha-2 code of the language to use (the language file be imported from `altcha/i18n/*`).
171
- - **maxnumber**: Max number to iterate to (defaults to 1,000,000).
172
- - **name**: Name of the hidden field containing the payload (defaults to "altcha").
173
- - **overlay**: Enables overlay UI mode (automatically sets `auto="onsubmit"`).
174
- - **overlaycontent**: CSS selector of the HTML element to display in the overlay modal before the widget.
175
- - **strings**: JSON-encoded translation strings. Refer to [customization](https://altcha.org/docs/widget-customization).
176
- - **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.
177
- - **workers**: Number of workers to utilize for PoW (defaults to `navigator.hardwareConcurrency || 8`, max value `16`).
178
- - **workerurl**: URL of the Worker script (defaults to `./worker.js`, only works with `external` build).
179
-
180
- Data Obfuscation options:
181
-
182
- - **obfuscated**: The [obfuscated data](https://altcha.org/docs/obfuscation) provided as a base64-encoded string (requires `altcha/obfuscation` plugin). Use only without `challengeurl`/`challengejson`.
183
-
184
- Development / Testing options:
185
-
186
- - **debug**: Print log messages in the console.
187
- - **mockerror**: Causes verification to always fail with a "mock" error.
188
- - **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.
189
223
 
190
224
  ## Internationalization (i18n)
191
225
 
@@ -227,14 +261,14 @@ To override the language manually, use the `language` attribute:
227
261
 
228
262
  ### Customizing Translations
229
263
 
230
- 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`):
231
265
 
232
266
  ```js
233
267
  import 'altcha/i18n/de';
234
268
 
235
- globalThis.altchaI18n.set('de', {
236
- ...globalThis.altchaI18n.get('de'),
237
- 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
238
272
  });
239
273
  ```
240
274
 
@@ -242,106 +276,31 @@ globalThis.altchaI18n.set('de', {
242
276
 
243
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.
244
278
 
245
- ## Plugins
246
-
247
- Extend functionality with plugins:
279
+ ## Data Obfuscation
248
280
 
249
- ```js
250
- import 'altcha/obfuscation'; // Data obfuscation
251
- import 'altcha/upload'; // File uploads
252
- import 'altcha'; // Main package
253
- ```
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.
254
282
 
255
- Enable plugins per widget:
283
+ ### Programmatic Usage
256
284
 
257
- ```html
258
- <altcha-widget plugins="upload,obfuscation"></altcha-widget>
259
- ```
285
+ The plugin exports `obfuscate` and `deobfuscate` functions for manual data handling:
260
286
 
261
- ### Available Plugins
262
-
263
- - **obfuscation**: Secure sensitive data (emails, phone numbers).
264
- - **upload**: File uploads with ALTCHA Sentinel or a custom backend.
287
+ ```ts
288
+ import { obfuscate } from 'altcha/plugins/obfuscation';
265
289
 
266
- ## Programmatic Configuration
290
+ const obfuscatedData = await obfuscate('mailto:hello@example.com');
291
+ ```
267
292
 
268
- To configure the widget programmatically, use the `configure()` method:
293
+ ### Widget Integration
269
294
 
270
- ```ts
271
- document.querySelector('#altcha').configure({
272
- challenge: {
273
- algorithm: 'SHA-256',
274
- challenge: '...',
275
- salt: '...',
276
- signature: '...',
277
- },
278
- strings: {
279
- label: 'Verify',
280
- },
281
- });
282
- ```
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:
283
296
 
284
- Available configuration options:
297
+ ```html
298
+ <script>
299
+ import 'altcha';
300
+ import 'altcha/plugins/obfuscation';
301
+ </script>
285
302
 
286
- ```ts
287
- export interface Configure {
288
- auto?: 'off' | 'onfocus' | 'onload' | 'onsubmit';
289
- challenge?: {
290
- codeChallenge?: {
291
- audio?: string;
292
- image: string;
293
- length?: number;
294
- };
295
- algorithm: string;
296
- challenge: string;
297
- maxnumber?: number;
298
- salt: string;
299
- signature: string;
300
- };
301
- challengeurl?: string;
302
- credentials?: 'omit' | 'same-origin' | 'include' | boolean;
303
- customfetch?:
304
- | string
305
- | ((url: string, init?: RequestInit) => Promise<Response>);
306
- debug?: boolean;
307
- delay?: number;
308
- disableautofocus?: boolean;
309
- disablerefetchonexpire?: boolean;
310
- expire?: number;
311
- floating?: 'auto' | 'top' | 'bottom';
312
- floatinganchor?: string;
313
- floatingoffset?: number;
314
- floatingpersist?: boolean | 'focus';
315
- hidefooter?: boolean;
316
- hidelogo?: boolean;
317
- maxnumber?: number;
318
- mockerror?: boolean;
319
- name?: string;
320
- obfuscated?: string;
321
- overlay?: boolean;
322
- refetchonexpire?: boolean; // deprecated, use disablerefetchonexpire
323
- spamfilter?: boolean | 'ipAddress' | SpamFilter; // deprecated
324
- strings?: {
325
- ariaLinkLabel: strin;
326
- enterCode: string;
327
- enterCodeAria: string;
328
- error: string;
329
- expired: string;
330
- footer: string;
331
- getAudioChallenge: string;
332
- label: string;
333
- loading: string;
334
- reload: strin;
335
- verificationRequired: string;
336
- verified: string;
337
- verifying: string;
338
- waitAlert: string;
339
- };
340
- test?: boolean | number | 'delay';
341
- verifyurl?: string;
342
- workers?: number;
343
- workerurl?: string;
344
- }
303
+ <altcha-widget data-obfuscated="${obfuscatedData}" display="floating"></altcha-widget>
345
304
  ```
346
305
 
347
306
  ## Methods
@@ -349,40 +308,40 @@ export interface Configure {
349
308
  - `configure(options)` - Configures the widget with the given options. See Configuration options above.
350
309
  - `getConfiguration()` - Returns the current configuration.
351
310
  - `getState()` - Returns the current `state` of the widget.
352
- - `show()` - Displays the widget (used in floating or overlay mode).
353
- - `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).
354
313
  - `reset(state?, err?)` - Resets the internal `state`, optionally with an error.
355
314
  - `setState(state, err?)` - Manually sets the specified `state`, optionally with an error.
356
- - `setFloatingAnchor(element)` - Sets the anchor element for the floating UI.
357
- - `verify()` - Initiates the verification process.s a "mock" challenge within the widget, bypassing the request to `challengeurl`.
358
-
315
+ - `updateUI()` - Force UI update or reposition, for example for the floating display mode.
316
+ - `verify()` - Initiates the verification process.
359
317
 
360
318
  ## Events
361
319
 
362
- - **code** - Triggers when code-challenge verification is requested.
320
+ - **codechallenge** - Triggers when code-challenge verification is requested.
321
+ - **expired** - Triggers when the challenge expires.
363
322
  - **load** - Triggers when the widget loads. The exported methods become available after this event.
364
- - **sentinelverification** - Triggers upon a verification with ALTCHA Sentinel.
365
- - **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.
366
325
  - **statechange** - Triggers whenever an internal `state` changes.
367
326
  - **verified** - Triggers when the challenge is verified.
368
327
 
369
328
  ```ts
370
329
  enum State {
371
- CODE = 'code',
372
- ERROR = 'error',
373
- VERIFIED = 'verified',
374
- VERIFYING = 'verifying',
375
- UNVERIFIED = 'unverified',
376
- EXPIRED = 'expired',
330
+ CODE = 'code',
331
+ ERROR = 'error',
332
+ VERIFIED = 'verified',
333
+ VERIFYING = 'verifying',
334
+ UNVERIFIED = 'unverified',
335
+ EXPIRED = 'expired'
377
336
  }
378
337
  ```
379
338
 
380
339
  Using events:
381
340
 
382
341
  ```js
383
- document.querySelector('#altcha').addEventListener('statechange', (ev) => {
384
- // See enum State above
385
- 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);
386
345
  });
387
346
  ```
388
347
 
@@ -393,10 +352,6 @@ document.querySelector('#altcha').addEventListener('statechange', (ev) => {
393
352
 
394
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).
395
354
 
396
- ## Sponsorship
397
-
398
- 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.
399
-
400
355
  ## License
401
356
 
402
- **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%}}