@wix/form-elements 1.133.0 → 1.135.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/component/{appointment-rac-D0mwr3TL.js → appointment-rac-CYCddSl9.js} +246 -246
  2. package/dist/component/{bookings-address-rac-BEnmwXax.js → bookings-address-rac-BK-sU26E.js} +1 -1
  3. package/dist/component/{bookings-email-rac-D56j9PXc.js → bookings-email-rac-DZ3HVkyn.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-xu3S-ih_.js → bookings-first-name-rac-Ci4PHqOr.js} +1 -1
  5. package/dist/component/{bookings-header-rac-hfBabv7v.js → bookings-header-rac-C_MYNrDA.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-6bMvN0Cm.js → bookings-last-name-rac-CdNlwyjm.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-DE70Omwf.js → bookings-login-bar-rac-CP2JcaVr.js} +17 -17
  8. package/dist/component/{bookings-phone-rac-D_EHRAiU.js → bookings-phone-rac-BV8sqxil.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-BxgI9Zt6.js → bookings-rich-text-rac-DQtcYRsh.js} +1 -1
  10. package/dist/component/{calendar.module-DnhTT4QT.js → calendar.module-CKCBG_Pg.js} +11 -11
  11. package/dist/component/{checkbox-field-rac-BLDUOAXM.js → checkbox-field-rac-DPNqHTNc.js} +26 -25
  12. package/dist/component/{checkbox-group-field-headless-CugSJIBp.js → checkbox-group-field-headless-DhhynlgN.js} +32 -31
  13. package/dist/component/{checkbox-group-field-rac-D4m9SmRX.js → checkbox-group-field-rac-B3zOW7qr.js} +6 -6
  14. package/dist/component/{checkbox-group-rac-BYqEsCwa.js → checkbox-group-rac-Qy03hO31.js} +1 -1
  15. package/dist/component/{checkbox-indicator-module-classes-zXKP5rD4.js → checkbox-indicator-module-classes-6173wvuW.js} +1 -1
  16. package/dist/component/{checkbox-rac-DkIBUAN7.js → checkbox-rac-DYr3RaHj.js} +1 -1
  17. package/dist/component/{contacts-address-rac-D1tzbiTM.js → contacts-address-rac-Bi-etpfX.js} +1 -1
  18. package/dist/component/{contacts-birthdate-rac-DO-1xG0u.js → contacts-birthdate-rac-D2LLjX9P.js} +1 -1
  19. package/dist/component/{contacts-company-rac-CzJK3YIo.js → contacts-company-rac-C9ImoG_i.js} +1 -1
  20. package/dist/component/{contacts-email-rac-DLvMErBI.js → contacts-email-rac-DeGblC9V.js} +1 -1
  21. package/dist/component/{contacts-first-name-rac-3RcSXL0h.js → contacts-first-name-rac-Xk3m57jK.js} +1 -1
  22. package/dist/component/{contacts-last-name-rac-BYoSi_QX.js → contacts-last-name-rac-BKE-1IYB.js} +1 -1
  23. package/dist/component/{contacts-phone-rac-DMYn0orB.js → contacts-phone-rac-CHmtTutD.js} +1 -1
  24. package/dist/component/{contacts-position-rac-K1R6ihXo.js → contacts-position-rac-BS3TySLG.js} +1 -1
  25. package/dist/component/{contacts-subscribe-rac-DsWNSH6t.js → contacts-subscribe-rac--fpczJiB.js} +1 -1
  26. package/dist/component/{contacts-tax-id-rac-D7NjPiRf.js → contacts-tax-id-rac-CHkn8vkL.js} +1 -1
  27. package/dist/component/{date-availability-D3n6-g3h.js → date-availability-70Vb-dlb.js} +1 -1
  28. package/dist/component/{date-input-field-rac-SyAmInlu.js → date-input-field-rac-BlkYEYM_.js} +60 -60
  29. package/dist/component/{date-input-rac-BQNOsWz1.js → date-input-rac-JdNFk07Q.js} +1 -1
  30. package/dist/component/{date-picker-field-rac-DO1epod7.js → date-picker-field-rac-DHu11mY1.js} +63 -63
  31. package/dist/component/{date-picker-rac-DQElftUu.js → date-picker-rac-CZtWhFzM.js} +1 -1
  32. package/dist/component/{date-time-input-field-rac-CV5wZSXO.js → date-time-input-field-rac-cHAALqS5.js} +7 -7
  33. package/dist/component/{date-time-input-rac-DvHwpjnk.js → date-time-input-rac-Dz7GfoJO.js} +1 -1
  34. package/dist/component/{dext-checkbox-group-rac-BfcKoslb.js → dext-checkbox-group-rac-ZNKzyWda.js} +2 -2
  35. package/dist/component/{dext-checkbox-rac-DhadtXb5.js → dext-checkbox-rac-DfPFXrKu.js} +1 -1
  36. package/dist/component/{dext-date-picker-rac-0Dmo3mrG.js → dext-date-picker-rac-BPbl65qK.js} +1 -1
  37. package/dist/component/{dext-date-time-input-rac-Cnh7Aqiq.js → dext-date-time-input-rac-D5ywbLtW.js} +1 -1
  38. package/dist/component/{dext-dropdown-rac-CajXcYsB.js → dext-dropdown-rac-BuVsPZOU.js} +1 -1
  39. package/dist/component/{dext-email-rac-DynJaiZt.js → dext-email-rac-DRjt3lqT.js} +1 -1
  40. package/dist/component/{dext-number-input-rac-LmTKwb80.js → dext-number-input-rac-Bzrl87fo.js} +1 -1
  41. package/dist/component/{dext-phone-rac-Cw2roq1_.js → dext-phone-rac-LibvQb8h.js} +1 -1
  42. package/dist/component/{dext-radio-group-rac-CaNZJrkc.js → dext-radio-group-rac-BTWnIvwW.js} +2 -2
  43. package/dist/component/{dext-rating-input-rac-CAL1jb0q.js → dext-rating-input-rac-DTlnOcC8.js} +1 -1
  44. package/dist/component/{dext-tags-rac-BOp_amVK.js → dext-tags-rac-YdeijviH.js} +2 -2
  45. package/dist/component/{dext-text-area-rac-6DYTHIeh.js → dext-text-area-rac-CdCzQYey.js} +1 -1
  46. package/dist/component/{dext-text-input-rac-CDWthvV3.js → dext-text-input-rac-B28RTezm.js} +1 -1
  47. package/dist/component/{dext-url-input-rac-CsS4NPYO.js → dext-url-input-rac-B0ZBPbAb.js} +1 -1
  48. package/dist/component/{donation-rac-B7lFkotu.js → donation-rac-_0cwsIAq.js} +7 -10
  49. package/dist/component/{dropdown-field-headless-ajQghLaj.js → dropdown-field-headless-DVZnbZAM.js} +5 -5
  50. package/dist/component/{dropdown-field-rac-Bf5LQqSL.js → dropdown-field-rac-DWCj_Grt.js} +5 -5
  51. package/dist/component/{dropdown-rac-CJmA_ePl.js → dropdown-rac-Bpo-F5sc.js} +1 -1
  52. package/dist/component/{ecom-address-rac-B49ZP2qc.js → ecom-address-rac-vJ0ku_Ld.js} +1 -1
  53. package/dist/component/{ecom-subscription-checkbox-rac-C8qImtxo.js → ecom-subscription-checkbox-rac-DgVReM6c.js} +2 -2
  54. package/dist/component/{email-input-field-rac-B_bEWp5N.js → email-input-field-rac-BXJGOBg-.js} +4 -4
  55. package/dist/component/{events-repeater-rac-DXxqmIBX.js → events-repeater-rac-CrXE_ppd.js} +48 -47
  56. package/dist/component/{events-rsvp-rac-BaJQLSv3.js → events-rsvp-rac-BGg3P1CQ.js} +4 -4
  57. package/dist/component/{field-error-headless-BxEFPwKI.js → field-error-headless-C3eOy1_l.js} +1 -1
  58. package/dist/component/{field-label-headless-5mewgrhq.js → field-label-headless-BMmR_IeF.js} +1 -1
  59. package/dist/component/field-rac.module-DfEb7pBp.js +25 -0
  60. package/dist/component/file-upload-rac-Umix6wXx.js +566 -0
  61. package/dist/component/{fixed-payment-rac-S68bqvbB.js → fixed-payment-rac-CfIJCBjb.js} +4 -4
  62. package/dist/component/{form-CPY-PtxT.js → form-CYPNOMwk.js} +1685 -1641
  63. package/dist/component/form.css +1 -1
  64. package/dist/component/form.js +1 -1
  65. package/dist/component/{header-field-rac-r6dYbnvA.js → header-field-rac-oxHUTKYV.js} +2 -2
  66. package/dist/component/{header-rac-C9gaKsaE.js → header-rac-DTGV923r.js} +1 -1
  67. package/dist/component/{image-choice-rac-BbES5dAK.js → image-choice-rac-B9JGl_h7.js} +42 -45
  68. package/dist/component/{index-o-TpCHqo.js → index-BOKSOnDK.js} +4 -4
  69. package/dist/component/{index-C6zuIVeJ.js → index-C_ktc-yO.js} +2 -2
  70. package/dist/component/{isObjectLike-BSRiBVs9.js → isObjectLike-Di8V7txC.js} +1 -1
  71. package/dist/component/{multiline-address-field-rac-BfVIiFyM.js → multiline-address-field-rac-zgmTbXlg.js} +8 -8
  72. package/dist/component/{multiline-address-rac-BOKBExhi.js → multiline-address-rac-Cyb3dvBf.js} +1 -1
  73. package/dist/component/{number-input-field-rac-BRKFm8aA.js → number-input-field-rac-DquqqRy_.js} +5 -5
  74. package/dist/component/{number-input-rac-BNbCCb-g.js → number-input-rac-G2DdTbk2.js} +1 -1
  75. package/dist/component/{password-rac-BygVJf7f.js → password-rac-DJCU0F38.js} +5 -5
  76. package/dist/component/{payment-input-rac-CoMbHcHG.js → payment-input-rac-DlIYza6N.js} +5 -5
  77. package/dist/component/{phone-input-field-rac-dFjxptEr.js → phone-input-field-rac-B10TInMa.js} +28 -29
  78. package/dist/component/{phone-rac-Dup3AP9J.js → phone-rac-BuyttJpM.js} +1 -1
  79. package/dist/component/{product-list-rac-B62mNB_W.js → product-list-rac-WrSJwQ_g.js} +69 -68
  80. package/dist/component/{quiz-radio-group-rac-DPMhDtr7.js → quiz-radio-group-rac-CHxZ_pK_.js} +1 -1
  81. package/dist/component/{radio-button-module-classes-BMvPai_6.js → radio-button-module-classes-DjJU-8ZB.js} +18 -17
  82. package/dist/component/{radio-group-field-rac-DPt2Zl4G.js → radio-group-field-rac-BImiqcKa.js} +5 -5
  83. package/dist/component/{radio-group-rac-BZyGqFzr.js → radio-group-rac-CDkJeGpN.js} +1 -1
  84. package/dist/component/{rating-input-field-rac-C3E0KzV-.js → rating-input-field-rac-Dsr_S5qN.js} +35 -33
  85. package/dist/component/{rating-input-rac-BKLz4l_D.js → rating-input-rac-BJUW8U93.js} +1 -1
  86. package/dist/component/{rich-content-rac.module-CQ1qa_zz.js → rich-content-rac.module-BfQJqA-x.js} +1 -1
  87. package/dist/component/{rich-text-field-rac-BfdA5KNz.js → rich-text-field-rac-DIuZbu_u.js} +2 -2
  88. package/dist/component/{rich-text-rac-BFbhfFuF.js → rich-text-rac-C39fpEiP.js} +1 -1
  89. package/dist/component/{service-dropdown-rac-VulpHBki.js → service-dropdown-rac-Bc9hEpx3.js} +6 -6
  90. package/dist/component/{services-multi-choice-rac-CIx5UpfD.js → services-multi-choice-rac-GVb4qA7g.js} +7 -7
  91. package/dist/component/{signature-rac-BdxMBfl9.js → signature-rac-nC5pr6nB.js} +269 -264
  92. package/dist/component/{submit-button-rac-CkuWGEyL.js → submit-button-rac-eUjgrx9Q.js} +2 -2
  93. package/dist/component/{tags-field-rac-DKo_Yb5i.js → tags-field-rac-zv30chSd.js} +54 -57
  94. package/dist/component/{tags-rac-BimVd3ym.js → tags-rac-PnS2SxVP.js} +1 -1
  95. package/dist/component/{text-area-field-rac-DEiLtCnb.js → text-area-field-rac-DLeOMD4g.js} +5 -5
  96. package/dist/component/{text-area-rac-CHZtsq0f.js → text-area-rac-jZ_mh45C.js} +1 -1
  97. package/dist/component/{text-input-field-rac-CSHvUtRG.js → text-input-field-rac-DifV7Erd.js} +4 -4
  98. package/dist/component/{text-input-headless-BYcExFPS.js → text-input-headless-DhVEjorY.js} +3 -3
  99. package/dist/component/{text-input-rac-D-R9btYo.js → text-input-rac-Ce4qKN9M.js} +1 -1
  100. package/dist/component/{time-input-rac-wkHemVzj.js → time-input-rac-1kW3aDIo.js} +5 -5
  101. package/dist/component/{url-input-field-rac-KJEcLyFk.js → url-input-field-rac-D9xXAQCq.js} +5 -5
  102. package/dist/component/{url-input-rac-JFfEH389.js → url-input-rac-SaAybDdN.js} +1 -1
  103. package/dist/component/{use-dropdown-option-class-name-BetaTWbW.js → use-dropdown-option-class-name-C_MO_0JS.js} +3 -3
  104. package/dist/component/{use-dropdown-trigger-class-name-C0ffAjFn.js → use-dropdown-trigger-class-name-D7EMiD-M.js} +2 -2
  105. package/dist/component/use-element-state-class-name-DZFi3Z42.js +23 -0
  106. package/dist/component/use-hoverable-input-class-name-JAZ1mif0.js +25 -0
  107. package/dist/component/{use-service-options-base-q0JTA7UI.js → use-service-options-base-ZX4iaxzr.js} +1 -1
  108. package/dist/component/use-text-input-class-name-XFjQX8q1.js +6 -0
  109. package/package.json +2 -2
  110. package/dist/component/field-rac.module-BGN-O8tV.js +0 -25
  111. package/dist/component/file-upload-rac-D9Z1Cumr.js +0 -562
  112. package/dist/component/use-element-state-class-name-BOks3she.js +0 -20
  113. package/dist/component/use-hoverable-input-class-name-jxtCw16L.js +0 -23
  114. package/dist/component/use-text-input-class-name-CTa0bC4T.js +0 -6
@@ -1,22 +1,22 @@
1
- import s, { useRef as V, useContext as Ae, useMemo as ge, useCallback as v, useState as ne, useEffect as oe, Children as we, isValidElement as Le } from "react";
2
- import Fe from "@wix/editor-react-components/AnimatedIcon";
1
+ import s, { useRef as $, useContext as Ae, useMemo as be, useCallback as _, useState as q, useEffect as le, Children as Fe, isValidElement as Le } from "react";
2
+ import we from "@wix/editor-react-components/AnimatedIcon";
3
3
  import { RicosViewer as xe } from "@wix/ricos/viewer";
4
- import w from "classnames";
5
- import { aL as Ue, bb as Te, an as Be, F as Oe, bd as Pe, b9 as Me, bp as Ce, E as me, ad as ee, bh as U, be as M, bj as Ie, br as He, ba as We, I as Ye, U as Ze, X as ke, p as pe, b as Ve, a0 as Ge, a1 as fe, v as $e, W as ze, _ as Xe, Y as qe, $ as je, f as K, Z as Je } from "./form-CPY-PtxT.js";
4
+ import F from "classnames";
5
+ import { aL as Ue, bb as Te, an as Be, F as Oe, bd as Pe, b9 as Me, bp as ye, E as me, ad as oe, bh as x, be as W, bj as Ce, br as He, ba as We, I as Ye, U as Ze, X as ke, p as pe, b as Ve, a0 as Ge, a1 as fe, v as $e, W as ze, _ as Xe, Y as qe, $ as je, f as ne, Z as Je } from "./form-CYPNOMwk.js";
6
6
  import { useHover as Ke, useFocusRing as Qe, mergeProps as et } from "react-aria";
7
- import { RadioGroup as tt, Button as _e, TextField as nt, DropZone as at, Input as ot, FileTrigger as rt, RadioField as st, RadioButton as lt } from "react-aria-components";
8
- import ye from "signature_pad";
9
- import { f as I, a as A } from "./find-child-C60k4CxG.js";
10
- import { D as it, E as ct } from "./field-error-headless-BxEFPwKI.js";
11
- import { L as ut } from "./field-label-headless-5mewgrhq.js";
7
+ import { RadioGroup as tt, Button as Ie, TextField as nt, DropZone as at, Input as ot, FileTrigger as rt, RadioField as st, RadioButton as lt } from "react-aria-components";
8
+ import _e from "signature_pad";
9
+ import { f as C, a as A } from "./find-child-C60k4CxG.js";
10
+ import { D as it, E as ct } from "./field-error-headless-C3eOy1_l.js";
11
+ import { L as ut } from "./field-label-headless-BMmR_IeF.js";
12
12
  import { D as dt } from "./data-hooks-Dkw1pbRj.js";
13
13
  import { E as mt } from "./error-icon-hZxQ6DEy.js";
14
- import { s as Q } from "./field-rac.module-BGN-O8tV.js";
15
- import { u as $ } from "./use-element-state-class-name-BOks3she.js";
16
- const pt = typeof s.useId == "function" ? s.useId : () => V(Ue()).current, ft = ({ properties: e }) => e.uploadEnabled === !0, Et = (e, t) => e.fieldType === Oe.SIGNATURE && !e.properties.hidden && !e.properties.disabled && !e.properties.readOnly && (t !== "upload" || ft(e)), ht = (e, t) => e.layout.row - t.layout.row || e.layout.column - t.layout.column, bt = (e) => {
14
+ import { s as ae } from "./field-rac.module-DfEb7pBp.js";
15
+ import { u as X } from "./use-element-state-class-name-DZFi3Z42.js";
16
+ const pt = typeof s.useId == "function" ? s.useId : () => $(Ue()).current, ft = ({ properties: e }) => e.uploadEnabled === !0, Et = (e, t) => e.fieldType === Oe.SIGNATURE && !e.properties.hidden && !e.properties.disabled && !e.properties.readOnly && (t !== "upload" || ft(e)), ht = (e, t) => e.layout.row - t.layout.row || e.layout.column - t.layout.column, gt = (e) => {
17
17
  var o;
18
18
  const t = (o = Te().signatureContainer) == null ? void 0 : o.signatureMode, a = Ae(Be);
19
- return ge(() => {
19
+ return be(() => {
20
20
  var r;
21
21
  return a && !a.parentId && t ? (r = a.fields.filter((l) => Et(l, t)).sort(ht)[0]) == null ? void 0 : r.id : void 0;
22
22
  }, [
@@ -26,14 +26,14 @@ const pt = typeof s.useId == "function" ? s.useId : () => V(Ue()).current, ft =
26
26
  };
27
27
  var N = /* @__PURE__ */ (function(e) {
28
28
  return e.TEXT = "text/plain", e.POINTS = "points/json", e;
29
- })({}), C = /* @__PURE__ */ (function(e) {
29
+ })({}), y = /* @__PURE__ */ (function(e) {
30
30
  return e.DRAW = "draw", e.TYPE = "type", e.UPLOAD = "upload", e;
31
31
  })({}), S = /* @__PURE__ */ (function(e) {
32
32
  return e.DRAW = "draw", e.TYPE = "type", e.IMAGE = "image", e.UPLOAD = "upload", e;
33
33
  })({});
34
- const gt = (e) => {
34
+ const bt = (e) => {
35
35
  const { actions: t, formId: a } = Pe(), n = t == null ? void 0 : t.uploadFile;
36
- return v(async (o) => {
36
+ return _(async (o) => {
37
37
  if (!n)
38
38
  throw new Error("No uploadFile action");
39
39
  const r = await n({
@@ -54,7 +54,7 @@ const gt = (e) => {
54
54
  ]);
55
55
  };
56
56
  function Lt(e) {
57
- const a = z(1, 1).getContext("2d");
57
+ const a = j(1, 1).getContext("2d");
58
58
  a.fillStyle = e, a.fillRect(0, 0, 1, 1);
59
59
  const n = a.getImageData(0, 0, 1, 1);
60
60
  return n.data[0] * 65536 + n.data[1] * 256 + n.data[2];
@@ -65,25 +65,25 @@ const Tt = (e, t) => {
65
65
  const r = (o * t.width + n) * 4;
66
66
  return t.data[r] * 65536 + t.data[r + 1] * 256 + t.data[r + 2] === a;
67
67
  };
68
- }, Ct = (e) => (t, a) => {
68
+ }, yt = (e) => (t, a) => {
69
69
  const n = (a * e.width + t) * 4;
70
70
  return e.data[n + 3] === 0;
71
71
  };
72
- function ae(e, t) {
72
+ function se(e, t) {
73
73
  const a = e.getContext("2d", {
74
74
  willReadFrequently: !0
75
- }), n = e.width, o = e.height, r = a.getImageData(0, 0, n, o), l = t ? Tt(t, r) : Ct(r);
76
- let i = n + 1, c = -1, u = o + 1, d = -1, E = 0, m = 0;
75
+ }), n = e.width, o = e.height, r = a.getImageData(0, 0, n, o), l = t ? Tt(t, r) : yt(r);
76
+ let i = n + 1, c = -1, u = o + 1, d = -1, f = 0, m = 0;
77
77
  for (m = 0; m < o; m++)
78
- for (E = 0; E < n; E++)
79
- l(E, m) || (i > E && (i = E), c < E && (c = E), u > m && (u = m), d < m && (d = m));
80
- const h = c - i, g = d - u;
81
- if (h < 0 || g < 0)
78
+ for (f = 0; f < n; f++)
79
+ l(f, m) || (i > f && (i = f), c < f && (c = f), u > m && (u = m), d < m && (d = m));
80
+ const L = c - i, g = d - u;
81
+ if (L < 0 || g < 0)
82
82
  return null;
83
- const p = a.getImageData(i, u, h, g), f = document.createElement("canvas"), L = f.getContext("2d");
84
- return f.width = h, f.height = g, t ? (L.fillStyle = t, L.fillRect(0, 0, h, g)) : L.clearRect(0, 0, h, g), L.putImageData(p, 0, 0), f;
83
+ const p = a.getImageData(i, u, L, g), h = document.createElement("canvas"), E = h.getContext("2d");
84
+ return h.width = L, h.height = g, t ? (E.fillStyle = t, E.fillRect(0, 0, L, g)) : E.clearRect(0, 0, L, g), E.putImageData(p, 0, 0), h;
85
85
  }
86
- function z(e, t, a) {
86
+ function j(e, t, a) {
87
87
  const n = document.createElement("canvas");
88
88
  if (n.width = e, n.height = t, a) {
89
89
  const o = n.getContext("2d", {
@@ -93,11 +93,11 @@ function z(e, t, a) {
93
93
  }
94
94
  return n;
95
95
  }
96
- function It(e, t) {
96
+ function Ct(e, t) {
97
97
  return new Promise((a, n) => {
98
98
  const o = new Image();
99
99
  o.onload = () => {
100
- const r = z(o.width, o.height), l = r.getContext("2d", {
100
+ const r = j(o.width, o.height), l = r.getContext("2d", {
101
101
  willReadFrequently: !0
102
102
  });
103
103
  l == null || l.drawImage(o, 0, 0), a(r);
@@ -105,18 +105,18 @@ function It(e, t) {
105
105
  });
106
106
  }
107
107
  function Ee(e, t, a, n) {
108
- const o = e.width, r = e.height, l = 1, i = a / r, c = Math.min(i, l), u = o * c, d = r * c, E = z(u, d), m = E.getContext("2d");
109
- return n && m && (m.fillStyle = n, m.fillRect(0, 0, u, d)), m == null || m.drawImage(e, 0, 0, o, r, 0, 0, u, d), E;
108
+ const o = e.width, r = e.height, l = 1, i = a / r, c = Math.min(i, l), u = o * c, d = r * c, f = j(u, d), m = f.getContext("2d");
109
+ return n && m && (m.fillStyle = n, m.fillRect(0, 0, u, d)), m == null || m.drawImage(e, 0, 0, o, r, 0, 0, u, d), f;
110
110
  }
111
111
  function he(e, t) {
112
112
  const a = e.getContext("2d"), n = e.offsetWidth, o = e.offsetHeight, r = Math.max(window.devicePixelRatio || 1, 1), l = n * r, i = o * r;
113
113
  return (e.width !== l || e.height !== i) && a ? (e.width = l, e.height = i, a.scale(r, r), t == null || t.redraw(), !0) : !1;
114
114
  }
115
- const k = 480, _t = (e) => Re({
115
+ const G = 480, It = (e) => Re({
116
116
  data: JSON.stringify(e),
117
117
  mimeType: N.POINTS
118
118
  }), ve = (e) => {
119
- const t = H(e);
119
+ const t = Y(e);
120
120
  if ((t == null ? void 0 : t.mimeType) === N.POINTS)
121
121
  try {
122
122
  return JSON.parse(t.data);
@@ -124,7 +124,7 @@ const k = 480, _t = (e) => Re({
124
124
  return null;
125
125
  }
126
126
  return null;
127
- }, be = 0.8, De = "Madefor";
127
+ }, ge = 0.8, De = "Madefor";
128
128
  function Ne(e, t) {
129
129
  const { width: a, actualBoundingBoxAscent: n, actualBoundingBoxDescent: o } = t.measureText(e);
130
130
  return {
@@ -133,25 +133,25 @@ function Ne(e, t) {
133
133
  offsetY: n
134
134
  };
135
135
  }
136
- function yt(e, t) {
137
- const a = t.getContext("2d"), n = t.offsetWidth || t.width, r = (t.offsetHeight || t.height) * be, l = n * be;
136
+ function _t(e, t) {
137
+ const a = t.getContext("2d"), n = t.offsetWidth || t.width, r = (t.offsetHeight || t.height) * ge, l = n * ge;
138
138
  a.font = `${r}px ${De}`;
139
139
  const { width: i, height: c } = Ne(e, a), u = r / (i / l), d = r / (c / r);
140
140
  return Math.min(u, d);
141
141
  }
142
142
  function vt(e, t, a = "black", n = !1, o) {
143
- const r = e.getContext("2d"), l = yt(t, e);
143
+ const r = e.getContext("2d"), l = _t(t, e);
144
144
  r.font = `${l}px ${De}`, r.textBaseline = "top";
145
- const i = e.offsetWidth || e.width, c = e.offsetHeight || e.height, { width: u, height: d, offsetY: E } = Ne(t, r);
145
+ const i = e.offsetWidth || e.width, c = e.offsetHeight || e.height, { width: u, height: d, offsetY: f } = Ne(t, r);
146
146
  r.fillStyle = o, r.fillRect(0, 0, i, c), r.fillStyle = a;
147
147
  const m = (i - u) / 2;
148
- r.fillText(t, n ? i - m : m, (c - d) / 2 + E);
148
+ r.fillText(t, n ? i - m : m, (c - d) / 2 + f);
149
149
  }
150
150
  const Se = /^data:([^;,]+)(?:;([^,]+))?,(.+)$/;
151
151
  function Dt(e) {
152
152
  return Se.test(e);
153
153
  }
154
- function H(e) {
154
+ function Y(e) {
155
155
  if (!e)
156
156
  return;
157
157
  const t = e.match(Se);
@@ -169,7 +169,7 @@ function Re({ data: e, mimeType: t, encoding: a = "text" }) {
169
169
  return `data:${a === "base64" ? `${t};base64` : t},${n}`;
170
170
  }
171
171
  function Nt(e, t) {
172
- const a = H(e);
172
+ const a = Y(e);
173
173
  if (!a)
174
174
  return;
175
175
  let n = a.data.length;
@@ -183,8 +183,8 @@ function Nt(e, t) {
183
183
  type: a.mimeType
184
184
  });
185
185
  }
186
- function re(e, t = "temp") {
187
- const a = H(e);
186
+ function ie(e, t = "temp") {
187
+ const a = Y(e);
188
188
  return {
189
189
  fileId: "temp",
190
190
  displayName: t,
@@ -193,14 +193,14 @@ function re(e, t = "temp") {
193
193
  };
194
194
  }
195
195
  async function St(e, t) {
196
- const a = H(e);
196
+ const a = Y(e);
197
197
  if (!a)
198
198
  return e;
199
199
  const n = a.mimeType;
200
200
  if (n === N.TEXT) {
201
- const o = z(k * 20, k, 1);
201
+ const o = j(G * 20, G, 1);
202
202
  vt(o, a.data, "black", t, "white");
203
- const r = ae(o, "white");
203
+ const r = se(o, "white");
204
204
  return (r == null ? void 0 : r.toDataURL("image/jpeg", 0.7)) ?? null;
205
205
  }
206
206
  if (n === N.POINTS) {
@@ -210,14 +210,14 @@ async function St(e, t) {
210
210
  const r = o.map((d) => ({
211
211
  ...d,
212
212
  penColor: "black"
213
- })), l = z(k * 20, k, Math.max(window.devicePixelRatio || 1, 1));
214
- new ye(l).fromData(r);
215
- const c = ae(l);
216
- return c ? Ee(c, void 0, k, "white").toDataURL("image/jpeg", 0.7) : null;
213
+ })), l = j(G * 20, G, Math.max(window.devicePixelRatio || 1, 1));
214
+ new _e(l).fromData(r);
215
+ const c = se(l);
216
+ return c ? Ee(c, void 0, G, "white").toDataURL("image/jpeg", 0.7) : null;
217
217
  }
218
218
  if (n != null && n.startsWith("image/")) {
219
- const o = await It(e), r = ae(o);
220
- return r ? Ee(r, void 0, k).toDataURL("image/jpeg", 0.7) : null;
219
+ const o = await Ct(e), r = se(o);
220
+ return r ? Ee(r, void 0, G).toDataURL("image/jpeg", 0.7) : null;
221
221
  }
222
222
  return e;
223
223
  }
@@ -227,30 +227,30 @@ async function Rt(e, t) {
227
227
  return Nt(a, "signature");
228
228
  }
229
229
  const At = ({ value: e, onChange: t, target: a }) => {
230
- const [n, o] = ne(e), { isRTL: r } = Me(), l = gt(a), { setFormStatus: i } = Ce(), c = V();
231
- oe(() => {
230
+ const [n, o] = q(e), { isRTL: r } = Me(), l = bt(a), { setFormStatus: i } = ye(), c = $();
231
+ le(() => {
232
232
  e === me && o(me);
233
233
  }, [
234
234
  e
235
235
  ]);
236
- const u = v(() => {
236
+ const u = _(() => {
237
237
  c.current && (clearTimeout(c.current), c.current = null);
238
- }, []), d = n == null ? void 0 : n[0], E = d != null && d.url ? H(d.url) : void 0, m = v(async (g) => {
238
+ }, []), d = n == null ? void 0 : n[0], f = d != null && d.url ? Y(d.url) : void 0, m = _(async (g) => {
239
239
  try {
240
240
  const p = (g == null ? void 0 : g.url) ?? "";
241
241
  if (Dt(p)) {
242
- const f = await Rt(p, r);
243
- if (f) {
244
- const L = await l(f);
242
+ const h = await Rt(p, r);
243
+ if (h) {
244
+ const E = await l(h);
245
245
  t([
246
- L
246
+ E
247
247
  ]);
248
248
  } else
249
249
  o(void 0), t(void 0);
250
250
  }
251
251
  c.current = null;
252
252
  } finally {
253
- i(a, ee.READY);
253
+ i(a, oe.READY);
254
254
  }
255
255
  }, [
256
256
  i,
@@ -260,13 +260,13 @@ const At = ({ value: e, onChange: t, target: a }) => {
260
260
  t
261
261
  ]);
262
262
  return {
263
- handleChange: v((g) => {
264
- const p = (f) => {
265
- c.current = setTimeout(() => m(f), 1500);
263
+ handleChange: _((g) => {
264
+ const p = (h) => {
265
+ c.current = setTimeout(() => m(h), 1500);
266
266
  };
267
267
  g ? (c.current && (clearTimeout(c.current), c.current = null), o([
268
268
  g
269
- ]), p(g)) : (t == null || t(null), o(void 0), i(a, ee.READY));
269
+ ]), p(g)) : (t == null || t(null), o(void 0), i(a, oe.READY));
270
270
  }, [
271
271
  m,
272
272
  t,
@@ -274,46 +274,46 @@ const At = ({ value: e, onChange: t, target: a }) => {
274
274
  a
275
275
  ]),
276
276
  signature: d,
277
- decodedValue: E,
277
+ decodedValue: f,
278
278
  cancelUpload: u
279
279
  };
280
- }, wt = ({ target: e, value: t, onChange: a }) => {
280
+ }, Ft = ({ target: e, value: t, onChange: a }) => {
281
281
  const { handleChange: n, cancelUpload: o, signature: r, decodedValue: l } = At({
282
282
  value: t,
283
283
  onChange: a,
284
284
  target: e
285
- }), [i, c] = ne(() => {
285
+ }), [i, c] = q(() => {
286
286
  if (r == null)
287
- return C.DRAW;
287
+ return y.DRAW;
288
288
  switch (l == null ? void 0 : l.mimeType) {
289
289
  case N.POINTS:
290
- return C.DRAW;
290
+ return y.DRAW;
291
291
  case N.TEXT:
292
- return C.TYPE;
292
+ return y.TYPE;
293
293
  default:
294
- return C.UPLOAD;
294
+ return y.UPLOAD;
295
295
  }
296
- }), { setFormStatus: u } = Ce(), d = v(() => {
297
- o(), u(e, ee.BUSY);
296
+ }), { setFormStatus: u } = ye(), d = _(() => {
297
+ o(), u(e, oe.BUSY);
298
298
  }, [
299
299
  o,
300
300
  u,
301
301
  e
302
- ]), E = v(() => {
303
- o(), n(null), u(e, ee.READY);
302
+ ]), f = _(() => {
303
+ o(), n(null), u(e, oe.READY);
304
304
  }, [
305
305
  o,
306
306
  n,
307
307
  u,
308
308
  e
309
- ]), m = r != null, h = xt(i, r, l), g = (() => {
309
+ ]), m = r != null, L = xt(i, r, l), g = (() => {
310
310
  switch (i) {
311
- case C.DRAW:
311
+ case y.DRAW:
312
312
  return S.DRAW;
313
- case C.TYPE:
313
+ case y.TYPE:
314
314
  return S.TYPE;
315
- case C.UPLOAD:
316
- return h != null ? S.IMAGE : S.UPLOAD;
315
+ case y.UPLOAD:
316
+ return L != null ? S.IMAGE : S.UPLOAD;
317
317
  default:
318
318
  return S.DRAW;
319
319
  }
@@ -323,25 +323,25 @@ const At = ({ value: e, onChange: t, target: a }) => {
323
323
  decodedValue: l,
324
324
  signatureMode: i,
325
325
  clearable: m,
326
- signatureValueForView: h,
326
+ signatureValueForView: L,
327
327
  signatureView: g,
328
328
  handleChange: n,
329
329
  setSignatureMode: c,
330
330
  handleBeforeChange: d,
331
- handleClear: E
331
+ handleClear: f
332
332
  };
333
- }, Ft = {
334
- [C.DRAW]: (e) => (e == null ? void 0 : e.mimeType) === N.POINTS,
335
- [C.TYPE]: (e) => (e == null ? void 0 : e.mimeType) === N.TEXT,
336
- [C.UPLOAD]: (e) => (e == null ? void 0 : e.mimeType) !== N.POINTS && (e == null ? void 0 : e.mimeType) !== N.TEXT
333
+ }, wt = {
334
+ [y.DRAW]: (e) => (e == null ? void 0 : e.mimeType) === N.POINTS,
335
+ [y.TYPE]: (e) => (e == null ? void 0 : e.mimeType) === N.TEXT,
336
+ [y.UPLOAD]: (e) => (e == null ? void 0 : e.mimeType) !== N.POINTS && (e == null ? void 0 : e.mimeType) !== N.TEXT
337
337
  };
338
338
  function xt(e, t, a) {
339
- return t && Ft[e](a) ? t : void 0;
339
+ return t && wt[e](a) ? t : void 0;
340
340
  }
341
341
  const Ut = (e) => {
342
- const t = e.url ? H(e.url) : void 0;
342
+ const t = e.url ? Y(e.url) : void 0;
343
343
  return t ? t.mimeType !== N.POINTS && t.mimeType !== N.TEXT : !0;
344
- }, se = () => {
344
+ }, ce = () => {
345
345
  const { hoverProps: e, isHovered: t } = Ke({}), { focusProps: a, isFocused: n, isFocusVisible: o } = Qe({
346
346
  within: !0
347
347
  });
@@ -352,7 +352,7 @@ const Ut = (e) => {
352
352
  "data-focus-visible": o || void 0
353
353
  };
354
354
  }, b = ({ children: e }) => {
355
- const { id: t, FieldLayout: a } = U(), n = I(e, b.Label), o = I(e, b.Input), r = I(e, b.Description), l = I(e, b.Error);
355
+ const { id: t, FieldLayout: a } = x(), n = C(e, b.Label), o = C(e, b.Input), r = C(e, b.Description), l = C(e, b.Error);
356
356
  return /* @__PURE__ */ s.createElement(a, {
357
357
  fieldId: t,
358
358
  renderLabel: () => n,
@@ -360,30 +360,30 @@ const Ut = (e) => {
360
360
  renderDescription: () => /* @__PURE__ */ s.createElement(s.Fragment, null, l, r)
361
361
  });
362
362
  }, Bt = {
363
- [C.DRAW]: S.DRAW,
364
- [C.TYPE]: S.TYPE,
365
- [C.UPLOAD]: S.UPLOAD
366
- }, X = ({ children: e, className: t }) => {
367
- const { id: a, value: n, onChange: o, target: r, readOnly: l } = U(), i = bt(a), { signatureMode: c, setSignatureMode: u, handleClear: d, clearable: E, signatureView: m, signatureValueForView: h, handleChange: g, handleBeforeChange: p } = wt({
363
+ [y.DRAW]: S.DRAW,
364
+ [y.TYPE]: S.TYPE,
365
+ [y.UPLOAD]: S.UPLOAD
366
+ }, J = ({ children: e, className: t }) => {
367
+ const { id: a, value: n, onChange: o, target: r, readOnly: l } = x(), i = gt(a), { signatureMode: c, setSignatureMode: u, handleClear: d, clearable: f, signatureView: m, signatureValueForView: L, handleChange: g, handleBeforeChange: p } = Ft({
368
368
  target: r,
369
369
  value: n,
370
370
  onChange: o
371
- }), f = I(e, X.Header), L = I(e, X.Value), R = {
371
+ }), h = C(e, J.Header), E = C(e, J.Value), R = {
372
372
  signatureMode: i ?? c,
373
373
  setSignatureMode: u,
374
374
  handleClear: d,
375
- clearable: E,
375
+ clearable: f,
376
376
  signatureView: i ? Bt[i] : m,
377
- signatureValueForView: i ? void 0 : h,
377
+ signatureValueForView: i ? void 0 : L,
378
378
  handleChange: g,
379
379
  handleBeforeChange: p
380
380
  };
381
381
  return /* @__PURE__ */ s.createElement("div", {
382
382
  className: t,
383
383
  "data-hook": "signature-container"
384
- }, !l && A(f, R), A(L, R));
385
- }, q = ({ children: e, className: t, ...a }) => {
386
- const { signatureMode: n, setSignatureMode: o, clearable: r, handleClear: l } = a, { uploadEnabled: i } = U(), c = I(e, q.Tabs), u = I(e, q.Clear);
384
+ }, !l && A(h, R), A(E, R));
385
+ }, K = ({ children: e, className: t, ...a }) => {
386
+ const { signatureMode: n, setSignatureMode: o, clearable: r, handleClear: l } = a, { uploadEnabled: i } = x(), c = C(e, K.Tabs), u = C(e, K.Clear);
387
387
  return /* @__PURE__ */ s.createElement("div", {
388
388
  className: t
389
389
  }, A(c, {
@@ -393,16 +393,16 @@ const Ut = (e) => {
393
393
  }), r && A(u, {
394
394
  handleClear: l
395
395
  }));
396
- }, O = ({ children: e, className: t, ...a }) => {
397
- const { signatureMode: n, setSignatureMode: o, uploadEnabled: r } = a, { disabled: l } = U(), { labelId: i, inputId: c } = M(), u = v((h) => {
398
- o(h);
396
+ }, M = ({ children: e, className: t, ...a }) => {
397
+ const { signatureMode: n, setSignatureMode: o, uploadEnabled: r } = a, { disabled: l } = x(), { labelId: i, inputId: c } = W(), u = _((L) => {
398
+ o(L);
399
399
  }, [
400
400
  o
401
401
  ]), d = {
402
- [C.DRAW]: I(e, O.Draw),
403
- [C.TYPE]: I(e, O.Type),
404
- [C.UPLOAD]: r ? I(e, O.Upload) : null
405
- }, E = d[n], m = Ot(E) ? E.props.description : void 0;
402
+ [y.DRAW]: C(e, M.Draw),
403
+ [y.TYPE]: C(e, M.Type),
404
+ [y.UPLOAD]: r ? C(e, M.Upload) : null
405
+ }, f = d[n], m = Ot(f) ? f.props.description : void 0;
406
406
  return /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("div", {
407
407
  role: "status",
408
408
  "aria-live": "polite",
@@ -421,25 +421,25 @@ const Ut = (e) => {
421
421
  "aria-controls": c,
422
422
  "data-hook": dt.SIGNATURE_FIELD_MODE_SELECT,
423
423
  className: t
424
- }, d[C.DRAW], d[C.TYPE], d[C.UPLOAD]));
425
- }, Ot = (e) => /* @__PURE__ */ Le(e), le = ({ mode: e, children: t, className: a, "aria-label": n }) => /* @__PURE__ */ s.createElement(st, {
424
+ }, d[y.DRAW], d[y.TYPE], d[y.UPLOAD]));
425
+ }, Ot = (e) => /* @__PURE__ */ Le(e), ue = ({ mode: e, children: t, className: a, "aria-label": n }) => /* @__PURE__ */ s.createElement(st, {
426
426
  value: e,
427
427
  "aria-label": n
428
428
  }, /* @__PURE__ */ s.createElement(lt, {
429
429
  "data-hook": `signature-mode-${e}`,
430
430
  className: a
431
- }, t)), Pt = (e) => /* @__PURE__ */ s.createElement(le, {
431
+ }, t)), Pt = (e) => /* @__PURE__ */ s.createElement(ue, {
432
432
  ...e,
433
- mode: C.DRAW
434
- }), Mt = (e) => /* @__PURE__ */ s.createElement(le, {
433
+ mode: y.DRAW
434
+ }), Mt = (e) => /* @__PURE__ */ s.createElement(ue, {
435
435
  ...e,
436
- mode: C.TYPE
437
- }), Ht = (e) => /* @__PURE__ */ s.createElement(le, {
436
+ mode: y.TYPE
437
+ }), Ht = (e) => /* @__PURE__ */ s.createElement(ue, {
438
438
  ...e,
439
- mode: C.UPLOAD
439
+ mode: y.UPLOAD
440
440
  }), Wt = ({ children: e, className: t, "aria-label": a, ...n }) => {
441
- const { handleClear: o } = n, { disabled: r, target: l } = U(), { inputId: i } = M();
442
- return /* @__PURE__ */ s.createElement(_e, {
441
+ const { handleClear: o } = n, { disabled: r, target: l } = x(), { inputId: i } = W();
442
+ return /* @__PURE__ */ s.createElement(Ie, {
443
443
  onPress: o,
444
444
  isDisabled: r,
445
445
  "aria-label": a,
@@ -447,12 +447,12 @@ const Ut = (e) => {
447
447
  "data-hook": `clear-${l}`,
448
448
  className: t
449
449
  }, e);
450
- }, P = ({ children: e, className: t, ...a }) => {
451
- const { signatureView: n, signatureValueForView: o, handleChange: r, handleBeforeChange: l } = a, { disabled: i, readOnly: c, onBlur: u, onFocus: d, hasError: E } = U(), m = I(e, P.Canvas), h = I(e, P.Type), g = I(e, P.Upload);
450
+ }, H = ({ children: e, className: t, ...a }) => {
451
+ const { signatureView: n, signatureValueForView: o, handleChange: r, handleBeforeChange: l } = a, { disabled: i, readOnly: c, onBlur: u, onFocus: d, hasError: f } = x(), m = C(e, H.Canvas), L = C(e, H.Type), g = C(e, H.Upload);
452
452
  return /* @__PURE__ */ s.createElement("div", {
453
453
  className: t,
454
454
  "data-hook": "signature-input",
455
- "data-invalid": E,
455
+ "data-invalid": f,
456
456
  "data-disabled": i,
457
457
  "data-readonly": c
458
458
  }, n === S.DRAW && A(m, {
@@ -463,7 +463,7 @@ const Ut = (e) => {
463
463
  readOnly: c,
464
464
  onBlur: u,
465
465
  onFocus: d
466
- }), n === S.TYPE && A(h, {
466
+ }), n === S.TYPE && A(L, {
467
467
  value: o,
468
468
  onChange: r,
469
469
  onBeforeChange: l,
@@ -481,57 +481,57 @@ const Ut = (e) => {
481
481
  onFocus: d
482
482
  }));
483
483
  }, Yt = ({ className: e, emptyLabel: t, signedLabel: a, ...n }) => {
484
- const { value: o, onChange: r, onBeforeChange: l, disabled: i, readOnly: c, onBlur: u, onFocus: d } = n, { id: E } = U(), { inputId: m, ariaDescribedBy: h } = M(), g = se(), p = V(), f = V(), L = V(null), R = o == null ? void 0 : o.url, [W, B] = ne(!1);
485
- Ie(() => {
486
- var y;
487
- (y = f.current) == null || y.focus();
488
- }, E);
489
- const D = ge(() => ({
484
+ const { value: o, onChange: r, onBeforeChange: l, disabled: i, readOnly: c, onBlur: u, onFocus: d } = n, { id: f } = x(), { inputId: m, ariaDescribedBy: L } = W(), g = ce(), p = $(), h = $(), E = $(null), R = o == null ? void 0 : o.url, [Z, P] = q(!1);
485
+ Ce(() => {
486
+ var I;
487
+ (I = h.current) == null || I.focus();
488
+ }, f);
489
+ const v = be(() => ({
490
490
  throttle: 0,
491
491
  dotSize: 2,
492
492
  minWidth: 1,
493
493
  maxWidth: 3,
494
494
  velocityFilterWeight: 0.2
495
- }), []), G = v(() => {
496
- var F, _, x;
497
- if ((F = p.current) != null && F.isEmpty())
495
+ }), []), ee = _(() => {
496
+ var w, U, B;
497
+ if ((w = p.current) != null && w.isEmpty())
498
498
  return "";
499
- const y = (_ = p.current) == null ? void 0 : _.toData();
500
- return y ? _t(y) : ((x = p.current) == null ? void 0 : x.toDataURL()) ?? "";
501
- }, []), Y = v(() => {
502
- var F;
503
- const y = (F = p.current) == null ? void 0 : F.isEmpty();
504
- B(!y), r(re(G()));
499
+ const I = (U = p.current) == null ? void 0 : U.toData();
500
+ return I ? It(I) : ((B = p.current) == null ? void 0 : B.toDataURL()) ?? "";
501
+ }, []), z = _(() => {
502
+ var w;
503
+ const I = (w = p.current) == null ? void 0 : w.isEmpty();
504
+ P(!I), r(ie(ee()));
505
505
  }, [
506
- G,
506
+ ee,
507
507
  r
508
- ]), Z = v(() => {
508
+ ]), k = _(() => {
509
509
  l == null || l();
510
510
  }, [
511
511
  l
512
- ]), J = v((y) => {
513
- var _, x, ce, ue;
514
- if (y != null) {
515
- if (f.current = y, p.current = new ye(y, {
516
- ...D,
517
- penColor: getComputedStyle(y).color || void 0
518
- }), he(f.current, p.current), R) {
519
- const de = ve(R);
520
- de && (p.current.fromData(de), B(!0));
512
+ ]), te = _((I) => {
513
+ var U, B, D, O;
514
+ if (I != null) {
515
+ if (h.current = I, p.current = new _e(I, {
516
+ ...v,
517
+ penColor: getComputedStyle(I).color || void 0
518
+ }), he(h.current, p.current), R) {
519
+ const V = ve(R);
520
+ V && (p.current.fromData(V), P(!0));
521
521
  } else
522
- p.current.clear(), B(!1);
523
- p.current.addEventListener("beginStroke", Z), p.current.addEventListener("endStroke", Y), typeof ResizeObserver < "u" && !L.current && (L.current = new ResizeObserver(() => {
524
- f.current && he(f.current, p == null ? void 0 : p.current);
525
- })), (_ = L.current) == null || _.observe(y);
522
+ p.current.clear(), P(!1);
523
+ p.current.addEventListener("beginStroke", k), p.current.addEventListener("endStroke", z), typeof ResizeObserver < "u" && !E.current && (E.current = new ResizeObserver(() => {
524
+ h.current && he(h.current, p == null ? void 0 : p.current);
525
+ })), (U = E.current) == null || U.observe(I);
526
526
  } else
527
- (x = L.current) == null || x.disconnect(), (ce = p.current) == null || ce.removeEventListener("endStroke", Y), (ue = p.current) == null || ue.removeEventListener("beginStroke", Z);
527
+ (B = E.current) == null || B.disconnect(), (D = p.current) == null || D.removeEventListener("endStroke", z), (O = p.current) == null || O.removeEventListener("beginStroke", k);
528
528
  }, [
529
- D,
529
+ v,
530
530
  R,
531
- Z,
532
- Y
531
+ k,
532
+ z
533
533
  ]);
534
- return oe(() => {
534
+ return le(() => {
535
535
  p.current && (c || i ? p.current.off() : p.current.on());
536
536
  }, [
537
537
  i,
@@ -540,7 +540,7 @@ const Ut = (e) => {
540
540
  className: e,
541
541
  ...g
542
542
  }, /* @__PURE__ */ s.createElement("canvas", {
543
- ref: J,
543
+ ref: te,
544
544
  id: m,
545
545
  "data-hook": "signature-canvas",
546
546
  "data-input-id": m,
@@ -548,52 +548,52 @@ const Ut = (e) => {
548
548
  onFocus: d,
549
549
  onBlur: u,
550
550
  role: "img",
551
- "aria-label": W ? a : t,
552
- "aria-describedby": h
551
+ "aria-label": Z ? a : t,
552
+ "aria-describedby": L
553
553
  }));
554
- }, ie = ({ children: e, className: t, ...a }) => {
555
- const { value: n, onChange: o, onBeforeChange: r, disabled: l, readOnly: i, onBlur: c, onFocus: u } = a, { id: d, required: E, hasError: m } = U(), { inputId: h, ariaDescribedBy: g, labelId: p } = M(), f = se(), L = n != null && n.url ? H(n.url) : void 0, { data: R = "" } = L ?? {
554
+ }, de = ({ children: e, className: t, ...a }) => {
555
+ const { value: n, onChange: o, onBeforeChange: r, disabled: l, readOnly: i, onBlur: c, onFocus: u } = a, { id: d, required: f, hasError: m } = x(), { inputId: L, ariaDescribedBy: g, labelId: p } = W(), h = ce(), E = n != null && n.url ? Y(n.url) : void 0, { data: R = "" } = E ?? {
556
556
  data: ""
557
557
  };
558
- Ie(() => {
559
- const D = document.getElementById(h);
560
- D == null || D.focus({
558
+ Ce(() => {
559
+ const v = document.getElementById(L);
560
+ v == null || v.focus({
561
561
  preventScroll: !0
562
562
  });
563
- }, d), oe(() => {
563
+ }, d), le(() => {
564
564
  if (!n) {
565
- const D = document.getElementById(h);
566
- D && (D.value = "");
565
+ const v = document.getElementById(L);
566
+ v && (v.value = "");
567
567
  }
568
568
  }, [
569
569
  n,
570
- h
570
+ L
571
571
  ]);
572
- const W = v((D) => {
573
- r == null || r(), D.trim() ? o(re(Re({
574
- data: D,
572
+ const Z = _((v) => {
573
+ r == null || r(), v.trim() ? o(ie(Re({
574
+ data: v,
575
575
  mimeType: N.TEXT
576
576
  }))) : o(null);
577
577
  }, [
578
578
  r,
579
579
  o
580
- ]), B = I(e, ie.Value);
580
+ ]), P = C(e, de.Value);
581
581
  return /* @__PURE__ */ s.createElement(nt, {
582
582
  "aria-labelledby": p,
583
583
  value: R,
584
- onChange: W,
584
+ onChange: Z,
585
585
  onBlur: c,
586
586
  onFocus: u,
587
587
  isDisabled: l,
588
588
  isReadOnly: i,
589
- isRequired: E,
589
+ isRequired: f,
590
590
  isInvalid: m,
591
591
  validationBehavior: "aria"
592
592
  }, /* @__PURE__ */ s.createElement("div", {
593
593
  className: t,
594
- ...f
595
- }, A(B, {
596
- inputId: h,
594
+ ...h
595
+ }, A(P, {
596
+ inputId: L,
597
597
  ariaDescribedBy: g
598
598
  })));
599
599
  }, Zt = ({ className: e, placeholder: t, ...a }) => {
@@ -605,17 +605,17 @@ const Ut = (e) => {
605
605
  placeholder: t,
606
606
  className: e
607
607
  });
608
- }, j = ({ children: e, className: t, ...a }) => {
609
- const { value: n, onChange: o, disabled: r, readOnly: l, onBlur: i, onFocus: c } = a, { labelId: u, ariaDescribedBy: d } = M(), E = I(e, j.Button), m = I(e, j.Preview), h = v((p) => {
610
- const f = p[0];
611
- if (!f) {
608
+ }, Q = ({ children: e, className: t, ...a }) => {
609
+ const { value: n, onChange: o, disabled: r, readOnly: l, onBlur: i, onFocus: c } = a, { labelId: u, ariaDescribedBy: d } = W(), f = C(e, Q.Button), m = C(e, Q.Preview), L = _((p) => {
610
+ const h = p[0];
611
+ if (!h) {
612
612
  o(null);
613
613
  return;
614
614
  }
615
- const L = new FileReader();
616
- L.onload = () => {
617
- o(re(L.result, f.name));
618
- }, L.readAsDataURL(f);
615
+ const E = new FileReader();
616
+ E.onload = () => {
617
+ o(ie(E.result, h.name));
618
+ }, E.readAsDataURL(h);
619
619
  }, [
620
620
  o
621
621
  ]);
@@ -628,26 +628,26 @@ const Ut = (e) => {
628
628
  "aria-describedby": d,
629
629
  "data-hook": "signature-upload-drop-zone",
630
630
  onDrop: async (p) => {
631
- for (const f of p.items)
632
- if (f.kind === "file" && f.type.startsWith("image/")) {
633
- const L = await f.getFile();
634
- if (L) {
635
- h([
636
- L
631
+ for (const h of p.items)
632
+ if (h.kind === "file" && h.type.startsWith("image/")) {
633
+ const E = await h.getFile();
634
+ if (E) {
635
+ L([
636
+ E
637
637
  ]);
638
638
  return;
639
639
  }
640
640
  }
641
641
  }
642
- }, A(E, {
643
- onSelectFiles: h,
642
+ }, A(f, {
643
+ onSelectFiles: L,
644
644
  disabled: r,
645
645
  readOnly: l,
646
646
  onBlur: i,
647
647
  onFocus: c
648
648
  }));
649
649
  }, kt = ({ className: e, imageAlt: t, ...a }) => {
650
- const { value: n } = a, { inputId: o } = M(), r = se();
650
+ const { value: n } = a, { inputId: o } = W(), r = ce();
651
651
  return /* @__PURE__ */ s.createElement("div", {
652
652
  className: e,
653
653
  "data-has-value": !0,
@@ -661,31 +661,32 @@ const Ut = (e) => {
661
661
  id: o,
662
662
  "data-hook": "signature-image"
663
663
  }, n.displayName || t));
664
- }, te = ({ children: e, className: t, onHoverStart: a, onHoverEnd: n, ...o }) => {
665
- const { onSelectFiles: r, disabled: l, readOnly: i, onBlur: c, onFocus: u } = o, { inputId: d, ariaDescribedBy: E, labelId: m } = M(), h = pt(), p = !!I(e, te.Text) ? we.map(e, (f) => /* @__PURE__ */ Le(f) && f.type === te.Text ? A(f, {
666
- textId: h
667
- }) : f) : /* @__PURE__ */ s.createElement("span", {
668
- id: h
664
+ }, re = ({ children: e, className: t, onHoverStart: a, onHoverEnd: n, onFocusChange: o, ...r }) => {
665
+ const { onSelectFiles: l, disabled: i, readOnly: c, onBlur: u, onFocus: d } = r, { inputId: f, ariaDescribedBy: m, labelId: L } = W(), g = pt(), h = !!C(e, re.Text) ? Fe.map(e, (E) => /* @__PURE__ */ Le(E) && E.type === re.Text ? A(E, {
666
+ textId: g
667
+ }) : E) : /* @__PURE__ */ s.createElement("span", {
668
+ id: g
669
669
  }, e);
670
670
  return /* @__PURE__ */ s.createElement(rt, {
671
671
  acceptedFileTypes: [
672
672
  "image/*"
673
673
  ],
674
- onSelect: (f) => {
675
- r(f ? Array.from(f) : []);
674
+ onSelect: (E) => {
675
+ l(E ? Array.from(E) : []);
676
676
  }
677
- }, /* @__PURE__ */ s.createElement(_e, {
678
- id: d,
679
- onBlur: c,
680
- onFocus: u,
681
- isDisabled: l || i,
682
- "aria-labelledby": `${m} ${h}`,
683
- "aria-describedby": E,
677
+ }, /* @__PURE__ */ s.createElement(Ie, {
678
+ id: f,
679
+ onBlur: u,
680
+ onFocus: d,
681
+ isDisabled: i || c,
682
+ "aria-labelledby": `${L} ${g}`,
683
+ "aria-describedby": m,
684
684
  "data-hook": "signature-upload",
685
685
  className: t,
686
686
  onHoverStart: a,
687
- onHoverEnd: n
688
- }, p));
687
+ onHoverEnd: n,
688
+ onFocusChange: o
689
+ }, h));
689
690
  }, Vt = ({ children: e, className: t, ...a }) => {
690
691
  const { textId: n } = a;
691
692
  return /* @__PURE__ */ s.createElement("span", {
@@ -694,23 +695,23 @@ const Ut = (e) => {
694
695
  }, e);
695
696
  };
696
697
  b.Label = ut;
697
- b.Input = X;
698
+ b.Input = J;
698
699
  b.Description = it;
699
700
  b.Error = ct;
700
- X.Header = q;
701
- X.Value = P;
702
- q.Tabs = O;
703
- q.Clear = Wt;
704
- O.Draw = Pt;
705
- O.Type = Mt;
706
- O.Upload = Ht;
707
- P.Canvas = Yt;
708
- P.Type = ie;
709
- P.Upload = j;
710
- ie.Value = Zt;
711
- j.Preview = kt;
712
- j.Button = te;
713
- te.Text = Vt;
701
+ J.Header = K;
702
+ J.Value = H;
703
+ K.Tabs = M;
704
+ K.Clear = Wt;
705
+ M.Draw = Pt;
706
+ M.Type = Mt;
707
+ M.Upload = Ht;
708
+ H.Canvas = Yt;
709
+ H.Type = de;
710
+ H.Upload = Q;
711
+ de.Value = Zt;
712
+ Q.Preview = kt;
713
+ Q.Button = re;
714
+ re.Text = Vt;
714
715
  const Gt = () => {
715
716
  const { t: e } = He();
716
717
  return {
@@ -767,7 +768,7 @@ const Gt = () => {
767
768
  }, /* @__PURE__ */ s.createElement("path", {
768
769
  fillRule: "evenodd",
769
770
  d: "M12,4 L12,5 L8,5 L8,16 L7,16 L7,5 L3,5 L3,4 L12,4 Z M18,8 L18,9 L15,9 L15,16 L14,16 L14,9 L11,9 L11,8 L18,8 Z"
770
- })), jt = "_container_t1rtn_1", Jt = "_header_t1rtn_7", Kt = "_tabs_t1rtn_13", Qt = "_tab_t1rtn_13", en = "_tabHover_t1rtn_42", tn = "_tabSelected_t1rtn_47", nn = "_tabIcon_t1rtn_77", an = "_uploadButton_t1rtn_84", on = "_uploadButtonHover_t1rtn_137", rn = "_uploadButtonLabel_t1rtn_154", sn = "_clear_t1rtn_158", ln = "_value_t1rtn_190", cn = "_box_t1rtn_195", un = "_uploadBox_t1rtn_196", dn = "_dropZone_t1rtn_227", mn = "_dropZoneHover_t1rtn_243", pn = "_boxHover_t1rtn_277", fn = "_typeInput_t1rtn_330", T = {
771
+ })), jt = "_container_adyrc_1", Jt = "_header_adyrc_7", Kt = "_tabs_adyrc_13", Qt = "_tab_adyrc_13", en = "_tabHover_adyrc_43", tn = "_tabSelected_adyrc_48", nn = "_tabIcon_adyrc_78", an = "_uploadButton_adyrc_85", on = "_uploadButtonHover_adyrc_138", rn = "_uploadButtonLabel_adyrc_155", sn = "_clear_adyrc_159", ln = "_value_adyrc_191", cn = "_box_adyrc_196", un = "_uploadBox_adyrc_197", dn = "_dropZone_adyrc_228", mn = "_dropZoneHover_adyrc_244", pn = "_boxHover_adyrc_278", fn = "_typeInput_adyrc_331", T = {
771
772
  container: jt,
772
773
  header: Jt,
773
774
  tabs: Kt,
@@ -790,19 +791,20 @@ const Gt = () => {
790
791
  content: e,
791
792
  locale: t
792
793
  }), hn = () => {
793
- var G, Y, Z, J, y, F;
794
- const e = Gt(), { disabled: t, readOnly: a } = U(), n = !t && !a, o = $({
794
+ var k, te, I, w, U, B;
795
+ const e = Gt(), { disabled: t, readOnly: a } = x(), n = !t && !a, o = X({
795
796
  globalClasses: Je,
796
797
  moduleClasses: {
797
798
  base: T.tab,
798
799
  hover: T.tabHover,
799
800
  selected: T.tabSelected
800
801
  }
801
- }), r = ({ isSelected: _, isHovered: x }) => o({
802
- isSelected: _,
803
- isHovered: x,
802
+ }), r = ({ isSelected: D, isHovered: O, isFocused: V }) => o({
803
+ isSelected: D,
804
+ isHovered: O,
805
+ isFocused: V,
804
806
  isInteractive: n
805
- }), i = $({
807
+ }), i = X({
806
808
  globalClasses: ze,
807
809
  moduleClasses: {
808
810
  base: T.box,
@@ -812,7 +814,7 @@ const Gt = () => {
812
814
  isSelected: !1,
813
815
  isHovered: !1,
814
816
  isInteractive: n
815
- }), u = $({
817
+ }), u = X({
816
818
  globalClasses: Xe,
817
819
  moduleClasses: {
818
820
  base: T.box,
@@ -822,31 +824,31 @@ const Gt = () => {
822
824
  isSelected: !1,
823
825
  isHovered: !1,
824
826
  isInteractive: n
825
- }), d = $({
827
+ }), d = X({
826
828
  globalClasses: qe,
827
829
  moduleClasses: {
828
830
  base: T.dropZone,
829
831
  hover: T.dropZoneHover
830
832
  }
831
- }), E = $({
833
+ }), f = X({
832
834
  globalClasses: je,
833
835
  moduleClasses: {
834
836
  base: T.uploadButton,
835
837
  hover: T.uploadButtonHover
836
838
  }
837
- }), m = (F = (y = (J = (Z = (Y = (G = Te().signatureContainer) == null ? void 0 : G.elementProps) == null ? void 0 : Y.signatureDropZone) == null ? void 0 : Z.elementProps) == null ? void 0 : J.signatureUploadButton) == null ? void 0 : y.elementProps) == null ? void 0 : F.icon, { wix: h, className: g, ...p } = m ?? {}, f = We(K.SIGNATURE_CONTAINER, K.SIGNATURE_DROP_ZONE, K.SIGNATURE_UPLOAD_BUTTON, K.UPLOAD_BUTTON_LABEL), L = V(null), [R, W] = ne(!1), B = v(() => {
838
- var _;
839
- W(!0), (_ = L.current) == null || _.runAnimationForward();
840
- }, []), D = v(() => {
841
- var _;
842
- W(!1), (_ = L.current) == null || _.runAnimationBackward();
839
+ }), m = (B = (U = (w = (I = (te = (k = Te().signatureContainer) == null ? void 0 : k.elementProps) == null ? void 0 : te.signatureDropZone) == null ? void 0 : I.elementProps) == null ? void 0 : w.signatureUploadButton) == null ? void 0 : U.elementProps) == null ? void 0 : B.icon, { wix: L, className: g, ...p } = m ?? {}, h = We(ne.SIGNATURE_CONTAINER, ne.SIGNATURE_DROP_ZONE, ne.SIGNATURE_UPLOAD_BUTTON, ne.UPLOAD_BUTTON_LABEL), E = $(null), [R, Z] = q(!1), [P, v] = q(!1), ee = _(() => {
840
+ var D;
841
+ Z(!0), (D = E.current) == null || D.runAnimationForward();
842
+ }, []), z = _(() => {
843
+ var D;
844
+ Z(!1), (D = E.current) == null || D.runAnimationBackward();
843
845
  }, []);
844
846
  return /* @__PURE__ */ s.createElement(b, null, /* @__PURE__ */ s.createElement(b.Label, {
845
- className: w(Ye, Q.label)
847
+ className: F(Ye, ae.label)
846
848
  }, /* @__PURE__ */ s.createElement(b.Label.Required, {
847
- className: w(Ze, Q.requiredMark)
849
+ className: F(Ze, ae.requiredMark)
848
850
  })), /* @__PURE__ */ s.createElement(b.Input, {
849
- className: w(ke, T.container)
851
+ className: F(ke, T.container)
850
852
  }, /* @__PURE__ */ s.createElement(b.Input.Header, {
851
853
  className: T.header
852
854
  }, /* @__PURE__ */ s.createElement(b.Input.Header.Tabs, {
@@ -870,7 +872,7 @@ const Gt = () => {
870
872
  }, /* @__PURE__ */ s.createElement(zt, {
871
873
  className: T.tabIcon
872
874
  }))), /* @__PURE__ */ s.createElement(b.Input.Header.Clear, {
873
- className: w(pe, T.clear),
875
+ className: F(pe, T.clear),
874
876
  "aria-label": e.clearLabel
875
877
  }, /* @__PURE__ */ s.createElement($t, null))), /* @__PURE__ */ s.createElement(b.Input.Value, {
876
878
  className: T.value
@@ -884,36 +886,39 @@ const Gt = () => {
884
886
  className: T.typeInput,
885
887
  placeholder: e.placeholder
886
888
  })), /* @__PURE__ */ s.createElement(b.Input.Value.Upload, {
887
- className: ({ isHovered: _, isDropTarget: x }) => w(T.uploadBox, d({
889
+ className: ({ isHovered: D, isFocused: O, isDropTarget: V }) => F(T.uploadBox, d({
888
890
  isSelected: !1,
889
- isHovered: _ || x,
891
+ isHovered: D || V,
892
+ isFocused: O,
890
893
  isInteractive: n
891
894
  }))
892
895
  }, /* @__PURE__ */ s.createElement(b.Input.Value.Upload.Preview, {
893
- className: w(T.uploadBox, i),
896
+ className: F(T.uploadBox, i),
894
897
  imageAlt: e.imageAlt
895
898
  }), /* @__PURE__ */ s.createElement(b.Input.Value.Upload.Button, {
896
- className: ({ isHovered: _ }) => E({
899
+ className: ({ isHovered: D, isFocused: O }) => f({
897
900
  isSelected: !1,
898
- isHovered: _,
901
+ isHovered: D,
902
+ isFocused: O,
899
903
  isInteractive: n
900
904
  }),
901
- onHoverStart: B,
902
- onHoverEnd: D
903
- }, p.svg ? /* @__PURE__ */ s.createElement(Fe, {
905
+ onHoverStart: ee,
906
+ onHoverEnd: z,
907
+ onFocusChange: v
908
+ }, p.svg ? /* @__PURE__ */ s.createElement(we, {
904
909
  ...p,
905
- ref: L,
906
- className: w(Ve, Ge, g)
910
+ ref: E,
911
+ className: F(Ve, Ge, g)
907
912
  }) : null, /* @__PURE__ */ s.createElement(b.Input.Value.Upload.Button.Text, {
908
- className: w(fe.base, T.uploadButtonLabel, f, {
909
- [fe.hover]: n && R
913
+ className: F(fe.base, T.uploadButtonLabel, h, {
914
+ [fe.hover]: n && (R || P)
910
915
  })
911
916
  }, e.uploadLabel))))), /* @__PURE__ */ s.createElement(b.Error, {
912
- className: w($e, Q.error)
917
+ className: F($e, ae.error)
913
918
  }, /* @__PURE__ */ s.createElement(mt, null), /* @__PURE__ */ s.createElement(b.Error.Text, null)), /* @__PURE__ */ s.createElement(b.Description, {
914
- className: w(pe, Q.description)
919
+ className: F(pe, ae.description)
915
920
  }, En));
916
- }, Fn = () => /* @__PURE__ */ s.createElement(hn, null);
921
+ }, wn = () => /* @__PURE__ */ s.createElement(hn, null);
917
922
  export {
918
- Fn as SignatureRAC
923
+ wn as SignatureRAC
919
924
  };