@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
@@ -5,60 +5,323 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
5
5
  enumerable: !(s = n(i, d)) || s.enumerable
6
6
  });
7
7
  return e;
8
- }, c = (n, r, a) => (a = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule ? t(a, "default", {
8
+ }, c = (n, r, o) => (o = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
9
9
  value: n,
10
10
  enumerable: !0
11
- }) : a, n));
12
- function l(e) {
13
- return Array.isArray(e) ? e.map((e) => String(e ?? "")) : [String(e ?? "")];
14
- }
15
- function u(e, t) {
16
- return e.some((e) => t.includes(e));
17
- }
18
- function d(e, t) {
19
- return e.some((e) => t.some((t) => t === e || t.includes(e)));
11
+ }) : o, n));
12
+ function l(e, t, n) {
13
+ let r = t.scope;
14
+ if (r === "count") return { value: e.length };
15
+ if (r === "all") return { value: e };
16
+ if (r === "first") return { value: e[0] ?? null };
17
+ if (r === "last") return { value: e[e.length - 1] ?? null };
18
+ if (r === "current" || r === "index") {
19
+ let i = r === "current" ? n : /^[0-9]+$/.test(t.index ?? "") ? Number(t.index) : void 0;
20
+ return i !== void 0 && i >= 0 && i < e.length ? { value: e[i] } : { diagnostic: "invalidRowScope" };
21
+ }
22
+ if (r === "rows") {
23
+ let n = t.rows ?? "";
24
+ if (!/^(?:even|odd|every:[1-9]\d*|[1-9]\d*(?:\s*-\s*[1-9]\d*)?(?:\s*,\s*[1-9]\d*(?:\s*-\s*[1-9]\d*)?)*)$/.test(n)) return { diagnostic: "invalidRowScope" };
25
+ let r = e.filter((e, t) => n === "even" ? t % 2 == 1 : n === "odd" ? t % 2 == 0 : n.startsWith("every:") ? t % Number(n.slice(6)) === 0 : n.split(",").some((e) => {
26
+ let [n, r = n] = e.split("-").map(Number);
27
+ return t + 1 >= Math.min(n, r) && t + 1 <= Math.max(n, r);
28
+ }));
29
+ return { value: r.length === 1 ? r[0] : r };
30
+ }
31
+ return { diagnostic: "missingRowScope" };
20
32
  }
21
- function f(e, t, n) {
22
- return t.some((t) => e.some((e) => n(e, t)));
33
+ var u = {
34
+ version: 1,
35
+ operators: {
36
+ "=": [
37
+ "text",
38
+ "number",
39
+ "boolean",
40
+ "date",
41
+ "time",
42
+ "datetime",
43
+ "collection"
44
+ ],
45
+ "!=": [
46
+ "text",
47
+ "number",
48
+ "boolean",
49
+ "date",
50
+ "time",
51
+ "datetime",
52
+ "collection"
53
+ ],
54
+ ">": [
55
+ "text",
56
+ "number",
57
+ "date",
58
+ "time",
59
+ "datetime"
60
+ ],
61
+ "<": [
62
+ "text",
63
+ "number",
64
+ "date",
65
+ "time",
66
+ "datetime"
67
+ ],
68
+ contains: ["text", "collection"],
69
+ notContains: ["text", "collection"],
70
+ startsWith: ["text"],
71
+ endsWith: ["text"],
72
+ empty: [
73
+ "text",
74
+ "number",
75
+ "boolean",
76
+ "date",
77
+ "time",
78
+ "datetime",
79
+ "collection"
80
+ ],
81
+ notEmpty: [
82
+ "text",
83
+ "number",
84
+ "boolean",
85
+ "date",
86
+ "time",
87
+ "datetime",
88
+ "collection"
89
+ ]
90
+ }
91
+ }, d = (e) => ({
92
+ value: null,
93
+ diagnostics: [{ code: e }]
94
+ }), f = (e) => typeof e == "number" && !Number.isFinite(e) ? null : e == null ? "" : [
95
+ "string",
96
+ "number",
97
+ "boolean"
98
+ ].includes(typeof e) ? String(e) : null, p = (e) => e.replace(/^[ \t\r\n\v\f]+|[ \t\r\n\v\f]+$/g, "");
99
+ function m(e) {
100
+ if (!["number", "string"].includes(typeof e) || !/^[+-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/.test(p(String(e)))) return null;
101
+ let t = Number(e);
102
+ return Number.isFinite(t) ? t : null;
23
103
  }
24
- function p(e, t, n) {
25
- return t.some((t) => {
26
- let r = Number.parseFloat(t);
27
- return Number.isFinite(r) ? e.some((e) => {
28
- let t = Number.parseFloat(e);
29
- return Number.isFinite(t) ? n(t, r) : !1;
30
- }) : !1;
31
- });
104
+ function h(e, t) {
105
+ if (t === "text") return f(e);
106
+ if (t === "number") return m(e);
107
+ if (t === "boolean") {
108
+ if (typeof e == "boolean") return e;
109
+ let t = p(f(e) ?? "").toLowerCase();
110
+ return [
111
+ "true",
112
+ "1",
113
+ "yes",
114
+ "on"
115
+ ].includes(t) ? !0 : ![
116
+ "false",
117
+ "0",
118
+ "no",
119
+ "off"
120
+ ].includes(t) && null;
121
+ }
122
+ if (e && typeof e == "object" && !Array.isArray(e)) {
123
+ let n = e;
124
+ if ((t === "date" ? [
125
+ "year",
126
+ "month",
127
+ "day"
128
+ ] : t === "time" ? ["hour", "minute"] : [
129
+ "year",
130
+ "month",
131
+ "day",
132
+ "hour",
133
+ "minute"
134
+ ]).some((e) => !/^[0-9]+$/.test(String(n[e]))) || "_input" in n || n.second != null && !/^[0-9]+$/.test(String(n.second))) return null;
135
+ let r = Number(n.hour ?? 0);
136
+ if (n.ampm != null) {
137
+ if (!["AM", "PM"].includes(String(n.ampm)) || r < 1 || r > 12) return null;
138
+ r = r % 12 + (n.ampm === "PM" ? 12 : 0);
139
+ }
140
+ let i = `${String(n.year ?? 1970).padStart(4, "0")}-${String(n.month ?? 1).padStart(2, "0")}-${String(n.day ?? 1).padStart(2, "0")}`, a = `${String(r).padStart(2, "0")}:${String(n.minute ?? 0).padStart(2, "0")}:${String(n.second ?? 0).padStart(2, "0")}`;
141
+ if (t === "datetime") {
142
+ if (h(i, "date") === null || h(a, "time") === null) return null;
143
+ let e = String(n.timezone ?? "UTC");
144
+ if (/^(Z|[+-][0-9]{2}:[0-9]{2})$/.test(e)) return h(`${i}T${a}${e}`, "datetime");
145
+ try {
146
+ let t = Date.parse(`${i}T${a}Z`), n = new Intl.DateTimeFormat("en-GB", {
147
+ timeZone: e,
148
+ year: "numeric",
149
+ month: "2-digit",
150
+ day: "2-digit",
151
+ hour: "2-digit",
152
+ minute: "2-digit",
153
+ second: "2-digit",
154
+ hourCycle: "h23"
155
+ }), r = (e) => {
156
+ let t = Object.fromEntries(n.formatToParts(e).map((e) => [e.type, e.value]));
157
+ return Date.parse(`${t.year.padStart(4, "0")}-${t.month}-${t.day}T${t.hour}:${t.minute}:${t.second}Z`);
158
+ }, o = new Set([
159
+ -864e5,
160
+ 0,
161
+ 864e5
162
+ ].map((e) => t - (r(t + e) - (t + e))).filter((e) => r(e) === t));
163
+ return o.size === 1 ? [...o][0] / 1e3 : null;
164
+ } catch {
165
+ return null;
166
+ }
167
+ }
168
+ e = t === "date" ? i : a;
169
+ }
170
+ if (typeof e != "string") return null;
171
+ if (t === "time") {
172
+ let t = e.match(/^([0-9]{2}):([0-9]{2})(?::([0-9]{2}))?$/);
173
+ return t && Number(t[1]) < 24 && Number(t[2]) < 60 && Number(t[3] ?? 0) < 60 ? Number(t[1]) * 3600 + Number(t[2]) * 60 + Number(t[3] ?? 0) : null;
174
+ }
175
+ let n = e.match(t === "date" ? /^([0-9]{4})-([0-9]{2})-([0-9]{2})$/ : /^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[+-][0-9]{2}:[0-9]{2})$/);
176
+ if (!n || Number(n[1]) < 1) return null;
177
+ let r = Number(n[1]), i = [
178
+ 31,
179
+ r % 4 == 0 && (r % 100 != 0 || r % 400 == 0) ? 29 : 28,
180
+ 31,
181
+ 30,
182
+ 31,
183
+ 30,
184
+ 31,
185
+ 31,
186
+ 30,
187
+ 31,
188
+ 30,
189
+ 31
190
+ ];
191
+ if (Number(n[2]) < 1 || Number(n[2]) > 12 || Number(n[3]) < 1 || Number(n[3]) > i[Number(n[2]) - 1] || t === "datetime" && (Number(n[4]) > 23 || Number(n[5]) > 59 || Number(n[6]) > 59 || n[7] !== "Z" && (Number(n[7].slice(1, 3)) > 23 || Number(n[7].slice(4)) > 59))) return null;
192
+ let a = Date.parse(t === "date" ? `${e}T00:00:00Z` : e);
193
+ return Number.isFinite(a) ? a / 1e3 : null;
32
194
  }
33
- function m(e) {
34
- return e.length === 0 || e.every((e) => e.trim() === "");
195
+ function g(e) {
196
+ return e && typeof e == "object" ? Object.values(e).flatMap(g) : [e];
35
197
  }
36
- function h(e, t, n = {}) {
37
- let r = String(e.condition || ""), i = l(e.value), a = n.visibility ?? null;
38
- switch (r) {
39
- case "=": return u(i, t);
40
- case "!=": return !u(i, t);
41
- case ">": return p(t, i, (e, t) => e > t);
42
- case "<": return p(t, i, (e, t) => e < t);
43
- case "contains": return d(i, t);
44
- case "notContains": return !d(i, t);
45
- case "startsWith": return f(t, i, (e, t) => e.startsWith(t));
46
- case "endsWith": return f(t, i, (e, t) => e.endsWith(t));
47
- case "empty": return m(t);
48
- case "notEmpty": return !m(t);
49
- case "visible": return a === !0;
50
- case "hidden": return a === !1;
51
- default: return !1;
198
+ function _(e, t, n, r = "text") {
199
+ if (!u.operators[e]?.includes(r)) return d("unsupportedOperator");
200
+ if (e === "empty" || e === "notEmpty") {
201
+ if (t && typeof t == "object" && !Array.isArray(t) && ![
202
+ "collection",
203
+ "date",
204
+ "time",
205
+ "datetime"
206
+ ].includes(r)) return d("invalidValue");
207
+ let n = t == null || typeof t == "object" && !!t && Object.keys(t).length === 0 || typeof t == "string" && p(t) === "";
208
+ return {
209
+ value: e === "empty" ? n : !n,
210
+ diagnostics: []
211
+ };
212
+ }
213
+ if (r === "collection") {
214
+ if (t != null && typeof t != "object") return d("invalidValue");
215
+ let r = g(t ?? []), i = Array.isArray(n) ? n : [n];
216
+ if ([...r, ...i].some((e) => f(e) === null)) return d("invalidValue");
217
+ let a = r.some((e) => i.some((t) => f(e) === f(t)));
218
+ return {
219
+ value: ["!=", "notContains"].includes(e) ? !a : a,
220
+ diagnostics: []
221
+ };
52
222
  }
223
+ let i = h(t, r), a = h(n, r);
224
+ if (i === null || a === null) return d("invalidValue");
225
+ let o = r === "text" ? ((e, t) => {
226
+ let n = Array.from(e, (e) => e.codePointAt(0)), r = Array.from(t, (e) => e.codePointAt(0));
227
+ for (let e = 0; e < Math.min(n.length, r.length); e++) if (n[e] !== r[e]) return n[e] - r[e];
228
+ return n.length - r.length;
229
+ })(String(i), String(a)) : i === a ? 0 : i > a ? 1 : -1;
230
+ return {
231
+ value: {
232
+ "=": i === a,
233
+ "!=": i !== a,
234
+ ">": o > 0,
235
+ "<": o < 0,
236
+ contains: String(i).includes(String(a)),
237
+ notContains: !String(i).includes(String(a)),
238
+ startsWith: String(i).startsWith(String(a)),
239
+ endsWith: String(i).endsWith(String(a))
240
+ }[e],
241
+ diagnostics: []
242
+ };
243
+ }
244
+ function v(e, t) {
245
+ let n = t.flatMap((e, t) => e.diagnostics.map((e) => ({
246
+ ...e,
247
+ rule: t
248
+ })));
249
+ return ["all", "any"].includes(e) ? n.length || t.some((e) => e.value === null) ? {
250
+ value: null,
251
+ diagnostics: n
252
+ } : {
253
+ value: e === "all" ? t.every((e) => e.value === !0) : t.some((e) => e.value === !0),
254
+ diagnostics: []
255
+ } : d("invalidSchema");
53
256
  }
54
- function g(e, t) {
55
- let n = e.conditionRule === "any" ? t.includes(!0) : t.every((e) => e === !0);
257
+ function y(e, t) {
258
+ let n = v(e.conditionRule, t.map((e) => typeof e == "boolean" ? {
259
+ value: e,
260
+ diagnostics: []
261
+ } : e)), r = n.value === !0;
56
262
  return {
57
- finalResult: n,
58
- shouldHide: n && e.showRule !== "show" || !n && e.showRule === "show"
263
+ finalResult: r,
264
+ shouldHide: ["show", "enable"].includes(e.showRule) ? !r : r,
265
+ evaluation: n
59
266
  };
60
267
  }
61
- var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
268
+ var b = /* @__PURE__ */ new Map();
269
+ function x(e) {
270
+ return e == null || e === !1 || typeof e == "string" && e.trim() === "" || Array.isArray(e) && e.length === 0;
271
+ }
272
+ function S(e, t, n = {}) {
273
+ let r = n.empty ?? x(e), i = n.label ?? "This field", a = (e, n) => t.messages?.[e] ?? t.message ?? n;
274
+ if (t.type === "required") return r ? a("required", `${i} cannot be blank.`) : null;
275
+ if (r) return null;
276
+ if (t.type === "email") return typeof e == "string" && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e) ? null : a("email", `${i} is not a valid email address.`);
277
+ if (t.type === "number") {
278
+ let n = m(e);
279
+ return n === null ? a("number", `${i} is not a valid number.`) : t.min != null && n < t.min ? a("numberMin", `${i} must be no less than ${t.min}.`) : t.max != null && n > t.max ? a("numberMax", `${i} must be no greater than ${t.max}.`) : null;
280
+ }
281
+ if (t.type === "url") {
282
+ try {
283
+ let t = new URL(String(e));
284
+ if (["http:", "https:"].includes(t.protocol)) return null;
285
+ } catch {}
286
+ return a("url", `${i} is not a valid URL.`);
287
+ }
288
+ if (t.type === "pattern") try {
289
+ let n = t.pattern instanceof RegExp ? t.pattern : typeof t.pattern == "string" ? RegExp(`^(?:${t.pattern})$`) : null;
290
+ return n ? (n.lastIndex = 0, n.test(String(e)) ? null : a("pattern", `${i} is not a valid format.`)) : null;
291
+ } catch {
292
+ return null;
293
+ }
294
+ if (t.type === "match") return n.comparison === void 0 || e === n.comparison ? null : a("match", `${i} must match ${n.comparisonLabel ?? "the other field"}.`);
295
+ if (t.type === "minmaxOptions" && Array.isArray(e)) {
296
+ if (t.min != null && e.length < t.min) return a("minOptions", `Please select at least ${t.min} options.`);
297
+ if (t.max != null && e.length > t.max) return a("maxOptions", `Please select no more than ${t.max} options.`);
298
+ }
299
+ return b.get(t.type)?.(e, t, n) ?? null;
300
+ }
301
+ function C(e) {
302
+ let t = e;
303
+ if (!t || t.contractVersion !== 2 || ![
304
+ "server-rendered",
305
+ "client-rendered",
306
+ "cp-edit"
307
+ ].includes(t.surface) || !Array.isArray(t.entries)) throw Error("Unsupported browser module contractVersion. Update Formie and its browser packages together.");
308
+ let n = /* @__PURE__ */ new Set();
309
+ for (let e of t.entries) {
310
+ if (!e || typeof e.key != "string" || !e.key || n.has(e.key) || typeof e.moduleId != "string" || !/^[a-z][a-z0-9.-]*:[a-z][a-z0-9.-]*$/.test(e.moduleId) || "src" in e || !Array.isArray(e.targets) || e.targets.length === 0 || typeof e.required != "boolean" || !e.config || typeof e.config != "object" || Array.isArray(e.config) || ![
311
+ "field",
312
+ "captcha",
313
+ "payment",
314
+ "address",
315
+ "core"
316
+ ].includes(e.kind)) throw Error("Invalid browser module entry. Check the registered module ID, occurrence key, kind and targets.");
317
+ for (let t of e.targets) {
318
+ let e = t && typeof t == "object" ? Object.keys(t).length : 0;
319
+ if (!(t && (t.type === "form" && e === 1 || t.type === "field" && e === 2 && typeof t.uid == "string" && t.uid !== "" || t.type === "page" && e === 2 && typeof t.id == "string" && t.id !== "" || t.type === "action" && e === 2 && typeof t.action == "string" && t.action !== "" || t.type === "selector" && e === 2 && typeof t.selector == "string" && t.selector !== ""))) throw Error("Invalid browser module target. Fields require a form-field instance UID.");
320
+ }
321
+ n.add(e.key);
322
+ }
323
+ }
324
+ var w = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
62
325
  (function(n, r) {
63
326
  typeof e == "object" && t !== void 0 ? r(e) : typeof define == "function" && define.amd ? define(["exports"], r) : r((n = typeof globalThis < "u" ? globalThis : n || self).ExpressionLanguage = {});
64
327
  })(e, function(e) {
@@ -122,7 +385,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
122
385
  }
123
386
  this.next();
124
387
  }), t(this, "isEOF", () => a.EOF_TYPE === this.current.type), t(this, "isEqualTo", (e) => {
125
- if (e == null || !e instanceof i || e.tokens.length !== this.tokens.length) return !1;
388
+ if (e == null || !(e instanceof i) || e.tokens.length !== this.tokens.length) return !1;
126
389
  let t = e.position;
127
390
  e.position = 0;
128
391
  let n = !0;
@@ -137,16 +400,16 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
137
400
  }), t(this, "diff", (e) => {
138
401
  let t = [];
139
402
  if (!this.isEqualTo(e)) {
140
- let n = e.position;
403
+ let n = 0, r = e.position;
141
404
  e.position = 0;
142
- for (let n of this.tokens) {
143
- let r = n.diff(e.current);
144
- r.length > 0 && t.push({
145
- index: 0,
146
- diff: r
147
- }), e.position < e.tokens.length - 1 && e.next();
405
+ for (let r of this.tokens) {
406
+ let i = r.diff(e.current);
407
+ i.length > 0 && t.push({
408
+ index: n,
409
+ diff: i
410
+ }), e.position < e.tokens.length - 1 && e.next(), n++;
148
411
  }
149
- e.position = n;
412
+ e.position = r;
150
413
  }
151
414
  return t;
152
415
  }), this.expression = e, this.position = 0, this.tokens = n;
@@ -163,7 +426,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
163
426
  }
164
427
  class a {
165
428
  constructor(e, n, r) {
166
- t(this, "test", (e, t = null) => this.type === e && (t === null || this.value === t)), t(this, "isEqualTo", (e) => !(e == null || !e instanceof a) && e.value == this.value && e.type === this.type && e.cursor === this.cursor), t(this, "diff", (e) => {
429
+ t(this, "test", (e, t = null) => this.type === e && (t === null || this.value === t)), t(this, "isEqualTo", (e) => e != null && e instanceof a && e.value == this.value && e.type === this.type && e.cursor === this.cursor), t(this, "diff", (e) => {
167
430
  let t = [];
168
431
  return this.isEqualTo(e) || (e.value !== this.value && t.push(`Value: ${e.value} != ${this.value}`), e.cursor !== this.cursor && t.push(`Cursor: ${e.cursor} != ${this.cursor}`), e.type !== this.type && t.push(`Type: ${e.type} != ${this.type}`)), t;
169
432
  }), this.value = n, this.type = e, this.cursor = r;
@@ -304,32 +567,33 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
304
567
  else r.push(".", c, l);
305
568
  i += l.length + 2;
306
569
  } else r.push(o);
307
- for (i = 0; i < e.length; i++) if (o = e.charAt(i), r.indexOf(o) !== -1) if (n += "\\", (h = o.charCodeAt(0)) < 32 || h > 126) switch (o) {
308
- case "\n":
309
- n += "n";
310
- break;
311
- case " ":
312
- n += "t";
313
- break;
314
- case "\r":
315
- n += "r";
316
- break;
317
- case "\x07":
318
- n += "a";
319
- break;
320
- case "\v":
321
- n += "v";
322
- break;
323
- case "\b":
324
- n += "b";
325
- break;
326
- case "\f":
327
- n += "f";
328
- break;
329
- default: for (_ = encodeURIComponent(o), (g = v.exec(_)) !== null && (n += y(parseInt(g[1], 16).toString(8), 3)); (g = v.exec(_)) !== null;) n += "\\" + y(parseInt(g[1], 16).toString(8), 3);
330
- }
331
- else n += o;
332
- else n += o;
570
+ for (i = 0; i < e.length; i++) if (o = e.charAt(i), r.indexOf(o) !== -1) {
571
+ if (n += "\\", (h = o.charCodeAt(0)) < 32 || h > 126) switch (o) {
572
+ case "\n":
573
+ n += "n";
574
+ break;
575
+ case " ":
576
+ n += "t";
577
+ break;
578
+ case "\r":
579
+ n += "r";
580
+ break;
581
+ case "\x07":
582
+ n += "a";
583
+ break;
584
+ case "\v":
585
+ n += "v";
586
+ break;
587
+ case "\b":
588
+ n += "b";
589
+ break;
590
+ case "\f":
591
+ n += "f";
592
+ break;
593
+ default: for (_ = encodeURIComponent(o), (g = v.exec(_)) !== null && (n += y(parseInt(g[1], 16).toString(8), 3)); (g = v.exec(_)) !== null;) n += "\\" + y(parseInt(g[1], 16).toString(8), 3);
594
+ }
595
+ else n += o;
596
+ } else n += o;
333
597
  return n;
334
598
  }
335
599
  class _ {
@@ -376,7 +640,20 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
376
640
  right: r
377
641
  }, { operator: e }), t(this, "compile", (e) => {
378
642
  let t = this.attributes.operator;
379
- t === "matches" ? e.compile(this.nodes.right).raw(".test(").compile(this.nodes.left).raw(")") : t === "contains" ? e.raw("(").compile(this.nodes.left).raw(".toString().toLowerCase().includes(").compile(this.nodes.right).raw(".toString().toLowerCase())") : t === "starts with" ? e.raw("(").compile(this.nodes.left).raw(".toString().toLowerCase().startsWith(").compile(this.nodes.right).raw(".toString().toLowerCase())") : t === "ends with" ? e.raw("(").compile(this.nodes.left).raw(".toString().toLowerCase().endsWith(").compile(this.nodes.right).raw(".toString().toLowerCase())") : v.functions[t] === void 0 ? (v.operators[t] !== void 0 && (t = v.operators[t]), e.raw("(").compile(this.nodes.left).raw(" ").raw(t).raw(" ").compile(this.nodes.right).raw(")")) : e.raw(`${v.functions[t]}(`).compile(this.nodes.left).raw(", ").compile(this.nodes.right).raw(")");
643
+ if (t !== "matches") {
644
+ if (t !== "contains") {
645
+ if (t !== "starts with") {
646
+ if (t !== "ends with") {
647
+ if (t === "in" || t === "not in") {
648
+ let n = t === "not in" ? "=== -1" : ">= 0";
649
+ e.raw("(function(__l, __r){return __r.indexOf(__l) " + n + ";})(").compile(this.nodes.left).raw(", ").compile(this.nodes.right).raw(")");
650
+ return;
651
+ }
652
+ t === ".." ? e.raw("(function(__s, __e){var __r=[];for(var __i=__s;__i<=__e;__i++){__r.push(__i);}return __r;})(").compile(this.nodes.left).raw(", ").compile(this.nodes.right).raw(")") : v.functions[t] === void 0 ? (v.operators[t] !== void 0 && (t = v.operators[t]), e.raw("(").compile(this.nodes.left).raw(" ").raw(t).raw(" ").compile(this.nodes.right).raw(")")) : e.raw(`${v.functions[t]}(`).compile(this.nodes.left).raw(", ").compile(this.nodes.right).raw(")");
653
+ } else e.raw("(").compile(this.nodes.left).raw(".toString().toLowerCase().endsWith(").compile(this.nodes.right).raw(".toString().toLowerCase())");
654
+ } else e.raw("(").compile(this.nodes.left).raw(".toString().toLowerCase().startsWith(").compile(this.nodes.right).raw(".toString().toLowerCase())");
655
+ } else e.raw("(").compile(this.nodes.left).raw(".toString().toLowerCase().includes(").compile(this.nodes.right).raw(".toString().toLowerCase())");
656
+ } else e.compile(this.nodes.right).raw(".test(").compile(this.nodes.left).raw(")");
380
657
  }), t(this, "evaluate", (e, t) => {
381
658
  let n = this.attributes.operator, r = this.nodes.left.evaluate(e, t);
382
659
  if (v.functions[n] !== void 0) {
@@ -627,8 +904,8 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
627
904
  let n = this.nodes.node.evaluate(e, t);
628
905
  if (n === null && (this.nodes.attribute.isNullSafe || this.attributes.is_null_coalesce)) return this.attributes.is_short_circuited = !0, null;
629
906
  if (n === null && this.isShortCircuited()) return null;
630
- if (typeof n != "object") throw Error(`Unable to get property "${r}" on a non-object: ` + typeof n);
631
907
  let r = this.nodes.attribute.attributes.value;
908
+ if (typeof n != "object") throw Error(`Unable to get property "${r}" on a non-object: ` + typeof n);
632
909
  return this.attributes.is_null_coalesce ? n[r] ?? null : n[r];
633
910
  case E.METHOD_CALL:
634
911
  let i = this.nodes.node.evaluate(e, t);
@@ -690,21 +967,21 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
690
967
  this.nodes.expr2,
691
968
  ")"
692
969
  ]), t(this, "_addNullCoalesceAttributeToGetAttrNodes", (e) => {
693
- if (!(!e instanceof E)) {
970
+ if (e instanceof E) {
694
971
  e.attributes.is_null_coalesce = !0;
695
972
  for (let t of Object.values(e.nodes)) this._addNullCoalesceAttributeToGetAttrNodes(t);
696
973
  }
697
974
  }), this.name = "NullCoalesceNode";
698
975
  }
699
976
  }
700
- class O extends _ {
977
+ class ee extends _ {
701
978
  constructor(e) {
702
979
  super({}, { name: e }), t(this, "compile", (e) => {
703
980
  e.raw(this.attributes.name + " ?? null");
704
981
  }), t(this, "evaluate", (e, t) => null), t(this, "toArray", () => [this.attributes.name + " ?? null"]), this.name = "NullCoalescedNameNode";
705
982
  }
706
983
  }
707
- class k {
984
+ class te {
708
985
  constructor(e = {}) {
709
986
  t(this, "functions", {}), t(this, "unaryOperators", {
710
987
  not: { precedence: 50 },
@@ -850,7 +1127,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
850
1127
  t === null && (console.log("Deprecated: passing \"null\" as the second argument of lint is deprecated, pass IGNORE_UNKNOWN_VARIABLES instead as the third argument"), n |= 1, t = []), this.parse(e, t, n);
851
1128
  }), t(this, "parseExpression", (e = 0) => {
852
1129
  let t = this.getPrimary(), n = this.tokenStream.current;
853
- if (this.nestedExecutions++, this.nestedExecutions > 1e3) throw Error("Way to many executions on '" + n.toString() + "' of '" + this.tokenStream.toString() + "'");
1130
+ if (this.nestedExecutions++, this.nestedExecutions > 1e3) throw Error("Too many executions on '" + n.toString() + "' of '" + this.tokenStream.toString() + "'");
854
1131
  for (; n.test(a.OPERATOR_TYPE) && this.binaryOperators[n.value] !== void 0 && this.binaryOperators[n.value] !== null && this.binaryOperators[n.value].precedence >= e;) {
855
1132
  let e = this.binaryOperators[n.value];
856
1133
  this.tokenStream.next();
@@ -965,7 +1242,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
965
1242
  if (1 & this.flags) n = e.value;
966
1243
  else {
967
1244
  if (!this.hasVariable(e.value)) {
968
- if (this.tokenStream.current.test(a.PUNCTUATION_TYPE, "??")) return new O(e.value);
1245
+ if (this.tokenStream.current.test(a.PUNCTUATION_TYPE, "??")) return new ee(e.value);
969
1246
  throw new r(`Variable "${e.value}" is not valid`, e.cursor, this.tokenStream.expression, e.value, this.getNames());
970
1247
  }
971
1248
  n = e.value, this.objectMatches[n] !== void 0 && (n = this.getNames()[this.objectMatches[n]]);
@@ -985,7 +1262,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
985
1262
  return this.parsePostfixExpression(t);
986
1263
  }
987
1264
  }
988
- class A {
1265
+ class ne {
989
1266
  constructor(e) {
990
1267
  t(this, "getFunction", (e) => this.functions[e]), t(this, "getSource", () => this.source), t(this, "reset", () => (this.source = "", this)), t(this, "compile", (e) => (e.compile(this), this)), t(this, "subcompile", (e) => {
991
1268
  let t = this.source;
@@ -997,22 +1274,22 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
997
1274
  else if (Number.isInteger(e) || +e === e && (!isFinite(e) || e % 1)) this.raw(e);
998
1275
  else if (e === null) this.raw("null");
999
1276
  else if (typeof e == "boolean") this.raw(e ? "true" : "false");
1000
- else if (typeof e == "object") {
1001
- this.raw("{");
1002
- let t = !0;
1003
- for (let n of Object.keys(e)) t || this.raw(", "), t = !1, this.repr(n), this.raw(":"), this.repr(e[n]);
1004
- this.raw("}");
1005
- } else if (Array.isArray(e)) {
1277
+ else if (Array.isArray(e)) {
1006
1278
  this.raw("[");
1007
1279
  let t = !0;
1008
1280
  for (let n of e) t || this.raw(", "), t = !1, this.repr(n);
1009
1281
  this.raw("]");
1282
+ } else if (typeof e == "object") {
1283
+ this.raw("{");
1284
+ let t = !0;
1285
+ for (let n of Object.keys(e)) t || this.raw(", "), t = !1, this.repr(n), this.raw(":"), this.repr(e[n]);
1286
+ this.raw("}");
1010
1287
  } else this.string(e);
1011
1288
  return this;
1012
1289
  }), this.source = "", this.functions = e;
1013
1290
  }
1014
1291
  }
1015
- class j {
1292
+ class re {
1016
1293
  constructor(e) {
1017
1294
  this.expression = e;
1018
1295
  }
@@ -1020,7 +1297,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1020
1297
  return this.expression;
1021
1298
  }
1022
1299
  }
1023
- class M extends j {
1300
+ class O extends re {
1024
1301
  constructor(e, n) {
1025
1302
  super(e), t(this, "getNodes", () => this.nodes), this.nodes = n;
1026
1303
  }
@@ -1030,7 +1307,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1030
1307
  switch (e.name) {
1031
1308
  case "ConstantNode": return new b(e.attributes?.value, !!e.isIdentifier, !!e.isNullSafe);
1032
1309
  case "NameNode": return new C(e.attributes?.name);
1033
- case "NullCoalescedNameNode": return new O(e.attributes?.name);
1310
+ case "NullCoalescedNameNode": return new ee(e.attributes?.name);
1034
1311
  case "UnaryNode": return new y(e.attributes?.operator, n(e.nodes?.node));
1035
1312
  case "BinaryNode": return new v(e.attributes?.operator, n(e.nodes?.left), n(e.nodes?.right));
1036
1313
  case "ConditionalNode": return new x(n(e.nodes?.expr1), n(e.nodes?.expr2), n(e.nodes?.expr3));
@@ -1048,7 +1325,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1048
1325
  return t;
1049
1326
  }
1050
1327
  case "FunctionNode": {
1051
- let t = n(e.nodes?.arguments);
1328
+ let t = n(e.nodes?.fnArguments);
1052
1329
  return new S(e.attributes?.name, t);
1053
1330
  }
1054
1331
  case "GetAttrNode": {
@@ -1074,8 +1351,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1074
1351
  return t.attributes = e.attributes || {}, t;
1075
1352
  }
1076
1353
  }
1077
- }, r = t.expression;
1078
- return new M(r, ((e) => {
1354
+ }, r = t.expression, i = ((e) => {
1079
1355
  if (e == null) return e;
1080
1356
  if (e.name) return n(e);
1081
1357
  if (Array.isArray(e)) return e.map(n);
@@ -1085,14 +1361,15 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1085
1361
  return t;
1086
1362
  }
1087
1363
  return e;
1088
- })(t.nodes));
1364
+ })(t.nodes);
1365
+ return new O(r, i);
1089
1366
  }
1090
1367
  }
1091
- var N;
1092
- class P {
1368
+ var ie;
1369
+ class ae {
1093
1370
  constructor(e = 0) {
1094
1371
  t(this, "createCacheItem", (e, t, n) => {
1095
- let r = new F();
1372
+ let r = new k();
1096
1373
  return r.key = e, r.value = t, r.isHit = n, r.defaultLifetime = this.defaultLifetime, r;
1097
1374
  }), t(this, "get", (e, t, n = null, r = null) => {
1098
1375
  let i = this.getItem(e);
@@ -1101,12 +1378,12 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1101
1378
  let t = this.hasItem(e), n = null;
1102
1379
  return t ? n = this.values[e] : this.values[e] = null, (0, this.createCacheItem)(e, n, t);
1103
1380
  }), t(this, "getItems", (e) => {
1104
- for (let t of e) typeof t == "string" || this.expiries[t] || F.validateKey(t);
1381
+ for (let t of e) typeof t == "string" || this.expiries[t] || k.validateKey(t);
1105
1382
  return this.generateItems(e, (/* @__PURE__ */ new Date()).getTime() / 1e3, this.createCacheItem);
1106
1383
  }), t(this, "deleteItems", (e) => {
1107
1384
  for (let t of e) this.deleteItem(t);
1108
1385
  return !0;
1109
- }), t(this, "save", (e) => !(!e instanceof F) && (e.expiry !== null && e.expiry <= (/* @__PURE__ */ new Date()).getTime() / 1e3 ? (this.deleteItem(e.key), !0) : (e.expiry === null && 0 < e.defaultLifetime && (e.expiry = (/* @__PURE__ */ new Date()).getTime() / 1e3 + e.defaultLifetime), this.values[e.key] = e.value, this.expiries[e.key] = e.expiry || 2 ** 53 - 1, !0))), t(this, "saveDeferred", (e) => this.save(e)), t(this, "commit", () => !0), t(this, "delete", (e) => this.deleteItem(e)), t(this, "getValues", () => this.values), t(this, "hasItem", (e) => !!(typeof e == "string" && this.expiries[e] && this.expiries[e] > (/* @__PURE__ */ new Date()).getTime() / 1e3) || (F.validateKey(e), !!this.expiries[e] && !this.deleteItem(e))), t(this, "clear", () => (this.values = {}, this.expiries = {}, !0)), t(this, "deleteItem", (e) => (typeof e == "string" && this.expiries[e] || F.validateKey(e), delete this.values[e], delete this.expiries[e], !0)), t(this, "reset", () => {
1386
+ }), t(this, "save", (e) => e instanceof k && (e.expiry !== null && e.expiry <= (/* @__PURE__ */ new Date()).getTime() / 1e3 ? (this.deleteItem(e.key), !0) : (e.expiry === null && 0 < e.defaultLifetime && (e.expiry = (/* @__PURE__ */ new Date()).getTime() / 1e3 + e.defaultLifetime), this.values[e.key] = e.value, this.expiries[e.key] = e.expiry || 2 ** 53 - 1, !0))), t(this, "saveDeferred", (e) => this.save(e)), t(this, "commit", () => !0), t(this, "delete", (e) => this.deleteItem(e)), t(this, "getValues", () => this.values), t(this, "hasItem", (e) => !!(typeof e == "string" && this.expiries[e] && this.expiries[e] > (/* @__PURE__ */ new Date()).getTime() / 1e3) || (k.validateKey(e), !!this.expiries[e] && !this.deleteItem(e))), t(this, "clear", () => (this.values = {}, this.expiries = {}, !0)), t(this, "deleteItem", (e) => (typeof e == "string" && this.expiries[e] || k.validateKey(e), delete this.values[e], delete this.expiries[e], !0)), t(this, "reset", () => {
1110
1387
  this.clear();
1111
1388
  }), t(this, "generateItems", (e, t, n) => {
1112
1389
  let r = [];
@@ -1118,7 +1395,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1118
1395
  }), this.defaultLifetime = e, this.values = {}, this.expiries = {};
1119
1396
  }
1120
1397
  }
1121
- class F {
1398
+ class k {
1122
1399
  constructor() {
1123
1400
  t(this, "getKey", () => this.key), t(this, "get", () => this.value), t(this, "set", (e) => (this.value = e, this)), t(this, "expiresAt", (e) => {
1124
1401
  if (e === null) this.expiry = this.defaultLifetime > 0 ? Date.now() / 1e3 + this.defaultLifetime : null;
@@ -1146,7 +1423,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1146
1423
  }), t(this, "getMetadata", () => this.metadata), this.key = null, this.value = null, this.isHit = !1, this.expiry = null, this.defaultLifetime = null, this.metadata = {}, this.newMetadata = {}, this.innerItem = null, this.poolHash = null, this.isTaggable = !1;
1147
1424
  }
1148
1425
  }
1149
- N = F, t(F, "METADATA_EXPIRY_OFFSET", 1527506807), t(F, "RESERVED_CHARACTERS", [
1426
+ ie = k, t(k, "METADATA_EXPIRY_OFFSET", 1527506807), t(k, "RESERVED_CHARACTERS", [
1150
1427
  "{",
1151
1428
  "}",
1152
1429
  "(",
@@ -1155,13 +1432,13 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1155
1432
  "\\",
1156
1433
  "@",
1157
1434
  ":"
1158
- ]), t(F, "validateKey", (e) => {
1435
+ ]), t(k, "validateKey", (e) => {
1159
1436
  if (typeof e != "string") throw Error(`Cache key must be string, "${typeof e}" given.`);
1160
1437
  if (e === "") throw Error("Cache key length must be greater than zero");
1161
- for (let t of N.RESERVED_CHARACTERS) if (e.indexOf(t) >= 0) throw Error(`Cache key "${e}" contains reserved character "${t}".`);
1438
+ for (let t of ie.RESERVED_CHARACTERS) if (e.indexOf(t) >= 0) throw Error(`Cache key "${e}" contains reserved character "${t}".`);
1162
1439
  return e;
1163
1440
  });
1164
- class ee extends Error {
1441
+ class oe extends Error {
1165
1442
  constructor(e) {
1166
1443
  super(e), this.name = "LogicException";
1167
1444
  }
@@ -1169,7 +1446,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1169
1446
  return `${this.name}: ${this.message}`;
1170
1447
  }
1171
1448
  }
1172
- class I {
1449
+ class A {
1173
1450
  constructor(e, n, r) {
1174
1451
  t(this, "getName", () => this.name), t(this, "getCompiler", () => this.compiler), t(this, "getEvaluator", () => this.evaluator), this.name = e, this.compiler = n, this.evaluator = r;
1175
1452
  }
@@ -1185,10 +1462,10 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1185
1462
  return new this(t || r[r.length - 1], (...e) => `${n}(${e.join(", ")})`, (e, ...t) => i(...t));
1186
1463
  }
1187
1464
  }
1188
- class L {
1465
+ class se {
1189
1466
  constructor(e = null, n = []) {
1190
- t(this, "compile", (e, t = []) => this.getCompiler().compile(this.parse(e, t).getNodes()).getSource()), t(this, "evaluate", (e, t = {}) => this.parse(e, Object.keys(t)).getNodes().evaluate(this.functions, t)), t(this, "parse", (e, t, n = 0) => {
1191
- if (e instanceof M) return e;
1467
+ t(this, "compile", (e, t = []) => this.getCompiler().compile(this.parse(e, t).getNodes()).getSource()), t(this, "evaluate", (e, t = {}) => this.parse(e, Object.keys(t)).getNodes().evaluate(this.functions, t)), t(this, "parse", (e, t = [], n = 0) => {
1468
+ if (e instanceof O) return e;
1192
1469
  t.sort((e, t) => {
1193
1470
  let n = e, r = t;
1194
1471
  return typeof e == "object" && (n = Object.values(e)[0]), typeof t == "object" && (r = Object.values(t)[0]), n.localeCompare(r);
@@ -1199,13 +1476,17 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1199
1476
  typeof e == "object" && (t = Object.keys(e)[0] + ":" + Object.values(e)[0]), r.push(t);
1200
1477
  }
1201
1478
  let i = this.cache.getItem(this.fixedEncodeURIComponent(e + "//" + r.join("|"))), a = i.get();
1202
- return a === null && (a = new M(e, this.getParser().parse(this.getLexer().tokenize(e), t, n)), i.set(a), this.cache.save(i)), a;
1479
+ if (a === null) {
1480
+ let r = this.getParser().parse(this.getLexer().tokenize(e), t, n);
1481
+ a = new O(e, r), i.set(a), this.cache.save(i);
1482
+ }
1483
+ return a;
1203
1484
  }), t(this, "lint", (e, t = null, n = 0) => {
1204
- t === null && (console.log("Deprecated: passing \"null\" as the second argument of lint is deprecated, pass IGNORE_UNKNOWN_VARIABLES instead as the third argument"), n |= 1, t = []), e instanceof M || this.getParser().lint(this.getLexer().tokenize(e), t, n);
1485
+ t === null && (console.log("Deprecated: passing \"null\" as the second argument of lint is deprecated, pass IGNORE_UNKNOWN_VARIABLES instead as the third argument"), n |= 1, t = []), e instanceof O || this.getParser().lint(this.getLexer().tokenize(e), t, n);
1205
1486
  }), t(this, "fixedEncodeURIComponent", (e) => encodeURIComponent(e).replace(/[!'()*]/g, function(e) {
1206
1487
  return "%" + e.charCodeAt(0).toString(16);
1207
1488
  })), t(this, "register", (e, t, n) => {
1208
- if (this.parser !== null) throw new ee("Registering functions after calling evaluate(), compile(), or parse() is not supported.");
1489
+ if (this.parser !== null) throw new oe("Registering functions after calling evaluate(), compile(), or parse() is not supported.");
1209
1490
  this.functions[e] = {
1210
1491
  compiler: t,
1211
1492
  evaluator: n
@@ -1214,19 +1495,19 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1214
1495
  this.register(e.getName(), e.getCompiler(), e.getEvaluator());
1215
1496
  }), t(this, "registerProvider", (e) => {
1216
1497
  for (let t of e.getFunctions()) this.addFunction(t);
1217
- }), t(this, "getLexer", () => (this.lexer === null && (this.lexer = { tokenize: o }), this.lexer)), t(this, "getParser", () => (this.parser === null && (this.parser = new k(this.functions)), this.parser)), t(this, "getCompiler", () => (this.compiler === null && (this.compiler = new A(this.functions)), this.compiler.reset())), this.functions = [], this.lexer = null, this.parser = null, this.compiler = null, this.cache = e || new P(), this._registerBuiltinFunctions();
1498
+ }), t(this, "getLexer", () => (this.lexer === null && (this.lexer = { tokenize: o }), this.lexer)), t(this, "getParser", () => (this.parser === null && (this.parser = new te(this.functions)), this.parser)), t(this, "getCompiler", () => (this.compiler === null && (this.compiler = new ne(this.functions)), this.compiler.reset())), this.functions = [], this.lexer = null, this.parser = null, this.compiler = null, this.cache = e || new ae(), this._registerBuiltinFunctions();
1218
1499
  for (let e of n) this.registerProvider(e);
1219
1500
  }
1220
1501
  _registerBuiltinFunctions() {
1221
- let e = I.fromJavascript("Math.min", "min"), t = I.fromJavascript("Math.max", "max");
1222
- this.addFunction(e), this.addFunction(t), this.addFunction(new I("constant", function(e) {
1502
+ let e = A.fromJavascript("Math.min", "min"), t = A.fromJavascript("Math.max", "max");
1503
+ this.addFunction(e), this.addFunction(t), this.addFunction(new A("constant", function(e) {
1223
1504
  return `(function(__n){var __g=(typeof globalThis!=='undefined'?globalThis:(typeof window!=='undefined'?window:(typeof global!=='undefined'?global:{})));return __n.split('.').reduce(function(o,k){return o==null?undefined:o[k];}, __g)})(${e})`;
1224
1505
  }, function(e, t) {
1225
1506
  if (typeof t != "string" || !t) return;
1226
1507
  let n = (r = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : {}, t.split(".").reduce((e, t) => e?.[t], r));
1227
1508
  var r;
1228
1509
  return n === void 0 && e && Object.prototype.hasOwnProperty.call(e, t) && (n = e[t]), n;
1229
- })), this.addFunction(new I("enum", function(e) {
1510
+ })), this.addFunction(new A("enum", function(e) {
1230
1511
  return `(function(__n){var __g=(typeof globalThis!=='undefined'?globalThis:(typeof window!=='undefined'?window:(typeof global!=='undefined'?global:{})));if(typeof __n!=='string'||!__n)return undefined;var s=String(__n);var keys=[],buf='';for(var i=0;i<s.length;i++){var c=s.charCodeAt(i);if(c===46||c===92){if(buf){keys.push(buf);buf='';}continue;}if(c===58){if(i+1<s.length&&s.charCodeAt(i+1)===58){if(buf){keys.push(buf);buf='';}i++;continue;}}buf+=s[i];}if(buf)keys.push(buf);return keys.reduce(function(o,k){return o==null?undefined:o[k];}, __g)})(${e})`;
1231
1512
  }, function(e, t) {
1232
1513
  if (typeof t != "string" || !t) return;
@@ -1236,30 +1517,32 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1236
1517
  }));
1237
1518
  }
1238
1519
  }
1239
- class R {
1520
+ class j {
1240
1521
  getFunctions() {
1241
- throw Error("getFunctions must be implemented by " + this.name);
1522
+ throw Error("getFunctions must be implemented by " + this.constructor.name);
1242
1523
  }
1243
1524
  }
1244
- let z = new I("isset", function(e) {
1245
- return `isset(${e})`;
1525
+ let ce = new A("isset", function(e) {
1526
+ if (/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')$/.test(e)) throw Error("isset() does not support compile() when called with a string-literal path (e.g. isset(\"foo.bar\")). Use an expression path instead (e.g. isset(foo.bar) or isset(foo?.bar)), or call evaluate() directly.");
1527
+ return `(function(){try{var __v=(${e});return __v!==null&&__v!==undefined;}catch(e){return false;}})()`;
1246
1528
  }, function(e, t) {
1247
1529
  if (typeof t != "string") return t != null;
1248
1530
  if (!(t.split(/[.\[]/)[0] in e)) return !0;
1249
1531
  let n = "", r = [], i = "", a = "";
1250
1532
  for (let e = 0; e < t.length; e++) {
1251
1533
  let o = t[e];
1252
- if (o !== "]") if (o !== "[") {
1253
- if (i === "object" && (!/[A-z0-9_]/.test(o) || e === t.length - 1)) {
1254
- let n = !1;
1255
- if (e === t.length - 1 && (a += o, n = !0), i = "", r.push({
1256
- type: "object",
1257
- attribute: a
1258
- }), a = "", n) continue;
1259
- }
1260
- o === "." ? (i = "object", a = "") : i ? a += o : n += o;
1261
- } else i = "array", a = "";
1262
- else i = "", r.push({
1534
+ if (o !== "]") {
1535
+ if (o !== "[") {
1536
+ if (i === "object" && (!/[A-z0-9_]/.test(o) || e === t.length - 1)) {
1537
+ let n = !1;
1538
+ if (e === t.length - 1 && (a += o, n = !0), i = "", r.push({
1539
+ type: "object",
1540
+ attribute: a
1541
+ }), a = "", n) continue;
1542
+ }
1543
+ o === "." ? (i = "object", a = "") : i ? a += o : n += o;
1544
+ } else i = "array", a = "";
1545
+ } else i = "", r.push({
1263
1546
  type: "array",
1264
1547
  index: a.replace(/"/g, "").replace(/'/g, "")
1265
1548
  }), a = "";
@@ -1282,28 +1565,38 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1282
1565
  return !1;
1283
1566
  }
1284
1567
  return e[n] !== void 0;
1285
- }), B = (e) => Object.entries(e);
1286
- function V(e) {
1568
+ });
1569
+ function le(...e) {
1570
+ let [t, n, r] = e, i = t, a = n;
1571
+ if (e.length < 2 || i === void 0 || a === void 0) return null;
1572
+ if (i === "" || !1 === i || i === null) return !1;
1573
+ if (typeof i == "function" || typeof i == "object" || typeof a == "function" || typeof a == "object") return { 0: "" };
1574
+ !0 === i && (i = "1");
1575
+ let o = i + "", s = (a + "").split(o);
1576
+ return r === void 0 ? s : (r === 0 && (r = 1), r > 0 ? r >= s.length ? s : s.slice(0, r - 1).concat([s.slice(r - 1).join(o)]) : -r >= s.length ? [] : (s.splice(s.length + r), s));
1577
+ }
1578
+ let ue = (e) => Object.entries(e);
1579
+ function de(e) {
1287
1580
  return typeof e == "object" && !!e;
1288
1581
  }
1289
- function H(e) {
1290
- return V(e) && !function(e) {
1582
+ function fe(e) {
1583
+ return de(e) && !function(e) {
1291
1584
  return Array.isArray(e);
1292
1585
  }(e);
1293
1586
  }
1294
- function U(e) {
1587
+ function pe(e) {
1295
1588
  return function(e) {
1296
- return V(e);
1589
+ return de(e);
1297
1590
  }(e) ? e : {};
1298
1591
  }
1299
- let W = typeof window == "object" && window !== null ? window : typeof global == "object" && global !== null ? global : {};
1300
- function te() {
1592
+ let M = typeof window == "object" && window !== null ? window : typeof global == "object" && global !== null ? global : {};
1593
+ function me() {
1301
1594
  let e = (() => {
1302
- let e = W.$locutus;
1303
- typeof e == "object" && e || (e = {}, W.$locutus = e);
1595
+ let e = M.$locutus;
1596
+ typeof e == "object" && e || (e = {}, M.$locutus = e);
1304
1597
  let t = e.php;
1305
1598
  return typeof t == "object" && t || (t = {}, e.php = t), t;
1306
- })(), t = e.ini, n = e.locales, r = e.localeCategories, i = e.pointers, a = H(t) ? t : {}, o = ((e) => H(e))(n) ? n : {}, s = ((e) => H(e))(r) ? r : {}, c = Array.isArray(i) ? i : [];
1599
+ })(), t = e.ini, n = e.locales, r = e.localeCategories, i = e.pointers, a = fe(t) ? t : {}, o = ((e) => fe(e))(n) ? n : {}, s = ((e) => fe(e))(r) ? r : {}, c = Array.isArray(i) ? i : [];
1307
1600
  t !== a && (e.ini = a), n !== o && (e.locales = o), r !== s && (e.localeCategories = s), i !== c && (e.pointers = c);
1308
1601
  let l = e.locale_default;
1309
1602
  return {
@@ -1314,11 +1607,42 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1314
1607
  locale_default: typeof l == "string" ? l : void 0
1315
1608
  };
1316
1609
  }
1317
- function G(e) {
1318
- let t = te().ini[e];
1610
+ function he(e) {
1611
+ let t = me().ini[e];
1319
1612
  return t && t.local_value !== void 0 ? t.local_value === null ? "" : String(t.local_value) : "";
1320
1613
  }
1321
- function ne(e, t, n) {
1614
+ function ge(e) {
1615
+ if (e === void 0) throw Error("strlen() expects exactly 1 argument, 0 given");
1616
+ let t = e + "";
1617
+ if ((he("unicode.semantics") || "off") === "off") return t.length;
1618
+ let n = 0, r = 0, i = function(e, t) {
1619
+ let n = e.charCodeAt(t);
1620
+ if (n >= 55296 && n <= 56319) {
1621
+ if (e.length <= t + 1) throw Error("High surrogate without following low surrogate");
1622
+ let n = e.charCodeAt(t + 1);
1623
+ if (n < 56320 || n > 57343) throw Error("High surrogate without following low surrogate");
1624
+ return e.charAt(t) + e.charAt(t + 1);
1625
+ }
1626
+ if (n >= 56320 && n <= 57343) {
1627
+ if (t === 0) throw Error("Low surrogate without preceding high surrogate");
1628
+ let n = e.charCodeAt(t - 1);
1629
+ if (n < 55296 || n > 56319) throw Error("Low surrogate without preceding high surrogate");
1630
+ return !1;
1631
+ }
1632
+ return e.charAt(t);
1633
+ };
1634
+ for (n = 0, r = 0; n < t.length; n++) !1 !== i(t, n) && r++;
1635
+ return r;
1636
+ }
1637
+ function _e(e) {
1638
+ if (e === void 0) throw Error("strtolower() expects exactly 1 argument, 0 given");
1639
+ return (e + "").toLowerCase();
1640
+ }
1641
+ function ve(e) {
1642
+ if (e === void 0) throw Error("strtoupper() expects exactly 1 argument, 0 given");
1643
+ return (e + "").toUpperCase();
1644
+ }
1645
+ function ye(e, t, n) {
1322
1646
  let r = function(e) {
1323
1647
  if (typeof e == "boolean") return e ? "1" : "";
1324
1648
  if (typeof e == "string") return e;
@@ -1326,17 +1650,25 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1326
1650
  if (e === void 0) return "";
1327
1651
  if (typeof e == "object") return Array.isArray(e) ? "Array" : e === null ? "" : "Object";
1328
1652
  throw Error("Unsupported value type");
1329
- }(e), i = G("unicode.semantics") === "on" ? r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\s\S]/g) || [] : null, a = i ? i.length : r.length, o = a;
1653
+ }(e), i = he("unicode.semantics") === "on" ? r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\s\S]/g) || [] : null, a = i ? i.length : r.length, o = a;
1330
1654
  return t < 0 && (t += o), n !== void 0 && (o = n < 0 ? n + o : n + t), !(t > a || t < 0 || t > o) && (i ? i.slice(t, o).join("") : r.slice(t, o));
1331
1655
  }
1332
- function re(e, ...t) {
1656
+ function be(e, t, n) {
1657
+ let r = 0;
1658
+ return r = (e += "").indexOf(t), r !== -1 && (n ? e.substr(0, r) : e.slice(r));
1659
+ }
1660
+ function xe(e, t, n) {
1661
+ let r = 0;
1662
+ return r = (e += "").toLowerCase().indexOf((t + "").toLowerCase()), r !== -1 && (n ? e.substr(0, r) : e.slice(r));
1663
+ }
1664
+ function Se(e, ...t) {
1333
1665
  let n = {};
1334
1666
  if (t.length < 1) return n;
1335
- let r = U(e);
1336
- e: for (let [e, i] of B(r)) {
1667
+ let r = pe(e);
1668
+ e: for (let [e, i] of ue(r)) {
1337
1669
  for (let e of t) {
1338
- let t = U(e), n = !1;
1339
- for (let [, e] of B(t)) if (e === i) {
1670
+ let t = pe(e), n = !1;
1671
+ for (let [, e] of ue(t)) if (e === i) {
1340
1672
  n = !0;
1341
1673
  break;
1342
1674
  }
@@ -1346,12 +1678,12 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1346
1678
  }
1347
1679
  return n;
1348
1680
  }
1349
- let K = (e) => {
1681
+ let Ce = (e) => {
1350
1682
  if (!e || typeof e != "object") return !1;
1351
1683
  let t = Object.getPrototypeOf(e);
1352
1684
  return t === Array.prototype || t === Object.prototype;
1353
1685
  };
1354
- function q(e, t = 0) {
1686
+ function we(e, t = 0) {
1355
1687
  let n = 0;
1356
1688
  if (e == null) return 0;
1357
1689
  if (typeof e != "object") return 1;
@@ -1362,51 +1694,48 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1362
1694
  for (let t of Object.keys(e)) {
1363
1695
  n++;
1364
1696
  let r = e[Number(t)];
1365
- i && K(r) && (n += q(r, 1));
1697
+ i && Ce(r) && (n += we(r, 1));
1366
1698
  }
1367
1699
  return n;
1368
1700
  }
1369
- for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t)) {
1370
- n++;
1371
- let r = e[t];
1372
- i && K(r) && (n += q(r, 1));
1373
- }
1701
+ for (let t of Object.values(e)) n++, i && Ce(t) && (n += we(t, 1));
1374
1702
  return n;
1375
1703
  }
1376
- let ie = new I("implode", function(e, t) {
1377
- return `implode(${e}, ${t})`;
1704
+ function Te(...e) {
1705
+ let t, n = "", r = "", i = "";
1706
+ if (e.length === 1) {
1707
+ let [n] = e;
1708
+ t = n;
1709
+ } else {
1710
+ let [n, r] = e;
1711
+ i = String(n ?? ""), t = r;
1712
+ }
1713
+ if (typeof t == "object" && t) {
1714
+ if (Array.isArray(t)) return t.join(i);
1715
+ for (let e in t) n += r + t[e], r = i;
1716
+ return n;
1717
+ }
1718
+ return String(t);
1719
+ }
1720
+ let Ee = new A("implode", function(e, t) {
1721
+ return `__runtime.implode(${e}, ${t})`;
1378
1722
  }, function(e, t, n) {
1379
- return function(...e) {
1380
- let t, n = "", r = "", i = "";
1381
- if (e.length === 1) {
1382
- let [n] = e;
1383
- t = n;
1384
- } else {
1385
- let [n, r] = e;
1386
- i = String(n ?? ""), t = r;
1387
- }
1388
- if (typeof t == "object" && t) {
1389
- if (Array.isArray(t)) return t.join(i);
1390
- for (let e in t) n += r + t[e], r = i;
1391
- return n;
1392
- }
1393
- return String(t);
1394
- }(t, n);
1395
- }), ae = new I("count", function(e, t) {
1723
+ return Te(t, n);
1724
+ }), De = new A("count", function(e, t) {
1396
1725
  let n = "";
1397
- return t && (n = `, ${t}`), `count(${e}${n})`;
1726
+ return t && (n = `, ${t}`), `__runtime.count(${e}${n})`;
1398
1727
  }, function(e, t, n) {
1399
- return q(t, n);
1400
- }), oe = new I("array_intersect", function(e, ...t) {
1728
+ return we(t, n);
1729
+ }), Oe = new A("array_intersect", function(e, ...t) {
1401
1730
  let n = "";
1402
- return t.length > 0 && (n = ", " + t.join(", ")), `array_intersect(${e}${n})`;
1731
+ return t.length > 0 && (n = ", " + t.join(", ")), `__runtime.array_intersect(${e}${n})`;
1403
1732
  }, function(e) {
1404
1733
  let t = [], n = !0;
1405
1734
  for (let e = 1; e < arguments.length; e++) t.push(arguments[e]), Array.isArray(arguments[e]) || (n = !1);
1406
- let r = re.apply(null, t);
1735
+ let r = Se.apply(null, t);
1407
1736
  return n ? Object.values(r) : r;
1408
1737
  });
1409
- function se(e, t) {
1738
+ function ke(e, t) {
1410
1739
  let n, r = /* @__PURE__ */ new Date(), i = [
1411
1740
  "Sun",
1412
1741
  "Mon",
@@ -1428,7 +1757,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1428
1757
  "November",
1429
1758
  "December"
1430
1759
  ], a = /\\?(.?)/gi, o = function(e, t) {
1431
- return r = e, Object.prototype.hasOwnProperty.call(n, r) ? String(n[e]()) : t;
1760
+ return r = e, Object.hasOwn(n, r) ? String(n[e]()) : t;
1432
1761
  var r;
1433
1762
  }, s = function(e, t) {
1434
1763
  let n = String(e);
@@ -1563,7 +1892,8 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1563
1892
  }, c = e, r = (l = t) === void 0 ? /* @__PURE__ */ new Date() : l instanceof Date ? new Date(l) : /* @__PURE__ */ new Date(1e3 * Number(l)), c.replace(a, o);
1564
1893
  var c, l;
1565
1894
  }
1566
- function J(e, t) {
1895
+ let Ae = "[ \\t]+", N = "[ \\t]*", P = "(?:([ap])\\.?m\\.?([\\t ]|$))", F = "(2[0-4]|[01]?[0-9])", I = "([01][0-9]|2[0-4])", L = "(0?[1-9]|1[0-2])", R = "([0-5]?[0-9])", z = "([0-5][0-9])", je = "(60|[0-5]?[0-9])", B = "(60|[0-5][0-9])", Me = "(?:\\.([0-9]+))", Ne = "sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun|mon|tue|wed|thu|fri|sat|weekdays?", Pe = "next|last|previous|this", Fe = "(?:second|sec|minute|min|hour|day|fortnight|forthnight|month|year)s?|weeks|" + Ne, V = "([0-9]{1,4})", H = "([0-9]{4})", U = "(1[0-2]|0?[0-9])", W = "(0[0-9]|1[0-2])", G = "(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)", K = "(0[0-9]|[1-2][0-9]|3[01])", Ie = "january|february|march|april|may|june|july|august|september|october|november|december", q = "jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec", J = "(" + Ie + "|" + q + "|i[vx]|vi{0,3}|xi{0,2}|i{1,3})", Le = "((?:GMT)?([+-])" + F + ":?" + R + "?)", Y = J + "[ .\\t-]*" + G + "[,.stndrh\\t ]*";
1896
+ function X(e, t) {
1567
1897
  switch (t?.toLowerCase()) {
1568
1898
  case "a":
1569
1899
  e += e === 12 ? -12 : 0;
@@ -1572,11 +1902,11 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1572
1902
  }
1573
1903
  return e;
1574
1904
  }
1575
- function Y(e) {
1905
+ function Z(e) {
1576
1906
  let t = +e;
1577
1907
  return e.length < 4 && t < 100 && (t += t < 70 ? 2e3 : 1900), t;
1578
1908
  }
1579
- function X(e) {
1909
+ function Q(e) {
1580
1910
  return {
1581
1911
  jan: 0,
1582
1912
  january: 0,
@@ -1616,7 +1946,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1616
1946
  xii: 11
1617
1947
  }[e.toLowerCase()] ?? NaN;
1618
1948
  }
1619
- function Z(e, t = 0) {
1949
+ function Re(e, t = 0) {
1620
1950
  return {
1621
1951
  mon: 1,
1622
1952
  monday: 1,
@@ -1634,13 +1964,13 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1634
1964
  sunday: 0
1635
1965
  }[e.toLowerCase()] || t;
1636
1966
  }
1637
- function Q(e, t = NaN) {
1967
+ function ze(e, t = NaN) {
1638
1968
  let n = e?.match(/(?:GMT)?([+-])(\d+)(:?)(\d{0,2})/i);
1639
1969
  if (!n) return t;
1640
1970
  let r = n[1] === "-" ? -1 : 1, i = +(n[2] ?? 0), a = +(n[4] ?? 0);
1641
1971
  return n[4] || n[3] || (a = Math.floor(i % 100), i = Math.floor(i / 100)), r * (60 * i + a) * 60;
1642
1972
  }
1643
- let ce = {
1973
+ let Be = {
1644
1974
  acdt: 37800,
1645
1975
  acst: 34200,
1646
1976
  addt: -7200,
@@ -1829,22 +2159,22 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1829
2159
  regex: /^(first|last) day of/i,
1830
2160
  name: "firstdayof | lastdayof",
1831
2161
  callback(e, t) {
1832
- t.toLowerCase() === "first" ? this.firstOrLastDayOfMonth = 1 : this.firstOrLastDayOfMonth = -1;
2162
+ this.firstOrLastDayOfMonth = t.toLowerCase() === "first" ? 1 : -1;
1833
2163
  }
1834
2164
  },
1835
2165
  backOrFrontOf: {
1836
- regex: /* @__PURE__ */ RegExp("^(back|front) of (2[0-4]|[01]?[0-9])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))?", "i"),
2166
+ regex: RegExp("^(back|front) of " + F + N + P + "?", "i"),
1837
2167
  name: "backof | frontof",
1838
2168
  callback(e, t, n, r) {
1839
2169
  let i = +n, a = 15;
1840
- return t.toLowerCase() === "back" || (--i, a = 45), i = J(i, r), this.resetTime() && this.time(i, a, 0, 0);
2170
+ return t.toLowerCase() === "back" || (--i, a = 45), i = X(i, r), this.resetTime() && this.time(i, a, 0, 0);
1841
2171
  }
1842
2172
  },
1843
2173
  mssqltime: {
1844
- regex: /* @__PURE__ */ RegExp("^(0?[1-9]|1[0-2]):([0-5][0-9]):(60|[0-5][0-9])[:.]([0-9]+)(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
2174
+ regex: RegExp("^" + L + ":" + z + ":" + B + "[:.]([0-9]+)" + P, "i"),
1845
2175
  name: "mssqltime",
1846
2176
  callback(e, t, n, r, i, a) {
1847
- return this.time(J(+t, a), +n, +r, +i.substr(0, 3));
2177
+ return this.time(X(+t, a), +n, +r, +i.substr(0, 3));
1848
2178
  }
1849
2179
  },
1850
2180
  oracledate: {
@@ -1869,175 +2199,175 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
1869
2199
  }
1870
2200
  },
1871
2201
  timeLong12: {
1872
- regex: /* @__PURE__ */ RegExp("^(0?[1-9]|1[0-2])[:.]([0-5]?[0-9])[:.](60|[0-5][0-9])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
2202
+ regex: RegExp("^" + L + "[:.]" + R + "[:.]" + B + N + P, "i"),
1873
2203
  name: "timelong12",
1874
2204
  callback(e, t, n, r, i) {
1875
- return this.time(J(+t, i), +n, +r, 0);
2205
+ return this.time(X(+t, i), +n, +r, 0);
1876
2206
  }
1877
2207
  },
1878
2208
  timeShort12: {
1879
- regex: /* @__PURE__ */ RegExp("^(0?[1-9]|1[0-2])[:.]([0-5][0-9])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
2209
+ regex: RegExp("^" + L + "[:.]" + z + N + P, "i"),
1880
2210
  name: "timeshort12",
1881
2211
  callback(e, t, n, r) {
1882
- return this.time(J(+t, r), +n, 0, 0);
2212
+ return this.time(X(+t, r), +n, 0, 0);
1883
2213
  }
1884
2214
  },
1885
2215
  timeTiny12: {
1886
- regex: /* @__PURE__ */ RegExp("^(0?[1-9]|1[0-2])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
2216
+ regex: RegExp("^" + L + N + P, "i"),
1887
2217
  name: "timetiny12",
1888
2218
  callback(e, t, n) {
1889
- return this.time(J(+t, n), 0, 0, 0);
2219
+ return this.time(X(+t, n), 0, 0, 0);
1890
2220
  }
1891
2221
  },
1892
2222
  soap: {
1893
- regex: /* @__PURE__ */ RegExp("^([0-9]{4})-(0[0-9]|1[0-2])-(0[0-9]|[1-2][0-9]|3[01])T([01][0-9]|2[0-4]):([0-5][0-9]):(60|[0-5][0-9])(?:\\.([0-9]+))((?:GMT)?([+-])(2[0-4]|[01]?[0-9]):?([0-5]?[0-9])?)?", "i"),
2223
+ regex: RegExp("^" + H + "-" + W + "-" + K + "T" + I + ":" + z + ":" + B + Me + Le + "?", "i"),
1894
2224
  name: "soap",
1895
2225
  callback(e, t, n, r, i, a, o, s, c) {
1896
- return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, +s.substr(0, 3)) && this.zone(Q(c));
2226
+ return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, +s.substr(0, 3)) && this.zone(ze(c));
1897
2227
  }
1898
2228
  },
1899
2229
  wddx: {
1900
- regex: /* @__PURE__ */ RegExp("^([0-9]{4})-(1[0-2]|0?[0-9])-(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)T(2[0-4]|[01]?[0-9]):([0-5]?[0-9]):(60|[0-5]?[0-9])"),
2230
+ regex: RegExp("^" + H + "-" + U + "-" + G + "T" + F + ":" + R + ":" + je),
1901
2231
  name: "wddx",
1902
2232
  callback(e, t, n, r, i, a, o) {
1903
2233
  return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
1904
2234
  }
1905
2235
  },
1906
2236
  exif: {
1907
- regex: /* @__PURE__ */ RegExp("^([0-9]{4}):(0[0-9]|1[0-2]):(0[0-9]|[1-2][0-9]|3[01]) ([01][0-9]|2[0-4]):([0-5][0-9]):(60|[0-5][0-9])", "i"),
2237
+ regex: RegExp("^" + H + ":" + W + ":" + K + " " + I + ":" + z + ":" + B, "i"),
1908
2238
  name: "exif",
1909
2239
  callback(e, t, n, r, i, a, o) {
1910
2240
  return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
1911
2241
  }
1912
2242
  },
1913
2243
  xmlRpc: {
1914
- regex: /* @__PURE__ */ RegExp("^([0-9]{4})(0[0-9]|1[0-2])(0[0-9]|[1-2][0-9]|3[01])T(2[0-4]|[01]?[0-9]):([0-5][0-9]):(60|[0-5][0-9])"),
2244
+ regex: RegExp("^" + H + W + K + "T" + F + ":" + z + ":" + B),
1915
2245
  name: "xmlrpc",
1916
2246
  callback(e, t, n, r, i, a, o) {
1917
2247
  return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
1918
2248
  }
1919
2249
  },
1920
2250
  xmlRpcNoColon: {
1921
- regex: /* @__PURE__ */ RegExp("^([0-9]{4})(0[0-9]|1[0-2])(0[0-9]|[1-2][0-9]|3[01])[Tt](2[0-4]|[01]?[0-9])([0-5][0-9])(60|[0-5][0-9])"),
2251
+ regex: RegExp("^" + H + W + K + "[Tt]" + F + z + B),
1922
2252
  name: "xmlrpcnocolon",
1923
2253
  callback(e, t, n, r, i, a, o) {
1924
2254
  return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
1925
2255
  }
1926
2256
  },
1927
2257
  clf: {
1928
- regex: /* @__PURE__ */ RegExp("^(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)/(jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec)/([0-9]{4}):([01][0-9]|2[0-4]):([0-5][0-9]):(60|[0-5][0-9])[ \\t]+((?:GMT)?([+-])(2[0-4]|[01]?[0-9]):?([0-5]?[0-9])?)", "i"),
2258
+ regex: RegExp("^" + G + "/(" + q + ")/" + H + ":" + I + ":" + z + ":" + B + Ae + Le, "i"),
1929
2259
  name: "clf",
1930
2260
  callback(e, t, n, r, i, a, o, s) {
1931
- return this.ymd(+r, X(n), +t) && this.time(+i, +a, +o, 0) && this.zone(Q(s));
2261
+ return this.ymd(+r, Q(n), +t) && this.time(+i, +a, +o, 0) && this.zone(ze(s));
1932
2262
  }
1933
2263
  },
1934
2264
  iso8601long: {
1935
- regex: /* @__PURE__ */ RegExp("^t?(2[0-4]|[01]?[0-9])[:.]([0-5]?[0-9])[:.](60|[0-5]?[0-9])(?:\\.([0-9]+))", "i"),
2265
+ regex: RegExp("^t?" + F + "[:.]" + R + "[:.]" + je + Me, "i"),
1936
2266
  name: "iso8601long",
1937
2267
  callback(e, t, n, r, i) {
1938
2268
  return this.time(+t, +n, +r, +i.substr(0, 3));
1939
2269
  }
1940
2270
  },
1941
2271
  dateTextual: {
1942
- regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ .\\t-]*(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[,.stndrh\\t ]+([0-9]{1,4})", "i"),
2272
+ regex: RegExp("^" + J + "[ .\\t-]*" + G + "[,.stndrh\\t ]+" + V, "i"),
1943
2273
  name: "datetextual",
1944
2274
  callback(e, t, n, r) {
1945
- return this.ymd(Y(r), X(t), +n);
2275
+ return this.ymd(Z(r), Q(t), +n);
1946
2276
  }
1947
2277
  },
1948
2278
  pointedDate4: {
1949
- regex: /* @__PURE__ */ RegExp("^(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[.\\t-](1[0-2]|0?[0-9])[.-]([0-9]{4})"),
2279
+ regex: RegExp("^" + G + "[.\\t-]" + U + "[.-]" + H),
1950
2280
  name: "pointeddate4",
1951
2281
  callback(e, t, n, r) {
1952
2282
  return this.ymd(+r, n - 1, +t);
1953
2283
  }
1954
2284
  },
1955
2285
  pointedDate2: {
1956
- regex: /* @__PURE__ */ RegExp("^(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[.\\t](1[0-2]|0?[0-9])\\.([0-9]{2})"),
2286
+ regex: RegExp("^" + G + "[.\\t]" + U + "\\.([0-9]{2})"),
1957
2287
  name: "pointeddate2",
1958
2288
  callback(e, t, n, r) {
1959
- return this.ymd(Y(r), n - 1, +t);
2289
+ return this.ymd(Z(r), n - 1, +t);
1960
2290
  }
1961
2291
  },
1962
2292
  timeLong24: {
1963
- regex: /* @__PURE__ */ RegExp("^t?(2[0-4]|[01]?[0-9])[:.]([0-5]?[0-9])[:.](60|[0-5]?[0-9])"),
2293
+ regex: RegExp("^t?" + F + "[:.]" + R + "[:.]" + je),
1964
2294
  name: "timelong24",
1965
2295
  callback(e, t, n, r) {
1966
2296
  return this.time(+t, +n, +r, 0);
1967
2297
  }
1968
2298
  },
1969
2299
  dateNoColon: {
1970
- regex: /* @__PURE__ */ RegExp("^([0-9]{4})(0[0-9]|1[0-2])(0[0-9]|[1-2][0-9]|3[01])"),
2300
+ regex: RegExp("^" + H + W + K),
1971
2301
  name: "datenocolon",
1972
2302
  callback(e, t, n, r) {
1973
2303
  return this.ymd(+t, n - 1, +r);
1974
2304
  }
1975
2305
  },
1976
2306
  pgydotd: {
1977
- regex: /* @__PURE__ */ RegExp("^([0-9]{4})\\.?(00[1-9]|0[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6])"),
2307
+ regex: RegExp("^" + H + "\\.?(00[1-9]|0[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6])"),
1978
2308
  name: "pgydotd",
1979
2309
  callback(e, t, n) {
1980
2310
  return this.ymd(+t, 0, +n);
1981
2311
  }
1982
2312
  },
1983
2313
  timeShort24: {
1984
- regex: /* @__PURE__ */ RegExp("^t?(2[0-4]|[01]?[0-9])[:.]([0-5]?[0-9])", "i"),
2314
+ regex: RegExp("^t?" + F + "[:.]" + R, "i"),
1985
2315
  name: "timeshort24",
1986
2316
  callback(e, t, n) {
1987
2317
  return this.time(+t, +n, 0, 0);
1988
2318
  }
1989
2319
  },
1990
2320
  iso8601noColon: {
1991
- regex: /* @__PURE__ */ RegExp("^t?([01][0-9]|2[0-4])([0-5][0-9])(60|[0-5][0-9])", "i"),
2321
+ regex: RegExp("^t?" + I + z + B, "i"),
1992
2322
  name: "iso8601nocolon",
1993
2323
  callback(e, t, n, r) {
1994
2324
  return this.time(+t, +n, +r, 0);
1995
2325
  }
1996
2326
  },
1997
2327
  iso8601dateSlash: {
1998
- regex: /* @__PURE__ */ RegExp("^([0-9]{4})/(0[0-9]|1[0-2])/(0[0-9]|[1-2][0-9]|3[01])/"),
2328
+ regex: RegExp("^" + H + "/" + W + "/" + K + "/"),
1999
2329
  name: "iso8601dateslash",
2000
2330
  callback(e, t, n, r) {
2001
2331
  return this.ymd(+t, n - 1, +r);
2002
2332
  }
2003
2333
  },
2004
2334
  dateSlash: {
2005
- regex: /* @__PURE__ */ RegExp("^([0-9]{4})/(1[0-2]|0?[0-9])/(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)"),
2335
+ regex: RegExp("^" + H + "/" + U + "/" + G),
2006
2336
  name: "dateslash",
2007
2337
  callback(e, t, n, r) {
2008
2338
  return this.ymd(+t, n - 1, +r);
2009
2339
  }
2010
2340
  },
2011
2341
  american: {
2012
- regex: /* @__PURE__ */ RegExp("^(1[0-2]|0?[0-9])/(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)/([0-9]{1,4})"),
2342
+ regex: RegExp("^" + U + "/" + G + "/" + V),
2013
2343
  name: "american",
2014
2344
  callback(e, t, n, r) {
2015
- return this.ymd(Y(r), t - 1, +n);
2345
+ return this.ymd(Z(r), t - 1, +n);
2016
2346
  }
2017
2347
  },
2018
2348
  americanShort: {
2019
- regex: /* @__PURE__ */ RegExp("^(1[0-2]|0?[0-9])/(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)"),
2349
+ regex: RegExp("^" + U + "/" + G),
2020
2350
  name: "americanshort",
2021
2351
  callback(e, t, n) {
2022
2352
  return this.ymd(this.y, t - 1, +n);
2023
2353
  }
2024
2354
  },
2025
2355
  gnuDateShortOrIso8601date2: {
2026
- regex: /* @__PURE__ */ RegExp("^([0-9]{1,4})-(1[0-2]|0?[0-9])-(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)"),
2356
+ regex: RegExp("^" + V + "-" + U + "-" + G),
2027
2357
  name: "gnudateshort | iso8601date2",
2028
2358
  callback(e, t, n, r) {
2029
- return this.ymd(Y(t), n - 1, +r);
2359
+ return this.ymd(Z(t), n - 1, +r);
2030
2360
  }
2031
2361
  },
2032
2362
  iso8601date4: {
2033
- regex: /* @__PURE__ */ RegExp("^([+-]?[0-9]{4})-(0[0-9]|1[0-2])-(0[0-9]|[1-2][0-9]|3[01])"),
2363
+ regex: RegExp("^([+-]?[0-9]{4})-" + W + "-" + K),
2034
2364
  name: "iso8601date4",
2035
2365
  callback(e, t, n, r) {
2036
2366
  return this.ymd(+t, n - 1, +r);
2037
2367
  }
2038
2368
  },
2039
2369
  gnuNoColon: {
2040
- regex: /* @__PURE__ */ RegExp("^t?([01][0-9]|2[0-4])([0-5][0-9])", "i"),
2370
+ regex: RegExp("^t?" + I + z, "i"),
2041
2371
  name: "gnunocolon",
2042
2372
  callback(e, t, n) {
2043
2373
  switch (this.times) {
@@ -2048,63 +2378,63 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
2048
2378
  }
2049
2379
  },
2050
2380
  gnuDateShorter: {
2051
- regex: /* @__PURE__ */ RegExp("^([0-9]{4})-(1[0-2]|0?[0-9])"),
2381
+ regex: RegExp("^" + H + "-" + U),
2052
2382
  name: "gnudateshorter",
2053
2383
  callback(e, t, n) {
2054
2384
  return this.ymd(+t, n - 1, 1);
2055
2385
  }
2056
2386
  },
2057
2387
  pgTextReverse: {
2058
- regex: /* @__PURE__ */ RegExp("^(\\d{3,4}|[4-9]\\d|3[2-9])-(jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec)-(0[0-9]|[1-2][0-9]|3[01])", "i"),
2388
+ regex: RegExp("^(\\d{3,4}|[4-9]\\d|3[2-9])-(" + q + ")-" + K, "i"),
2059
2389
  name: "pgtextreverse",
2060
2390
  callback(e, t, n, r) {
2061
- return this.ymd(Y(t), X(n), +r);
2391
+ return this.ymd(Z(t), Q(n), +r);
2062
2392
  }
2063
2393
  },
2064
2394
  dateFull: {
2065
- regex: /* @__PURE__ */ RegExp("^(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[ \\t.-]*(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ \\t.-]*([0-9]{1,4})", "i"),
2395
+ regex: RegExp("^" + G + "[ \\t.-]*" + J + "[ \\t.-]*" + V, "i"),
2066
2396
  name: "datefull",
2067
2397
  callback(e, t, n, r) {
2068
- return this.ymd(Y(r), X(n), +t);
2398
+ return this.ymd(Z(r), Q(n), +t);
2069
2399
  }
2070
2400
  },
2071
2401
  dateNoDay: {
2072
- regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ .\\t-]*([0-9]{4})", "i"),
2402
+ regex: RegExp("^" + J + "[ .\\t-]*" + H, "i"),
2073
2403
  name: "datenoday",
2074
2404
  callback(e, t, n) {
2075
- return this.ymd(+n, X(t), 1);
2405
+ return this.ymd(+n, Q(t), 1);
2076
2406
  }
2077
2407
  },
2078
2408
  dateNoDayRev: {
2079
- regex: /* @__PURE__ */ RegExp("^([0-9]{4})[ .\\t-]*(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})", "i"),
2409
+ regex: RegExp("^" + H + "[ .\\t-]*" + J, "i"),
2080
2410
  name: "datenodayrev",
2081
2411
  callback(e, t, n) {
2082
- return this.ymd(+t, X(n), 1);
2412
+ return this.ymd(+t, Q(n), 1);
2083
2413
  }
2084
2414
  },
2085
2415
  pgTextShort: {
2086
- regex: /* @__PURE__ */ RegExp("^(jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec)-(0[0-9]|[1-2][0-9]|3[01])-([0-9]{1,4})", "i"),
2416
+ regex: RegExp("^(" + q + ")-" + K + "-" + V, "i"),
2087
2417
  name: "pgtextshort",
2088
2418
  callback(e, t, n, r) {
2089
- return this.ymd(Y(r), X(t), +n);
2419
+ return this.ymd(Z(r), Q(t), +n);
2090
2420
  }
2091
2421
  },
2092
2422
  dateNoYear: {
2093
- regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ .\\t-]*(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[,.stndrh\\t ]*", "i"),
2423
+ regex: RegExp("^" + Y, "i"),
2094
2424
  name: "datenoyear",
2095
2425
  callback(e, t, n) {
2096
- return this.ymd(this.y, X(t), +n);
2426
+ return this.ymd(this.y, Q(t), +n);
2097
2427
  }
2098
2428
  },
2099
2429
  dateNoYearRev: {
2100
- regex: /* @__PURE__ */ RegExp("^(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[ .\\t-]*(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})", "i"),
2430
+ regex: RegExp("^" + G + "[ .\\t-]*" + J, "i"),
2101
2431
  name: "datenoyearrev",
2102
2432
  callback(e, t, n) {
2103
- return this.ymd(this.y, X(n), +t);
2433
+ return this.ymd(this.y, Q(n), +t);
2104
2434
  }
2105
2435
  },
2106
2436
  isoWeekDay: {
2107
- regex: /* @__PURE__ */ RegExp("^([0-9]{4})-?W(0[1-9]|[1-4][0-9]|5[0-3])(?:-?([0-7]))?"),
2437
+ regex: RegExp("^" + H + "-?W(0[1-9]|[1-4][0-9]|5[0-3])(?:-?([0-7]))?"),
2108
2438
  name: "isoweekday | isoweek",
2109
2439
  callback(e, t, n, r) {
2110
2440
  let i = r ? +r : 1;
@@ -2114,7 +2444,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
2114
2444
  }
2115
2445
  },
2116
2446
  relativeText: {
2117
- regex: /* @__PURE__ */ RegExp("^(first|second|third|fourth|fifth|sixth|seventh|eighth?|ninth|tenth|eleventh|twelfth|next|last|previous|this)[ \\t]+((?:second|sec|minute|min|hour|day|fortnight|forthnight|month|year)s?|weeks|sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun|mon|tue|wed|thu|fri|sat|weekdays?)", "i"),
2447
+ regex: RegExp("^(first|second|third|fourth|fifth|sixth|seventh|eighth?|ninth|tenth|eleventh|twelfth|" + Pe + ")" + Ae + "(" + Fe + ")", "i"),
2118
2448
  name: "relativetext",
2119
2449
  callback(e, t, n) {
2120
2450
  let { amount: r } = function(e) {
@@ -2194,53 +2524,53 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
2194
2524
  case "sat":
2195
2525
  case "saturday":
2196
2526
  case "sun":
2197
- case "sunday": this.resetTime(), this.weekday = Z(n, 7), this.weekdayBehavior = 1, this.rd += 7 * (r > 0 ? r - 1 : r);
2527
+ case "sunday": this.resetTime(), this.weekday = Re(n, 7), this.weekdayBehavior = 1, this.rd += 7 * (r > 0 ? r - 1 : r);
2198
2528
  }
2199
2529
  }
2200
2530
  },
2201
2531
  relative: {
2202
- regex: /* @__PURE__ */ RegExp("^([+-]*)[ \\t]*(\\d+)[ \\t]*((?:second|sec|minute|min|hour|day|fortnight|forthnight|month|year)s?|weeks|sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun|mon|tue|wed|thu|fri|sat|weekdays?|week)", "i"),
2532
+ regex: RegExp("^([+-]*)[ \\t]*(\\d+)[ \\t]*(" + Fe + "|week)", "i"),
2203
2533
  name: "relative",
2204
2534
  callback(e, t, n, r) {
2205
- let i = n * (-1) ** t.replace(/[^-]/g, "").length;
2535
+ let i = t.replace(/[^-]/g, "").length, a = +n * (-1) ** i;
2206
2536
  switch (r.toLowerCase()) {
2207
2537
  case "sec":
2208
2538
  case "secs":
2209
2539
  case "second":
2210
2540
  case "seconds":
2211
- this.rs += i;
2541
+ this.rs += a;
2212
2542
  break;
2213
2543
  case "min":
2214
2544
  case "mins":
2215
2545
  case "minute":
2216
2546
  case "minutes":
2217
- this.ri += i;
2547
+ this.ri += a;
2218
2548
  break;
2219
2549
  case "hour":
2220
2550
  case "hours":
2221
- this.rh += i;
2551
+ this.rh += a;
2222
2552
  break;
2223
2553
  case "day":
2224
2554
  case "days":
2225
- this.rd += i;
2555
+ this.rd += a;
2226
2556
  break;
2227
2557
  case "fortnight":
2228
2558
  case "fortnights":
2229
2559
  case "forthnight":
2230
2560
  case "forthnights":
2231
- this.rd += 14 * i;
2561
+ this.rd += 14 * a;
2232
2562
  break;
2233
2563
  case "week":
2234
2564
  case "weeks":
2235
- this.rd += 7 * i;
2565
+ this.rd += 7 * a;
2236
2566
  break;
2237
2567
  case "month":
2238
2568
  case "months":
2239
- this.rm += i;
2569
+ this.rm += a;
2240
2570
  break;
2241
2571
  case "year":
2242
2572
  case "years":
2243
- this.ry += i;
2573
+ this.ry += a;
2244
2574
  break;
2245
2575
  case "mon":
2246
2576
  case "monday":
@@ -2255,19 +2585,19 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
2255
2585
  case "sat":
2256
2586
  case "saturday":
2257
2587
  case "sun":
2258
- case "sunday": this.resetTime(), this.weekday = Z(r, 7), this.weekdayBehavior = 1, this.rd += 7 * (i > 0 ? i - 1 : i);
2588
+ case "sunday": this.resetTime(), this.weekday = Re(r, 7), this.weekdayBehavior = 1, this.rd += 7 * (a > 0 ? a - 1 : a);
2259
2589
  }
2260
2590
  }
2261
2591
  },
2262
2592
  dayText: {
2263
- regex: /* @__PURE__ */ RegExp("^(sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun|mon|tue|wed|thu|fri|sat|weekdays?)", "i"),
2593
+ regex: RegExp("^(" + Ne + ")", "i"),
2264
2594
  name: "daytext",
2265
2595
  callback(e, t) {
2266
- this.resetTime(), this.weekday = Z(t, 0), this.weekdayBehavior !== 2 && (this.weekdayBehavior = 1);
2596
+ this.resetTime(), this.weekday = Re(t, 0), this.weekdayBehavior !== 2 && (this.weekdayBehavior = 1);
2267
2597
  }
2268
2598
  },
2269
2599
  relativeTextWeek: {
2270
- regex: /* @__PURE__ */ RegExp("^(next|last|previous|this)[ \\t]+week", "i"),
2600
+ regex: RegExp("^(" + Pe + ")" + Ae + "week", "i"),
2271
2601
  name: "relativetextweek",
2272
2602
  callback(e, t) {
2273
2603
  switch (this.weekdayBehavior = 2, t.toLowerCase()) {
@@ -2284,24 +2614,24 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
2284
2614
  }
2285
2615
  },
2286
2616
  monthFullOrMonthAbbr: {
2287
- regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec)", "i"),
2617
+ regex: RegExp("^(" + Ie + "|" + q + ")", "i"),
2288
2618
  name: "monthfull | monthabbr",
2289
2619
  callback(e, t) {
2290
- return this.ymd(this.y, X(t), this.d);
2620
+ return this.ymd(this.y, Q(t), this.d);
2291
2621
  }
2292
2622
  },
2293
2623
  tzCorrection: {
2294
- regex: /* @__PURE__ */ RegExp("^((?:GMT)?([+-])(2[0-4]|[01]?[0-9]):?([0-5]?[0-9])?)", "i"),
2624
+ regex: RegExp("^" + Le, "i"),
2295
2625
  name: "tzcorrection",
2296
2626
  callback(e) {
2297
- return this.zone(Q(e));
2627
+ return this.zone(ze(e));
2298
2628
  }
2299
2629
  },
2300
2630
  tzAbbr: {
2301
2631
  regex: /* @__PURE__ */ RegExp("^\\(?([a-zA-Z]{1,6})\\)?"),
2302
2632
  name: "tzabbr",
2303
2633
  callback(e, t) {
2304
- let n = ce[t.toLowerCase()];
2634
+ let n = Be[t.toLowerCase()];
2305
2635
  return n != null && !Number.isNaN(n) && this.zone(n);
2306
2636
  }
2307
2637
  },
@@ -2313,7 +2643,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
2313
2643
  }
2314
2644
  },
2315
2645
  year4: {
2316
- regex: /* @__PURE__ */ RegExp("^([0-9]{4})"),
2646
+ regex: RegExp("^" + H),
2317
2647
  name: "year4",
2318
2648
  callback(e, t) {
2319
2649
  return this.y = +t, !0;
@@ -2324,34 +2654,34 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
2324
2654
  name: "whitespace"
2325
2655
  },
2326
2656
  dateShortWithTimeLong: {
2327
- regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ .\\t-]*(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[,.stndrh\\t ]*t?(2[0-4]|[01]?[0-9])[:.]([0-5]?[0-9])[:.](60|[0-5]?[0-9])", "i"),
2657
+ regex: RegExp("^" + Y + "t?" + F + "[:.]" + R + "[:.]" + je, "i"),
2328
2658
  name: "dateshortwithtimelong",
2329
2659
  callback(e, t, n, r, i, a) {
2330
- return this.ymd(this.y, X(t), +n) && this.time(+r, +i, +a, 0);
2660
+ return this.ymd(this.y, Q(t), +n) && this.time(+r, +i, +a, 0);
2331
2661
  }
2332
2662
  },
2333
2663
  dateShortWithTimeLong12: {
2334
- regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ .\\t-]*(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[,.stndrh\\t ]*(0?[1-9]|1[0-2])[:.]([0-5]?[0-9])[:.](60|[0-5][0-9])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
2664
+ regex: RegExp("^" + Y + L + "[:.]" + R + "[:.]" + B + N + P, "i"),
2335
2665
  name: "dateshortwithtimelong12",
2336
2666
  callback(e, t, n, r, i, a, o) {
2337
- return this.ymd(this.y, X(t), +n) && this.time(J(+r, o), +i, +a, 0);
2667
+ return this.ymd(this.y, Q(t), +n) && this.time(X(+r, o), +i, +a, 0);
2338
2668
  }
2339
2669
  },
2340
2670
  dateShortWithTimeShort: {
2341
- regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ .\\t-]*(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[,.stndrh\\t ]*t?(2[0-4]|[01]?[0-9])[:.]([0-5]?[0-9])", "i"),
2671
+ regex: RegExp("^" + Y + "t?" + F + "[:.]" + R, "i"),
2342
2672
  name: "dateshortwithtimeshort",
2343
2673
  callback(e, t, n, r, i) {
2344
- return this.ymd(this.y, X(t), +n) && this.time(+r, +i, 0, 0);
2674
+ return this.ymd(this.y, Q(t), +n) && this.time(+r, +i, 0, 0);
2345
2675
  }
2346
2676
  },
2347
2677
  dateShortWithTimeShort12: {
2348
- regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ .\\t-]*(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[,.stndrh\\t ]*(0?[1-9]|1[0-2])[:.]([0-5][0-9])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
2678
+ regex: RegExp("^" + Y + L + "[:.]" + z + N + P, "i"),
2349
2679
  name: "dateshortwithtimeshort12",
2350
2680
  callback(e, t, n, r, i, a) {
2351
- return this.ymd(this.y, X(t), +n) && this.time(J(+r, a), +i, 0, 0);
2681
+ return this.ymd(this.y, Q(t), +n) && this.time(X(+r, a), +i, 0, 0);
2352
2682
  }
2353
2683
  }
2354
- }, le = {
2684
+ }, Ve = {
2355
2685
  y: NaN,
2356
2686
  m: NaN,
2357
2687
  d: NaN,
@@ -2413,174 +2743,459 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
2413
2743
  return isNaN(this.z) || t.getTimezoneOffset() === this.z || (t.setUTCFullYear(t.getFullYear(), t.getMonth(), t.getDate()), t.setUTCHours(t.getHours(), t.getMinutes(), t.getSeconds() - this.z, t.getMilliseconds())), t;
2414
2744
  }
2415
2745
  };
2416
- e.AbstractProvider = R, e.ArrayAdapter = P, e.ArrayProvider = class extends R {
2746
+ function He(e, t) {
2747
+ let n = t ?? Math.floor(Date.now() / 1e3), r = [
2748
+ $.yesterday,
2749
+ $.now,
2750
+ $.noon,
2751
+ $.midnightOrToday,
2752
+ $.tomorrow,
2753
+ $.timestamp,
2754
+ $.firstOrLastDay,
2755
+ $.backOrFrontOf,
2756
+ $.timeTiny12,
2757
+ $.timeShort12,
2758
+ $.timeLong12,
2759
+ $.mssqltime,
2760
+ $.oracledate,
2761
+ $.timeShort24,
2762
+ $.timeLong24,
2763
+ $.iso8601long,
2764
+ $.gnuNoColon,
2765
+ $.iso8601noColon,
2766
+ $.americanShort,
2767
+ $.american,
2768
+ $.iso8601date4,
2769
+ $.iso8601dateSlash,
2770
+ $.dateSlash,
2771
+ $.gnuDateShortOrIso8601date2,
2772
+ $.gnuDateShorter,
2773
+ $.dateFull,
2774
+ $.pointedDate4,
2775
+ $.pointedDate2,
2776
+ $.dateNoDay,
2777
+ $.dateNoDayRev,
2778
+ $.dateTextual,
2779
+ $.dateNoYear,
2780
+ $.dateNoYearRev,
2781
+ $.dateNoColon,
2782
+ $.xmlRpc,
2783
+ $.xmlRpcNoColon,
2784
+ $.soap,
2785
+ $.wddx,
2786
+ $.exif,
2787
+ $.pgydotd,
2788
+ $.isoWeekDay,
2789
+ $.pgTextShort,
2790
+ $.pgTextReverse,
2791
+ $.clf,
2792
+ $.year4,
2793
+ $.ago,
2794
+ $.dayText,
2795
+ $.relativeTextWeek,
2796
+ $.relativeText,
2797
+ $.monthFullOrMonthAbbr,
2798
+ $.tzCorrection,
2799
+ $.tzAbbr,
2800
+ $.dateShortWithTimeShort12,
2801
+ $.dateShortWithTimeLong12,
2802
+ $.dateShortWithTimeShort,
2803
+ $.dateShortWithTimeLong,
2804
+ $.relative,
2805
+ $.whitespace
2806
+ ], i = { ...Ve };
2807
+ for (; e.length;) {
2808
+ let t = null, n = null;
2809
+ for (let i of r) {
2810
+ let r = e.match(i.regex);
2811
+ r && (!t || r[0].length > t[0].length) && (t = r, n = i);
2812
+ }
2813
+ if (!n || !t || n.callback && !1 === n.callback.apply(i, t)) return !1;
2814
+ e = e.substr(t[0].length), n = null, t = null;
2815
+ }
2816
+ return Math.floor(i.toDate(/* @__PURE__ */ new Date(1e3 * n)).getTime() / 1e3);
2817
+ }
2818
+ function Ue(e) {
2819
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
2820
+ }
2821
+ var We, Ge = { exports: {} }, Ke = Ue((We || (We = 1, function(e) {
2822
+ e.exports = function() {
2823
+ var e = 1e3, t = 6e4, n = 36e5, r = "millisecond", i = "second", a = "minute", o = "hour", s = "day", c = "week", l = "month", u = "quarter", d = "year", f = "date", p = "Invalid Date", m = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, h = /\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, g = {
2824
+ name: "en",
2825
+ weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
2826
+ months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
2827
+ ordinal: function(e) {
2828
+ var t = [
2829
+ "th",
2830
+ "st",
2831
+ "nd",
2832
+ "rd"
2833
+ ], n = e % 100;
2834
+ return "[" + e + (t[(n - 20) % 10] || t[n] || t[0]) + "]";
2835
+ }
2836
+ }, _ = function(e, t, n) {
2837
+ var r = String(e);
2838
+ return !r || r.length >= t ? e : "" + Array(t + 1 - r.length).join(n) + e;
2839
+ }, v = {
2840
+ s: _,
2841
+ z: function(e) {
2842
+ var t = -e.utcOffset(), n = Math.abs(t), r = Math.floor(n / 60), i = n % 60;
2843
+ return (t <= 0 ? "+" : "-") + _(r, 2, "0") + ":" + _(i, 2, "0");
2844
+ },
2845
+ m: function e(t, n) {
2846
+ if (t.date() < n.date()) return -e(n, t);
2847
+ var r = 12 * (n.year() - t.year()) + (n.month() - t.month()), i = t.clone().add(r, l), a = n - i < 0, o = t.clone().add(r + (a ? -1 : 1), l);
2848
+ return +(-(r + (n - i) / (a ? i - o : o - i)) || 0);
2849
+ },
2850
+ a: function(e) {
2851
+ return e < 0 ? Math.ceil(e) || 0 : Math.floor(e);
2852
+ },
2853
+ p: function(e) {
2854
+ return {
2855
+ M: l,
2856
+ y: d,
2857
+ w: c,
2858
+ d: s,
2859
+ D: f,
2860
+ h: o,
2861
+ m: a,
2862
+ s: i,
2863
+ ms: r,
2864
+ Q: u
2865
+ }[e] || String(e || "").toLowerCase().replace(/s$/, "");
2866
+ },
2867
+ u: function(e) {
2868
+ return e === void 0;
2869
+ }
2870
+ }, y = "en", b = {};
2871
+ b[y] = g;
2872
+ var x = "$isDayjsObject", S = function(e) {
2873
+ return e instanceof E || !(!e || !e[x]);
2874
+ }, C = function e(t, n, r) {
2875
+ var i;
2876
+ if (!t) return y;
2877
+ if (typeof t == "string") {
2878
+ var a = t.toLowerCase();
2879
+ b[a] && (i = a), n && (b[a] = n, i = a);
2880
+ var o = t.split("-");
2881
+ if (!i && o.length > 1) return e(o[0]);
2882
+ } else {
2883
+ var s = t.name;
2884
+ b[s] = t, i = s;
2885
+ }
2886
+ return !r && i && (y = i), i || !r && y;
2887
+ }, w = function(e, t) {
2888
+ if (S(e)) return e.clone();
2889
+ var n = typeof t == "object" ? t : {};
2890
+ return n.date = e, n.args = arguments, new E(n);
2891
+ }, T = v;
2892
+ T.l = C, T.i = S, T.w = function(e, t) {
2893
+ return w(e, {
2894
+ locale: t.$L,
2895
+ utc: t.$u,
2896
+ x: t.$x,
2897
+ $offset: t.$offset
2898
+ });
2899
+ };
2900
+ var E = function() {
2901
+ function g(e) {
2902
+ this.$L = C(e.locale, null, !0), this.parse(e), this.$x = this.$x || e.x || {}, this[x] = !0;
2903
+ }
2904
+ var _ = g.prototype;
2905
+ return _.parse = function(e) {
2906
+ this.$d = function(e) {
2907
+ var t = e.date, n = e.utc;
2908
+ if (t === null) return /* @__PURE__ */ new Date(NaN);
2909
+ if (T.u(t)) return /* @__PURE__ */ new Date();
2910
+ if (t instanceof Date) return new Date(t);
2911
+ if (typeof t == "string" && !/Z$/i.test(t)) {
2912
+ var r = t.match(m);
2913
+ if (r) {
2914
+ var i = r[2] - 1 || 0, a = (r[7] || "0").substring(0, 3);
2915
+ return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, a)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, a);
2916
+ }
2917
+ }
2918
+ return new Date(t);
2919
+ }(e), this.init();
2920
+ }, _.init = function() {
2921
+ var e = this.$d;
2922
+ this.$y = e.getFullYear(), this.$M = e.getMonth(), this.$D = e.getDate(), this.$W = e.getDay(), this.$H = e.getHours(), this.$m = e.getMinutes(), this.$s = e.getSeconds(), this.$ms = e.getMilliseconds();
2923
+ }, _.$utils = function() {
2924
+ return T;
2925
+ }, _.isValid = function() {
2926
+ return this.$d.toString() !== p;
2927
+ }, _.isSame = function(e, t) {
2928
+ var n = w(e);
2929
+ return this.startOf(t) <= n && n <= this.endOf(t);
2930
+ }, _.isAfter = function(e, t) {
2931
+ return w(e) < this.startOf(t);
2932
+ }, _.isBefore = function(e, t) {
2933
+ return this.endOf(t) < w(e);
2934
+ }, _.$g = function(e, t, n) {
2935
+ return T.u(e) ? this[t] : this.set(n, e);
2936
+ }, _.unix = function() {
2937
+ return Math.floor(this.valueOf() / 1e3);
2938
+ }, _.valueOf = function() {
2939
+ return this.$d.getTime();
2940
+ }, _.startOf = function(e, t) {
2941
+ var n = this, r = !!T.u(t) || t, u = T.p(e), p = function(e, t) {
2942
+ var i = T.w(n.$u ? Date.UTC(n.$y, t, e) : new Date(n.$y, t, e), n);
2943
+ return r ? i : i.endOf(s);
2944
+ }, m = function(e, t) {
2945
+ return T.w(n.toDate()[e].apply(n.toDate("s"), (r ? [
2946
+ 0,
2947
+ 0,
2948
+ 0,
2949
+ 0
2950
+ ] : [
2951
+ 23,
2952
+ 59,
2953
+ 59,
2954
+ 999
2955
+ ]).slice(t)), n);
2956
+ }, h = this.$W, g = this.$M, _ = this.$D, v = "set" + (this.$u ? "UTC" : "");
2957
+ switch (u) {
2958
+ case d: return r ? p(1, 0) : p(31, 11);
2959
+ case l: return r ? p(1, g) : p(0, g + 1);
2960
+ case c:
2961
+ var y = this.$locale().weekStart || 0, b = (h < y ? h + 7 : h) - y;
2962
+ return p(r ? _ - b : _ + (6 - b), g);
2963
+ case s:
2964
+ case f: return m(v + "Hours", 0);
2965
+ case o: return m(v + "Minutes", 1);
2966
+ case a: return m(v + "Seconds", 2);
2967
+ case i: return m(v + "Milliseconds", 3);
2968
+ default: return this.clone();
2969
+ }
2970
+ }, _.endOf = function(e) {
2971
+ return this.startOf(e, !1);
2972
+ }, _.$set = function(e, t) {
2973
+ var n, c = T.p(e), u = "set" + (this.$u ? "UTC" : ""), p = (n = {}, n[s] = u + "Date", n[f] = u + "Date", n[l] = u + "Month", n[d] = u + "FullYear", n[o] = u + "Hours", n[a] = u + "Minutes", n[i] = u + "Seconds", n[r] = u + "Milliseconds", n)[c], m = c === s ? this.$D + (t - this.$W) : t;
2974
+ if (c === l || c === d) {
2975
+ var h = this.clone().set(f, 1);
2976
+ h.$d[p](m), h.init(), this.$d = h.set(f, Math.min(this.$D, h.daysInMonth())).$d;
2977
+ } else p && this.$d[p](m);
2978
+ return this.init(), this;
2979
+ }, _.set = function(e, t) {
2980
+ return this.clone().$set(e, t);
2981
+ }, _.get = function(e) {
2982
+ return this[T.p(e)]();
2983
+ }, _.add = function(r, u) {
2984
+ var f, p = this;
2985
+ r = Number(r);
2986
+ var m = T.p(u), h = function(e) {
2987
+ var t = w(p);
2988
+ return T.w(t.date(t.date() + Math.round(e * r)), p);
2989
+ };
2990
+ if (m === l) return this.set(l, this.$M + r);
2991
+ if (m === d) return this.set(d, this.$y + r);
2992
+ if (m === s) return h(1);
2993
+ if (m === c) return h(7);
2994
+ var g = (f = {}, f[a] = t, f[o] = n, f[i] = e, f)[m] || 1, _ = this.$d.getTime() + r * g;
2995
+ return T.w(_, this);
2996
+ }, _.subtract = function(e, t) {
2997
+ return this.add(-1 * e, t);
2998
+ }, _.format = function(e) {
2999
+ var t = this, n = this.$locale();
3000
+ if (!this.isValid()) return n.invalidDate || p;
3001
+ var r = e || "YYYY-MM-DDTHH:mm:ssZ", i = T.z(this), a = this.$H, o = this.$m, s = this.$M, c = n.weekdays, l = n.months, u = n.meridiem, d = function(e, n, i, a) {
3002
+ return e && (e[n] || e(t, r)) || i[n].slice(0, a);
3003
+ }, f = function(e) {
3004
+ return T.s(a % 12 || 12, e, "0");
3005
+ }, m = u || function(e, t, n) {
3006
+ var r = e < 12 ? "AM" : "PM";
3007
+ return n ? r.toLowerCase() : r;
3008
+ };
3009
+ return r.replace(h, function(e, r) {
3010
+ return r || function(e) {
3011
+ switch (e) {
3012
+ case "YY": return String(t.$y).slice(-2);
3013
+ case "YYYY": return T.s(t.$y, 4, "0");
3014
+ case "M": return s + 1;
3015
+ case "MM": return T.s(s + 1, 2, "0");
3016
+ case "MMM": return d(n.monthsShort, s, l, 3);
3017
+ case "MMMM": return d(l, s);
3018
+ case "D": return t.$D;
3019
+ case "DD": return T.s(t.$D, 2, "0");
3020
+ case "d": return String(t.$W);
3021
+ case "dd": return d(n.weekdaysMin, t.$W, c, 2);
3022
+ case "ddd": return d(n.weekdaysShort, t.$W, c, 3);
3023
+ case "dddd": return c[t.$W];
3024
+ case "H": return String(a);
3025
+ case "HH": return T.s(a, 2, "0");
3026
+ case "h": return f(1);
3027
+ case "hh": return f(2);
3028
+ case "a": return m(a, o, !0);
3029
+ case "A": return m(a, o, !1);
3030
+ case "m": return String(o);
3031
+ case "mm": return T.s(o, 2, "0");
3032
+ case "s": return String(t.$s);
3033
+ case "ss": return T.s(t.$s, 2, "0");
3034
+ case "SSS": return T.s(t.$ms, 3, "0");
3035
+ case "Z": return i;
3036
+ }
3037
+ return null;
3038
+ }(e) || i.replace(":", "");
3039
+ });
3040
+ }, _.utcOffset = function() {
3041
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
3042
+ }, _.diff = function(r, f, p) {
3043
+ var m, h = this, g = T.p(f), _ = w(r), v = (_.utcOffset() - this.utcOffset()) * t, y = this - _, b = function() {
3044
+ return T.m(h, _);
3045
+ };
3046
+ switch (g) {
3047
+ case d:
3048
+ m = b() / 12;
3049
+ break;
3050
+ case l:
3051
+ m = b();
3052
+ break;
3053
+ case u:
3054
+ m = b() / 3;
3055
+ break;
3056
+ case c:
3057
+ m = (y - v) / 6048e5;
3058
+ break;
3059
+ case s:
3060
+ m = (y - v) / 864e5;
3061
+ break;
3062
+ case o:
3063
+ m = y / n;
3064
+ break;
3065
+ case a:
3066
+ m = y / t;
3067
+ break;
3068
+ case i:
3069
+ m = y / e;
3070
+ break;
3071
+ default: m = y;
3072
+ }
3073
+ return p ? m : T.a(m);
3074
+ }, _.daysInMonth = function() {
3075
+ return this.endOf(l).$D;
3076
+ }, _.$locale = function() {
3077
+ return b[this.$L];
3078
+ }, _.locale = function(e, t) {
3079
+ if (!e) return this.$L;
3080
+ var n = this.clone(), r = C(e, t, !0);
3081
+ return r && (n.$L = r), n;
3082
+ }, _.clone = function() {
3083
+ return T.w(this.$d, this);
3084
+ }, _.toDate = function() {
3085
+ return new Date(this.valueOf());
3086
+ }, _.toJSON = function() {
3087
+ return this.isValid() ? this.toISOString() : null;
3088
+ }, _.toISOString = function() {
3089
+ return this.$d.toISOString();
3090
+ }, _.toString = function() {
3091
+ return this.$d.toUTCString();
3092
+ }, g;
3093
+ }(), D = E.prototype;
3094
+ return w.prototype = D, [
3095
+ ["$ms", r],
3096
+ ["$s", i],
3097
+ ["$m", a],
3098
+ ["$H", o],
3099
+ ["$W", s],
3100
+ ["$M", l],
3101
+ ["$y", d],
3102
+ ["$D", f]
3103
+ ].forEach(function(e) {
3104
+ D[e[1]] = function(t) {
3105
+ return this.$g(t, e[0], e[1]);
3106
+ };
3107
+ }), w.extend = function(e, t) {
3108
+ return e.$i ||= (e(t, E, w), !0), w;
3109
+ }, w.locale = C, w.isDayjs = S, w.unix = function(e) {
3110
+ return w(1e3 * e);
3111
+ }, w.en = b[y], w.Ls = b, w.p = {}, w;
3112
+ }();
3113
+ }(Ge)), Ge.exports));
3114
+ let qe = (e) => typeof e == "string", Je = (e, t) => e.format(t), Ye = {
3115
+ isString: qe,
3116
+ strLen: (e) => qe(e) ? e.length : 0,
3117
+ isEmail: (e) => !!qe(e) && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),
3118
+ isPhone: (e) => !!qe(e) && (e.substring(0, 2) === "+1" && (e = e.substring(2)), /^\d{10}$/.test(e.replace(/\D/g, ""))),
3119
+ isNull: (e) => e === null,
3120
+ isCurrency: (e) => /(?=.*?\d)^\$?(([1-9]\d{0,2}(,\d{3})*)|\d+)?(\.\d{1,2})?$/.test(e),
3121
+ now: () => Ke(),
3122
+ dateFormat: Je,
3123
+ year: (e) => Je(e, "YYYY"),
3124
+ date: (e) => Je(e, "YYYY-MM-DD"),
3125
+ string: (e) => e == null || e.toString === void 0 ? "" : e.toString(),
3126
+ int: (e) => parseInt(e)
3127
+ }, Xe = {
3128
+ strtolower: _e,
3129
+ strtoupper: ve,
3130
+ explode: le,
3131
+ strlen: ge,
3132
+ strstr: be,
3133
+ stristr: xe,
3134
+ substr: ye,
3135
+ implode: Te,
3136
+ count: we,
3137
+ array_intersect: (...e) => Oe.getEvaluator()(null, ...e),
3138
+ date: ke,
3139
+ strtotime: He
3140
+ };
3141
+ e.AbstractProvider = j, e.ArrayAdapter = ae, e.ArrayProvider = class extends j {
2417
3142
  getFunctions() {
2418
3143
  return [
2419
- ie,
2420
- ae,
2421
- oe
3144
+ Ee,
3145
+ De,
3146
+ Oe
2422
3147
  ];
2423
3148
  }
2424
- }, e.BasicProvider = class extends R {
3149
+ }, e.BasicProvider = class extends j {
2425
3150
  getFunctions() {
2426
- return [z];
3151
+ return [ce];
2427
3152
  }
2428
- }, e.Compiler = A, e.DateProvider = class extends R {
3153
+ }, e.CacheItem = k, e.CompileRuntime = Xe, e.Compiler = ne, e.DateProvider = class extends j {
2429
3154
  getFunctions() {
2430
- return [new I("date", function(e, t) {
3155
+ return [new A("date", function(e, t) {
2431
3156
  let n = "";
2432
- return t && (n = `, ${t}`), `date(${e}${n})`;
3157
+ return t && (n = `, ${t}`), `__runtime.date(${e}${n})`;
2433
3158
  }, function(e, t, n) {
2434
- return se(t, n);
2435
- }), new I("strtotime", function(e, t) {
3159
+ return ke(t, n);
3160
+ }), new A("strtotime", function(e, t) {
2436
3161
  let n = "";
2437
- return t && (n = `, ${t}`), `strtotime(${e}${n})`;
3162
+ return t && (n = `, ${t}`), `__runtime.strtotime(${e}${n})`;
2438
3163
  }, function(e, t, n) {
2439
- return function(e, t) {
2440
- let n = t ?? Math.floor(Date.now() / 1e3), r = [
2441
- $.yesterday,
2442
- $.now,
2443
- $.noon,
2444
- $.midnightOrToday,
2445
- $.tomorrow,
2446
- $.timestamp,
2447
- $.firstOrLastDay,
2448
- $.backOrFrontOf,
2449
- $.timeTiny12,
2450
- $.timeShort12,
2451
- $.timeLong12,
2452
- $.mssqltime,
2453
- $.oracledate,
2454
- $.timeShort24,
2455
- $.timeLong24,
2456
- $.iso8601long,
2457
- $.gnuNoColon,
2458
- $.iso8601noColon,
2459
- $.americanShort,
2460
- $.american,
2461
- $.iso8601date4,
2462
- $.iso8601dateSlash,
2463
- $.dateSlash,
2464
- $.gnuDateShortOrIso8601date2,
2465
- $.gnuDateShorter,
2466
- $.dateFull,
2467
- $.pointedDate4,
2468
- $.pointedDate2,
2469
- $.dateNoDay,
2470
- $.dateNoDayRev,
2471
- $.dateTextual,
2472
- $.dateNoYear,
2473
- $.dateNoYearRev,
2474
- $.dateNoColon,
2475
- $.xmlRpc,
2476
- $.xmlRpcNoColon,
2477
- $.soap,
2478
- $.wddx,
2479
- $.exif,
2480
- $.pgydotd,
2481
- $.isoWeekDay,
2482
- $.pgTextShort,
2483
- $.pgTextReverse,
2484
- $.clf,
2485
- $.year4,
2486
- $.ago,
2487
- $.dayText,
2488
- $.relativeTextWeek,
2489
- $.relativeText,
2490
- $.monthFullOrMonthAbbr,
2491
- $.tzCorrection,
2492
- $.tzAbbr,
2493
- $.dateShortWithTimeShort12,
2494
- $.dateShortWithTimeLong12,
2495
- $.dateShortWithTimeShort,
2496
- $.dateShortWithTimeLong,
2497
- $.relative,
2498
- $.whitespace
2499
- ], i = { ...le };
2500
- for (; e.length;) {
2501
- let t = null, n = null;
2502
- for (let i of r) {
2503
- let r = e.match(i.regex);
2504
- r && (!t || r[0].length > t[0].length) && (t = r, n = i);
2505
- }
2506
- if (!n || !t || n.callback && !1 === n.callback.apply(i, t)) return !1;
2507
- e = e.substr(t[0].length), n = null, t = null;
2508
- }
2509
- return Math.floor(i.toDate(/* @__PURE__ */ new Date(1e3 * n)).getTime() / 1e3);
2510
- }(t, n);
3164
+ return He(t, n);
2511
3165
  })];
2512
3166
  }
2513
- }, e.ExpressionFunction = I, e.ExpressionLanguage = L, e.IGNORE_UNKNOWN_FUNCTIONS = 2, e.IGNORE_UNKNOWN_VARIABLES = 1, e.Parser = k, e.StringProvider = class extends R {
3167
+ }, e.Expression = re, e.ExpressionFunction = A, e.ExpressionLanguage = se, e.IGNORE_UNKNOWN_FUNCTIONS = 2, e.IGNORE_UNKNOWN_VARIABLES = 1, e.Node = _, e.OPERATOR_LEFT = 1, e.OPERATOR_RIGHT = 2, e.ParsedExpression = O, e.Parser = te, e.StringProvider = class extends j {
2514
3168
  getFunctions() {
2515
3169
  return [
2516
- new I("strtolower", (e) => "strtolower(" + e + ")", (e, t) => function(e) {
2517
- return (e + "").toLowerCase();
2518
- }(t)),
2519
- new I("strtoupper", (e) => "strtoupper(" + e + ")", (e, t) => function(e) {
2520
- return (e + "").toUpperCase();
2521
- }(t)),
2522
- new I("explode", (e, t, n = "null") => `explode(${e}, ${t}, ${n})`, (e, t, n, r = null) => function(...e) {
2523
- let [t, n, r] = e, i = t, a = n;
2524
- if (e.length < 2 || i === void 0 || a === void 0) return null;
2525
- if (i === "" || !1 === i || i === null) return !1;
2526
- if (typeof i == "function" || typeof i == "object" || typeof a == "function" || typeof a == "object") return { 0: "" };
2527
- !0 === i && (i = "1");
2528
- let o = i + "", s = (a + "").split(o);
2529
- return r === void 0 ? s : (r === 0 && (r = 1), r > 0 ? r >= s.length ? s : s.slice(0, r - 1).concat([s.slice(r - 1).join(o)]) : -r >= s.length ? [] : (s.splice(s.length + r), s));
2530
- }(t, n, r)),
2531
- new I("strlen", function(e) {
2532
- return `strlen(${e});`;
3170
+ new A("strtolower", (e) => "__runtime.strtolower(" + e + ")", (e, t) => _e(t)),
3171
+ new A("strtoupper", (e) => "__runtime.strtoupper(" + e + ")", (e, t) => ve(t)),
3172
+ new A("explode", (e, t, n = "null") => `__runtime.explode(${e}, ${t}, ${n})`, (e, t, n, r = null) => le(t, n, r)),
3173
+ new A("strlen", function(e) {
3174
+ return `__runtime.strlen(${e})`;
2533
3175
  }, function(e, t) {
2534
- return function(e) {
2535
- let t = e + "";
2536
- if ((G("unicode.semantics") || "off") === "off") return t.length;
2537
- let n = 0, r = 0, i = function(e, t) {
2538
- let n = e.charCodeAt(t);
2539
- if (n >= 55296 && n <= 56319) {
2540
- if (e.length <= t + 1) throw Error("High surrogate without following low surrogate");
2541
- let n = e.charCodeAt(t + 1);
2542
- if (n < 56320 || n > 57343) throw Error("High surrogate without following low surrogate");
2543
- return e.charAt(t) + e.charAt(t + 1);
2544
- }
2545
- if (n >= 56320 && n <= 57343) {
2546
- if (t === 0) throw Error("Low surrogate without preceding high surrogate");
2547
- let n = e.charCodeAt(t - 1);
2548
- if (n < 55296 || n > 56319) throw Error("Low surrogate without preceding high surrogate");
2549
- return !1;
2550
- }
2551
- return e.charAt(t);
2552
- };
2553
- for (n = 0, r = 0; n < t.length; n++) !1 !== i(t, n) && r++;
2554
- return r;
2555
- }(t);
3176
+ return ge(t);
2556
3177
  }),
2557
- new I("strstr", function(e, t, n) {
3178
+ new A("strstr", function(e, t, n) {
2558
3179
  let r = "";
2559
- return n && (r = `, ${n}`), `strstr(${e}, ${t}${r});`;
3180
+ return n && (r = `, ${n}`), `__runtime.strstr(${e}, ${t}${r})`;
2560
3181
  }, function(e, t, n, r) {
2561
- return function(e, t, n) {
2562
- let r = 0;
2563
- return r = (e += "").indexOf(t), r !== -1 && (n ? e.substr(0, r) : e.slice(r));
2564
- }(t, n, r);
3182
+ return be(t, n, r);
2565
3183
  }),
2566
- new I("stristr", function(e, t, n) {
3184
+ new A("stristr", function(e, t, n) {
2567
3185
  let r = "";
2568
- return n && (r = `, ${n}`), `stristr(${e}, ${t}${r});`;
3186
+ return n && (r = `, ${n}`), `__runtime.stristr(${e}, ${t}${r})`;
2569
3187
  }, function(e, t, n, r) {
2570
- return function(e, t, n) {
2571
- let r = 0;
2572
- return r = (e += "").toLowerCase().indexOf((t + "").toLowerCase()), r !== -1 && (n ? e.substr(0, r) : e.slice(r));
2573
- }(t, n, r);
3188
+ return xe(t, n, r);
2574
3189
  }),
2575
- new I("substr", function(e, t, n) {
3190
+ new A("substr", function(e, t, n) {
2576
3191
  let r = "";
2577
- return n && (r = `, ${n}`), `substr(${e}, ${t}${r});`;
3192
+ return n && (r = `, ${n}`), `__runtime.substr(${e}, ${t}${r})`;
2578
3193
  }, function(e, t, n, r) {
2579
- return ne(t, n, r);
3194
+ return ye(t, n, r);
2580
3195
  })
2581
3196
  ];
2582
3197
  }
2583
- }, e.default = L, e.tokenize = o, Object.defineProperty(e, "__esModule", { value: !0 });
3198
+ }, e.SyntaxError = r, e.Token = a, e.TokenStream = i, e.default = se, e.defaultCustomFunctions = Ye, e.tokenize = o, Object.defineProperty(e, "__esModule", { value: !0 });
2584
3199
  }), function(e) {
2585
3200
  var t = e.ExpressionLanguage;
2586
3201
  if (t && typeof t.ExpressionLanguage == "function") {
@@ -2590,22 +3205,22 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
2590
3205
  }), e.ExpressionLanguage = n;
2591
3206
  }
2592
3207
  }(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : e);
2593
- })))(), 1), v = null;
2594
- function y() {
2595
- let e = _, t = e.ExpressionLanguage || e.default || _;
3208
+ })))(), 1), T = null;
3209
+ function E() {
3210
+ let e = w, t = e.ExpressionLanguage || e.default || w;
2596
3211
  if (typeof t != "function") throw TypeError("Unable to resolve expression-language constructor.");
2597
3212
  return t;
2598
3213
  }
2599
- function b() {
2600
- return v ??= new (y())(), v;
3214
+ function D() {
3215
+ return T ??= new (E())(), T;
2601
3216
  }
2602
- function x(e) {
3217
+ function ee(e) {
2603
3218
  return (e.formula?.expression || e.formula?.formula || "").trim();
2604
3219
  }
2605
- function S(e) {
3220
+ function te(e) {
2606
3221
  return Object.entries(e.formula?.variables || {}).filter((e) => !!e[1]?.sourceKey);
2607
3222
  }
2608
- function C(e, t) {
3223
+ function ne(e, t) {
2609
3224
  return Object.entries(e).forEach(([t, n]) => {
2610
3225
  if (Array.isArray(n)) {
2611
3226
  let r = n.map((e) => typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? Number(e) : e), i = r.filter((e) => typeof e == "number");
@@ -2615,45 +3230,258 @@ function C(e, t) {
2615
3230
  typeof n == "string" && n.trim() !== "" && !Number.isNaN(Number(n)) && (e[t] = Number(n));
2616
3231
  }), e;
2617
3232
  }
2618
- function w(e, t) {
3233
+ function re(e, t) {
2619
3234
  if (t.formatting !== "number") return typeof e == "number" || typeof e == "string" ? e : "";
2620
3235
  let n = e;
2621
3236
  Array.isArray(n) && (n = n.reduce((e, t) => e + Number(t || 0), 0));
2622
3237
  let r = typeof t.decimals == "number" ? t.decimals : 0, i = Number(n || 0).toFixed(r);
2623
3238
  return `${t.prefix || ""}${i}${t.suffix || ""}`;
2624
3239
  }
2625
- function T(e, t) {
3240
+ function O(e, t) {
2626
3241
  let n = e.type?.endsWith("\\Number");
2627
3242
  return e.type?.endsWith("\\Checkboxes") ? Array.isArray(t) ? t.length ? t : "" : t ? [t] : "" : Array.isArray(t) ? t.length ? n ? t.map((e) => Number(e || 0)) : t : "" : n ? Number(t || 0) : t;
2628
3243
  }
2629
- function E(e, t, n) {
2630
- return w(b().evaluate(e, t), n);
3244
+ function ie(e, t, n) {
3245
+ return re(D().evaluate(e, t), n);
3246
+ }
3247
+ var ae = /* @__PURE__ */ new Map();
3248
+ async function k(e, t, n = {}) {
3249
+ let r = n.profile ?? "same-origin-browser", i = oe(e, n, t.headers), a = await fetch(e, {
3250
+ ...t,
3251
+ headers: i,
3252
+ credentials: r === "cross-origin-public" ? "omit" : "same-origin"
3253
+ }), o = new URL(e, typeof location > "u" ? "http://localhost" : location.href).origin, s = a.headers.get("X-Formie-Session");
3254
+ return r === "cross-origin-public" && s && ae.set(o, s), a;
3255
+ }
3256
+ function oe(e, t = {}, n) {
3257
+ let r = t.profile ?? "same-origin-browser";
3258
+ if (!["same-origin-browser", "cross-origin-public"].includes(r)) throw Error("Client-rendered forms require a public browser profile. Use administrative API mutations for trusted administration.");
3259
+ let i = new Headers(n);
3260
+ i.set("X-Formie-Profile", r);
3261
+ let a = new URL(e, typeof location > "u" ? "http://localhost" : location.href).origin;
3262
+ if (r === "cross-origin-public") {
3263
+ let e = t.publicSession ?? ae.get(a);
3264
+ e && i.set("X-Formie-Session", e);
3265
+ }
3266
+ return i;
2631
3267
  }
2632
- var D = (() => {
3268
+ var A = (() => {
3269
+ if (typeof Intl > "u") return null;
2633
3270
  let e = Intl.Segmenter;
2634
- return e ? new e(void 0, { granularity: "grapheme" }) : null;
2635
- })(), O = /[\p{L}\p{N}\p{M}]+(?:['’._-][\p{L}\p{N}\p{M}]+)*/gu;
2636
- function k(e) {
2637
- return typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "text/html").body.textContent || "" : e.replace(/<[^>]*>/g, " ");
3271
+ if (!e) return null;
3272
+ try {
3273
+ return new e(void 0, { granularity: "grapheme" });
3274
+ } catch {
3275
+ return null;
3276
+ }
3277
+ })(), se = /[^\s\u0085]+/gu, j = (() => {
3278
+ try {
3279
+ return /* @__PURE__ */ RegExp("(?:\\p{Regional_Indicator}{2}|\\p{Extended_Pictographic}[\\p{Emoji_Modifier}\\p{M}\\u{E0020}-\\u{E007F}]*(?:\\u{200D}\\p{Extended_Pictographic}[\\p{Emoji_Modifier}\\p{M}\\u{E0020}-\\u{E007F}]*)*|[\\s\\S])\\p{M}*", "gu");
3280
+ } catch {
3281
+ return null;
3282
+ }
3283
+ })();
3284
+ function ce(e) {
3285
+ return typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "text/html").body.textContent || "" : e.replace(/<[^>]*>/g, "");
2638
3286
  }
2639
- function A(e) {
2640
- return k(e);
3287
+ function le(e) {
3288
+ return ce(e);
2641
3289
  }
2642
- function j(e) {
2643
- return A(e).replace(/[\s\t\n\r]+/g, " ").trim();
3290
+ function ue(e) {
3291
+ return le(e).replace(/[\s\u0085]+/g, " ").trim();
2644
3292
  }
2645
- function M(e) {
2646
- return D ? Array.from(D.segment(e)).length : Array.from(e).length;
3293
+ function de(e) {
3294
+ return A ? Array.from(A.segment(e)).length : j ? e.match(j)?.length || 0 : Array.from(e).length;
2647
3295
  }
2648
- function N(e) {
2649
- return e.match(O)?.length || 0;
3296
+ function fe(e) {
3297
+ return e.match(se)?.length || 0;
2650
3298
  }
2651
- function P(e) {
2652
- let t = A(e), n = j(e);
3299
+ function pe(e) {
3300
+ let t = le(e), n = ue(e);
2653
3301
  return {
2654
- graphemeCount: M(t),
2655
- wordCount: N(n)
3302
+ graphemeCount: de(t),
3303
+ wordCount: fe(n)
3304
+ };
3305
+ }
3306
+ var M = { username: "user:name" };
3307
+ Object.entries({
3308
+ form: ["name", "handle"],
3309
+ submission: [
3310
+ "id",
3311
+ "uid",
3312
+ "title",
3313
+ "url",
3314
+ "date",
3315
+ "site",
3316
+ "status"
3317
+ ],
3318
+ site: [
3319
+ "id",
3320
+ "name",
3321
+ "handle",
3322
+ "url",
3323
+ "language"
3324
+ ]
3325
+ }).forEach(([e, t]) => {
3326
+ t.forEach((t) => {
3327
+ M[`${e}.${t}`] = `${e}:${t}`;
3328
+ });
3329
+ }), Object.entries({
3330
+ form: ["Name", "Handle"],
3331
+ submission: [
3332
+ "Title",
3333
+ "Url",
3334
+ "Id",
3335
+ "Uid",
3336
+ "Date",
3337
+ "Site",
3338
+ "Status"
3339
+ ],
3340
+ system: [
3341
+ "Name",
3342
+ "Email",
3343
+ "ReplyTo"
3344
+ ],
3345
+ site: [
3346
+ "Name",
3347
+ "Handle",
3348
+ "Url",
3349
+ "Id",
3350
+ "Language"
3351
+ ],
3352
+ user: [
3353
+ "Ip",
3354
+ "Id",
3355
+ "Email",
3356
+ "FullName",
3357
+ "FirstName",
3358
+ "LastName"
3359
+ ]
3360
+ }).forEach(([e, t]) => {
3361
+ t.forEach((t) => {
3362
+ M[e + t] = `${e}:${t[0].toLowerCase()}${t.slice(1)}`;
3363
+ });
3364
+ }), Object.entries({
3365
+ dateUs: "m/d/Y",
3366
+ dateInt: "d/m/Y",
3367
+ time12: "h:i a",
3368
+ time24: "H:i"
3369
+ }).forEach(([e, t]) => {
3370
+ M[e] = `timestamp;transform=format;preset=custom;pattern=${encodeURIComponent(t)}`;
3371
+ });
3372
+ function me(e) {
3373
+ let t = {
3374
+ raw: e,
3375
+ target: "",
3376
+ identifier: "",
3377
+ selector: "",
3378
+ default: "",
3379
+ transformerId: "",
3380
+ transformerParams: {},
3381
+ version: 1,
3382
+ isValid: !1
3383
+ }, n = (e) => ({
3384
+ ...t,
3385
+ diagnostic: e
3386
+ }), r = e.trim().match(/^\{([^{}]+)\}$/);
3387
+ if (!r) return n("invalidSyntax");
3388
+ let i = r[1].replace(/^field\./, "field:"), a = i.indexOf("|"), o = a < 0 ? "" : i.slice(a + 1);
3389
+ i = a < 0 ? i : i.slice(0, a);
3390
+ let s = i.indexOf(";"), c = s < 0 ? i : i.slice(0, s);
3391
+ i = (Object.prototype.hasOwnProperty.call(M, c) ? M[c] : c) + (s < 0 ? "" : i.slice(s));
3392
+ let [l, ...u] = i.split(";"), d = Object.create(null);
3393
+ try {
3394
+ for (let e of u) {
3395
+ let t = e.match(/^([a-zA-Z][a-zA-Z0-9_]*)=(.*)$/);
3396
+ if (!t || Object.prototype.hasOwnProperty.call(d, t[1])) return n("invalidMetadata");
3397
+ d[t[1]] = decodeURIComponent(t[2]);
3398
+ }
3399
+ if ((d.v ?? "1") !== "1") return n("unsupportedVersion");
3400
+ delete d.v;
3401
+ let e = l.indexOf(":"), r = e < 0 ? l : l.slice(0, e), i = e < 0 ? "" : l.slice(e + 1);
3402
+ if (!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(r)) return n("invalidSource");
3403
+ let a = "";
3404
+ if (r === "field" && i.includes(":")) {
3405
+ let e = i.indexOf(":");
3406
+ a = i.slice(e + 1), i = i.slice(0, e);
3407
+ }
3408
+ if (![
3409
+ "timestamp",
3410
+ "allFields",
3411
+ "allContentFields",
3412
+ "allVisibleFields"
3413
+ ].includes(r) && !i || /[\s{}]/.test(i + a)) return n("invalidIdentifier");
3414
+ let s = d.transform ?? "";
3415
+ return delete d.transform, {
3416
+ ...t,
3417
+ target: r,
3418
+ identifier: decodeURIComponent(i),
3419
+ selector: decodeURIComponent(a),
3420
+ default: decodeURIComponent(o),
3421
+ transformerId: s,
3422
+ transformerParams: d,
3423
+ isValid: !0
3424
+ };
3425
+ } catch {
3426
+ return n("invalidEncoding");
3427
+ }
3428
+ }
3429
+ function he(e, t) {
3430
+ let n = me(e);
3431
+ if (!n.isValid) return {
3432
+ expression: n,
3433
+ diagnostic: "invalidExpression"
3434
+ };
3435
+ let r = `${n.target}:${n.identifier}`, i = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
3436
+ if (!i(t.definitions, r)) return {
3437
+ expression: n,
3438
+ diagnostic: n.target === "field" ? "missingField" : "unknownSource"
3439
+ };
3440
+ let a = t.definitions[r];
3441
+ if (!a.availability.browser) return {
3442
+ expression: n,
3443
+ diagnostic: "forbiddenSource"
3444
+ };
3445
+ if (Object.keys(n.transformerParams).some((e) => [
3446
+ "scope",
3447
+ "index",
3448
+ "rows"
3449
+ ].includes(e))) return {
3450
+ expression: n,
3451
+ diagnostic: "invalidRowScope"
3452
+ };
3453
+ if (n.selector && !a.selectors?.includes(n.selector)) return {
3454
+ expression: n,
3455
+ diagnostic: "invalidSelector"
3456
+ };
3457
+ let o = n.selector ? `${r}:${n.selector}` : r;
3458
+ if (!i(t.values, o)) return {
3459
+ expression: n,
3460
+ diagnostic: "missingField"
3461
+ };
3462
+ let s = t.values[o];
3463
+ if (n.transformerId) {
3464
+ let e = t.transforms?.[n.transformerId];
3465
+ if (!e) return {
3466
+ expression: n,
3467
+ diagnostic: "unknownTransform"
3468
+ };
3469
+ if (!e.browser) return {
3470
+ expression: n,
3471
+ diagnostic: "forbiddenSource"
3472
+ };
3473
+ if (a.transforms && !a.transforms.includes(n.transformerId) || !e.accepts(s) || Object.keys(n.transformerParams).some((t) => !e.parameters.includes(t)) || (s = e.resolve(s, n.transformerParams), !e.acceptsOutput(s))) return {
3474
+ expression: n,
3475
+ diagnostic: "invalidType"
3476
+ };
3477
+ } else if (Object.keys(n.transformerParams).length) return {
3478
+ expression: n,
3479
+ diagnostic: "invalidExpression"
3480
+ };
3481
+ return (s === "" || s == null || Array.isArray(s) && s.length === 0) && n.default && (s = n.default), {
3482
+ expression: n,
3483
+ value: s
2656
3484
  };
2657
3485
  }
2658
3486
  //#endregion
2659
- export { g as a, x as c, S as i, P as n, h as o, T as r, E as s, C as t };
3487
+ export { oe as a, _ as c, l as d, me as f, ie as h, S as i, y as l, C as m, ee as n, te as o, pe as p, O as r, ne as s, k as t, he as u };