@wix/form-elements 1.146.0 → 1.148.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.
- package/dist/component/{appointment-rac-scUix9QX.js → appointment-rac-BNqXl3dq.js} +168 -164
- package/dist/component/{bookings-address-rac-CKemkJOO.js → bookings-address-rac-DzLf588z.js} +1 -1
- package/dist/component/{bookings-email-rac-CDqdhPAB.js → bookings-email-rac-BCNWH7ss.js} +1 -1
- package/dist/component/{bookings-first-name-rac-DEy_7Hjb.js → bookings-first-name-rac-D36aHUOJ.js} +1 -1
- package/dist/component/{bookings-header-rac-Bl4xy9lB.js → bookings-header-rac-CNr2y2ES.js} +1 -1
- package/dist/component/{bookings-last-name-rac-CsL9xQ1W.js → bookings-last-name-rac-yHE6ZIxr.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-DkHYQ4No.js → bookings-login-bar-rac-C3weOc1i.js} +6 -6
- package/dist/component/{bookings-phone-rac-BoBiFwbV.js → bookings-phone-rac-CIo_ApRf.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-DZZnPKWA.js → bookings-rich-text-rac-rgKnvt57.js} +1 -1
- package/dist/component/{checkbox-field-rac-UgLmJxB-.js → checkbox-field-rac-CMaVxLNe.js} +9 -7
- package/dist/component/{checkbox-group-field-headless-C809nB0Q.js → checkbox-group-field-headless-XPtqS8Km.js} +68 -68
- package/dist/component/{checkbox-group-field-rac-u4i4wG21.js → checkbox-group-field-rac-C_58XfQt.js} +9 -9
- package/dist/component/{checkbox-group-rac-DBAQhSo3.js → checkbox-group-rac-FQrWViSh.js} +1 -1
- package/dist/component/{checkbox-indicator-module-classes-6173wvuW.js → checkbox-indicator-module-classes-akWZsZNn.js} +1 -1
- package/dist/component/{checkbox-rac-FDQVsI5-.js → checkbox-rac-C5Lj2b1N.js} +1 -1
- package/dist/component/{contacts-address-rac-DnArylPa.js → contacts-address-rac-OhpLzD0X.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-C19jhGEO.js → contacts-birthdate-rac-Dnqq84ct.js} +1 -1
- package/dist/component/{contacts-company-rac-Dxs0hs_i.js → contacts-company-rac-DMnTF55t.js} +1 -1
- package/dist/component/{contacts-email-rac-D-H43L8r.js → contacts-email-rac-DmZhScW2.js} +1 -1
- package/dist/component/{contacts-first-name-rac-DwV5NESk.js → contacts-first-name-rac-B6A4fuzK.js} +1 -1
- package/dist/component/{contacts-last-name-rac-C5v2xurf.js → contacts-last-name-rac-DVz97lew.js} +1 -1
- package/dist/component/{contacts-phone-rac-D9a5x-xl.js → contacts-phone-rac-DV8aO0uS.js} +1 -1
- package/dist/component/{contacts-position-rac-DfsgOv-k.js → contacts-position-rac-BP_yBIE4.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-B-Hho0Kb.js → contacts-subscribe-rac-wmTprtLf.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-q6TQkB4b.js → contacts-tax-id-rac-CUEPBQye.js} +1 -1
- package/dist/component/{date-availability-CMDvf5VU.js → date-availability-BK_0gLRv.js} +1 -1
- package/dist/component/{date-input-field-rac-C1WLUct3.js → date-input-field-rac-BfWPvRnd.js} +84 -78
- package/dist/component/{date-input-rac-cNQ-nr4D.js → date-input-rac-B7vAMRBX.js} +1 -1
- package/dist/component/{date-picker-field-rac-mx11z-MO.js → date-picker-field-rac-CpDY4EkU.js} +111 -105
- package/dist/component/{date-picker-rac-DeTz17zC.js → date-picker-rac-BCswaZB1.js} +1 -1
- package/dist/component/{date-time-input-field-rac-feQ2E1eU.js → date-time-input-field-rac-D9w4eEa0.js} +135 -129
- package/dist/component/{date-time-input-rac-G0s0xP4v.js → date-time-input-rac-_im8-JRC.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BcTN1nJb.js → dext-checkbox-group-rac-Di7B1Wzv.js} +2 -2
- package/dist/component/{dext-checkbox-rac-DX0TOrCO.js → dext-checkbox-rac-BPendOsP.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CpDp11oa.js → dext-date-picker-rac-_-Ig9Qn6.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BRvO8izU.js → dext-date-time-input-rac-dKFW87yu.js} +1 -1
- package/dist/component/{dext-dropdown-rac-DGZ4Yi_X.js → dext-dropdown-rac-Cpdpps7P.js} +1 -1
- package/dist/component/{dext-email-rac-B9YCFHB4.js → dext-email-rac-D4UmYH5m.js} +1 -1
- package/dist/component/{dext-number-input-rac-D890dBZf.js → dext-number-input-rac-DUetGnYJ.js} +1 -1
- package/dist/component/{dext-phone-rac-BAQftbXo.js → dext-phone-rac-Bsz_DAT9.js} +1 -1
- package/dist/component/dext-radio-group-rac-B_soj2FD.js +18 -0
- package/dist/component/{dext-rating-input-rac-BqQKVaHo.js → dext-rating-input-rac-cm40qt4O.js} +1 -1
- package/dist/component/{dext-tags-rac-zxxKcNUe.js → dext-tags-rac-D1ULx6t1.js} +2 -2
- package/dist/component/{dext-text-area-rac-Ctp9SwPg.js → dext-text-area-rac-IkL67rHB.js} +1 -1
- package/dist/component/{dext-text-input-rac-c_QMlyjr.js → dext-text-input-rac-DsYSTEL2.js} +1 -1
- package/dist/component/{dext-url-input-rac-96pv15aC.js → dext-url-input-rac-BKvEkpYu.js} +1 -1
- package/dist/component/{donation-rac-GEWKSLJY.js → donation-rac-CaCXMa-H.js} +87 -85
- package/dist/component/{dropdown-field-headless-C3OxMhLE.js → dropdown-field-headless-DcrQK8mL.js} +36 -34
- package/dist/component/{dropdown-field-rac-CCXfBmSc.js → dropdown-field-rac-CuGoz_6I.js} +9 -10
- package/dist/component/{dropdown-rac-CR7hswXE.js → dropdown-rac-rIe6ZqaZ.js} +1 -1
- package/dist/component/{ecom-address-rac-khMuxEFD.js → ecom-address-rac-DT0rzvvp.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-CAi_AHpb.js → ecom-subscription-checkbox-rac-ZfbiME6e.js} +5 -5
- package/dist/component/{email-input-field-rac-B83mY2lg.js → email-input-field-rac-8Qn3yskh.js} +62 -62
- package/dist/component/{events-repeater-rac-ClEwXgmb.js → events-repeater-rac-DyHrMd3y.js} +25 -21
- package/dist/component/{events-rsvp-rac-BJ5q2SVR.js → events-rsvp-rac-CoL-euuc.js} +9 -9
- package/dist/component/{field-error-headless-CsYQCsiT.js → field-error-headless-RylIeqXr.js} +6 -6
- package/dist/component/{field-label-headless-Yg_1PMSg.js → field-label-headless-d3hZxIEc.js} +15 -15
- package/dist/component/field-rac.module-DP0lkkEv.js +25 -0
- package/dist/component/{file-upload-rac-DJsuI_lR.js → file-upload-rac-rXbabrgc.js} +172 -168
- package/dist/component/{fixed-payment-rac-BMFe9wxU.js → fixed-payment-rac-CaR7pXXA.js} +13 -13
- package/dist/component/{form-Bed4Kfz8.js → form-DhIEC3nB.js} +2309 -2308
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +2 -2
- package/dist/component/{header-field-rac-DPQTrOSZ.js → header-field-rac-nELbyGjP.js} +4 -4
- package/dist/component/{header-rac-CzXsuLmE.js → header-rac-q80EQNmM.js} +1 -1
- package/dist/component/{image-choice-rac-R_4pbOSr.js → image-choice-rac-CLMiTQK0.js} +42 -42
- package/dist/component/{index-DZxHlvzt.js → index-C-jVrv9Y.js} +91 -91
- package/dist/component/{index-qSZCe_WC.js → index-DnLJzPM-.js} +2 -2
- package/dist/component/{isObjectLike-B-a5uaU-.js → isObjectLike-Bf577MHV.js} +15 -15
- package/dist/component/{multiline-address-field-rac-rv4IZZy_.js → multiline-address-field-rac-BVAv1w9F.js} +155 -137
- package/dist/component/{multiline-address-rac-DZ7cYtgn.js → multiline-address-rac-qMuUHA9U.js} +1 -1
- package/dist/component/{number-input-field-rac-CL9iXKIf.js → number-input-field-rac-B_vnBWFG.js} +24 -22
- package/dist/component/{number-input-rac-BeGn6qJR.js → number-input-rac-BPCIW8Fz.js} +1 -1
- package/dist/component/{password-rac-DfvhdsKG.js → password-rac-D72HG72u.js} +28 -26
- package/dist/component/{payment-input-rac-BmMfi5rf.js → payment-input-rac-DthVgsAi.js} +32 -30
- package/dist/component/{phone-input-field-rac-DW0a1pXs.js → phone-input-field-rac-XIPkH8Fb.js} +46 -46
- package/dist/component/{phone-rac-quZjJ08H.js → phone-rac-U94fCfer.js} +1 -1
- package/dist/component/{product-list-rac-Ci0KB7sN.js → product-list-rac-BRMGPyhr.js} +78 -78
- package/dist/component/{quiz-radio-group-rac--UUtGx2t.js → quiz-radio-group-rac-DafNzzgX.js} +1 -1
- package/dist/component/radio-button-module-classes-DtFlHID_.js +134 -0
- package/dist/component/{radio-group-field-rac-w8fHpFKJ.js → radio-group-field-rac-BXrYWjew.js} +13 -13
- package/dist/component/{radio-group-rac-jO8aghii.js → radio-group-rac-BNyFfQYV.js} +1 -1
- package/dist/component/{rating-input-field-rac-BRc2PtqE.js → rating-input-field-rac-KbkiVCZ7.js} +27 -27
- package/dist/component/{rating-input-rac-D9zs06xR.js → rating-input-rac-zT4vPkwP.js} +1 -1
- package/dist/component/{rich-content-rac.module-Cv3ZmD00.js → rich-content-rac.module-C0OQetct.js} +8 -8
- package/dist/component/{rich-text-field-rac-BmWuIfA8.js → rich-text-field-rac-T4NoShC0.js} +4 -4
- package/dist/component/{rich-text-rac-BnqnrvB1.js → rich-text-rac-m6VRCRZu.js} +1 -1
- package/dist/component/{service-dropdown-rac-Cl81KfJU.js → service-dropdown-rac-BFwKhL1l.js} +44 -45
- package/dist/component/{services-multi-choice-rac-sQ1NF9hY.js → services-multi-choice-rac-DjzcuRWv.js} +13 -13
- package/dist/component/{signature-rac-Huairu7V.js → signature-rac-B1LPKnIw.js} +281 -279
- package/dist/component/{submit-button-rac-Dpg7N0TG.js → submit-button-rac-Cz3PVtW4.js} +25 -25
- package/dist/component/{tags-field-rac-BQ8TEqXH.js → tags-field-rac-DzSoL__s.js} +82 -82
- package/dist/component/{tags-rac-CFOmyCCc.js → tags-rac-DMYJDrm-.js} +1 -1
- package/dist/component/{text-area-field-rac-DNiMa7d3.js → text-area-field-rac-SuMzBm-Q.js} +30 -28
- package/dist/component/{text-area-rac-kLFe-KbZ.js → text-area-rac-C-zmnJgt.js} +1 -1
- package/dist/component/{text-input-field-rac-CqENSUUX.js → text-input-field-rac-BmQlXTK9.js} +6 -6
- package/dist/component/text-input-headless-BsrjGTK4.js +47 -0
- package/dist/component/{text-input-rac-uYQEfOtE.js → text-input-rac-DhQFKG4h.js} +1 -1
- package/dist/component/time-input-rac-CRZZdbTI.js +161 -0
- package/dist/component/{url-input-field-rac-BioH7kuz.js → url-input-field-rac-D617Pvsf.js} +30 -28
- package/dist/component/{url-input-rac-D2VSSyqW.js → url-input-rac-CLvxaWZz.js} +1 -1
- package/dist/component/use-dropdown-trigger-class-name-C4uqTKFP.js +117 -0
- package/dist/component/{use-element-state-class-name-oiKCauK-.js → use-element-state-class-name-DJx-T0zf.js} +3 -3
- package/dist/component/use-hoverable-input-class-name-pwVZXwrY.js +25 -0
- package/dist/component/use-is-forced-open-dropdown-DBpm1D-o.js +48 -0
- package/dist/component/{use-service-options-base-DXG60hA5.js → use-service-options-base-xHeVTve3.js} +6 -6
- package/dist/component/use-text-input-class-name-CrEjJ2Z8.js +6 -0
- package/dist/form.d.ts +5 -0
- package/package.json +2 -2
- package/dist/component/dext-radio-group-rac-CtEjnu_X.js +0 -18
- package/dist/component/field-rac.module-DfEb7pBp.js +0 -25
- package/dist/component/radio-button-module-classes-CqdBGknT.js +0 -132
- package/dist/component/text-input-headless-BdPkEeK2.js +0 -45
- package/dist/component/time-input-rac-BYoojlJ9.js +0 -159
- package/dist/component/use-dropdown-option-class-name-BEmvU-Gg.js +0 -115
- package/dist/component/use-dropdown-trigger-class-name-qj9skLWZ.js +0 -40
- package/dist/component/use-hoverable-input-class-name-BW3nCyhG.js +0 -25
- package/dist/component/use-text-input-class-name-BhQFcXYH.js +0 -6
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r, { useRef as G, useContext as Ae, useMemo as be, useCallback as _, useState as X, useEffect as le, Children as Fe, isValidElement as Le } from "react";
|
|
2
2
|
import we from "@wix/editor-react-components/AnimatedIcon";
|
|
3
3
|
import { RicosViewer as xe } from "@wix/ricos/viewer";
|
|
4
4
|
import F from "classnames";
|
|
5
|
-
import {
|
|
5
|
+
import { aS as Ue, bi as Te, au as Be, F as Oe, bk as Pe, bg as Me, bw as Ce, E as me, ak as oe, bo as x, bl as W, bq as Ie, by as He, bh as We, S as Ye, a0 as qe, a2 as ke, v as pe, b as Ze, a7 as Ve, a8 as fe, H as Ge, a1 as $e, a5 as ze, a3 as Xe, a6 as je, f as ne, a4 as Je } from "./form-DhIEC3nB.js";
|
|
6
6
|
import { useHover as Ke, useFocusRing as Qe, mergeProps as et } from "react-aria";
|
|
7
|
-
import { RadioGroup as tt, Button as
|
|
7
|
+
import { RadioGroup as tt, Button as ye, TextField as nt, DropZone as at, Input as ot, FileTrigger as st, RadioField as rt, RadioButton as lt } from "react-aria-components";
|
|
8
8
|
import _e from "signature_pad";
|
|
9
|
-
import { f as
|
|
10
|
-
import { D as it, E as ct } from "./field-error-headless-
|
|
11
|
-
import { L as ut } from "./field-label-headless-
|
|
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-RylIeqXr.js";
|
|
11
|
+
import { L as ut } from "./field-label-headless-d3hZxIEc.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 ae } from "./field-rac.module-
|
|
15
|
-
import { u as
|
|
16
|
-
const pt = typeof
|
|
14
|
+
import { s as ae } from "./field-rac.module-DP0lkkEv.js";
|
|
15
|
+
import { u as z } from "./use-element-state-class-name-DJx-T0zf.js";
|
|
16
|
+
const pt = typeof r.useId == "function" ? r.useId : () => G(Ue()).current, ft = ({ properties: e }) => e.uploadEnabled === !0, ht = (e, t) => e.fieldType === Oe.SIGNATURE && !e.properties.hidden && !e.properties.disabled && !e.properties.readOnly && (t !== "upload" || ft(e)), Et = (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
19
|
return be(() => {
|
|
20
|
-
var
|
|
21
|
-
return a && !a.parentId && t ? (
|
|
20
|
+
var s;
|
|
21
|
+
return a && !a.parentId && t ? (s = a.fields.filter((l) => ht(l, t)).sort(Et)[0]) == null ? void 0 : s.id : void 0;
|
|
22
22
|
}, [
|
|
23
23
|
a,
|
|
24
24
|
t
|
|
25
25
|
]) === e ? t : void 0;
|
|
26
26
|
};
|
|
27
|
-
var
|
|
27
|
+
var S = /* @__PURE__ */ (function(e) {
|
|
28
28
|
return e.TEXT = "text/plain", e.POINTS = "points/json", e;
|
|
29
|
-
})({}),
|
|
29
|
+
})({}), C = /* @__PURE__ */ (function(e) {
|
|
30
30
|
return e.DRAW = "draw", e.TYPE = "type", e.UPLOAD = "upload", e;
|
|
31
31
|
})({}), N = /* @__PURE__ */ (function(e) {
|
|
32
32
|
return e.DRAW = "draw", e.TYPE = "type", e.IMAGE = "image", e.UPLOAD = "upload", e;
|
|
@@ -36,11 +36,11 @@ const bt = (e) => {
|
|
|
36
36
|
return _(async (o) => {
|
|
37
37
|
if (!n)
|
|
38
38
|
throw new Error("No uploadFile action");
|
|
39
|
-
const
|
|
39
|
+
const s = await n({
|
|
40
40
|
file: o,
|
|
41
41
|
formId: a,
|
|
42
42
|
uploadTarget: e
|
|
43
|
-
}), { id: l, displayName: i, url: c, isPrivate: u } =
|
|
43
|
+
}), { id: l, displayName: i, url: c, isPrivate: u } = s;
|
|
44
44
|
return {
|
|
45
45
|
fileId: l,
|
|
46
46
|
displayName: i || o.name,
|
|
@@ -62,26 +62,26 @@ function Lt(e) {
|
|
|
62
62
|
const Tt = (e, t) => {
|
|
63
63
|
const a = Lt(e);
|
|
64
64
|
return (n, o) => {
|
|
65
|
-
const
|
|
66
|
-
return t.data[
|
|
65
|
+
const s = (o * t.width + n) * 4;
|
|
66
|
+
return t.data[s] * 65536 + t.data[s + 1] * 256 + t.data[s + 2] === a;
|
|
67
67
|
};
|
|
68
|
-
},
|
|
68
|
+
}, Ct = (e) => (t, a) => {
|
|
69
69
|
const n = (a * e.width + t) * 4;
|
|
70
70
|
return e.data[n + 3] === 0;
|
|
71
71
|
};
|
|
72
|
-
function
|
|
72
|
+
function re(e, t) {
|
|
73
73
|
const a = e.getContext("2d", {
|
|
74
74
|
willReadFrequently: !0
|
|
75
|
-
}), n = e.width, o = e.height,
|
|
75
|
+
}), n = e.width, o = e.height, s = a.getImageData(0, 0, n, o), l = t ? Tt(t, s) : Ct(s);
|
|
76
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
78
|
for (f = 0; f < n; f++)
|
|
79
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,
|
|
81
|
-
if (L < 0 ||
|
|
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, L,
|
|
84
|
-
return
|
|
83
|
+
const p = a.getImageData(i, u, L, g), E = document.createElement("canvas"), h = E.getContext("2d");
|
|
84
|
+
return E.width = L, E.height = g, t ? (h.fillStyle = t, h.fillRect(0, 0, L, g)) : h.clearRect(0, 0, L, g), h.putImageData(p, 0, 0), E;
|
|
85
85
|
}
|
|
86
86
|
function j(e, t, a) {
|
|
87
87
|
const n = document.createElement("canvas");
|
|
@@ -93,39 +93,39 @@ function j(e, t, a) {
|
|
|
93
93
|
}
|
|
94
94
|
return n;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function It(e, t) {
|
|
97
97
|
return new Promise((a, n) => {
|
|
98
98
|
const o = new Image();
|
|
99
99
|
o.onload = () => {
|
|
100
|
-
const
|
|
100
|
+
const s = j(o.width, o.height), l = s.getContext("2d", {
|
|
101
101
|
willReadFrequently: !0
|
|
102
102
|
});
|
|
103
|
-
l == null || l.drawImage(o, 0, 0), a(
|
|
103
|
+
l == null || l.drawImage(o, 0, 0), a(s);
|
|
104
104
|
}, o.onerror = n, o.src = e;
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
const o = e.width,
|
|
109
|
-
return n && m && (m.fillStyle = n, m.fillRect(0, 0, u, d)), m == null || m.drawImage(e, 0, 0, o,
|
|
107
|
+
function he(e, t, a, n) {
|
|
108
|
+
const o = e.width, s = e.height, l = 1, i = a / s, c = Math.min(i, l), u = o * c, d = s * 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, s, 0, 0, u, d), f;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
const a = e.getContext("2d"), n = e.offsetWidth, o = e.offsetHeight,
|
|
113
|
-
return (e.width !== l || e.height !== i) && a ? (e.width = l, e.height = i, a.scale(
|
|
111
|
+
function Ee(e, t) {
|
|
112
|
+
const a = e.getContext("2d"), n = e.offsetWidth, o = e.offsetHeight, s = Math.max(window.devicePixelRatio || 1, 1), l = n * s, i = o * s;
|
|
113
|
+
return (e.width !== l || e.height !== i) && a ? (e.width = l, e.height = i, a.scale(s, s), t == null || t.redraw(), !0) : !1;
|
|
114
114
|
}
|
|
115
|
-
const V = 480,
|
|
115
|
+
const V = 480, yt = (e) => Re({
|
|
116
116
|
data: JSON.stringify(e),
|
|
117
|
-
mimeType:
|
|
117
|
+
mimeType: S.POINTS
|
|
118
118
|
}), ve = (e) => {
|
|
119
119
|
const t = Y(e);
|
|
120
|
-
if ((t == null ? void 0 : t.mimeType) ===
|
|
120
|
+
if ((t == null ? void 0 : t.mimeType) === S.POINTS)
|
|
121
121
|
try {
|
|
122
122
|
return JSON.parse(t.data);
|
|
123
123
|
} catch {
|
|
124
124
|
return null;
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
|
-
},
|
|
128
|
-
function
|
|
127
|
+
}, ge = 0.8, De = "Madefor";
|
|
128
|
+
function Se(e, t) {
|
|
129
129
|
const { width: a, actualBoundingBoxAscent: n, actualBoundingBoxDescent: o } = t.measureText(e);
|
|
130
130
|
return {
|
|
131
131
|
width: a,
|
|
@@ -134,18 +134,18 @@ function Re(e, t) {
|
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
function _t(e, t) {
|
|
137
|
-
const a = t.getContext("2d"), n = t.offsetWidth || t.width,
|
|
138
|
-
a.font = `${
|
|
139
|
-
const { width: i, height: c } =
|
|
137
|
+
const a = t.getContext("2d"), n = t.offsetWidth || t.width, s = (t.offsetHeight || t.height) * ge, l = n * ge;
|
|
138
|
+
a.font = `${s}px ${De}`;
|
|
139
|
+
const { width: i, height: c } = Se(e, a), u = s / (i / l), d = s / (c / s);
|
|
140
140
|
return Math.min(u, d);
|
|
141
141
|
}
|
|
142
142
|
function vt(e, t, a = "black", n = !1, o) {
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
const i = e.offsetWidth || e.width, c = e.offsetHeight || e.height, { width: u, height: d, offsetY: f } =
|
|
146
|
-
|
|
143
|
+
const s = e.getContext("2d"), l = _t(t, e);
|
|
144
|
+
s.font = `${l}px ${De}`, s.textBaseline = "top";
|
|
145
|
+
const i = e.offsetWidth || e.width, c = e.offsetHeight || e.height, { width: u, height: d, offsetY: f } = Se(t, s);
|
|
146
|
+
s.fillStyle = o, s.fillRect(0, 0, i, c), s.fillStyle = a;
|
|
147
147
|
const m = (i - u) / 2;
|
|
148
|
-
|
|
148
|
+
s.fillText(t, n ? i - m : m, (c - d) / 2 + f);
|
|
149
149
|
}
|
|
150
150
|
const Ne = /^data:([^;,]+)(?:;([^,]+))?,(.+)$/;
|
|
151
151
|
function Dt(e) {
|
|
@@ -164,11 +164,11 @@ function Y(e) {
|
|
|
164
164
|
encoding: n
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function Re({ data: e, mimeType: t, encoding: a = "text" }) {
|
|
168
168
|
const n = a === "base64" ? btoa(e) : encodeURI(e);
|
|
169
169
|
return `data:${a === "base64" ? `${t};base64` : t},${n}`;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function St(e, t) {
|
|
172
172
|
const a = Y(e);
|
|
173
173
|
if (!a)
|
|
174
174
|
return;
|
|
@@ -176,10 +176,10 @@ function Rt(e, t) {
|
|
|
176
176
|
const o = new Uint8Array(n);
|
|
177
177
|
for (; n--; )
|
|
178
178
|
o[n] = a.data.charCodeAt(n);
|
|
179
|
-
const
|
|
179
|
+
const s = a.mimeType.split("/")[1] ?? "txt";
|
|
180
180
|
return new File([
|
|
181
181
|
o
|
|
182
|
-
], `${t}.${
|
|
182
|
+
], `${t}.${s}`, {
|
|
183
183
|
type: a.mimeType
|
|
184
184
|
});
|
|
185
185
|
}
|
|
@@ -197,37 +197,37 @@ async function Nt(e, t) {
|
|
|
197
197
|
if (!a)
|
|
198
198
|
return e;
|
|
199
199
|
const n = a.mimeType;
|
|
200
|
-
if (n ===
|
|
200
|
+
if (n === S.TEXT) {
|
|
201
201
|
const o = j(V * 20, V, 1);
|
|
202
202
|
vt(o, a.data, "black", t, "white");
|
|
203
|
-
const
|
|
204
|
-
return (
|
|
203
|
+
const s = re(o, "white");
|
|
204
|
+
return (s == null ? void 0 : s.toDataURL("image/jpeg", 0.7)) ?? null;
|
|
205
205
|
}
|
|
206
|
-
if (n ===
|
|
206
|
+
if (n === S.POINTS) {
|
|
207
207
|
const o = ve(e);
|
|
208
208
|
if (!o)
|
|
209
209
|
return null;
|
|
210
|
-
const
|
|
210
|
+
const s = o.map((d) => ({
|
|
211
211
|
...d,
|
|
212
212
|
penColor: "black"
|
|
213
213
|
})), l = j(V * 20, V, Math.max(window.devicePixelRatio || 1, 1));
|
|
214
|
-
new _e(l).fromData(
|
|
215
|
-
const c =
|
|
216
|
-
return c ?
|
|
214
|
+
new _e(l).fromData(s);
|
|
215
|
+
const c = re(l);
|
|
216
|
+
return c ? he(c, void 0, V, "white").toDataURL("image/jpeg", 0.7) : null;
|
|
217
217
|
}
|
|
218
218
|
if (n != null && n.startsWith("image/")) {
|
|
219
|
-
const o = await
|
|
220
|
-
return
|
|
219
|
+
const o = await It(e), s = re(o);
|
|
220
|
+
return s ? he(s, void 0, V).toDataURL("image/jpeg", 0.7) : null;
|
|
221
221
|
}
|
|
222
222
|
return e;
|
|
223
223
|
}
|
|
224
|
-
async function
|
|
224
|
+
async function Rt(e, t) {
|
|
225
225
|
const a = await Nt(e, t);
|
|
226
226
|
if (a)
|
|
227
|
-
return
|
|
227
|
+
return St(a, "signature");
|
|
228
228
|
}
|
|
229
229
|
const At = ({ value: e, onChange: t, target: a }) => {
|
|
230
|
-
const [n, o] =
|
|
230
|
+
const [n, o] = X(e), { isRTL: s } = Me(), l = bt(a), { setFormStatus: i } = Ce(), c = G();
|
|
231
231
|
le(() => {
|
|
232
232
|
e === me && o(me);
|
|
233
233
|
}, [
|
|
@@ -235,15 +235,15 @@ const At = ({ value: e, onChange: t, target: a }) => {
|
|
|
235
235
|
]);
|
|
236
236
|
const u = _(() => {
|
|
237
237
|
c.current && (clearTimeout(c.current), c.current = null);
|
|
238
|
-
}, []), d = n == null ? void 0 : n[0], f = d != null && d.url ? Y(d.url) : void 0, m = _(async (
|
|
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
|
-
const p = (
|
|
240
|
+
const p = (g == null ? void 0 : g.url) ?? "";
|
|
241
241
|
if (Dt(p)) {
|
|
242
|
-
const
|
|
243
|
-
if (
|
|
244
|
-
const
|
|
242
|
+
const E = await Rt(p, s);
|
|
243
|
+
if (E) {
|
|
244
|
+
const h = await l(E);
|
|
245
245
|
t([
|
|
246
|
-
|
|
246
|
+
h
|
|
247
247
|
]);
|
|
248
248
|
} else
|
|
249
249
|
o(void 0), t(void 0);
|
|
@@ -255,18 +255,18 @@ const At = ({ value: e, onChange: t, target: a }) => {
|
|
|
255
255
|
}, [
|
|
256
256
|
i,
|
|
257
257
|
a,
|
|
258
|
-
|
|
258
|
+
s,
|
|
259
259
|
l,
|
|
260
260
|
t
|
|
261
261
|
]);
|
|
262
262
|
return {
|
|
263
|
-
handleChange: _((
|
|
264
|
-
const p = (
|
|
265
|
-
c.current = setTimeout(() => m(
|
|
263
|
+
handleChange: _((g) => {
|
|
264
|
+
const p = (E) => {
|
|
265
|
+
c.current = setTimeout(() => m(E), 1500);
|
|
266
266
|
};
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
]), p(
|
|
267
|
+
g ? (c.current && (clearTimeout(c.current), c.current = null), o([
|
|
268
|
+
g
|
|
269
|
+
]), p(g)) : (t == null || t(null), o(void 0), i(a, oe.READY));
|
|
270
270
|
}, [
|
|
271
271
|
m,
|
|
272
272
|
t,
|
|
@@ -278,22 +278,22 @@ const At = ({ value: e, onChange: t, target: a }) => {
|
|
|
278
278
|
cancelUpload: u
|
|
279
279
|
};
|
|
280
280
|
}, Ft = ({ target: e, value: t, onChange: a }) => {
|
|
281
|
-
const { handleChange: n, cancelUpload: o, signature:
|
|
281
|
+
const { handleChange: n, cancelUpload: o, signature: s, decodedValue: l } = At({
|
|
282
282
|
value: t,
|
|
283
283
|
onChange: a,
|
|
284
284
|
target: e
|
|
285
|
-
}), [i, c] =
|
|
286
|
-
if (
|
|
287
|
-
return
|
|
285
|
+
}), [i, c] = X(() => {
|
|
286
|
+
if (s == null)
|
|
287
|
+
return C.DRAW;
|
|
288
288
|
switch (l == null ? void 0 : l.mimeType) {
|
|
289
|
-
case
|
|
290
|
-
return
|
|
291
|
-
case
|
|
292
|
-
return
|
|
289
|
+
case S.POINTS:
|
|
290
|
+
return C.DRAW;
|
|
291
|
+
case S.TEXT:
|
|
292
|
+
return C.TYPE;
|
|
293
293
|
default:
|
|
294
|
-
return
|
|
294
|
+
return C.UPLOAD;
|
|
295
295
|
}
|
|
296
|
-
}), { setFormStatus: u } =
|
|
296
|
+
}), { setFormStatus: u } = Ce(), d = _(() => {
|
|
297
297
|
o(), u(e, oe.BUSY);
|
|
298
298
|
}, [
|
|
299
299
|
o,
|
|
@@ -306,41 +306,41 @@ const At = ({ value: e, onChange: t, target: a }) => {
|
|
|
306
306
|
n,
|
|
307
307
|
u,
|
|
308
308
|
e
|
|
309
|
-
]), m =
|
|
309
|
+
]), m = s != null, L = xt(i, s, l), g = (() => {
|
|
310
310
|
switch (i) {
|
|
311
|
-
case
|
|
311
|
+
case C.DRAW:
|
|
312
312
|
return N.DRAW;
|
|
313
|
-
case
|
|
313
|
+
case C.TYPE:
|
|
314
314
|
return N.TYPE;
|
|
315
|
-
case
|
|
315
|
+
case C.UPLOAD:
|
|
316
316
|
return L != null ? N.IMAGE : N.UPLOAD;
|
|
317
317
|
default:
|
|
318
318
|
return N.DRAW;
|
|
319
319
|
}
|
|
320
320
|
})();
|
|
321
321
|
return {
|
|
322
|
-
signature:
|
|
322
|
+
signature: s,
|
|
323
323
|
decodedValue: l,
|
|
324
324
|
signatureMode: i,
|
|
325
325
|
clearable: m,
|
|
326
326
|
signatureValueForView: L,
|
|
327
|
-
signatureView:
|
|
327
|
+
signatureView: g,
|
|
328
328
|
handleChange: n,
|
|
329
329
|
setSignatureMode: c,
|
|
330
330
|
handleBeforeChange: d,
|
|
331
331
|
handleClear: f
|
|
332
332
|
};
|
|
333
333
|
}, wt = {
|
|
334
|
-
[
|
|
335
|
-
[
|
|
336
|
-
[
|
|
334
|
+
[C.DRAW]: (e) => (e == null ? void 0 : e.mimeType) === S.POINTS,
|
|
335
|
+
[C.TYPE]: (e) => (e == null ? void 0 : e.mimeType) === S.TEXT,
|
|
336
|
+
[C.UPLOAD]: (e) => (e == null ? void 0 : e.mimeType) !== S.POINTS && (e == null ? void 0 : e.mimeType) !== S.TEXT
|
|
337
337
|
};
|
|
338
338
|
function xt(e, t, a) {
|
|
339
339
|
return t && wt[e](a) ? t : void 0;
|
|
340
340
|
}
|
|
341
341
|
const Ut = (e) => {
|
|
342
342
|
const t = e.url ? Y(e.url) : void 0;
|
|
343
|
-
return t ? t.mimeType !==
|
|
343
|
+
return t ? t.mimeType !== S.POINTS && t.mimeType !== S.TEXT : !0;
|
|
344
344
|
}, ce = () => {
|
|
345
345
|
const { hoverProps: e, isHovered: t } = Ke({}), { focusProps: a, isFocused: n, isFocusVisible: o } = Qe({
|
|
346
346
|
within: !0
|
|
@@ -352,58 +352,58 @@ const Ut = (e) => {
|
|
|
352
352
|
"data-focus-visible": o || void 0
|
|
353
353
|
};
|
|
354
354
|
}, b = ({ children: e }) => {
|
|
355
|
-
const { id: t, FieldLayout: a } = x(), n =
|
|
356
|
-
return /* @__PURE__ */
|
|
355
|
+
const { id: t, FieldLayout: a } = x(), n = I(e, b.Label), o = I(e, b.Input), s = I(e, b.Description), l = I(e, b.Error);
|
|
356
|
+
return /* @__PURE__ */ r.createElement(a, {
|
|
357
357
|
fieldId: t,
|
|
358
358
|
renderLabel: () => n,
|
|
359
359
|
renderInput: () => o,
|
|
360
|
-
renderDescription: () => /* @__PURE__ */
|
|
360
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, l, s)
|
|
361
361
|
});
|
|
362
362
|
}, Bt = {
|
|
363
|
-
[
|
|
364
|
-
[
|
|
365
|
-
[
|
|
363
|
+
[C.DRAW]: N.DRAW,
|
|
364
|
+
[C.TYPE]: N.TYPE,
|
|
365
|
+
[C.UPLOAD]: N.UPLOAD
|
|
366
366
|
}, J = ({ children: e, className: t }) => {
|
|
367
|
-
const { id: a, value: n, onChange: o, target:
|
|
368
|
-
target:
|
|
367
|
+
const { id: a, value: n, onChange: o, target: s, readOnly: l } = x(), i = gt(a), { signatureMode: c, setSignatureMode: u, handleClear: d, clearable: f, signatureView: m, signatureValueForView: L, handleChange: g, handleBeforeChange: p } = Ft({
|
|
368
|
+
target: s,
|
|
369
369
|
value: n,
|
|
370
370
|
onChange: o
|
|
371
|
-
}),
|
|
371
|
+
}), E = I(e, J.Header), h = I(e, J.Value), R = {
|
|
372
372
|
signatureMode: i ?? c,
|
|
373
373
|
setSignatureMode: u,
|
|
374
374
|
handleClear: d,
|
|
375
375
|
clearable: f,
|
|
376
376
|
signatureView: i ? Bt[i] : m,
|
|
377
377
|
signatureValueForView: i ? void 0 : L,
|
|
378
|
-
handleChange:
|
|
378
|
+
handleChange: g,
|
|
379
379
|
handleBeforeChange: p
|
|
380
380
|
};
|
|
381
|
-
return /* @__PURE__ */
|
|
381
|
+
return /* @__PURE__ */ r.createElement("div", {
|
|
382
382
|
className: t,
|
|
383
383
|
"data-hook": "signature-container"
|
|
384
|
-
}, !l && A(
|
|
384
|
+
}, !l && A(E, R), A(h, R));
|
|
385
385
|
}, K = ({ children: e, className: t, ...a }) => {
|
|
386
|
-
const { signatureMode: n, setSignatureMode: o, clearable:
|
|
387
|
-
return /* @__PURE__ */
|
|
386
|
+
const { signatureMode: n, setSignatureMode: o, clearable: s, handleClear: l } = a, { uploadEnabled: i } = x(), c = I(e, K.Tabs), u = I(e, K.Clear);
|
|
387
|
+
return /* @__PURE__ */ r.createElement("div", {
|
|
388
388
|
className: t
|
|
389
389
|
}, A(c, {
|
|
390
390
|
signatureMode: n,
|
|
391
391
|
setSignatureMode: o,
|
|
392
392
|
uploadEnabled: i
|
|
393
|
-
}),
|
|
393
|
+
}), s && A(u, {
|
|
394
394
|
handleClear: l
|
|
395
395
|
}));
|
|
396
396
|
}, M = ({ children: e, className: t, ...a }) => {
|
|
397
|
-
const { signatureMode: n, setSignatureMode: o, uploadEnabled:
|
|
397
|
+
const { signatureMode: n, setSignatureMode: o, uploadEnabled: s } = a, { disabled: l } = x(), { labelId: i, inputId: c } = W(), u = _((L) => {
|
|
398
398
|
o(L);
|
|
399
399
|
}, [
|
|
400
400
|
o
|
|
401
401
|
]), d = {
|
|
402
|
-
[
|
|
403
|
-
[
|
|
404
|
-
[
|
|
402
|
+
[C.DRAW]: I(e, M.Draw),
|
|
403
|
+
[C.TYPE]: I(e, M.Type),
|
|
404
|
+
[C.UPLOAD]: s ? I(e, M.Upload) : null
|
|
405
405
|
}, f = d[n], m = Ot(f) ? f.props.description : void 0;
|
|
406
|
-
return /* @__PURE__ */
|
|
406
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("div", {
|
|
407
407
|
role: "status",
|
|
408
408
|
"aria-live": "polite",
|
|
409
409
|
style: {
|
|
@@ -413,7 +413,7 @@ const Ut = (e) => {
|
|
|
413
413
|
height: "1px",
|
|
414
414
|
overflow: "hidden"
|
|
415
415
|
}
|
|
416
|
-
}, m), /* @__PURE__ */
|
|
416
|
+
}, m), /* @__PURE__ */ r.createElement(tt, {
|
|
417
417
|
value: n,
|
|
418
418
|
onChange: u,
|
|
419
419
|
isDisabled: l,
|
|
@@ -421,35 +421,35 @@ const Ut = (e) => {
|
|
|
421
421
|
"aria-controls": c,
|
|
422
422
|
"data-hook": dt.SIGNATURE_FIELD_MODE_SELECT,
|
|
423
423
|
className: t
|
|
424
|
-
}, d[
|
|
425
|
-
}, Ot = (e) => /* @__PURE__ */ Le(e), ue = ({ mode: e, children: t, className: a, "aria-label": n }) => /* @__PURE__ */
|
|
424
|
+
}, d[C.DRAW], d[C.TYPE], d[C.UPLOAD]));
|
|
425
|
+
}, Ot = (e) => /* @__PURE__ */ Le(e), ue = ({ mode: e, children: t, className: a, "aria-label": n }) => /* @__PURE__ */ r.createElement(rt, {
|
|
426
426
|
value: e,
|
|
427
427
|
"aria-label": n
|
|
428
|
-
}, /* @__PURE__ */
|
|
428
|
+
}, /* @__PURE__ */ r.createElement(lt, {
|
|
429
429
|
"data-hook": `signature-mode-${e}`,
|
|
430
430
|
className: a
|
|
431
|
-
}, t)), Pt = (e) => /* @__PURE__ */
|
|
431
|
+
}, t)), Pt = (e) => /* @__PURE__ */ r.createElement(ue, {
|
|
432
432
|
...e,
|
|
433
|
-
mode:
|
|
434
|
-
}), Mt = (e) => /* @__PURE__ */
|
|
433
|
+
mode: C.DRAW
|
|
434
|
+
}), Mt = (e) => /* @__PURE__ */ r.createElement(ue, {
|
|
435
435
|
...e,
|
|
436
|
-
mode:
|
|
437
|
-
}), Ht = (e) => /* @__PURE__ */
|
|
436
|
+
mode: C.TYPE
|
|
437
|
+
}), Ht = (e) => /* @__PURE__ */ r.createElement(ue, {
|
|
438
438
|
...e,
|
|
439
|
-
mode:
|
|
439
|
+
mode: C.UPLOAD
|
|
440
440
|
}), Wt = ({ children: e, className: t, "aria-label": a, ...n }) => {
|
|
441
|
-
const { handleClear: o } = n, { disabled:
|
|
442
|
-
return /* @__PURE__ */
|
|
441
|
+
const { handleClear: o } = n, { disabled: s, target: l } = x(), { inputId: i } = W();
|
|
442
|
+
return /* @__PURE__ */ r.createElement(ye, {
|
|
443
443
|
onPress: o,
|
|
444
|
-
isDisabled:
|
|
444
|
+
isDisabled: s,
|
|
445
445
|
"aria-label": a,
|
|
446
446
|
"aria-controls": i,
|
|
447
447
|
"data-hook": `clear-${l}`,
|
|
448
448
|
className: t
|
|
449
449
|
}, e);
|
|
450
450
|
}, H = ({ children: e, className: t, ...a }) => {
|
|
451
|
-
const { signatureView: n, signatureValueForView: o, handleChange:
|
|
452
|
-
return /* @__PURE__ */
|
|
451
|
+
const { signatureView: n, signatureValueForView: o, handleChange: s, handleBeforeChange: l } = a, { disabled: i, readOnly: c, onBlur: u, onFocus: d, hasError: f } = x(), m = I(e, H.Canvas), L = I(e, H.Type), g = I(e, H.Upload);
|
|
452
|
+
return /* @__PURE__ */ r.createElement("div", {
|
|
453
453
|
className: t,
|
|
454
454
|
"data-hook": "signature-input",
|
|
455
455
|
"data-invalid": f,
|
|
@@ -457,7 +457,7 @@ const Ut = (e) => {
|
|
|
457
457
|
"data-readonly": c
|
|
458
458
|
}, n === N.DRAW && A(m, {
|
|
459
459
|
value: o,
|
|
460
|
-
onChange:
|
|
460
|
+
onChange: s,
|
|
461
461
|
onBeforeChange: l,
|
|
462
462
|
disabled: i,
|
|
463
463
|
readOnly: c,
|
|
@@ -465,15 +465,15 @@ const Ut = (e) => {
|
|
|
465
465
|
onFocus: d
|
|
466
466
|
}), n === N.TYPE && A(L, {
|
|
467
467
|
value: o,
|
|
468
|
-
onChange:
|
|
468
|
+
onChange: s,
|
|
469
469
|
onBeforeChange: l,
|
|
470
470
|
disabled: i,
|
|
471
471
|
readOnly: c,
|
|
472
472
|
onBlur: u,
|
|
473
473
|
onFocus: d
|
|
474
|
-
}), (n === N.UPLOAD || n === N.IMAGE) && A(
|
|
474
|
+
}), (n === N.UPLOAD || n === N.IMAGE) && A(g, {
|
|
475
475
|
value: o,
|
|
476
|
-
onChange:
|
|
476
|
+
onChange: s,
|
|
477
477
|
onBeforeChange: l,
|
|
478
478
|
disabled: i,
|
|
479
479
|
readOnly: c,
|
|
@@ -481,10 +481,12 @@ const Ut = (e) => {
|
|
|
481
481
|
onFocus: d
|
|
482
482
|
}));
|
|
483
483
|
}, Yt = ({ className: e, emptyLabel: t, signedLabel: a, ...n }) => {
|
|
484
|
-
const { value: o, onChange:
|
|
485
|
-
|
|
486
|
-
var
|
|
487
|
-
(
|
|
484
|
+
const { value: o, onChange: s, onBeforeChange: l, disabled: i, readOnly: c, onBlur: u, onFocus: d } = n, { id: f } = x(), { inputId: m, ariaDescribedBy: L } = W(), g = ce(), p = G(), E = G(), h = G(null), R = o == null ? void 0 : o.url, [q, P] = X(!1);
|
|
485
|
+
Ie(() => {
|
|
486
|
+
var y;
|
|
487
|
+
(y = E.current) == null || y.focus({
|
|
488
|
+
preventScroll: !0
|
|
489
|
+
});
|
|
488
490
|
}, f);
|
|
489
491
|
const v = be(() => ({
|
|
490
492
|
throttle: 0,
|
|
@@ -496,66 +498,66 @@ const Ut = (e) => {
|
|
|
496
498
|
var w, U, B;
|
|
497
499
|
if ((w = p.current) != null && w.isEmpty())
|
|
498
500
|
return "";
|
|
499
|
-
const
|
|
500
|
-
return
|
|
501
|
-
}, []),
|
|
501
|
+
const y = (U = p.current) == null ? void 0 : U.toData();
|
|
502
|
+
return y ? yt(y) : ((B = p.current) == null ? void 0 : B.toDataURL()) ?? "";
|
|
503
|
+
}, []), $ = _(() => {
|
|
502
504
|
var w;
|
|
503
|
-
const
|
|
504
|
-
P(!
|
|
505
|
+
const y = (w = p.current) == null ? void 0 : w.isEmpty();
|
|
506
|
+
P(!y), s(ie(ee()));
|
|
505
507
|
}, [
|
|
506
508
|
ee,
|
|
507
|
-
|
|
509
|
+
s
|
|
508
510
|
]), k = _(() => {
|
|
509
511
|
l == null || l();
|
|
510
512
|
}, [
|
|
511
513
|
l
|
|
512
|
-
]), te = _((
|
|
514
|
+
]), te = _((y) => {
|
|
513
515
|
var U, B, D, O;
|
|
514
|
-
if (
|
|
515
|
-
if (
|
|
516
|
+
if (y != null) {
|
|
517
|
+
if (E.current = y, p.current = new _e(y, {
|
|
516
518
|
...v,
|
|
517
|
-
penColor: getComputedStyle(
|
|
518
|
-
}),
|
|
519
|
-
const
|
|
520
|
-
|
|
519
|
+
penColor: getComputedStyle(y).color || void 0
|
|
520
|
+
}), Ee(E.current, p.current), R) {
|
|
521
|
+
const Z = ve(R);
|
|
522
|
+
Z && (p.current.fromData(Z), P(!0));
|
|
521
523
|
} else
|
|
522
524
|
p.current.clear(), P(!1);
|
|
523
|
-
p.current.addEventListener("beginStroke", k), p.current.addEventListener("endStroke",
|
|
524
|
-
|
|
525
|
-
})), (U =
|
|
525
|
+
p.current.addEventListener("beginStroke", k), p.current.addEventListener("endStroke", $), typeof ResizeObserver < "u" && !h.current && (h.current = new ResizeObserver(() => {
|
|
526
|
+
E.current && Ee(E.current, p == null ? void 0 : p.current);
|
|
527
|
+
})), (U = h.current) == null || U.observe(y);
|
|
526
528
|
} else
|
|
527
|
-
(B =
|
|
529
|
+
(B = h.current) == null || B.disconnect(), (D = p.current) == null || D.removeEventListener("endStroke", $), (O = p.current) == null || O.removeEventListener("beginStroke", k);
|
|
528
530
|
}, [
|
|
529
531
|
v,
|
|
530
|
-
|
|
532
|
+
R,
|
|
531
533
|
k,
|
|
532
|
-
|
|
534
|
+
$
|
|
533
535
|
]);
|
|
534
536
|
return le(() => {
|
|
535
537
|
p.current && (c || i ? p.current.off() : p.current.on());
|
|
536
538
|
}, [
|
|
537
539
|
i,
|
|
538
540
|
c
|
|
539
|
-
]), /* @__PURE__ */
|
|
541
|
+
]), /* @__PURE__ */ r.createElement("div", {
|
|
540
542
|
className: e,
|
|
541
|
-
...
|
|
542
|
-
}, /* @__PURE__ */
|
|
543
|
+
...g
|
|
544
|
+
}, /* @__PURE__ */ r.createElement("canvas", {
|
|
543
545
|
ref: te,
|
|
544
546
|
id: m,
|
|
545
547
|
"data-hook": "signature-canvas",
|
|
546
548
|
"data-input-id": m,
|
|
547
|
-
"data-has-value": !!
|
|
549
|
+
"data-has-value": !!R,
|
|
548
550
|
onFocus: d,
|
|
549
551
|
onBlur: u,
|
|
550
552
|
role: "img",
|
|
551
|
-
"aria-label":
|
|
553
|
+
"aria-label": q ? a : t,
|
|
552
554
|
"aria-describedby": L
|
|
553
555
|
}));
|
|
554
556
|
}, de = ({ children: e, className: t, ...a }) => {
|
|
555
|
-
const { value: n, onChange: o, onBeforeChange:
|
|
557
|
+
const { value: n, onChange: o, onBeforeChange: s, disabled: l, readOnly: i, onBlur: c, onFocus: u } = a, { id: d, required: f, hasError: m } = x(), { inputId: L, ariaDescribedBy: g, labelId: p } = W(), E = ce(), h = n != null && n.url ? Y(n.url) : void 0, { data: R = "" } = h ?? {
|
|
556
558
|
data: ""
|
|
557
559
|
};
|
|
558
|
-
|
|
560
|
+
Ie(() => {
|
|
559
561
|
const v = document.getElementById(L);
|
|
560
562
|
v == null || v.focus({
|
|
561
563
|
preventScroll: !0
|
|
@@ -569,19 +571,19 @@ const Ut = (e) => {
|
|
|
569
571
|
n,
|
|
570
572
|
L
|
|
571
573
|
]);
|
|
572
|
-
const
|
|
573
|
-
|
|
574
|
+
const q = _((v) => {
|
|
575
|
+
s == null || s(), v.trim() ? o(ie(Re({
|
|
574
576
|
data: v,
|
|
575
|
-
mimeType:
|
|
577
|
+
mimeType: S.TEXT
|
|
576
578
|
}))) : o(null);
|
|
577
579
|
}, [
|
|
578
|
-
|
|
580
|
+
s,
|
|
579
581
|
o
|
|
580
|
-
]), P =
|
|
581
|
-
return /* @__PURE__ */
|
|
582
|
+
]), P = I(e, de.Value);
|
|
583
|
+
return /* @__PURE__ */ r.createElement(nt, {
|
|
582
584
|
"aria-labelledby": p,
|
|
583
|
-
value:
|
|
584
|
-
onChange:
|
|
585
|
+
value: R,
|
|
586
|
+
onChange: q,
|
|
585
587
|
onBlur: c,
|
|
586
588
|
onFocus: u,
|
|
587
589
|
isDisabled: l,
|
|
@@ -589,16 +591,16 @@ const Ut = (e) => {
|
|
|
589
591
|
isRequired: f,
|
|
590
592
|
isInvalid: m,
|
|
591
593
|
validationBehavior: "aria"
|
|
592
|
-
}, /* @__PURE__ */
|
|
594
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
593
595
|
className: t,
|
|
594
|
-
...
|
|
596
|
+
...E
|
|
595
597
|
}, A(P, {
|
|
596
598
|
inputId: L,
|
|
597
|
-
ariaDescribedBy:
|
|
599
|
+
ariaDescribedBy: g
|
|
598
600
|
})));
|
|
599
|
-
},
|
|
601
|
+
}, qt = ({ className: e, placeholder: t, ...a }) => {
|
|
600
602
|
const { inputId: n, ariaDescribedBy: o } = a;
|
|
601
|
-
return /* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ r.createElement(ot, {
|
|
602
604
|
id: n,
|
|
603
605
|
"data-hook": "signature-text",
|
|
604
606
|
"aria-describedby": o,
|
|
@@ -606,34 +608,34 @@ const Ut = (e) => {
|
|
|
606
608
|
className: e
|
|
607
609
|
});
|
|
608
610
|
}, Q = ({ children: e, className: t, ...a }) => {
|
|
609
|
-
const { value: n, onChange: o, disabled:
|
|
610
|
-
const
|
|
611
|
-
if (!
|
|
611
|
+
const { value: n, onChange: o, disabled: s, readOnly: l, onBlur: i, onFocus: c } = a, { labelId: u, ariaDescribedBy: d } = W(), f = I(e, Q.Button), m = I(e, Q.Preview), L = _((p) => {
|
|
612
|
+
const E = p[0];
|
|
613
|
+
if (!E) {
|
|
612
614
|
o(null);
|
|
613
615
|
return;
|
|
614
616
|
}
|
|
615
|
-
const
|
|
616
|
-
|
|
617
|
-
o(ie(
|
|
618
|
-
},
|
|
617
|
+
const h = new FileReader();
|
|
618
|
+
h.onload = () => {
|
|
619
|
+
o(ie(h.result, E.name));
|
|
620
|
+
}, h.readAsDataURL(E);
|
|
619
621
|
}, [
|
|
620
622
|
o
|
|
621
623
|
]);
|
|
622
624
|
return n && Ut(n) ? A(m, {
|
|
623
625
|
value: n
|
|
624
|
-
}) ?? null : /* @__PURE__ */
|
|
626
|
+
}) ?? null : /* @__PURE__ */ r.createElement(at, {
|
|
625
627
|
className: t,
|
|
626
|
-
isDisabled:
|
|
628
|
+
isDisabled: s || l,
|
|
627
629
|
"aria-labelledby": u,
|
|
628
630
|
"aria-describedby": d,
|
|
629
631
|
"data-hook": "signature-upload-drop-zone",
|
|
630
632
|
onDrop: async (p) => {
|
|
631
|
-
for (const
|
|
632
|
-
if (
|
|
633
|
-
const
|
|
634
|
-
if (
|
|
633
|
+
for (const E of p.items)
|
|
634
|
+
if (E.kind === "file" && E.type.startsWith("image/")) {
|
|
635
|
+
const h = await E.getFile();
|
|
636
|
+
if (h) {
|
|
635
637
|
L([
|
|
636
|
-
|
|
638
|
+
h
|
|
637
639
|
]);
|
|
638
640
|
return;
|
|
639
641
|
}
|
|
@@ -641,55 +643,55 @@ const Ut = (e) => {
|
|
|
641
643
|
}
|
|
642
644
|
}, A(f, {
|
|
643
645
|
onSelectFiles: L,
|
|
644
|
-
disabled:
|
|
646
|
+
disabled: s,
|
|
645
647
|
readOnly: l,
|
|
646
648
|
onBlur: i,
|
|
647
649
|
onFocus: c
|
|
648
650
|
}));
|
|
649
651
|
}, kt = ({ className: e, imageAlt: t, ...a }) => {
|
|
650
|
-
const { value: n } = a, { inputId: o } = W(),
|
|
651
|
-
return /* @__PURE__ */
|
|
652
|
+
const { value: n } = a, { inputId: o } = W(), s = ce();
|
|
653
|
+
return /* @__PURE__ */ r.createElement("div", {
|
|
652
654
|
className: e,
|
|
653
655
|
"data-has-value": !0,
|
|
654
|
-
...
|
|
655
|
-
}, n.url ? /* @__PURE__ */
|
|
656
|
+
...s
|
|
657
|
+
}, n.url ? /* @__PURE__ */ r.createElement("img", {
|
|
656
658
|
id: o,
|
|
657
659
|
src: n.url,
|
|
658
660
|
alt: n.displayName || t,
|
|
659
661
|
"data-hook": "signature-image"
|
|
660
|
-
}) : /* @__PURE__ */
|
|
662
|
+
}) : /* @__PURE__ */ r.createElement("span", {
|
|
661
663
|
id: o,
|
|
662
664
|
"data-hook": "signature-image"
|
|
663
665
|
}, n.displayName || t));
|
|
664
|
-
},
|
|
665
|
-
const { onSelectFiles: l, disabled: i, readOnly: c, onBlur: u, onFocus: d } =
|
|
666
|
-
textId:
|
|
667
|
-
}) :
|
|
668
|
-
id:
|
|
666
|
+
}, se = ({ children: e, className: t, onHoverStart: a, onHoverEnd: n, onFocusChange: o, ...s }) => {
|
|
667
|
+
const { onSelectFiles: l, disabled: i, readOnly: c, onBlur: u, onFocus: d } = s, { inputId: f, ariaDescribedBy: m, labelId: L } = W(), g = pt(), E = !!I(e, se.Text) ? Fe.map(e, (h) => /* @__PURE__ */ Le(h) && h.type === se.Text ? A(h, {
|
|
668
|
+
textId: g
|
|
669
|
+
}) : h) : /* @__PURE__ */ r.createElement("span", {
|
|
670
|
+
id: g
|
|
669
671
|
}, e);
|
|
670
|
-
return /* @__PURE__ */
|
|
672
|
+
return /* @__PURE__ */ r.createElement(st, {
|
|
671
673
|
acceptedFileTypes: [
|
|
672
674
|
"image/*"
|
|
673
675
|
],
|
|
674
|
-
onSelect: (
|
|
675
|
-
l(
|
|
676
|
+
onSelect: (h) => {
|
|
677
|
+
l(h ? Array.from(h) : []);
|
|
676
678
|
}
|
|
677
|
-
}, /* @__PURE__ */
|
|
679
|
+
}, /* @__PURE__ */ r.createElement(ye, {
|
|
678
680
|
id: f,
|
|
679
681
|
onBlur: u,
|
|
680
682
|
onFocus: d,
|
|
681
683
|
isDisabled: i || c,
|
|
682
|
-
"aria-labelledby": `${L} ${
|
|
684
|
+
"aria-labelledby": `${L} ${g}`,
|
|
683
685
|
"aria-describedby": m,
|
|
684
686
|
"data-hook": "signature-upload",
|
|
685
687
|
className: t,
|
|
686
688
|
onHoverStart: a,
|
|
687
689
|
onHoverEnd: n,
|
|
688
690
|
onFocusChange: o
|
|
689
|
-
},
|
|
690
|
-
},
|
|
691
|
+
}, E));
|
|
692
|
+
}, Zt = ({ children: e, className: t, ...a }) => {
|
|
691
693
|
const { textId: n } = a;
|
|
692
|
-
return /* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ r.createElement("span", {
|
|
693
695
|
id: n,
|
|
694
696
|
className: t
|
|
695
697
|
}, e);
|
|
@@ -708,10 +710,10 @@ M.Upload = Ht;
|
|
|
708
710
|
H.Canvas = Yt;
|
|
709
711
|
H.Type = de;
|
|
710
712
|
H.Upload = Q;
|
|
711
|
-
de.Value =
|
|
713
|
+
de.Value = qt;
|
|
712
714
|
Q.Preview = kt;
|
|
713
|
-
Q.Button =
|
|
714
|
-
|
|
715
|
+
Q.Button = se;
|
|
716
|
+
se.Text = Zt;
|
|
715
717
|
const Vt = () => {
|
|
716
718
|
const { t: e } = He();
|
|
717
719
|
return {
|
|
@@ -728,47 +730,47 @@ const Vt = () => {
|
|
|
728
730
|
imageAlt: e("field.signature.a11y.state.signed"),
|
|
729
731
|
uploadLabel: e("field.signature.settings.upload-button.label")
|
|
730
732
|
};
|
|
731
|
-
},
|
|
733
|
+
}, Gt = (e) => /* @__PURE__ */ r.createElement("svg", {
|
|
732
734
|
viewBox: "0 0 24 24",
|
|
733
735
|
width: 24,
|
|
734
736
|
height: 24,
|
|
735
737
|
fill: "currentColor",
|
|
736
738
|
"aria-hidden": "true",
|
|
737
739
|
...e
|
|
738
|
-
}, /* @__PURE__ */
|
|
740
|
+
}, /* @__PURE__ */ r.createElement("path", {
|
|
739
741
|
fillRule: "evenodd",
|
|
740
742
|
d: "M13.5,3 C14.327,3 15,3.673 15,4.5 L15,4.5 L15,5 L19,5 L19,6 L18,6 L18,17.5 C18,18.879 16.878,20 15.5,20 L15.5,20 L7.5,20 C6.122,20 5,18.879 5,17.5 L5,17.5 L5,6 L4,6 L4,5 L8,5 L8,4.5 C8,3.673 8.673,3 9.5,3 L9.5,3 Z M17,6 L6,6 L6,17.5 C6,18.327 6.673,19 7.5,19 L7.5,19 L15.5,19 C16.327,19 17,18.327 17,17.5 L17,17.5 L17,6 Z M10,9 L10,16 L9,16 L9,9 L10,9 Z M14,9 L14,16 L13,16 L13,9 L14,9 Z M13.5,4 L9.5,4 C9.224,4 9,4.225 9,4.5 L9,4.5 L9,5 L14,5 L14,4.5 C14,4.225 13.776,4 13.5,4 L13.5,4 Z"
|
|
741
|
-
})),
|
|
743
|
+
})), $t = (e) => /* @__PURE__ */ r.createElement("svg", {
|
|
742
744
|
viewBox: "0 0 24 24",
|
|
743
745
|
width: 24,
|
|
744
746
|
height: 24,
|
|
745
747
|
fill: "currentColor",
|
|
746
748
|
"aria-hidden": "true",
|
|
747
749
|
...e
|
|
748
|
-
}, /* @__PURE__ */
|
|
750
|
+
}, /* @__PURE__ */ r.createElement("path", {
|
|
749
751
|
fillRule: "evenodd",
|
|
750
752
|
d: "M4.9937,15.9971 L4.9937,18.4971 C4.9937,18.7721 5.2177,18.9971 5.4937,18.9971 L5.4937,18.9971 L17.4937,18.9971 C17.7697,18.9971 17.9937,18.7721 17.9937,18.4971 L17.9937,18.4971 L17.9937,15.9971 L18.9937,15.9971 L18.9937,18.4971 C18.9937,19.3241 18.3207,19.9971 17.4937,19.9971 L17.4937,19.9971 L5.4937,19.9971 C4.6657,19.9971 3.9937,19.3241 3.9937,18.4971 L3.9937,18.4971 L3.9937,15.9971 L4.9937,15.9971 Z M11.9933,4 L11.9933,14.078 L15.0293,11.043 L15.7363,11.75 L11.4933,15.992 L7.2513,11.75 L7.9583,11.043 L10.9933,14.078 L10.9933,4 L11.9933,4 Z"
|
|
751
|
-
})),
|
|
753
|
+
})), zt = (e) => /* @__PURE__ */ r.createElement("svg", {
|
|
752
754
|
viewBox: "0 0 24 24",
|
|
753
755
|
width: 24,
|
|
754
756
|
height: 24,
|
|
755
757
|
fill: "currentColor",
|
|
756
758
|
"aria-hidden": "true",
|
|
757
759
|
...e
|
|
758
|
-
}, /* @__PURE__ */
|
|
760
|
+
}, /* @__PURE__ */ r.createElement("path", {
|
|
759
761
|
fillRule: "evenodd",
|
|
760
762
|
d: "M18.8525,7.543 L17.7515,8.644 L15.3565,6.248 L16.4575,5.147 C16.5555,5.05 16.6835,5.001 16.8105,5.001 C16.9385,5.001 17.0665,5.05 17.1645,5.147 L18.8525,6.835 C19.0475,7.03 19.0475,7.348 18.8525,7.543 L18.8525,7.543 Z M8.1895,18.206 C8.1185,18.276 8.0275,18.324 7.9295,18.344 L5.1275,18.873 L5.6575,16.07 C5.6755,15.972 5.7225,15.882 5.7945,15.811 L14.6495,6.955 L17.0445,9.351 L8.1895,18.206 Z M19.5595,6.128 L17.8715,4.44 C17.2865,3.856 16.3355,3.856 15.7505,4.44 L5.0875,15.103 C4.8735,15.317 4.7295,15.588 4.6745,15.886 L4.0085,19.407 C3.9775,19.569 4.0295,19.736 4.1465,19.854 C4.2415,19.948 4.3685,20 4.4995,20 C4.5305,20 4.5615,19.997 4.5925,19.991 L8.1165,19.326 C8.4145,19.269 8.6855,19.125 8.8965,18.912 L19.5595,8.25 C20.1445,7.665 20.1445,6.713 19.5595,6.128 L19.5595,6.128 Z"
|
|
761
|
-
})),
|
|
763
|
+
})), Xt = (e) => /* @__PURE__ */ r.createElement("svg", {
|
|
762
764
|
viewBox: "0 0 20 20",
|
|
763
765
|
width: 24,
|
|
764
766
|
height: 24,
|
|
765
767
|
fill: "currentColor",
|
|
766
768
|
"aria-hidden": "true",
|
|
767
769
|
...e
|
|
768
|
-
}, /* @__PURE__ */
|
|
770
|
+
}, /* @__PURE__ */ r.createElement("path", {
|
|
769
771
|
fillRule: "evenodd",
|
|
770
772
|
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"
|
|
771
|
-
})), jt = "
|
|
773
|
+
})), jt = "_container_1qhus_1", Jt = "_header_1qhus_7", Kt = "_tabs_1qhus_13", Qt = "_tab_1qhus_13", en = "_tabHover_1qhus_43", tn = "_tabSelected_1qhus_48", nn = "_tabIcon_1qhus_78", an = "_uploadButton_1qhus_85", on = "_uploadButtonHover_1qhus_138", sn = "_uploadButtonLabel_1qhus_155", rn = "_clear_1qhus_159", ln = "_value_1qhus_191", cn = "_box_1qhus_196", un = "_uploadBox_1qhus_197", dn = "_dropZone_1qhus_228", mn = "_dropZoneHover_1qhus_244", pn = "_boxHover_1qhus_281", fn = "_typeInput_1qhus_341", T = {
|
|
772
774
|
container: jt,
|
|
773
775
|
header: Jt,
|
|
774
776
|
tabs: Kt,
|
|
@@ -778,8 +780,8 @@ const Vt = () => {
|
|
|
778
780
|
tabIcon: nn,
|
|
779
781
|
uploadButton: an,
|
|
780
782
|
uploadButtonHover: on,
|
|
781
|
-
uploadButtonLabel:
|
|
782
|
-
clear:
|
|
783
|
+
uploadButtonLabel: sn,
|
|
784
|
+
clear: rn,
|
|
783
785
|
value: ln,
|
|
784
786
|
box: cn,
|
|
785
787
|
uploadBox: un,
|
|
@@ -787,25 +789,25 @@ const Vt = () => {
|
|
|
787
789
|
dropZoneHover: mn,
|
|
788
790
|
boxHover: pn,
|
|
789
791
|
typeInput: fn
|
|
790
|
-
},
|
|
792
|
+
}, hn = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(xe, {
|
|
791
793
|
content: e,
|
|
792
794
|
locale: t
|
|
793
|
-
}),
|
|
794
|
-
var k, te,
|
|
795
|
-
const e = Vt(), { disabled: t, readOnly: a } = x(), n = !t && !a, o =
|
|
795
|
+
}), En = () => {
|
|
796
|
+
var k, te, y, w, U, B;
|
|
797
|
+
const e = Vt(), { disabled: t, readOnly: a } = x(), n = !t && !a, o = z({
|
|
796
798
|
globalClasses: Je,
|
|
797
799
|
moduleClasses: {
|
|
798
800
|
base: T.tab,
|
|
799
801
|
hover: T.tabHover,
|
|
800
802
|
selected: T.tabSelected
|
|
801
803
|
}
|
|
802
|
-
}),
|
|
804
|
+
}), s = ({ isSelected: D, isHovered: O, isFocused: Z }) => o({
|
|
803
805
|
isSelected: D,
|
|
804
806
|
isHovered: O,
|
|
805
|
-
isFocused:
|
|
807
|
+
isFocused: Z,
|
|
806
808
|
isInteractive: n
|
|
807
|
-
}), i =
|
|
808
|
-
globalClasses:
|
|
809
|
+
}), i = z({
|
|
810
|
+
globalClasses: $e,
|
|
809
811
|
moduleClasses: {
|
|
810
812
|
base: T.box,
|
|
811
813
|
hover: T.boxHover
|
|
@@ -814,8 +816,8 @@ const Vt = () => {
|
|
|
814
816
|
isSelected: !1,
|
|
815
817
|
isHovered: !1,
|
|
816
818
|
isInteractive: n
|
|
817
|
-
}), u =
|
|
818
|
-
globalClasses:
|
|
819
|
+
}), u = z({
|
|
820
|
+
globalClasses: ze,
|
|
819
821
|
moduleClasses: {
|
|
820
822
|
base: T.box,
|
|
821
823
|
hover: T.boxHover
|
|
@@ -824,78 +826,78 @@ const Vt = () => {
|
|
|
824
826
|
isSelected: !1,
|
|
825
827
|
isHovered: !1,
|
|
826
828
|
isInteractive: n
|
|
827
|
-
}), d =
|
|
828
|
-
globalClasses:
|
|
829
|
+
}), d = z({
|
|
830
|
+
globalClasses: Xe,
|
|
829
831
|
moduleClasses: {
|
|
830
832
|
base: T.dropZone,
|
|
831
833
|
hover: T.dropZoneHover
|
|
832
834
|
}
|
|
833
|
-
}), f =
|
|
835
|
+
}), f = z({
|
|
834
836
|
globalClasses: je,
|
|
835
837
|
moduleClasses: {
|
|
836
838
|
base: T.uploadButton,
|
|
837
839
|
hover: T.uploadButtonHover
|
|
838
840
|
}
|
|
839
|
-
}), m = (B = (U = (w = (
|
|
841
|
+
}), m = (B = (U = (w = (y = (te = (k = Te().signatureContainer) == null ? void 0 : k.elementProps) == null ? void 0 : te.signatureDropZone) == null ? void 0 : y.elementProps) == null ? void 0 : w.signatureUploadButton) == null ? void 0 : U.elementProps) == null ? void 0 : B.icon, { wix: L, className: g, ...p } = m ?? {}, E = We(ne.SIGNATURE_CONTAINER, ne.SIGNATURE_DROP_ZONE, ne.SIGNATURE_UPLOAD_BUTTON, ne.UPLOAD_BUTTON_LABEL), h = G(null), [R, q] = X(!1), [P, v] = X(!1), ee = _(() => {
|
|
840
842
|
var D;
|
|
841
|
-
|
|
842
|
-
}, []),
|
|
843
|
+
q(!0), (D = h.current) == null || D.runAnimationForward();
|
|
844
|
+
}, []), $ = _(() => {
|
|
843
845
|
var D;
|
|
844
|
-
|
|
846
|
+
q(!1), (D = h.current) == null || D.runAnimationBackward();
|
|
845
847
|
}, []);
|
|
846
|
-
return /* @__PURE__ */
|
|
848
|
+
return /* @__PURE__ */ r.createElement(b, null, /* @__PURE__ */ r.createElement(b.Label, {
|
|
847
849
|
className: F(Ye, ae.label)
|
|
848
|
-
}, /* @__PURE__ */
|
|
849
|
-
className: F(
|
|
850
|
-
})), /* @__PURE__ */
|
|
850
|
+
}, /* @__PURE__ */ r.createElement(b.Label.Required, {
|
|
851
|
+
className: F(qe, ae.requiredMark)
|
|
852
|
+
})), /* @__PURE__ */ r.createElement(b.Input, {
|
|
851
853
|
className: F(ke, T.container)
|
|
852
|
-
}, /* @__PURE__ */
|
|
854
|
+
}, /* @__PURE__ */ r.createElement(b.Input.Header, {
|
|
853
855
|
className: T.header
|
|
854
|
-
}, /* @__PURE__ */
|
|
856
|
+
}, /* @__PURE__ */ r.createElement(b.Input.Header.Tabs, {
|
|
855
857
|
className: T.tabs
|
|
856
|
-
}, /* @__PURE__ */
|
|
857
|
-
className:
|
|
858
|
+
}, /* @__PURE__ */ r.createElement(b.Input.Header.Tabs.Draw, {
|
|
859
|
+
className: s,
|
|
858
860
|
"aria-label": e.drawLabel,
|
|
859
861
|
description: e.drawDescription
|
|
860
|
-
}, /* @__PURE__ */
|
|
862
|
+
}, /* @__PURE__ */ r.createElement(zt, {
|
|
861
863
|
className: T.tabIcon
|
|
862
|
-
})), /* @__PURE__ */
|
|
863
|
-
className:
|
|
864
|
+
})), /* @__PURE__ */ r.createElement(b.Input.Header.Tabs.Type, {
|
|
865
|
+
className: s,
|
|
864
866
|
"aria-label": e.typeLabel,
|
|
865
867
|
description: e.typeDescription
|
|
866
|
-
}, /* @__PURE__ */
|
|
868
|
+
}, /* @__PURE__ */ r.createElement(Xt, {
|
|
867
869
|
className: T.tabIcon
|
|
868
|
-
})), /* @__PURE__ */
|
|
869
|
-
className:
|
|
870
|
+
})), /* @__PURE__ */ r.createElement(b.Input.Header.Tabs.Upload, {
|
|
871
|
+
className: s,
|
|
870
872
|
"aria-label": e.uploadModeLabel,
|
|
871
873
|
description: e.uploadDescription
|
|
872
|
-
}, /* @__PURE__ */
|
|
874
|
+
}, /* @__PURE__ */ r.createElement($t, {
|
|
873
875
|
className: T.tabIcon
|
|
874
|
-
}))), /* @__PURE__ */
|
|
876
|
+
}))), /* @__PURE__ */ r.createElement(b.Input.Header.Clear, {
|
|
875
877
|
className: F(pe, T.clear),
|
|
876
878
|
"aria-label": e.clearLabel
|
|
877
|
-
}, /* @__PURE__ */
|
|
879
|
+
}, /* @__PURE__ */ r.createElement(Gt, null))), /* @__PURE__ */ r.createElement(b.Input.Value, {
|
|
878
880
|
className: T.value
|
|
879
|
-
}, /* @__PURE__ */
|
|
881
|
+
}, /* @__PURE__ */ r.createElement(b.Input.Value.Canvas, {
|
|
880
882
|
className: i,
|
|
881
883
|
emptyLabel: e.emptyLabel,
|
|
882
884
|
signedLabel: e.signedLabel
|
|
883
|
-
}), /* @__PURE__ */
|
|
885
|
+
}), /* @__PURE__ */ r.createElement(b.Input.Value.Type, {
|
|
884
886
|
className: u
|
|
885
|
-
}, /* @__PURE__ */
|
|
887
|
+
}, /* @__PURE__ */ r.createElement(b.Input.Value.Type.Value, {
|
|
886
888
|
className: T.typeInput,
|
|
887
889
|
placeholder: e.placeholder
|
|
888
|
-
})), /* @__PURE__ */
|
|
889
|
-
className: ({ isHovered: D, isFocused: O, isDropTarget:
|
|
890
|
+
})), /* @__PURE__ */ r.createElement(b.Input.Value.Upload, {
|
|
891
|
+
className: ({ isHovered: D, isFocused: O, isDropTarget: Z }) => F(T.uploadBox, d({
|
|
890
892
|
isSelected: !1,
|
|
891
|
-
isHovered: D ||
|
|
893
|
+
isHovered: D || Z,
|
|
892
894
|
isFocused: O,
|
|
893
895
|
isInteractive: n
|
|
894
896
|
}))
|
|
895
|
-
}, /* @__PURE__ */
|
|
897
|
+
}, /* @__PURE__ */ r.createElement(b.Input.Value.Upload.Preview, {
|
|
896
898
|
className: F(T.uploadBox, i),
|
|
897
899
|
imageAlt: e.imageAlt
|
|
898
|
-
}), /* @__PURE__ */
|
|
900
|
+
}), /* @__PURE__ */ r.createElement(b.Input.Value.Upload.Button, {
|
|
899
901
|
className: ({ isHovered: D, isFocused: O }) => f({
|
|
900
902
|
isSelected: !1,
|
|
901
903
|
isHovered: D,
|
|
@@ -903,22 +905,22 @@ const Vt = () => {
|
|
|
903
905
|
isInteractive: n
|
|
904
906
|
}),
|
|
905
907
|
onHoverStart: ee,
|
|
906
|
-
onHoverEnd:
|
|
908
|
+
onHoverEnd: $,
|
|
907
909
|
onFocusChange: v
|
|
908
|
-
}, p.svg ? /* @__PURE__ */
|
|
910
|
+
}, p.svg ? /* @__PURE__ */ r.createElement(we, {
|
|
909
911
|
...p,
|
|
910
|
-
ref:
|
|
911
|
-
className: F(
|
|
912
|
-
}) : null, /* @__PURE__ */
|
|
913
|
-
className: F(fe.base, T.uploadButtonLabel,
|
|
914
|
-
[fe.hover]: n && (
|
|
912
|
+
ref: h,
|
|
913
|
+
className: F(Ze, Ve, g)
|
|
914
|
+
}) : null, /* @__PURE__ */ r.createElement(b.Input.Value.Upload.Button.Text, {
|
|
915
|
+
className: F(fe.base, T.uploadButtonLabel, E, {
|
|
916
|
+
[fe.hover]: n && (R || P)
|
|
915
917
|
})
|
|
916
|
-
}, e.uploadLabel))))), /* @__PURE__ */
|
|
917
|
-
className: F(
|
|
918
|
-
}, /* @__PURE__ */
|
|
918
|
+
}, e.uploadLabel))))), /* @__PURE__ */ r.createElement(b.Error, {
|
|
919
|
+
className: F(Ge, ae.error)
|
|
920
|
+
}, /* @__PURE__ */ r.createElement(mt, null), /* @__PURE__ */ r.createElement(b.Error.Text, null)), /* @__PURE__ */ r.createElement(b.Description, {
|
|
919
921
|
className: F(pe, ae.description)
|
|
920
|
-
},
|
|
921
|
-
}, wn = () => /* @__PURE__ */
|
|
922
|
+
}, hn));
|
|
923
|
+
}, wn = () => /* @__PURE__ */ r.createElement(En, null);
|
|
922
924
|
export {
|
|
923
925
|
wn as SignatureRAC
|
|
924
926
|
};
|