@saasquatch/mint-components 2.3.0-6 → 2.3.0-8

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 (67) hide show
  1. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +50 -743
  2. package/dist/cjs/sqm-big-stat_47.cjs.entry.js +4 -4
  3. package/dist/cjs/sqm-email-verification_2.cjs.entry.js +16 -31
  4. package/dist/cjs/sqm-stencilbook.cjs.entry.js +253 -76
  5. package/dist/cjs/sqm-user-info-form-view-374a3f01.js +1427 -0
  6. package/dist/cjs/subregions-984e30d7.js +1505 -0
  7. package/dist/cjs/{useIndirectTaxForm-c3c1ec56.js → useIndirectTaxForm-112914a0.js} +5 -5
  8. package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +16 -31
  9. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +2 -0
  10. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/PayoutDetailsCard.stories.js +6 -0
  11. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card-view.js +13 -2
  12. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/TaxAndCashDashboardView.stories.js +151 -0
  13. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +18 -7
  14. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +22 -19
  15. package/dist/collection/components/tax-and-cash/utils.js +55 -0
  16. package/dist/esm/sqm-banking-info-form_10.entry.js +38 -731
  17. package/dist/esm/sqm-big-stat_47.entry.js +2 -2
  18. package/dist/esm/sqm-email-verification_2.entry.js +16 -31
  19. package/dist/esm/sqm-stencilbook.entry.js +217 -40
  20. package/dist/esm/sqm-user-info-form-view-5322525c.js +1421 -0
  21. package/dist/esm/subregions-7c9778d0.js +1492 -0
  22. package/dist/esm/{useIndirectTaxForm-b2888ea5.js → useIndirectTaxForm-a6ac7e7e.js} +1 -1
  23. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  24. package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
  25. package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
  26. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  27. package/dist/esm-es5/sqm-user-info-form-view-5322525c.js +1 -0
  28. package/dist/esm-es5/subregions-7c9778d0.js +1 -0
  29. package/dist/esm-es5/{useIndirectTaxForm-b2888ea5.js → useIndirectTaxForm-a6ac7e7e.js} +1 -1
  30. package/dist/mint-components/mint-components.esm.js +1 -1
  31. package/dist/mint-components/p-1f387c7b.system.js +1 -1
  32. package/dist/mint-components/{p-abe9f5b1.js → p-2d4132fb.js} +4 -4
  33. package/dist/mint-components/{p-e7f09044.entry.js → p-459c4251.entry.js} +6 -31
  34. package/dist/mint-components/p-5623f1e0.js +1 -0
  35. package/dist/mint-components/{p-b419f9ac.entry.js → p-5bc707cf.entry.js} +1 -1
  36. package/dist/mint-components/p-6eebbc59.entry.js +83 -0
  37. package/dist/mint-components/{p-58c24352.system.js → p-6ef373ed.system.js} +1 -1
  38. package/dist/mint-components/p-7a4cf6c9.system.entry.js +1 -0
  39. package/dist/mint-components/p-7f29622d.js +1 -0
  40. package/dist/mint-components/{p-a38eece5.system.entry.js → p-8a08cec6.system.entry.js} +1 -1
  41. package/dist/mint-components/p-90200f08.system.entry.js +1 -0
  42. package/dist/mint-components/p-91295327.entry.js +9 -0
  43. package/dist/mint-components/p-b21c53cb.system.entry.js +1 -0
  44. package/dist/mint-components/p-bd03efe0.system.js +1 -0
  45. package/dist/mint-components/p-c13c20b2.system.js +1 -0
  46. package/dist/types/components/sqm-partner-info-modal/usePartnerInfoModal.d.ts +0 -1
  47. package/dist/types/components/tax-and-cash/sqm-payout-details-card/PayoutDetailsCard.stories.d.ts +1 -0
  48. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/TaxAndCashDashboardView.stories.d.ts +19 -0
  49. package/dist/types/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.d.ts +1 -0
  50. package/dist/types/components/tax-and-cash/utils.d.ts +5 -0
  51. package/docs/docs.docx +0 -0
  52. package/package.json +1 -1
  53. package/dist/cjs/sqm-user-info-form-view-0e1ddbe4.js +0 -1682
  54. package/dist/cjs/utils-a3b3d05b.js +0 -478
  55. package/dist/esm/sqm-user-info-form-view-e1ba6009.js +0 -1677
  56. package/dist/esm/utils-4f5cd04c.js +0 -467
  57. package/dist/esm-es5/sqm-user-info-form-view-e1ba6009.js +0 -1
  58. package/dist/esm-es5/utils-4f5cd04c.js +0 -1
  59. package/dist/mint-components/p-12d11abc.system.entry.js +0 -1
  60. package/dist/mint-components/p-1e6a2945.js +0 -1
  61. package/dist/mint-components/p-88e427ac.system.entry.js +0 -1
  62. package/dist/mint-components/p-a0eb0331.entry.js +0 -9
  63. package/dist/mint-components/p-b222bace.system.entry.js +0 -1
  64. package/dist/mint-components/p-b96ed8eb.js +0 -1
  65. package/dist/mint-components/p-cdabd9de.system.js +0 -1
  66. package/dist/mint-components/p-ebc519bc.system.js +0 -1
  67. package/dist/mint-components/p-ffcebe78.entry.js +0 -83
@@ -0,0 +1,1427 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index-8277cbb3.js');
4
+ const global = require('./global-b7b1b8fe.js');
5
+ const JSS = require('./JSS-8503a151.js');
6
+ const subregions = require('./subregions-984e30d7.js');
7
+ const data = require('./data-89ac73dd.js');
8
+
9
+ const style = {
10
+ Description: {
11
+ fontSize: "var(--sl-font-size-small)",
12
+ marginTop: "var(--sl-spacing-small)",
13
+ margin: "0 0 var(--sl-spacing-large)",
14
+ color: "var(--sqm-text-subdued)",
15
+ },
16
+ Header: {
17
+ fontSize: "var(--sl-font-size-large)",
18
+ fontWeight: "var(-sl-font-weight-semibold)",
19
+ margin: "0 0 var(--sl-spacing-xxx-small)",
20
+ },
21
+ Container: {},
22
+ InvoiceTableContaier: {
23
+ "& sl-details::part(base)": {
24
+ border: "none",
25
+ },
26
+ "& sl-details::part(content)": {
27
+ padding: 0,
28
+ },
29
+ "& sl-details::part(header)": {
30
+ fontSize: "var(--sl-font-size-medium)",
31
+ padding: "0px",
32
+ },
33
+ "& sl-details::part(summary)": {
34
+ fontWeight: "var(-sl-font-weight-semibold)",
35
+ },
36
+ "& sl-details::part(summary-icon)": {
37
+ marginRight: "100%",
38
+ marginLeft: "var(--sl-spacing-x-small)",
39
+ transform: "rotate(90deg)",
40
+ },
41
+ "& sl-details[open]::part(summary-icon)": {
42
+ transform: "rotate(270deg)",
43
+ },
44
+ },
45
+ };
46
+ function InvoiceTableView(props, children) {
47
+ const sheet = JSS.createStyleSheet(style);
48
+ const styleString = sheet.toString();
49
+ const vanillaStyle = `
50
+ :host{
51
+ display: block;
52
+ }`;
53
+ return (index.h("div", { class: sheet.classes.Container },
54
+ index.h("style", { type: "text/css" },
55
+ vanillaStyle,
56
+ styleString),
57
+ index.h("div", { class: sheet.classes.InvoiceTableContaier },
58
+ index.h("sl-details", { summary: props.header },
59
+ index.h("p", { class: sheet.classes.Description }, props.description),
60
+ children))));
61
+ }
62
+
63
+ const style$1 = {
64
+ ErrorAlertContainer: {
65
+ "&::part(base)": {
66
+ backgroundColor: "var(--sl-color-red-100)",
67
+ borderTop: "none",
68
+ },
69
+ },
70
+ WarningAlertContainer: {
71
+ "&::part(base)": {
72
+ backgroundColor: "var(--sl-color-yellow-100)",
73
+ borderTop: "none",
74
+ maxWidth: "600px",
75
+ },
76
+ },
77
+ WarningHoldAlertContainer: {
78
+ marginLeft: "-20px",
79
+ "&::part(base)": {
80
+ maxWidth: "850px",
81
+ border: "none",
82
+ backgroundColor: "transparent",
83
+ color: "var(--sqm-text)",
84
+ },
85
+ "& sl-icon::part(base)": {
86
+ color: "var(--sqm-warning-color-icon)",
87
+ },
88
+ },
89
+ ErrorHoldAlertContainer: {
90
+ marginLeft: "-20px",
91
+ "&::part(base)": {
92
+ maxWidth: "850px",
93
+ border: "none",
94
+ backgroundColor: "transparent",
95
+ color: "var(--sqm-text)",
96
+ },
97
+ "& sl-icon::part(base)": {
98
+ color: "var(--sqm-danger-color-icon)",
99
+ },
100
+ },
101
+ ExpiringSoonAlertContainer: {
102
+ "&::part(base)": {
103
+ backgroundColor: "var(--sl-color-yellow-100)",
104
+ borderTop: "none",
105
+ },
106
+ },
107
+ BankingInformationContainer: {
108
+ maxWidth: "700px",
109
+ },
110
+ IndirectTaxPreviewContainer: {
111
+ marginTop: "var(--sl-spacing-x-large)",
112
+ borderTop: "1px solid var(--sl-color-neutral-200)",
113
+ },
114
+ IndirectTaxPreviewHeaderContainer: {
115
+ marginTop: "var(--sl-spacing-large)",
116
+ marginBottom: "var(--sl-spacing-xx-small)",
117
+ margin: "0",
118
+ display: "flex",
119
+ alignItems: "center",
120
+ gap: "var(--sl-spacing-x-small)",
121
+ "&::part(base)": {
122
+ color: "var(--sqm-text)",
123
+ },
124
+ },
125
+ IndirectTaxPreviewDetails: {
126
+ gap: "var(--sl-spacing-x-small)",
127
+ display: "flex",
128
+ flexDirection: "column",
129
+ lineHeight: "var(--sl-spacing-medium)",
130
+ fontSize: "var(--sl-font-size-small)",
131
+ color: "var(--sqm-text-subdued)",
132
+ },
133
+ InvoiceTableContainer: {
134
+ marginTop: "var(--sl-spacing-medium)",
135
+ },
136
+ NotRegisteredIndirectTaxText: {
137
+ color: "var(--sqm-text-subdued)",
138
+ },
139
+ TaxDocumentsContainer: {
140
+ marginTop: "var(--sl-spacing-xx-large)",
141
+ borderTop: "1px solid var(--sl-color-neutral-200)",
142
+ },
143
+ TaxDocumentsSectionHeaderContainer: {
144
+ marginTop: "var(--sl-spacing-x-large)",
145
+ marginBottom: "var(--sl-spacing-xx-small)",
146
+ },
147
+ StatusContainer: {
148
+ marginTop: "var(--sl-spacing-x-large)",
149
+ display: "flex",
150
+ flexDirection: "column",
151
+ gap: "var(--sl-spacing-x-small)",
152
+ "& h3": {
153
+ margin: "0",
154
+ },
155
+ "& p": {
156
+ margin: "0",
157
+ paddingTop: "2px",
158
+ },
159
+ },
160
+ StatusAlert: {
161
+ fontSize: "var(--sl-font-size-small)",
162
+ },
163
+ TaxFormDetailsContainer: {
164
+ display: "flex",
165
+ gap: "var(--sl-spacing-small)",
166
+ alignItems: "center",
167
+ },
168
+ NewFormButton: {
169
+ marginTop: "var(--sl-spacing-large)",
170
+ maxWidth: "300px",
171
+ },
172
+ EditBankDetailsButton: {
173
+ marginTop: "var(--sl-spacing-large)",
174
+ },
175
+ TaxSectionSkeletonContainer: {
176
+ display: "flex",
177
+ flexDirection: "column",
178
+ marginTop: "var(--sl-spacing-x-large)",
179
+ },
180
+ TaxDocSubtext: {
181
+ margin: "0",
182
+ color: "var(--sqm-text-subdued)",
183
+ lineHeight: "var(--sl-spacing-medium)",
184
+ fontSize: "var(--sl-font-size-small)",
185
+ marginLeft: "1px",
186
+ },
187
+ TooltipContainer: {
188
+ display: "flex",
189
+ textAlign: "center",
190
+ width: "250px",
191
+ "&::part(body)": {
192
+ pointerEvents: "auto",
193
+ },
194
+ },
195
+ ToolTip: {
196
+ top: "6px",
197
+ width: "16px",
198
+ height: "16px",
199
+ },
200
+ TaxNumberContainer: {
201
+ display: "flex",
202
+ flexDirection: "column",
203
+ gap: "6px",
204
+ },
205
+ DescriptionText: {
206
+ color: "var(--sqm-text-subdued)",
207
+ fontSize: "var(--sl-font-size-x-small)",
208
+ marginBottom: "none",
209
+ maxWidth: "492px",
210
+ },
211
+ PageDescriptionText: {
212
+ color: "var(--sqm-text-subdued)",
213
+ fontSize: "var(--sl-font-size-medium)",
214
+ marginTop: "0",
215
+ },
216
+ Dialog: {
217
+ "&::part(panel)": {
218
+ maxWidth: "420px",
219
+ },
220
+ "&::part(close-button)": {
221
+ marginBottom: "var(--sl-spacing-xx-large)",
222
+ },
223
+ "&::part(title)": {
224
+ fontSize: "var(--sl-font-size-x-large)",
225
+ fontWeight: "600",
226
+ marginTop: "var(--sl-spacing-xxx-large)",
227
+ padding: "var(--sl-spacing-x-large) var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)",
228
+ },
229
+ "&::part(body)": {
230
+ padding: "0 var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)",
231
+ fontSize: "var(--sl-font-size-small)",
232
+ },
233
+ "&::part(footer)": {
234
+ display: "flex",
235
+ flexDirection: "column",
236
+ gap: "var(--sl-spacing-small)",
237
+ marginBottom: "var(--sl-spacing-xx-small)",
238
+ alignItems: "center",
239
+ flex: "1",
240
+ },
241
+ },
242
+ DialogButton: { margin: "auto", width: "100%" },
243
+ SuccessBadge: {
244
+ "&::part(base)": {
245
+ textAlign: "center",
246
+ whiteSpace: "pre-line",
247
+ background: "var(--sqm-success-color-icon)",
248
+ },
249
+ },
250
+ WarningBadge: {
251
+ "&::part(base)": {
252
+ textAlign: "center",
253
+ whiteSpace: "pre-line",
254
+ background: "var(--sqm-warning-color-icon)",
255
+ },
256
+ },
257
+ ErrorBadge: {
258
+ "&::part(base)": {
259
+ textAlign: "center",
260
+ whiteSpace: "pre-line",
261
+ background: "var(--sqm-danger-color-icon)",
262
+ },
263
+ },
264
+ SubduedText: {
265
+ color: "var(--sqm-text-subdued)",
266
+ },
267
+ ButtonContainer: {
268
+ display: "flex",
269
+ gap: "var(--sl-spacing-medium)",
270
+ flexWrap: "wrap",
271
+ },
272
+ DropdownTooltipContainer: {
273
+ top: "-4px",
274
+ "&::part(panel)": {
275
+ boxShadow: "none",
276
+ border: "none",
277
+ marginTop: "var(--sl-spacing-x-small)",
278
+ },
279
+ },
280
+ DropdownContent: {
281
+ padding: "var(--sl-spacing-xxx-small) var(--sl-spacing-x-small)",
282
+ fontSize: "var(--sl-font-size-small)",
283
+ fontFamily: "var(--sl-font-sans)",
284
+ fontWeight: "var(--sl-font-weight-normal)",
285
+ lineHeight: "var(--sl-line-height-dense)",
286
+ minWidth: "225px",
287
+ backgroundColor: "var(--sl-color-gray-900)",
288
+ color: "var(--sl-color-white)",
289
+ borderRadius: "var(--sl-border-radius-medium)",
290
+ position: "relative",
291
+ marginLeft: "5px",
292
+ },
293
+ DropdownArrow: {
294
+ position: "absolute",
295
+ left: "-5px",
296
+ top: "50%",
297
+ transform: "translateY(-50%)",
298
+ width: "0",
299
+ height: "0",
300
+ borderTop: "5px solid transparent",
301
+ borderBottom: "5px solid transparent",
302
+ borderRight: "5px solid var(--sl-color-gray-900)",
303
+ zIndex: "1",
304
+ },
305
+ DropdownLink: {
306
+ color: "var(--sl-color-white)",
307
+ textDecoration: "underline",
308
+ },
309
+ };
310
+ const sheet = JSS.createStyleSheet(style$1);
311
+ const styleString = sheet.toString();
312
+ const vanillaStyle = `
313
+ :host{
314
+ display: block;
315
+ }
316
+
317
+ sl-button[type="secondary"]::part(base) {
318
+ font-family: var(--sqm-primary-font);
319
+ background-color: var(--sqm-secondary-button-background);
320
+ color: var(--sqm-secondary-button-color);
321
+ border-color: var(--sqm-secondary-button-color-border);
322
+ border-radius: var(--sqm-secondary-button-radius);
323
+ }
324
+
325
+ sl-button[type="secondary"]::part(base):hover {
326
+ background-color: var(--sqm-secondary-button-background-hover);
327
+ color: var(--sqm-secondary-button-color-hover);
328
+ border-color: var(--sqm-secondary-button-border-color-hover);
329
+ }
330
+
331
+ `;
332
+ const TaxAndCashDashboardView = (props) => {
333
+ var _a;
334
+ const { states, text, callbacks, slots } = props;
335
+ function getAlert(status) {
336
+ switch (status) {
337
+ case "OVER_W9_THRESHOLD":
338
+ if (states.enforceUsTaxComplianceOption === "CASH_ONLY_DEFER_W9") {
339
+ return {
340
+ header: text.w9RequiredHeader,
341
+ description: global.intl.formatMessage({
342
+ id: "w9RequiredDescription",
343
+ defaultMessage: text.w9RequiredDescription,
344
+ }, {
345
+ termsAndConditions: (index.h("a", { target: "_blank", href: `https://terms.advocate.impact.com/PayoutTermsAndConditions.html` }, text.termsAndConditions)),
346
+ }),
347
+ button: (index.h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", onClick: callbacks.onNewFormClick }, text.w9RequiredButtonText)),
348
+ alertType: "warning",
349
+ icon: "info-circle",
350
+ class: sheet.classes.WarningHoldAlertContainer,
351
+ };
352
+ }
353
+ else {
354
+ return {
355
+ header: text.payoutHoldAlertHeader,
356
+ description: global.intl.formatMessage({
357
+ id: "payoutHoldAlertDescription",
358
+ defaultMessage: text.payoutHoldAlertDescription,
359
+ }, {
360
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
361
+ }),
362
+ buttonText: null,
363
+ alertType: "warning",
364
+ icon: "exclamation-triangle",
365
+ class: sheet.classes.WarningHoldAlertContainer,
366
+ };
367
+ }
368
+ case "VERIFICATION:REQUIRED":
369
+ return {
370
+ header: text.verificationRequiredHeader,
371
+ description: global.intl.formatMessage({
372
+ id: "verificationRequiredDescription",
373
+ defaultMessage: text.verificationRequiredDescription,
374
+ }, {
375
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
376
+ }),
377
+ buttonText: text.verificationRequiredButtonText,
378
+ alertType: "warning",
379
+ icon: "exclamation-triangle",
380
+ class: sheet.classes.WarningHoldAlertContainer,
381
+ };
382
+ case "VERIFICATION:INTERNAL":
383
+ return {
384
+ header: text.verificationRequiredInternalHeader,
385
+ description: global.intl.formatMessage({
386
+ id: "verificationRequiredInternalDescription",
387
+ defaultMessage: text.verificationRequiredInternalDescription,
388
+ }, {
389
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
390
+ }),
391
+ alertType: "warning",
392
+ icon: "exclamation-triangle",
393
+ class: sheet.classes.WarningHoldAlertContainer,
394
+ };
395
+ case "VERIFICATION:REVIEW":
396
+ return {
397
+ header: text.verificationReviewInternalHeader,
398
+ description: global.intl.formatMessage({
399
+ id: "verificationReviewInternalDescription",
400
+ defaultMessage: text.verificationReviewInternalDescription,
401
+ }, {
402
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
403
+ }),
404
+ alertType: "warning",
405
+ icon: "exclamation-triangle",
406
+ class: sheet.classes.WarningHoldAlertContainer,
407
+ };
408
+ case "VERIFICATION:FAILED":
409
+ return {
410
+ header: text.verificationFailedInternalHeader,
411
+ description: global.intl.formatMessage({
412
+ id: "verificationFailedInternalDescription",
413
+ defaultMessage: text.verificationFailedInternalDescription,
414
+ }, {
415
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
416
+ }),
417
+ alertType: "error",
418
+ icon: "exclamation-octagon",
419
+ class: sheet.classes.ErrorHoldAlertContainer,
420
+ };
421
+ case "NEW_PAYEE_REVIEW":
422
+ return {
423
+ header: text.accountReviewHeader,
424
+ description: global.intl.formatMessage({
425
+ id: "accountReviewDescription",
426
+ defaultMessage: text.accountReviewDescription,
427
+ }, {
428
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
429
+ }),
430
+ buttonText: null,
431
+ alertType: "warning",
432
+ icon: "exclamation-triangle",
433
+ class: sheet.classes.WarningHoldAlertContainer,
434
+ };
435
+ case "PAYMENT_HOLD_ON_CHANGE":
436
+ return {
437
+ header: text.paymentHoldOnChangeHeader,
438
+ description: global.intl.formatMessage({
439
+ id: "accountReviewDescription",
440
+ defaultMessage: text.paymentHoldOnChangeDescription,
441
+ }, {
442
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
443
+ }),
444
+ buttonText: null,
445
+ alertType: "warning",
446
+ icon: "exclamation-triangle",
447
+ class: sheet.classes.WarningHoldAlertContainer,
448
+ };
449
+ case "BENEFICIARY_NAME_INVALID":
450
+ return {
451
+ header: text.beneficiaryNameInvalidHeader,
452
+ description: global.intl.formatMessage({
453
+ id: "accountReviewDescription",
454
+ defaultMessage: text.beneficiaryNameInvalidDescription,
455
+ }, {
456
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
457
+ }),
458
+ button: (index.h("div", { class: sheet.classes.ButtonContainer },
459
+ index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
460
+ index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
461
+ alertType: "warning",
462
+ icon: "exclamation-triangle",
463
+ class: sheet.classes.WarningHoldAlertContainer,
464
+ };
465
+ case "BENEFICIARY_NAME_MISMATCH":
466
+ return {
467
+ header: text.beneficiaryNameMismatchHeader,
468
+ description: global.intl.formatMessage({
469
+ id: "accountReviewDescription",
470
+ defaultMessage: text.beneficiaryNameMismatchDescription,
471
+ }, {
472
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
473
+ }),
474
+ button: (index.h("div", { class: sheet.classes.ButtonContainer },
475
+ index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
476
+ index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
477
+ alertType: "warning",
478
+ icon: "exclamation-triangle",
479
+ class: sheet.classes.WarningHoldAlertContainer,
480
+ };
481
+ case "BANK_TAX_NAME_MISMATCH":
482
+ return {
483
+ header: text.bankTaxNameMismatchHeader,
484
+ description: global.intl.formatMessage({
485
+ id: "accountReviewDescription",
486
+ defaultMessage: text.bankTaxNameMismatchDescription,
487
+ }, {
488
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
489
+ }),
490
+ button: (index.h("div", { class: sheet.classes.ButtonContainer },
491
+ index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton),
492
+ index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet.classes.EditBankDetailsButton, onClick: callbacks.onNewFormClick }, text.newFormButton))),
493
+ alertType: "warning",
494
+ icon: "exclamation-triangle",
495
+ class: sheet.classes.WarningHoldAlertContainer,
496
+ };
497
+ case "WITHDRAWAL_SETTINGS_INVALID":
498
+ return {
499
+ header: text.withdrawalSettingsInvalidHeader,
500
+ description: global.intl.formatMessage({
501
+ id: "accountReviewDescription",
502
+ defaultMessage: text.withdrawalSettingsInvalidDescription,
503
+ }, {
504
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
505
+ }),
506
+ button: (index.h("sl-button", { disabled: states.disabled || states.loading, type: "default", class: sheet.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
507
+ alertType: "warning",
508
+ icon: "exclamation-triangle",
509
+ class: sheet.classes.WarningHoldAlertContainer,
510
+ };
511
+ case "PAYMENT_RETURNED":
512
+ return {
513
+ header: text.paymentReturnedHeader,
514
+ description: global.intl.formatMessage({
515
+ id: "accountReviewDescription",
516
+ defaultMessage: text.paymentReturnedDescription,
517
+ }, {
518
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
519
+ }),
520
+ button: (index.h("sl-button", { disabled: states.disabled || states.loading, type: "primary", class: sheet.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)),
521
+ alertType: "error",
522
+ icon: "exclamation-triangle",
523
+ class: sheet.classes.WarningHoldAlertContainer,
524
+ };
525
+ case "HOLD":
526
+ return {
527
+ header: text.payoutHoldAlertHeader,
528
+ description: global.intl.formatMessage({
529
+ id: "payoutHoldAlertDescription",
530
+ defaultMessage: text.payoutHoldAlertDescription,
531
+ }, {
532
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
533
+ }),
534
+ buttonText: null,
535
+ alertType: "warning",
536
+ icon: "exclamation-triangle",
537
+ class: sheet.classes.WarningHoldAlertContainer,
538
+ };
539
+ default:
540
+ return;
541
+ }
542
+ }
543
+ const statusMap = {
544
+ NOT_VERIFIED: (index.h("div", { class: sheet.classes.TaxFormDetailsContainer },
545
+ index.h("sl-badge", { class: sheet.classes.WarningBadge, type: "warning", pill: true }, text.statusTextNotVerified),
546
+ index.h("p", { class: sheet.classes.SubduedText }, global.intl.formatMessage({
547
+ id: `badgeTextAwaitingReview`,
548
+ defaultMessage: text.badgeTextAwaitingReview,
549
+ }, {
550
+ dateSubmitted: states.dateSubmitted,
551
+ })))),
552
+ ACTIVE: (index.h("div", { class: sheet.classes.TaxFormDetailsContainer },
553
+ index.h("sl-badge", { class: sheet.classes.SuccessBadge, type: "success", pill: true }, text.statusTextActive),
554
+ index.h("p", { class: sheet.classes.SubduedText }, global.intl.formatMessage({
555
+ id: `badgeTextSubmittedOn`,
556
+ defaultMessage: states.documentType === "W9" || !states.documentType
557
+ ? text.badgeTextSubmittedOn
558
+ : text.badgeTextSubmittedOnW8,
559
+ }, {
560
+ dateSubmitted: states.dateSubmitted,
561
+ })))),
562
+ INACTIVE: (index.h("div", { class: sheet.classes.TaxFormDetailsContainer },
563
+ index.h("sl-badge", { class: sheet.classes.ErrorBadge, type: "danger", pill: true }, text.statusTextNotActive),
564
+ index.h("p", { class: sheet.classes.SubduedText }, text.invalidForm))),
565
+ undefined: (index.h("div", { class: sheet.classes.TaxFormDetailsContainer },
566
+ index.h("sl-badge", { type: "danger", pill: true }, text.statusTextRequired),
567
+ index.h("p", null, global.intl.formatMessage({
568
+ id: `requiredTaxForm`,
569
+ defaultMessage: text.requiredTaxForm,
570
+ }, {
571
+ taxFormType: states.documentType,
572
+ })))),
573
+ };
574
+ const alertMap = {
575
+ INACTIVE: (index.h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", class: sheet.classes.ErrorHoldAlertContainer, type: "danger", open: true },
576
+ index.h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
577
+ index.h("strong", null, global.intl.formatMessage({
578
+ id: `taxAlertHeaderNotActive`,
579
+ defaultMessage: states.documentType === "W9"
580
+ ? text.taxAlertHeaderNotActiveW9
581
+ : text.taxAlertHeaderNotActiveW8,
582
+ }, {
583
+ documentType: states.documentType || "Your",
584
+ })),
585
+ index.h("br", null),
586
+ global.intl.formatMessage({
587
+ id: `taxAlertMessage`,
588
+ defaultMessage: states.documentType === "W9"
589
+ ? text.taxAlertNotActiveMessageW9
590
+ : text.taxAlertNotActiveMessageW8,
591
+ }, {
592
+ documentType: states.documentTypeString || "tax",
593
+ }))),
594
+ };
595
+ const getIndirectTaxRegisteredIn = () => {
596
+ if (states.province) {
597
+ return global.intl.formatMessage({
598
+ id: `indirectTaxInfoCanada`,
599
+ defaultMessage: text.indirectTaxInfoCanada,
600
+ }, {
601
+ country: "Canada",
602
+ province: states.province,
603
+ });
604
+ }
605
+ else if (states.subRegion) {
606
+ return global.intl.formatMessage({
607
+ id: `indirectTaxInfoSpain`,
608
+ defaultMessage: text.indirectTaxInfoSpain,
609
+ }, {
610
+ country: states.country,
611
+ subRegion: states.subRegion,
612
+ });
613
+ }
614
+ else {
615
+ return global.intl.formatMessage({
616
+ id: `indirectTaxInfoOtherCountry`,
617
+ defaultMessage: text.indirectTaxInfoOtherCountry,
618
+ }, {
619
+ country: states.country,
620
+ });
621
+ }
622
+ };
623
+ const alertInfo = getAlert(states.payoutStatus);
624
+ const dropdownHover = (el) => {
625
+ var _a;
626
+ if (!el)
627
+ return;
628
+ const trigger = el.querySelector('[slot="trigger"]');
629
+ const panel = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".dropdown__panel");
630
+ if (!trigger || !panel)
631
+ return;
632
+ let hideTimeout;
633
+ const show = () => {
634
+ clearTimeout(hideTimeout);
635
+ el.show();
636
+ };
637
+ const scheduleHide = () => {
638
+ hideTimeout = setTimeout(() => el.hide(), 100);
639
+ };
640
+ trigger.addEventListener("mouseenter", show);
641
+ trigger.addEventListener("mouseleave", scheduleHide);
642
+ panel.addEventListener("mouseenter", show);
643
+ panel.addEventListener("mouseleave", scheduleHide);
644
+ return () => {
645
+ trigger.removeEventListener("mouseenter", show);
646
+ trigger.removeEventListener("mouseleave", scheduleHide);
647
+ panel.removeEventListener("mouseenter", show);
648
+ panel.removeEventListener("mouseleave", scheduleHide);
649
+ clearTimeout(hideTimeout);
650
+ };
651
+ };
652
+ return (index.h("div", null,
653
+ index.h("div", null,
654
+ index.h("style", { type: "text/css" },
655
+ styleString,
656
+ vanillaStyle),
657
+ states.loadingError && (index.h("div", null,
658
+ index.h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "danger", open: true, class: sheet.classes.ErrorAlertContainer },
659
+ index.h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
660
+ index.h("strong", null, text.error.loadingErrorAlertHeader),
661
+ index.h("br", null),
662
+ global.intl.formatMessage({
663
+ id: "loadingErrorAlertDescription",
664
+ defaultMessage: text.error.loadingErrorAlertDescription,
665
+ }, {
666
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
667
+ })))),
668
+ ((_a = states.errors) === null || _a === void 0 ? void 0 : _a.general) && (index.h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "danger", open: true, class: sheet.classes.ErrorAlertContainer },
669
+ index.h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
670
+ index.h("strong", null, text.error.generalTitle),
671
+ index.h("br", null),
672
+ global.intl.formatMessage({
673
+ id: "generalDescription",
674
+ defaultMessage: text.error.generalDescription,
675
+ }, {
676
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
677
+ }))),
678
+ alertInfo && (index.h("sqm-form-message", { loading: states.loading, exportparts: "base: alert-base, icon:alert-icon", type: alertInfo === null || alertInfo === void 0 ? void 0 : alertInfo.alertType, class: alertInfo === null || alertInfo === void 0 ? void 0 : alertInfo.class, icon: alertInfo === null || alertInfo === void 0 ? void 0 : alertInfo.icon, transparent: true },
679
+ index.h("strong", null, alertInfo.header),
680
+ index.h("p", { style: { margin: "0" } }, alertInfo.description),
681
+ alertInfo.buttonText && (index.h("sl-button", { style: { marginTop: "var(--sl-spacing-x-small)" }, type: "default", loading: states.veriffLoading, onClick: () => callbacks.onVerifyClick() }, alertInfo.buttonText)),
682
+ alertInfo.button ? (alertInfo.button) : (index.h("div", { style: { display: "none" } })))),
683
+ index.h("sl-dialog", { label: text.replaceTaxFormModalHeader, class: sheet.classes.Dialog, open: states.showNewFormDialog, "onSl-hide": callbacks.onNewFormCancel },
684
+ index.h("p", null, text.replaceTaxFormModalBodyText),
685
+ index.h("sl-button", { slot: "footer", type: "primary", class: sheet.classes.DialogButton, onClick: callbacks.onNewFormClick }, text.newFormButton),
686
+ index.h("sl-button", { slot: "footer", type: "default", class: sheet.classes.DialogButton, onClick: callbacks.onNewFormCancel }, text.cancelButton)),
687
+ states.status === "INACTIVE" && alertMap[states.status],
688
+ index.h("div", null,
689
+ index.h("h3", { style: { marginBottom: "0" } }, text.bankingInformationSectionHeader),
690
+ index.h("div", { class: sheet.classes.BankingInformationContainer },
691
+ slots.payoutDetailsCardSlot,
692
+ !states.loading && (index.h("p", { class: sheet.classes.DescriptionText }, text.payoutFromImpact)),
693
+ states.canEditPayoutInfo && (index.h("sl-button", { disabled: states.disabled || states.loading, exportparts: "base: secondarybutton-base", type: "secondary", class: sheet.classes.EditBankDetailsButton, onClick: callbacks.onEditPayoutInfo }, text.editPaymentInformationButton)))),
694
+ (!states.noFormNeeded || !!states.status) && (index.h("div", { class: sheet.classes.TaxDocumentsContainer },
695
+ index.h("div", null, states.loading ? (index.h("div", { class: sheet.classes.TaxSectionSkeletonContainer },
696
+ index.h("sqm-skeleton", { width: "15%", height: "10px" }),
697
+ index.h("sqm-skeleton", { width: "25%", height: "24px" }))) : (index.h("div", null,
698
+ index.h("div", null,
699
+ index.h("span", { class: sheet.classes.TaxFormDetailsContainer },
700
+ index.h("div", { class: sheet.classes.StatusContainer },
701
+ index.h("h3", null, states.documentType
702
+ ? global.intl.formatMessage({
703
+ id: "section-subheader",
704
+ defaultMessage: text.taxDocumentSectionSubHeader,
705
+ }, {
706
+ documentType: states.documentTypeString,
707
+ })
708
+ : text.taxDocumentSectionSubHeaderNoDocument),
709
+ index.h("span", { class: sheet.classes.StatusAlert }, statusMap[states.status]))),
710
+ (!states.noFormNeeded || !!states.status) &&
711
+ states.status !== "NOT_VERIFIED" && (index.h("sl-button", { disabled: states.disabled || states.loading, onClick: callbacks.onClick, type: "default", class: sheet.classes.NewFormButton, exportparts: "base: primarybutton-base" }, text.newFormButton)))))))),
712
+ index.h("div", { class: sheet.classes.IndirectTaxPreviewContainer }, states.loading ? (index.h("div", { class: sheet.classes.TaxSectionSkeletonContainer },
713
+ index.h("sqm-skeleton", { width: "15%", height: "10px" }),
714
+ index.h("sqm-skeleton", { width: "25%", height: "24px" }))) : (index.h("div", null,
715
+ index.h("h3", { class: sheet.classes.IndirectTaxPreviewHeaderContainer },
716
+ text.indirectTaxInfoSectionHeader,
717
+ index.h("sl-dropdown", { placement: "right", distance: 1, ref: dropdownHover, class: sheet.classes.DropdownTooltipContainer },
718
+ index.h("sl-icon", { slot: "trigger", name: "info-circle", class: sheet.classes.ToolTip, style: { cursor: "pointer" } }),
719
+ index.h("div", { class: sheet.classes.DropdownContent },
720
+ index.h("div", { class: sheet.classes.DropdownArrow }),
721
+ global.intl.formatMessage({
722
+ id: "indirectTaxTooltipSupport",
723
+ defaultMessage: text.indirectTaxTooltipSupport,
724
+ }, {
725
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com`, class: sheet.classes.DropdownLink }, text.supportLink)),
726
+ })))),
727
+ index.h("div", { class: sheet.classes.IndirectTaxPreviewDetails },
728
+ index.h("span", null, states.notRegistered ? (index.h("span", { class: sheet.classes.NotRegisteredIndirectTaxText }, global.intl.formatMessage({
729
+ id: "notRegisteredForTax",
730
+ defaultMessage: text.notRegisteredForTax,
731
+ }, {
732
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
733
+ }))) : (getIndirectTaxRegisteredIn())),
734
+ !states.notRegistered && (index.h("div", { class: sheet.classes.TaxNumberContainer },
735
+ index.h("span", null, global.intl.formatMessage({
736
+ id: `indirectTaxDetails`,
737
+ defaultMessage: text.indirectTaxDetails,
738
+ }, {
739
+ indirectTaxType: states.indirectTaxType,
740
+ indirectTaxNumber: states.indirectTaxNumber,
741
+ })),
742
+ index.h("span", null,
743
+ states.qstNumber &&
744
+ global.intl.formatMessage({
745
+ id: `qstNumber`,
746
+ defaultMessage: text.qstNumber,
747
+ }, {
748
+ qstNumber: states.qstNumber,
749
+ }),
750
+ states.subRegionTaxNumber &&
751
+ global.intl.formatMessage({
752
+ id: `subRegionTaxNumber`,
753
+ defaultMessage: text.subRegionTaxNumber,
754
+ }, {
755
+ subRegionTaxNumber: states.subRegionTaxNumber,
756
+ })))),
757
+ !states.notRegistered && (index.h("div", { class: sheet.classes.InvoiceTableContainer },
758
+ index.h("sqm-invoice-table", { description: text.invoiceDescription, "prev-label": text.invoicePrevLabel, "more-label": text.invoiceMoreLabel, header: text.invoiceHeader, "empty-state-header": text.invoiceEmptyStateHeader, "empty-state-text": text.invoiceEmptyStateText },
759
+ index.h("sqm-invoice-table-download-column", null),
760
+ index.h("sqm-invoice-table-date-column", { "column-title": text.dateColumnTitle }),
761
+ index.h("sqm-invoice-table-data-column", { "column-title": text.invoiceColumnTitle, property: "invoiceId" }),
762
+ index.h("sqm-invoice-table-data-column", { "column-title": text.earningsColumnTitle, property: "earnings" }),
763
+ index.h("sqm-invoice-table-data-column", { "column-title": text.indirectTaxColumnTitle, property: "indirectTax" }),
764
+ index.h("sqm-invoice-table-data-column", { "column-title": text.earningsAfterTaxColumnTitle, property: "netEarnings" })))))))))));
765
+ };
766
+
767
+ const vatLabels = {
768
+ GB: "VAT",
769
+ AU: "GST",
770
+ NZ: "GST",
771
+ CA: "HST",
772
+ AT: "VAT",
773
+ BE: "VAT",
774
+ BG: "VAT",
775
+ HR: "VAT",
776
+ CY: "VAT",
777
+ CZ: "VAT",
778
+ DK: "VAT",
779
+ EE: "VAT",
780
+ FI: "VAT",
781
+ FR: "VAT",
782
+ DE: "VAT",
783
+ GR: "VAT",
784
+ HU: "VAT",
785
+ IE: "VAT",
786
+ IT: "VAT",
787
+ LV: "VAT",
788
+ LT: "VAT",
789
+ LU: "VAT",
790
+ MT: "VAT",
791
+ NL: "VAT",
792
+ PL: "VAT",
793
+ PT: "VAT",
794
+ RO: "VAT",
795
+ SK: "VAT",
796
+ SI: "VAT",
797
+ ES: "VAT",
798
+ SE: "VAT",
799
+ IS: "VAT",
800
+ IN: "GST",
801
+ IL: "VAT",
802
+ JP: "CT",
803
+ MX: "VAT",
804
+ NO: "VAT",
805
+ SG: "GST",
806
+ ZA: "VAT",
807
+ KR: "VAT",
808
+ CH: "VAT",
809
+ TW: "VAT",
810
+ TH: "VAT",
811
+ PH: "VAT",
812
+ MY: "SST",
813
+ AE: "VAT",
814
+ TR: "VAT",
815
+ RU: "VAT",
816
+ };
817
+
818
+ const style$2 = {
819
+ Container: {
820
+ width: "100%",
821
+ },
822
+ InputContainer: {
823
+ width: "100%",
824
+ display: "flex",
825
+ justifyContent: "flex-start",
826
+ flexDirection: "column",
827
+ gap: "16px",
828
+ padding: "16px",
829
+ maxWidth: "450px",
830
+ },
831
+ ConditionalInputsContainer: {
832
+ width: "100%",
833
+ display: "flex",
834
+ justifyContent: "flex-start",
835
+ flexDirection: "column",
836
+ gap: "16px",
837
+ },
838
+ HR: {
839
+ border: "var(--sqm-border-thickness, 1px) solid var(--sqm-border-color)",
840
+ margin: "10px 0",
841
+ },
842
+ Input: { maxWidth: "500px" },
843
+ Checkbox: {
844
+ "&::part(control)": {
845
+ borderRadius: "0 !important",
846
+ },
847
+ },
848
+ SearchInput: {
849
+ padding: "var(--sl-spacing-x-small)",
850
+ },
851
+ ErrorInput: {
852
+ maxWidth: "500px",
853
+ "&::part(base)": {
854
+ border: "var(--sqm-border-thickness, 1px) solid var(--sqm-danger-color-border)",
855
+ borderRadius: "var(--sl-input-border-radius-medium)",
856
+ },
857
+ "&::part(help-text)": {
858
+ color: "var(--sqm-danger-color-text)",
859
+ },
860
+ },
861
+ };
862
+ const sheet$1 = JSS.createStyleSheet(style$2);
863
+ const styleString$1 = sheet$1.toString();
864
+ const vanillaStyle$1 = `
865
+ :host{
866
+ display: block;
867
+ }
868
+ * {
869
+ margin: 0;
870
+ padding: 0;
871
+ box-sizing: border-box;
872
+ }
873
+ sl-menu-item::part(base) {
874
+ color: var(--sqm-input-color);
875
+ }
876
+
877
+ sl-menu-item::part(base):hover {
878
+ background-color: var(--sqm-input-border-color-hover);
879
+ }
880
+ sl-checkbox[checked]::part(control){
881
+ background-color: var(--sqm-input-border-color-focus);
882
+ }
883
+
884
+ sl-checkbox[checked]::part(checked-icon){
885
+ color: var(--sqm-input-background);
886
+ }
887
+ `;
888
+ const OtherRegionSlotView = (props) => {
889
+ var _a, _b, _c;
890
+ const { states, states: { formState }, callbacks, text, } = props;
891
+ const { classes } = sheet$1;
892
+ const getTaxFieldLabel = (taxType) => {
893
+ return global.intl.formatMessage({
894
+ id: `tax-field-label${taxType}`,
895
+ defaultMessage: text.indirectTaxNumber,
896
+ }, { taxType });
897
+ };
898
+ const getTaxFieldError = (taxType) => {
899
+ return global.intl.formatMessage({
900
+ id: `tax-field-label${taxType}`,
901
+ defaultMessage: text.error.indirectTaxNumber,
902
+ }, { taxType });
903
+ };
904
+ const IndirectTaxNumberInput = ({ label, error, name, }) => {
905
+ var _a;
906
+ return (index.h("sl-input", Object.assign({ required: true, exportparts: "label: input-label, base: input-base", class: classes.Input, label: label, disabled: states.loading || states.disabled, value: formState[name] }, (((_a = formState.errors) === null || _a === void 0 ? void 0 : _a[name]) && {
907
+ class: classes.ErrorInput,
908
+ helpText: error,
909
+ }), { id: name, name: `/${name}` })));
910
+ };
911
+ const SpainFields = () => {
912
+ var _a, _b;
913
+ return (index.h("div", { class: classes.ConditionalInputsContainer },
914
+ index.h("sl-select", Object.assign({ required: true, exportparts: "label: input-label, base: input-base", class: classes.Input, value: formState.subRegion, label: text.subRegion, disabled: states.loading || states.disabled }, (((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.indirectTaxNumber) && {
915
+ class: classes.ErrorInput,
916
+ helpText: subregions.formatErrorMessage(text.subRegion, text.error.fieldRequiredError),
917
+ }), { id: "subRegion", name: "/subRegion" }), props.data.esRegions.map((r) => (index.h("sl-menu-item", { value: r.regionCode }, r.displayName)))),
918
+ index.h(IndirectTaxNumberInput, { name: "indirectTaxNumber", label: getTaxFieldLabel("VAT"), error: getTaxFieldError("VAT") }),
919
+ index.h("sl-checkbox", { class: classes.Checkbox, exportparts: "label: input-label, base: input-base", checked: formState.hasSubRegionTaxNumber, "onSl-change": callbacks.onSpainToggle, disabled: states.disabled || states.isPartner }, text.isRegisteredSubRegionIncomeTax),
920
+ formState.hasSubRegionTaxNumber && (index.h("sl-input", Object.assign({ required: true, exportparts: "label: input-label, base: input-base", class: classes.Input, label: text.subRegionTaxNumberLabel, disabled: states.loading || states.disabled, value: formState.subRegionTaxNumber }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.subRegionTaxNumber) && {
921
+ class: classes.ErrorInput,
922
+ helpText: subregions.formatErrorMessage(text.subRegionTaxNumberLabel, text.error.fieldRequiredError),
923
+ }), { id: "subRegionTaxNumber", name: "/subRegionTaxNumber" })))));
924
+ };
925
+ const CanadaFields = () => {
926
+ var _a, _b;
927
+ const { classes } = sheet$1;
928
+ const currentTaxType = (_a = subregions.INDIRECT_TAX_PROVINCES === null || subregions.INDIRECT_TAX_PROVINCES === void 0 ? void 0 : subregions.INDIRECT_TAX_PROVINCES.find((p) => p.regionCode === formState.province)) === null || _a === void 0 ? void 0 : _a.taxType;
929
+ return (index.h("div", { class: classes.ConditionalInputsContainer },
930
+ index.h("sl-select", Object.assign({ required: true, value: formState.province, exportparts: "label: input-label, base: input-base", class: classes.Input, label: text.province, disabled: states.loading || states.disabled, "onSl-select": (e) => callbacks.onFormChange("province", e) }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.province) && {
931
+ class: classes.ErrorInput,
932
+ helpText: subregions.formatErrorMessage(text.province, text.error.fieldRequiredError),
933
+ }), { id: "province", name: "/province" }), props.data.provinces.map((p) => (index.h("sl-menu-item", { value: p.regionCode }, p.displayName)))),
934
+ currentTaxType === "GST" && (index.h(IndirectTaxNumberInput, { label: getTaxFieldLabel("GST"), error: getTaxFieldError("GST"), name: "indirectTaxNumber" })),
935
+ currentTaxType === "HST" && (index.h(IndirectTaxNumberInput, { label: getTaxFieldLabel("HST"), error: getTaxFieldError("HST"), name: "indirectTaxNumber" })),
936
+ formState.province === "QUEBEC" && (index.h("div", { class: classes.ConditionalInputsContainer },
937
+ index.h("sl-checkbox", { class: classes.Checkbox, exportparts: "label: input-label, base: input-base", "onSl-change": callbacks.onQstToggle, checked: formState.hasQst, disabled: states.isPartner || states.disabled }, text.isRegisteredQST),
938
+ formState.hasQst && (index.h(IndirectTaxNumberInput, { name: "qstNumber", label: text.qstNumber, error: subregions.formatErrorMessage(text.qstNumber, text.error.fieldRequiredError) }))))));
939
+ };
940
+ const getActiveForm = (selectedRegion) => {
941
+ var _a;
942
+ switch (selectedRegion) {
943
+ case "CA":
944
+ return index.h(CanadaFields, null);
945
+ case "ES":
946
+ return index.h(SpainFields, null);
947
+ default:
948
+ return (index.h("sl-input", Object.assign({ required: true, exportparts: "label: input-label, base: input-base", class: classes.Input, value: formState.indirectTaxNumber, label: getTaxFieldLabel(vatLabels[selectedRegion] || "GENERAL"), disabled: states.loading || states.disabled }, (((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.indirectTaxNumber) && {
949
+ class: classes.ErrorInput,
950
+ helpText: getTaxFieldError(vatLabels[selectedRegion] || "GENERAL"),
951
+ }), { id: "indirectTaxNumber", name: "/indirectTaxNumber" })));
952
+ }
953
+ };
954
+ const activeForm = getActiveForm(formState.selectedRegion);
955
+ return (index.h("div", { style: states.hide ? { display: "none" } : {} },
956
+ index.h("form", { class: classes.Container },
957
+ index.h("style", { type: "text/css" },
958
+ styleString$1,
959
+ vanillaStyle$1),
960
+ index.h("hr", { class: classes.HR }),
961
+ index.h("div", { class: classes.InputContainer },
962
+ index.h("sl-select", Object.assign({ required: true, class: classes.Input, value: formState.selectedRegion, exportparts: "label: input-label, base: input-base", label: text.selectedRegion, disabled: states.loading || states.disabled, "onSl-select": (e) => callbacks.onFormChange("selectedRegion", e) }, (((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.selectedRegion) && {
963
+ class: classes.ErrorInput,
964
+ helpText: subregions.formatErrorMessage(text.selectedRegion, text.error.fieldRequiredError),
965
+ }), { id: "selectedRegion", name: "/selectedRegion" }),
966
+ index.h("sl-input", { class: classes.SearchInput, placeholder: text.searchForCountryText, onKeyDown: (e) => {
967
+ // Stop shoelace intercepting key presses
968
+ e.stopPropagation();
969
+ }, "onSl-input": (e) => {
970
+ callbacks.setCountrySearch(e.target.value);
971
+ } }), (_b = props.data.countries) === null || _b === void 0 ? void 0 :
972
+ _b.map((c) => (index.h("sl-menu-item", { value: c.countryCode }, c.displayName))), (_c = props.data.allCountries) === null || _c === void 0 ? void 0 :
973
+ _c.map((c) => (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" } }, c.displayName)))),
974
+ activeForm),
975
+ index.h("hr", { class: classes.HR }))));
976
+ };
977
+
978
+ const style$3 = {
979
+ FormWrapper: {},
980
+ ErrorInput: {
981
+ "&::part(base)": {
982
+ border: "var(--sqm-border-thickness, 1px) solid var(--sqm-danger-color-border)",
983
+ borderRadius: "var(--sl-input-border-radius-medium)",
984
+ },
985
+ "&::part(help-text)": {
986
+ color: "var(--sqm-danger-color-text)",
987
+ },
988
+ },
989
+ ErrorText: {
990
+ color: "var(--sqm-danger-color-text)",
991
+ marginTop: "10px",
992
+ },
993
+ TextContainer: {
994
+ display: "flex",
995
+ justifyContent: "flex-start",
996
+ flexDirection: "column",
997
+ gap: "24px",
998
+ paddingBottom: "16px",
999
+ },
1000
+ InputContainer: {
1001
+ display: "flex",
1002
+ justifyContent: "flex-start",
1003
+ flexDirection: "column",
1004
+ gap: "24px",
1005
+ paddingBottom: "36px",
1006
+ maxWidth: "450px",
1007
+ },
1008
+ SearchInput: {
1009
+ padding: "var(--sl-spacing-x-small)",
1010
+ },
1011
+ BtnContainer: {
1012
+ paddingTop: "36px",
1013
+ display: "flex",
1014
+ gap: "8px",
1015
+ },
1016
+ CheckboxWrapper: {
1017
+ display: "flex",
1018
+ justifyContent: "flex-start",
1019
+ flexDirection: "column",
1020
+ },
1021
+ BoldText: {
1022
+ fontWeight: "bold",
1023
+ },
1024
+ RoundedCheckbox: {
1025
+ "&::part(control)": {
1026
+ borderRadius: "50%",
1027
+ },
1028
+ },
1029
+ PageDescriptionText: {
1030
+ color: "var(--sqm-text-subdued)",
1031
+ fontSize: "var(--sl-font-size-medium)",
1032
+ },
1033
+ PhoneInputsSection: {
1034
+ display: "flex",
1035
+ flexDirection: "column",
1036
+ gap: "4px",
1037
+ "& p": {
1038
+ fontSize: "var(--sl-font-size-small)",
1039
+ color: "var(--sqm-input-label-color)",
1040
+ fontWeight: "var(--sl-font-weight-semibold)",
1041
+ },
1042
+ },
1043
+ PhoneInputsContainer: {
1044
+ display: "flex",
1045
+ gap: "4px",
1046
+ width: "100%",
1047
+ "& #phoneNumber": {
1048
+ width: "100%",
1049
+ minWidth: "0px",
1050
+ },
1051
+ },
1052
+ };
1053
+ const sheet$2 = JSS.createStyleSheet(style$3);
1054
+ const styleString$2 = sheet$2.toString();
1055
+ const vanillaStyle$2 = `
1056
+ :host{
1057
+ display: block;
1058
+ }
1059
+ * {
1060
+ margin: 0;
1061
+ padding: 0;
1062
+ box-sizing: border-box;
1063
+ }
1064
+ a {
1065
+ color: var(--sqm-text);
1066
+ color: inherit !important;
1067
+ text-decoration: underline;
1068
+ }
1069
+
1070
+ p {
1071
+ line-height: 18px;
1072
+ font-size: var(--sl-font-size-small);
1073
+ }
1074
+
1075
+ sl-radio-group::part(base) {
1076
+ display: flex;
1077
+ flex-direction: column;
1078
+ }
1079
+
1080
+ sl-select#phoneNumberCountryCode::part(menu) {
1081
+ min-width: 250px;
1082
+ }
1083
+
1084
+ sl-button[type="primary"]::part(base){
1085
+ background-color: var(--sqm-primary-button-background);
1086
+ color: var(--sqm-primary-button-color);
1087
+ border-color: var(--sqm-primary-button-color-border);
1088
+ border-radius: var(--sqm-primary-button-radius);
1089
+ }
1090
+
1091
+ sl-button[type="primary"]::part(base):hover{
1092
+ background-color: var(--sqm-primary-button-background-hover);
1093
+ }
1094
+
1095
+ sl-button[type="primary"]::part(base):focus{
1096
+ box-shadow: none;
1097
+ }
1098
+
1099
+ sl-button[type="secondary"]::part(base){
1100
+ background-color: var(--sqm-secondary-button-background);
1101
+ color: var(--sqm-secondary-button-color);
1102
+ border-color: var(--sqm-secondary-button-color-border);
1103
+ border-radius: var(--sqm-secondary-button-radius);
1104
+ }
1105
+
1106
+ sl-button[type="secondary"]::part(base):hover{
1107
+ background-color: var(--sqm-secondary-button-background-hover);
1108
+ }
1109
+
1110
+
1111
+
1112
+ *::part(primarybutton-base){
1113
+ background-color: var(--sqm-primary-button-background);
1114
+ color: var(--sqm-primary-button-color);
1115
+ border-color: var(--sqm-primary-button-color-border);
1116
+ border-radius: var(--sqm-primary-button-radius);
1117
+ }
1118
+
1119
+ *::part(primarybutton-base):hover{
1120
+ background-color: var(--sqm-primary-button-background-hover);
1121
+ }
1122
+
1123
+ *::part(primarybutton-base):focus{
1124
+ box-shadow: none;
1125
+ }
1126
+
1127
+ *::part(secondarybutton-base){
1128
+ background-color: var(--sqm-secondary-button-background);
1129
+ color: var(--sqm-secondary-button-color);
1130
+ border-color: var(--sqm-secondary-button-color-border);
1131
+ border-radius: var(--sqm-secondary-button-radius);
1132
+ }
1133
+
1134
+ *::part(secondarybutton-base):hover{
1135
+ background-color: var(--sqm-secondary-button-background-hover);
1136
+ }
1137
+
1138
+ *::part(secondarybutton-base){
1139
+ background-color: var(--sqm-secondary-button-background);
1140
+ color: var(--sqm-secondary-button-color);
1141
+ border-color: var(--sqm-secondary-button-color-border);
1142
+ border-radius: var(--sqm-secondary-button-radius);
1143
+ width: max-content;
1144
+ display: flex;
1145
+ margin: auto;
1146
+ }
1147
+
1148
+ *::part(secondarybutton-base):hover{
1149
+ background: var(--sqm-secondary-button-background-hover);
1150
+ }
1151
+
1152
+ sl-input::part(label),
1153
+ sl-select::part(label),
1154
+ sl-textarea::part(label){
1155
+ font-size: var(--sqm-input-label-font-size, var(--sl-input-font-size-small));
1156
+ font-weight: var(--sl-font-weight-semibold);
1157
+ color: var(--sqm-input-label-color, var(--sqm-text), black);
1158
+ }
1159
+
1160
+ /* Corrected: Target sl-input, sl-select, sl-textarea base elements */
1161
+ sl-input::part(base),
1162
+ sl-dropdown::part(base),
1163
+ sl-textarea::part(base){
1164
+ background-color: var(--sqm-input-background, #fff);
1165
+ border-radius: var(--sqm-input-border-radius, var(--sl-input-border-radius-large), 0.25rem);
1166
+ color: var(--sqm-input-color, white);
1167
+ border-width: var(--sqm-border-thickness, 1px);
1168
+ border-style: solid;
1169
+ border-color: var(--sqm-input-border-color, #ccc);
1170
+ }
1171
+
1172
+
1173
+ sl-select::part(menu) {
1174
+ background: var(--sqm-input-background, inherit);
1175
+ color: var(--sqm-input-color, inherit);
1176
+ border:none;
1177
+ }
1178
+
1179
+ sl-menu-item::part(base) {
1180
+ color: var(--sqm-input-color);
1181
+ }
1182
+
1183
+ sl-menu-item::part(base):hover {
1184
+ background-color: var(--sqm-input-border-color-hover);
1185
+ }
1186
+
1187
+ sl-select::part(panel) {
1188
+ border-radius: var(--sqm-border-radius-normal);
1189
+ }
1190
+
1191
+ sl-select::part(help-text) {
1192
+ color: var(--sqm-text-subdued, var(--sl-input-help-text-color, #6c757d));
1193
+ }
1194
+
1195
+ sl-input::part(base):focus,
1196
+ sl-select::part(base):focus, /* Corrected part name for sl-select */
1197
+ sl-textarea::part(base):focus { /* Corrected part name for sl-textarea */
1198
+ border: var(--sqm-input-focus-border, 1px solid var(--sl-input-border-color-focus, #007bff)); /* Added fallback for --sl-input-border-color-focus */
1199
+ }
1200
+
1201
+ sl-input[disabled]::part(base),
1202
+ sl-select[disabled]::part(base),
1203
+ sl-textarea[disabled]::part(base){
1204
+ background: var(--sqm-input-disabled-background, #f5f5f5);
1205
+ border-color: var(--sl-input-border-color-disabled, #e0e0e0); /* Example disabled border color */
1206
+ }
1207
+
1208
+
1209
+ sl-input::part(input):-webkit-autofill {
1210
+ box-shadow: 0 0 0 50px var(--sqm-input-background, #fff) inset !important;
1211
+ -webkit-text-fill-color: var(--sqm-input-color, white) !important;
1212
+ }
1213
+
1214
+ sl-input::part(input):-webkit-autofill:hover {
1215
+ box-shadow: 0 0 0 50px var(--sqm-input-background, #fff) inset !important;
1216
+ -webkit-text-fill-color: var(--sqm-input-color, white) !important;
1217
+ }
1218
+
1219
+ sl-input::part(input):-webkit-autofill:focus {
1220
+ box-shadow: 0 0 0 50px var(--sqm-input-background, #fff) inset !important;
1221
+ -webkit-text-fill-color: var(--sqm-input-color, white) !important;
1222
+ }
1223
+
1224
+ sl-checkbox::part(label){
1225
+ color: var(--sqm-text);
1226
+ }
1227
+
1228
+ sl-checkbox[checked]::part(control){
1229
+ background-color: var(--sqm-input-border-color-focus);
1230
+ }
1231
+
1232
+ sl-checkbox[checked]::part(checked-icon){
1233
+ color: var(--sqm-input-background);
1234
+ }
1235
+ `;
1236
+ const UserInfoFormView = (props) => {
1237
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
1238
+ const { states, states: { formState }, callbacks, text, refs, data: data$1, } = props;
1239
+ const { classes } = sheet$2;
1240
+ const bankingCollectionText = global.intl.formatMessage({
1241
+ id: "bankingCollectionText",
1242
+ defaultMessage: text.allowBankingCollection,
1243
+ }, {
1244
+ termsAndConditionsLink: (index.h("a", { href: text.termsAndConditionsLink, target: "_blank" }, text.termsAndConditionsLabel)),
1245
+ });
1246
+ let regionLabel = undefined;
1247
+ switch (data$1.regionLabelEnum) {
1248
+ case "STATE":
1249
+ regionLabel = text.state;
1250
+ break;
1251
+ case "PROVINCE":
1252
+ regionLabel = text.province;
1253
+ break;
1254
+ case "REGION":
1255
+ regionLabel = text.region;
1256
+ break;
1257
+ default:
1258
+ regionLabel = text.state;
1259
+ }
1260
+ // when creating an impact connection without sending phoneNumber data, the impactAPI defaults the value to "0000000" and the phoneNumberCountryCode to "DZ"
1261
+ function isDisabledPartnerInput(field) {
1262
+ var _a, _b, _c, _d;
1263
+ if (((_a = data$1.partnerData) === null || _a === void 0 ? void 0 : _a.phoneNumber) === "0000000" &&
1264
+ (field === "phoneNumber" || field === "phoneNumberCountryCode")) {
1265
+ return false;
1266
+ }
1267
+ // if bad phone number was previously saved, unlock the field so user can correct it
1268
+ if ((field === "phoneNumber" || field === "phoneNumberCountryCode") &&
1269
+ states.isPartner &&
1270
+ !subregions.isValidI18nPhoneNumber((_b = data$1.partnerData) === null || _b === void 0 ? void 0 : _b.phoneNumberCountryCode, (_c = data$1.partnerData) === null || _c === void 0 ? void 0 : _c.phoneNumber)) {
1271
+ return false;
1272
+ }
1273
+ return states.isPartner && !!((_d = data$1.partnerData) === null || _d === void 0 ? void 0 : _d[field]);
1274
+ }
1275
+ function isDisabledUserInput(field) {
1276
+ var _a;
1277
+ return states.isUser && !!((_a = data$1.userData) === null || _a === void 0 ? void 0 : _a[field]);
1278
+ }
1279
+ return (index.h("sl-form", { class: classes.FormWrapper, "onSl-submit": callbacks.onSubmit, ref: (el) => (refs.formRef.current = el), novalidate: true },
1280
+ index.h("style", { type: "text/css" },
1281
+ styleString$2,
1282
+ vanillaStyle$2),
1283
+ states.loadingError && (index.h("div", null,
1284
+ index.h("sqm-form-message", { type: "error" },
1285
+ index.h("p", { part: "alert-title" }, text.error.loadingErrorAlertHeader),
1286
+ index.h("p", { part: "alert-description" }, global.intl.formatMessage({
1287
+ id: "loadingErrorAlertDescription",
1288
+ defaultMessage: text.error.loadingErrorAlertDescription,
1289
+ }, {
1290
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
1291
+ }))))),
1292
+ states.loading ? (index.h(subregions.LoadingView, null)) : (index.h("div", null,
1293
+ index.h("div", { class: classes.TextContainer },
1294
+ index.h("div", null,
1295
+ !states.hideSteps && (index.h("p", null, global.intl.formatMessage({
1296
+ id: "formStep",
1297
+ defaultMessage: text.formStep,
1298
+ }, { step: states.step, count: data.FORM_STEPS }))),
1299
+ index.h("h3", null, text.personalInformation),
1300
+ index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription))),
1301
+ ((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.general) && (index.h("sqm-form-message", { type: "error" },
1302
+ index.h("p", { part: "alert-title" }, text.error.generalTitle),
1303
+ index.h("p", { part: "alert-description" }, global.intl.formatMessage({
1304
+ id: "generalDescription",
1305
+ defaultMessage: text.error.generalDescription,
1306
+ }, {
1307
+ supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
1308
+ })))),
1309
+ index.h("div", null,
1310
+ index.h("div", { class: classes.InputContainer },
1311
+ index.h("sl-input", Object.assign({ class: "ErrorInput", exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled || isDisabledUserInput("firstName") }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
1312
+ class: classes.ErrorInput,
1313
+ helpText: subregions.formatErrorMessage(text.firstName, formState.errors.firstName),
1314
+ }
1315
+ : {}), { id: "firstName", name: "/firstName", required: true })),
1316
+ index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled || isDisabledUserInput("lastName") }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
1317
+ class: classes.ErrorInput,
1318
+ helpText: subregions.formatErrorMessage(text.lastName, formState.errors.lastName),
1319
+ }
1320
+ : {}), { id: "lastName", name: "/lastName", required: true })),
1321
+ index.h("sl-input", { exportparts: "label: input-label, base: input-base", value: formState.email, label: text.email, disabled: true, id: "email", name: "/email", required: true }),
1322
+ index.h("sl-select", Object.assign({ id: "countryCode", exportparts: "label: input-label, base: input-base", name: "/countryCode", label: text.country, value: formState.countryCode, disabled: states.disabled || isDisabledPartnerInput("countryCode") }, (((_d = formState.errors) === null || _d === void 0 ? void 0 : _d.countryCode) ? {
1323
+ class: classes.ErrorInput,
1324
+ helpText: subregions.formatErrorMessage(text.country, formState.errors.countryCode),
1325
+ }
1326
+ : {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("countryCode", e) }),
1327
+ index.h("sl-input", { class: classes.SearchInput, placeholder: text.searchForCountryText, onKeyDown: (e) => {
1328
+ // Stop shoelace intercepting key presses
1329
+ e.stopPropagation();
1330
+ }, "onSl-input": (e) => {
1331
+ callbacks.setCountrySearch(e.target.value);
1332
+ } }), (_e = data$1 === null || data$1 === void 0 ? void 0 : data$1.countries) === null || _e === void 0 ? void 0 :
1333
+ _e.map((c) => (index.h("sl-menu-item", { value: c.countryCode }, c.displayName))), (_f = data$1 === null || data$1 === void 0 ? void 0 : data$1.allCountries) === null || _f === void 0 ? void 0 :
1334
+ _f.map((c) => (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" } }, c.displayName)))),
1335
+ index.h("div", { class: classes.PhoneInputsSection },
1336
+ index.h("p", null, text.phoneNumber),
1337
+ index.h("div", { class: classes.PhoneInputsContainer },
1338
+ index.h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
1339
+ isDisabledPartnerInput("phoneNumberCountryCode"), ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
1340
+ class: classes.ErrorInput,
1341
+ }
1342
+ : {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
1343
+ index.h("sl-input", { class: classes.SearchInput, placeholder: text.searchForCountryText, onKeyDown: (e) => {
1344
+ // Stop shoelace intercepting key presses
1345
+ e.stopPropagation();
1346
+ }, "onSl-input": (e) => {
1347
+ callbacks.setPhoneCountrySearch(e.target.value);
1348
+ } }), (_h = data$1 === null || data$1 === void 0 ? void 0 : data$1.phoneCountries) === null || _h === void 0 ? void 0 :
1349
+ _h.map((c) => {
1350
+ var _a, _b;
1351
+ return (index.h("sl-menu-item", { value: c.countryCode },
1352
+ index.h("div", { slot: "prefix" }, `${(_a = subregions.PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = subregions.PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
1353
+ _b.dial_code));
1354
+ }), (_j = data$1 === null || data$1 === void 0 ? void 0 : data$1.allCountries) === null || _j === void 0 ? void 0 :
1355
+ _j.map((c) => {
1356
+ var _a, _b;
1357
+ return (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" } },
1358
+ index.h("div", { slot: "prefix" }, `${(_a = subregions.PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = subregions.PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
1359
+ _b.dial_code));
1360
+ })),
1361
+ index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", id: "phoneNumber", name: "/phoneNumber", value: formState.phoneNumber, validationError: ({ control, value, formData }) => {
1362
+ // skip validation for values the user can't edit
1363
+ if (control === null || control === void 0 ? void 0 : control.disabled)
1364
+ return undefined;
1365
+ if (!(value === null || value === void 0 ? void 0 : value.trim()))
1366
+ return undefined;
1367
+ return subregions.isValidI18nPhoneNumber(formData.phoneNumberCountryCode, value)
1368
+ ? undefined
1369
+ : subregions.formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
1370
+ }, disabled: states.disabled || isDisabledPartnerInput("phoneNumber") }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
1371
+ class: classes.ErrorInput,
1372
+ helpText: subregions.formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
1373
+ }
1374
+ : {}), { required: true })))),
1375
+ index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.address, id: "address", name: "/address", value: formState.address, validationError: ({ value }) =>
1376
+ // Checks for non-ASCII characters
1377
+ !subregions.validateBillingField(/^[\x20-\xFF]+$/, value) &&
1378
+ subregions.formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || isDisabledPartnerInput("billingAddress") }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
1379
+ class: classes.ErrorInput,
1380
+ helpText: subregions.formatErrorMessage(text.address, formState.errors.address),
1381
+ }
1382
+ : {}), { required: true })),
1383
+ index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.city, id: "city", name: "/city", value: formState.city, validationError: ({ value }) =>
1384
+ // Checks for non-ASCII characters
1385
+ !subregions.validateBillingField(/^[\x20-\xFF]+$/, value) &&
1386
+ subregions.formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || isDisabledPartnerInput("billingCity") }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
1387
+ class: classes.ErrorInput,
1388
+ helpText: subregions.formatErrorMessage(text.city, formState.errors.city),
1389
+ }
1390
+ : {}), { required: true })),
1391
+ !states.hideState && (index.h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled || isDisabledPartnerInput("billingState") }, (((_o = formState.errors) === null || _o === void 0 ? void 0 : _o.state) ? {
1392
+ class: classes.ErrorInput,
1393
+ helpText: subregions.formatErrorMessage(text.state, formState.errors.state),
1394
+ }
1395
+ : {}), { required: true }), (_p = data$1.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (index.h("sl-menu-item", { value: r.value }, r.label))))),
1396
+ index.h("sl-input", Object.assign({ label: text.postalCode, exportparts: "label: input-label, base: input-base", id: "postalCode", name: "/postalCode", value: formState.postalCode, disabled: states.disabled || isDisabledPartnerInput("billingPostalCode") }, (((_q = formState.errors) === null || _q === void 0 ? void 0 : _q.postalCode) ? {
1397
+ class: classes.ErrorInput,
1398
+ helpText: subregions.formatErrorMessage(text.postalCode, formState.errors.postalCode),
1399
+ }
1400
+ : {}), { required: true })),
1401
+ index.h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label, base: input-base", name: "/currency", label: text.currency, menu: true, value: formState.currency, disabled: states.disabled || isDisabledPartnerInput("currency") }, (((_r = formState.errors) === null || _r === void 0 ? void 0 : _r.currency) ? {
1402
+ class: classes.ErrorInput,
1403
+ helpText: subregions.formatErrorMessage(text.currency, formState.errors.currency),
1404
+ }
1405
+ : {}), { required: true, ref: (el) => (refs.currencyRef.current = el) }),
1406
+ index.h("sl-input", { class: classes.SearchInput, placeholder: text.searchForCurrencyText, onKeyDown: (e) => {
1407
+ // Stop shoelace intercepting key presses
1408
+ e.stopPropagation();
1409
+ }, "onSl-input": (e) => {
1410
+ callbacks.setCurrencySearch(e.target.value);
1411
+ } }), (_s = data$1 === null || data$1 === void 0 ? void 0 : data$1.currencies) === null || _s === void 0 ? void 0 :
1412
+ _s.map((c) => (index.h("sl-menu-item", { value: c.currencyCode },
1413
+ c.currencyCode,
1414
+ " - ",
1415
+ c.displayName))), (_t = data$1 === null || data$1 === void 0 ? void 0 : data$1.allCurrencies) === null || _t === void 0 ? void 0 :
1416
+ _t.map((c) => (index.h("sl-menu-item", { value: c.currencyCode, style: { display: "none" } },
1417
+ c.currencyCode,
1418
+ " - ",
1419
+ c.displayName))))),
1420
+ index.h("sl-button", { type: "primary", disabled: states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
1421
+ };
1422
+
1423
+ exports.InvoiceTableView = InvoiceTableView;
1424
+ exports.OtherRegionSlotView = OtherRegionSlotView;
1425
+ exports.TaxAndCashDashboardView = TaxAndCashDashboardView;
1426
+ exports.UserInfoFormView = UserInfoFormView;
1427
+ exports.vatLabels = vatLabels;