@wix/form-elements 1.81.0 → 1.83.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 (118) hide show
  1. package/dist/component/{appointment-rac-DmwbqZse.js → appointment-rac-ky2cE6hE.js} +6 -6
  2. package/dist/component/{bookings-address-rac-RCzVU87c.js → bookings-address-rac-Bxc6H9Pb.js} +1 -1
  3. package/dist/component/{bookings-email-rac-Df_Wte1_.js → bookings-email-rac-Dw1Xttdx.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-BmdRGYxF.js → bookings-first-name-rac-dgHOrJaJ.js} +1 -1
  5. package/dist/component/{bookings-header-rac-DewQWtkZ.js → bookings-header-rac-Bl9RYGWo.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-DmmNBuqy.js → bookings-last-name-rac-BeqYpbZq.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-QskvFo0C.js → bookings-login-bar-rac-C1k6o0A5.js} +2 -2
  8. package/dist/component/{bookings-phone-rac-7wn8IXna.js → bookings-phone-rac-ByhaJrwE.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-B5nk0BlD.js → bookings-rich-text-rac-Mw5-ZiIn.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-BnVNfYWL.js → checkbox-field-rac-CMEI5t4Y.js} +7 -7
  11. package/dist/component/{checkbox-group-field-headless-Bx5Y-RMP.js → checkbox-group-field-headless-CP21R7_s.js} +3 -3
  12. package/dist/component/checkbox-group-field-rac-DGOZjSIY.js +42 -0
  13. package/dist/component/{checkbox-group-rac-B20t8dTB.js → checkbox-group-rac-CEGtshrl.js} +1 -1
  14. package/dist/component/{checkbox-indicator-module-classes-DqzGZQRQ.js → checkbox-indicator-module-classes-Bb3xB1ve.js} +1 -1
  15. package/dist/component/{checkbox-rac-ifC6qSE8.js → checkbox-rac-DCnRh1WF.js} +1 -1
  16. package/dist/component/{contacts-address-rac-XJRKvPlp.js → contacts-address-rac-CZb_5N5o.js} +1 -1
  17. package/dist/component/{contacts-birthdate-rac-CKYESrPO.js → contacts-birthdate-rac-DZlwSyp5.js} +1 -1
  18. package/dist/component/{contacts-company-rac-BXwEeb0p.js → contacts-company-rac-BNEF6LjB.js} +1 -1
  19. package/dist/component/{contacts-email-rac-D8Yspo_m.js → contacts-email-rac-CAgk_zfN.js} +1 -1
  20. package/dist/component/{contacts-first-name-rac-mvCGP1LJ.js → contacts-first-name-rac-DyTVcmrX.js} +1 -1
  21. package/dist/component/{contacts-last-name-rac-Clg9RXal.js → contacts-last-name-rac-DrFcDcGr.js} +1 -1
  22. package/dist/component/{contacts-phone-rac-qEwjhByI.js → contacts-phone-rac-UAPALlFx.js} +1 -1
  23. package/dist/component/{contacts-position-rac-Bh8fvf2M.js → contacts-position-rac-CJ1M4kJJ.js} +1 -1
  24. package/dist/component/{contacts-subscribe-rac-DEQ2XkZo.js → contacts-subscribe-rac-1cEd5s1l.js} +2 -2
  25. package/dist/component/{contacts-tax-id-rac-0DUZ4tJz.js → contacts-tax-id-rac-CqnO__fd.js} +1 -1
  26. package/dist/component/{date-availability-2ek2RtXx.js → date-availability-COM2EaRy.js} +1 -1
  27. package/dist/component/{date-input-field-rac-Bp4SQB-t.js → date-input-field-rac-CuuWbw42.js} +80 -79
  28. package/dist/component/{date-input-rac-CYsJcMe5.js → date-input-rac-DfVmj9Gc.js} +1 -1
  29. package/dist/component/{date-picker-field-rac-BGQvnSYI.js → date-picker-field-rac-BFCZik9T.js} +6 -6
  30. package/dist/component/{date-picker-rac-BVncggYR.js → date-picker-rac-C2vajJpb.js} +1 -1
  31. package/dist/component/{date-time-input-field-rac-B1mggelc.js → date-time-input-field-rac-B7ne2emo.js} +127 -126
  32. package/dist/component/{date-time-input-rac-DzdCno0L.js → date-time-input-rac-D4FEieQz.js} +1 -1
  33. package/dist/component/{dext-checkbox-group-rac-CNCpeolD.js → dext-checkbox-group-rac-BDBBTNNo.js} +2 -2
  34. package/dist/component/{dext-checkbox-rac-BYDQ58Mo.js → dext-checkbox-rac-DAAhNboR.js} +1 -1
  35. package/dist/component/{dext-date-picker-rac-aYYk8Nrl.js → dext-date-picker-rac-me7XbR5z.js} +1 -1
  36. package/dist/component/{dext-date-time-input-rac-v2v974p5.js → dext-date-time-input-rac-DLsUl2Eg.js} +1 -1
  37. package/dist/component/{dext-dropdown-rac-C846KZCe.js → dext-dropdown-rac-C3vVIRir.js} +1 -1
  38. package/dist/component/{dext-email-rac-izjbfME9.js → dext-email-rac-a8qXYTLP.js} +1 -1
  39. package/dist/component/{dext-number-input-rac-CnOFsD7l.js → dext-number-input-rac-DdDnL_fX.js} +1 -1
  40. package/dist/component/{dext-phone-rac-D8GMXD88.js → dext-phone-rac-ByaxbHpO.js} +1 -1
  41. package/dist/component/{dext-radio-group-rac-BtiyGCRh.js → dext-radio-group-rac-Bzubt7Uy.js} +2 -2
  42. package/dist/component/{dext-rating-input-rac-BHJ1kitb.js → dext-rating-input-rac-BZ1EvOkG.js} +1 -1
  43. package/dist/component/{dext-tags-rac-CvNjwS5R.js → dext-tags-rac-C_R89noV.js} +2 -2
  44. package/dist/component/{dext-text-area-rac-X5L0Q3sC.js → dext-text-area-rac-DRpYeQ-K.js} +1 -1
  45. package/dist/component/{dext-text-input-rac-swkyAJqC.js → dext-text-input-rac-D_RtbQQ-.js} +1 -1
  46. package/dist/component/{dext-url-input-rac-BYlXOAkz.js → dext-url-input-rac-BSSjSbIo.js} +1 -1
  47. package/dist/component/{donation-rac-CDWLBZZM.js → donation-rac-De0KyyGR.js} +92 -91
  48. package/dist/component/{dropdown-field-headless-JJzbZvps.js → dropdown-field-headless-DNhnTDlD.js} +3 -3
  49. package/dist/component/{dropdown-field-rac-BodpIQ9Q.js → dropdown-field-rac-Bq_FNv9a.js} +3 -3
  50. package/dist/component/{dropdown-rac-Bfbxxx9k.js → dropdown-rac-0UIyqF15.js} +1 -1
  51. package/dist/component/{ecom-address-rac-BCnsL5tr.js → ecom-address-rac-7IVbvs3J.js} +1 -1
  52. package/dist/component/{ecom-subscription-checkbox-rac-CNSdI_ty.js → ecom-subscription-checkbox-rac-DilgIpiG.js} +3 -3
  53. package/dist/component/{email-input-field-rac-Btaa4O5T.js → email-input-field-rac-CHJ6RSGy.js} +83 -79
  54. package/dist/component/{events-repeater-rac-xBwqJddt.js → events-repeater-rac-v18FFLC7.js} +6 -6
  55. package/dist/component/{events-rsvp-rac-D90PwkHd.js → events-rsvp-rac-BpGLrxsf.js} +4 -4
  56. package/dist/component/{field-error-headless-BErhh9GG.js → field-error-headless-DAy-1oAQ.js} +1 -1
  57. package/dist/component/{field-label-headless-BGyK-5xW.js → field-label-headless-BWxHmO0c.js} +1 -1
  58. package/dist/component/field-rac.module-D06m9T9x.js +24 -0
  59. package/dist/component/{file-upload-rac-MxH3CVml.js → file-upload-rac-BfWN27JT.js} +5 -5
  60. package/dist/component/{fixed-payment-rac-DpBA9irF.js → fixed-payment-rac-Bha61SB4.js} +5 -5
  61. package/dist/component/{form-f0tqdMye.js → form-D0eeH0lX.js} +69 -69
  62. package/dist/component/{form-element-classes-jC8D0LnK.js → form-element-classes-Ct1UaxuQ.js} +38 -32
  63. package/dist/component/form.css +1 -1
  64. package/dist/component/form.js +1 -1
  65. package/dist/component/{header-field-rac-BXxFqu9u.js → header-field-rac-uNzfDMbv.js} +3 -3
  66. package/dist/component/{header-rac-BN70esac.js → header-rac-B91q4fHl.js} +1 -1
  67. package/dist/component/{image-choice-rac-DLBGIBXL.js → image-choice-rac-BKcnNGPp.js} +6 -6
  68. package/dist/component/{index-BvB-uE1H.js → index-BWHymomM.js} +2 -2
  69. package/dist/component/{index-DXLEHYlA.js → index-BvzLLTKc.js} +4 -4
  70. package/dist/component/{isObjectLike-BYOX5XY4.js → isObjectLike-D7Mkqoju.js} +1 -1
  71. package/dist/component/multiline-address-field-rac-Avd9Vlv1.js +1617 -0
  72. package/dist/component/{multiline-address-rac-D82Gbj3n.js → multiline-address-rac-BwQOoejw.js} +1 -1
  73. package/dist/component/number-input-field-rac-CRqPXDl0.js +93 -0
  74. package/dist/component/{number-input-rac-Bnsvb-SO.js → number-input-rac-0Y8K4e6K.js} +1 -1
  75. package/dist/component/password-rac-C7F6sEB3.js +143 -0
  76. package/dist/component/payment-input-rac-CTJr4QTK.js +141 -0
  77. package/dist/component/{phone-input-field-rac-Ce_wuE46.js → phone-input-field-rac-jjSmYCI1.js} +5 -5
  78. package/dist/component/{phone-rac-DslINtcH.js → phone-rac-BwSnmgYF.js} +1 -1
  79. package/dist/component/{product-list-rac-C4P_SOyG.js → product-list-rac-CTN2wvHE.js} +7 -7
  80. package/dist/component/{quiz-radio-group-rac-noy4fmD8.js → quiz-radio-group-rac-CZHEDJxr.js} +2 -2
  81. package/dist/component/{radio-button-module-classes-DXQ1UlmI.js → radio-button-module-classes-DCz6XS1X.js} +3 -3
  82. package/dist/component/radio-group-field-rac-60MF_9DO.js +48 -0
  83. package/dist/component/{radio-group-rac-CGHQFyJY.js → radio-group-rac-Dqo-Earp.js} +1 -1
  84. package/dist/component/{rating-input-field-rac-elaferlI.js → rating-input-field-rac-CzWTwWT8.js} +6 -6
  85. package/dist/component/{rating-input-rac-fnOtTKN8.js → rating-input-rac-Nq4tll2Z.js} +1 -1
  86. package/dist/component/{rich-content-rac.module-DbwuwQeo.js → rich-content-rac.module-sUUSbcSy.js} +1 -1
  87. package/dist/component/{rich-text-field-rac-DtcQC8zU.js → rich-text-field-rac-BvLfS4I5.js} +3 -3
  88. package/dist/component/{rich-text-rac-CuT97sby.js → rich-text-rac-BWkTbWk3.js} +1 -1
  89. package/dist/component/{service-dropdown-rac-rk2tzikX.js → service-dropdown-rac-DZ3USe7_.js} +5 -5
  90. package/dist/component/{services-multi-choice-rac-BMQyF_xs.js → services-multi-choice-rac-D-og7fMo.js} +7 -7
  91. package/dist/component/{signature-rac-DeV9C6ta.js → signature-rac-D3c4fnvN.js} +5 -5
  92. package/dist/component/{submit-button-rac-BpN-FYtM.js → submit-button-rac-Dn_BGt1n.js} +2 -2
  93. package/dist/component/tags-field-rac-DXmZBcpO.js +218 -0
  94. package/dist/component/{tags-rac-Dabz4jHd.js → tags-rac-CoXWx42D.js} +1 -1
  95. package/dist/component/text-area-field-rac-Cy0Mr29Z.js +73 -0
  96. package/dist/component/{text-area-rac-CDLF-_56.js → text-area-rac-C3Mjmgpa.js} +1 -1
  97. package/dist/component/text-input-field-rac-D1TB9B_M.js +28 -0
  98. package/dist/component/{text-input-headless-BwVLU9cp.js → text-input-headless-BUa59Rgn.js} +3 -3
  99. package/dist/component/{text-input-rac-CoGTzfo1.js → text-input-rac-BQ3Z9ws4.js} +1 -1
  100. package/dist/component/{time-input-rac-DQDupKTA.js → time-input-rac-Wi0oD5YF.js} +5 -5
  101. package/dist/component/url-input-field-rac-DINXfZdf.js +75 -0
  102. package/dist/component/{url-input-rac-_d6XRdKX.js → url-input-rac-Ch9eTIF_.js} +1 -1
  103. package/dist/component/use-element-state-class-name-j8W1zbdG.js +20 -0
  104. package/dist/component/{use-service-options-base-CRgxxz7b.js → use-service-options-base-BJZhzDyO.js} +1 -1
  105. package/dist/component/use-text-input-class-name-8gMUWeCb.js +24 -0
  106. package/package.json +2 -2
  107. package/dist/component/checkbox-group-field-rac-CZW28rj5.js +0 -41
  108. package/dist/component/field-rac.module-ColNPUt0.js +0 -23
  109. package/dist/component/multiline-address-field-rac-fcQYnPlO.js +0 -1613
  110. package/dist/component/number-input-field-rac-B0-4Rz3w.js +0 -89
  111. package/dist/component/password-rac-BdBjFa8y.js +0 -142
  112. package/dist/component/payment-input-rac-DkAGOvaF.js +0 -137
  113. package/dist/component/radio-group-field-rac-CYBDq7R1.js +0 -47
  114. package/dist/component/tags-field-rac-ByC9DnyH.js +0 -217
  115. package/dist/component/text-area-field-rac-CtSa8XW_.js +0 -69
  116. package/dist/component/text-input-field-rac-C6fQYKhI.js +0 -24
  117. package/dist/component/url-input-field-rac-4T8gcMHH.js +0 -71
  118. package/dist/component/use-element-state-class-name-BqmaTba3.js +0 -15
@@ -0,0 +1,1617 @@
1
+ import { RicosViewer as X } from "@wix/ricos/viewer";
2
+ import L from "classnames";
3
+ import n, { useMemo as w, createContext as Ue, useContext as Se, useState as fe, useRef as B, useCallback as D, useEffect as We } from "react";
4
+ import { UNSAFE_PortalProvider as _t } from "react-aria";
5
+ import { ad as bt, c as ft, a9 as Pt, ab as yt, G as Tt, H as Mt, u as qt, z as V, F as K, as as Te, a2 as st, ai as P, af as T, ak as ae, ae as Ct, Q as wt, C as ve, a0 as xt, a4 as Bt, ap as kt, aj as $t, ao as Ut, a7 as Wt, Y as Vt, a6 as Kt, al as Yt, j as Ht } from "./form-D0eeH0lX.js";
6
+ import { f as E, a as h } from "./find-child-C60k4CxG.js";
7
+ import { F as jt, V as Jt } from "./headless-styles-CmcyA_pi.js";
8
+ import { TextField as ye, Input as le, ComboBoxStateContext as It, ComboBox as De, Popover as Re, ListBox as Ae, ListBoxItem as _e, Group as Lt, Button as Nt } from "react-aria-components";
9
+ import { D as ie, E as ce } from "./field-error-headless-DAy-1oAQ.js";
10
+ import { L as de } from "./field-label-headless-BWxHmO0c.js";
11
+ import { e as Gt, c as Xt, a as zt, r as Ot } from "./isObjectLike-D7Mkqoju.js";
12
+ import { u as Qt } from "./use-invoke-callback-UH73A_J3.js";
13
+ import { C as at } from "./chevron-down-icon-CcpVm6B-.js";
14
+ import { E as z } from "./error-icon-hZxQ6DEy.js";
15
+ import { H as be } from "./custom-focus-class-_483Pkwp.js";
16
+ import { s as y } from "./field-rac.module-D06m9T9x.js";
17
+ import { y as Q, O as Z, x as lt, A as Oe, o as ee, i as te } from "./form-element-classes-Ct1UaxuQ.js";
18
+ import { u as Zt } from "./use-text-input-class-name-8gMUWeCb.js";
19
+ const en = (e, t, r) => {
20
+ var a, l, i, s;
21
+ const o = (a = e.steps) == null ? void 0 : a.map((d) => {
22
+ var m, u, C, I, b, p;
23
+ return {
24
+ ...d,
25
+ layout: {
26
+ ...d.layout,
27
+ large: {
28
+ ...(m = d.layout) == null ? void 0 : m.large,
29
+ items: ((I = (C = (u = d.layout) == null ? void 0 : u.large) == null ? void 0 : C.items) == null ? void 0 : I.map((f) => ({
30
+ ...f,
31
+ row: r.row <= f.row ? (f.row || 0) + 1 : f.row
32
+ }))) || ((p = (b = d.layout) == null ? void 0 : b.large) == null ? void 0 : p.items)
33
+ }
34
+ }
35
+ };
36
+ });
37
+ return (s = (i = (l = o == null ? void 0 : o[0].layout) == null ? void 0 : l.large) == null ? void 0 : i.items) == null || s.unshift(r), {
38
+ ...e,
39
+ fields: [
40
+ t,
41
+ ...e.fields || []
42
+ ],
43
+ steps: o || e.steps
44
+ };
45
+ };
46
+ var Ce = /* @__PURE__ */ (function(e) {
47
+ return e.COUNTRY = "country", e.SUBDIVISION = "subdivision", e.CITY = "city", e.ADDRESS_LINE = "addressLine", e.ADDRESS_LINE_2 = "addressLine2", e.POSTAL_CODE = "postalCode", e.STREET_NAME = "streetName", e.STREET_NUMBER = "streetNumber", e.APARTMENT = "apartment", e;
48
+ })({});
49
+ function tn(e, t, r = !1) {
50
+ const { country: o, subdivision: a, city: l, addressLine: i, streetAddress: s, addressLine2: d, postalCode: m } = e, u = {};
51
+ return t ? (o && (u.country = o), a && (u.subdivision = a), l && (u.city = l), i ? u.addressLine = i : s != null && s.formattedAddressLine && (u.addressLine = s == null ? void 0 : s.formattedAddressLine), d && (u.addressLine = d), m && (u.postalCode = m), s != null && s.apt && (u.apartment = s == null ? void 0 : s.apt), s != null && s.name ? u.streetName = s == null ? void 0 : s.name : r && (s != null && s.formattedAddressLine) && (u.streetName = s == null ? void 0 : s.formattedAddressLine), s != null && s.number && (u.streetNumber = s.number)) : (o && (u.country = o), a && (u.subdivision = a), l && (u.city = l), i ? u.address_line = i : s != null && s.formattedAddressLine && (u.address_line = s == null ? void 0 : s.formattedAddressLine), d && (u.address_line = d), m && (u.postal_code = m), s != null && s.apt && (u.apartment = s == null ? void 0 : s.apt), s != null && s.name ? u.street_name = s == null ? void 0 : s.name : r && (s != null && s.formattedAddressLine) && (u.street_name = s == null ? void 0 : s.formattedAddressLine), s != null && s.number && (u.street_number = s.number)), u;
52
+ }
53
+ const gt = /* @__PURE__ */ Ue({
54
+ onAddressSelect: () => {
55
+ }
56
+ }), nn = ({ children: e, onAddressSelect: t, autocompleteEnabled: r }) => {
57
+ const o = w(() => ({
58
+ onAddressSelect: t,
59
+ autocompleteEnabled: r
60
+ }), [
61
+ t,
62
+ r
63
+ ]);
64
+ return /* @__PURE__ */ n.createElement(gt.Provider, {
65
+ value: o
66
+ }, e);
67
+ };
68
+ function Ie() {
69
+ return Se(gt);
70
+ }
71
+ const vt = /* @__PURE__ */ Ue(void 0), rn = ({ children: e, countryCode: t }) => {
72
+ const r = w(() => ({
73
+ countryCode: t
74
+ }), [
75
+ t
76
+ ]);
77
+ return /* @__PURE__ */ n.createElement(vt.Provider, {
78
+ value: r
79
+ }, e);
80
+ };
81
+ function Le() {
82
+ const e = Se(vt);
83
+ return e == null ? void 0 : e.countryCode;
84
+ }
85
+ function Me(e) {
86
+ return e != null;
87
+ }
88
+ function on(e, t, r) {
89
+ return !t || !r ? e : {
90
+ ...e,
91
+ fields: (e.fields ?? []).map((o) => {
92
+ const { show: a, ...l } = t[o.target] || {}, { required: i } = r[o.target] || {};
93
+ return {
94
+ ...o,
95
+ view: {
96
+ ...o.view,
97
+ ...l
98
+ },
99
+ ...Me(a) && {
100
+ hidden: !a
101
+ },
102
+ ...Me(i) && Me(o.validation) && {
103
+ validation: {
104
+ ...o.validation,
105
+ required: i
106
+ }
107
+ }
108
+ };
109
+ })
110
+ };
111
+ }
112
+ const sn = (e, t) => e.map((r) => ({
113
+ ...r,
114
+ id: ("target" in r ? t[r.target] : void 0) ?? r.id
115
+ })), ht = 12, an = (e) => {
116
+ const t = e.filter((o) => !o.properties.hidden), r = e.filter((o) => o.properties.hidden);
117
+ return {
118
+ visibleFields: t,
119
+ hiddenFields: r
120
+ };
121
+ }, ln = (e) => {
122
+ const t = {};
123
+ return e.forEach((r) => {
124
+ const o = r.layout.row;
125
+ t[o] || (t[o] = []), t[o].push(r);
126
+ }), t;
127
+ }, cn = (e) => {
128
+ const t = {};
129
+ return Object.keys(e).forEach((r) => {
130
+ const o = parseInt(r, 10), a = e[o];
131
+ a.reduce((i, s) => i + s.layout.width, 0) !== ht && (t[o] = a);
132
+ }), t;
133
+ }, dn = (e, t) => e.map((r) => {
134
+ const o = r.layout.row;
135
+ if (t[o] && !r.properties.hidden) {
136
+ const a = t[o], l = a.length, i = ht / l, s = a.findIndex((m) => m.id === r.id), d = i * s;
137
+ return {
138
+ ...r,
139
+ layout: {
140
+ ...r.layout,
141
+ width: i,
142
+ column: d
143
+ }
144
+ };
145
+ }
146
+ return r;
147
+ }), un = (e, t, r) => {
148
+ const o = Math.max(...t.map((a) => a.layout.row), -1);
149
+ return e.map((a) => {
150
+ if (a.properties.hidden) {
151
+ const l = r.findIndex((i) => i.id === a.id);
152
+ return {
153
+ ...a,
154
+ layout: {
155
+ ...a.layout,
156
+ row: o + 1 + l
157
+ }
158
+ };
159
+ }
160
+ return a;
161
+ });
162
+ }, mn = (e) => {
163
+ const { visibleFields: t, hiddenFields: r } = an(e.fields), o = ln(t), a = cn(o), l = dn(e.fields, a), i = un(l, t, r);
164
+ return {
165
+ ...e,
166
+ fields: i
167
+ };
168
+ }, pn = () => ({
169
+ country: V(),
170
+ subdivision: V(),
171
+ city: V(),
172
+ address_line: V(),
173
+ address_line_2: V(),
174
+ postal_code: V(),
175
+ street_name: V(),
176
+ street_number: V(),
177
+ apartment: V()
178
+ }), En = ({ id: e, target: t, fieldType: r, form: o, country: a, fieldSettings: l, validation: i, required: s }) => {
179
+ const [d] = fe(pn), { isExperimentEnabled: m } = bt(), u = m(ft.USE_FIELDS_V2), { getCountryAddressForm: C } = Pt(), { isMobile: I, breakpoint: b } = yt(), p = C(a), f = r === K.MULTILINE_ADDRESS || r === K.BOOKINGS_ADDRESS, N = w(() => {
180
+ var g;
181
+ return Tt(s, (g = i == null ? void 0 : i.predefined) == null ? void 0 : g.multilineAddressOptions);
182
+ }, [
183
+ i,
184
+ s
185
+ ]), F = w(() => Mt(), []);
186
+ return {
187
+ form: w(() => {
188
+ var _, O;
189
+ if (!f || !p)
190
+ return o && {
191
+ ...o,
192
+ fields: sn(o.fields, d)
193
+ };
194
+ const g = qt({
195
+ useFieldsV2: u,
196
+ path: t,
197
+ parentId: e,
198
+ includeHiddenFields: !0,
199
+ isMobile: I,
200
+ breakpoint: b,
201
+ form: on(en(p, N, F), l, (O = (_ = i == null ? void 0 : i.predefined) == null ? void 0 : _.multilineAddressOptions) == null ? void 0 : O.fields)
202
+ });
203
+ if (!g.fields.some((v) => v.properties.hidden))
204
+ return g;
205
+ const M = mn(g);
206
+ return {
207
+ ...M,
208
+ fields: M.fields.filter((v) => !v.properties.hidden)
209
+ };
210
+ }, [
211
+ p,
212
+ o,
213
+ d,
214
+ l,
215
+ i,
216
+ t,
217
+ N,
218
+ F,
219
+ f,
220
+ u,
221
+ e,
222
+ I,
223
+ b
224
+ ]),
225
+ isMultilineAddressField: f
226
+ };
227
+ }, Ft = /* @__PURE__ */ Ue(void 0), bn = ({ children: e, fields: t }) => {
228
+ const r = w(() => ({
229
+ fields: t
230
+ }), [
231
+ t
232
+ ]);
233
+ return /* @__PURE__ */ n.createElement(Ft.Provider, {
234
+ value: r
235
+ }, e);
236
+ };
237
+ function ue(e) {
238
+ const t = Se(Ft);
239
+ if (!t)
240
+ throw new Error("useAddressFields must be used within AddressFieldsProvider");
241
+ return t.fields[e];
242
+ }
243
+ function Ee(e) {
244
+ const { t } = Te(), r = Le(), o = r && st.getCountryByShortKey(r), l = (o ? o.addressPartDisplayNames : st.getDefaultAddressDisplayNames())[e];
245
+ return l ? t(l) : "";
246
+ }
247
+ const ne = ({ children: e }) => {
248
+ const { id: t, value: r, onChange: o, disabled: a, readOnly: l, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u } = P(), { labelId: C } = T(), I = Ee("addressLine2"), b = E(e, ne.Label), p = E(e, ne.Input), f = E(e, ne.Description), N = E(e, ne.Error);
249
+ return /* @__PURE__ */ n.createElement(u, {
250
+ fieldId: t,
251
+ renderLabel: () => h(b, {
252
+ label: I
253
+ }),
254
+ renderInput: () => /* @__PURE__ */ n.createElement(ye, {
255
+ "aria-labelledby": C,
256
+ value: r ?? "",
257
+ onChange: o,
258
+ isDisabled: a,
259
+ isReadOnly: l,
260
+ isRequired: i,
261
+ isInvalid: s,
262
+ onBlur: d,
263
+ onFocus: m
264
+ }, p),
265
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, N, f)
266
+ });
267
+ }, fn = ({ className: e }) => {
268
+ const { id: t, placeholder: r } = P(), { inputId: o, ariaDescribedBy: a } = T(), l = B(null);
269
+ return ae(() => {
270
+ var i;
271
+ (i = l.current) == null || i.focus();
272
+ }, t), /* @__PURE__ */ n.createElement(le, {
273
+ ref: l,
274
+ id: o,
275
+ "aria-describedby": a,
276
+ className: e,
277
+ placeholder: r
278
+ });
279
+ };
280
+ ne.Label = de;
281
+ ne.Input = fn;
282
+ ne.Description = ie;
283
+ ne.Error = ce;
284
+ const Ve = ({ enabled: e }) => {
285
+ const { actions: t } = Ct(), [r, o] = fe(V()), a = D(() => o(V()), []);
286
+ return w(() => {
287
+ const { predict: l, getPlace: i, searchByPostalCode: s } = t ?? {};
288
+ if (!(!e || !l || !i || !s))
289
+ return {
290
+ predict: (d) => l({
291
+ ...d,
292
+ sessionToken: r
293
+ }),
294
+ getPlace: (d) => i({
295
+ ...d,
296
+ sessionToken: r,
297
+ refreshSessionToken: a
298
+ }),
299
+ searchByPostalCode: (d) => s({
300
+ ...d,
301
+ sessionToken: r
302
+ })
303
+ };
304
+ }, [
305
+ e,
306
+ t,
307
+ r,
308
+ a
309
+ ]);
310
+ };
311
+ var qe, it;
312
+ function yn() {
313
+ if (it) return qe;
314
+ it = 1;
315
+ var e = Gt(), t = function() {
316
+ return e.Date.now();
317
+ };
318
+ return qe = t, qe;
319
+ }
320
+ var we, ct;
321
+ function Cn() {
322
+ if (ct) return we;
323
+ ct = 1;
324
+ var e = /\s/;
325
+ function t(r) {
326
+ for (var o = r.length; o-- && e.test(r.charAt(o)); )
327
+ ;
328
+ return o;
329
+ }
330
+ return we = t, we;
331
+ }
332
+ var xe, dt;
333
+ function In() {
334
+ if (dt) return xe;
335
+ dt = 1;
336
+ var e = Cn(), t = /^\s+/;
337
+ function r(o) {
338
+ return o && o.slice(0, e(o) + 1).replace(t, "");
339
+ }
340
+ return xe = r, xe;
341
+ }
342
+ var Be, ut;
343
+ function Ln() {
344
+ if (ut) return Be;
345
+ ut = 1;
346
+ var e = Xt(), t = zt(), r = "[object Symbol]";
347
+ function o(a) {
348
+ return typeof a == "symbol" || t(a) && e(a) == r;
349
+ }
350
+ return Be = o, Be;
351
+ }
352
+ var ke, mt;
353
+ function Nn() {
354
+ if (mt) return ke;
355
+ mt = 1;
356
+ var e = In(), t = Ot(), r = Ln(), o = NaN, a = /^[-+]0x[0-9a-f]+$/i, l = /^0b[01]+$/i, i = /^0o[0-7]+$/i, s = parseInt;
357
+ function d(m) {
358
+ if (typeof m == "number")
359
+ return m;
360
+ if (r(m))
361
+ return o;
362
+ if (t(m)) {
363
+ var u = typeof m.valueOf == "function" ? m.valueOf() : m;
364
+ m = t(u) ? u + "" : u;
365
+ }
366
+ if (typeof m != "string")
367
+ return m === 0 ? m : +m;
368
+ m = e(m);
369
+ var C = l.test(m);
370
+ return C || i.test(m) ? s(m.slice(2), C ? 2 : 8) : a.test(m) ? o : +m;
371
+ }
372
+ return ke = d, ke;
373
+ }
374
+ var $e, pt;
375
+ function On() {
376
+ if (pt) return $e;
377
+ pt = 1;
378
+ var e = Ot(), t = yn(), r = Nn(), o = "Expected a function", a = Math.max, l = Math.min;
379
+ function i(s, d, m) {
380
+ var u, C, I, b, p, f, N = 0, F = !1, S = !1, g = !0;
381
+ if (typeof s != "function")
382
+ throw new TypeError(o);
383
+ d = r(d) || 0, e(m) && (F = !!m.leading, S = "maxWait" in m, I = S ? a(r(m.maxWait) || 0, d) : I, g = "trailing" in m ? !!m.trailing : g);
384
+ function R(A) {
385
+ var J = u, pe = C;
386
+ return u = C = void 0, N = A, b = s.apply(pe, J), b;
387
+ }
388
+ function M(A) {
389
+ return N = A, p = setTimeout(v, d), F ? R(A) : b;
390
+ }
391
+ function _(A) {
392
+ var J = A - f, pe = A - N, Ne = d - J;
393
+ return S ? l(Ne, I - pe) : Ne;
394
+ }
395
+ function O(A) {
396
+ var J = A - f, pe = A - N;
397
+ return f === void 0 || J >= d || J < 0 || S && pe >= I;
398
+ }
399
+ function v() {
400
+ var A = t();
401
+ if (O(A))
402
+ return me(A);
403
+ p = setTimeout(v, _(A));
404
+ }
405
+ function me(A) {
406
+ return p = void 0, g && u ? R(A) : (u = C = void 0, b);
407
+ }
408
+ function x() {
409
+ p !== void 0 && clearTimeout(p), N = 0, u = f = C = p = void 0;
410
+ }
411
+ function q() {
412
+ return p === void 0 ? b : me(t());
413
+ }
414
+ function j() {
415
+ var A = t(), J = O(A);
416
+ if (u = arguments, C = this, f = A, J) {
417
+ if (p === void 0)
418
+ return M(f);
419
+ if (S)
420
+ return clearTimeout(p), p = setTimeout(v, d), R(f);
421
+ }
422
+ return p === void 0 && (p = setTimeout(v, d)), b;
423
+ }
424
+ return j.cancel = x, j.flush = q, j;
425
+ }
426
+ return $e = i, $e;
427
+ }
428
+ var gn = On();
429
+ const vn = /* @__PURE__ */ wt(gn), hn = (e, t, r = 200) => {
430
+ const o = B(e), a = D(vn((...l) => {
431
+ o.current(...l);
432
+ }, r), [
433
+ r
434
+ ]);
435
+ return We(() => {
436
+ o.current = e;
437
+ }, [
438
+ e,
439
+ t
440
+ ]), a;
441
+ }, Fn = () => {
442
+ const e = B(!0);
443
+ return We(() => () => {
444
+ e.current = !1;
445
+ }, []), () => e.current;
446
+ }, Et = {
447
+ loading: !1,
448
+ predictions: []
449
+ }, St = ({ atlas: e, onError: t }) => {
450
+ const [{ loading: o, predictions: a }, l] = fe(Et), i = B(0), s = Fn(), d = D(() => {
451
+ i.current++, l(Et);
452
+ }, []), m = hn(async ({ input: u, countryCodes: C }) => {
453
+ if (!e || !s())
454
+ return;
455
+ if (!u) {
456
+ d();
457
+ return;
458
+ }
459
+ const I = ++i.current;
460
+ l((p) => ({
461
+ ...p,
462
+ loading: !0
463
+ }));
464
+ let b;
465
+ try {
466
+ b = await e.predict({
467
+ input: u,
468
+ countryCodes: C
469
+ });
470
+ } catch (p) {
471
+ t ? t(p) : console.error(p);
472
+ } finally {
473
+ const p = I === i.current;
474
+ s() && p && l((f) => ({
475
+ loading: !1,
476
+ // set new predictions if fetched properly, else keep current predictions
477
+ predictions: b || f.predictions
478
+ }));
479
+ }
480
+ }, [
481
+ e,
482
+ t
483
+ ], 200);
484
+ return {
485
+ predictions: a,
486
+ loading: o,
487
+ updatePredictions: m,
488
+ clearPredictions: d
489
+ };
490
+ }, Ke = ({ optionCount: e }) => {
491
+ const t = Se(It), r = B(t);
492
+ r.current = t;
493
+ const o = B(e);
494
+ return We(() => {
495
+ const a = e > 0 && o.current === 0;
496
+ o.current = e;
497
+ const l = r.current;
498
+ a && (l != null && l.isFocused) && !l.isOpen && l.open(null, "manual");
499
+ }, [
500
+ e
501
+ ]), null;
502
+ }, k = ({ children: e }) => {
503
+ const { id: t, value: r, onChange: o, disabled: a, readOnly: l, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u, autocomplete: C } = P(), { labelId: I } = T(), { autocompleteEnabled: b } = Ie(), p = C || b, f = Ee("addressLine1"), N = E(e, k.Label), F = E(e, k.Input), S = E(e, k.Options), g = E(e, k.Description), R = E(e, k.Error);
504
+ return p ? /* @__PURE__ */ n.createElement(u, {
505
+ fieldId: t,
506
+ renderLabel: () => h(N, {
507
+ label: f
508
+ }),
509
+ renderInput: () => /* @__PURE__ */ n.createElement(Sn, {
510
+ value: r,
511
+ onChange: o,
512
+ disabled: a,
513
+ readOnly: l,
514
+ required: i,
515
+ hasError: s,
516
+ onBlur: d,
517
+ onFocus: m
518
+ }, F, S),
519
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, R, g)
520
+ }) : /* @__PURE__ */ n.createElement(u, {
521
+ fieldId: t,
522
+ renderLabel: () => h(N, {
523
+ label: f
524
+ }),
525
+ renderInput: () => /* @__PURE__ */ n.createElement(ye, {
526
+ "aria-labelledby": I,
527
+ value: r ?? "",
528
+ onChange: o,
529
+ isDisabled: a,
530
+ isReadOnly: l,
531
+ isRequired: i,
532
+ isInvalid: s,
533
+ onBlur: d,
534
+ onFocus: m
535
+ }, F),
536
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, R, g)
537
+ });
538
+ }, Sn = ({ children: e, value: t, onChange: r, disabled: o, readOnly: a, required: l, hasError: i, onBlur: s, onFocus: d }) => {
539
+ const { labelId: m } = T(), { onAddressSelect: u } = Ie(), C = Le(), I = Ve({
540
+ enabled: !0
541
+ }), { predictions: b, updatePredictions: p, clearPredictions: f } = St({
542
+ atlas: I
543
+ }), N = w(() => b.map((O) => ({
544
+ id: O.searchId || "",
545
+ label: O.description || ""
546
+ })), [
547
+ b
548
+ ]), F = D((O) => {
549
+ p({
550
+ input: O,
551
+ countryCodes: C ? [
552
+ C
553
+ ] : void 0
554
+ }), r(O);
555
+ }, [
556
+ r,
557
+ p,
558
+ C
559
+ ]), S = D(async (O) => {
560
+ if (!O)
561
+ return;
562
+ f();
563
+ const v = await (I == null ? void 0 : I.getPlace({
564
+ searchId: String(O)
565
+ }));
566
+ v && u && u(v);
567
+ }, [
568
+ u,
569
+ f,
570
+ I
571
+ ]), g = D(() => {
572
+ f(), s == null || s();
573
+ }, [
574
+ s,
575
+ f
576
+ ]), R = D(() => {
577
+ d == null || d();
578
+ }, [
579
+ d
580
+ ]), M = E(e, k.Input), _ = E(e, k.Options);
581
+ return /* @__PURE__ */ n.createElement(De, {
582
+ "aria-labelledby": m,
583
+ inputValue: t ?? "",
584
+ onInputChange: F,
585
+ value: null,
586
+ onChange: S,
587
+ isDisabled: o,
588
+ isReadOnly: a,
589
+ isRequired: l,
590
+ isInvalid: i,
591
+ onBlur: g,
592
+ onFocus: R,
593
+ allowsCustomValue: !0,
594
+ menuTrigger: "input",
595
+ items: N
596
+ }, h(M, {
597
+ onFocus: R
598
+ }), h(_, {
599
+ options: N
600
+ }), /* @__PURE__ */ n.createElement(Ke, {
601
+ optionCount: N.length
602
+ }));
603
+ }, Dn = ({ className: e, ...t }) => {
604
+ const { id: r, placeholder: o } = P(), { inputId: a, ariaDescribedBy: l } = T(), { onFocus: i } = t, s = B(null);
605
+ return ae(() => {
606
+ var d;
607
+ (d = s.current) == null || d.focus();
608
+ }, r), /* @__PURE__ */ n.createElement(le, {
609
+ ref: s,
610
+ id: a,
611
+ "aria-describedby": l,
612
+ className: e,
613
+ placeholder: o,
614
+ onFocus: i
615
+ });
616
+ }, Ye = ({ children: e, className: t }) => {
617
+ const r = E(e, Ye.Option);
618
+ return /* @__PURE__ */ n.createElement(Re, {
619
+ className: t,
620
+ containerPadding: 0,
621
+ offset: 0
622
+ }, /* @__PURE__ */ n.createElement(Ae, {
623
+ renderEmptyState: () => null
624
+ }, (o) => h(r, {
625
+ id: o.id,
626
+ label: o.label
627
+ })));
628
+ }, Rn = ({ className: e, ...t }) => {
629
+ const { id: r, label: o } = t;
630
+ return /* @__PURE__ */ n.createElement(_e, {
631
+ className: e,
632
+ id: r,
633
+ textValue: o
634
+ }, o);
635
+ };
636
+ Ye.Option = Rn;
637
+ k.Label = de;
638
+ k.Input = Dn;
639
+ k.Options = Ye;
640
+ k.Description = ie;
641
+ k.Error = ce;
642
+ const re = ({ children: e }) => {
643
+ const { id: t, value: r, onChange: o, disabled: a, readOnly: l, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u } = P(), { labelId: C } = T(), { t: I } = Te(), b = I("field.mla-apartment.label"), p = E(e, re.Label), f = E(e, re.Input), N = E(e, re.Description), F = E(e, re.Error);
644
+ return /* @__PURE__ */ n.createElement(u, {
645
+ fieldId: t,
646
+ renderLabel: () => h(p, {
647
+ label: b
648
+ }),
649
+ renderInput: () => /* @__PURE__ */ n.createElement(ye, {
650
+ "aria-labelledby": C,
651
+ value: r ?? "",
652
+ onChange: o,
653
+ isDisabled: a,
654
+ isReadOnly: l,
655
+ isRequired: i,
656
+ isInvalid: s,
657
+ onBlur: d,
658
+ onFocus: m
659
+ }, f),
660
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, F, N)
661
+ });
662
+ }, An = ({ className: e }) => {
663
+ const { id: t, placeholder: r } = P(), { inputId: o, ariaDescribedBy: a } = T(), l = B(null);
664
+ return ae(() => {
665
+ var i;
666
+ (i = l.current) == null || i.focus();
667
+ }, t), /* @__PURE__ */ n.createElement(le, {
668
+ ref: l,
669
+ id: o,
670
+ "aria-describedby": a,
671
+ className: e,
672
+ placeholder: r
673
+ });
674
+ };
675
+ re.Label = de;
676
+ re.Input = An;
677
+ re.Description = ie;
678
+ re.Error = ce;
679
+ const oe = ({ children: e }) => {
680
+ const { id: t, value: r, onChange: o, disabled: a, readOnly: l, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u } = P(), { labelId: C } = T(), I = Ee("city"), b = E(e, oe.Label), p = E(e, oe.Input), f = E(e, oe.Description), N = E(e, oe.Error);
681
+ return /* @__PURE__ */ n.createElement(u, {
682
+ fieldId: t,
683
+ renderLabel: () => h(b, {
684
+ label: I
685
+ }),
686
+ renderInput: () => /* @__PURE__ */ n.createElement(ye, {
687
+ "aria-labelledby": C,
688
+ value: r ?? "",
689
+ onChange: o,
690
+ isDisabled: a,
691
+ isReadOnly: l,
692
+ isRequired: i,
693
+ isInvalid: s,
694
+ onBlur: d,
695
+ onFocus: m
696
+ }, p),
697
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, N, f)
698
+ });
699
+ }, _n = ({ className: e }) => {
700
+ const { id: t, placeholder: r } = P(), { inputId: o, ariaDescribedBy: a } = T(), l = B(null);
701
+ return ae(() => {
702
+ var i;
703
+ (i = l.current) == null || i.focus();
704
+ }, t), /* @__PURE__ */ n.createElement(le, {
705
+ ref: l,
706
+ id: o,
707
+ "aria-describedby": a,
708
+ className: e,
709
+ placeholder: r
710
+ });
711
+ };
712
+ oe.Label = de;
713
+ oe.Input = _n;
714
+ oe.Description = ie;
715
+ oe.Error = ce;
716
+ const Dt = ({ readOnly: e, disabled: t } = {}) => {
717
+ const r = Se(It);
718
+ return D(() => {
719
+ !r || r.isOpen || e || t || r.open(null, "manual");
720
+ }, [
721
+ r,
722
+ e,
723
+ t
724
+ ]);
725
+ }, Pn = (e, t) => e.find((r) => r.label.toLocaleLowerCase() === t.toLocaleLowerCase().trim()), Rt = ({ options: e, value: t, commit: r, clear: o, onBlur: a }) => {
726
+ const [l, i] = fe(null), s = Qt(a), d = w(() => {
727
+ var b;
728
+ return t ? ((b = e.find((p) => p.value === t)) == null ? void 0 : b.label) ?? "" : "";
729
+ }, [
730
+ t,
731
+ e
732
+ ]), m = D((b) => {
733
+ typeof b != "string" || b === "" || b === t || (i(null), r(b));
734
+ }, [
735
+ r,
736
+ t
737
+ ]), u = D((b) => {
738
+ if (i(b), b === "")
739
+ return;
740
+ const p = Pn(e, b);
741
+ p && p.value !== t && r(p.value);
742
+ }, [
743
+ r,
744
+ e,
745
+ t
746
+ ]), C = D((b) => {
747
+ b.key !== "Enter" && b.key !== "Escape" || (i(null), b.key === "Enter" && l === "" && t && o());
748
+ }, [
749
+ l,
750
+ t,
751
+ o
752
+ ]), I = D(() => {
753
+ l === "" && t && o(), i(null), s();
754
+ }, [
755
+ l,
756
+ t,
757
+ o,
758
+ s
759
+ ]);
760
+ return {
761
+ value: t ?? null,
762
+ inputValue: l ?? d,
763
+ onChange: m,
764
+ onInputChange: u,
765
+ onBlur: I,
766
+ onInputKeyDown: C
767
+ };
768
+ }, Y = ({ children: e }) => {
769
+ const { id: t, value: r, onChange: o, disabled: a, readOnly: l, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u, options: C } = P(), { labelId: I } = T(), { t: b } = Te(), { language: p } = yt(), f = w(() => (C || []).reduce((x, q) => (q.value && ve.hasOwnProperty(q.value) && x.push({
770
+ value: q.value,
771
+ label: b(`locale-dataset.countries.${ve[q.value].toUpperCase()}`)
772
+ }), x), []).sort((x, q) => x.label.localeCompare(q.label, p)), [
773
+ C,
774
+ b,
775
+ p
776
+ ]), N = D((x) => o(x), [
777
+ o
778
+ ]), F = D(() => N(""), [
779
+ N
780
+ ]), { onInputKeyDown: S, ...g } = Rt({
781
+ options: f,
782
+ value: r,
783
+ commit: N,
784
+ clear: F,
785
+ onBlur: d
786
+ }), R = Ee("country"), M = E(e, Y.Label), _ = E(e, Y.Control), O = E(e, Y.Options), v = E(e, Y.Description), me = E(e, Y.Error);
787
+ return /* @__PURE__ */ n.createElement(u, {
788
+ fieldId: t,
789
+ renderLabel: () => h(M, {
790
+ label: R
791
+ }),
792
+ renderInput: () => /* @__PURE__ */ n.createElement(De, {
793
+ "aria-labelledby": I,
794
+ ...g,
795
+ isDisabled: a,
796
+ isReadOnly: l,
797
+ isRequired: i,
798
+ isInvalid: s,
799
+ onFocus: m,
800
+ menuTrigger: "input"
801
+ }, h(_, {
802
+ onKeyDown: S
803
+ }), h(O, {
804
+ options: f
805
+ })),
806
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, me, v)
807
+ });
808
+ }, he = ({ children: e, className: t, ...r }) => {
809
+ const { disabled: o, hasError: a } = P(), { onKeyDown: l } = r, i = E(e, he.Input), s = E(e, he.Trigger);
810
+ return /* @__PURE__ */ n.createElement(Lt, {
811
+ className: t,
812
+ isDisabled: o,
813
+ isInvalid: a
814
+ }, h(i, {
815
+ onKeyDown: l
816
+ }), s);
817
+ }, Tn = ({ className: e, ...t }) => {
818
+ const { id: r, placeholder: o, readOnly: a, disabled: l } = P(), { inputId: i, ariaDescribedBy: s } = T(), { onKeyDown: d } = t, m = B(null), u = Dt({
819
+ readOnly: a,
820
+ disabled: l
821
+ });
822
+ return ae(() => {
823
+ var C;
824
+ (C = m.current) == null || C.focus();
825
+ }, r), /* @__PURE__ */ n.createElement(le, {
826
+ ref: m,
827
+ id: i,
828
+ "aria-describedby": s,
829
+ className: e,
830
+ placeholder: o,
831
+ onClick: u,
832
+ onKeyDown: d
833
+ });
834
+ }, Mn = ({ children: e, className: t }) => /* @__PURE__ */ n.createElement(Nt, {
835
+ className: t
836
+ }, e);
837
+ he.Input = Tn;
838
+ he.Trigger = Mn;
839
+ const He = ({ children: e, className: t, ...r }) => {
840
+ const { options: o } = r, a = E(e, He.Option);
841
+ return /* @__PURE__ */ n.createElement(Re, {
842
+ className: t,
843
+ containerPadding: 0,
844
+ offset: 0
845
+ }, /* @__PURE__ */ n.createElement(Ae, null, o.map((l) => h(a, {
846
+ key: l.value,
847
+ value: l.value,
848
+ label: l.label
849
+ }))));
850
+ }, qn = ({ className: e, ...t }) => {
851
+ const { value: r, label: o } = t;
852
+ return /* @__PURE__ */ n.createElement(_e, {
853
+ className: e,
854
+ id: r,
855
+ textValue: o
856
+ }, o);
857
+ };
858
+ He.Option = qn;
859
+ Y.Label = de;
860
+ Y.Control = he;
861
+ Y.Options = He;
862
+ Y.Description = ie;
863
+ Y.Error = ce;
864
+ const wn = /(\d{7})|(\d{3}-\d{4})/;
865
+ function xn(e) {
866
+ var t;
867
+ return (t = e.match(wn)) == null ? void 0 : t[0];
868
+ }
869
+ function Bn({ isAutocompleteEnabled: e }) {
870
+ const t = B({
871
+ hasAddress: !1
872
+ }), r = Ve({
873
+ enabled: e
874
+ });
875
+ return {
876
+ searchByPostalCode: D(async (a) => {
877
+ const l = xn(a);
878
+ if (l) {
879
+ if (t.current.postalCode === l && t.current.hasAddress)
880
+ return t.current.address;
881
+ t.current = {
882
+ postalCode: l,
883
+ address: void 0,
884
+ hasAddress: !1
885
+ };
886
+ try {
887
+ const i = await (r == null ? void 0 : r.searchByPostalCode({
888
+ countryCode: "JP",
889
+ postalCode: l
890
+ }));
891
+ return t.current.hasAddress = !0, t.current.address = void 0, i != null && i.formattedAddress ? (t.current.address = i, i) : void 0;
892
+ } catch (i) {
893
+ console.error(i);
894
+ }
895
+ }
896
+ }, [
897
+ r
898
+ ])
899
+ };
900
+ }
901
+ const $ = ({ children: e }) => {
902
+ const { id: t, value: r, onChange: o, disabled: a, readOnly: l, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u, autocomplete: C } = P(), { labelId: I } = T(), b = Le(), { autocompleteEnabled: p } = Ie(), f = !!(b && ve[b] === ve.JP), N = (C || p) && f, F = Ee("zipCode"), S = E(e, $.Label), g = E(e, $.Control), R = E(e, $.Options), M = E(e, $.Description), _ = E(e, $.Error);
903
+ return N ? /* @__PURE__ */ n.createElement(u, {
904
+ fieldId: t,
905
+ renderLabel: () => h(S, {
906
+ label: F
907
+ }),
908
+ renderInput: () => /* @__PURE__ */ n.createElement(kn, {
909
+ value: r,
910
+ onChange: o,
911
+ disabled: a,
912
+ readOnly: l,
913
+ required: i,
914
+ hasError: s,
915
+ onBlur: d,
916
+ onFocus: m
917
+ }, g, R),
918
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, _, M)
919
+ }) : /* @__PURE__ */ n.createElement(u, {
920
+ fieldId: t,
921
+ renderLabel: () => h(S, {
922
+ label: F
923
+ }),
924
+ renderInput: () => /* @__PURE__ */ n.createElement(ye, {
925
+ "aria-labelledby": I,
926
+ value: r ?? "",
927
+ onChange: o,
928
+ isDisabled: a,
929
+ isReadOnly: l,
930
+ isRequired: i,
931
+ isInvalid: s,
932
+ onBlur: d,
933
+ onFocus: m
934
+ }, g),
935
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, _, M)
936
+ });
937
+ }, kn = ({ children: e, value: t, onChange: r, disabled: o, readOnly: a, required: l, hasError: i, onBlur: s, onFocus: d }) => {
938
+ const { labelId: m } = T(), { onAddressSelect: u } = Ie(), [C, I] = fe(!1), { searchByPostalCode: b } = Bn({
939
+ isAutocompleteEnabled: C
940
+ }), [p, f] = fe(), N = w(() => p ? [
941
+ {
942
+ id: V(),
943
+ label: p.formattedAddress || ""
944
+ }
945
+ ] : [], [
946
+ p
947
+ ]), F = D(async (O) => {
948
+ r(O);
949
+ const v = await b(O ?? "");
950
+ f(v);
951
+ }, [
952
+ r,
953
+ b
954
+ ]), S = D(async (O) => {
955
+ O && (f(void 0), p && u && u(p));
956
+ }, [
957
+ u,
958
+ p
959
+ ]), g = D(() => {
960
+ f(void 0), s == null || s();
961
+ }, [
962
+ s
963
+ ]), R = D(() => {
964
+ I(!0), d == null || d();
965
+ }, [
966
+ d
967
+ ]), M = E(e, $.Control), _ = E(e, $.Options);
968
+ return /* @__PURE__ */ n.createElement(De, {
969
+ "aria-labelledby": m,
970
+ inputValue: t ?? "",
971
+ onInputChange: F,
972
+ value: null,
973
+ onChange: S,
974
+ isDisabled: o,
975
+ isReadOnly: a,
976
+ isRequired: l,
977
+ isInvalid: i,
978
+ onBlur: g,
979
+ onFocus: R,
980
+ allowsCustomValue: !0,
981
+ menuTrigger: "input",
982
+ items: N
983
+ }, h(M, {
984
+ onFocus: R
985
+ }), h(_, {
986
+ options: N
987
+ }), /* @__PURE__ */ n.createElement(Ke, {
988
+ optionCount: N.length
989
+ }));
990
+ }, je = ({ children: e, className: t, ...r }) => {
991
+ const { disabled: o, hasError: a } = P(), { onFocus: l } = r, i = Le(), s = E(e, je.Input);
992
+ return /* @__PURE__ */ n.createElement("div", {
993
+ className: t,
994
+ "data-country": i || void 0,
995
+ "data-disabled": o || void 0,
996
+ "data-invalid": a || void 0
997
+ }, h(s, {
998
+ onFocus: l
999
+ }));
1000
+ }, $n = ({ className: e, ...t }) => {
1001
+ const { id: r, placeholder: o } = P(), { inputId: a, ariaDescribedBy: l } = T(), { onFocus: i } = t, s = B(null);
1002
+ return ae(() => {
1003
+ var d;
1004
+ (d = s.current) == null || d.focus();
1005
+ }, r), /* @__PURE__ */ n.createElement(le, {
1006
+ ref: s,
1007
+ id: a,
1008
+ "aria-describedby": l,
1009
+ className: e,
1010
+ placeholder: o,
1011
+ onFocus: i
1012
+ });
1013
+ }, Je = ({ children: e, className: t }) => {
1014
+ const r = E(e, Je.Option);
1015
+ return /* @__PURE__ */ n.createElement(Re, {
1016
+ className: t,
1017
+ containerPadding: 0,
1018
+ offset: 0
1019
+ }, /* @__PURE__ */ n.createElement(Ae, {
1020
+ renderEmptyState: () => null
1021
+ }, (o) => h(r, {
1022
+ id: o.id,
1023
+ label: o.label
1024
+ })));
1025
+ }, Un = ({ className: e, ...t }) => {
1026
+ const { id: r, label: o } = t;
1027
+ return /* @__PURE__ */ n.createElement(_e, {
1028
+ className: e,
1029
+ id: r,
1030
+ textValue: o
1031
+ }, o);
1032
+ };
1033
+ Je.Option = Un;
1034
+ je.Input = $n;
1035
+ $.Label = de;
1036
+ $.Control = je;
1037
+ $.Options = Je;
1038
+ $.Description = ie;
1039
+ $.Error = ce;
1040
+ const U = ({ children: e }) => {
1041
+ const { id: t, value: r, onChange: o, disabled: a, readOnly: l, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u, autocomplete: C } = P(), { labelId: I } = T(), { autocompleteEnabled: b } = Ie(), p = C || b, f = Ee("streetName"), N = E(e, U.Label), F = E(e, U.Input), S = E(e, U.Options), g = E(e, U.Description), R = E(e, U.Error);
1042
+ return p ? /* @__PURE__ */ n.createElement(u, {
1043
+ fieldId: t,
1044
+ renderLabel: () => h(N, {
1045
+ label: f
1046
+ }),
1047
+ renderInput: () => /* @__PURE__ */ n.createElement(Wn, {
1048
+ value: r,
1049
+ onChange: o,
1050
+ disabled: a,
1051
+ readOnly: l,
1052
+ required: i,
1053
+ hasError: s,
1054
+ onBlur: d,
1055
+ onFocus: m
1056
+ }, F, S),
1057
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, R, g)
1058
+ }) : /* @__PURE__ */ n.createElement(u, {
1059
+ fieldId: t,
1060
+ renderLabel: () => h(N, {
1061
+ label: f
1062
+ }),
1063
+ renderInput: () => /* @__PURE__ */ n.createElement(ye, {
1064
+ "aria-labelledby": I,
1065
+ value: r ?? "",
1066
+ onChange: o,
1067
+ isDisabled: a,
1068
+ isReadOnly: l,
1069
+ isRequired: i,
1070
+ isInvalid: s,
1071
+ onBlur: d,
1072
+ onFocus: m
1073
+ }, F),
1074
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, R, g)
1075
+ });
1076
+ }, Wn = ({ children: e, value: t, onChange: r, disabled: o, readOnly: a, required: l, hasError: i, onBlur: s, onFocus: d }) => {
1077
+ const { labelId: m } = T(), { onAddressSelect: u } = Ie(), C = Le(), I = Ve({
1078
+ enabled: !0
1079
+ }), { predictions: b, updatePredictions: p, clearPredictions: f } = St({
1080
+ atlas: I
1081
+ }), N = E(e, U.Input), F = E(e, U.Options), S = w(() => b.reduce((O, v) => (v.searchId && v.description && O.push({
1082
+ id: v.searchId,
1083
+ label: v.description
1084
+ }), O), []), [
1085
+ b
1086
+ ]), g = D((O) => {
1087
+ p({
1088
+ input: O,
1089
+ countryCodes: C ? [
1090
+ C
1091
+ ] : void 0
1092
+ }), r(O);
1093
+ }, [
1094
+ r,
1095
+ p,
1096
+ C
1097
+ ]), R = D(async (O) => {
1098
+ if (f(), !O)
1099
+ return;
1100
+ const v = await (I == null ? void 0 : I.getPlace({
1101
+ searchId: String(O)
1102
+ }));
1103
+ v && u && u(v);
1104
+ }, [
1105
+ u,
1106
+ f,
1107
+ I
1108
+ ]), M = D(() => {
1109
+ f(), s == null || s();
1110
+ }, [
1111
+ s,
1112
+ f
1113
+ ]), _ = D(() => {
1114
+ d == null || d();
1115
+ }, [
1116
+ d
1117
+ ]);
1118
+ return /* @__PURE__ */ n.createElement(De, {
1119
+ "aria-labelledby": m,
1120
+ inputValue: t ?? "",
1121
+ onInputChange: g,
1122
+ value: null,
1123
+ onChange: R,
1124
+ isDisabled: o,
1125
+ isReadOnly: a,
1126
+ isRequired: l,
1127
+ isInvalid: i,
1128
+ onBlur: M,
1129
+ onFocus: _,
1130
+ allowsCustomValue: !0,
1131
+ menuTrigger: "input",
1132
+ items: S
1133
+ }, h(N, {
1134
+ onFocus: _
1135
+ }), h(F, {
1136
+ options: S
1137
+ }), /* @__PURE__ */ n.createElement(Ke, {
1138
+ optionCount: S.length
1139
+ }));
1140
+ }, Vn = ({ className: e, ...t }) => {
1141
+ const { id: r, placeholder: o } = P(), { inputId: a, ariaDescribedBy: l } = T(), { onFocus: i } = t, s = B(null);
1142
+ return ae(() => {
1143
+ var d;
1144
+ (d = s.current) == null || d.focus();
1145
+ }, r), /* @__PURE__ */ n.createElement(le, {
1146
+ ref: s,
1147
+ id: a,
1148
+ "aria-describedby": l,
1149
+ className: e,
1150
+ placeholder: o,
1151
+ onFocus: i
1152
+ });
1153
+ }, Ge = ({ children: e, className: t }) => {
1154
+ const r = E(e, Ge.Option);
1155
+ return /* @__PURE__ */ n.createElement(Re, {
1156
+ className: t,
1157
+ containerPadding: 0,
1158
+ offset: 0
1159
+ }, /* @__PURE__ */ n.createElement(Ae, {
1160
+ renderEmptyState: () => null
1161
+ }, (o) => h(r, {
1162
+ id: o.id,
1163
+ label: o.label
1164
+ })));
1165
+ }, Kn = ({ className: e, ...t }) => {
1166
+ const { id: r, label: o } = t;
1167
+ return /* @__PURE__ */ n.createElement(_e, {
1168
+ className: e,
1169
+ id: r,
1170
+ textValue: o
1171
+ }, o);
1172
+ };
1173
+ Ge.Option = Kn;
1174
+ U.Label = de;
1175
+ U.Input = Vn;
1176
+ U.Options = Ge;
1177
+ U.Description = ie;
1178
+ U.Error = ce;
1179
+ const se = ({ children: e }) => {
1180
+ const { id: t, value: r, onChange: o, disabled: a, readOnly: l, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u } = P(), { labelId: C } = T(), I = Ee("streetNumber"), b = E(e, se.Label), p = E(e, se.Input), f = E(e, se.Description), N = E(e, se.Error);
1181
+ return /* @__PURE__ */ n.createElement(u, {
1182
+ fieldId: t,
1183
+ renderLabel: () => h(b, {
1184
+ label: I
1185
+ }),
1186
+ renderInput: () => /* @__PURE__ */ n.createElement(ye, {
1187
+ "aria-labelledby": C,
1188
+ value: r ?? "",
1189
+ onChange: o,
1190
+ isDisabled: a,
1191
+ isReadOnly: l,
1192
+ isRequired: i,
1193
+ isInvalid: s,
1194
+ onBlur: d,
1195
+ onFocus: m
1196
+ }, p),
1197
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, N, f)
1198
+ });
1199
+ }, Yn = ({ className: e }) => {
1200
+ const { id: t, placeholder: r } = P(), { inputId: o, ariaDescribedBy: a } = T(), l = B(null);
1201
+ return ae(() => {
1202
+ var i;
1203
+ (i = l.current) == null || i.focus();
1204
+ }, t), /* @__PURE__ */ n.createElement(le, {
1205
+ ref: l,
1206
+ id: o,
1207
+ "aria-describedby": a,
1208
+ className: e,
1209
+ placeholder: r
1210
+ });
1211
+ };
1212
+ se.Label = de;
1213
+ se.Input = Yn;
1214
+ se.Description = ie;
1215
+ se.Error = ce;
1216
+ const H = ({ children: e }) => {
1217
+ const { id: t, value: r, onChange: o, disabled: a, readOnly: l, required: i, hasError: s, onBlur: d, onFocus: m, FieldLayout: u } = P(), { labelId: C } = T(), { t: I } = Te(), b = Le(), p = b ? ve[b] : void 0, f = b && xt.getCountryByShortKey(b), N = w(() => {
1218
+ var q;
1219
+ return (Bt(((q = f == null ? void 0 : f.subdivisions) == null ? void 0 : q.list) || [], p) || []).map((j) => ({
1220
+ value: j.key,
1221
+ label: I(j.displayName)
1222
+ })).sort((j, A) => j.label.localeCompare(A.label));
1223
+ }, [
1224
+ p,
1225
+ I,
1226
+ f
1227
+ ]), F = D(() => o(""), [
1228
+ o
1229
+ ]), { onInputKeyDown: S, ...g } = Rt({
1230
+ options: N,
1231
+ value: r,
1232
+ commit: o,
1233
+ clear: F,
1234
+ onBlur: d
1235
+ }), R = Ee("subdivision"), M = E(e, H.Label), _ = E(e, H.Control), O = E(e, H.Options), v = E(e, H.Description), me = E(e, H.Error);
1236
+ return /* @__PURE__ */ n.createElement(u, {
1237
+ fieldId: t,
1238
+ renderLabel: () => h(M, {
1239
+ label: R
1240
+ }),
1241
+ renderInput: () => /* @__PURE__ */ n.createElement(De, {
1242
+ "aria-labelledby": C,
1243
+ ...g,
1244
+ isDisabled: a,
1245
+ isReadOnly: l,
1246
+ isRequired: i,
1247
+ isInvalid: s,
1248
+ onFocus: m,
1249
+ menuTrigger: "input"
1250
+ }, h(_, {
1251
+ onKeyDown: S
1252
+ }), h(O, {
1253
+ options: N
1254
+ })),
1255
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, me, v)
1256
+ });
1257
+ }, Fe = ({ children: e, className: t, ...r }) => {
1258
+ const { disabled: o, hasError: a } = P(), { onKeyDown: l } = r, i = E(e, Fe.Input), s = E(e, Fe.Trigger);
1259
+ return /* @__PURE__ */ n.createElement(Lt, {
1260
+ className: t,
1261
+ isDisabled: o,
1262
+ isInvalid: a
1263
+ }, h(i, {
1264
+ onKeyDown: l
1265
+ }), s);
1266
+ }, Hn = ({ className: e, ...t }) => {
1267
+ const { id: r, placeholder: o, readOnly: a, disabled: l } = P(), { inputId: i, ariaDescribedBy: s } = T(), { onKeyDown: d } = t, m = B(null), u = Dt({
1268
+ readOnly: a,
1269
+ disabled: l
1270
+ });
1271
+ return ae(() => {
1272
+ var C;
1273
+ (C = m.current) == null || C.focus();
1274
+ }, r), /* @__PURE__ */ n.createElement(le, {
1275
+ ref: m,
1276
+ id: i,
1277
+ "aria-describedby": s,
1278
+ className: e,
1279
+ placeholder: o,
1280
+ onClick: u,
1281
+ onKeyDown: d
1282
+ });
1283
+ }, jn = ({ children: e, className: t }) => /* @__PURE__ */ n.createElement(Nt, {
1284
+ className: t
1285
+ }, e);
1286
+ Fe.Input = Hn;
1287
+ Fe.Trigger = jn;
1288
+ const Xe = ({ children: e, className: t, ...r }) => {
1289
+ const { options: o } = r, a = E(e, Xe.Option);
1290
+ return /* @__PURE__ */ n.createElement(Re, {
1291
+ className: t,
1292
+ containerPadding: 0,
1293
+ offset: 0
1294
+ }, /* @__PURE__ */ n.createElement(Ae, null, o.map((l) => h(a, {
1295
+ key: l.value,
1296
+ value: l.value,
1297
+ label: l.label
1298
+ }))));
1299
+ }, Jn = ({ className: e, ...t }) => {
1300
+ const { value: r, label: o } = t;
1301
+ return /* @__PURE__ */ n.createElement(_e, {
1302
+ className: e,
1303
+ id: r,
1304
+ textValue: o
1305
+ }, o);
1306
+ };
1307
+ Xe.Option = Jn;
1308
+ H.Label = de;
1309
+ H.Control = Fe;
1310
+ H.Options = Xe;
1311
+ H.Description = ie;
1312
+ H.Error = ce;
1313
+ const Gn = () => ue("country"), Xn = () => ue("subdivision"), zn = () => ue("city"), Qn = () => ue("addressLine"), Zn = () => ue("addressLine2"), er = () => ue("postalCode"), tr = () => ue("streetName"), nr = () => ue("streetNumber"), rr = () => ue("apartment"), or = {
1314
+ [K.MLA_COUNTRY]: Gn,
1315
+ [K.MLA_SUBDIVISION]: Xn,
1316
+ [K.MLA_CITY]: zn,
1317
+ [K.MLA_ADDRESS_LINE]: Qn,
1318
+ [K.MLA_ADDRESS_LINE_2]: Zn,
1319
+ [K.MLA_POSTAL_CODE]: er,
1320
+ [K.MLA_STREET_NAME]: tr,
1321
+ [K.MLA_STREET_NUMBER]: nr,
1322
+ [K.MLA_APARTMENT]: rr
1323
+ }, sr = {}, ar = [], c = ({ children: e }) => {
1324
+ const { id: t, form: r, value: o, onChange: a, onFieldBlur: l, onFieldFocus: i, errors: s, FieldLayout: d, fieldSettings: m, label: u, validation: C, target: I, autocompleteEnabled: b, required: p, fieldType: f } = P(), [N, F] = fe(null), S = kt(), g = w(() => ({
1325
+ ...S,
1326
+ ...or
1327
+ }), [
1328
+ S
1329
+ ]), { isExperimentEnabled: R } = bt(), M = R(ft.STREETLESS_LOCALITY_FALLBACK), { validateFields: _ } = $t(), O = Ut(), v = Ct(), me = w(() => ({
1330
+ ...v,
1331
+ actions: {
1332
+ predict: Kt,
1333
+ getPlace: Vt,
1334
+ searchByPostalCode: Wt,
1335
+ ...v.actions
1336
+ }
1337
+ }), [
1338
+ v
1339
+ ]), { form: x, isMultilineAddressField: q } = En({
1340
+ id: t,
1341
+ target: I,
1342
+ fieldType: f,
1343
+ form: r,
1344
+ country: o == null ? void 0 : o.country,
1345
+ fieldSettings: m,
1346
+ validation: C,
1347
+ required: p
1348
+ }), j = D((W) => {
1349
+ if (!o)
1350
+ return;
1351
+ const G = tn(W, q, M), Pe = {
1352
+ ...G,
1353
+ [Ce.COUNTRY]: G[Ce.COUNTRY] ?? o[Ce.COUNTRY]
1354
+ };
1355
+ a == null || a(Pe);
1356
+ }, [
1357
+ a,
1358
+ o,
1359
+ q,
1360
+ M
1361
+ ]), A = D((W, G) => {
1362
+ if (q && W === Ce.COUNTRY && (o == null ? void 0 : o[W]) !== G) {
1363
+ a == null || a({
1364
+ [Ce.COUNTRY]: G
1365
+ });
1366
+ return;
1367
+ }
1368
+ a == null || a({
1369
+ ...o,
1370
+ [W]: G
1371
+ });
1372
+ }, [
1373
+ a,
1374
+ o,
1375
+ q
1376
+ ]), J = D(async (W) => _(q ? [
1377
+ ...W,
1378
+ {
1379
+ path: `${I}/${Ce.COUNTRY}`,
1380
+ value: o == null ? void 0 : o.country
1381
+ }
1382
+ ] : W), [
1383
+ o,
1384
+ I,
1385
+ _,
1386
+ q
1387
+ ]);
1388
+ Yt(t, () => {
1389
+ var Pe;
1390
+ const W = s == null ? void 0 : s[0], G = (Pe = x == null ? void 0 : x.fields) == null ? void 0 : Pe.find((ot) => "target" in ot && ot.target === (W == null ? void 0 : W.errorPath));
1391
+ return G == null ? void 0 : G.id;
1392
+ });
1393
+ const pe = E(e, c.Country), Ne = E(e, c.Subdivision), ze = E(e, c.City), Qe = E(e, c.AddressLine), Ze = E(e, c.AddressLine2), et = E(e, c.PostalCode), tt = E(e, c.StreetName), nt = E(e, c.StreetNumber), rt = E(e, c.Apartment), At = w(() => ({
1394
+ country: pe,
1395
+ subdivision: Ne,
1396
+ city: ze,
1397
+ addressLine: Qe,
1398
+ addressLine2: Ze,
1399
+ postalCode: et,
1400
+ streetName: tt,
1401
+ streetNumber: nt,
1402
+ apartment: rt
1403
+ }), [
1404
+ pe,
1405
+ Ne,
1406
+ ze,
1407
+ Qe,
1408
+ Ze,
1409
+ et,
1410
+ tt,
1411
+ nt,
1412
+ rt
1413
+ ]);
1414
+ return x ? /* @__PURE__ */ n.createElement(d, {
1415
+ fieldId: t
1416
+ }, /* @__PURE__ */ n.createElement(rn, {
1417
+ countryCode: o == null ? void 0 : o.country
1418
+ }, /* @__PURE__ */ n.createElement(nn, {
1419
+ autocompleteEnabled: b,
1420
+ onAddressSelect: j
1421
+ }, /* @__PURE__ */ n.createElement(bn, {
1422
+ fields: At
1423
+ }, /* @__PURE__ */ n.createElement("div", {
1424
+ ref: F,
1425
+ style: {
1426
+ display: "contents"
1427
+ }
1428
+ }), /* @__PURE__ */ n.createElement(_t, {
1429
+ getContainer: () => N
1430
+ }, /* @__PURE__ */ n.createElement("fieldset", {
1431
+ style: jt
1432
+ }, /* @__PURE__ */ n.createElement("legend", {
1433
+ style: Jt
1434
+ }, u), /* @__PURE__ */ n.createElement(Ht, {
1435
+ formSchema: O,
1436
+ form: x,
1437
+ values: o ?? sr,
1438
+ onFieldChange: A,
1439
+ onBlur: l,
1440
+ onFocus: i,
1441
+ errors: s ?? ar,
1442
+ validateFields: J,
1443
+ fields: g,
1444
+ fieldActions: me
1445
+ }))))))) : null;
1446
+ };
1447
+ c.Country = Y;
1448
+ c.Subdivision = H;
1449
+ c.City = oe;
1450
+ c.AddressLine = k;
1451
+ c.AddressLine2 = ne;
1452
+ c.PostalCode = $;
1453
+ c.StreetName = U;
1454
+ c.StreetNumber = se;
1455
+ c.Apartment = re;
1456
+ const lr = "_postalCodeControl_1tire_1", ir = "_comboControl_1tire_5", cr = "_comboTrigger_1tire_19", ge = {
1457
+ postalCodeControl: lr,
1458
+ comboControl: ir,
1459
+ comboTrigger: cr
1460
+ }, Dr = () => {
1461
+ const e = Zt();
1462
+ return /* @__PURE__ */ n.createElement(c, null, /* @__PURE__ */ n.createElement(c.Country, null, /* @__PURE__ */ n.createElement(c.Country.Label, {
1463
+ className: L(Q, y.label)
1464
+ }, /* @__PURE__ */ n.createElement(c.Country.Label.Required, {
1465
+ className: L(Z, y.requiredMark)
1466
+ })), /* @__PURE__ */ n.createElement(c.Country.Control, {
1467
+ className: L(lt, y.input, ge.comboControl)
1468
+ }, /* @__PURE__ */ n.createElement(c.Country.Control.Input, {
1469
+ className: L(y.innerInput, be)
1470
+ }), /* @__PURE__ */ n.createElement(c.Country.Control.Trigger, {
1471
+ className: ge.comboTrigger
1472
+ }, /* @__PURE__ */ n.createElement(at, {
1473
+ className: y.dropdownIcon
1474
+ }))), /* @__PURE__ */ n.createElement(c.Country.Options, {
1475
+ className: L(Oe, y.selectPopover, y.dropdownPopover)
1476
+ }, /* @__PURE__ */ n.createElement(c.Country.Options.Option, {
1477
+ className: L(y.selectOption, be)
1478
+ })), /* @__PURE__ */ n.createElement(c.Country.Error, {
1479
+ className: L(ee, y.error)
1480
+ }, /* @__PURE__ */ n.createElement(z, null), /* @__PURE__ */ n.createElement(c.Country.Error.Text, null)), /* @__PURE__ */ n.createElement(c.Country.Description, {
1481
+ className: L(te, y.description)
1482
+ }, ({ content: t, locale: r }) => /* @__PURE__ */ n.createElement(X, {
1483
+ content: t,
1484
+ locale: r
1485
+ }))), /* @__PURE__ */ n.createElement(c.AddressLine, null, /* @__PURE__ */ n.createElement(c.AddressLine.Label, {
1486
+ className: L(Q, y.label)
1487
+ }, /* @__PURE__ */ n.createElement(c.AddressLine.Label.Required, {
1488
+ className: L(Z, y.requiredMark)
1489
+ })), /* @__PURE__ */ n.createElement(c.AddressLine.Input, {
1490
+ className: e
1491
+ }), /* @__PURE__ */ n.createElement(c.AddressLine.Options, {
1492
+ className: L(Oe, y.selectPopover, y.dropdownPopover)
1493
+ }, /* @__PURE__ */ n.createElement(c.AddressLine.Options.Option, {
1494
+ className: L(y.selectOption, be)
1495
+ })), /* @__PURE__ */ n.createElement(c.AddressLine.Error, {
1496
+ className: L(ee, y.error)
1497
+ }, /* @__PURE__ */ n.createElement(z, null), /* @__PURE__ */ n.createElement(c.AddressLine.Error.Text, null)), /* @__PURE__ */ n.createElement(c.AddressLine.Description, {
1498
+ className: L(te, y.description)
1499
+ }, ({ content: t, locale: r }) => /* @__PURE__ */ n.createElement(X, {
1500
+ content: t,
1501
+ locale: r
1502
+ }))), /* @__PURE__ */ n.createElement(c.AddressLine2, null, /* @__PURE__ */ n.createElement(c.AddressLine2.Label, {
1503
+ className: L(Q, y.label)
1504
+ }, /* @__PURE__ */ n.createElement(c.AddressLine2.Label.Required, {
1505
+ className: L(Z, y.requiredMark)
1506
+ })), /* @__PURE__ */ n.createElement(c.AddressLine2.Input, {
1507
+ className: e
1508
+ }), /* @__PURE__ */ n.createElement(c.AddressLine2.Error, {
1509
+ className: L(ee, y.error)
1510
+ }, /* @__PURE__ */ n.createElement(z, null), /* @__PURE__ */ n.createElement(c.AddressLine2.Error.Text, null)), /* @__PURE__ */ n.createElement(c.AddressLine2.Description, {
1511
+ className: L(te, y.description)
1512
+ }, ({ content: t, locale: r }) => /* @__PURE__ */ n.createElement(X, {
1513
+ content: t,
1514
+ locale: r
1515
+ }))), /* @__PURE__ */ n.createElement(c.City, null, /* @__PURE__ */ n.createElement(c.City.Label, {
1516
+ className: L(Q, y.label)
1517
+ }, /* @__PURE__ */ n.createElement(c.City.Label.Required, {
1518
+ className: L(Z, y.requiredMark)
1519
+ })), /* @__PURE__ */ n.createElement(c.City.Input, {
1520
+ className: e
1521
+ }), /* @__PURE__ */ n.createElement(c.City.Error, {
1522
+ className: L(ee, y.error)
1523
+ }, /* @__PURE__ */ n.createElement(z, null), /* @__PURE__ */ n.createElement(c.City.Error.Text, null)), /* @__PURE__ */ n.createElement(c.City.Description, {
1524
+ className: L(te, y.description)
1525
+ }, ({ content: t, locale: r }) => /* @__PURE__ */ n.createElement(X, {
1526
+ content: t,
1527
+ locale: r
1528
+ }))), /* @__PURE__ */ n.createElement(c.PostalCode, null, /* @__PURE__ */ n.createElement(c.PostalCode.Label, {
1529
+ className: L(Q, y.label)
1530
+ }, /* @__PURE__ */ n.createElement(c.PostalCode.Label.Required, {
1531
+ className: L(Z, y.requiredMark)
1532
+ })), /* @__PURE__ */ n.createElement(c.PostalCode.Control, {
1533
+ className: ge.postalCodeControl
1534
+ }, /* @__PURE__ */ n.createElement(c.PostalCode.Control.Input, {
1535
+ className: e
1536
+ })), /* @__PURE__ */ n.createElement(c.PostalCode.Options, {
1537
+ className: L(Oe, y.selectPopover, y.dropdownPopover)
1538
+ }, /* @__PURE__ */ n.createElement(c.PostalCode.Options.Option, {
1539
+ className: L(y.selectOption, be)
1540
+ })), /* @__PURE__ */ n.createElement(c.PostalCode.Error, {
1541
+ className: L(ee, y.error)
1542
+ }, /* @__PURE__ */ n.createElement(z, null), /* @__PURE__ */ n.createElement(c.PostalCode.Error.Text, null)), /* @__PURE__ */ n.createElement(c.PostalCode.Description, {
1543
+ className: L(te, y.description)
1544
+ }, ({ content: t, locale: r }) => /* @__PURE__ */ n.createElement(X, {
1545
+ content: t,
1546
+ locale: r
1547
+ }))), /* @__PURE__ */ n.createElement(c.Subdivision, null, /* @__PURE__ */ n.createElement(c.Subdivision.Label, {
1548
+ className: L(Q, y.label)
1549
+ }, /* @__PURE__ */ n.createElement(c.Subdivision.Label.Required, {
1550
+ className: L(Z, y.requiredMark)
1551
+ })), /* @__PURE__ */ n.createElement(c.Subdivision.Control, {
1552
+ className: L(lt, y.input, ge.comboControl)
1553
+ }, /* @__PURE__ */ n.createElement(c.Subdivision.Control.Input, {
1554
+ className: L(y.innerInput, be)
1555
+ }), /* @__PURE__ */ n.createElement(c.Subdivision.Control.Trigger, {
1556
+ className: ge.comboTrigger
1557
+ }, /* @__PURE__ */ n.createElement(at, {
1558
+ className: y.dropdownIcon
1559
+ }))), /* @__PURE__ */ n.createElement(c.Subdivision.Options, {
1560
+ className: L(Oe, y.selectPopover, y.dropdownPopover)
1561
+ }, /* @__PURE__ */ n.createElement(c.Subdivision.Options.Option, {
1562
+ className: L(y.selectOption, be)
1563
+ })), /* @__PURE__ */ n.createElement(c.Subdivision.Error, {
1564
+ className: L(ee, y.error)
1565
+ }, /* @__PURE__ */ n.createElement(z, null), /* @__PURE__ */ n.createElement(c.Subdivision.Error.Text, null)), /* @__PURE__ */ n.createElement(c.Subdivision.Description, {
1566
+ className: L(te, y.description)
1567
+ }, ({ content: t, locale: r }) => /* @__PURE__ */ n.createElement(X, {
1568
+ content: t,
1569
+ locale: r
1570
+ }))), /* @__PURE__ */ n.createElement(c.StreetName, null, /* @__PURE__ */ n.createElement(c.StreetName.Label, {
1571
+ className: L(Q, y.label)
1572
+ }, /* @__PURE__ */ n.createElement(c.StreetName.Label.Required, {
1573
+ className: L(Z, y.requiredMark)
1574
+ })), /* @__PURE__ */ n.createElement(c.StreetName.Input, {
1575
+ className: e
1576
+ }), /* @__PURE__ */ n.createElement(c.StreetName.Options, {
1577
+ className: L(Oe, y.selectPopover, y.dropdownPopover)
1578
+ }, /* @__PURE__ */ n.createElement(c.StreetName.Options.Option, {
1579
+ className: L(y.selectOption, be)
1580
+ })), /* @__PURE__ */ n.createElement(c.StreetName.Error, {
1581
+ className: L(ee, y.error)
1582
+ }, /* @__PURE__ */ n.createElement(z, null), /* @__PURE__ */ n.createElement(c.StreetName.Error.Text, null)), /* @__PURE__ */ n.createElement(c.StreetName.Description, {
1583
+ className: L(te, y.description)
1584
+ }, ({ content: t, locale: r }) => /* @__PURE__ */ n.createElement(X, {
1585
+ content: t,
1586
+ locale: r
1587
+ }))), /* @__PURE__ */ n.createElement(c.StreetNumber, null, /* @__PURE__ */ n.createElement(c.StreetNumber.Label, {
1588
+ className: L(Q, y.label)
1589
+ }, /* @__PURE__ */ n.createElement(c.StreetNumber.Label.Required, {
1590
+ className: L(Z, y.requiredMark)
1591
+ })), /* @__PURE__ */ n.createElement(c.StreetNumber.Input, {
1592
+ className: e
1593
+ }), /* @__PURE__ */ n.createElement(c.StreetNumber.Error, {
1594
+ className: L(ee, y.error)
1595
+ }, /* @__PURE__ */ n.createElement(z, null), /* @__PURE__ */ n.createElement(c.StreetNumber.Error.Text, null)), /* @__PURE__ */ n.createElement(c.StreetNumber.Description, {
1596
+ className: L(te, y.description)
1597
+ }, ({ content: t, locale: r }) => /* @__PURE__ */ n.createElement(X, {
1598
+ content: t,
1599
+ locale: r
1600
+ }))), /* @__PURE__ */ n.createElement(c.Apartment, null, /* @__PURE__ */ n.createElement(c.Apartment.Label, {
1601
+ className: L(Q, y.label)
1602
+ }, /* @__PURE__ */ n.createElement(c.Apartment.Label.Required, {
1603
+ className: L(Z, y.requiredMark)
1604
+ })), /* @__PURE__ */ n.createElement(c.Apartment.Input, {
1605
+ className: e
1606
+ }), /* @__PURE__ */ n.createElement(c.Apartment.Error, {
1607
+ className: L(ee, y.error)
1608
+ }, /* @__PURE__ */ n.createElement(z, null), /* @__PURE__ */ n.createElement(c.Apartment.Error.Text, null)), /* @__PURE__ */ n.createElement(c.Apartment.Description, {
1609
+ className: L(te, y.description)
1610
+ }, ({ content: t, locale: r }) => /* @__PURE__ */ n.createElement(X, {
1611
+ content: t,
1612
+ locale: r
1613
+ }))));
1614
+ };
1615
+ export {
1616
+ Dr as M
1617
+ };