@verbb/formie-browser 1.0.12 → 1.0.14

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 (383) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/chunks/{address-country-Rx6GQTND.js → address-country-Dn71jroa.js} +10 -4
  3. package/dist/chunks/{address-finder-k7_BXaRe.js → address-finder-O49uDRoR.js} +2 -2
  4. package/dist/chunks/{address-state-BwE01m2_.js → address-state-ByYatUur.js} +154 -143
  5. package/dist/chunks/{api-DqpfkZWL.js → api-D6kJ7kXZ.js} +183 -179
  6. package/dist/chunks/{api-BUb6P-xu.js → api-DYYsVIub.js} +77 -47
  7. package/dist/chunks/{api-sPqGbOww.js → api-ghNr2uxX.js} +15 -9
  8. package/dist/chunks/{bpoint-Dlq34XH1.js → bpoint-D0RKFM4F.js} +3 -3
  9. package/dist/chunks/calculations-YEoVCG2q.js +310 -0
  10. package/dist/chunks/{captcha-eu-CGm8Lbrj.js → captcha-eu-DERJbXnH.js} +5 -4
  11. package/dist/chunks/{checkbox-radio-BY2aTCOG.js → checkbox-radio-gsm8QPJg.js} +74 -75
  12. package/dist/chunks/{combobox-C0EuExSI.js → combobox-CWNdx4Fk.js} +290 -279
  13. package/dist/chunks/conditions-DqNHLTbN.js +464 -0
  14. package/dist/chunks/country-from-ip-DDj_mFki.js +29 -0
  15. package/dist/chunks/csrf-DxHg_ZYt.js +61 -0
  16. package/dist/chunks/{custom-google-maps-BsaSirEZ.js → custom-google-maps-C4l2S3GO.js} +9 -3
  17. package/dist/chunks/{custom-link-CJ1-FjEM.js → custom-link-CLazgKYH.js} +8 -2
  18. package/dist/chunks/{custom-maps-DYW_pBid.js → custom-maps-DqcAlD0v.js} +10 -4
  19. package/dist/chunks/{date-picker-5CA_-zGb.js → date-picker-RUnevF7l.js} +456 -430
  20. package/dist/chunks/{dist-BdUy8m_p.js → dist-ZLeW0zZ3.js} +1280 -452
  21. package/dist/chunks/{eway-D9_m8ooj.js → eway-or6dtjoT.js} +3 -3
  22. package/dist/chunks/field-references.resolver-Ca8MguFv.js +104 -0
  23. package/dist/chunks/{file-upload-rqfZNqlH.js → file-upload-Bm-TXyNB.js} +104 -96
  24. package/dist/chunks/friendly-captcha-v1-GFqCt1Mh.js +34 -0
  25. package/dist/chunks/{friendly-captcha-v2-CLSAbkqx.js → friendly-captcha-v2-WoW246JG.js} +6 -5
  26. package/dist/chunks/{friendly-challenge-8uPatWqk.js → friendly-challenge-DPG9MJb1.js} +111 -102
  27. package/dist/chunks/{go-cardless-DAT3ZaQf.js → go-cardless-DzJ-0FKg.js} +2 -2
  28. package/dist/chunks/google-address-C1P1nTDM.js +163 -0
  29. package/dist/chunks/{hcaptcha-CGLAmgjO.js → hcaptcha-D0T8aIHz.js} +3 -3
  30. package/dist/chunks/{hidden-D7_Ch-QN.js → hidden-BZhXnNPe.js} +8 -2
  31. package/dist/chunks/http-C2QdHuWO.js +27 -0
  32. package/dist/chunks/{leaflet-src-j-lHNmhR.js → leaflet-src-DE6rv6M-.js} +42 -46
  33. package/dist/chunks/{loqate-CJPzBmSm.js → loqate-DD1S7PY9.js} +2 -2
  34. package/dist/chunks/{mollie-Bibhl67p.js → mollie-DG8Ju83x.js} +2 -2
  35. package/dist/chunks/{moneris-H2wSqk9h.js → moneris-C8m3Fvqu.js} +3 -3
  36. package/dist/chunks/opayo-B3EvrVxw.js +188 -0
  37. package/dist/chunks/{paddle-DkvIxQdG.js → paddle-BIYR9Um3.js} +3 -3
  38. package/dist/chunks/{password-validation-T0vDQPCr.js → password-validation-C8_uO_c_.js} +18 -12
  39. package/dist/chunks/{paypal-CQpAF7Ua.js → paypal-B_yxIo2d.js} +7 -5
  40. package/dist/chunks/{payway-CwDkC7YZ.js → payway-CeOzS0sL.js} +3 -3
  41. package/dist/chunks/{phone-country-D3ayr60L.js → phone-country-bAqje17P.js} +80 -63
  42. package/dist/chunks/{place-kit-BGHklIZ-.js → place-kit-BE5gi3vo.js} +3 -3
  43. package/dist/chunks/{placekit-autocomplete.esm-DWVabQlq.js → placekit-autocomplete.esm-CZZERYur.js} +11 -15
  44. package/dist/chunks/{recaptcha-enterprise-XPId5-bS.js → recaptcha-enterprise-CruXddZq.js} +4 -4
  45. package/dist/chunks/{recaptcha-shared-CLYJvojk.js → recaptcha-shared-AQRMDMme.js} +1 -1
  46. package/dist/chunks/{recaptcha-v2-checkbox-Cy-0PEPc.js → recaptcha-v2-checkbox-CCnJYCnG.js} +4 -4
  47. package/dist/chunks/{recaptcha-v2-invisible-BwRH540O.js → recaptcha-v2-invisible-BuVqRRYn.js} +4 -4
  48. package/dist/chunks/{recaptcha-v3-No4Ykrhk.js → recaptcha-v3-CloqhO2A.js} +4 -4
  49. package/dist/chunks/{repeater-BVnPUqTj.js → repeater-DwE27jI1.js} +25 -19
  50. package/dist/chunks/request-profile-DhwkeCpS.js +10 -0
  51. package/dist/chunks/rich-text-uV4o_pGk.js +361 -0
  52. package/dist/chunks/{chunk-3b4jIN3o.js → rolldown-runtime-DtPi1Y-2.js} +2 -2
  53. package/dist/chunks/{sdk-BhHAYgga.js → sdk-lkwSvlpM.js} +282 -234
  54. package/dist/chunks/{shared-Bx9s0i0P.js → shared-OKhSay59.js} +27 -21
  55. package/dist/chunks/{signature-xz4QO7CR.js → signature-7cldFbqj.js} +160 -112
  56. package/dist/chunks/{snaptcha-DKx98oon.js → snaptcha-C04kNGYQ.js} +2 -2
  57. package/dist/chunks/{square-DwdcOI1G.js → square-DEzxv9D9.js} +8 -6
  58. package/dist/chunks/{stripe-DaoG2FT1.js → stripe-CVPQGDz3.js} +10 -11
  59. package/dist/chunks/{summary-Dks0gXS3.js → summary-BF_8mrXI.js} +47 -45
  60. package/dist/chunks/{survey-likert-DkE6bR7B.js → survey-likert-fk1hUPff.js} +7 -1
  61. package/dist/chunks/{survey-rank-DN6x4IZM.js → survey-rank-BsLGl2LX.js} +37 -25
  62. package/dist/chunks/{survey-rating-BnsNL9U5.js → survey-rating-DVS6e6fM.js} +17 -5
  63. package/dist/chunks/{table-CAjCJHrL.js → table-DnIBdeKF.js} +21 -15
  64. package/dist/chunks/{text-limit-Bn18WrPU.js → text-limit-LGMPhFuC.js} +40 -34
  65. package/dist/chunks/{theme-classes-Tv7q7ToE.js → theme-classes-DAQuEqdP.js} +1 -1
  66. package/dist/chunks/{turnstile-DJakPzQD.js → turnstile-n9DNyPxi.js} +3 -3
  67. package/dist/chunks/{upload-manager-W-QDgxKD.js → upload-manager-BbiUosZq.js} +410 -350
  68. package/dist/chunks/{utils-Vqp8i_RM.js → utils-DpUBPadZ.js} +20 -14
  69. package/dist/css/formie-base.css +104 -1
  70. package/dist/css/theme/_messages.css +2 -0
  71. package/dist/css/theme/_tokens.css +31 -25
  72. package/dist/css/theme/fields/_signature.css +2 -1
  73. package/dist/css/theme/forms/_form.css +5 -1
  74. package/dist/index.d.ts +5 -4
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.js +1778 -1425
  77. package/dist/js/contracts/client.d.ts +5 -3
  78. package/dist/js/contracts/client.d.ts.map +1 -1
  79. package/dist/js/contracts/common.d.ts +2 -2
  80. package/dist/js/contracts/common.d.ts.map +1 -1
  81. package/dist/js/contracts/modules.d.ts +37 -12
  82. package/dist/js/contracts/modules.d.ts.map +1 -1
  83. package/dist/js/contracts/schema.d.ts +20 -38
  84. package/dist/js/contracts/schema.d.ts.map +1 -1
  85. package/dist/js/contracts/theme.d.ts +4 -1
  86. package/dist/js/contracts/theme.d.ts.map +1 -1
  87. package/dist/js/core/client-rendered-modules.d.ts +17 -0
  88. package/dist/js/core/client-rendered-modules.d.ts.map +1 -0
  89. package/dist/js/core/create-formie-client.d.ts.map +1 -1
  90. package/dist/js/core/field-error-aria.d.ts +23 -0
  91. package/dist/js/core/field-error-aria.d.ts.map +1 -0
  92. package/dist/js/core/hydrate-modules.d.ts +10 -8
  93. package/dist/js/core/hydrate-modules.d.ts.map +1 -1
  94. package/dist/js/core/submit-result-state.d.ts.map +1 -1
  95. package/dist/js/core/submit-result-ui.d.ts.map +1 -1
  96. package/dist/js/core/validation-focus.d.ts.map +1 -1
  97. package/dist/js/modules/address/address-finder.d.ts +1 -1
  98. package/dist/js/modules/address/address-finder.d.ts.map +1 -1
  99. package/dist/js/modules/address/factories.d.ts +3 -3
  100. package/dist/js/modules/address/factories.d.ts.map +1 -1
  101. package/dist/js/modules/address/google-address.d.ts +2 -1
  102. package/dist/js/modules/address/google-address.d.ts.map +1 -1
  103. package/dist/js/modules/address/index.d.ts +2 -2
  104. package/dist/js/modules/address/index.d.ts.map +1 -1
  105. package/dist/js/modules/address/loqate.d.ts +1 -1
  106. package/dist/js/modules/address/loqate.d.ts.map +1 -1
  107. package/dist/js/modules/address/place-kit.d.ts +1 -1
  108. package/dist/js/modules/address/place-kit.d.ts.map +1 -1
  109. package/dist/js/modules/captchas/captcha-eu.d.ts +1 -1
  110. package/dist/js/modules/captchas/captcha-eu.d.ts.map +1 -1
  111. package/dist/js/modules/captchas/factories.d.ts +11 -11
  112. package/dist/js/modules/captchas/factories.d.ts.map +1 -1
  113. package/dist/js/modules/captchas/friendly-captcha-v1.d.ts +1 -1
  114. package/dist/js/modules/captchas/friendly-captcha-v1.d.ts.map +1 -1
  115. package/dist/js/modules/captchas/friendly-captcha-v2.d.ts +1 -1
  116. package/dist/js/modules/captchas/friendly-captcha-v2.d.ts.map +1 -1
  117. package/dist/js/modules/captchas/hcaptcha.d.ts +1 -1
  118. package/dist/js/modules/captchas/hcaptcha.d.ts.map +1 -1
  119. package/dist/js/modules/captchas/index.d.ts +2 -2
  120. package/dist/js/modules/captchas/index.d.ts.map +1 -1
  121. package/dist/js/modules/captchas/recaptcha-enterprise.d.ts +1 -1
  122. package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -1
  123. package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts +1 -1
  124. package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts.map +1 -1
  125. package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts +1 -1
  126. package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts.map +1 -1
  127. package/dist/js/modules/captchas/recaptcha-v3.d.ts +1 -1
  128. package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -1
  129. package/dist/js/modules/captchas/snaptcha.d.ts +1 -1
  130. package/dist/js/modules/captchas/snaptcha.d.ts.map +1 -1
  131. package/dist/js/modules/captchas/turnstile.d.ts +1 -1
  132. package/dist/js/modules/captchas/turnstile.d.ts.map +1 -1
  133. package/dist/js/modules/fields/address-country.d.ts +2 -2
  134. package/dist/js/modules/fields/address-country.d.ts.map +1 -1
  135. package/dist/js/modules/fields/address-state.d.ts +2 -2
  136. package/dist/js/modules/fields/address-state.d.ts.map +1 -1
  137. package/dist/js/modules/fields/calculations.d.ts +2 -2
  138. package/dist/js/modules/fields/calculations.d.ts.map +1 -1
  139. package/dist/js/modules/fields/checkbox-radio.d.ts +2 -2
  140. package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -1
  141. package/dist/js/modules/fields/combobox.d.ts +2 -2
  142. package/dist/js/modules/fields/combobox.d.ts.map +1 -1
  143. package/dist/js/modules/fields/conditions/config.d.ts.map +1 -1
  144. package/dist/js/modules/fields/conditions/effects.d.ts +1 -0
  145. package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -1
  146. package/dist/js/modules/fields/conditions/evaluator.d.ts +4 -1
  147. package/dist/js/modules/fields/conditions/evaluator.d.ts.map +1 -1
  148. package/dist/js/modules/fields/conditions/references.d.ts.map +1 -1
  149. package/dist/js/modules/fields/conditions/submission-context.d.ts +15 -0
  150. package/dist/js/modules/fields/conditions/submission-context.d.ts.map +1 -0
  151. package/dist/js/modules/fields/conditions/types.d.ts +3 -1
  152. package/dist/js/modules/fields/conditions/types.d.ts.map +1 -1
  153. package/dist/js/modules/fields/conditions/values.d.ts +1 -1
  154. package/dist/js/modules/fields/conditions/values.d.ts.map +1 -1
  155. package/dist/js/modules/fields/conditions.d.ts +2 -2
  156. package/dist/js/modules/fields/conditions.d.ts.map +1 -1
  157. package/dist/js/modules/fields/custom-google-maps.d.ts +2 -2
  158. package/dist/js/modules/fields/custom-google-maps.d.ts.map +1 -1
  159. package/dist/js/modules/fields/custom-link.d.ts +2 -2
  160. package/dist/js/modules/fields/custom-link.d.ts.map +1 -1
  161. package/dist/js/modules/fields/custom-maps.d.ts +2 -2
  162. package/dist/js/modules/fields/custom-maps.d.ts.map +1 -1
  163. package/dist/js/modules/fields/date-picker.d.ts +2 -2
  164. package/dist/js/modules/fields/date-picker.d.ts.map +1 -1
  165. package/dist/js/modules/fields/file-upload.d.ts +2 -2
  166. package/dist/js/modules/fields/file-upload.d.ts.map +1 -1
  167. package/dist/js/modules/fields/hidden.d.ts +2 -2
  168. package/dist/js/modules/fields/hidden.d.ts.map +1 -1
  169. package/dist/js/modules/fields/index.d.ts +2 -2
  170. package/dist/js/modules/fields/index.d.ts.map +1 -1
  171. package/dist/js/modules/fields/password-validation.d.ts +2 -2
  172. package/dist/js/modules/fields/password-validation.d.ts.map +1 -1
  173. package/dist/js/modules/fields/phone-country.d.ts +2 -2
  174. package/dist/js/modules/fields/phone-country.d.ts.map +1 -1
  175. package/dist/js/modules/fields/repeater.d.ts +2 -2
  176. package/dist/js/modules/fields/repeater.d.ts.map +1 -1
  177. package/dist/js/modules/fields/rich-text.d.ts +2 -2
  178. package/dist/js/modules/fields/rich-text.d.ts.map +1 -1
  179. package/dist/js/modules/fields/shared.d.ts +1 -0
  180. package/dist/js/modules/fields/shared.d.ts.map +1 -1
  181. package/dist/js/modules/fields/signature.d.ts +2 -2
  182. package/dist/js/modules/fields/signature.d.ts.map +1 -1
  183. package/dist/js/modules/fields/summary.d.ts +2 -2
  184. package/dist/js/modules/fields/summary.d.ts.map +1 -1
  185. package/dist/js/modules/fields/survey-likert.d.ts +2 -2
  186. package/dist/js/modules/fields/survey-likert.d.ts.map +1 -1
  187. package/dist/js/modules/fields/survey-rank.d.ts +2 -2
  188. package/dist/js/modules/fields/survey-rank.d.ts.map +1 -1
  189. package/dist/js/modules/fields/survey-rating.d.ts +2 -2
  190. package/dist/js/modules/fields/survey-rating.d.ts.map +1 -1
  191. package/dist/js/modules/fields/table.d.ts +2 -2
  192. package/dist/js/modules/fields/table.d.ts.map +1 -1
  193. package/dist/js/modules/fields/text-limit.d.ts +2 -2
  194. package/dist/js/modules/fields/text-limit.d.ts.map +1 -1
  195. package/dist/js/modules/fields/upload-manager.d.ts +2 -2
  196. package/dist/js/modules/fields/upload-manager.d.ts.map +1 -1
  197. package/dist/js/modules/loader.d.ts +10 -4
  198. package/dist/js/modules/loader.d.ts.map +1 -1
  199. package/dist/js/modules/payments/bpoint.d.ts +1 -1
  200. package/dist/js/modules/payments/bpoint.d.ts.map +1 -1
  201. package/dist/js/modules/payments/eway.d.ts +1 -1
  202. package/dist/js/modules/payments/eway.d.ts.map +1 -1
  203. package/dist/js/modules/payments/factories.d.ts +7 -7
  204. package/dist/js/modules/payments/factories.d.ts.map +1 -1
  205. package/dist/js/modules/payments/go-cardless.d.ts +1 -1
  206. package/dist/js/modules/payments/go-cardless.d.ts.map +1 -1
  207. package/dist/js/modules/payments/index.d.ts +2 -2
  208. package/dist/js/modules/payments/index.d.ts.map +1 -1
  209. package/dist/js/modules/payments/mollie.d.ts +1 -1
  210. package/dist/js/modules/payments/mollie.d.ts.map +1 -1
  211. package/dist/js/modules/payments/moneris.d.ts +1 -1
  212. package/dist/js/modules/payments/moneris.d.ts.map +1 -1
  213. package/dist/js/modules/payments/opayo.d.ts +1 -1
  214. package/dist/js/modules/payments/opayo.d.ts.map +1 -1
  215. package/dist/js/modules/payments/paddle.d.ts +1 -1
  216. package/dist/js/modules/payments/paddle.d.ts.map +1 -1
  217. package/dist/js/modules/payments/paypal.d.ts +1 -1
  218. package/dist/js/modules/payments/paypal.d.ts.map +1 -1
  219. package/dist/js/modules/payments/payway.d.ts +1 -1
  220. package/dist/js/modules/payments/payway.d.ts.map +1 -1
  221. package/dist/js/modules/payments/square.d.ts +1 -1
  222. package/dist/js/modules/payments/square.d.ts.map +1 -1
  223. package/dist/js/modules/payments/stripe.d.ts +1 -1
  224. package/dist/js/modules/payments/stripe.d.ts.map +1 -1
  225. package/dist/js/modules/payments/utils.d.ts +6 -0
  226. package/dist/js/modules/payments/utils.d.ts.map +1 -1
  227. package/dist/js/modules/registry.d.ts +6 -4
  228. package/dist/js/modules/registry.d.ts.map +1 -1
  229. package/dist/js/submit/pipeline.d.ts.map +1 -1
  230. package/dist/js/theme/browser-theme-state.generated.d.ts +24 -0
  231. package/dist/js/theme/browser-theme-state.generated.d.ts.map +1 -0
  232. package/dist/js/theme/theme-classes.d.ts +3 -3
  233. package/dist/js/theme/theme-classes.d.ts.map +1 -1
  234. package/dist/js/transport/forms-api.d.ts +5 -3
  235. package/dist/js/transport/forms-api.d.ts.map +1 -1
  236. package/dist/js/utils/country-from-ip.d.ts +2 -2
  237. package/dist/js/utils/country-from-ip.d.ts.map +1 -1
  238. package/dist/js/utils/csrf.d.ts +17 -0
  239. package/dist/js/utils/csrf.d.ts.map +1 -0
  240. package/dist/js/utils/field-references.parser.d.ts +1 -0
  241. package/dist/js/utils/field-references.parser.d.ts.map +1 -1
  242. package/dist/js/utils/field-references.resolver.d.ts.map +1 -1
  243. package/dist/js/utils/field-references.types.d.ts +1 -0
  244. package/dist/js/utils/field-references.types.d.ts.map +1 -1
  245. package/dist/js/utils/http.d.ts +3 -1
  246. package/dist/js/utils/http.d.ts.map +1 -1
  247. package/dist/js/utils/request-profile.d.ts +4 -0
  248. package/dist/js/utils/request-profile.d.ts.map +1 -0
  249. package/dist/js/utils/unload-warning.d.ts.map +1 -1
  250. package/dist/js/validation/rules/email.d.ts.map +1 -1
  251. package/dist/js/validation/rules/match.d.ts.map +1 -1
  252. package/dist/js/validation/rules/number.d.ts.map +1 -1
  253. package/dist/js/validation/rules/required.d.ts.map +1 -1
  254. package/dist/js/validation/rules/shared.d.ts.map +1 -1
  255. package/dist/js/validation/rules/url.d.ts.map +1 -1
  256. package/dist/js/validation/skip.d.ts +7 -0
  257. package/dist/js/validation/skip.d.ts.map +1 -0
  258. package/dist/js/validation/submit-readiness.d.ts.map +1 -1
  259. package/dist/js/validation/validator.d.ts.map +1 -1
  260. package/package.json +43 -12
  261. package/src/css/formie-base.css +104 -1
  262. package/src/css/theme/_messages.css +2 -0
  263. package/src/css/theme/_tokens.css +31 -25
  264. package/src/css/theme/fields/_signature.css +2 -1
  265. package/src/css/theme/forms/_form.css +5 -1
  266. package/src/index.ts +13 -8
  267. package/src/js/contracts/client.ts +5 -3
  268. package/src/js/contracts/common.ts +5 -6
  269. package/src/js/contracts/modules.ts +41 -12
  270. package/src/js/contracts/schema.ts +21 -43
  271. package/src/js/contracts/theme.ts +6 -1
  272. package/src/js/core/client-rendered-modules.ts +69 -0
  273. package/src/js/core/create-formie-client.ts +119 -73
  274. package/src/js/core/field-error-aria.ts +93 -0
  275. package/src/js/core/hydrate-modules.ts +54 -29
  276. package/src/js/core/submit-result-state.ts +34 -45
  277. package/src/js/core/submit-result-ui.ts +21 -65
  278. package/src/js/core/validation-focus.ts +20 -20
  279. package/src/js/modules/address/address-finder.ts +1 -1
  280. package/src/js/modules/address/factories.ts +15 -13
  281. package/src/js/modules/address/google-address.ts +10 -6
  282. package/src/js/modules/address/index.ts +2 -2
  283. package/src/js/modules/address/loqate.ts +1 -1
  284. package/src/js/modules/address/place-kit.ts +1 -1
  285. package/src/js/modules/captchas/captcha-eu.ts +2 -2
  286. package/src/js/modules/captchas/factories.ts +66 -42
  287. package/src/js/modules/captchas/friendly-captcha-v1.ts +12 -2
  288. package/src/js/modules/captchas/friendly-captcha-v2.ts +4 -2
  289. package/src/js/modules/captchas/hcaptcha.ts +5 -5
  290. package/src/js/modules/captchas/index.ts +2 -2
  291. package/src/js/modules/captchas/recaptcha-enterprise.ts +2 -2
  292. package/src/js/modules/captchas/recaptcha-v2-checkbox.ts +3 -3
  293. package/src/js/modules/captchas/recaptcha-v2-invisible.ts +2 -2
  294. package/src/js/modules/captchas/recaptcha-v3.ts +2 -2
  295. package/src/js/modules/captchas/snaptcha.ts +1 -1
  296. package/src/js/modules/captchas/turnstile.ts +3 -3
  297. package/src/js/modules/fields/address-country.ts +6 -4
  298. package/src/js/modules/fields/address-state.ts +20 -12
  299. package/src/js/modules/fields/calculations.ts +5 -3
  300. package/src/js/modules/fields/checkbox-radio.ts +24 -42
  301. package/src/js/modules/fields/combobox.ts +25 -9
  302. package/src/js/modules/fields/conditions/config.ts +17 -20
  303. package/src/js/modules/fields/conditions/effects.ts +23 -26
  304. package/src/js/modules/fields/conditions/evaluator.ts +21 -29
  305. package/src/js/modules/fields/conditions/references.ts +16 -5
  306. package/src/js/modules/fields/conditions/submission-context.ts +80 -0
  307. package/src/js/modules/fields/conditions/types.ts +3 -1
  308. package/src/js/modules/fields/conditions/values.ts +31 -6
  309. package/src/js/modules/fields/conditions.ts +59 -18
  310. package/src/js/modules/fields/custom-google-maps.ts +5 -3
  311. package/src/js/modules/fields/custom-link.ts +5 -3
  312. package/src/js/modules/fields/custom-maps.ts +5 -3
  313. package/src/js/modules/fields/date-picker.ts +40 -4
  314. package/src/js/modules/fields/file-upload.ts +19 -10
  315. package/src/js/modules/fields/hidden.ts +5 -3
  316. package/src/js/modules/fields/index.ts +2 -2
  317. package/src/js/modules/fields/password-validation.ts +5 -3
  318. package/src/js/modules/fields/phone-country.ts +33 -6
  319. package/src/js/modules/fields/repeater.ts +5 -3
  320. package/src/js/modules/fields/rich-text.ts +20 -4
  321. package/src/js/modules/fields/shared.ts +13 -0
  322. package/src/js/modules/fields/signature.ts +64 -6
  323. package/src/js/modules/fields/summary.ts +8 -20
  324. package/src/js/modules/fields/survey-likert.ts +5 -3
  325. package/src/js/modules/fields/survey-rank.ts +21 -3
  326. package/src/js/modules/fields/survey-rating.ts +17 -3
  327. package/src/js/modules/fields/table.ts +5 -3
  328. package/src/js/modules/fields/text-limit.ts +5 -3
  329. package/src/js/modules/fields/upload-manager.ts +190 -49
  330. package/src/js/modules/loader.ts +345 -281
  331. package/src/js/modules/payments/bpoint.ts +2 -2
  332. package/src/js/modules/payments/eway.ts +2 -2
  333. package/src/js/modules/payments/factories.ts +53 -52
  334. package/src/js/modules/payments/go-cardless.ts +1 -1
  335. package/src/js/modules/payments/index.ts +2 -2
  336. package/src/js/modules/payments/mollie.ts +1 -1
  337. package/src/js/modules/payments/moneris.ts +2 -2
  338. package/src/js/modules/payments/opayo.ts +21 -8
  339. package/src/js/modules/payments/paddle.ts +10 -6
  340. package/src/js/modules/payments/payment.ts +22 -18
  341. package/src/js/modules/payments/paypal.ts +1 -1
  342. package/src/js/modules/payments/payway.ts +2 -2
  343. package/src/js/modules/payments/square.ts +2 -2
  344. package/src/js/modules/payments/stripe.ts +5 -5
  345. package/src/js/modules/payments/utils.ts +14 -0
  346. package/src/js/modules/registry.ts +19 -11
  347. package/src/js/submit/pipeline.ts +10 -11
  348. package/src/js/theme/browser-theme-state.generated.ts +25 -0
  349. package/src/js/theme/theme-classes.ts +3 -3
  350. package/src/js/transport/forms-api.ts +66 -67
  351. package/src/js/utils/country-from-ip.ts +14 -9
  352. package/src/js/utils/csrf.ts +136 -0
  353. package/src/js/utils/field-references.parser.ts +13 -113
  354. package/src/js/utils/field-references.resolver.ts +27 -64
  355. package/src/js/utils/field-references.row-scope.ts +1 -1
  356. package/src/js/utils/field-references.types.ts +1 -0
  357. package/src/js/utils/http.ts +5 -5
  358. package/src/js/utils/request-profile.ts +10 -0
  359. package/src/js/utils/unload-warning.ts +12 -4
  360. package/src/js/validation/rules/email.ts +3 -5
  361. package/src/js/validation/rules/match.ts +2 -1
  362. package/src/js/validation/rules/minmax.ts +4 -43
  363. package/src/js/validation/rules/number.ts +3 -47
  364. package/src/js/validation/rules/pattern.ts +3 -8
  365. package/src/js/validation/rules/required.ts +2 -1
  366. package/src/js/validation/rules/shared.ts +5 -1
  367. package/src/js/validation/rules/url.ts +3 -10
  368. package/src/js/validation/skip.ts +9 -0
  369. package/src/js/validation/submit-readiness.ts +9 -2
  370. package/src/js/validation/validator.ts +35 -59
  371. package/dist/chunks/calculations-DERi2xaC.js +0 -299
  372. package/dist/chunks/conditions-65kBcFWW.js +0 -424
  373. package/dist/chunks/country-from-ip-BwxKaBuJ.js +0 -26
  374. package/dist/chunks/field-references.resolver-CHwn0G0L.js +0 -145
  375. package/dist/chunks/friendly-captcha-v1-C_2reOXr.js +0 -31
  376. package/dist/chunks/google-address-BH3Zhi06.js +0 -161
  377. package/dist/chunks/http-D-JExro7.js +0 -27
  378. package/dist/chunks/opayo-CR0DtsLa.js +0 -179
  379. package/dist/chunks/rich-text-Bg_--4TG.js +0 -349
  380. package/dist/js/modules/fields/conditions/transforms.d.ts +0 -3
  381. package/dist/js/modules/fields/conditions/transforms.d.ts.map +0 -1
  382. package/src/js/modules/fields/conditions/transforms.ts +0 -206
  383. package/src/js/modules/payments/stub-payment-module.ts +0 -87
@@ -1,6 +1,6 @@
1
1
  import { a as e } from "./event-names-BCI2FLD8.js";
2
2
  import { t } from "./debug-BV0DvdHx.js";
3
- import { t as n } from "./theme-classes-Tv7q7ToE.js";
3
+ import { t as n } from "./theme-classes-DAQuEqdP.js";
4
4
  import { i as r } from "./i18n-BY1ds1BL.js";
5
5
  import { n as i, t as a } from "./async-nPFRNQ06.js";
6
6
  //#region src/js/modules/captchas/constants.ts
@@ -44,7 +44,7 @@ async function h(e, t, n) {
44
44
  }
45
45
  //#endregion
46
46
  //#region src/js/modules/captchas/host.ts
47
- var g = new Set([
47
+ var g = /* @__PURE__ */ new Set([
48
48
  "handle",
49
49
  "placeholderSelector",
50
50
  "errorMessage",
@@ -54,7 +54,7 @@ var g = new Set([
54
54
  "formie:page:navigate",
55
55
  "formie:page:navigate:after",
56
56
  "formie:submit:result"
57
- ], y = new Set(["formie:page:navigate", "formie:page:navigate:after"]);
57
+ ], y = /* @__PURE__ */ new Set(["formie:page:navigate", "formie:page:navigate:after"]);
58
58
  function b(e, t, n) {
59
59
  return e.addEventListener(t, n), () => {
60
60
  e.removeEventListener(t, n);
@@ -225,13 +225,15 @@ function M(e, t) {
225
225
  //#endregion
226
226
  //#region src/js/modules/captchas/factories.ts
227
227
  var N = t("captchas");
228
- function P({ id: e, defaultPlaceholderSelector: t, defaultTokenFieldNames: n = [], defaultWaitForValueMs: r = o, setup: i }) {
228
+ function P({ moduleId: e, defaultPlaceholderSelector: t, defaultTokenFieldNames: n = [], defaultWaitForValueMs: r = o, setup: i }) {
229
229
  return {
230
- id: e,
230
+ moduleId: e,
231
+ version: 2,
232
+ surfaces: ["server-rendered", "client-rendered"],
231
233
  kind: "captcha",
232
234
  match: () => !0,
233
235
  setup: async (a) => {
234
- let o = j(e, a.options || {}, {
236
+ let o = j(e.split(":")[1], a.options || {}, {
235
237
  defaultPlaceholderSelector: t,
236
238
  defaultTokenFieldNames: n,
237
239
  defaultWaitForValueMs: r
@@ -241,24 +243,40 @@ function P({ id: e, defaultPlaceholderSelector: t, defaultTokenFieldNames: n = [
241
243
  placeholderSelector: o.ui.placeholderSelector,
242
244
  tokenFieldNames: o.transport.tokenFieldNames
243
245
  });
244
- let s = M(a, o);
245
- return i({
246
+ let s;
247
+ if (a.surface === "client-rendered" && !a.root.querySelector(o.ui.placeholderSelector)) {
248
+ let e = /^\[(data-[a-z0-9-]+)\]$/.exec(o.ui.placeholderSelector)?.[1];
249
+ if (!e) throw Error("The CAPTCHA needs a supported placeholder in the client-rendered form.");
250
+ s = document.createElement("div"), s.setAttribute(e, ""), (a.form ?? a.root).append(s);
251
+ }
252
+ let c = M(a, o), l = await i({
246
253
  ...a,
247
254
  options: o,
248
- services: s
255
+ services: c
249
256
  });
257
+ if (!l) {
258
+ s?.remove();
259
+ return;
260
+ }
261
+ let u = l.destroy;
262
+ return {
263
+ ...l,
264
+ destroy: async () => {
265
+ await u(), s?.remove();
266
+ }
267
+ };
250
268
  }
251
269
  };
252
270
  }
253
- function F({ id: e, defaultPlaceholderSelector: t, defaultTokenFieldNames: n = [], defaultWaitForValueMs: r = o }) {
271
+ function F({ moduleId: e, defaultPlaceholderSelector: t, defaultTokenFieldNames: n = [], defaultWaitForValueMs: r = o }) {
254
272
  return P({
255
- id: e,
273
+ moduleId: e,
256
274
  defaultPlaceholderSelector: t,
257
275
  defaultTokenFieldNames: n,
258
276
  defaultWaitForValueMs: r,
259
277
  setup: async ({ services: t, options: n, root: r }) => {
260
278
  let i = [], a = t.placeholder.getPrimary(), o = n.transport.sessionKey, s = n.transport.value || "", c = (e) => {
261
- !e || !o || (e.innerHTML = "", m(e, o, {
279
+ e && o && (e.innerHTML = "", m(e, o, {
262
280
  value: s,
263
281
  container: e
264
282
  }));
@@ -277,8 +295,8 @@ function F({ id: e, defaultPlaceholderSelector: t, defaultTokenFieldNames: n = [
277
295
  e();
278
296
  });
279
297
  },
280
- onBeforeStage: async (i) => {
281
- if (i.stage !== "screen" || i.action !== "submit") return;
298
+ beforeSubmit: async (i) => {
299
+ if (i.action !== "submit") return;
282
300
  let s = o ? [o] : n.transport.tokenFieldNames;
283
301
  if (s.length !== 0 && !await h(r, s, n.transport.waitForValueMs)) {
284
302
  let n = t.errors.getDefaultMessage();
@@ -294,17 +312,17 @@ function F({ id: e, defaultPlaceholderSelector: t, defaultTokenFieldNames: n = [
294
312
  }
295
313
  function I(t) {
296
314
  return P({
297
- id: t.id,
315
+ moduleId: t.moduleId,
298
316
  defaultPlaceholderSelector: t.defaultPlaceholderSelector,
299
317
  defaultTokenFieldNames: t.defaultTokenFieldNames,
300
318
  setup: async (n) => {
301
- let r = [], i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = n.services.placeholder.getPrimary(), s = !1, c = null, l = async () => (c ||= (N.log("Loading captcha provider API.", { moduleId: t.id }), t.load(n)), c), u = async (e) => {
319
+ let r = [], i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = n.services.placeholder.getPrimary(), s = !1, c, l = null, u = async () => (l ||= (N.log("Loading captcha provider API.", { moduleId: t.moduleId }), t.load(n)), l), d = async (e) => {
302
320
  let r = i.get(e);
303
321
  if (n.services.errors.clear(e), !r) {
304
322
  e.innerHTML = "";
305
323
  return;
306
324
  }
307
- let a = await l();
325
+ let a = await u();
308
326
  t.unmount && await t.unmount({
309
327
  api: a,
310
328
  widget: r,
@@ -312,11 +330,12 @@ function I(t) {
312
330
  services: n.services,
313
331
  options: n.options,
314
332
  provider: n.options.provider
315
- }), i.delete(e), e.innerHTML = "", n.services.tokens.clear(), N.log("Unmounted captcha placeholder widget.", { moduleId: t.id }), o === e && (o = n.services.placeholder.getPrimary());
316
- }, d = async (e) => {
317
- if (s || i.has(e) || a.has(e)) return;
333
+ }), i.delete(e), e.innerHTML = "", n.services.tokens.clear(), N.log("Unmounted captcha placeholder widget.", { moduleId: t.moduleId }), o === e && (o = n.services.placeholder.getPrimary());
334
+ }, f = async (e) => {
335
+ if (s || i.has(e)) return;
336
+ if (a.has(e)) return a.get(e);
318
337
  let r = (async () => {
319
- let r = await l();
338
+ let r = await u();
320
339
  if (s || i.has(e)) return;
321
340
  let a = n.services.placeholder.createContainer(e), c = await t.mount({
322
341
  api: r,
@@ -326,25 +345,27 @@ function I(t) {
326
345
  options: n.options,
327
346
  provider: n.options.provider
328
347
  });
329
- i.set(e, c), o = e, N.log("Mounted captcha placeholder widget.", { moduleId: t.id });
348
+ i.set(e, c), o = e, N.log("Mounted captcha placeholder widget.", { moduleId: t.moduleId });
330
349
  })().finally(() => {
331
350
  a.delete(e);
332
351
  });
333
352
  a.set(e, r), await r;
334
- }, f = n.services.placeholder.observe((e) => {
335
- o = e, d(e);
353
+ }, p = n.services.placeholder.observe((e) => {
354
+ o = e, f(e).catch((e) => {
355
+ c = e;
356
+ });
336
357
  }, (e) => {
337
- u(e);
358
+ d(e);
338
359
  });
339
- r.push(f.cleanup);
340
- let p = async (e) => {
341
- let r = f.getVisible();
360
+ r.push(p.cleanup);
361
+ let m = async (e) => {
362
+ let r = p.getVisible();
342
363
  if (t.reset) {
343
- let a = await l();
364
+ let a = await u();
344
365
  for (let o of r) {
345
366
  let r = i.get(o);
346
367
  if (!r) {
347
- await d(o);
368
+ await f(o);
348
369
  continue;
349
370
  }
350
371
  await t.reset({
@@ -357,42 +378,51 @@ function I(t) {
357
378
  reason: e
358
379
  }), n.services.tokens.clear(), n.services.errors.clear(o);
359
380
  }
360
- f.reconcile();
381
+ p.reconcile();
361
382
  return;
362
383
  }
363
- for (let e of Array.from(i.keys())) await u(e);
364
- for (let e of r) await d(e);
365
- f.reconcile();
384
+ for (let e of Array.from(i.keys())) await d(e);
385
+ for (let e of r) await f(e);
386
+ p.reconcile();
366
387
  };
367
- return r.push(n.services.events.onRoot("formie:submit:result", (e) => {
388
+ r.push(n.services.events.onRoot("formie:submit:result", (e) => {
368
389
  let t = e instanceof CustomEvent ? e.detail : null;
369
- t?.stage !== "validate" && (t?.ok === !1 && t?.stage === "screen" || t?.ok !== !0 && p("submit-result"));
390
+ t?.stage !== "validate" && (t?.ok !== !1 || t?.stage !== "challenge") && t?.ok !== !0 && m("submit-result");
370
391
  })), n.form && r.push(n.services.events.onForm(e("reset"), () => {
371
392
  o = n.services.placeholder.getPrimary() || o, window.setTimeout(() => {
372
- p("reset-state");
393
+ m("reset-state");
373
394
  }, 0);
374
- })), {
395
+ })), p.reconcileImmediate();
396
+ try {
397
+ if (await Promise.all([...a.values()]), c) throw c;
398
+ } catch (e) {
399
+ throw s = !0, r.forEach((e) => e()), e;
400
+ }
401
+ return {
402
+ assertReady: () => {
403
+ if (c) throw c;
404
+ },
375
405
  destroy: async () => {
376
406
  s = !0, r.forEach((e) => {
377
407
  e();
378
408
  });
379
- for (let e of Array.from(i.keys())) await u(e);
409
+ for (let e of Array.from(i.keys())) await d(e);
380
410
  },
381
- onBeforeStage: async (e) => {
382
- if (e.stage !== "screen" || e.action !== "submit") return;
383
- f.reconcileImmediate();
384
- let r = f.getVisible();
411
+ beforeSubmit: async (e) => {
412
+ if (e.action !== "submit") return;
413
+ p.reconcileImmediate();
414
+ let r = p.getVisible();
385
415
  if (r.length === 0) return;
386
416
  let a = r.find((e) => e === o) || r[0];
387
- await d(a), a = o || a, n.services.errors.clear(a);
417
+ await f(a), a = o || a, n.services.errors.clear(a);
388
418
  let s = i.get(a);
389
419
  if (!s) {
390
420
  let r = n.services.errors.getDefaultMessage();
391
- n.services.errors.show(r, a), N.warn("Captcha widget unavailable at screen stage.", { moduleId: t.id }), e.abort(r);
421
+ n.services.errors.show(r, a), N.warn("Captcha widget unavailable at challenge stage.", { moduleId: t.moduleId }), e.abort(r);
392
422
  return;
393
423
  }
394
- let c = await l();
395
- await t.screen({
424
+ let c = await u();
425
+ await t.challenge({
396
426
  api: c,
397
427
  widget: s,
398
428
  placeholder: a,
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./debug-BV0DvdHx.js";
2
2
  import { i as t, r as n, t as r } from "./constants-DVcJAvc5.js";
3
3
  //#region src/js/modules/address/host.ts
4
- var i = new Set(["handle"]);
4
+ var i = /* @__PURE__ */ new Set(["handle"]);
5
5
  function a(e, t) {
6
6
  return (typeof t.handle == "string" && t.handle.trim() !== "" ? t.handle.trim() : "") || e;
7
7
  }
@@ -57,19 +57,25 @@ function u(e) {
57
57
  }
58
58
  function d(e) {
59
59
  return {
60
- id: e.id,
60
+ moduleId: e.moduleId,
61
+ version: 2,
62
+ surfaces: [
63
+ "server-rendered",
64
+ "client-rendered",
65
+ "cp-edit"
66
+ ],
61
67
  kind: "address",
62
68
  match: (e) => !!e.target.querySelector("[data-formie-address-autocomplete-input]"),
63
69
  setup: async (t) => {
64
- let n = o(e.id, t.options || {}), r = c(t);
65
- l.log("Setup module.", { moduleId: e.id });
70
+ let n = o(e.moduleId.split(":")[1], t.options || {}), r = c(t);
71
+ l.log("Setup module.", { moduleId: e.moduleId });
66
72
  let i = {
67
73
  ...t,
68
74
  options: n,
69
75
  services: r
70
76
  }, a = [], s = null, d = null;
71
- if (!r.input.getAutocomplete()) return console.warn(`[formie] Address module "${e.id}" skipped: no autocomplete input found in target. Ensure the Address field has the Auto-Complete subfield enabled.`), l.warn("Autocomplete input missing; skipping module.", { moduleId: e.id }), { destroy: () => {} };
72
- let f = async () => (s ||= (l.log("Loading provider API.", { moduleId: e.id }), e.load(i)), s), p = async () => {
77
+ if (!r.input.getAutocomplete()) return console.warn(`[formie] Address module "${e.moduleId}" skipped: no autocomplete input found in target. Ensure the Address field has the Auto-Complete subfield enabled.`), l.warn("Autocomplete input missing; skipping module.", { moduleId: e.moduleId }), { destroy: () => {} };
78
+ let f = async () => (s ||= (l.log("Loading provider API.", { moduleId: e.moduleId }), e.load(i)), s), p = async () => {
73
79
  if (d || !u(t.target)) return;
74
80
  let i = await f();
75
81
  d = await e.mount({
@@ -78,7 +84,7 @@ function d(e) {
78
84
  services: r,
79
85
  options: n,
80
86
  provider: n.provider
81
- }), l.log("Widget mounted.", { moduleId: e.id });
87
+ }), l.log("Widget mounted.", { moduleId: e.moduleId });
82
88
  };
83
89
  u(t.target) && await p(), ["formie:page:navigate:after", "formie:submit:result"].forEach((e) => {
84
90
  let n = () => {
@@ -103,7 +109,7 @@ function d(e) {
103
109
  })();
104
110
  });
105
111
  return m && a.push(m), { destroy: async () => {
106
- if (l.log("Destroying module.", { moduleId: e.id }), a.forEach((e) => e()), d && e.unmount) {
112
+ if (l.log("Destroying module.", { moduleId: e.moduleId }), a.forEach((e) => e()), d && e.unmount) {
107
113
  let i = await f();
108
114
  await e.unmount({
109
115
  api: i,
@@ -112,7 +118,7 @@ function d(e) {
112
118
  services: r,
113
119
  options: n,
114
120
  provider: n.provider
115
- }), l.log("Widget unmounted.", { moduleId: e.id });
121
+ }), l.log("Widget unmounted.", { moduleId: e.moduleId });
116
122
  }
117
123
  } };
118
124
  }
@@ -1,10 +1,10 @@
1
- import { t as e } from "./api-DqpfkZWL.js";
1
+ import { t as e } from "./api-D6kJ7kXZ.js";
2
2
  //#region src/js/modules/payments/bpoint.ts
3
3
  var t = e({
4
- id: "bpoint",
4
+ moduleId: "formie:bpoint",
5
5
  defaultRequiredInputSuffixes: ["bpointToken"],
6
6
  load: async () => null,
7
- onBeforeAuthorize: async ({ field: e, services: t }) => {
7
+ onBeforePayment: async ({ field: e, services: t }) => {
8
8
  if ((e.querySelector("input[name$=\"[bpointToken]\"]")?.value || "").trim() !== "") return !0;
9
9
  let n = e.querySelector("[data-bpoint-card=\"cardholder-name\"]")?.value?.trim() || "", r = e.querySelector("[data-bpoint-card=\"card-number\"]")?.value?.replace(/\s+/g, "") || "", i = e.querySelector("[data-bpoint-card=\"expiry-date\"]")?.value || "", a = e.querySelector("[data-bpoint-card=\"security-code\"]")?.value?.trim() || "", o = (i.match(/\d/g) || []).join("").slice(0, 4);
10
10
  if (!r || o.length !== 4 || !a) return t.addError("Please provide valid card details to continue."), !1;
@@ -0,0 +1,310 @@
1
+ import { h as e, n as t, o as n, r, s as i } from "./dist-ZLeW0zZ3.js";
2
+ import { t as a } from "./debug-BV0DvdHx.js";
3
+ import { r as o, t as s } from "./field-references.keys-58ZSTrCW.js";
4
+ import { n as c, r as l } from "./field-references.resolver-Ca8MguFv.js";
5
+ import { i as u, n as d } from "./shared-OKhSay59.js";
6
+ //#region src/js/utils/field-references.row-scope.ts
7
+ var f = /* @__PURE__ */ new Set([
8
+ "first",
9
+ "last",
10
+ "index",
11
+ "all",
12
+ "count",
13
+ "rows"
14
+ ]);
15
+ function p(e) {
16
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
17
+ }
18
+ function m(e, t) {
19
+ let n = String(e || "").trim().toLowerCase();
20
+ if (!n || t <= 0) return [];
21
+ if (n === "even") {
22
+ let e = [];
23
+ for (let n = 1; n <= t; n++) n % 2 == 0 && e.push(n - 1);
24
+ return e;
25
+ }
26
+ if (n === "odd") {
27
+ let e = [];
28
+ for (let n = 1; n <= t; n++) n % 2 == 1 && e.push(n - 1);
29
+ return e;
30
+ }
31
+ let r = n.match(/^every:(\d+)$/);
32
+ if (r) {
33
+ let e = Math.max(1, Number.parseInt(r[1] || "1", 10)), n = [];
34
+ for (let r = 1; r <= t; r += e) n.push(r - 1);
35
+ return n;
36
+ }
37
+ let i = [];
38
+ return n.split(/\s*,\s*/).forEach((e) => {
39
+ let n = e.trim();
40
+ if (!n) return;
41
+ let r = n.match(/^(\d+)\s*-\s*(\d+)$/);
42
+ if (r) {
43
+ let e = Number.parseInt(r[1] || "0", 10), n = Number.parseInt(r[2] || "0", 10);
44
+ e > n && ([e, n] = [n, e]);
45
+ for (let r = Math.max(1, e); r <= Math.min(t, n); r++) r >= 1 && r <= t && i.push(r - 1);
46
+ return;
47
+ }
48
+ let a = Number.parseInt(n, 10);
49
+ Number.isFinite(a) && a >= 1 && a <= t && i.push(a - 1);
50
+ }), [...new Set(i)].sort((e, t) => e - t);
51
+ }
52
+ function h(e) {
53
+ let t = o(e), n = t.split(".").filter(Boolean);
54
+ return n.length < 2 ? {
55
+ fieldKey: t,
56
+ columnKey: n[n.length - 1] || ""
57
+ } : n.length >= 3 && /^\d+$/.test(n[1] || "") ? {
58
+ fieldKey: n[0] || "",
59
+ columnKey: n.slice(2).join(".")
60
+ } : {
61
+ fieldKey: n[0] || "",
62
+ columnKey: n.slice(1).join(".")
63
+ };
64
+ }
65
+ function g(e, t, n) {
66
+ let r = RegExp(`^${p(e)}\\.(\\d+)\\.${p(t)}$`);
67
+ return [...n.keys()].filter((e) => r.test(e)).sort((e, t) => Number.parseInt(e.split(".")[1] || "0", 10) - Number.parseInt(t.split(".")[1] || "0", 10));
68
+ }
69
+ function _(e, t) {
70
+ return c(e, t).value;
71
+ }
72
+ function v(e, t, n) {
73
+ let r = /* @__PURE__ */ new Set(), { fieldKey: i, columnKey: a } = h(e), o = String(t.scope || "").trim().toLowerCase();
74
+ if (!i || !a || !f.has(o)) {
75
+ let t = s(e);
76
+ return t && (r.add(t), r.add(`${t}[]`)), r;
77
+ }
78
+ return g(i, a, n).forEach((e) => {
79
+ let t = n.get(e);
80
+ if (t?.names?.length) {
81
+ t.names.forEach((e) => {
82
+ r.add(e);
83
+ });
84
+ return;
85
+ }
86
+ let i = s(e);
87
+ i && (r.add(i), r.add(`${i}[]`));
88
+ }), r;
89
+ }
90
+ function y(e, t, n) {
91
+ let r = String(t.scope || "").trim().toLowerCase();
92
+ if (!r || !f.has(r)) return c(e, n);
93
+ let { fieldKey: i, columnKey: a } = h(e);
94
+ if (!i || !a) return c(e, n);
95
+ let o = g(i, a, n), s = o.map((e) => _(e, n));
96
+ if (r === "count") return {
97
+ key: `${i}.${a}`,
98
+ value: String(o.length),
99
+ found: !0
100
+ };
101
+ if (r === "first") return {
102
+ key: o[0] || `${i}.0.${a}`,
103
+ value: s[0] ?? "",
104
+ found: o.length > 0
105
+ };
106
+ if (r === "last") return {
107
+ key: o[o.length - 1] || `${i}.0.${a}`,
108
+ value: s[s.length - 1] ?? "",
109
+ found: o.length > 0
110
+ };
111
+ if (r === "index") {
112
+ let e = `${i}.${Number.parseInt(String(t.index ?? "0"), 10)}.${a}`;
113
+ return c(e, n);
114
+ }
115
+ if (r === "all") {
116
+ let e = s.flatMap((e) => Array.isArray(e) ? e : e === "" ? [] : [e]);
117
+ return {
118
+ key: `${i}.${a}`,
119
+ value: e,
120
+ found: e.length > 0
121
+ };
122
+ }
123
+ if (r === "rows") {
124
+ let e = m(String(t.rows || ""), o.length);
125
+ if (e.length === 0) return {
126
+ key: `${i}.${a}`,
127
+ value: "",
128
+ found: !1
129
+ };
130
+ if (e.length === 1) return {
131
+ key: o[e[0]] || `${i}.${e[0]}.${a}`,
132
+ value: s[e[0]] ?? "",
133
+ found: !0
134
+ };
135
+ let n = e.flatMap((e) => {
136
+ let t = s[e];
137
+ return Array.isArray(t) ? t : t === "" ? [] : [t];
138
+ });
139
+ return {
140
+ key: `${i}.${a}`,
141
+ value: n,
142
+ found: n.length > 0
143
+ };
144
+ }
145
+ return c(e, n);
146
+ }
147
+ //#endregion
148
+ //#region src/js/modules/fields/calculations.ts
149
+ var b = "input[data-formie-calculation-input]";
150
+ function x(e) {
151
+ let t = e;
152
+ return {
153
+ scope: t.scope,
154
+ index: t.index,
155
+ rows: t.rows,
156
+ fieldKind: t.fieldKind
157
+ };
158
+ }
159
+ var S = "calculations", C = a("fields", "calculations");
160
+ function w(e, t, n) {
161
+ let a = l(e), o = {};
162
+ return t.forEach(([e, t]) => {
163
+ let n = x(t);
164
+ if (String(n.scope || "").trim()) {
165
+ let i = y(t.sourceKey || "", n, a);
166
+ o[e] = r(t, i.value);
167
+ return;
168
+ }
169
+ let i = c(t.sourceKey || "", a);
170
+ o[e] = r(t, i.value);
171
+ }), i(o, n.formatting);
172
+ }
173
+ function T(e, t) {
174
+ let n = l(e), r = /* @__PURE__ */ new Set();
175
+ return t.forEach(([, e]) => {
176
+ let t = x(e);
177
+ if (String(t.scope || "").trim()) {
178
+ v(e.sourceKey || "", t, n).forEach((e) => {
179
+ r.add(e);
180
+ });
181
+ return;
182
+ }
183
+ let i = o(e.sourceKey || ""), a = n.get(i);
184
+ if (a?.names?.length) {
185
+ a.names.forEach((e) => {
186
+ r.add(e);
187
+ });
188
+ return;
189
+ }
190
+ let c = s(i);
191
+ c && (r.add(c), r.add(`${c}[]`));
192
+ }), r;
193
+ }
194
+ function E(r, i, a, o) {
195
+ let s = t(o), c = n(o), l = /* @__PURE__ */ new Map(), u = null, f = !1, p = !1, m = !1, h = () => {
196
+ l.forEach((e, t) => {
197
+ e.forEach((e, n) => {
198
+ t.removeEventListener(n, e);
199
+ });
200
+ }), l.clear();
201
+ }, g = (e) => {
202
+ e && !f && queueMicrotask(() => {
203
+ f || (a.dispatchEvent(new Event("input", { bubbles: !0 })), a.dispatchEvent(new Event("change", { bubbles: !0 })));
204
+ });
205
+ }, _ = (t = !1) => {
206
+ let n = w(r, c, o);
207
+ C.log("Evaluate requested.", {
208
+ fieldHandle: i.getAttribute("data-formie-field-handle") || null,
209
+ isInit: t
210
+ });
211
+ let l = {
212
+ calculations: a,
213
+ init: t,
214
+ formula: s,
215
+ variables: n
216
+ };
217
+ if (d(i, S, "before-evaluate", l), !l.formula) {
218
+ let e = a.value !== "";
219
+ a.value = "", g(e);
220
+ return;
221
+ }
222
+ try {
223
+ let n = e(l.formula, l.variables, o), r = {
224
+ calculations: a,
225
+ init: t,
226
+ formula: l.formula,
227
+ variables: l.variables,
228
+ result: n
229
+ };
230
+ d(i, S, "after-evaluate", r);
231
+ let s = typeof r.result == "string" || typeof r.result == "number" ? String(r.result) : "", c = a.value !== s;
232
+ a.value = s, C.log("Evaluate complete.", {
233
+ fieldHandle: i.getAttribute("data-formie-field-handle") || null,
234
+ valueChanged: c,
235
+ nextValue: s
236
+ }), g(c);
237
+ } catch (e) {
238
+ let t = a.value !== "";
239
+ console.error("[formie] Failed to evaluate calculation.", e), C.warn("Evaluate failed.", {
240
+ fieldHandle: i.getAttribute("data-formie-field-handle") || null,
241
+ error: e instanceof Error ? e.message : e
242
+ }), a.value = "", g(t);
243
+ }
244
+ }, v = (e = !1) => {
245
+ p || f || (p = !0, queueMicrotask(() => {
246
+ p = !1, _(e);
247
+ }));
248
+ }, y = () => {
249
+ h();
250
+ let e = T(r, c);
251
+ if (C.log("Binding variable watchers.", {
252
+ fieldHandle: i.getAttribute("data-formie-field-handle") || null,
253
+ watchCount: e.size
254
+ }), !e.size) return;
255
+ let t = (t) => {
256
+ let n = t.target?.name || "";
257
+ n && e.has(n) && (C.log("Source change detected.", {
258
+ fieldHandle: i.getAttribute("data-formie-field-handle") || null,
259
+ sourceName: n,
260
+ eventType: t.type
261
+ }), v(!1));
262
+ };
263
+ ["input", "change"].forEach((e) => {
264
+ r.addEventListener(e, t);
265
+ let n = l.get(r) || /* @__PURE__ */ new Map();
266
+ n.set(e, t), l.set(r, n);
267
+ });
268
+ }, b = () => {
269
+ m || f || (m = !0, queueMicrotask(() => {
270
+ m = !1, y(), v(!1);
271
+ }));
272
+ };
273
+ return y(), u = new MutationObserver(() => {
274
+ b();
275
+ }), u.observe(r, {
276
+ childList: !0,
277
+ subtree: !0
278
+ }), _(!0), () => {
279
+ f = !0, u?.disconnect(), h();
280
+ };
281
+ }
282
+ var D = {
283
+ moduleId: `formie:${S}`,
284
+ version: 2,
285
+ surfaces: [
286
+ "server-rendered",
287
+ "client-rendered",
288
+ "cp-edit"
289
+ ],
290
+ kind: "field",
291
+ match: (e) => !!e.target.querySelector(b),
292
+ setup: async (e) => {
293
+ let t = e.options || {}, n = u(e);
294
+ C.log("Module setup.", {
295
+ fieldCount: n.length,
296
+ formatting: t.formatting || null
297
+ });
298
+ let r = n.map((n) => {
299
+ let r = n.querySelector(b);
300
+ return r instanceof HTMLInputElement ? E(e.root, n, r, t) : () => {};
301
+ });
302
+ return await e.emit("formie:module:calculations:init", { count: r.length }), { destroy: () => {
303
+ C.log("Module destroy.", { fieldCount: r.length }), r.forEach((e) => {
304
+ e();
305
+ }), e.emit("formie:module:calculations:destroy", {});
306
+ } };
307
+ }
308
+ };
309
+ //#endregion
310
+ export { D as calculationsModule };
@@ -1,17 +1,18 @@
1
- import { a as e, t } from "./api-BUb6P-xu.js";
1
+ import { a as e, t } from "./api-DYYsVIub.js";
2
2
  import { r as n } from "./scripts-CbQ7agX3.js";
3
3
  //#region src/js/modules/captchas/captcha-eu.ts
4
4
  async function r(t) {
5
+ let r = String(t.endPoint || "https://www.captcha.eu").trim().replace(/\/+$/, "");
5
6
  return n("KROT", {
6
7
  id: "FORMIE_CAPTCHA_EU_SCRIPT",
7
- src: `${String(t.endPoint || "https://www.captcha.eu").trim().replace(/\/+$/, "")}/sdk.js`,
8
+ src: `${r}/sdk.js`,
8
9
  async: !0,
9
10
  defer: !0,
10
11
  timeoutMs: e
11
12
  });
12
13
  }
13
14
  var i = t({
14
- id: "captcha-eu",
15
+ moduleId: "formie:captcha-eu",
15
16
  defaultPlaceholderSelector: "[data-captcha-eu-placeholder]",
16
17
  defaultTokenFieldNames: ["captcha-eu-token"],
17
18
  load: ({ options: e }) => r(e.provider),
@@ -20,7 +21,7 @@ var i = t({
20
21
  }, t), e.on("CPT_EXPIRED", () => {
21
22
  r.tokens.clear(), r.errors.clear();
22
23
  }, t), t),
23
- screen: async ({ placeholder: e, services: t, stageCtx: n }) => {
24
+ challenge: async ({ placeholder: e, services: t, stageCtx: n }) => {
24
25
  if (!await t.tokens.wait()) {
25
26
  let r = t.errors.getDefaultMessage();
26
27
  t.errors.show(r, e), n.abort(r);