@verbb/formie-browser 1.0.13 → 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 (381) hide show
  1. package/CHANGELOG.md +50 -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-F9BUBDSW.js → date-picker-RUnevF7l.js} +455 -432
  20. package/dist/chunks/{dist-D6i-VNgM.js → dist-ZLeW0zZ3.js} +1281 -453
  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-D06uH9va.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-IOhuicje.js → signature-7cldFbqj.js} +138 -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-BGaY0jhI.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/forms/_form.css +5 -1
  73. package/dist/index.d.ts +5 -4
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +1778 -1427
  76. package/dist/js/contracts/client.d.ts +5 -3
  77. package/dist/js/contracts/client.d.ts.map +1 -1
  78. package/dist/js/contracts/common.d.ts +2 -2
  79. package/dist/js/contracts/common.d.ts.map +1 -1
  80. package/dist/js/contracts/modules.d.ts +37 -12
  81. package/dist/js/contracts/modules.d.ts.map +1 -1
  82. package/dist/js/contracts/schema.d.ts +20 -38
  83. package/dist/js/contracts/schema.d.ts.map +1 -1
  84. package/dist/js/contracts/theme.d.ts +4 -1
  85. package/dist/js/contracts/theme.d.ts.map +1 -1
  86. package/dist/js/core/client-rendered-modules.d.ts +17 -0
  87. package/dist/js/core/client-rendered-modules.d.ts.map +1 -0
  88. package/dist/js/core/create-formie-client.d.ts.map +1 -1
  89. package/dist/js/core/field-error-aria.d.ts +23 -0
  90. package/dist/js/core/field-error-aria.d.ts.map +1 -0
  91. package/dist/js/core/hydrate-modules.d.ts +10 -8
  92. package/dist/js/core/hydrate-modules.d.ts.map +1 -1
  93. package/dist/js/core/submit-result-state.d.ts.map +1 -1
  94. package/dist/js/core/submit-result-ui.d.ts.map +1 -1
  95. package/dist/js/core/validation-focus.d.ts.map +1 -1
  96. package/dist/js/modules/address/address-finder.d.ts +1 -1
  97. package/dist/js/modules/address/address-finder.d.ts.map +1 -1
  98. package/dist/js/modules/address/factories.d.ts +3 -3
  99. package/dist/js/modules/address/factories.d.ts.map +1 -1
  100. package/dist/js/modules/address/google-address.d.ts +2 -1
  101. package/dist/js/modules/address/google-address.d.ts.map +1 -1
  102. package/dist/js/modules/address/index.d.ts +2 -2
  103. package/dist/js/modules/address/index.d.ts.map +1 -1
  104. package/dist/js/modules/address/loqate.d.ts +1 -1
  105. package/dist/js/modules/address/loqate.d.ts.map +1 -1
  106. package/dist/js/modules/address/place-kit.d.ts +1 -1
  107. package/dist/js/modules/address/place-kit.d.ts.map +1 -1
  108. package/dist/js/modules/captchas/captcha-eu.d.ts +1 -1
  109. package/dist/js/modules/captchas/captcha-eu.d.ts.map +1 -1
  110. package/dist/js/modules/captchas/factories.d.ts +11 -11
  111. package/dist/js/modules/captchas/factories.d.ts.map +1 -1
  112. package/dist/js/modules/captchas/friendly-captcha-v1.d.ts +1 -1
  113. package/dist/js/modules/captchas/friendly-captcha-v1.d.ts.map +1 -1
  114. package/dist/js/modules/captchas/friendly-captcha-v2.d.ts +1 -1
  115. package/dist/js/modules/captchas/friendly-captcha-v2.d.ts.map +1 -1
  116. package/dist/js/modules/captchas/hcaptcha.d.ts +1 -1
  117. package/dist/js/modules/captchas/hcaptcha.d.ts.map +1 -1
  118. package/dist/js/modules/captchas/index.d.ts +2 -2
  119. package/dist/js/modules/captchas/index.d.ts.map +1 -1
  120. package/dist/js/modules/captchas/recaptcha-enterprise.d.ts +1 -1
  121. package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -1
  122. package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts +1 -1
  123. package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts.map +1 -1
  124. package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts +1 -1
  125. package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts.map +1 -1
  126. package/dist/js/modules/captchas/recaptcha-v3.d.ts +1 -1
  127. package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -1
  128. package/dist/js/modules/captchas/snaptcha.d.ts +1 -1
  129. package/dist/js/modules/captchas/snaptcha.d.ts.map +1 -1
  130. package/dist/js/modules/captchas/turnstile.d.ts +1 -1
  131. package/dist/js/modules/captchas/turnstile.d.ts.map +1 -1
  132. package/dist/js/modules/fields/address-country.d.ts +2 -2
  133. package/dist/js/modules/fields/address-country.d.ts.map +1 -1
  134. package/dist/js/modules/fields/address-state.d.ts +2 -2
  135. package/dist/js/modules/fields/address-state.d.ts.map +1 -1
  136. package/dist/js/modules/fields/calculations.d.ts +2 -2
  137. package/dist/js/modules/fields/calculations.d.ts.map +1 -1
  138. package/dist/js/modules/fields/checkbox-radio.d.ts +2 -2
  139. package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -1
  140. package/dist/js/modules/fields/combobox.d.ts +2 -2
  141. package/dist/js/modules/fields/combobox.d.ts.map +1 -1
  142. package/dist/js/modules/fields/conditions/config.d.ts.map +1 -1
  143. package/dist/js/modules/fields/conditions/effects.d.ts +1 -0
  144. package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -1
  145. package/dist/js/modules/fields/conditions/evaluator.d.ts +4 -1
  146. package/dist/js/modules/fields/conditions/evaluator.d.ts.map +1 -1
  147. package/dist/js/modules/fields/conditions/references.d.ts.map +1 -1
  148. package/dist/js/modules/fields/conditions/submission-context.d.ts +15 -0
  149. package/dist/js/modules/fields/conditions/submission-context.d.ts.map +1 -0
  150. package/dist/js/modules/fields/conditions/types.d.ts +3 -1
  151. package/dist/js/modules/fields/conditions/types.d.ts.map +1 -1
  152. package/dist/js/modules/fields/conditions/values.d.ts +1 -1
  153. package/dist/js/modules/fields/conditions/values.d.ts.map +1 -1
  154. package/dist/js/modules/fields/conditions.d.ts +2 -2
  155. package/dist/js/modules/fields/conditions.d.ts.map +1 -1
  156. package/dist/js/modules/fields/custom-google-maps.d.ts +2 -2
  157. package/dist/js/modules/fields/custom-google-maps.d.ts.map +1 -1
  158. package/dist/js/modules/fields/custom-link.d.ts +2 -2
  159. package/dist/js/modules/fields/custom-link.d.ts.map +1 -1
  160. package/dist/js/modules/fields/custom-maps.d.ts +2 -2
  161. package/dist/js/modules/fields/custom-maps.d.ts.map +1 -1
  162. package/dist/js/modules/fields/date-picker.d.ts +2 -2
  163. package/dist/js/modules/fields/date-picker.d.ts.map +1 -1
  164. package/dist/js/modules/fields/file-upload.d.ts +2 -2
  165. package/dist/js/modules/fields/file-upload.d.ts.map +1 -1
  166. package/dist/js/modules/fields/hidden.d.ts +2 -2
  167. package/dist/js/modules/fields/hidden.d.ts.map +1 -1
  168. package/dist/js/modules/fields/index.d.ts +2 -2
  169. package/dist/js/modules/fields/index.d.ts.map +1 -1
  170. package/dist/js/modules/fields/password-validation.d.ts +2 -2
  171. package/dist/js/modules/fields/password-validation.d.ts.map +1 -1
  172. package/dist/js/modules/fields/phone-country.d.ts +2 -2
  173. package/dist/js/modules/fields/phone-country.d.ts.map +1 -1
  174. package/dist/js/modules/fields/repeater.d.ts +2 -2
  175. package/dist/js/modules/fields/repeater.d.ts.map +1 -1
  176. package/dist/js/modules/fields/rich-text.d.ts +2 -2
  177. package/dist/js/modules/fields/rich-text.d.ts.map +1 -1
  178. package/dist/js/modules/fields/shared.d.ts +1 -0
  179. package/dist/js/modules/fields/shared.d.ts.map +1 -1
  180. package/dist/js/modules/fields/signature.d.ts +2 -2
  181. package/dist/js/modules/fields/signature.d.ts.map +1 -1
  182. package/dist/js/modules/fields/summary.d.ts +2 -2
  183. package/dist/js/modules/fields/summary.d.ts.map +1 -1
  184. package/dist/js/modules/fields/survey-likert.d.ts +2 -2
  185. package/dist/js/modules/fields/survey-likert.d.ts.map +1 -1
  186. package/dist/js/modules/fields/survey-rank.d.ts +2 -2
  187. package/dist/js/modules/fields/survey-rank.d.ts.map +1 -1
  188. package/dist/js/modules/fields/survey-rating.d.ts +2 -2
  189. package/dist/js/modules/fields/survey-rating.d.ts.map +1 -1
  190. package/dist/js/modules/fields/table.d.ts +2 -2
  191. package/dist/js/modules/fields/table.d.ts.map +1 -1
  192. package/dist/js/modules/fields/text-limit.d.ts +2 -2
  193. package/dist/js/modules/fields/text-limit.d.ts.map +1 -1
  194. package/dist/js/modules/fields/upload-manager.d.ts +2 -2
  195. package/dist/js/modules/fields/upload-manager.d.ts.map +1 -1
  196. package/dist/js/modules/loader.d.ts +10 -4
  197. package/dist/js/modules/loader.d.ts.map +1 -1
  198. package/dist/js/modules/payments/bpoint.d.ts +1 -1
  199. package/dist/js/modules/payments/bpoint.d.ts.map +1 -1
  200. package/dist/js/modules/payments/eway.d.ts +1 -1
  201. package/dist/js/modules/payments/eway.d.ts.map +1 -1
  202. package/dist/js/modules/payments/factories.d.ts +7 -7
  203. package/dist/js/modules/payments/factories.d.ts.map +1 -1
  204. package/dist/js/modules/payments/go-cardless.d.ts +1 -1
  205. package/dist/js/modules/payments/go-cardless.d.ts.map +1 -1
  206. package/dist/js/modules/payments/index.d.ts +2 -2
  207. package/dist/js/modules/payments/index.d.ts.map +1 -1
  208. package/dist/js/modules/payments/mollie.d.ts +1 -1
  209. package/dist/js/modules/payments/mollie.d.ts.map +1 -1
  210. package/dist/js/modules/payments/moneris.d.ts +1 -1
  211. package/dist/js/modules/payments/moneris.d.ts.map +1 -1
  212. package/dist/js/modules/payments/opayo.d.ts +1 -1
  213. package/dist/js/modules/payments/opayo.d.ts.map +1 -1
  214. package/dist/js/modules/payments/paddle.d.ts +1 -1
  215. package/dist/js/modules/payments/paddle.d.ts.map +1 -1
  216. package/dist/js/modules/payments/paypal.d.ts +1 -1
  217. package/dist/js/modules/payments/paypal.d.ts.map +1 -1
  218. package/dist/js/modules/payments/payway.d.ts +1 -1
  219. package/dist/js/modules/payments/payway.d.ts.map +1 -1
  220. package/dist/js/modules/payments/square.d.ts +1 -1
  221. package/dist/js/modules/payments/square.d.ts.map +1 -1
  222. package/dist/js/modules/payments/stripe.d.ts +1 -1
  223. package/dist/js/modules/payments/stripe.d.ts.map +1 -1
  224. package/dist/js/modules/payments/utils.d.ts +6 -0
  225. package/dist/js/modules/payments/utils.d.ts.map +1 -1
  226. package/dist/js/modules/registry.d.ts +6 -4
  227. package/dist/js/modules/registry.d.ts.map +1 -1
  228. package/dist/js/submit/pipeline.d.ts.map +1 -1
  229. package/dist/js/theme/browser-theme-state.generated.d.ts +24 -0
  230. package/dist/js/theme/browser-theme-state.generated.d.ts.map +1 -0
  231. package/dist/js/theme/theme-classes.d.ts +3 -3
  232. package/dist/js/theme/theme-classes.d.ts.map +1 -1
  233. package/dist/js/transport/forms-api.d.ts +5 -3
  234. package/dist/js/transport/forms-api.d.ts.map +1 -1
  235. package/dist/js/utils/country-from-ip.d.ts +2 -2
  236. package/dist/js/utils/country-from-ip.d.ts.map +1 -1
  237. package/dist/js/utils/csrf.d.ts +17 -0
  238. package/dist/js/utils/csrf.d.ts.map +1 -0
  239. package/dist/js/utils/field-references.parser.d.ts +1 -0
  240. package/dist/js/utils/field-references.parser.d.ts.map +1 -1
  241. package/dist/js/utils/field-references.resolver.d.ts.map +1 -1
  242. package/dist/js/utils/field-references.types.d.ts +1 -0
  243. package/dist/js/utils/field-references.types.d.ts.map +1 -1
  244. package/dist/js/utils/http.d.ts +3 -1
  245. package/dist/js/utils/http.d.ts.map +1 -1
  246. package/dist/js/utils/request-profile.d.ts +4 -0
  247. package/dist/js/utils/request-profile.d.ts.map +1 -0
  248. package/dist/js/utils/unload-warning.d.ts.map +1 -1
  249. package/dist/js/validation/rules/email.d.ts.map +1 -1
  250. package/dist/js/validation/rules/match.d.ts.map +1 -1
  251. package/dist/js/validation/rules/number.d.ts.map +1 -1
  252. package/dist/js/validation/rules/required.d.ts.map +1 -1
  253. package/dist/js/validation/rules/shared.d.ts.map +1 -1
  254. package/dist/js/validation/rules/url.d.ts.map +1 -1
  255. package/dist/js/validation/skip.d.ts +7 -0
  256. package/dist/js/validation/skip.d.ts.map +1 -0
  257. package/dist/js/validation/submit-readiness.d.ts.map +1 -1
  258. package/dist/js/validation/validator.d.ts.map +1 -1
  259. package/package.json +43 -12
  260. package/src/css/formie-base.css +104 -1
  261. package/src/css/theme/_messages.css +2 -0
  262. package/src/css/theme/_tokens.css +31 -25
  263. package/src/css/theme/forms/_form.css +5 -1
  264. package/src/index.ts +13 -8
  265. package/src/js/contracts/client.ts +5 -3
  266. package/src/js/contracts/common.ts +5 -6
  267. package/src/js/contracts/modules.ts +41 -12
  268. package/src/js/contracts/schema.ts +21 -43
  269. package/src/js/contracts/theme.ts +6 -1
  270. package/src/js/core/client-rendered-modules.ts +69 -0
  271. package/src/js/core/create-formie-client.ts +116 -77
  272. package/src/js/core/field-error-aria.ts +93 -0
  273. package/src/js/core/hydrate-modules.ts +54 -29
  274. package/src/js/core/submit-result-state.ts +34 -45
  275. package/src/js/core/submit-result-ui.ts +21 -65
  276. package/src/js/core/validation-focus.ts +20 -20
  277. package/src/js/modules/address/address-finder.ts +1 -1
  278. package/src/js/modules/address/factories.ts +15 -13
  279. package/src/js/modules/address/google-address.ts +10 -6
  280. package/src/js/modules/address/index.ts +2 -2
  281. package/src/js/modules/address/loqate.ts +1 -1
  282. package/src/js/modules/address/place-kit.ts +1 -1
  283. package/src/js/modules/captchas/captcha-eu.ts +2 -2
  284. package/src/js/modules/captchas/factories.ts +66 -42
  285. package/src/js/modules/captchas/friendly-captcha-v1.ts +12 -2
  286. package/src/js/modules/captchas/friendly-captcha-v2.ts +4 -2
  287. package/src/js/modules/captchas/hcaptcha.ts +5 -5
  288. package/src/js/modules/captchas/index.ts +2 -2
  289. package/src/js/modules/captchas/recaptcha-enterprise.ts +2 -2
  290. package/src/js/modules/captchas/recaptcha-v2-checkbox.ts +3 -3
  291. package/src/js/modules/captchas/recaptcha-v2-invisible.ts +2 -2
  292. package/src/js/modules/captchas/recaptcha-v3.ts +2 -2
  293. package/src/js/modules/captchas/snaptcha.ts +1 -1
  294. package/src/js/modules/captchas/turnstile.ts +3 -3
  295. package/src/js/modules/fields/address-country.ts +6 -4
  296. package/src/js/modules/fields/address-state.ts +20 -12
  297. package/src/js/modules/fields/calculations.ts +5 -3
  298. package/src/js/modules/fields/checkbox-radio.ts +24 -42
  299. package/src/js/modules/fields/combobox.ts +25 -9
  300. package/src/js/modules/fields/conditions/config.ts +17 -20
  301. package/src/js/modules/fields/conditions/effects.ts +23 -26
  302. package/src/js/modules/fields/conditions/evaluator.ts +21 -29
  303. package/src/js/modules/fields/conditions/references.ts +16 -5
  304. package/src/js/modules/fields/conditions/submission-context.ts +80 -0
  305. package/src/js/modules/fields/conditions/types.ts +3 -1
  306. package/src/js/modules/fields/conditions/values.ts +31 -6
  307. package/src/js/modules/fields/conditions.ts +59 -18
  308. package/src/js/modules/fields/custom-google-maps.ts +5 -3
  309. package/src/js/modules/fields/custom-link.ts +5 -3
  310. package/src/js/modules/fields/custom-maps.ts +5 -3
  311. package/src/js/modules/fields/date-picker.ts +34 -4
  312. package/src/js/modules/fields/file-upload.ts +19 -10
  313. package/src/js/modules/fields/hidden.ts +5 -3
  314. package/src/js/modules/fields/index.ts +2 -2
  315. package/src/js/modules/fields/password-validation.ts +5 -3
  316. package/src/js/modules/fields/phone-country.ts +33 -6
  317. package/src/js/modules/fields/repeater.ts +5 -3
  318. package/src/js/modules/fields/rich-text.ts +20 -4
  319. package/src/js/modules/fields/shared.ts +13 -0
  320. package/src/js/modules/fields/signature.ts +24 -4
  321. package/src/js/modules/fields/summary.ts +8 -20
  322. package/src/js/modules/fields/survey-likert.ts +5 -3
  323. package/src/js/modules/fields/survey-rank.ts +21 -3
  324. package/src/js/modules/fields/survey-rating.ts +17 -3
  325. package/src/js/modules/fields/table.ts +5 -3
  326. package/src/js/modules/fields/text-limit.ts +5 -3
  327. package/src/js/modules/fields/upload-manager.ts +190 -49
  328. package/src/js/modules/loader.ts +345 -281
  329. package/src/js/modules/payments/bpoint.ts +2 -2
  330. package/src/js/modules/payments/eway.ts +2 -2
  331. package/src/js/modules/payments/factories.ts +53 -52
  332. package/src/js/modules/payments/go-cardless.ts +1 -1
  333. package/src/js/modules/payments/index.ts +2 -2
  334. package/src/js/modules/payments/mollie.ts +1 -1
  335. package/src/js/modules/payments/moneris.ts +2 -2
  336. package/src/js/modules/payments/opayo.ts +21 -8
  337. package/src/js/modules/payments/paddle.ts +10 -6
  338. package/src/js/modules/payments/payment.ts +22 -18
  339. package/src/js/modules/payments/paypal.ts +1 -1
  340. package/src/js/modules/payments/payway.ts +2 -2
  341. package/src/js/modules/payments/square.ts +2 -2
  342. package/src/js/modules/payments/stripe.ts +5 -5
  343. package/src/js/modules/payments/utils.ts +14 -0
  344. package/src/js/modules/registry.ts +19 -11
  345. package/src/js/submit/pipeline.ts +10 -11
  346. package/src/js/theme/browser-theme-state.generated.ts +25 -0
  347. package/src/js/theme/theme-classes.ts +3 -3
  348. package/src/js/transport/forms-api.ts +66 -67
  349. package/src/js/utils/country-from-ip.ts +14 -9
  350. package/src/js/utils/csrf.ts +136 -0
  351. package/src/js/utils/field-references.parser.ts +13 -113
  352. package/src/js/utils/field-references.resolver.ts +27 -64
  353. package/src/js/utils/field-references.row-scope.ts +1 -1
  354. package/src/js/utils/field-references.types.ts +1 -0
  355. package/src/js/utils/http.ts +5 -5
  356. package/src/js/utils/request-profile.ts +10 -0
  357. package/src/js/utils/unload-warning.ts +12 -4
  358. package/src/js/validation/rules/email.ts +3 -5
  359. package/src/js/validation/rules/match.ts +2 -1
  360. package/src/js/validation/rules/minmax.ts +4 -43
  361. package/src/js/validation/rules/number.ts +3 -47
  362. package/src/js/validation/rules/pattern.ts +3 -8
  363. package/src/js/validation/rules/required.ts +2 -1
  364. package/src/js/validation/rules/shared.ts +5 -1
  365. package/src/js/validation/rules/url.ts +3 -10
  366. package/src/js/validation/skip.ts +9 -0
  367. package/src/js/validation/submit-readiness.ts +9 -2
  368. package/src/js/validation/validator.ts +35 -59
  369. package/dist/chunks/calculations-Dv3hYb8_.js +0 -299
  370. package/dist/chunks/conditions-CPH1snCx.js +0 -424
  371. package/dist/chunks/country-from-ip-BwxKaBuJ.js +0 -26
  372. package/dist/chunks/field-references.resolver-CHwn0G0L.js +0 -145
  373. package/dist/chunks/friendly-captcha-v1-C_2reOXr.js +0 -31
  374. package/dist/chunks/google-address-BH3Zhi06.js +0 -161
  375. package/dist/chunks/http-D-JExro7.js +0 -27
  376. package/dist/chunks/opayo-CR0DtsLa.js +0 -179
  377. package/dist/chunks/rich-text-Bg_--4TG.js +0 -349
  378. package/dist/js/modules/fields/conditions/transforms.d.ts +0 -3
  379. package/dist/js/modules/fields/conditions/transforms.d.ts.map +0 -1
  380. package/src/js/modules/fields/conditions/transforms.ts +0 -206
  381. package/src/js/modules/payments/stub-payment-module.ts +0 -87
package/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 1.0.14 - 2026-10-08
6
+
7
+ ### Added
8
+ - Add a `formie:field:clear` event for custom controls to clear their values when conditions hide a field or page.
9
+ - Add one generated browser-theme state manifest and canonical state classes for browser-created controls.
10
+ - Add `data-formie-validation-skip` so helper controls (such as the Upload Manager browse input) can opt out of client-side validation.
11
+
12
+ ### Changed
13
+ - Use Tailwind's Rose palette for the default danger theme colors.
14
+ - Use Tailwind's Emerald palette for the default success theme colors.
15
+ - Add themeable borders to success and error form messages.
16
+ - Consume canonical payment actions and domain status independently from completion redirects, retaining the Formie 3 response facade.
17
+ - Expose mounted instances and current failures as a structured hydration report, separately from runtime lifecycle controls.
18
+ - Consume canonical completion data attributes and response fields while retaining Formie 3 markup and response fallbacks.
19
+ - Resolve surface-specific browser-module manifests by exact occurrence key, pass the exact rendering surface to match and setup hooks, and expose stable `beforeSubmit` and `afterSubmit` lifecycle hooks instead of internal pipeline stages.
20
+ - Read the bounded `data-formie-theme-classes` contract, stop posting executable theme config during Summary refreshes, and keep client-rendered forms responsible for their own markup.
21
+ - Split required `formie-base.css` behaviour from optional `formie-theme.css` visuals while retaining combined `formie.css`.
22
+ - Share versioned tri-state conditions and plain-text validation rules across PHP and browser consumers; enforce recursive hidden-value clearing and server-authoritative navigation.
23
+ - Preserve exact nested submission error paths, return typed page-transition results, and distinguish skipped side effects from invalid condition configuration.
24
+ - Consume the shared completion outcome and preserve the server-owned configuration and query-prefill boundary.
25
+ - Resolve trusted versioned browser modules, reconcile occurrence lifecycles and failures, and restrict full form mounts to server-rendered HTML.
26
+ - Share reference parsing with the Variable Picker and diagnose unavailable browser references.
27
+ - Initialize Opayo through its CSRF-protected payment-session endpoint and display unknown payment outcomes as awaiting reconciliation.
28
+ - Use browser-bound creation plus separate view, delete and attach capabilities for Upload Manager assets, and submit staged files as structured upload references instead of authoritative asset IDs.
29
+ - Carry expected submission versions and signed request tokens through submit and page-state requests.
30
+
31
+ ### Fixed
32
+ - Fixed successful front-end submission edits showing an unsaved-changes warning when leaving the page.
33
+ - Fixed saved uploads being cleared when opening a submission for editing or resuming.
34
+ - Fixed conditional Date/Time fields failing to initialize when shown again.
35
+ - Fixed conditionally hidden date and signature fields retaining their previous values.
36
+ - Fixed browser module errors repeatedly updating the page and making forms unresponsive.
37
+ - Fixed unchecked checkbox groups being treated as nonempty by browser conditions.
38
+ - Fixed empty searchable multi-select fields being treated as filled by conditions.
39
+ - Fixed date pickers retaining a submitted date after their visible input reset.
40
+ - Fixed signatures carrying over into a new submission after a form reset.
41
+ - Fixed searchable Dropdown fields showing a stale selection after a form reset.
42
+ - Fixed checkbox, radio, rich-text, rating, and rank fields retaining stale values or display state after a form reset.
43
+ - Fixed “Disable Submit Button Until Valid” being ignored on server-rendered forms and repeatedly updating disabled buttons.
44
+ - Fixed successful AJAX redirects triggering an unsaved-changes warning.
45
+ - Fixed refreshed upload tokens triggering an unsaved-changes warning after a successful form submission.
46
+ - Fix TypeScript declaration imports when the npm packages are installed outside the Formie workspace.
47
+ - Present required browser-module failures as accessible alerts with collapsed, copyable technical details, while keeping raw exception details restricted to Craft's authenticated submission editor.
48
+ - Let the persistent field error region own announcements without reserving empty layout space or overriding its configured priority with nested assertive alerts. ([#2954](https://github.com/verbb/formie/issues/2954))
49
+ - Keep Stripe checkout amounts aligned with server rounding and UGX currency conversion.
50
+ - Open Paddle checkout using the transaction created by the server.
51
+ - Refresh cached form tokens when Twig emits the static-cache attribute without a value.
52
+ - Fix required File Upload fields using Upload Manager never passing client-side validation after a successful upload. ([#2924](https://github.com/verbb/formie/issues/2924))
53
+ - Fix Advanced Upload Manager and form transport helpers hard-coding `CRAFT_CSRF_TOKEN`, so uploads and related XHR requests work when Craft’s `csrfTokenName` is customised.
54
+
5
55
  ## 1.0.13 - 2026-07-09
6
56
 
7
57
  ### Fixed
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./debug-BV0DvdHx.js";
2
2
  import { i as t, n } from "./constants-DVcJAvc5.js";
3
- import { r } from "./shared-Bx9s0i0P.js";
4
- import { n as i } from "./country-from-ip-BwxKaBuJ.js";
3
+ import { i as r } from "./shared-OKhSay59.js";
4
+ import { n as i } from "./country-from-ip-DDj_mFki.js";
5
5
  //#region src/js/modules/fields/address-country.ts
6
6
  var a = "address-country", o = n.country, s = e("fields", "address-country");
7
7
  function c(e, t, n) {
@@ -35,7 +35,7 @@ async function f(e, n) {
35
35
  return;
36
36
  }
37
37
  if (r.value.trim()) return;
38
- let a = await i(n.countryFromIpAction);
38
+ let a = await i(n.countryFromIpAction, e.closest("form"));
39
39
  if (!a?.countryCode) return;
40
40
  if (!l(a.countryCode, n.countryAllowed)) {
41
41
  s.log("Detected country is not in the allowed list; skipping preselect.", { countryCode: a.countryCode });
@@ -49,7 +49,13 @@ async function f(e, n) {
49
49
  await d(r, f), s.log("Preselected country from IP.", { selectValue: f });
50
50
  }
51
51
  var p = {
52
- id: a,
52
+ moduleId: `formie:${a}`,
53
+ version: 2,
54
+ surfaces: [
55
+ "server-rendered",
56
+ "client-rendered",
57
+ "cp-edit"
58
+ ],
53
59
  kind: "field",
54
60
  match: (e) => !!e.target.querySelector(o),
55
61
  setup: async (e) => {
@@ -1,9 +1,9 @@
1
1
  import { n as e } from "./event-names-BCI2FLD8.js";
2
- import { t } from "./api-sPqGbOww.js";
2
+ import { t } from "./api-ghNr2uxX.js";
3
3
  import { r as n } from "./scripts-CbQ7agX3.js";
4
4
  //#region src/js/modules/address/address-finder.ts
5
5
  var r = "FORMIE_ADDRESS_FINDER_SCRIPT", i = t({
6
- id: "address-finder",
6
+ moduleId: "formie:address-finder",
7
7
  load: async () => n("AddressFinder", {
8
8
  id: r,
9
9
  src: "https://api.addressfinder.io/assets/v3/widget.js",
@@ -1,55 +1,58 @@
1
- import { t as e } from "./debug-BV0DvdHx.js";
2
- import { n as t } from "./constants-DVcJAvc5.js";
3
- import { r as n, t as r } from "./shared-Bx9s0i0P.js";
4
- import { initFormieCombobox as i } from "./combobox-C0EuExSI.js";
1
+ import { t as e } from "./request-profile-DhwkeCpS.js";
2
+ import { t } from "./dist-ZLeW0zZ3.js";
3
+ import { t as n } from "./debug-BV0DvdHx.js";
4
+ import { a as r, n as i } from "./theme-classes-DAQuEqdP.js";
5
+ import { n as a } from "./constants-DVcJAvc5.js";
6
+ import { i as o, n as s } from "./shared-OKhSay59.js";
7
+ import { initFormieCombobox as c } from "./combobox-CWNdx4Fk.js";
5
8
  //#region src/js/modules/fields/address-state.ts
6
- var a = "[data-formie-address-state-dynamic]", o = "[data-formie-address-state-input]", s = "[data-formie-address-state-autofill-anchor]", c = "formie-address-autofill-start", l = t.country, u = "address-state", d = "formie/address/subdivisions", f = ["formie-select", "formie-dropdown-input"], p = [
9
+ var l = "[data-formie-address-state-dynamic]", u = "[data-formie-address-state-input]", d = "[data-formie-address-state-autofill-anchor]", f = "formie-address-autofill-start", p = a.country, m = "address-state", h = "formie/address/subdivisions", g = ["formie-select", "formie-dropdown-input"], _ = [
7
10
  0,
8
11
  100,
9
12
  300
10
- ], m = e("fields", "address-state"), h = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
11
- function _(e) {
13
+ ], v = n("fields", "address-state"), y = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map();
14
+ function x(e) {
12
15
  return e.closest("[data-formie-field-type=\"address\"]") || e.closest("[data-formie-address-field-layout]")?.closest("[data-formie-field]") || e.closest("[data-formie-field]");
13
16
  }
14
- function v(e) {
15
- let t = e.querySelector(l);
17
+ function S(e) {
18
+ let t = e.querySelector(p);
16
19
  return t instanceof HTMLInputElement || t instanceof HTMLSelectElement ? t : null;
17
20
  }
18
- function y(e) {
19
- let t = e.querySelector(a);
21
+ function C(e) {
22
+ let t = e.querySelector(l);
20
23
  return t instanceof HTMLInputElement || t instanceof HTMLSelectElement ? t : null;
21
24
  }
22
- function b(e) {
25
+ function w(e) {
23
26
  return e.querySelector("[data-formie-field-label]");
24
27
  }
25
- function x(e) {
28
+ function T(e) {
26
29
  e.dispatchEvent(new Event("input", { bubbles: !0 })), e.dispatchEvent(new Event("change", { bubbles: !0 }));
27
30
  }
28
- function S(e, t) {
31
+ function E(e, t) {
29
32
  if (!(e instanceof HTMLSelectElement)) return;
30
33
  let n = e._formieTomSelect;
31
34
  n && n.getValue() !== t && n.setValue(t, !0);
32
35
  }
33
- function C(e, t) {
36
+ function D(e, t) {
34
37
  if (e.value !== t) {
35
- e.value = t, x(e);
38
+ e.value = t, T(e);
36
39
  return;
37
40
  }
38
- S(e, t);
41
+ E(e, t);
39
42
  }
40
- function w(e, t) {
43
+ function O(e, t) {
41
44
  e.autofillAnchor && (e.autofillAnchor.value = t);
42
45
  }
43
- function T(e) {
46
+ function k(e) {
44
47
  let t = e.autofillAnchor?.value?.trim() || "", n = e.stateControl.value?.trim() || "", r = t || n;
45
48
  r && (e.pendingStateValue = r);
46
49
  }
47
- function E(e) {
50
+ function A(e) {
48
51
  return e.pendingStateValue?.trim() || e.autofillAnchor?.value?.trim() || e.stateControl.value?.trim() || "";
49
52
  }
50
- function D(e) {
53
+ function j(e) {
51
54
  if (e.autofillAnchor) return e.autofillAnchor;
52
- let t = e.addressRoot.querySelector(s);
55
+ let t = e.addressRoot.querySelector(d);
53
56
  if (t instanceof HTMLInputElement) e.autofillAnchor = t;
54
57
  else {
55
58
  let t = document.createElement("input");
@@ -57,18 +60,18 @@ function D(e) {
57
60
  }
58
61
  return e.stateControl.setAttribute("autocomplete", "off"), e.stateControl.value && !e.autofillAnchor.value && (e.autofillAnchor.value = e.stateControl.value), e.autofillAnchor;
59
62
  }
60
- function O(e) {
61
- T(e);
62
- let t = E(e);
63
+ function M(e) {
64
+ k(e);
65
+ let t = A(e);
63
66
  if (!t) return;
64
- let n = e.lastSubdivisions, r = n.length > 0 && N(t, n) || t;
65
- C(e.stateControl, r), S(e.stateControl, r), w(e, r), e.pendingStateValue = r;
67
+ let n = e.lastSubdivisions, r = n.length > 0 && L(t, n) || t;
68
+ D(e.stateControl, r), E(e.stateControl, r), O(e, r), e.pendingStateValue = r;
66
69
  }
67
- function k(e, t, n, r) {
68
- let i = new URL(e.startsWith("/") ? e : `/actions/${e}`, window.location.origin);
70
+ function N(e, t, n, r) {
71
+ let i = new URL(/^https?:\/\//.test(e) || e.startsWith("/") ? e : `/actions/${e}`, window.location.origin);
69
72
  return i.searchParams.set("country", t), i.searchParams.set("optionLabel", n), i.searchParams.set("optionValue", r), i.toString();
70
73
  }
71
- function A(e, t, n, r) {
74
+ function P(e, t, n, r) {
72
75
  return [
73
76
  e,
74
77
  t,
@@ -76,34 +79,34 @@ function A(e, t, n, r) {
76
79
  r
77
80
  ].join("|");
78
81
  }
79
- function j(e) {
80
- return h.has(e);
82
+ function F(e) {
83
+ return y.has(e);
81
84
  }
82
- async function M(e, t, n, r) {
83
- let i = A(e, t, n, r);
84
- return h.has(i) ? h.get(i) || null : (g.has(i) || g.set(i, (async () => {
85
+ async function I(e, n, r, i, a) {
86
+ let o = P(e, n, r, i);
87
+ return y.has(o) ? y.get(o) || null : (b.has(o) || b.set(o, (async () => {
85
88
  try {
86
- let a = await fetch(k(r, e, t, n), { headers: { Accept: "application/json" } });
87
- if (!a.ok) return h.set(i, null), null;
88
- let o = await a.json();
89
- return h.set(i, o), o;
89
+ let s = await t(N(i, e, n, r), { headers: { Accept: "application/json" } }, a);
90
+ if (!s.ok) return y.set(o, null), null;
91
+ let c = await s.json();
92
+ return y.set(o, c), c;
90
93
  } catch (t) {
91
- return m.warn("Failed fetching subdivisions.", {
94
+ return v.warn("Failed fetching subdivisions.", {
92
95
  country: e,
93
96
  error: t
94
- }), h.set(i, null), null;
97
+ }), y.set(o, null), null;
95
98
  } finally {
96
- g.delete(i);
99
+ b.delete(o);
97
100
  }
98
- })()), g.get(i) || null);
101
+ })()), b.get(o) || null);
99
102
  }
100
- function N(e, t) {
103
+ function L(e, t) {
101
104
  let n = e.trim().toLowerCase();
102
105
  if (!n) return null;
103
106
  for (let e of t) if (e.value.toLowerCase() === n || (e.name || "").toLowerCase() === n || (e.short || "").toLowerCase() === n || e.label.toLowerCase() === n) return e.value;
104
107
  return null;
105
108
  }
106
- function P(e, t) {
109
+ function R(e, t) {
107
110
  [
108
111
  "id",
109
112
  "name",
@@ -129,33 +132,35 @@ function P(e, t) {
129
132
  t.setAttribute(n, r);
130
133
  });
131
134
  }
132
- function F(e, t) {
135
+ function z(e, t) {
133
136
  t.className = e.className;
134
137
  }
135
- function I(e, t) {
136
- let n = [...f];
137
- e.classList.contains("formie-input-error") && n.push("formie-input-error"), t.className = n.join(" ");
138
+ function B(e, t) {
139
+ let n = [...g];
140
+ i(e, "fieldControlError").forEach((t) => {
141
+ e.classList.contains(t) && n.push(t);
142
+ }), t.className = n.join(" ");
138
143
  }
139
- function L(e, t) {
144
+ function V(e, t) {
140
145
  return e.parentNode?.replaceChild(t, e), t;
141
146
  }
142
- function R(e, t) {
147
+ function H(e, t) {
143
148
  let n = document.createElement("input");
144
- return n.type = "text", P(e, n), F(e, n), n.setAttribute("data-formie-input-type", "text"), n.setAttribute("data-formie-address-state-input", "true"), n.setAttribute("data-formie-single-line-text-input", "true"), n.setAttribute("autocomplete", "off"), n.removeAttribute("data-formie-combobox-input"), n.value = t, n;
149
+ return n.type = "text", R(e, n), z(e, n), n.setAttribute("data-formie-input-type", "text"), n.setAttribute("data-formie-address-state-input", "true"), n.setAttribute("data-formie-single-line-text-input", "true"), n.setAttribute("autocomplete", "off"), n.removeAttribute("data-formie-combobox-input"), n.value = t, n;
145
150
  }
146
- function z(e, t, n, r = "") {
151
+ function U(e, t, n, r = "") {
147
152
  e.innerHTML = "";
148
153
  let i = document.createElement("option");
149
154
  i.value = "", i.textContent = n || "", e.appendChild(i), t.forEach((t) => {
150
155
  let n = document.createElement("option");
151
156
  n.value = t.value, n.textContent = t.label, e.appendChild(n);
152
- }), e.value = N(r, t) || r;
157
+ }), e.value = L(r, t) || r;
153
158
  }
154
- function B(e, t, n, r) {
159
+ function W(e, t, n, r) {
155
160
  let i = document.createElement("select");
156
- return P(e, i), I(e, i), i.setAttribute("data-formie-input-type", "select"), i.setAttribute("data-formie-address-state-input", "true"), i.setAttribute("data-formie-select", "true"), i.setAttribute("data-formie-dropdown-input", "true"), i.removeAttribute("data-formie-single-line-text-input"), i.setAttribute("autocomplete", "off"), z(i, n, r, t), i;
161
+ return R(e, i), B(e, i), i.setAttribute("data-formie-input-type", "select"), i.setAttribute("data-formie-address-state-input", "true"), i.setAttribute("data-formie-select", "true"), i.setAttribute("data-formie-dropdown-input", "true"), i.removeAttribute("data-formie-single-line-text-input"), i.setAttribute("autocomplete", "off"), U(i, n, r, t), i;
157
162
  }
158
- function V(e, t, n, r) {
163
+ function G(e, t, n, r) {
159
164
  let i = e.list;
160
165
  if (!r || n.length === 0) {
161
166
  e.removeAttribute("list"), i && i.remove();
@@ -167,110 +172,110 @@ function V(e, t, n, r) {
167
172
  n.value = t.label, a?.appendChild(n);
168
173
  }), e.setAttribute("list", t);
169
174
  }
170
- function H(e, t) {
171
- let { stateField: n, stateControl: r, required: i } = e;
172
- if (n.classList.toggle("formie-conditionally-hidden", !t), n.toggleAttribute("data-formie-conditionally-hidden", !t), !t) {
173
- r.required = !1, r.disabled = !0;
175
+ function K(e, t) {
176
+ let { stateField: n, stateControl: i, required: a } = e;
177
+ if (r(n, n, "conditionalHidden", !t), n.toggleAttribute("data-formie-conditionally-hidden", !t), !t) {
178
+ i.required = !1, i.disabled = !0;
174
179
  return;
175
180
  }
176
- r.disabled = !1, r.required = i;
181
+ i.disabled = !1, i.required = a;
177
182
  }
178
- function U(e) {
183
+ function q(e) {
179
184
  if (e.fetchingAnnouncementEl) return e.fetchingAnnouncementEl;
180
185
  let t = document.createElement("div");
181
186
  return t.className = "formie-sr-only", t.setAttribute("data-formie-address-state-fetching-announce", "true"), t.setAttribute("aria-live", "polite"), t.setAttribute("aria-atomic", "true"), e.addressRoot.appendChild(t), e.fetchingAnnouncementEl = t, t;
182
187
  }
183
- function W() {
188
+ function J() {
184
189
  let e = document.createElement("div");
185
190
  e.className = "formie-address-state-skeleton", e.setAttribute("data-formie-address-state-skeleton", "true"), e.setAttribute("aria-hidden", "true");
186
191
  let t = document.createElement("div");
187
192
  return t.className = "formie-address-state-skeleton-input", e.appendChild(t), e;
188
193
  }
189
- function G(e) {
190
- e.addressRoot.setAttribute("data-formie-address-state-fetching", "true"), e.countryControl?.setAttribute("aria-busy", "true"), e.stateControl.setAttribute("aria-hidden", "true"), e.stateControl.setAttribute("tabindex", "-1"), e.stateField.classList.remove("formie-conditionally-hidden"), e.stateField.removeAttribute("data-formie-conditionally-hidden"), e.stateField.setAttribute("data-formie-address-state-skeleton-active", "true");
194
+ function Y(e) {
195
+ e.addressRoot.setAttribute("data-formie-address-state-fetching", "true"), e.countryControl?.setAttribute("aria-busy", "true"), e.stateControl.setAttribute("aria-hidden", "true"), e.stateControl.setAttribute("tabindex", "-1"), r(e.stateField, e.stateField, "conditionalHidden", !1), e.stateField.removeAttribute("data-formie-conditionally-hidden"), e.stateField.setAttribute("data-formie-address-state-skeleton-active", "true");
191
196
  let t = e.stateField.querySelector("[data-formie-field-control]");
192
- t instanceof HTMLElement && (e.skeletonEl || (e.skeletonEl = W(), t.appendChild(e.skeletonEl)), e.skeletonEl.removeAttribute("hidden")), U(e).textContent = "Loading state or province options for the selected country.";
197
+ t instanceof HTMLElement && (e.skeletonEl || (e.skeletonEl = J(), t.appendChild(e.skeletonEl)), e.skeletonEl.removeAttribute("hidden")), q(e).textContent = "Loading state or province options for the selected country.";
193
198
  }
194
- function K(e) {
199
+ function X(e) {
195
200
  e.addressRoot.removeAttribute("data-formie-address-state-fetching"), e.countryControl?.removeAttribute("aria-busy"), e.stateControl.removeAttribute("aria-hidden"), e.stateControl.removeAttribute("tabindex"), e.stateField.removeAttribute("data-formie-address-state-skeleton-active"), e.skeletonEl?.setAttribute("hidden", "hidden"), e.fetchingAnnouncementEl && (e.fetchingAnnouncementEl.textContent = "");
196
201
  }
197
- function q(e, t) {
198
- let n = b(e);
202
+ function Z(e, t) {
203
+ let n = w(e);
199
204
  if (!n) return;
200
205
  let r = n.querySelector("[data-formie-field-required]");
201
206
  n.textContent = t, r && n.appendChild(r);
202
207
  }
203
- function J(e, t) {
204
- e.setAttribute("data-formie-combobox-input", "true"), r(e, "combobox", "before-init", {
208
+ function Q(e, t) {
209
+ e.setAttribute("data-formie-combobox-input", "true"), s(e, "combobox", "before-init", {
205
210
  select: e,
206
211
  options: { placeholder: t }
207
212
  });
208
- let n = i(e, { placeholder: t });
209
- return r(e, "combobox", "after-init", {
213
+ let n = c(e, { placeholder: t });
214
+ return s(e, "combobox", "after-init", {
210
215
  combobox: e._formieTomSelect,
211
216
  options: { placeholder: t }
212
217
  }), n;
213
218
  }
214
- async function Y(e, t) {
215
- let { hideWhenUnused: n = !0, useSearchable: r = !0, useDatalist: i = !0, optionLabel: a = "name", optionValue: o = "name", placeholder: s = null, subdivisionsAction: c = d } = t, l = e.countryControl?.value?.trim() || "";
216
- T(e);
217
- let u = E(e), f = ++e.fetchGeneration;
218
- if (e.comboboxCleanup?.(), e.comboboxCleanup = null, !l) {
219
- if (q(e.stateField, e.stateField.dataset.formieAddressStateDefaultLabel || "State / Province"), K(e), n) {
220
- H(e, !1), C(e.stateControl, ""), w(e, ""), e.pendingStateValue = "", e.lastSubdivisions = [];
219
+ async function $(t, n) {
220
+ let { hideWhenUnused: r = !0, useSearchable: i = !0, useDatalist: a = !0, optionLabel: o = "name", optionValue: s = "name", placeholder: c = null, subdivisionsAction: l = h } = n, u = t.countryControl?.value?.trim() || "";
221
+ k(t);
222
+ let d = A(t), f = ++t.fetchGeneration;
223
+ if (t.comboboxCleanup?.(), t.comboboxCleanup = null, !u) {
224
+ if (Z(t.stateField, t.stateField.dataset.formieAddressStateDefaultLabel || "State / Province"), X(t), r) {
225
+ K(t, !1), D(t.stateControl, ""), O(t, ""), t.pendingStateValue = "", t.lastSubdivisions = [];
221
226
  return;
222
227
  }
223
- if (H(e, !0), e.stateControl instanceof HTMLSelectElement) {
224
- let t = R(e.stateControl, u);
225
- e.stateControl = L(e.stateControl, t);
226
- } else e.stateControl.disabled = !0, e.stateControl.placeholder = s || e.stateControl.placeholder;
227
- e.lastSubdivisions = [];
228
+ if (K(t, !0), t.stateControl instanceof HTMLSelectElement) {
229
+ let e = H(t.stateControl, d);
230
+ t.stateControl = V(t.stateControl, e);
231
+ } else t.stateControl.disabled = !0, t.stateControl.placeholder = c || t.stateControl.placeholder;
232
+ t.lastSubdivisions = [];
228
233
  return;
229
234
  }
230
- j(A(l, a, o, c)) || G(e);
231
- let p = await M(l, a, o, c);
232
- if (f !== e.fetchGeneration) return;
233
- let m = p?.subdivisions || [], h = p?.administrativeAreaUsed ?? !0, g = p?.administrativeAreaLabel || "State / Province";
234
- if (e.lastSubdivisions = m, K(e), n && !h) {
235
- H(e, !1), C(e.stateControl, ""), w(e, ""), e.pendingStateValue = "";
235
+ F(P(u, o, s, l)) || Y(t);
236
+ let p = await I(u, o, s, l, e(t.addressRoot.closest("form")));
237
+ if (f !== t.fetchGeneration) return;
238
+ let m = p?.subdivisions || [], g = p?.administrativeAreaUsed ?? !0, _ = p?.administrativeAreaLabel || "State / Province";
239
+ if (t.lastSubdivisions = m, X(t), r && !g) {
240
+ K(t, !1), D(t.stateControl, ""), O(t, ""), t.pendingStateValue = "";
236
241
  return;
237
242
  }
238
- if (H(e, !0), q(e.stateField, g), m.length > 0) {
239
- let t = e.stateControl instanceof HTMLSelectElement ? e.stateControl : B(e.stateControl, u, m, s);
240
- e.stateControl === t ? (I(e.stateControl, t), z(t, m, s, t.value)) : e.stateControl = L(e.stateControl, t), r ? e.comboboxCleanup = J(t, s) : t.removeAttribute("data-formie-combobox-input"), C(t, N(u, m) || u), O(e);
243
+ if (K(t, !0), Z(t.stateField, _), m.length > 0) {
244
+ let e = t.stateControl instanceof HTMLSelectElement ? t.stateControl : W(t.stateControl, d, m, c);
245
+ t.stateControl === e ? (B(t.stateControl, e), U(e, m, c, e.value)) : t.stateControl = V(t.stateControl, e), i ? t.comboboxCleanup = Q(e, c) : e.removeAttribute("data-formie-combobox-input"), D(e, L(d, m) || d), M(t);
241
246
  return;
242
247
  }
243
- let _ = e.stateControl instanceof HTMLInputElement ? e.stateControl : R(e.stateControl, u);
244
- e.stateControl !== _ && (e.stateControl = L(e.stateControl, _)), _.disabled = !1, V(_, e.datalistId, m, i), C(_, u), O(e);
248
+ let v = t.stateControl instanceof HTMLInputElement ? t.stateControl : H(t.stateControl, d);
249
+ t.stateControl !== v && (t.stateControl = V(t.stateControl, v)), v.disabled = !1, G(v, t.datalistId, m, a), D(v, d), M(t);
245
250
  }
246
- function X(e, t) {
251
+ function ee(e, t) {
247
252
  let n = () => {
248
- T(e), e.countryControl?.value?.trim() && (e.lastCountry = "", Y(e, t).then(() => {
249
- O(e);
253
+ k(e), e.countryControl?.value?.trim() && (e.lastCountry = "", $(e, t).then(() => {
254
+ M(e);
250
255
  }));
251
256
  };
252
- p.forEach((t) => {
257
+ _.forEach((t) => {
253
258
  let r = window.setTimeout(n, t);
254
259
  e.autofillSweepTimers.push(r);
255
260
  });
256
261
  }
257
- function Z(e) {
262
+ function te(e) {
258
263
  e.countryChangeTimer !== null && (window.clearTimeout(e.countryChangeTimer), e.countryChangeTimer = null), e.autofillSweepTimers.forEach((e) => {
259
264
  window.clearTimeout(e);
260
265
  }), e.autofillSweepTimers = [];
261
266
  }
262
- function Q(e, t) {
263
- let n = _(e);
264
- if (!n) return m.warn("Address root not found; skipping field."), () => {};
265
- let r = y(e);
266
- if (!r) return m.warn("Dynamic state control not found; skipping field."), () => {};
267
- let i = b(e);
267
+ function ne(e, t) {
268
+ let n = x(e);
269
+ if (!n) return v.warn("Address root not found; skipping field."), () => {};
270
+ let r = C(e);
271
+ if (!r) return v.warn("Dynamic state control not found; skipping field."), () => {};
272
+ let i = w(e);
268
273
  i && !e.dataset.formieAddressStateDefaultLabel && (e.dataset.formieAddressStateDefaultLabel = i.textContent?.trim() || "State / Province");
269
- let s = {
274
+ let a = {
270
275
  addressRoot: n,
271
276
  stateField: e,
272
277
  stateControl: r,
273
- countryControl: v(n),
278
+ countryControl: S(n),
274
279
  autofillAnchor: null,
275
280
  pendingStateValue: r.value?.trim() || "",
276
281
  datalistId: `formie-address-state-datalist-${r.getAttribute("data-formie-input-id") || Math.random().toString(36).slice(2)}`,
@@ -284,61 +289,67 @@ function Q(e, t) {
284
289
  required: r.required,
285
290
  lastSubdivisions: []
286
291
  };
287
- D(s);
288
- let l = (e = !1) => {
289
- let n = s.countryControl?.value?.trim() || "";
290
- if (!e && n === s.lastCountry) return;
291
- let r = s.lastCountry, i = E(s);
292
- s.lastCountry = n, Y(s, t).then(() => {
293
- O(s), !(!r || !n || r === n) && !N(i, s.lastSubdivisions) && !E(s) && (C(s.stateControl, ""), w(s, ""));
292
+ j(a);
293
+ let o = (e = !1) => {
294
+ let n = a.countryControl?.value?.trim() || "";
295
+ if (!e && n === a.lastCountry) return;
296
+ let r = a.lastCountry, i = A(a);
297
+ a.lastCountry = n, $(a, t).then(() => {
298
+ M(a), r && n && r !== n && !L(i, a.lastSubdivisions) && !A(a) && (D(a.stateControl, ""), O(a, ""));
294
299
  });
295
- }, u = () => {
296
- s.countryChangeTimer !== null && window.clearTimeout(s.countryChangeTimer), s.countryChangeTimer = window.setTimeout(() => {
297
- s.countryChangeTimer = null, T(s), l(!0);
300
+ }, s = () => {
301
+ a.countryChangeTimer !== null && window.clearTimeout(a.countryChangeTimer), a.countryChangeTimer = window.setTimeout(() => {
302
+ a.countryChangeTimer = null, k(a), o(!0);
298
303
  }, 50);
299
- }, d = (e) => {
304
+ }, c = (e) => {
300
305
  let n = e.target;
301
306
  if (!(n instanceof HTMLInputElement || n instanceof HTMLSelectElement)) return;
302
- let r = n === s.autofillAnchor, i = n.matches(a) || n.matches(o);
303
- if (!(!r && !i) && (i && !r && w(s, n.value), T(s), s.countryControl?.value?.trim())) {
304
- if (s.lastSubdivisions.length > 0) {
305
- O(s);
307
+ let r = n === a.autofillAnchor, i = n.matches(l) || n.matches(u);
308
+ if ((r || i) && (i && !r && O(a, n.value), k(a), a.countryControl?.value?.trim())) {
309
+ if (a.lastSubdivisions.length > 0) {
310
+ M(a);
306
311
  return;
307
312
  }
308
- s.lastCountry = "", Y(s, t).then(() => {
309
- O(s);
313
+ a.lastCountry = "", $(a, t).then(() => {
314
+ M(a);
310
315
  });
311
316
  }
312
- }, f = (e) => {
313
- if (e.animationName !== c) return;
317
+ }, d = (e) => {
318
+ if (e.animationName !== f) return;
314
319
  let r = e.target;
315
- (r instanceof HTMLInputElement || r instanceof HTMLSelectElement) && n.contains(r) && (T(s), s.countryControl?.value?.trim() && (s.lastCountry = "", Y(s, t).then(() => {
316
- O(s);
320
+ (r instanceof HTMLInputElement || r instanceof HTMLSelectElement) && n.contains(r) && (k(a), a.countryControl?.value?.trim() && (a.lastCountry = "", $(a, t).then(() => {
321
+ M(a);
317
322
  })));
318
323
  }, p = (e) => {
319
324
  let n = e.detail?.state?.trim();
320
325
  if (!n) {
321
- l();
326
+ o();
322
327
  return;
323
328
  }
324
- s.pendingStateValue = n, w(s, n), Y(s, t).then(() => {
325
- C(s.stateControl, n), S(s.stateControl, n), s.lastCountry = s.countryControl?.value?.trim() || "";
329
+ a.pendingStateValue = n, O(a, n), $(a, t).then(() => {
330
+ D(a.stateControl, n), E(a.stateControl, n), a.lastCountry = a.countryControl?.value?.trim() || "";
326
331
  });
327
332
  };
328
- return s.countryControl?.addEventListener("change", u), s.countryControl?.addEventListener("input", u), n.addEventListener("input", d), n.addEventListener("change", d), n.addEventListener("animationstart", f), n.addEventListener("formie:address:google:populate", p), n.addEventListener("formie:address:address-finder:populate", p), n.addEventListener("formie:address:loqate:populate", p), n.addEventListener("formie:address:place-kit:populate", p), l(), X(s, t), () => {
329
- Z(s), K(s), s.skeletonEl?.remove(), s.fetchingAnnouncementEl?.remove(), s.autofillAnchor?.remove(), s.comboboxCleanup?.(), s.countryControl?.removeEventListener("change", u), s.countryControl?.removeEventListener("input", u), n.removeEventListener("input", d), n.removeEventListener("change", d), n.removeEventListener("animationstart", f), n.removeEventListener("formie:address:google:populate", p), n.removeEventListener("formie:address:address-finder:populate", p), n.removeEventListener("formie:address:loqate:populate", p), n.removeEventListener("formie:address:place-kit:populate", p);
333
+ return a.countryControl?.addEventListener("change", s), a.countryControl?.addEventListener("input", s), n.addEventListener("input", c), n.addEventListener("change", c), n.addEventListener("animationstart", d), n.addEventListener("formie:address:google:populate", p), n.addEventListener("formie:address:address-finder:populate", p), n.addEventListener("formie:address:loqate:populate", p), n.addEventListener("formie:address:place-kit:populate", p), o(), ee(a, t), () => {
334
+ te(a), X(a), a.skeletonEl?.remove(), a.fetchingAnnouncementEl?.remove(), a.autofillAnchor?.remove(), a.comboboxCleanup?.(), a.countryControl?.removeEventListener("change", s), a.countryControl?.removeEventListener("input", s), n.removeEventListener("input", c), n.removeEventListener("change", c), n.removeEventListener("animationstart", d), n.removeEventListener("formie:address:google:populate", p), n.removeEventListener("formie:address:address-finder:populate", p), n.removeEventListener("formie:address:loqate:populate", p), n.removeEventListener("formie:address:place-kit:populate", p);
330
335
  };
331
336
  }
332
- var $ = {
333
- id: u,
337
+ var re = {
338
+ moduleId: `formie:${m}`,
339
+ version: 2,
340
+ surfaces: [
341
+ "server-rendered",
342
+ "client-rendered",
343
+ "cp-edit"
344
+ ],
334
345
  kind: "field",
335
- match: (e) => !!e.target.querySelector(a),
346
+ match: (e) => !!e.target.querySelector(l),
336
347
  setup: async (e) => {
337
- let t = e.options || {}, r = n(e), i = r.map((e) => Q(e, t));
338
- return m.log("Module setup.", { fieldCount: r.length }), { destroy: () => {
339
- i.forEach((e) => e()), m.log("Module destroy.", { fieldCount: r.length });
348
+ let t = e.options || {}, n = o(e), r = n.map((e) => ne(e, t));
349
+ return v.log("Module setup.", { fieldCount: n.length }), { destroy: () => {
350
+ r.forEach((e) => e()), v.log("Module destroy.", { fieldCount: n.length });
340
351
  } };
341
352
  }
342
353
  };
343
354
  //#endregion
344
- export { $ as addressStateModule };
355
+ export { re as addressStateModule };