@verbb/formie-browser 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (490) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE.md +40 -0
  3. package/README.md +34 -0
  4. package/dist/chunks/address-finder-DfMCiW89.js +47 -0
  5. package/dist/chunks/api-CbqEMQT5.js +181 -0
  6. package/dist/chunks/api-DE7LfK-R.js +960 -0
  7. package/dist/chunks/api-DOfDzYC_.js +538 -0
  8. package/dist/chunks/async-B3DUf1GZ.js +26 -0
  9. package/dist/chunks/bpoint-Ciy3yY9Q.js +34 -0
  10. package/dist/chunks/calculations-CkYAqO_-.js +197 -0
  11. package/dist/chunks/captcha-eu-DnOWhMwr.js +43 -0
  12. package/dist/chunks/checkbox-radio-0x7Tc0br.js +197 -0
  13. package/dist/chunks/chunk-K6L4z4UQ.js +24 -0
  14. package/dist/chunks/conditions-4fXKhEJS.js +609 -0
  15. package/dist/chunks/date-picker-B6iZkjHS.js +6204 -0
  16. package/dist/chunks/debug-KnZeKYBI.js +39 -0
  17. package/dist/chunks/dist-D09GnXMW.js +2663 -0
  18. package/dist/chunks/event-names-DamGPtXR.js +51 -0
  19. package/dist/chunks/eway-DEAYcwT0.js +86 -0
  20. package/dist/chunks/field-references.keys-BpBZ_quS.js +24 -0
  21. package/dist/chunks/field-references.resolver-Ba6xhiJC.js +183 -0
  22. package/dist/chunks/file-upload-Bh63PQSE.js +430 -0
  23. package/dist/chunks/friendly-captcha-v1-CqO4WVre.js +40 -0
  24. package/dist/chunks/friendly-captcha-v2-CyykcJcM.js +47 -0
  25. package/dist/chunks/friendly-challenge-Dg8XkStd.js +1101 -0
  26. package/dist/chunks/go-cardless-CuND59rR.js +26 -0
  27. package/dist/chunks/google-address--uR8WDSm.js +208 -0
  28. package/dist/chunks/hcaptcha-CmaFUesv.js +72 -0
  29. package/dist/chunks/hidden-CYnZYple.js +36 -0
  30. package/dist/chunks/http-18nn97DZ.js +29 -0
  31. package/dist/chunks/i18n-vUh-KGiH.js +55 -0
  32. package/dist/chunks/loqate-BICNJlVK.js +97 -0
  33. package/dist/chunks/mollie-DwlsgHZ1.js +26 -0
  34. package/dist/chunks/moneris-B_IFZFTx.js +159 -0
  35. package/dist/chunks/opayo-U2x_TOII.js +192 -0
  36. package/dist/chunks/paddle-BqXFrc79.js +75 -0
  37. package/dist/chunks/paypal-Cn_DYGDb.js +121 -0
  38. package/dist/chunks/payway-Rnq796eC.js +75 -0
  39. package/dist/chunks/phone-country-B6Me4lK0.js +3317 -0
  40. package/dist/chunks/place-kit-ldUl-u9w.js +56 -0
  41. package/dist/chunks/placekit-autocomplete.esm-D-lGeaZl.js +1771 -0
  42. package/dist/chunks/recaptcha-enterprise-DPJNyv1X.js +72 -0
  43. package/dist/chunks/recaptcha-shared-DTI4qWVR.js +22 -0
  44. package/dist/chunks/recaptcha-v2-checkbox-zFjpvJ5c.js +49 -0
  45. package/dist/chunks/recaptcha-v2-invisible-CnYtkNvz.js +62 -0
  46. package/dist/chunks/recaptcha-v3-EAlWhnkX.js +33 -0
  47. package/dist/chunks/repeater-CXD1eLSn.js +151 -0
  48. package/dist/chunks/rich-text-DkmZRhGj.js +442 -0
  49. package/dist/chunks/scripts-BGD_iU_6.js +41 -0
  50. package/dist/chunks/sdk-B7u9fTlP.js +2103 -0
  51. package/dist/chunks/shared-DC6_1u8X.js +85 -0
  52. package/dist/chunks/signature-E9KyYXS1.js +765 -0
  53. package/dist/chunks/snaptcha-CCDunGeb.js +8 -0
  54. package/dist/chunks/square-BLqK51rS.js +61 -0
  55. package/dist/chunks/stripe-B8gHpZNC.js +273 -0
  56. package/dist/chunks/styles-BIh6g7V_.js +22 -0
  57. package/dist/chunks/summary-EcNE0cvg.js +191 -0
  58. package/dist/chunks/table-yxEDL6kA.js +124 -0
  59. package/dist/chunks/text-limit-D0H_Ca2c.js +179 -0
  60. package/dist/chunks/theme-classes-vSHpdCUO.js +59 -0
  61. package/dist/chunks/turnstile-DP0bdR7T.js +68 -0
  62. package/dist/chunks/utils-ByrEVYrJ.js +49584 -0
  63. package/dist/css/formie-base.css +78 -0
  64. package/dist/css/formie-theme.css +19 -0
  65. package/dist/css/formie.css +2 -0
  66. package/dist/css/theme/_buttons.css +249 -0
  67. package/dist/css/theme/_loading.css +37 -0
  68. package/dist/css/theme/_messages.css +39 -0
  69. package/dist/css/theme/_progress.css +62 -0
  70. package/dist/css/theme/_tokens.css +361 -0
  71. package/dist/css/theme/_typography.css +70 -0
  72. package/dist/css/theme/fields/_address.css +17 -0
  73. package/dist/css/theme/fields/_check-radio.css +108 -0
  74. package/dist/css/theme/fields/_file.css +58 -0
  75. package/dist/css/theme/fields/_group.css +13 -0
  76. package/dist/css/theme/fields/_input.css +48 -0
  77. package/dist/css/theme/fields/_nested.css +19 -0
  78. package/dist/css/theme/fields/_repeater.css +69 -0
  79. package/dist/css/theme/fields/_rich-text.css +201 -0
  80. package/dist/css/theme/fields/_select.css +37 -0
  81. package/dist/css/theme/fields/_signature.css +39 -0
  82. package/dist/css/theme/fields/_summary.css +53 -0
  83. package/dist/css/theme/fields/_table.css +121 -0
  84. package/dist/css/theme/fields/_text-limit.css +10 -0
  85. package/dist/css/theme/forms/_field.css +62 -0
  86. package/dist/css/theme/forms/_form.css +166 -0
  87. package/dist/css/theme/integrations/_payment-modal.css +32 -0
  88. package/dist/css/theme/integrations/_paypal.css +10 -0
  89. package/dist/css/theme/integrations/_payway.css +10 -0
  90. package/dist/css/theme/integrations/_stripe.css +24 -0
  91. package/dist/css/theme/utilities/_accessibility.css +13 -0
  92. package/dist/css/theme-base/_controls.css +41 -0
  93. package/dist/css/theme-base/_primitives.css +34 -0
  94. package/dist/index.d.ts +30 -0
  95. package/dist/index.d.ts.map +1 -0
  96. package/dist/index.js +3206 -0
  97. package/dist/js/compatibility/dom-adapter.d.ts +12 -0
  98. package/dist/js/compatibility/dom-adapter.d.ts.map +1 -0
  99. package/dist/js/compatibility/event-map.d.ts +25 -0
  100. package/dist/js/compatibility/event-map.d.ts.map +1 -0
  101. package/dist/js/compatibility/validator-adapter.d.ts +17 -0
  102. package/dist/js/compatibility/validator-adapter.d.ts.map +1 -0
  103. package/dist/js/contracts/client.d.ts +40 -0
  104. package/dist/js/contracts/client.d.ts.map +1 -0
  105. package/dist/js/contracts/common.d.ts +5 -0
  106. package/dist/js/contracts/common.d.ts.map +1 -0
  107. package/dist/js/contracts/modules.d.ts +47 -0
  108. package/dist/js/contracts/modules.d.ts.map +1 -0
  109. package/dist/js/contracts/schema.d.ts +79 -0
  110. package/dist/js/contracts/schema.d.ts.map +1 -0
  111. package/dist/js/contracts/theme.d.ts +2 -0
  112. package/dist/js/contracts/theme.d.ts.map +1 -0
  113. package/dist/js/core/create-formie-client.d.ts +3 -0
  114. package/dist/js/core/create-formie-client.d.ts.map +1 -0
  115. package/dist/js/core/dom-events.d.ts +2 -0
  116. package/dist/js/core/dom-events.d.ts.map +1 -0
  117. package/dist/js/core/formie.d.ts +27 -0
  118. package/dist/js/core/formie.d.ts.map +1 -0
  119. package/dist/js/core/hydrate-modules.d.ts +22 -0
  120. package/dist/js/core/hydrate-modules.d.ts.map +1 -0
  121. package/dist/js/core/page-client-event.d.ts +9 -0
  122. package/dist/js/core/page-client-event.d.ts.map +1 -0
  123. package/dist/js/core/page-tab-errors.d.ts +2 -0
  124. package/dist/js/core/page-tab-errors.d.ts.map +1 -0
  125. package/dist/js/core/submit-flow.d.ts +21 -0
  126. package/dist/js/core/submit-flow.d.ts.map +1 -0
  127. package/dist/js/core/submit-result-state.d.ts +8 -0
  128. package/dist/js/core/submit-result-state.d.ts.map +1 -0
  129. package/dist/js/core/submit-result-ui.d.ts +10 -0
  130. package/dist/js/core/submit-result-ui.d.ts.map +1 -0
  131. package/dist/js/events/event-bus.d.ts +21 -0
  132. package/dist/js/events/event-bus.d.ts.map +1 -0
  133. package/dist/js/modules/address/address-finder.d.ts +2 -0
  134. package/dist/js/modules/address/address-finder.d.ts.map +1 -0
  135. package/dist/js/modules/address/api.d.ts +8 -0
  136. package/dist/js/modules/address/api.d.ts.map +1 -0
  137. package/dist/js/modules/address/constants.d.ts +15 -0
  138. package/dist/js/modules/address/constants.d.ts.map +1 -0
  139. package/dist/js/modules/address/factories.d.ts +35 -0
  140. package/dist/js/modules/address/factories.d.ts.map +1 -0
  141. package/dist/js/modules/address/google-address.d.ts +2 -0
  142. package/dist/js/modules/address/google-address.d.ts.map +1 -0
  143. package/dist/js/modules/address/host.d.ts +30 -0
  144. package/dist/js/modules/address/host.d.ts.map +1 -0
  145. package/dist/js/modules/address/index.d.ts +3 -0
  146. package/dist/js/modules/address/index.d.ts.map +1 -0
  147. package/dist/js/modules/address/loqate.d.ts +2 -0
  148. package/dist/js/modules/address/loqate.d.ts.map +1 -0
  149. package/dist/js/modules/address/place-kit.d.ts +2 -0
  150. package/dist/js/modules/address/place-kit.d.ts.map +1 -0
  151. package/dist/js/modules/captchas/api.d.ts +9 -0
  152. package/dist/js/modules/captchas/api.d.ts.map +1 -0
  153. package/dist/js/modules/captchas/captcha-eu.d.ts +2 -0
  154. package/dist/js/modules/captchas/captcha-eu.d.ts.map +1 -0
  155. package/dist/js/modules/captchas/constants.d.ts +5 -0
  156. package/dist/js/modules/captchas/constants.d.ts.map +1 -0
  157. package/dist/js/modules/captchas/factories.d.ts +63 -0
  158. package/dist/js/modules/captchas/factories.d.ts.map +1 -0
  159. package/dist/js/modules/captchas/friendly-captcha-v1.d.ts +2 -0
  160. package/dist/js/modules/captchas/friendly-captcha-v1.d.ts.map +1 -0
  161. package/dist/js/modules/captchas/friendly-captcha-v2.d.ts +2 -0
  162. package/dist/js/modules/captchas/friendly-captcha-v2.d.ts.map +1 -0
  163. package/dist/js/modules/captchas/hcaptcha.d.ts +2 -0
  164. package/dist/js/modules/captchas/hcaptcha.d.ts.map +1 -0
  165. package/dist/js/modules/captchas/host.d.ts +78 -0
  166. package/dist/js/modules/captchas/host.d.ts.map +1 -0
  167. package/dist/js/modules/captchas/index.d.ts +3 -0
  168. package/dist/js/modules/captchas/index.d.ts.map +1 -0
  169. package/dist/js/modules/captchas/recaptcha-enterprise.d.ts +2 -0
  170. package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -0
  171. package/dist/js/modules/captchas/recaptcha-shared.d.ts +26 -0
  172. package/dist/js/modules/captchas/recaptcha-shared.d.ts.map +1 -0
  173. package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts +2 -0
  174. package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts.map +1 -0
  175. package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts +2 -0
  176. package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts.map +1 -0
  177. package/dist/js/modules/captchas/recaptcha-v3.d.ts +2 -0
  178. package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -0
  179. package/dist/js/modules/captchas/snaptcha.d.ts +2 -0
  180. package/dist/js/modules/captchas/snaptcha.d.ts.map +1 -0
  181. package/dist/js/modules/captchas/turnstile.d.ts +2 -0
  182. package/dist/js/modules/captchas/turnstile.d.ts.map +1 -0
  183. package/dist/js/modules/captchas/utils.d.ts +13 -0
  184. package/dist/js/modules/captchas/utils.d.ts.map +1 -0
  185. package/dist/js/modules/fields/calculations.d.ts +3 -0
  186. package/dist/js/modules/fields/calculations.d.ts.map +1 -0
  187. package/dist/js/modules/fields/checkbox-radio.d.ts +3 -0
  188. package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -0
  189. package/dist/js/modules/fields/conditions/config.d.ts +5 -0
  190. package/dist/js/modules/fields/conditions/config.d.ts.map +1 -0
  191. package/dist/js/modules/fields/conditions/effects.d.ts +2 -0
  192. package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -0
  193. package/dist/js/modules/fields/conditions/evaluator.d.ts +6 -0
  194. package/dist/js/modules/fields/conditions/evaluator.d.ts.map +1 -0
  195. package/dist/js/modules/fields/conditions/references.d.ts +5 -0
  196. package/dist/js/modules/fields/conditions/references.d.ts.map +1 -0
  197. package/dist/js/modules/fields/conditions/transforms.d.ts +3 -0
  198. package/dist/js/modules/fields/conditions/transforms.d.ts.map +1 -0
  199. package/dist/js/modules/fields/conditions/types.d.ts +30 -0
  200. package/dist/js/modules/fields/conditions/types.d.ts.map +1 -0
  201. package/dist/js/modules/fields/conditions/values.d.ts +5 -0
  202. package/dist/js/modules/fields/conditions/values.d.ts.map +1 -0
  203. package/dist/js/modules/fields/conditions.d.ts +3 -0
  204. package/dist/js/modules/fields/conditions.d.ts.map +1 -0
  205. package/dist/js/modules/fields/date-picker.d.ts +3 -0
  206. package/dist/js/modules/fields/date-picker.d.ts.map +1 -0
  207. package/dist/js/modules/fields/file-upload.d.ts +3 -0
  208. package/dist/js/modules/fields/file-upload.d.ts.map +1 -0
  209. package/dist/js/modules/fields/hidden.d.ts +3 -0
  210. package/dist/js/modules/fields/hidden.d.ts.map +1 -0
  211. package/dist/js/modules/fields/index.d.ts +3 -0
  212. package/dist/js/modules/fields/index.d.ts.map +1 -0
  213. package/dist/js/modules/fields/phone-country.d.ts +3 -0
  214. package/dist/js/modules/fields/phone-country.d.ts.map +1 -0
  215. package/dist/js/modules/fields/repeater.d.ts +3 -0
  216. package/dist/js/modules/fields/repeater.d.ts.map +1 -0
  217. package/dist/js/modules/fields/rich-text.d.ts +3 -0
  218. package/dist/js/modules/fields/rich-text.d.ts.map +1 -0
  219. package/dist/js/modules/fields/shared.d.ts +20 -0
  220. package/dist/js/modules/fields/shared.d.ts.map +1 -0
  221. package/dist/js/modules/fields/signature.d.ts +3 -0
  222. package/dist/js/modules/fields/signature.d.ts.map +1 -0
  223. package/dist/js/modules/fields/summary.d.ts +3 -0
  224. package/dist/js/modules/fields/summary.d.ts.map +1 -0
  225. package/dist/js/modules/fields/table.d.ts +3 -0
  226. package/dist/js/modules/fields/table.d.ts.map +1 -0
  227. package/dist/js/modules/fields/text-limit.d.ts +3 -0
  228. package/dist/js/modules/fields/text-limit.d.ts.map +1 -0
  229. package/dist/js/modules/loader.d.ts +11 -0
  230. package/dist/js/modules/loader.d.ts.map +1 -0
  231. package/dist/js/modules/payments/api.d.ts +8 -0
  232. package/dist/js/modules/payments/api.d.ts.map +1 -0
  233. package/dist/js/modules/payments/bpoint.d.ts +2 -0
  234. package/dist/js/modules/payments/bpoint.d.ts.map +1 -0
  235. package/dist/js/modules/payments/constants.d.ts +5 -0
  236. package/dist/js/modules/payments/constants.d.ts.map +1 -0
  237. package/dist/js/modules/payments/eway.d.ts +9 -0
  238. package/dist/js/modules/payments/eway.d.ts.map +1 -0
  239. package/dist/js/modules/payments/factories.d.ts +54 -0
  240. package/dist/js/modules/payments/factories.d.ts.map +1 -0
  241. package/dist/js/modules/payments/go-cardless.d.ts +2 -0
  242. package/dist/js/modules/payments/go-cardless.d.ts.map +1 -0
  243. package/dist/js/modules/payments/host.d.ts +70 -0
  244. package/dist/js/modules/payments/host.d.ts.map +1 -0
  245. package/dist/js/modules/payments/index.d.ts +3 -0
  246. package/dist/js/modules/payments/index.d.ts.map +1 -0
  247. package/dist/js/modules/payments/mollie.d.ts +2 -0
  248. package/dist/js/modules/payments/mollie.d.ts.map +1 -0
  249. package/dist/js/modules/payments/moneris.d.ts +2 -0
  250. package/dist/js/modules/payments/moneris.d.ts.map +1 -0
  251. package/dist/js/modules/payments/opayo.d.ts +25 -0
  252. package/dist/js/modules/payments/opayo.d.ts.map +1 -0
  253. package/dist/js/modules/payments/paddle.d.ts +2 -0
  254. package/dist/js/modules/payments/paddle.d.ts.map +1 -0
  255. package/dist/js/modules/payments/paypal.d.ts +2 -0
  256. package/dist/js/modules/payments/paypal.d.ts.map +1 -0
  257. package/dist/js/modules/payments/payway.d.ts +2 -0
  258. package/dist/js/modules/payments/payway.d.ts.map +1 -0
  259. package/dist/js/modules/payments/square.d.ts +2 -0
  260. package/dist/js/modules/payments/square.d.ts.map +1 -0
  261. package/dist/js/modules/payments/stripe.d.ts +2 -0
  262. package/dist/js/modules/payments/stripe.d.ts.map +1 -0
  263. package/dist/js/modules/payments/utils.d.ts +17 -0
  264. package/dist/js/modules/payments/utils.d.ts.map +1 -0
  265. package/dist/js/modules/registry.d.ts +9 -0
  266. package/dist/js/modules/registry.d.ts.map +1 -0
  267. package/dist/js/modules/styles.d.ts +2 -0
  268. package/dist/js/modules/styles.d.ts.map +1 -0
  269. package/dist/js/submit/pipeline.d.ts +18 -0
  270. package/dist/js/submit/pipeline.d.ts.map +1 -0
  271. package/dist/js/theme/theme-classes.d.ts +10 -0
  272. package/dist/js/theme/theme-classes.d.ts.map +1 -0
  273. package/dist/js/transport/forms-api.d.ts +11 -0
  274. package/dist/js/transport/forms-api.d.ts.map +1 -0
  275. package/dist/js/utils/async.d.ts +8 -0
  276. package/dist/js/utils/async.d.ts.map +1 -0
  277. package/dist/js/utils/debug.d.ts +10 -0
  278. package/dist/js/utils/debug.d.ts.map +1 -0
  279. package/dist/js/utils/event-names.d.ts +13 -0
  280. package/dist/js/utils/event-names.d.ts.map +1 -0
  281. package/dist/js/utils/field-references.d.ts +6 -0
  282. package/dist/js/utils/field-references.d.ts.map +1 -0
  283. package/dist/js/utils/field-references.keys.d.ts +4 -0
  284. package/dist/js/utils/field-references.keys.d.ts.map +1 -0
  285. package/dist/js/utils/field-references.parser.d.ts +3 -0
  286. package/dist/js/utils/field-references.parser.d.ts.map +1 -0
  287. package/dist/js/utils/field-references.registry.d.ts +3 -0
  288. package/dist/js/utils/field-references.registry.d.ts.map +1 -0
  289. package/dist/js/utils/field-references.resolver.d.ts +4 -0
  290. package/dist/js/utils/field-references.resolver.d.ts.map +1 -0
  291. package/dist/js/utils/field-references.types.d.ts +27 -0
  292. package/dist/js/utils/field-references.types.d.ts.map +1 -0
  293. package/dist/js/utils/fields.d.ts +5 -0
  294. package/dist/js/utils/fields.d.ts.map +1 -0
  295. package/dist/js/utils/http.d.ts +9 -0
  296. package/dist/js/utils/http.d.ts.map +1 -0
  297. package/dist/js/utils/i18n.d.ts +7 -0
  298. package/dist/js/utils/i18n.d.ts.map +1 -0
  299. package/dist/js/utils/scripts.d.ts +13 -0
  300. package/dist/js/utils/scripts.d.ts.map +1 -0
  301. package/dist/js/utils/unload-warning.d.ts +10 -0
  302. package/dist/js/utils/unload-warning.d.ts.map +1 -0
  303. package/dist/js/validation/rules/email.d.ts +4 -0
  304. package/dist/js/validation/rules/email.d.ts.map +1 -0
  305. package/dist/js/validation/rules/match.d.ts +4 -0
  306. package/dist/js/validation/rules/match.d.ts.map +1 -0
  307. package/dist/js/validation/rules/number.d.ts +4 -0
  308. package/dist/js/validation/rules/number.d.ts.map +1 -0
  309. package/dist/js/validation/rules/required.d.ts +4 -0
  310. package/dist/js/validation/rules/required.d.ts.map +1 -0
  311. package/dist/js/validation/rules/shared.d.ts +7 -0
  312. package/dist/js/validation/rules/shared.d.ts.map +1 -0
  313. package/dist/js/validation/rules/url.d.ts +4 -0
  314. package/dist/js/validation/rules/url.d.ts.map +1 -0
  315. package/dist/js/validation/rules.d.ts +10 -0
  316. package/dist/js/validation/rules.d.ts.map +1 -0
  317. package/dist/js/validation/types.d.ts +44 -0
  318. package/dist/js/validation/types.d.ts.map +1 -0
  319. package/dist/js/validation/validator.d.ts +53 -0
  320. package/dist/js/validation/validator.d.ts.map +1 -0
  321. package/package.json +78 -0
  322. package/src/css/formie-base.css +78 -0
  323. package/src/css/formie-theme.css +19 -0
  324. package/src/css/formie.css +2 -0
  325. package/src/css/theme/_buttons.css +249 -0
  326. package/src/css/theme/_loading.css +37 -0
  327. package/src/css/theme/_messages.css +39 -0
  328. package/src/css/theme/_progress.css +62 -0
  329. package/src/css/theme/_tokens.css +361 -0
  330. package/src/css/theme/_typography.css +70 -0
  331. package/src/css/theme/fields/_address.css +17 -0
  332. package/src/css/theme/fields/_check-radio.css +108 -0
  333. package/src/css/theme/fields/_file.css +58 -0
  334. package/src/css/theme/fields/_group.css +13 -0
  335. package/src/css/theme/fields/_input.css +48 -0
  336. package/src/css/theme/fields/_nested.css +19 -0
  337. package/src/css/theme/fields/_repeater.css +69 -0
  338. package/src/css/theme/fields/_rich-text.css +201 -0
  339. package/src/css/theme/fields/_select.css +37 -0
  340. package/src/css/theme/fields/_signature.css +39 -0
  341. package/src/css/theme/fields/_summary.css +53 -0
  342. package/src/css/theme/fields/_table.css +121 -0
  343. package/src/css/theme/fields/_text-limit.css +10 -0
  344. package/src/css/theme/forms/_field.css +62 -0
  345. package/src/css/theme/forms/_form.css +166 -0
  346. package/src/css/theme/integrations/_payment-modal.css +32 -0
  347. package/src/css/theme/integrations/_paypal.css +10 -0
  348. package/src/css/theme/integrations/_payway.css +10 -0
  349. package/src/css/theme/integrations/_stripe.css +24 -0
  350. package/src/css/theme/utilities/_accessibility.css +13 -0
  351. package/src/css/theme-base/_controls.css +41 -0
  352. package/src/css/theme-base/_primitives.css +34 -0
  353. package/src/icons/rich-text/aligncenter.svg +6 -0
  354. package/src/icons/rich-text/alignleft.svg +6 -0
  355. package/src/icons/rich-text/alignright.svg +6 -0
  356. package/src/icons/rich-text/bold.svg +4 -0
  357. package/src/icons/rich-text/clear.svg +6 -0
  358. package/src/icons/rich-text/code.svg +4 -0
  359. package/src/icons/rich-text/heading1.svg +3 -0
  360. package/src/icons/rich-text/heading2.svg +3 -0
  361. package/src/icons/rich-text/image.svg +6 -0
  362. package/src/icons/rich-text/italic.svg +5 -0
  363. package/src/icons/rich-text/line.svg +3 -0
  364. package/src/icons/rich-text/link.svg +4 -0
  365. package/src/icons/rich-text/olist.svg +8 -0
  366. package/src/icons/rich-text/paragraph.svg +3 -0
  367. package/src/icons/rich-text/quote.svg +4 -0
  368. package/src/icons/rich-text/strikethrough.svg +4 -0
  369. package/src/icons/rich-text/ulist.svg +8 -0
  370. package/src/icons/rich-text/underline.svg +4 -0
  371. package/src/index.ts +125 -0
  372. package/src/js/compatibility/dom-adapter.ts +129 -0
  373. package/src/js/compatibility/event-map.ts +72 -0
  374. package/src/js/compatibility/validator-adapter.ts +105 -0
  375. package/src/js/contracts/client.ts +43 -0
  376. package/src/js/contracts/common.ts +14 -0
  377. package/src/js/contracts/modules.ts +53 -0
  378. package/src/js/contracts/schema.ts +83 -0
  379. package/src/js/contracts/theme.ts +1 -0
  380. package/src/js/core/create-formie-client.ts +1519 -0
  381. package/src/js/core/dom-events.ts +8 -0
  382. package/src/js/core/formie.ts +242 -0
  383. package/src/js/core/hydrate-modules.ts +102 -0
  384. package/src/js/core/page-client-event.ts +129 -0
  385. package/src/js/core/page-tab-errors.ts +37 -0
  386. package/src/js/core/submit-flow.ts +120 -0
  387. package/src/js/core/submit-result-state.ts +597 -0
  388. package/src/js/core/submit-result-ui.ts +448 -0
  389. package/src/js/events/event-bus.ts +109 -0
  390. package/src/js/modules/address/address-finder.ts +85 -0
  391. package/src/js/modules/address/api.ts +22 -0
  392. package/src/js/modules/address/constants.ts +15 -0
  393. package/src/js/modules/address/factories.ts +203 -0
  394. package/src/js/modules/address/google-address.ts +345 -0
  395. package/src/js/modules/address/host.ts +137 -0
  396. package/src/js/modules/address/index.ts +10 -0
  397. package/src/js/modules/address/loqate.ts +128 -0
  398. package/src/js/modules/address/place-kit.ts +94 -0
  399. package/src/js/modules/captchas/api.ts +25 -0
  400. package/src/js/modules/captchas/captcha-eu.ts +86 -0
  401. package/src/js/modules/captchas/constants.ts +4 -0
  402. package/src/js/modules/captchas/factories.ts +485 -0
  403. package/src/js/modules/captchas/friendly-captcha-v1.ts +65 -0
  404. package/src/js/modules/captchas/friendly-captcha-v2.ts +84 -0
  405. package/src/js/modules/captchas/hcaptcha.ts +153 -0
  406. package/src/js/modules/captchas/host.ts +448 -0
  407. package/src/js/modules/captchas/index.ts +16 -0
  408. package/src/js/modules/captchas/recaptcha-enterprise.ts +138 -0
  409. package/src/js/modules/captchas/recaptcha-shared.ts +69 -0
  410. package/src/js/modules/captchas/recaptcha-v2-checkbox.ts +72 -0
  411. package/src/js/modules/captchas/recaptcha-v2-invisible.ts +108 -0
  412. package/src/js/modules/captchas/recaptcha-v3.ts +62 -0
  413. package/src/js/modules/captchas/snaptcha.ts +10 -0
  414. package/src/js/modules/captchas/turnstile.ts +131 -0
  415. package/src/js/modules/captchas/utils.ts +85 -0
  416. package/src/js/modules/fields/calculations.ts +273 -0
  417. package/src/js/modules/fields/checkbox-radio.ts +295 -0
  418. package/src/js/modules/fields/conditions/config.ts +79 -0
  419. package/src/js/modules/fields/conditions/effects.ts +166 -0
  420. package/src/js/modules/fields/conditions/evaluator.ts +44 -0
  421. package/src/js/modules/fields/conditions/references.ts +165 -0
  422. package/src/js/modules/fields/conditions/transforms.ts +206 -0
  423. package/src/js/modules/fields/conditions/types.ts +33 -0
  424. package/src/js/modules/fields/conditions/values.ts +115 -0
  425. package/src/js/modules/fields/conditions.ts +229 -0
  426. package/src/js/modules/fields/date-picker.ts +272 -0
  427. package/src/js/modules/fields/file-upload.ts +628 -0
  428. package/src/js/modules/fields/hidden.ts +58 -0
  429. package/src/js/modules/fields/index.ts +19 -0
  430. package/src/js/modules/fields/phone-country.ts +226 -0
  431. package/src/js/modules/fields/repeater.ts +231 -0
  432. package/src/js/modules/fields/rich-text.ts +217 -0
  433. package/src/js/modules/fields/shared.ts +238 -0
  434. package/src/js/modules/fields/signature.ts +202 -0
  435. package/src/js/modules/fields/summary.ts +272 -0
  436. package/src/js/modules/fields/table.ts +197 -0
  437. package/src/js/modules/fields/text-limit.ts +280 -0
  438. package/src/js/modules/loader.ts +331 -0
  439. package/src/js/modules/payments/api.ts +20 -0
  440. package/src/js/modules/payments/bpoint.ts +48 -0
  441. package/src/js/modules/payments/constants.ts +17 -0
  442. package/src/js/modules/payments/eway.ts +132 -0
  443. package/src/js/modules/payments/factories.ts +332 -0
  444. package/src/js/modules/payments/go-cardless.ts +37 -0
  445. package/src/js/modules/payments/host.ts +459 -0
  446. package/src/js/modules/payments/index.ts +17 -0
  447. package/src/js/modules/payments/mollie.ts +38 -0
  448. package/src/js/modules/payments/moneris.ts +216 -0
  449. package/src/js/modules/payments/opayo.ts +272 -0
  450. package/src/js/modules/payments/paddle.ts +111 -0
  451. package/src/js/modules/payments/payment.ts +183 -0
  452. package/src/js/modules/payments/paypal.ts +214 -0
  453. package/src/js/modules/payments/payway.ts +114 -0
  454. package/src/js/modules/payments/square.ts +106 -0
  455. package/src/js/modules/payments/stripe.ts +426 -0
  456. package/src/js/modules/payments/stub-payment-module.ts +87 -0
  457. package/src/js/modules/payments/utils.ts +60 -0
  458. package/src/js/modules/registry.ts +38 -0
  459. package/src/js/modules/styles.ts +29 -0
  460. package/src/js/submit/pipeline.ts +514 -0
  461. package/src/js/theme/theme-classes.ts +106 -0
  462. package/src/js/transport/forms-api.ts +345 -0
  463. package/src/js/utils/async.ts +81 -0
  464. package/src/js/utils/debug.ts +59 -0
  465. package/src/js/utils/event-names.ts +60 -0
  466. package/src/js/utils/field-references.keys.ts +47 -0
  467. package/src/js/utils/field-references.parser.ts +121 -0
  468. package/src/js/utils/field-references.registry.ts +50 -0
  469. package/src/js/utils/field-references.resolver.ts +115 -0
  470. package/src/js/utils/field-references.ts +11 -0
  471. package/src/js/utils/field-references.types.ts +31 -0
  472. package/src/js/utils/fields.ts +58 -0
  473. package/src/js/utils/http.ts +51 -0
  474. package/src/js/utils/i18n.ts +98 -0
  475. package/src/js/utils/scripts.ts +84 -0
  476. package/src/js/utils/unload-warning.ts +190 -0
  477. package/src/js/validation/rules/email.ts +18 -0
  478. package/src/js/validation/rules/match.ts +26 -0
  479. package/src/js/validation/rules/minmax.ts +47 -0
  480. package/src/js/validation/rules/number.ts +55 -0
  481. package/src/js/validation/rules/pattern.ts +29 -0
  482. package/src/js/validation/rules/required.ts +30 -0
  483. package/src/js/validation/rules/shared.ts +47 -0
  484. package/src/js/validation/rules/url.ts +23 -0
  485. package/src/js/validation/rules.ts +16 -0
  486. package/src/js/validation/types.ts +50 -0
  487. package/src/js/validation/validator.ts +643 -0
  488. package/src/vendor.d.ts +100 -0
  489. package/src/vite-env.d.ts +22 -0
  490. package/vite-dev.mjs +22 -0
@@ -0,0 +1,2103 @@
1
+ //#region node_modules/@friendlycaptcha/sdk/sdk.js
2
+ function flatPromise(executor) {
3
+ let resolve;
4
+ let reject;
5
+ const promise = new Promise((res, rej) => {
6
+ resolve = res;
7
+ reject = rej;
8
+ });
9
+ if (executor) executor(resolve, reject);
10
+ return {
11
+ promise,
12
+ resolve,
13
+ reject
14
+ };
15
+ }
16
+ function stringHasPrefix(str, word) {
17
+ return str.lastIndexOf(word, 0) === 0;
18
+ }
19
+ var originRegex = /^((?:\w+:)?\/\/([^\/]+))/;
20
+ function encodeQuery(queryParams) {
21
+ let out = [];
22
+ const k = Object.keys(queryParams);
23
+ const eu = encodeURIComponent;
24
+ for (let i = 0; i < k.length; i++) out.push(`${eu(k[i])}=${eu(queryParams[k[i]])}`);
25
+ return out.join("&");
26
+ }
27
+ function originOf(url) {
28
+ const l = document.location;
29
+ if (stringHasPrefix(url, "/") || stringHasPrefix(url, ".")) {
30
+ if (l.origin) return l.origin;
31
+ return l.protocol + "//" + l.host;
32
+ }
33
+ const match = url.match(originRegex);
34
+ if (!match) throw new Error("Invalid URL: " + url);
35
+ return match[1];
36
+ }
37
+ var IFrameCommunicationTarget = class {
38
+ constructor(opts) {
39
+ /**
40
+ * We have received a message from this target at any point
41
+ */
42
+ this.ready = false;
43
+ /**
44
+ * Messages that couldn't be delivered yet as the target isn't ready to receive messages.
45
+ */
46
+ this.buffer = [];
47
+ this.id = opts.id;
48
+ this.type = opts.type;
49
+ this.element = opts.element;
50
+ this.onReady = opts.onReady;
51
+ this.origin = originOf(opts.element.src);
52
+ }
53
+ send(msg) {
54
+ if (this.ready) this.element.contentWindow.postMessage(msg, this.origin);
55
+ else this.buffer.push(msg);
56
+ }
57
+ setReady(ready) {
58
+ this.onReady();
59
+ this.ready = ready;
60
+ if (this.ready) this.flush();
61
+ }
62
+ flush() {
63
+ for (let i = 0; i < this.buffer.length; i++) this.element.contentWindow.postMessage(this.buffer[i], this.origin);
64
+ this.buffer = [];
65
+ }
66
+ };
67
+ function isAllowedOrigin(origin, allowedOrigins) {
68
+ return origin === "*" || allowedOrigins.has(origin);
69
+ }
70
+ var CommunicationBus = class {
71
+ constructor() {
72
+ /**
73
+ * Messages sent from this set of origins will be considered, all others are ignored.
74
+ * Perhaps the website this code runs on has more cross-origin message passing happening, we don't want to interfere.
75
+ */
76
+ this.origins = /* @__PURE__ */ new Set();
77
+ this.targets = {};
78
+ /** Some messages that expect an answer may be handled twice if two SDKs are present. Here we keep track of those and deliver them only once. */
79
+ this.answered = /* @__PURE__ */ new Set();
80
+ /**
81
+ * Called upon receiving a message intended for consumption by the root itself, which is the host page
82
+ * that contains the widgets and agent iframes.
83
+ */
84
+ this.onReceiveRootMessage = () => {};
85
+ window.addEventListener("message", (ev) => {
86
+ this.onReceive(ev);
87
+ });
88
+ }
89
+ /**
90
+ * Adds a listener for root messages.
91
+ * @internal
92
+ */
93
+ listen(onReceiveRootMessage) {
94
+ let orig = this.onReceiveRootMessage;
95
+ this.onReceiveRootMessage = (msg) => {
96
+ orig(msg);
97
+ onReceiveRootMessage(msg);
98
+ };
99
+ }
100
+ /**
101
+ * Add origins to allow messages from.
102
+ * @internal
103
+ */
104
+ addOrigins(origins) {
105
+ origins.forEach((origin) => this.origins.add(origin));
106
+ }
107
+ /**
108
+ * Send from the local root
109
+ * @param msg
110
+ * @internal
111
+ */
112
+ send(msg) {
113
+ if (msg.from_id) {
114
+ const messageSender = this.targets[msg.from_id];
115
+ if (!messageSender) {
116
+ console.error(`[bus] Unexpected message from unknown sender ${msg.from_id}`, msg);
117
+ return;
118
+ }
119
+ if (msg.type === "widget_announce" || msg.type === "agent_announce") messageSender.setReady(true);
120
+ }
121
+ const rid = msg.rid;
122
+ if (rid) {
123
+ if (this.answered.has(rid + msg.to_id)) return;
124
+ this.answered.add(rid + msg.to_id);
125
+ }
126
+ if (msg.to_id === "") {
127
+ this.onReceiveRootMessage(msg);
128
+ return;
129
+ }
130
+ const messageTarget = this.targets[msg.to_id];
131
+ if (!messageTarget) {
132
+ console.error(`[bus] Unexpected message to unknown target ${msg.to_id}`, msg);
133
+ return;
134
+ }
135
+ messageTarget.send(msg);
136
+ }
137
+ onReceive(ev) {
138
+ if (!isAllowedOrigin(ev.origin, this.origins)) return;
139
+ const msg = ev.data;
140
+ if (!msg || !msg._frc) return;
141
+ this.send(msg);
142
+ }
143
+ /**
144
+ * @param ct
145
+ * @internal
146
+ */
147
+ registerTarget(ct) {
148
+ this.targets[ct.id] = ct;
149
+ }
150
+ /**
151
+ * @internal
152
+ */
153
+ registerTargetIFrame(type, id, iframe, timeout) {
154
+ const fp = flatPromise();
155
+ let timeoutPromise = new Promise((resolve) => setTimeout(() => resolve("timeout"), timeout));
156
+ const t = new IFrameCommunicationTarget({
157
+ id,
158
+ element: iframe,
159
+ type,
160
+ onReady: () => fp.resolve("registered")
161
+ });
162
+ this.registerTarget(t);
163
+ return Promise.race([fp.promise, timeoutPromise]);
164
+ }
165
+ /**
166
+ * @internal
167
+ */
168
+ removeTarget(id) {
169
+ delete this.targets[id];
170
+ }
171
+ };
172
+ function randomId(length, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") {
173
+ let out = "";
174
+ for (let i = 0; i < length; i++) out += chars.charAt(Math.floor(Math.random() * chars.length));
175
+ return out;
176
+ }
177
+ function shuffledCopy(values) {
178
+ const out = values.slice();
179
+ for (let i = out.length - 1; i > 0; i--) {
180
+ const j = Math.floor(Math.random() * (i + 1));
181
+ const tmp = out[i];
182
+ out[i] = out[j];
183
+ out[j] = tmp;
184
+ }
185
+ return out;
186
+ }
187
+ var SESSION_COUNT_KEY = "frc_sc";
188
+ var SESSION_ID_KEY = "frc_sid";
189
+ var SEPARATOR = "__";
190
+ var didIncrease = false;
191
+ var sc = "0";
192
+ var sid = "__" + randomId(10);
193
+ function sessionCount(increase) {
194
+ if (!didIncrease) {
195
+ let scnumber = 0;
196
+ try {
197
+ scnumber = parseInt(sessionStorage.getItem(SESSION_COUNT_KEY) || "", 10);
198
+ } catch (e) {}
199
+ if (isNaN(scnumber)) scnumber = 0;
200
+ increase && scnumber++;
201
+ sc = scnumber.toString();
202
+ try {
203
+ sessionStorage.setItem(SESSION_COUNT_KEY, sc);
204
+ } catch (e) {}
205
+ }
206
+ return sc;
207
+ }
208
+ function sessionId() {
209
+ let id;
210
+ try {
211
+ id = sessionStorage.getItem(SESSION_ID_KEY);
212
+ } catch (e) {
213
+ return sid;
214
+ }
215
+ if (!id) {
216
+ id = randomId(12);
217
+ sessionStorage.setItem(SESSION_ID_KEY, id);
218
+ }
219
+ return id;
220
+ }
221
+ var Store = class {
222
+ constructor(prefix) {
223
+ /**
224
+ * Fallback memory-only store
225
+ */
226
+ this.mem = /* @__PURE__ */ new Map();
227
+ this.storePrefix = prefix;
228
+ }
229
+ get(key) {
230
+ const storeKey = this.storePrefix + SEPARATOR + key;
231
+ try {
232
+ const sessValue = sessionStorage.getItem(storeKey);
233
+ return sessValue === null ? void 0 : sessValue;
234
+ } catch (e) {}
235
+ return this.mem.get(key);
236
+ }
237
+ set(key, value) {
238
+ const storeKey = this.storePrefix + SEPARATOR + key;
239
+ try {
240
+ if (value === void 0) {
241
+ this.mem.delete(key);
242
+ sessionStorage.removeItem(storeKey);
243
+ } else {
244
+ this.mem.set(key, value);
245
+ sessionStorage.setItem(storeKey, value);
246
+ }
247
+ } catch (e) {}
248
+ }
249
+ };
250
+ var supportAllowClipboardWrite = typeof navigator !== "undefined" && navigator.userAgentData !== void 0;
251
+ function findFRCElements() {
252
+ return [document.querySelectorAll(".frc-captcha"), document.querySelectorAll(".frc-risk-intelligence")];
253
+ }
254
+ function findParentFormElement(element) {
255
+ let current = element;
256
+ while (current) {
257
+ if (current.tagName === "FORM") return current;
258
+ if (current.parentElement) {
259
+ current = current.parentElement;
260
+ continue;
261
+ }
262
+ const parentNode = current.parentNode;
263
+ if (parentNode && parentNode.host) {
264
+ current = parentNode.host;
265
+ continue;
266
+ }
267
+ current = null;
268
+ }
269
+ return null;
270
+ }
271
+ function executeOnceOnFocusInEvent(element, listener) {
272
+ element.addEventListener("focusin", listener, {
273
+ once: true,
274
+ passive: true
275
+ });
276
+ }
277
+ function createManagedInputElement(parentElement, formFieldName) {
278
+ const iel = document.createElement("input");
279
+ iel.type = "hidden";
280
+ iel.style.display = "none";
281
+ iel.name = formFieldName;
282
+ parentElement.appendChild(iel);
283
+ return iel;
284
+ }
285
+ function styleIfNotAlreadySet(el, name, value) {
286
+ if (el.style[name] === "") el.style[name] = value;
287
+ }
288
+ function setWidgetRootStyles(el) {
289
+ const sinas = styleIfNotAlreadySet;
290
+ sinas(el, "position", "relative");
291
+ sinas(el, "height", "70px");
292
+ sinas(el, "padding", "0");
293
+ sinas(el, "width", "316px");
294
+ sinas(el, "maxWidth", "100%");
295
+ sinas(el, "maxHeight", "100%");
296
+ sinas(el, "overflow", "hidden");
297
+ sinas(el, "borderRadius", "4px");
298
+ }
299
+ function removeWidgetRootStyles(el) {
300
+ el.removeAttribute("style");
301
+ }
302
+ function runOnDocumentLoaded(func) {
303
+ if (document.readyState !== "loading") func();
304
+ else document.addEventListener("DOMContentLoaded", func);
305
+ }
306
+ function fireFRCEvent(element, eventData) {
307
+ let event;
308
+ if (typeof window.CustomEvent === "function") event = new CustomEvent(eventData.name, {
309
+ bubbles: true,
310
+ detail: eventData
311
+ });
312
+ else {
313
+ event = document.createEvent("CustomEvent");
314
+ event.initCustomEvent(eventData.name, true, false, eventData);
315
+ }
316
+ element.dispatchEvent(event);
317
+ }
318
+ function findFirstParentLangAttribute(element) {
319
+ while (!element.lang || typeof element.lang !== "string") {
320
+ element = element.parentElement;
321
+ if (!element) return null;
322
+ }
323
+ return element.lang;
324
+ }
325
+ var PLACEHOLDER_LOCALIZATIONS = {
326
+ ar: {
327
+ title: "التحقق من مكافحة الروبوتات",
328
+ connecting: "التحقق من مكافحة الروبوتات قيد الاتصال…",
329
+ retrying: "استغرق الاتصال بالتحقق من مكافحة الروبوتات وقتًا طويلاً.\n\nإعادة المحاولة…",
330
+ failed: "فشل الاتصال بالتحقق من مكافحة الروبوتات."
331
+ },
332
+ bg: {
333
+ title: "Проверка срещу роботи",
334
+ connecting: "Зарежда се задачата…",
335
+ retrying: "Неуспешно свързване.\n\nОпит за повторно свързване…",
336
+ failed: "Неуспешно свързване."
337
+ },
338
+ ca: {
339
+ title: "Verificació anti-robot",
340
+ connecting: "Carregant el desafiament…",
341
+ retrying: "Errada de conexió.\n\nReintentant…",
342
+ failed: "Errada de conexió."
343
+ },
344
+ cs: {
345
+ title: "Ověření proti robotům",
346
+ connecting: "Připojování kontroly proti robotům…",
347
+ retrying: "Připojení kontroly proti robotům trvalo příliš dlouho.\n\nOpakuji pokus…",
348
+ failed: "Kontrola proti robotům se nepodařilo připojit."
349
+ },
350
+ da: {
351
+ title: "Anti-robot-verifikation",
352
+ connecting: "Anti-robot-kontrol forbinder…",
353
+ retrying: "Anti-robot-kontrol tog for lang tid at oprette forbindelse.\n\nPrøver igen…",
354
+ failed: "Anti-robot-kontrol kunne ikke oprette forbindelse."
355
+ },
356
+ nl: {
357
+ title: "Anti-robotcheck",
358
+ connecting: "Verbinden met Anti-robotcheck…",
359
+ retrying: "Verbinden met Anti-robotcheck mislukt.\n\nOpnieuw aan het proberen…",
360
+ failed: "Verbinden met Anti-robotcheck mislukt."
361
+ },
362
+ en: {
363
+ title: "Anti-Robot verification",
364
+ connecting: "Anti-Robot check connecting…",
365
+ retrying: "Anti-Robot check took too long to connect.\n\nRetrying…",
366
+ failed: "Anti-Robot check failed to connect."
367
+ },
368
+ fi: {
369
+ title: "Robottien torjunnan vahvistus",
370
+ connecting: "Robottien torjunnan tarkistus käynnissä…",
371
+ retrying: "Robottien torjunnan tarkistus kesti liian kauan.\n\nYritetään uudelleen…",
372
+ failed: "Robottien torjunnan tarkistus epäonnistui."
373
+ },
374
+ fr: {
375
+ title: "Vérification anti-robot",
376
+ connecting: "Connexion à la vérification anti-robot…",
377
+ retrying: "La connexion à la vérification anti-robot a pris trop de temps.\n\nNouvelle tentative…",
378
+ failed: "Échec de la connexion à la vérification anti-robot."
379
+ },
380
+ de: {
381
+ title: "Anti-Roboter-Verifizierung",
382
+ connecting: "Verbindung zur Anti-Roboter-Verifizierung wird hergestellt…",
383
+ retrying: "Verbindung zur Anti-Roboter-Verifizierung hat zu lange gedauert.\n\nErneuter Versuch…",
384
+ failed: "Verbindung zur Anti-Roboter-Verifizierung ist fehlgeschlagen."
385
+ },
386
+ hi: {
387
+ title: "एंटी-रोबोट सत्यापन",
388
+ connecting: "चुनौती लोड हो रही है…",
389
+ retrying: "कनेक्शन विफल.\n\nपुनः प्रयास कर रहे हैं…",
390
+ failed: "कनेक्शन विफल."
391
+ },
392
+ hu: {
393
+ title: "Robotellenőrzés",
394
+ connecting: "Robotellenőrzés csatlakozás…",
395
+ retrying: "A robotellenőrzés túl sokáig tartott a csatlakozáshoz.\n\nÚjrapróbálom…",
396
+ failed: "A robotellenőrzés nem tudott csatlakozni."
397
+ },
398
+ id: {
399
+ title: "Verifikasi Anti-Robot",
400
+ connecting: "Pemeriksaan Anti-Robot sedang terhubung…",
401
+ retrying: "Pemeriksaan Anti-Robot memakan waktu terlalu lama untuk terhubung.\n\nMencoba lagi…",
402
+ failed: "Pemeriksaan Anti-Robot gagal terhubung."
403
+ },
404
+ ja: {
405
+ title: "ロボット防止認証",
406
+ connecting: "チャレンジを読み込んでいます…",
407
+ retrying: "接続失敗.\n\n再試行中…",
408
+ failed: "接続失敗."
409
+ },
410
+ it: {
411
+ title: "Verifica anti-robot",
412
+ connecting: "Connessione verifica anti-robot in corso…",
413
+ retrying: "La connessione alla verifica anti-robot ha richiesto troppo tempo.\n\nRiprovando…",
414
+ failed: "Impossibile connettersi alla verifica anti-robot."
415
+ },
416
+ nb: {
417
+ title: "Anti-robot-verifisering",
418
+ connecting: "Laster inn utfordring…",
419
+ retrying: "Klarte ikke å koble til.\n\nPrøver igjen…",
420
+ failed: "Klarte ikke å koble til."
421
+ },
422
+ pl: {
423
+ title: "Weryfikacja antyrobotowa",
424
+ connecting: "Łączenie się z kontrolą antyrobotową…",
425
+ retrying: "Łączenie się z kontrolą antyrobotową trwało zbyt długo. \n\nPonowna próba…",
426
+ failed: "Nie udało się połączyć z kontrolą antyrobotową."
427
+ },
428
+ ro: {
429
+ title: "Verificare anti-robot",
430
+ connecting: "Se incarca testul…",
431
+ retrying: "Conexiunea a esuat.\n\nReincercare…",
432
+ failed: "Conexiunea a esuat."
433
+ },
434
+ pt: {
435
+ title: "Verificação anti-robô",
436
+ connecting: "Verificação anti-robô a ligar…",
437
+ retrying: "A verificação anti-robô demorou demasiado tempo a ligar-se.\n\nA tentar novamente…",
438
+ failed: "A verificação anti-robô não conseguiu ligar-se."
439
+ },
440
+ ru: {
441
+ title: "Проверка антиробота",
442
+ connecting: "Подключение к проверке антиробота…",
443
+ retrying: "Подключение к проверке антиробота заняло слишком много времени.\n\nПовторяем попытку…",
444
+ failed: "Не удалось подключиться к проверке антиробота."
445
+ },
446
+ sk: {
447
+ title: "Overovanie proti robotom",
448
+ connecting: "Pripojenie kontroly proti robotom…",
449
+ retrying: "Pripojenie kontroly proti robotom trvalo príliš dlho.\n\nOpakujem pokus…",
450
+ failed: "Pripojenie kontroly proti robotom sa nepodarilo."
451
+ },
452
+ sl: {
453
+ title: "Preverjanje proti robotom",
454
+ connecting: "Nalaganje izziva…",
455
+ retrying: "Povezava ni uspela.\n\nPonovni poskus…",
456
+ failed: "Povezava ni uspela."
457
+ },
458
+ es: {
459
+ title: "Verificación antirrobot",
460
+ connecting: "Conectando verificación antirrobot…",
461
+ retrying: "La verificación antirrobot tardó demasiado en conectarse.\n\nReintentando…",
462
+ failed: "Error al conectar la verificación antirrobot."
463
+ },
464
+ sv: {
465
+ title: "Anti-robotverifiering",
466
+ connecting: "Anti-robotverifiering ansluter…",
467
+ retrying: "Anti-robotverifiering tog för lång tid att ansluta.\n\nFörsöker igen…",
468
+ failed: "Anti-robotverifiering kunde inte ansluta."
469
+ },
470
+ th: {
471
+ title: "การตรวจสอบป้องกันบอท",
472
+ connecting: "กำลังโหลดการท้าทาย…",
473
+ retrying: "เชื่อมต่อไม่สำเร็จ.\n\nกำลังลองใหม่…",
474
+ failed: "เชื่อมต่อไม่สำเร็จ."
475
+ },
476
+ tr: {
477
+ title: "Robot önleme doğrulaması",
478
+ connecting: "Robot önleme kontrolü bağlanıyor…",
479
+ retrying: "Robot önleme kontrolü bağlanmak için çok uzun sürdü.\n\nYeniden deniyor…",
480
+ failed: "Robot önleme kontrolü bağlanamadı."
481
+ },
482
+ vi: {
483
+ title: "Xác minh chống robot",
484
+ connecting: "Kiểm tra robot đang kết nối…",
485
+ retrying: "Kiểm tra chống robot mất quá nhiều thời gian để kết nối.\n\nĐang thử lại…",
486
+ failed: "Kiểm tra chống robot không thể kết nối."
487
+ },
488
+ zh: {
489
+ title: "反机器人验证",
490
+ connecting: "反机器人验证正在连接…",
491
+ retrying: "反机器人验证连接耗时过长。\n\n正在重试…",
492
+ failed: "反机器人验证连接失败。"
493
+ }
494
+ };
495
+ var RTL_LANGUAGES = [
496
+ "ar",
497
+ "he",
498
+ "fa",
499
+ "ur",
500
+ "ps",
501
+ "sd",
502
+ "yi"
503
+ ];
504
+ function getLanguageCode(lang) {
505
+ return lang.toLowerCase().split("-")[0].split("_")[0];
506
+ }
507
+ function isRTLLanguage(lang) {
508
+ lang = getLanguageCode(lang);
509
+ return RTL_LANGUAGES.indexOf(lang) !== -1;
510
+ }
511
+ function getLocalizedWidgetTitle(lang) {
512
+ lang = getLanguageCode(lang);
513
+ return (PLACEHOLDER_LOCALIZATIONS[lang] || PLACEHOLDER_LOCALIZATIONS["en"]).title + " - Widget";
514
+ }
515
+ function getLocalizedPlaceholderText(lang, type) {
516
+ lang = getLanguageCode(lang);
517
+ return (PLACEHOLDER_LOCALIZATIONS[lang] || PLACEHOLDER_LOCALIZATIONS["en"])[type];
518
+ }
519
+ var FRAME_ID_DATASET_FIELD = "FrcFrameId";
520
+ var AGENT_FRAME_CLASSNAME = "frc-i-agent";
521
+ var WIDGET_FRAME_CLASSNAME = "frc-i-widget";
522
+ var WIDGET_PLACEHOLDER_CLASSNAME = "frc-widget-placeholder";
523
+ function createAgentIFrame(frcSDK, agentId, src) {
524
+ const frameParams = {
525
+ origin: document.location.origin,
526
+ sess_id: sessionId(),
527
+ sess_c: sessionCount(true),
528
+ comm_id: agentId,
529
+ sdk_v: "1.0.0",
530
+ v: "1",
531
+ agent_id: agentId,
532
+ ts: Date.now().toString()
533
+ };
534
+ const el = document.createElement("iframe");
535
+ el.className = AGENT_FRAME_CLASSNAME;
536
+ el.dataset[FRAME_ID_DATASET_FIELD] = agentId;
537
+ el.src = src + "?" + encodeQuery(frameParams);
538
+ el.frcSDK = frcSDK;
539
+ const s = el.style;
540
+ s.width = s.height = s.border = s.visibility = "0";
541
+ s.display = "none";
542
+ return el;
543
+ }
544
+ function createWidgetIFrame(agentId, widgetId, widgetUrl, opts) {
545
+ const el = document.createElement("iframe");
546
+ const language = getLanguageFromOptionsOrParent(opts);
547
+ const frameData = {
548
+ origin: document.location.origin,
549
+ sess_id: sessionId(),
550
+ sess_c: sessionCount(true),
551
+ comm_id: widgetId,
552
+ sdk_v: "1.0.0",
553
+ v: "1",
554
+ agent_id: agentId,
555
+ lang: language,
556
+ sitekey: opts.sitekey || "",
557
+ ts: Date.now().toString()
558
+ };
559
+ if (opts.theme) frameData.theme = opts.theme;
560
+ if (supportAllowClipboardWrite) el.allow = "clipboard-write";
561
+ el.frameBorder = "0";
562
+ el.src = widgetUrl + "?" + encodeQuery(frameData);
563
+ el.className = WIDGET_FRAME_CLASSNAME;
564
+ el.title = getLocalizedWidgetTitle(language);
565
+ el.dataset[FRAME_ID_DATASET_FIELD] = widgetId;
566
+ const s = el.style;
567
+ s.border = s.visibility = "0";
568
+ s.position = "absolute";
569
+ s.height = s.width = "100%";
570
+ s.userSelect = "none";
571
+ s["-webkit-tap-highlight-color"] = "transparent";
572
+ s.display = "none";
573
+ opts.element.appendChild(el);
574
+ return el;
575
+ }
576
+ function createWidgetPlaceholder(opts) {
577
+ const el = document.createElement("div");
578
+ el.classList.add(WIDGET_PLACEHOLDER_CLASSNAME);
579
+ const s = el.style;
580
+ const isDark = opts.theme === "dark" || opts.theme === "auto" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
581
+ s.color = isDark ? "#fff" : "#222";
582
+ s.backgroundColor = isDark ? "#171717" : "#fafafa";
583
+ s.borderRadius = "4px";
584
+ s.border = "1px solid";
585
+ s.borderColor = "#ddd";
586
+ s.padding = "8px";
587
+ s.height = s.width = "100%";
588
+ s.fontSize = "14px";
589
+ s.boxSizing = "border-box";
590
+ setCommonTextStyles(s);
591
+ opts.element.appendChild(el);
592
+ return el;
593
+ }
594
+ function setCommonTextStyles(s) {
595
+ s.textDecoration = s.fontStyle = "none";
596
+ s.fontWeight = "500";
597
+ s.fontFamily = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
598
+ s.lineHeight = "1";
599
+ s.letterSpacing = "-0.0125rem";
600
+ }
601
+ function createBanner(opts) {
602
+ const el = document.createElement("div");
603
+ el.classList.add("frc-banner");
604
+ const language = getLanguageFromOptionsOrParent(opts);
605
+ const isDark = opts.theme === "dark" || opts.theme === "auto" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
606
+ let primaryColor = "#565656";
607
+ let secondaryColor = "#a2a2a2";
608
+ if (isDark) {
609
+ primaryColor = "#a2a2a2";
610
+ secondaryColor = "#565656";
611
+ }
612
+ const els = el.style;
613
+ els.position = "absolute";
614
+ els.bottom = "6px";
615
+ if (isRTLLanguage(language)) els.left = "6px";
616
+ else els.right = "6px";
617
+ els.lineHeight = "1";
618
+ const a = document.createElement("a");
619
+ a.href = "https://friendlycaptcha.com";
620
+ a.rel = "noopener";
621
+ const s = a.style;
622
+ setCommonTextStyles(s);
623
+ s.color = primaryColor;
624
+ s.fontSize = "10px";
625
+ s.userSelect = "none";
626
+ s.textDecorationLine = "underline";
627
+ s.textDecorationThickness = "1px";
628
+ s.textDecorationColor = secondaryColor;
629
+ s.letterSpacing = "-0.0125rem";
630
+ a.target = "_blank";
631
+ a.textContent = "Friendly Captcha";
632
+ a.onmouseenter = () => s.textDecorationColor = primaryColor;
633
+ a.onmouseleave = () => s.textDecorationColor = secondaryColor;
634
+ el.appendChild(a);
635
+ opts.element.appendChild(el);
636
+ }
637
+ function getLanguageFromOptionsOrParent(opts) {
638
+ let language = opts.language;
639
+ if (!language || language === "html") language = findFirstParentLangAttribute(opts.element) || "";
640
+ return language;
641
+ }
642
+ function createFallback(el, apiOrigin, language) {
643
+ const link = (href, text) => {
644
+ const l = document.createElement("a");
645
+ l.href = href;
646
+ l.target = "_blank";
647
+ l.rel = "noopener";
648
+ l.textContent = text;
649
+ const style = l.style;
650
+ setCommonTextStyles(style);
651
+ style.textDecoration = "underline";
652
+ style.color = "#565656";
653
+ l.onmouseenter = () => style.textDecoration = "none";
654
+ l.onmouseleave = () => style.textDecoration = "underline";
655
+ return l;
656
+ };
657
+ const failedText = getLocalizedPlaceholderText(language, "failed");
658
+ const els = [link(`${apiOrigin}/connectionTest`, failedText)];
659
+ el.textContent = "";
660
+ els.forEach((e) => el.appendChild(e));
661
+ }
662
+ function windowPerformanceNow() {
663
+ const p = window.performance;
664
+ return p ? p.now() : 0;
665
+ }
666
+ function getTrigger(type, startMode, el, ev) {
667
+ const t = windowPerformanceNow();
668
+ const bcr = el.getBoundingClientRect();
669
+ const trigger = {
670
+ v: 1,
671
+ tt: type,
672
+ pnow: t,
673
+ sm: startMode,
674
+ el: {
675
+ bcr: [
676
+ bcr.left,
677
+ bcr.top,
678
+ bcr.width,
679
+ bcr.height
680
+ ],
681
+ con: document.body.contains(el)
682
+ },
683
+ stack: (/* @__PURE__ */ new Error()).stack || "",
684
+ we: !!window.event,
685
+ weit: !!window.event && !!window.event.isTrusted
686
+ };
687
+ if (ev) trigger.ev = {
688
+ ts: ev.timeStamp,
689
+ rt: !!ev.relatedTarget,
690
+ eot: !!ev.explicitOriginalTarget,
691
+ it: ev.isTrusted
692
+ };
693
+ return trigger;
694
+ }
695
+ function mergeObject(target, ...sources) {
696
+ for (let i = 0; i < sources.length; i++) {
697
+ const source = sources[i];
698
+ for (var key in source) if (source.hasOwnProperty(key)) target[key] = source[key];
699
+ }
700
+ return target;
701
+ }
702
+ var DEFAULT_FORM_FIELD_NAME = "frc-captcha-response";
703
+ var WidgetHandle = class {
704
+ /**
705
+ * You don't want to create this yourself, use `FriendlyCaptcha.createWidget` instead.
706
+ * @internal
707
+ */
708
+ constructor(opts) {
709
+ this.state = "init";
710
+ this.response = ".UNINITIALIZED";
711
+ this.focusEventPending = false;
712
+ /**
713
+ * When this is true the widget has been destroyed and can no longer be used.
714
+ */
715
+ this.isDestroyed = false;
716
+ this.id = opts.id;
717
+ const createOpts = opts.createOpts;
718
+ this.e = createOpts.element;
719
+ this.ready = opts.registered;
720
+ if (!this.e) throw new Error("No element provided to mount widget under.");
721
+ this.e.frcWidget = this;
722
+ this.formFieldName = createOpts.formFieldName === void 0 ? DEFAULT_FORM_FIELD_NAME : createOpts.formFieldName;
723
+ this.sitekey = createOpts.sitekey;
724
+ this._reset = opts.callbacks.onReset;
725
+ this._destroy = opts.callbacks.onDestroy;
726
+ this._trigger = opts.callbacks.onTrigger;
727
+ this.startMode = opts.createOpts.startMode || "focus";
728
+ if (this.formFieldName !== null) this.hiddenFormEl = createManagedInputElement(this.e, this.formFieldName);
729
+ this.setState({
730
+ response: ".UNCONNECTED",
731
+ state: "init"
732
+ });
733
+ this.ready.then(() => {
734
+ this.handleStartMode();
735
+ });
736
+ }
737
+ handleStartMode() {
738
+ if (this.startMode === "focus" && !this.focusEventPending && !this.isDestroyed) {
739
+ const formElement = findParentFormElement(this.e);
740
+ if (formElement) {
741
+ this.focusEventPending = true;
742
+ executeOnceOnFocusInEvent(formElement, (ev) => {
743
+ this.trigger("focus", { ev });
744
+ this.focusEventPending = false;
745
+ });
746
+ }
747
+ } else if (this.startMode === "auto") this.trigger("auto");
748
+ }
749
+ /**
750
+ * Reset the widget, removing any progress.
751
+ *
752
+ * Optional argument: an object with the name of the trigger that caused the reset.
753
+ * You would usually keep this empty. This is the `trigger` field in the `frc:widget.reset` event, which defaults to `root`.
754
+ */
755
+ reset(opts = { trigger: "root" }) {
756
+ if (this.isDestroyed) throw new Error("Can not reset destroyed widget.");
757
+ this.setState({
758
+ response: ".RESET",
759
+ state: "reset",
760
+ resetTrigger: opts.trigger
761
+ });
762
+ this._reset(opts);
763
+ this.handleStartMode();
764
+ }
765
+ /**
766
+ * Destroy the widget.
767
+ *
768
+ * This removes the `element` that the widget was mounted to as well as the hidden `frc-captcha-response` form field.
769
+ */
770
+ destroy() {
771
+ this.isDestroyed = true;
772
+ this.hiddenFormEl && this.hiddenFormEl.remove();
773
+ this.hiddenFormEl = void 0;
774
+ this.setState({
775
+ response: ".DESTROYED",
776
+ state: "destroyed"
777
+ });
778
+ this._destroy();
779
+ }
780
+ /**
781
+ * @internal
782
+ */
783
+ trigger(triggerType, data = {}) {
784
+ if (this.isDestroyed) throw new Error("Can not start destroyed widget.");
785
+ const trigger = getTrigger(triggerType, this.startMode, this.e, data.ev);
786
+ this._trigger({ trigger });
787
+ }
788
+ /**
789
+ * Trigger the widget to start a challenge.
790
+ * The widget will start a challenge solving in the background.
791
+ *
792
+ * * In `interactive` mode, the user will need to click the widget to complete the process.
793
+ * * In `noninteractive` mode, the widget will complete the process automatically.
794
+ *
795
+ */
796
+ start() {
797
+ this.trigger("programmatic");
798
+ }
799
+ /**
800
+ * Sets the state of the widget, this is for internal use.
801
+ * It is unlikely this is useful to call yourself.
802
+ * @internal
803
+ */
804
+ setState(s) {
805
+ const didStateChange = this.state !== s.state;
806
+ this.response = s.response;
807
+ this.state = s.state;
808
+ if (this.hiddenFormEl && this.e.isConnected !== false) this.hiddenFormEl.value = s.response;
809
+ if (didStateChange) this.dispatchWidgetEvent({
810
+ name: "frc:widget.statechange",
811
+ error: s.error,
812
+ mode: s.mode
813
+ });
814
+ if (this.state === "expired") this.dispatchWidgetEvent({ name: "frc:widget.expire" });
815
+ else if (this.state === "completed") this.dispatchWidgetEvent({ name: "frc:widget.complete" });
816
+ else if (this.state === "error") this.dispatchWidgetEvent({
817
+ name: "frc:widget.error",
818
+ error: s.error
819
+ });
820
+ else if (this.state === "reset") this.dispatchWidgetEvent({
821
+ name: "frc:widget.reset",
822
+ trigger: s.resetTrigger
823
+ });
824
+ }
825
+ dispatchWidgetEvent(eventData) {
826
+ const ed = {
827
+ response: this.response,
828
+ state: this.state,
829
+ id: this.id
830
+ };
831
+ mergeObject(ed, eventData);
832
+ fireFRCEvent(this.e, ed);
833
+ }
834
+ /**
835
+ * Shorthand for `this.getElement().addEventListener` (that is strictly typed in Typescript)
836
+ */
837
+ addEventListener(type, listener, options) {
838
+ this.e.addEventListener(type, listener, options);
839
+ }
840
+ /**
841
+ * Shorthand for `this.getElement().removeEventListener` (that is strictly typed in Typescript)
842
+ */
843
+ removeEventListener(type, listener, options) {
844
+ this.e.removeEventListener(type, listener, options);
845
+ }
846
+ /**
847
+ * The current state of the widget.
848
+ */
849
+ getState() {
850
+ return this.state;
851
+ }
852
+ /**
853
+ * The current response of the widget. This is the value that should be sent to the server and is embedded in HTML forms.
854
+ */
855
+ getResponse() {
856
+ return this.response;
857
+ }
858
+ /**
859
+ * The HTML element that contains the widget.
860
+ */
861
+ getElement() {
862
+ return this.e;
863
+ }
864
+ };
865
+ var isFunc = function(value) {
866
+ return typeof value === "function";
867
+ };
868
+ var patchNativeFunctions = function(opts) {
869
+ const queue = [];
870
+ const origPatchMap = /* @__PURE__ */ new Map();
871
+ const takeRecords = function() {
872
+ return queue.splice(0, queue.length);
873
+ };
874
+ const w = window;
875
+ const $window = (function getRealmSafely() {
876
+ try {
877
+ const iframe = document.createElement("iframe");
878
+ iframe.style.display = "none";
879
+ (document.body || document.head).appendChild(iframe);
880
+ const $window2 = iframe ? iframe.contentWindow : 0;
881
+ iframe.remove();
882
+ return $window2 || w;
883
+ } catch (e) {
884
+ return w;
885
+ }
886
+ })();
887
+ const originalFuncToString = Function.prototype.toString;
888
+ const newFuncToString = function toString(...args) {
889
+ const patchedRef = isFunc(this) ? origPatchMap.get(this) : false;
890
+ const ref = this === newFuncToString ? originalFuncToString : patchedRef ? patchedRef : this;
891
+ return originalFuncToString.apply(ref, args);
892
+ };
893
+ Function.prototype.toString = newFuncToString;
894
+ const getStackSafely = function FC_DummyTrace() {
895
+ return ($window.Error || w.Error)("FriendlyCaptcha_DummyTrace").stack || "";
896
+ };
897
+ const p = "prototype";
898
+ const dispatchEvent = w.EventTarget ? w.EventTarget[p].dispatchEvent : {};
899
+ const patches = [
900
+ [
901
+ "Document." + p + ".documentElement",
902
+ w.Document[p],
903
+ "documentElement"
904
+ ],
905
+ [
906
+ "Element." + p + ".shadowRoot",
907
+ w.Element[p],
908
+ "shadowRoot"
909
+ ],
910
+ [
911
+ "Node." + p + ".nodeType",
912
+ w.Node[p],
913
+ "nodeType"
914
+ ],
915
+ [
916
+ "Object.is",
917
+ w.Object,
918
+ "is"
919
+ ],
920
+ [
921
+ "Array." + p + ".slice",
922
+ w.Array[p],
923
+ "slice"
924
+ ],
925
+ [
926
+ "Document." + p + ".querySelectorAll",
927
+ w.Document[p],
928
+ "querySelectorAll"
929
+ ],
930
+ [
931
+ "Document." + p + ".createElement",
932
+ w.Document[p],
933
+ "createElement"
934
+ ],
935
+ [
936
+ "EventTarget." + p + ".dispatchEvent",
937
+ dispatchEvent,
938
+ "dispatchEvent"
939
+ ]
940
+ ];
941
+ if (!opts.disableEvalPatching) patches.push([
942
+ "eval",
943
+ w,
944
+ "eval"
945
+ ]);
946
+ patches.forEach(function([name, target, prop]) {
947
+ const descriptor = Object.getOwnPropertyDescriptor(target, prop);
948
+ const hasGetterOrSetter = descriptor && (descriptor.get || descriptor.set);
949
+ if (!descriptor) return;
950
+ else if (hasGetterOrSetter) {
951
+ if (!descriptor.get) return;
952
+ } else if (typeof descriptor.value !== "object" && typeof descriptor.value !== "function") return;
953
+ let l = 0, c = 0;
954
+ const newAccessor = function fcPatch(...args) {
955
+ const now = Date.now();
956
+ if (now - l >= 1e3) {
957
+ c = 0;
958
+ l = now;
959
+ }
960
+ if (c < 50) {
961
+ const record = {
962
+ d: now,
963
+ pnow: windowPerformanceNow(),
964
+ n: name,
965
+ st: getStackSafely()
966
+ };
967
+ if (queue.length > 2e4) queue.splice(0, 1e3);
968
+ queue.push(record);
969
+ c++;
970
+ }
971
+ return (hasGetterOrSetter ? descriptor.get : descriptor.value).apply(this, args);
972
+ };
973
+ try {
974
+ const descriptorValue = hasGetterOrSetter ? descriptor.get ? descriptor.get() : void 0 : descriptor.value();
975
+ if (descriptorValue) {
976
+ newAccessor.length = descriptorValue.length;
977
+ newAccessor.name = descriptorValue.name;
978
+ }
979
+ } catch (e) {}
980
+ try {
981
+ const newDescriptor = mergeObject({}, descriptor);
982
+ if (hasGetterOrSetter) newDescriptor.get = newAccessor;
983
+ else newDescriptor.value = newAccessor;
984
+ Object.defineProperty(target, prop, newDescriptor);
985
+ origPatchMap.set(newAccessor, hasGetterOrSetter ? descriptor.get : descriptor.value);
986
+ } catch (e) {}
987
+ });
988
+ return takeRecords;
989
+ };
990
+ function buildOnlineMetric() {
991
+ const s = [
992
+ 0,
993
+ 0,
994
+ 0,
995
+ 0,
996
+ 0,
997
+ 0,
998
+ 0
999
+ ];
1000
+ return {
1001
+ s,
1002
+ add(x2) {
1003
+ const n = ++s[0];
1004
+ const d = x2 - s[1];
1005
+ const dN = d / n;
1006
+ const dN2 = dN * dN;
1007
+ const t1 = d * dN * (n - 1);
1008
+ s[1] += dN;
1009
+ s[4] += t1 * dN2 * (n * n - 3 * n + 3) + 6 * dN2 * s[2] - 4 * dN * s[3];
1010
+ s[3] += t1 * dN * (n - 2) - 3 * dN * s[2];
1011
+ s[2] += t1;
1012
+ if (n == 1) s[5] = s[6] = x2;
1013
+ else {
1014
+ if (x2 < s[5]) s[5] = x2;
1015
+ if (x2 > s[6]) s[6] = x2;
1016
+ }
1017
+ }
1018
+ };
1019
+ }
1020
+ var x = "addEventListener";
1021
+ var M = Math;
1022
+ var ssig;
1023
+ function isAndroidUA() {
1024
+ return /Android/i.test(navigator.userAgent);
1025
+ }
1026
+ function onOffEventMetric(onEventName, offEventName, retrigger = false, target) {
1027
+ const m = buildOnlineMetric();
1028
+ let on = false;
1029
+ let ts;
1030
+ runOnDocumentLoaded(() => {
1031
+ target = target || document.body;
1032
+ target[x](onEventName, (ev) => {
1033
+ if (!on || retrigger) {
1034
+ ts = ev.timeStamp;
1035
+ on = true;
1036
+ }
1037
+ });
1038
+ target[x](offEventName, (ev) => {
1039
+ if (on) {
1040
+ m.add(ev.timeStamp - ts);
1041
+ on = false;
1042
+ }
1043
+ });
1044
+ });
1045
+ return m.s;
1046
+ }
1047
+ function eventCounts(events) {
1048
+ const out = [];
1049
+ for (let i = 0; i < events.length; i++) {
1050
+ out.push(0);
1051
+ document[x](events[i], (_) => out[i]++);
1052
+ }
1053
+ return out;
1054
+ }
1055
+ function keyCountMetric() {
1056
+ const out = [
1057
+ 0,
1058
+ 0,
1059
+ 0,
1060
+ 0,
1061
+ 0,
1062
+ 0,
1063
+ 0,
1064
+ 0
1065
+ ];
1066
+ const m = {
1067
+ 8: 1,
1068
+ 46: 1,
1069
+ 9: 2,
1070
+ 45: 3,
1071
+ 17: 4,
1072
+ 13: 5,
1073
+ 37: 6,
1074
+ 38: 6,
1075
+ 39: 6,
1076
+ 40: 6,
1077
+ 33: 7,
1078
+ 34: 7
1079
+ };
1080
+ document[x]("keydown", (ev) => {
1081
+ const kc = ev.keyCode;
1082
+ if (m[kc]) out[m[kc]]++;
1083
+ else if (kc >= 112 && kc <= 123) out[0]++;
1084
+ });
1085
+ return out;
1086
+ }
1087
+ function euclidean2d(x0, x1, y0, y1) {
1088
+ return M.sqrt(M.pow(x0 - x1, 2) + M.pow(y0 - y1, 2));
1089
+ }
1090
+ function vector3Length(x2, y, z) {
1091
+ return M.sqrt(M.pow(x2, 2) + M.pow(y, 2) + M.pow(z, 2));
1092
+ }
1093
+ function deltaAngle(a, b) {
1094
+ let angle = b - a;
1095
+ angle += angle > 180 ? -360 : angle < -180 ? 360 : 0;
1096
+ return angle;
1097
+ }
1098
+ var Signals = class {
1099
+ constructor(opts) {
1100
+ /** Distinct touch event radius count */
1101
+ this.rn = 0;
1102
+ /** Counter */
1103
+ this.i = 0;
1104
+ this.smel = {
1105
+ n: 0,
1106
+ ts: 0,
1107
+ d: 0
1108
+ };
1109
+ const $ = "mouse";
1110
+ const sm = this.smel;
1111
+ const updateMouseEnterMouseLeave = (e) => {
1112
+ if (!sm.n) {
1113
+ sm.fts = e.timeStamp;
1114
+ sm.fxy = [
1115
+ e.clientX,
1116
+ e.clientY,
1117
+ e.screenX,
1118
+ e.screenY
1119
+ ];
1120
+ }
1121
+ sm.n++;
1122
+ if (e.type === $ + "leave") sm.d += e.timeStamp - sm.ts;
1123
+ sm.ts = e.timeStamp;
1124
+ sm.xy = [e.clientX, e.clientY];
1125
+ };
1126
+ const d = document;
1127
+ runOnDocumentLoaded(() => {
1128
+ const b = d.body;
1129
+ b[x]($ + "enter", updateMouseEnterMouseLeave);
1130
+ b[x]($ + "leave", updateMouseEnterMouseLeave);
1131
+ });
1132
+ this.bh = {
1133
+ onoff: {
1134
+ kdu: onOffEventMetric("keydown", "keyup"),
1135
+ cse: onOffEventMetric("compositionstart", "compositionend"),
1136
+ mdu: onOffEventMetric($ + "down", $ + "up"),
1137
+ mle: onOffEventMetric($ + "leave", $ + "enter"),
1138
+ med: onOffEventMetric($ + "enter", $ + "down", true),
1139
+ semd: onOffEventMetric("scrollend", $ + "down", true, d),
1140
+ se: onOffEventMetric("scroll", "scrollend", false, d),
1141
+ pdc: onOffEventMetric("pointerdown", "pointercancel", true),
1142
+ mmc: onOffEventMetric($ + "move", "click", true),
1143
+ tse: onOffEventMetric("touchstart", "touchend"),
1144
+ fikd: onOffEventMetric("focusin", "keydown", true)
1145
+ },
1146
+ nev: eventCounts([
1147
+ $ + "out",
1148
+ "pointercancel",
1149
+ "focus",
1150
+ "focusin",
1151
+ "blur",
1152
+ "visibilitychange",
1153
+ "copy",
1154
+ "paste",
1155
+ "cut",
1156
+ "contextmenu",
1157
+ "click",
1158
+ "auxclick",
1159
+ "wheel",
1160
+ "resize"
1161
+ ]),
1162
+ nk: keyCountMetric(),
1163
+ mov: this.setupMovementMetrics(),
1164
+ dm: this.setupMotionMetrics(),
1165
+ do: this.setupOrientationMetrics()
1166
+ };
1167
+ this.dep = opts.disableEvalPatching || false;
1168
+ this.takeTraceRecords = patchNativeFunctions(opts);
1169
+ }
1170
+ setupMovementMetrics() {
1171
+ let intervalHandle = void 0;
1172
+ let sample = [];
1173
+ const interval = 50;
1174
+ const duration = buildOnlineMetric();
1175
+ const distance = buildOnlineMetric();
1176
+ const vel = buildOnlineMetric();
1177
+ const out = {
1178
+ t: duration.s,
1179
+ v: vel.s,
1180
+ d: distance.s,
1181
+ ns: 0
1182
+ };
1183
+ const updateFunc = () => {
1184
+ const lastSample = sample[sample.length - 1];
1185
+ if (sample.length >= 1e4 / interval || lastSample && (lastSample[0] && this.tm.timeStamp === lastSample[1] || !lastSample[0] && this.mm.timeStamp === lastSample[1])) {
1186
+ clearInterval(intervalHandle);
1187
+ intervalHandle = void 0;
1188
+ if (sample.length === 1) {
1189
+ out.ns++;
1190
+ sample = [];
1191
+ return;
1192
+ }
1193
+ const firstSample = sample[0];
1194
+ duration.add(lastSample[1] - firstSample[1]);
1195
+ distance.add(euclidean2d(lastSample[2], firstSample[2], lastSample[3], firstSample[3]));
1196
+ for (let i = 1; i < sample.length; i++) {
1197
+ const c = sample[i];
1198
+ const p = sample[i - 1];
1199
+ const dist = euclidean2d(c[2], p[2], c[3], p[3]) * 1e3;
1200
+ const dt = c[1] - p[1];
1201
+ vel.add(dist / dt);
1202
+ }
1203
+ sample = [];
1204
+ return;
1205
+ }
1206
+ let evType = 0;
1207
+ if (lastSample) evType = lastSample[0];
1208
+ else if (this.mm && this.tm) evType = this.mm.timeStamp > this.tm.timeStamp ? 0 : 1;
1209
+ else if (!this.mm) evType = 1;
1210
+ if (evType) {
1211
+ const t = this.tm.touches[0];
1212
+ t && sample.push([
1213
+ 1,
1214
+ this.tm.timeStamp,
1215
+ t.screenX,
1216
+ t.screenY
1217
+ ]);
1218
+ } else sample.push([
1219
+ 0,
1220
+ this.mm.timeStamp,
1221
+ this.mm.screenX,
1222
+ this.mm.screenY
1223
+ ]);
1224
+ };
1225
+ let lastRadius = -1;
1226
+ runOnDocumentLoaded(() => {
1227
+ const b = document.body;
1228
+ b[x]("mousemove", (e) => {
1229
+ this.mm = e;
1230
+ if (intervalHandle === void 0) {
1231
+ updateFunc();
1232
+ intervalHandle = setInterval(updateFunc, interval);
1233
+ }
1234
+ });
1235
+ b[x]("touchmove", (e) => {
1236
+ this.tm = e;
1237
+ const t = e.touches[0];
1238
+ if (t) {
1239
+ const newRadius = t.radiusX + t.radiusY * 1.234;
1240
+ if (newRadius !== lastRadius) {
1241
+ lastRadius = newRadius;
1242
+ this.rn++;
1243
+ }
1244
+ }
1245
+ if (intervalHandle === void 0) {
1246
+ updateFunc();
1247
+ intervalHandle = setInterval(updateFunc, interval);
1248
+ }
1249
+ });
1250
+ });
1251
+ return out;
1252
+ }
1253
+ /**
1254
+ * @internal
1255
+ */
1256
+ setupMotionMetrics() {
1257
+ const acc = buildOnlineMetric();
1258
+ const rr = buildOnlineMetric();
1259
+ const sig = {
1260
+ n: 0,
1261
+ ts: 0,
1262
+ ac: acc.s,
1263
+ rr: rr.s,
1264
+ i: 0,
1265
+ g: false
1266
+ };
1267
+ if (!isAndroidUA()) return sig;
1268
+ window[x]("devicemotion", (e) => {
1269
+ sig.ts = e.timeStamp;
1270
+ sig.i = e.interval;
1271
+ sig.g = !e.acceleration;
1272
+ const a = e.acceleration || e.accelerationIncludingGravity;
1273
+ if (a) acc.add(vector3Length(a.x, a.y, a.z));
1274
+ const r = e.rotationRate;
1275
+ if (r) rr.add(vector3Length(r.alpha, r.beta, r.gamma));
1276
+ });
1277
+ return sig;
1278
+ }
1279
+ /**
1280
+ * @internal
1281
+ */
1282
+ setupOrientationMetrics() {
1283
+ const gd = buildOnlineMetric();
1284
+ const bd = buildOnlineMetric();
1285
+ const sig = {
1286
+ fts: 0,
1287
+ ts: 0,
1288
+ gd: gd.s,
1289
+ bd: bd.s
1290
+ };
1291
+ if (!isAndroidUA()) return sig;
1292
+ let hasPrevious;
1293
+ window[x]("deviceorientation", (e) => {
1294
+ if (e.gamma == null || e.beta == null || e.alpha == null) return;
1295
+ sig.ts = e.timeStamp;
1296
+ sig.a = e.alpha;
1297
+ sig.b = e.beta;
1298
+ sig.g = e.gamma;
1299
+ if (!hasPrevious) {
1300
+ sig.fts = sig.ts;
1301
+ hasPrevious = true;
1302
+ } else {
1303
+ gd.add(deltaAngle(e.gamma, sig.g));
1304
+ bd.add(deltaAngle(sig.b, e.beta));
1305
+ }
1306
+ });
1307
+ return sig;
1308
+ }
1309
+ /**
1310
+ * @internal
1311
+ */
1312
+ gmm() {
1313
+ const e = this.mm;
1314
+ return e && {
1315
+ xy: [
1316
+ e.clientX,
1317
+ e.clientY,
1318
+ e.screenX,
1319
+ e.screenY,
1320
+ e.offsetX,
1321
+ e.offsetY,
1322
+ e.pageX,
1323
+ e.pageY,
1324
+ e.movementX,
1325
+ e.movementY
1326
+ ],
1327
+ ts: e.timeStamp
1328
+ };
1329
+ }
1330
+ /**
1331
+ * @internal
1332
+ */
1333
+ gtm() {
1334
+ const tm = this.tm;
1335
+ const tt = tm && tm.touches;
1336
+ const tm0 = tt && tt[0];
1337
+ return tm && tm0 && {
1338
+ id: tm0.identifier,
1339
+ xy: [
1340
+ tm0.clientX,
1341
+ tm0.clientY,
1342
+ tm0.screenX,
1343
+ tm0.screenY,
1344
+ tm0.pageX,
1345
+ tm0.pageY
1346
+ ],
1347
+ r: [
1348
+ tm0.radiusX,
1349
+ tm0.radiusX,
1350
+ tm0.rotationAngle,
1351
+ tm0.force
1352
+ ],
1353
+ n: tt.length,
1354
+ ts: tm.timeStamp,
1355
+ rn: this.rn
1356
+ };
1357
+ }
1358
+ /**
1359
+ * @internal
1360
+ */
1361
+ get(widgetId) {
1362
+ const b = document.body;
1363
+ const w = window;
1364
+ const p = w.performance;
1365
+ return {
1366
+ v: 1,
1367
+ i: ++this.i,
1368
+ hl: history.length,
1369
+ fe: !!window.frameElement,
1370
+ dep: this.dep,
1371
+ wid: widgetId,
1372
+ sc: parseInt(sessionCount(false)),
1373
+ sid: sessionId(),
1374
+ conv: 0,
1375
+ t: {
1376
+ pnow: windowPerformanceNow(),
1377
+ pto: p && p.timeOrigin || 0,
1378
+ ts: Date.now()
1379
+ },
1380
+ dims: {
1381
+ d: [
1382
+ w.innerWidth,
1383
+ w.innerHeight,
1384
+ w.outerWidth,
1385
+ w.outerHeight,
1386
+ w.screenX,
1387
+ w.screenY,
1388
+ w.pageXOffset,
1389
+ w.pageYOffset,
1390
+ b.clientWidth,
1391
+ b.clientHeight
1392
+ ],
1393
+ dpr: w.devicePixelRatio
1394
+ },
1395
+ mel: this.smel,
1396
+ mm: this.gmm(),
1397
+ tm: this.gtm(),
1398
+ bh: this.bh,
1399
+ stack: (/* @__PURE__ */ new Error()).stack || "",
1400
+ trc: this.takeTraceRecords()
1401
+ };
1402
+ }
1403
+ };
1404
+ function getSignals(opts) {
1405
+ return ssig || (ssig = new Signals(opts));
1406
+ }
1407
+ var toFRCAPIUrl = (hosts) => hosts.map((h) => `https://${h}.frcapi.com`).join(",");
1408
+ var SHORTHANDS = {
1409
+ eu: toFRCAPIUrl([
1410
+ "eu",
1411
+ "eu0",
1412
+ "eu1"
1413
+ ]),
1414
+ global: toFRCAPIUrl([
1415
+ "global",
1416
+ "global0",
1417
+ "global1"
1418
+ ])
1419
+ };
1420
+ var splitCSV = (value) => value.split(",").map((v) => v.trim()).filter((v) => !!v);
1421
+ var expandEndpointShorthand = (value) => splitCSV(SHORTHANDS[value] || value);
1422
+ function resolveAPIOrigins(optionValue) {
1423
+ const resolved = splitCSV(optionValue || SHORTHANDS.global).reduce((acc, endpoint) => acc.concat(expandEndpointShorthand(endpoint)), []).map(originOf);
1424
+ if (resolved.length > 0) return resolved;
1425
+ return splitCSV(SHORTHANDS.global).map(originOf);
1426
+ }
1427
+ function getSDKDisableEvalPatching() {
1428
+ const m = document.querySelector(`meta[name="frc-disable-eval-patching"]`);
1429
+ if (!m) return false;
1430
+ return !!m.content;
1431
+ }
1432
+ function getSDKAPIEndpoint() {
1433
+ const m = document.querySelector(`meta[name="frc-api-endpoint"]`);
1434
+ if (m) return m.content;
1435
+ const cs = document.currentScript;
1436
+ if (cs) {
1437
+ const endpoint = cs.dataset["frcApiEndpoint"];
1438
+ if (endpoint) return endpoint;
1439
+ }
1440
+ const we = document.querySelector(".frc-captcha[data-api-endpoint]");
1441
+ if (we) {
1442
+ const endpoint = we.dataset["apiEndpoint"];
1443
+ if (endpoint) return endpoint;
1444
+ }
1445
+ }
1446
+ function tz() {
1447
+ const intl = window.Intl;
1448
+ if (!intl || !intl.DateTimeFormat) return;
1449
+ const dtf = new intl.DateTimeFormat();
1450
+ if (!dtf || !dtf.resolvedOptions) return;
1451
+ return dtf.resolvedOptions().timeZone;
1452
+ }
1453
+ var CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
1454
+ function encodeStringToBase64Url(str) {
1455
+ if (!window.TextEncoder) return "";
1456
+ return encodeBase64Url(new TextEncoder().encode(str));
1457
+ }
1458
+ function encodeBase64Url(bytes) {
1459
+ const len = bytes.length;
1460
+ let base64 = "";
1461
+ for (let i = 0; i < len; i += 3) {
1462
+ const b0 = bytes[i + 0];
1463
+ const b1 = bytes[i + 1];
1464
+ const b2 = bytes[i + 2];
1465
+ let t = "";
1466
+ t += CHARS.charAt(b0 >>> 2);
1467
+ t += CHARS.charAt((b0 & 3) << 4 | b1 >>> 4);
1468
+ t += CHARS.charAt((b1 & 15) << 2 | b2 >>> 6);
1469
+ t += CHARS.charAt(b2 & 63);
1470
+ base64 += t;
1471
+ }
1472
+ if (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";
1473
+ else if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";
1474
+ return base64;
1475
+ }
1476
+ var DEFAULT_FORM_FIELD_NAME2 = "frc-risk-intelligence-token";
1477
+ var RiskIntelligenceHandle = class {
1478
+ /**
1479
+ * This class is only instantiated by the SDK by calling FriendlyCaptchaSDK.attach()
1480
+ * Do not create a handle manually.
1481
+ *
1482
+ * @internal
1483
+ */
1484
+ constructor(opts) {
1485
+ /**
1486
+ * A timeout ID used for firing an expiration event when this handle's
1487
+ * token expires.
1488
+ */
1489
+ this.timeout = null;
1490
+ this.data = null;
1491
+ this.e = opts.element;
1492
+ if (!this.e) throw new Error("No element provided for mounting Risk Intelligence handle.");
1493
+ this.e.frcRiskIntelligence = this;
1494
+ this.formFieldName = opts.formFieldName === void 0 ? DEFAULT_FORM_FIELD_NAME2 : opts.formFieldName;
1495
+ if (this.formFieldName !== null) this.hiddenFormEl = createManagedInputElement(this.e, this.formFieldName);
1496
+ this.startMode = opts.startMode || "focus";
1497
+ this.requestRiskIntelligence = opts.riskIntelligence;
1498
+ this.handleStartMode();
1499
+ }
1500
+ handleStartMode() {
1501
+ if (this.startMode === "none") console.warn("Risk Intelligence <div> found with data-start=\"none\" (no-op), skipping...", this.e);
1502
+ else if (this.startMode === "auto") this.request();
1503
+ else {
1504
+ const parentForm = findParentFormElement(this.e);
1505
+ if (!parentForm) console.warn("Risk Intelligence <div> with startMode of \"focus\" found without a parent <form> element, skipping...", this.e);
1506
+ else executeOnceOnFocusInEvent(parentForm, () => {
1507
+ this.request();
1508
+ });
1509
+ }
1510
+ }
1511
+ request() {
1512
+ this.requestRiskIntelligence().then((data) => {
1513
+ if (this.timeout !== null) clearTimeout(this.timeout);
1514
+ this.timeout = setTimeout(() => {
1515
+ fireFRCEvent(this.e, { name: "frc:riskintelligence.expire" });
1516
+ }, data.expiresAt - Date.now());
1517
+ this.data = {
1518
+ token: data.token,
1519
+ expiresAt: data.expiresAt
1520
+ };
1521
+ if (this.hiddenFormEl) this.hiddenFormEl.value = data.token;
1522
+ fireFRCEvent(this.e, {
1523
+ name: "frc:riskintelligence.complete",
1524
+ token: data.token,
1525
+ expiresAt: data.expiresAt
1526
+ });
1527
+ }).catch((error) => {
1528
+ fireFRCEvent(this.e, {
1529
+ name: "frc:riskintelligence.error",
1530
+ error: {
1531
+ code: error.code,
1532
+ detail: error.detail
1533
+ }
1534
+ });
1535
+ });
1536
+ }
1537
+ /**
1538
+ * @returns Risk Intelligence data if request is done and `null` if not.
1539
+ */
1540
+ getData() {
1541
+ return this.data;
1542
+ }
1543
+ /**
1544
+ * @returns The HTML element used to configure the Risk Intelligence request.
1545
+ */
1546
+ getElement() {
1547
+ return this.e;
1548
+ }
1549
+ /**
1550
+ * Shorthand for `this.getElement().addEventListener` (that is strictly typed in Typescript)
1551
+ */
1552
+ addEventListener(type, listener, options) {
1553
+ this.e.addEventListener(type, listener, options);
1554
+ }
1555
+ /**
1556
+ * Shorthand for `this.getElement().removeEventListener` (that is strictly typed in Typescript)
1557
+ */
1558
+ removeEventListener(type, listener, options) {
1559
+ this.e.removeEventListener(type, listener, options);
1560
+ }
1561
+ };
1562
+ function getRetryOrigins(origins) {
1563
+ if (origins.length === 0) return [];
1564
+ return [origins[0]].concat(shuffledCopy(origins.slice(1)));
1565
+ }
1566
+ function getRetryOriginIndex(attemptNumber, retryOrigins) {
1567
+ const retryOriginsLength = retryOrigins.length;
1568
+ if (retryOriginsLength === 0) return -1;
1569
+ if (attemptNumber <= 2 || retryOriginsLength === 1) return 0;
1570
+ const fallbackCount = retryOriginsLength - 1;
1571
+ const fallbackAttempt = attemptNumber - 2;
1572
+ if (fallbackAttempt <= fallbackCount) return fallbackAttempt;
1573
+ return 1 + Math.floor(Math.random() * fallbackCount);
1574
+ }
1575
+ function getRetrySrc(src, nextOrigin, retryCount) {
1576
+ const srcOrigin = originOf(src);
1577
+ const normalizedNextOrigin = originOf(nextOrigin);
1578
+ let pathAndQuery = stringHasPrefix(src, srcOrigin) ? src.slice(srcOrigin.length) : src;
1579
+ if (pathAndQuery.length === 0) pathAndQuery = "/";
1580
+ else if (!stringHasPrefix(pathAndQuery, "/")) pathAndQuery = "/" + pathAndQuery;
1581
+ const separator = pathAndQuery.indexOf("?") === -1 ? "?" : "&";
1582
+ return normalizedNextOrigin + pathAndQuery + separator + "retry=" + retryCount;
1583
+ }
1584
+ var agentEndpoint = "/api/v2/captcha/agent";
1585
+ var widgetEndpoint = "/api/v2/captcha/widget";
1586
+ var FRAME_ID_DATASET_FIELD2 = "FrcFrameId";
1587
+ var AGENT_ORIGIN_KEY_DATASET_FIELD = "FrcAgentOriginKey";
1588
+ var IFRAME_EXP_TIME = 1e3 * 60 * 60 * 36;
1589
+ var MAX_IFRAME_LOAD_ATTEMPTS = 5;
1590
+ var cbus;
1591
+ var sdkC = 0;
1592
+ var FriendlyCaptchaSDK = class {
1593
+ constructor(opts = {}) {
1594
+ /**
1595
+ * Multiple agents may be running at the same time, this is the case if someone uses widgets with different endpoints on a single page.
1596
+ * This is a mapping from the origin to the IFrame.
1597
+ */
1598
+ this.agents = /* @__PURE__ */ new Map();
1599
+ /**
1600
+ * A mapping from the agent ID to its local state.
1601
+ */
1602
+ this.agentState = /* @__PURE__ */ new Map();
1603
+ /**
1604
+ * Mapping of widget ID to the widget handle.
1605
+ */
1606
+ this.widgets = /* @__PURE__ */ new Map();
1607
+ this._attached = flatPromise();
1608
+ /**
1609
+ * A promise that resolves to all the widgets that are currently attached.
1610
+ * @public
1611
+ */
1612
+ this.attached = this._attached.promise;
1613
+ /**
1614
+ * A mapping of random IDs to promises that resolve to a risk intelligence
1615
+ * token generation response. Each call to `riskIntelligence()` will return
1616
+ * a promise that gets a unique ID. The mapping is used for tying the agent
1617
+ * message to its reply.
1618
+ */
1619
+ this.riskIntelligencePromises = /* @__PURE__ */ new Map();
1620
+ /**
1621
+ * A mapping of random IDs to promises that resolve when a risk intelligence
1622
+ * clear request completes. Each call to `clearRiskIntelligence()` will return
1623
+ * a promise that gets a unique ID. The mapping is used for tying the agent message
1624
+ * to its reply.
1625
+ */
1626
+ this.clearRiskIntelligencePromises = /* @__PURE__ */ new Map();
1627
+ /**
1628
+ * A list of handles (objects that manage a Risk Intelligence DOM element)
1629
+ * associated with the SDK instance.
1630
+ */
1631
+ this.riskIntelligenceHandles = [];
1632
+ this.apiEndpoint = opts.apiEndpoint;
1633
+ cbus = cbus || new CommunicationBus();
1634
+ cbus.listen((msg) => this.onReceiveMessage(msg));
1635
+ this.bus = cbus;
1636
+ sdkC++;
1637
+ if (sdkC > 1) console.warn("Multiple Friendly Captcha SDKs created, this is not recommended. Please use a single SDK instance.");
1638
+ this.signals = getSignals({ disableEvalPatching: opts.disableEvalPatching || getSDKDisableEvalPatching() });
1639
+ if (opts.startAgent) {
1640
+ const origins = resolveAPIOrigins(this.apiEndpoint || getSDKAPIEndpoint());
1641
+ const retryOrigins = this.getRetryOrigins(origins);
1642
+ this.ensureAgentIFrame(retryOrigins);
1643
+ }
1644
+ this.setupPeriodicRefresh();
1645
+ }
1646
+ getRetryOrigins(origins) {
1647
+ return getRetryOrigins(origins);
1648
+ }
1649
+ onReceiveMessage(msg) {
1650
+ if (msg.type === "root_set_response") {
1651
+ const w = this.widgets.get(msg.widget_id);
1652
+ if (!w) {
1653
+ if (sdkC === 1) console.warn(`Received set response message for widget ${msg.widget_id} that doesn't exist`);
1654
+ return;
1655
+ }
1656
+ w.setState(msg);
1657
+ } else if (stringHasPrefix(msg.type, "root_store")) this.handleStoreMessage(msg);
1658
+ else if (msg.type === "root_signals_get") this.handleSignalsGetMessage(msg);
1659
+ else if (msg.type === "widget_language_change") this.handleWidgetLanguageChange(msg);
1660
+ else if (msg.type === "widget_reset") {
1661
+ const w = this.widgets.get(msg.from_id);
1662
+ if (!w) {
1663
+ if (sdkC === 1) console.warn(`Received reset message for widget ${msg.from_id} that doesn't exist`);
1664
+ return;
1665
+ }
1666
+ w.reset({ trigger: "widget" });
1667
+ } else if (stringHasPrefix(msg.type, "root_risk_intelligence")) this.handleRiskIntelligenceMessage(msg);
1668
+ }
1669
+ handleRiskIntelligenceMessage(msg) {
1670
+ if (msg.type === "root_risk_intelligence_generate_reply") {
1671
+ const promise = this.riskIntelligencePromises.get(msg.uid);
1672
+ if (promise) {
1673
+ if (msg.data) promise.resolve(msg.data);
1674
+ else if (msg.error) promise.reject(msg.error);
1675
+ else console.warn("Received risk intelligence generate reply message with no data");
1676
+ this.riskIntelligencePromises.delete(msg.uid);
1677
+ } else console.warn("Received risk intelligence generate reply message with no promise to resolve");
1678
+ } else if (msg.type === "root_risk_intelligence_clear_reply") {
1679
+ const promise = this.clearRiskIntelligencePromises.get(msg.uid);
1680
+ if (promise) if (msg.error) promise.reject(msg.error);
1681
+ else promise.resolve();
1682
+ else console.warn("Received risk intelligence clear reply message with no promise to resolve");
1683
+ this.clearRiskIntelligencePromises.delete(msg.uid);
1684
+ }
1685
+ }
1686
+ handleWidgetLanguageChange(msg) {
1687
+ const w = this.widgets.get(msg.from_id);
1688
+ if (!w) {
1689
+ if (sdkC === 1) console.warn(`Received language change message for widget ${msg.from_id} that doesn't exist`);
1690
+ return;
1691
+ }
1692
+ const element = w.getElement();
1693
+ const iframe = element.querySelector("iframe");
1694
+ if (iframe) iframe.title = getLocalizedWidgetTitle(msg.language);
1695
+ const banner = element.querySelector(".frc-banner");
1696
+ if (banner) {
1697
+ const bs = banner.style;
1698
+ if (isRTLLanguage(msg.language)) {
1699
+ bs.left = "6px";
1700
+ bs.right = "auto";
1701
+ } else {
1702
+ bs.left = "auto";
1703
+ bs.right = "6px";
1704
+ }
1705
+ }
1706
+ }
1707
+ handleSignalsGetMessage(msg) {
1708
+ const sigs = this.signals.get(msg.widget_id);
1709
+ this.bus.send({
1710
+ type: "root_signals_get_reply",
1711
+ from_id: "",
1712
+ to_id: msg.from_id,
1713
+ _frc: 1,
1714
+ rid: msg.rid,
1715
+ value: sigs
1716
+ });
1717
+ }
1718
+ handleStoreMessage(msg) {
1719
+ const from = msg.from_id;
1720
+ const s = this.agentState.get(from);
1721
+ if (!s) {
1722
+ console.error(`Store not found ${from}`);
1723
+ return;
1724
+ }
1725
+ if (msg.type === "root_store_get") this.bus.send({
1726
+ type: "root_store_get_reply",
1727
+ from_id: "",
1728
+ to_id: from,
1729
+ _frc: 1,
1730
+ rid: msg.rid,
1731
+ value: s.store.get(msg.key),
1732
+ sa: true
1733
+ });
1734
+ else if (msg.type === "root_store_set") {
1735
+ s.store.set(msg.key, msg.value);
1736
+ this.bus.send({
1737
+ type: "root_store_set_reply",
1738
+ from_id: "",
1739
+ to_id: from,
1740
+ _frc: 1,
1741
+ rid: msg.rid,
1742
+ sa: true
1743
+ });
1744
+ }
1745
+ }
1746
+ /**
1747
+ * Ensures an agent iframe exists for the configured primary origin in `retryOrigins`.
1748
+ *
1749
+ * Reuses an existing iframe when possible (within this SDK instance and across SDK
1750
+ * instances on the same page), otherwise creates and registers a new one with retry
1751
+ * failover across `retryOrigins`.
1752
+ *
1753
+ * @param retryOrigins - Ordered retry origins with the primary origin at index 0.
1754
+ * @returns String - The agent ID for the reused or newly created iframe.
1755
+ */
1756
+ ensureAgentIFrame(retryOrigins) {
1757
+ let attempt = 1;
1758
+ const origin = retryOrigins[getRetryOriginIndex(attempt, retryOrigins)];
1759
+ const src = origin + agentEndpoint;
1760
+ const maxAttempts = MAX_IFRAME_LOAD_ATTEMPTS;
1761
+ const existing = this.agents.get(origin);
1762
+ if (existing && existing.dataset[FRAME_ID_DATASET_FIELD2]) return existing.dataset[FRAME_ID_DATASET_FIELD2];
1763
+ let agentIFrames = document.getElementsByClassName(AGENT_FRAME_CLASSNAME);
1764
+ for (let index = 0; index < agentIFrames.length; index++) {
1765
+ const i = agentIFrames[index];
1766
+ if (i.dataset[AGENT_ORIGIN_KEY_DATASET_FIELD] === origin && i.dataset[FRAME_ID_DATASET_FIELD2]) {
1767
+ this.agents.set(origin, i);
1768
+ return i.dataset[FRAME_ID_DATASET_FIELD2];
1769
+ }
1770
+ }
1771
+ const agentId = "a_" + randomId(12);
1772
+ const el = createAgentIFrame(this, agentId, src);
1773
+ el.dataset[AGENT_ORIGIN_KEY_DATASET_FIELD] = origin;
1774
+ const initialSrc = el.src;
1775
+ let currentOrigin = origin;
1776
+ this.agents.set(origin, el);
1777
+ this.agentState.set(agentId, {
1778
+ store: new Store(origin),
1779
+ origin
1780
+ });
1781
+ document.body.appendChild(el);
1782
+ const registerWithRetry = () => {
1783
+ this.bus.registerTargetIFrame("agent", agentId, el, this.getRetryTimeout(attempt)).then((status) => {
1784
+ if (status === "timeout") {
1785
+ if (attempt >= maxAttempts) {
1786
+ console.error(`[Friendly Captcha] Failed to load agent iframe after ${attempt - 1} retries.`);
1787
+ el.remove();
1788
+ this.agents.delete(origin);
1789
+ return;
1790
+ }
1791
+ const nextAttempt = attempt + 1;
1792
+ currentOrigin = retryOrigins[getRetryOriginIndex(nextAttempt, retryOrigins)] || currentOrigin;
1793
+ console.warn("[Friendly Captcha] Retrying agent iframe load.");
1794
+ el.src = getRetrySrc(initialSrc, currentOrigin, nextAttempt - 1);
1795
+ attempt = nextAttempt;
1796
+ registerWithRetry();
1797
+ }
1798
+ });
1799
+ };
1800
+ registerWithRetry();
1801
+ return agentId;
1802
+ }
1803
+ /**
1804
+ * @internal
1805
+ */
1806
+ setupPeriodicRefresh() {
1807
+ let count = 1;
1808
+ setInterval(() => {
1809
+ const e = "&expire=" + count++;
1810
+ this.agents.forEach((el, origin) => {
1811
+ el.src += e;
1812
+ });
1813
+ this.widgets.forEach((w, id) => {
1814
+ const iframe = w.getElement().querySelector("iframe");
1815
+ iframe.src += e;
1816
+ });
1817
+ }, IFRAME_EXP_TIME);
1818
+ }
1819
+ /**
1820
+ * @internal
1821
+ */
1822
+ getRetryTimeout(retryLoadCounter) {
1823
+ return (1.5 + Math.pow(retryLoadCounter, 1.8)) * 1e3;
1824
+ }
1825
+ /**
1826
+ * Attaches a widget to given element or elements if they are not attached to yet.
1827
+ *
1828
+ * You can pass one or more HTML elements to attach to, or undefined. If `undefined` is passed, the HTML page is scanned
1829
+ * for unattached widget elements (= elements with the `frc-captcha` class).
1830
+ *
1831
+ * Returns handles to the newly-attached elements.
1832
+ * @public
1833
+ */
1834
+ attach(elements) {
1835
+ const [captchaElements, riskIntelligenceElements] = findFRCElements();
1836
+ for (let index = 0; index < riskIntelligenceElements.length; index++) {
1837
+ const hElement = riskIntelligenceElements[index];
1838
+ if (hElement && !hElement.frcRiskIntelligence) {
1839
+ const ds = hElement.dataset;
1840
+ const sitekey = ds.sitekey;
1841
+ if (!sitekey) {
1842
+ console.warn("Risk Intelligence <div> found with no sitekey, skipping...", hElement);
1843
+ continue;
1844
+ }
1845
+ this.riskIntelligenceHandles.push(new RiskIntelligenceHandle({
1846
+ element: hElement,
1847
+ formFieldName: ds.formFieldName,
1848
+ startMode: ds.start,
1849
+ riskIntelligence: () => {
1850
+ return this.riskIntelligence({
1851
+ sitekey,
1852
+ apiEndpoint: ds.apiEndpoint
1853
+ });
1854
+ }
1855
+ }));
1856
+ }
1857
+ }
1858
+ if (elements === void 0) elements = captchaElements;
1859
+ if (!(Array.isArray(elements) || elements instanceof NodeList)) elements = [elements];
1860
+ const newWidgets = [];
1861
+ for (let index = 0; index < elements.length; index++) {
1862
+ const hElement = elements[index];
1863
+ if (hElement && !hElement.frcWidget) {
1864
+ const ds = hElement.dataset;
1865
+ const opts = {
1866
+ element: hElement,
1867
+ sitekey: ds.sitekey,
1868
+ formFieldName: ds.formFieldName,
1869
+ apiEndpoint: ds.apiEndpoint,
1870
+ language: ds.lang,
1871
+ theme: ds.theme,
1872
+ startMode: ds.start
1873
+ };
1874
+ newWidgets.push(this.createWidget(opts));
1875
+ }
1876
+ }
1877
+ const allWidgets = this.getAllWidgets();
1878
+ this._attached.resolve(allWidgets);
1879
+ this.attached = Promise.resolve(allWidgets);
1880
+ return newWidgets;
1881
+ }
1882
+ /**
1883
+ * Creates a Friendly Captcha widget with given options under given HTML element.
1884
+ * @public
1885
+ */
1886
+ createWidget(opts) {
1887
+ const origins = resolveAPIOrigins(opts.apiEndpoint || this.apiEndpoint || getSDKAPIEndpoint());
1888
+ const retryOrigins = this.getRetryOrigins(origins);
1889
+ let attempt = 1;
1890
+ this.bus.addOrigins(origins);
1891
+ const origin = retryOrigins[getRetryOriginIndex(attempt, retryOrigins)] || origins[0];
1892
+ const agentId = this.ensureAgentIFrame(retryOrigins);
1893
+ const widgetId = "w_" + randomId(12);
1894
+ const send = (msg) => {
1895
+ const msgToSend = {
1896
+ from_id: widgetId,
1897
+ to_id: agentId,
1898
+ _frc: 1
1899
+ };
1900
+ this.bus.send(mergeObject(msgToSend, msg));
1901
+ };
1902
+ const callbacks = {
1903
+ onDestroy: () => {
1904
+ send({ type: "root_destroy_widget" });
1905
+ this.bus.removeTarget(widgetId);
1906
+ this.widgets.delete(widgetId);
1907
+ opts.element.innerHTML = "";
1908
+ removeWidgetRootStyles(opts.element);
1909
+ },
1910
+ onReset: () => {
1911
+ send({ type: "root_reset_widget" });
1912
+ },
1913
+ onTrigger: (data) => {
1914
+ send({
1915
+ type: "root_trigger_widget",
1916
+ trigger: data.trigger
1917
+ });
1918
+ }
1919
+ };
1920
+ const registered = flatPromise();
1921
+ const widgetHandle = new WidgetHandle({
1922
+ id: widgetId,
1923
+ createOpts: opts,
1924
+ callbacks,
1925
+ registered: registered.promise
1926
+ });
1927
+ this.widgets.set(widgetId, widgetHandle);
1928
+ const wel = createWidgetIFrame(agentId, widgetId, origin + widgetEndpoint, opts);
1929
+ const maxAttempts = MAX_IFRAME_LOAD_ATTEMPTS;
1930
+ const initialSrc = wel.src;
1931
+ let currentOrigin = origin;
1932
+ const widgetPlaceholder = createWidgetPlaceholder(opts);
1933
+ setWidgetRootStyles(opts.element);
1934
+ createBanner(opts);
1935
+ let language = getLanguageFromOptionsOrParent(opts);
1936
+ if (isRTLLanguage(language)) opts.element.dir = "rtl";
1937
+ const widgetPlaceholderStyle = widgetPlaceholder.style;
1938
+ widgetPlaceholder.textContent = getLocalizedPlaceholderText(language, "connecting");
1939
+ function setUnreachableState(detail) {
1940
+ const debugString = encodeStringToBase64Url(JSON.stringify({
1941
+ sdk_v: "1.0.0",
1942
+ sitekey: opts.sitekey || "",
1943
+ retry: attempt + "",
1944
+ endpoint: currentOrigin,
1945
+ ua: navigator.userAgent,
1946
+ tz: tz() || ""
1947
+ }));
1948
+ let resp = ".ERROR.UNREACHABLE";
1949
+ if (debugString) resp += "~" + debugString;
1950
+ widgetHandle.setState({
1951
+ state: "error",
1952
+ response: resp,
1953
+ error: {
1954
+ code: "network_error",
1955
+ detail
1956
+ }
1957
+ });
1958
+ }
1959
+ const registerWithRetry = () => {
1960
+ this.bus.registerTargetIFrame("widget", widgetId, wel, this.getRetryTimeout(attempt)).then((status) => {
1961
+ if (status === "timeout") {
1962
+ if (attempt >= maxAttempts) {
1963
+ console.error(`[Friendly Captcha] Failed to load widget iframe after ${attempt - 1} retries.`);
1964
+ setUnreachableState("Widget load timeout, stopped retrying");
1965
+ widgetPlaceholderStyle.borderColor = "#f00";
1966
+ widgetPlaceholderStyle.fontSize = "12px";
1967
+ createFallback(widgetPlaceholder, originOf(wel.src), language);
1968
+ return;
1969
+ }
1970
+ const nextAttempt = attempt + 1;
1971
+ currentOrigin = retryOrigins[getRetryOriginIndex(nextAttempt, retryOrigins)] || currentOrigin;
1972
+ widgetPlaceholderStyle.backgroundColor = "#fee";
1973
+ widgetPlaceholderStyle.color = "#222";
1974
+ widgetPlaceholder.textContent = getLocalizedPlaceholderText(language, "retrying") + ` (${attempt})`;
1975
+ console.warn(`[Friendly Captcha] Retrying widget ${widgetId} iframe load.`);
1976
+ setUnreachableState("Widget load timeout, will retry");
1977
+ wel.src = getRetrySrc(initialSrc, currentOrigin, nextAttempt - 1);
1978
+ attempt = nextAttempt;
1979
+ registerWithRetry();
1980
+ } else if (status === "registered") {
1981
+ opts.element.removeChild(widgetPlaceholder);
1982
+ wel.style.display = "";
1983
+ }
1984
+ });
1985
+ };
1986
+ registerWithRetry();
1987
+ registered.resolve();
1988
+ return widgetHandle;
1989
+ }
1990
+ /**
1991
+ * Creates a Risk Intelligence token generation request, returning a Promise that resolves
1992
+ * to the generated token.
1993
+ *
1994
+ * @public
1995
+ */
1996
+ riskIntelligence(opts) {
1997
+ const origins = resolveAPIOrigins(opts.apiEndpoint || this.apiEndpoint || getSDKAPIEndpoint());
1998
+ const retryOrigins = this.getRetryOrigins(origins);
1999
+ this.bus.addOrigins(origins);
2000
+ const agentId = this.ensureAgentIFrame(retryOrigins);
2001
+ const uid = randomId(8);
2002
+ this.bus.send({
2003
+ type: "root_risk_intelligence_generate",
2004
+ to_id: agentId,
2005
+ from_id: "",
2006
+ _frc: 1,
2007
+ sitekey: opts.sitekey,
2008
+ bypassCache: opts.bypassCache || false,
2009
+ uid
2010
+ });
2011
+ const riskIntelligencePromise = flatPromise();
2012
+ this.riskIntelligencePromises.set(uid, riskIntelligencePromise);
2013
+ return riskIntelligencePromise.promise;
2014
+ }
2015
+ /**
2016
+ * Clears cached Risk Intelligence tokens. Cached tokens for a given sitekey can be cleared
2017
+ * by specifying it; if a sitekey is not specified, all tokens will be cleared from the cache.
2018
+ *
2019
+ * @public
2020
+ */
2021
+ clearRiskIntelligence(opts) {
2022
+ const origins = resolveAPIOrigins((opts == null ? void 0 : opts.apiEndpoint) || this.apiEndpoint || getSDKAPIEndpoint());
2023
+ const retryOrigins = this.getRetryOrigins(origins);
2024
+ this.bus.addOrigins(origins);
2025
+ const agentId = this.ensureAgentIFrame(retryOrigins);
2026
+ const uid = randomId(8);
2027
+ this.bus.send({
2028
+ type: "root_risk_intelligence_clear",
2029
+ to_id: agentId,
2030
+ from_id: "",
2031
+ _frc: 1,
2032
+ sitekey: opts == null ? void 0 : opts.sitekey,
2033
+ uid
2034
+ });
2035
+ const clearRiskIntelligencePromise = flatPromise();
2036
+ this.clearRiskIntelligencePromises.set(uid, clearRiskIntelligencePromise);
2037
+ return clearRiskIntelligencePromise.promise;
2038
+ }
2039
+ /**
2040
+ * Returns all current widgets known about (in an unspecified order).
2041
+ * @public
2042
+ */
2043
+ getAllWidgets() {
2044
+ const out = [];
2045
+ this.widgets.forEach((w) => {
2046
+ out.push(w);
2047
+ });
2048
+ return out;
2049
+ }
2050
+ /**
2051
+ * Retrieves a widget by its widget ID.
2052
+ * @public
2053
+ */
2054
+ getWidgetById(id) {
2055
+ return this.widgets.get(id);
2056
+ }
2057
+ /**
2058
+ * Returns all current Risk Intelligence handles known about (in an unspecified order).
2059
+ * @public
2060
+ */
2061
+ getAllRiskIntelligenceHandles() {
2062
+ const out = [];
2063
+ this.riskIntelligenceHandles.forEach((rih) => {
2064
+ out.push(rih);
2065
+ });
2066
+ return out;
2067
+ }
2068
+ /**
2069
+ * Completely remove all widgets and background agents related to the SDK on this page.
2070
+ * @public
2071
+ */
2072
+ clear() {
2073
+ this.widgets.forEach((w) => {
2074
+ w.destroy();
2075
+ });
2076
+ this.agents.forEach((el) => {
2077
+ el.remove();
2078
+ });
2079
+ this.agents.clear();
2080
+ }
2081
+ };
2082
+ var FRCWidgetStateChangeEventName = "frc:widget.statechange";
2083
+ var FRCWidgetCompleteEventName = "frc:widget.complete";
2084
+ var FRCWidgetExpireEventName = "frc:widget.expire";
2085
+ var FRCWidgetErrorEventName = "frc:widget.error";
2086
+ var FRCWidgetResetEventName = "frc:widget.reset";
2087
+ var FRCRiskIntelligenceCompleteEventName = "frc:riskintelligence.complete";
2088
+ var FRCRiskIntelligenceErrorEventName = "frc:riskintelligence.error";
2089
+ var FRCRiskIntelligenceExpireEventName = "frc:riskintelligence.expire";
2090
+ /*!
2091
+ * Copyright (c) Friendly Captcha GmbH 2023.
2092
+ * This Source Code Form is subject to the terms of the Mozilla Public
2093
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
2094
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
2095
+ */
2096
+ /*!
2097
+ * Copyright (c) Friendly Captcha GmbH 2026.
2098
+ * This Source Code Form is subject to the terms of the Mozilla Public
2099
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
2100
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
2101
+ */
2102
+ //#endregion
2103
+ export { FRCRiskIntelligenceCompleteEventName, FRCRiskIntelligenceErrorEventName, FRCRiskIntelligenceExpireEventName, FRCWidgetCompleteEventName, FRCWidgetErrorEventName, FRCWidgetExpireEventName, FRCWidgetResetEventName, FRCWidgetStateChangeEventName, FriendlyCaptchaSDK };