favesalon-embed 1.0.15 → 1.0.17

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 (56) hide show
  1. package/dist/custom-elements/index.d.ts +36 -0
  2. package/dist/favesalon-embed/{_commonjsHelpers-a4f66ccd.js → _commonjsHelpers-9bc404fc.js} +1 -1
  3. package/dist/favesalon-embed/activate-form.entry.js +10 -3
  4. package/dist/favesalon-embed/buy-giftcard-form.entry.js +1025 -0
  5. package/dist/favesalon-embed/buy-giftcard-verification.entry.js +3937 -0
  6. package/dist/favesalon-embed/change-password-form.entry.js +10 -3
  7. package/dist/favesalon-embed/chat-box.entry.js +2 -2
  8. package/dist/favesalon-embed/chat-button.entry.js +2 -2
  9. package/dist/favesalon-embed/chat-form.entry.js +2 -2
  10. package/dist/favesalon-embed/chat-messages.entry.js +4 -4
  11. package/dist/favesalon-embed/chat-rooms.entry.js +4 -4
  12. package/dist/favesalon-embed/credit-card-types.entry.js +16 -0
  13. package/dist/favesalon-embed/favesalon-embed.css +20 -0
  14. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -1
  15. package/dist/favesalon-embed/{index-00b83e1c.js → index-ac52896a.js} +1 -1
  16. package/dist/favesalon-embed/{lodash-d5526b38.js → lodash-b4fe554a.js} +1 -1
  17. package/dist/favesalon-embed/login-form.entry.js +2 -2
  18. package/dist/favesalon-embed/powered-by-favesalon.entry.js +16 -0
  19. package/dist/favesalon-embed/register-form.entry.js +10 -4
  20. package/dist/favesalon-embed/{relativeTime-268e64b0.js → relativeTime-15477f02.js} +1 -1
  21. package/dist/favesalon-embed/reset-password-form.entry.js +10 -3
  22. package/dist/favesalon-embed/salon-booking.entry.js +2 -2
  23. package/dist/favesalon-embed/salon-gift-card.entry.js +2 -2
  24. package/dist/favesalon-embed/salon-info.entry.js +2 -2
  25. package/dist/favesalon-embed/salon-latest-reviews.entry.js +3 -3
  26. package/dist/favesalon-embed/salon-latest-styles.entry.js +2 -2
  27. package/dist/favesalon-embed/salon-locations.entry.js +3 -3
  28. package/dist/favesalon-embed/salon-lookbook.entry.js +2 -2
  29. package/dist/favesalon-embed/salon-reviews.entry.js +2 -2
  30. package/dist/favesalon-embed/salon-schedules.entry.js +2 -2
  31. package/dist/favesalon-embed/salon-services.entry.js +2 -2
  32. package/dist/favesalon-embed/salon-stylists.entry.js +2 -2
  33. package/dist/favesalon-embed/services-09264f42.js +24132 -0
  34. package/dist/favesalon-embed/services-1406013d.js +24132 -0
  35. package/dist/favesalon-embed/services-82948efc.js +24123 -0
  36. package/dist/favesalon-embed/{services-ece4767f.js → services-9a686ade.js} +318 -125
  37. package/dist/favesalon-embed/services-c2c81c88.js +24131 -0
  38. package/dist/favesalon-embed/services-ef32efdc.js +24132 -0
  39. package/dist/favesalon-embed/style-detail.entry.js +3 -3
  40. package/dist/favesalon-embed/utils-00e4ed17.js +33 -0
  41. package/dist/favesalon-embed/utils-359c37f7.js +33 -0
  42. package/dist/favesalon-embed/utils-daaa9ecc.js +34 -0
  43. package/dist/favesalon-embed/utils-e6e3f132.js +33 -0
  44. package/dist/favesalon-embed/wizard-existing-user.entry.js +146 -0
  45. package/dist/favesalon-embed/wizard-new-user.entry.js +178 -0
  46. package/dist/types/components/buy-giftcard-form/buy-giftcard-form.d.ts +57 -0
  47. package/dist/types/components/buy-giftcard-verification/buy-giftcard-verification.d.ts +23 -0
  48. package/dist/types/components/credit-card-types/credit-card-types.d.ts +4 -0
  49. package/dist/types/components/powered-by-favesalon/powered-by-favesalon.d.ts +4 -0
  50. package/dist/types/components/wizard-existing-user/wizard-existing-user.d.ts +19 -0
  51. package/dist/types/components/wizard-new-user/wizard-new-user.d.ts +23 -0
  52. package/dist/types/components.d.ts +108 -0
  53. package/dist/types/services/services.d.ts +55 -0
  54. package/dist/types/types/giftcard.d.ts +13 -0
  55. package/dist/types/types/salon.d.ts +1 -0
  56. package/package.json +4 -1
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, h } from './index-888e99e3.js';
2
- import { d as dayjs_min, H as HttpService, i as isVideoMedia, g as getSalonImage, s as shortDateYearFormat } from './services-ece4767f.js';
3
- import { r as relativeTime } from './relativeTime-268e64b0.js';
2
+ import { d as dayjs_min, H as HttpService, j as isVideoMedia, c as getSalonImage, f as shortDateYearFormat } from './services-82948efc.js';
3
+ import { r as relativeTime } from './relativeTime-15477f02.js';
4
4
  import { C as Colors } from './colors-ea36347a.js';
5
- import './_commonjsHelpers-a4f66ccd.js';
5
+ import './_commonjsHelpers-9bc404fc.js';
6
6
 
7
7
  const indexCss = ".salon-modal.salon-modal--lookbook-detail .salon-modal--close{display:none !important}.salon-modal.salon-modal--lookbook-detail .salon-modal--content{background-color:#fff;position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:1000;overflow-y:auto}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--image{height:240px !important}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--thumbnails{text-align:center}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--thumbnail{display:inline-block;margin-top:12px;margin-right:12px;height:40px;width:60px}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--button{border:none;position:absolute;top:50%;z-index:20;height:40px;width:40px;-moz-border-radius:50px;-webkit-border-radius:50px;border-radius:50px;-moz-transform:translate(0, -50%);-webkit-transform:translate(0, -50%);transform:translate(0, -50%)}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--prev{left:24px}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--next{right:24px}@media (min-width: 768px){.salon-modal.salon-modal--lookbook-detail .style-detail--slides--image{height:360px !important}}@media (min-width: 992px){.salon-modal.salon-modal--lookbook-detail .style-detail--slides--image{height:480px !important}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--thumbnail{height:56px;width:72px}}";
8
8
 
@@ -0,0 +1,33 @@
1
+ function wait(time = 1000) {
2
+ return new Promise(resolve => setTimeout(() => resolve({}), time));
3
+ }
4
+ function format(first, middle, last) {
5
+ return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
6
+ }
7
+ function formatWebsiteUrl(website) {
8
+ return !!website ? website.indexOf('http') > -1 ? website : `http://${website}` : null;
9
+ }
10
+ function formatFullAddress(salon) {
11
+ const { businessAddress, city, state, zipcode, } = salon || {};
12
+ const stateFields = [state, zipcode].filter(field => !!field);
13
+ if (businessAddress) {
14
+ return [businessAddress, city]
15
+ .filter(field => !!field)
16
+ .concat(stateFields.length > 0 ? [stateFields.join(' ')] : [])
17
+ .join(', ');
18
+ }
19
+ return null;
20
+ }
21
+ function getRatingText() {
22
+ return ['', 'Poor', 'Sufficient', 'Average', 'Well', 'Very good'];
23
+ }
24
+ function formatPhoneNumber(phone) {
25
+ debugger;
26
+ return String(phone || '')
27
+ .replace('(', '')
28
+ .replace(')', '')
29
+ .replace('-', '')
30
+ .replaceAll(' ', '');
31
+ }
32
+
33
+ export { formatWebsiteUrl as a, formatFullAddress as b, formatPhoneNumber as f, getRatingText as g };
@@ -0,0 +1,33 @@
1
+ function wait(time = 1000) {
2
+ return new Promise(resolve => setTimeout(() => resolve({}), time));
3
+ }
4
+ function format(first, middle, last) {
5
+ return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
6
+ }
7
+ function formatWebsiteUrl(website) {
8
+ return !!website ? website.indexOf('http') > -1 ? website : `http://${website}` : null;
9
+ }
10
+ function formatFullAddress(salon) {
11
+ const { businessAddress, city, state, zipcode, } = salon || {};
12
+ const stateFields = [state, zipcode].filter(field => !!field);
13
+ if (businessAddress) {
14
+ return [businessAddress, city]
15
+ .filter(field => !!field)
16
+ .concat(stateFields.length > 0 ? [stateFields.join(' ')] : [])
17
+ .join(', ');
18
+ }
19
+ return null;
20
+ }
21
+ function getRatingText() {
22
+ return ['', 'Poor', 'Sufficient', 'Average', 'Well', 'Very good'];
23
+ }
24
+ function formatPhoneNumber(phone) {
25
+ return String(phone || '')
26
+ .replaceAll('(', '')
27
+ .replaceAll(')', '')
28
+ .replaceAll('-', '')
29
+ .replaceAll('_', '')
30
+ .replaceAll(' ', '');
31
+ }
32
+
33
+ export { formatWebsiteUrl as a, formatFullAddress as b, formatPhoneNumber as f, getRatingText as g };
@@ -0,0 +1,34 @@
1
+ function wait(time = 1000) {
2
+ return new Promise(resolve => setTimeout(() => resolve({}), time));
3
+ }
4
+ function format(first, middle, last) {
5
+ return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
6
+ }
7
+ function formatWebsiteUrl(website) {
8
+ return !!website ? website.indexOf('http') > -1 ? website : `http://${website}` : null;
9
+ }
10
+ function formatFullAddress(salon) {
11
+ const { businessAddress, city, state, zipcode, } = salon || {};
12
+ const stateFields = [state, zipcode].filter(field => !!field);
13
+ if (businessAddress) {
14
+ return [businessAddress, city]
15
+ .filter(field => !!field)
16
+ .concat(stateFields.length > 0 ? [stateFields.join(' ')] : [])
17
+ .join(', ');
18
+ }
19
+ return null;
20
+ }
21
+ function getRatingText() {
22
+ return ['', 'Poor', 'Sufficient', 'Average', 'Well', 'Very good'];
23
+ }
24
+ function formatPhoneNumber(phone) {
25
+ debugger;
26
+ return String(phone || '')
27
+ .replace('(', '')
28
+ .replace(')', '')
29
+ .replace('-', '')
30
+ .replace('_', '')
31
+ .replaceAll(' ', '');
32
+ }
33
+
34
+ export { formatWebsiteUrl as a, formatFullAddress as b, formatPhoneNumber as f, getRatingText as g };
@@ -0,0 +1,33 @@
1
+ function wait(time = 1000) {
2
+ return new Promise(resolve => setTimeout(() => resolve({}), time));
3
+ }
4
+ function format(first, middle, last) {
5
+ return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
6
+ }
7
+ function formatWebsiteUrl(website) {
8
+ return !!website ? website.indexOf('http') > -1 ? website : `http://${website}` : null;
9
+ }
10
+ function formatFullAddress(salon) {
11
+ const { businessAddress, city, state, zipcode, } = salon || {};
12
+ const stateFields = [state, zipcode].filter(field => !!field);
13
+ if (businessAddress) {
14
+ return [businessAddress, city]
15
+ .filter(field => !!field)
16
+ .concat(stateFields.length > 0 ? [stateFields.join(' ')] : [])
17
+ .join(', ');
18
+ }
19
+ return null;
20
+ }
21
+ function getRatingText() {
22
+ return ['', 'Poor', 'Sufficient', 'Average', 'Well', 'Very good'];
23
+ }
24
+ function formatPhoneNumber(phone) {
25
+ return String(phone || '')
26
+ .replace('(', '')
27
+ .replace(')', '')
28
+ .replace('-', '')
29
+ .replace('_', '')
30
+ .replaceAll(' ', '');
31
+ }
32
+
33
+ export { formatWebsiteUrl as a, formatFullAddress as b, formatPhoneNumber as f, getRatingText as g };
@@ -0,0 +1,146 @@
1
+ import { r as registerInstance, h } from './index-888e99e3.js';
2
+ import { H as HttpService, g as get_1 } from './services-82948efc.js';
3
+ import { C as Colors } from './colors-ea36347a.js';
4
+ import './_commonjsHelpers-9bc404fc.js';
5
+
6
+ const wizardExistingUserCss = ".wizard-existing-user *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}";
7
+
8
+ var FormStep;
9
+ (function (FormStep) {
10
+ FormStep["Info"] = "Info";
11
+ FormStep["Activate"] = "Activate";
12
+ })(FormStep || (FormStep = {}));
13
+ const WizardExistingUser = class {
14
+ constructor(hostRef) {
15
+ registerInstance(this, hostRef);
16
+ this.activateAccount = async () => {
17
+ this.isSubmitting = true;
18
+ this.errorMessage = null;
19
+ try {
20
+ const currentUser = await HttpService().loginByPhoneCode({
21
+ phone_number: this.inputtedPhone,
22
+ login_code: this.activatCode,
23
+ });
24
+ setTimeout(() => this.onSuccess(currentUser), 300);
25
+ }
26
+ catch (error) {
27
+ let errorMessage = get_1(error, 'response.data.message', null);
28
+ if ((errorMessage || '').indexOf('Email has been exists') > -1) {
29
+ errorMessage = 'There was an existing account with your inputted info';
30
+ }
31
+ this.errorMessage = errorMessage || `Something went wrong when creating your account`;
32
+ }
33
+ this.isSubmitting = false;
34
+ };
35
+ this.sendLoginCode = async (resend) => {
36
+ this.isSubmitting = true;
37
+ this.errorMessage = null;
38
+ try {
39
+ await HttpService().sendLoginCode(this.inputtedPhone, this.salonId);
40
+ if (!resend) {
41
+ this.step = FormStep.Activate;
42
+ }
43
+ }
44
+ catch (error) {
45
+ let errorMessage = get_1(error, 'response.data.message');
46
+ if (!errorMessage || errorMessage === 'Error!') {
47
+ const twilioErrorMessages = get_1(error, 'response.data.data.twilio_error', []);
48
+ if (twilioErrorMessages.length > 0) {
49
+ errorMessage = twilioErrorMessages[0].note || `Failed to send activate code to your phone. Please try again or contact us via info@favesalon.com for assistance`;
50
+ }
51
+ }
52
+ this.errorMessage = errorMessage || 'Something went wrong when re-sending the code';
53
+ }
54
+ this.isSubmitting = false;
55
+ };
56
+ this.salonId = undefined;
57
+ this.inputtedPhone = undefined;
58
+ this.onClose = undefined;
59
+ this.onSuccess = undefined;
60
+ this.step = FormStep.Info;
61
+ this.errorMessage = undefined;
62
+ this.isSubmitting = undefined;
63
+ this.activatCode = undefined;
64
+ }
65
+ render() {
66
+ if (this.step === FormStep.Activate) {
67
+ return (h("div", { class: "wizard-existing-user" }, this.errorMessage && (h("div", { style: {
68
+ backgroundColor: Colors.Red01,
69
+ border: `1px solid ${Colors.Red02}`,
70
+ marginBottom: '24px',
71
+ padding: '16px',
72
+ } }, this.errorMessage)), h("div", { style: { marginBottom: '24px' } }, h("div", { style: {
73
+ fontSize: '20px',
74
+ fontWeight: '600',
75
+ } }, "Phone verification code sent!"), h("div", { style: {
76
+ marginTop: '4px',
77
+ } }, "You should receive a text message within 30 seconds")), h("div", { style: { marginBottom: '24px' } }, h("input", { type: "text", value: this.activatCode, onInput: (evt) => this.activatCode = evt.target.value, style: {
78
+ border: `1px solid ${Colors.Gray02}`,
79
+ backgroundColor: Colors.White,
80
+ borderRadius: '8px',
81
+ padding: '8px 16px',
82
+ height: '48px',
83
+ width: '100%',
84
+ fontSize: '22px',
85
+ fontWeight: '700',
86
+ } })), h("div", null, h("button", { type: "button", disabled: this.isSubmitting, style: {
87
+ border: `1px solid ${Colors.Secondary}`,
88
+ background: Colors.Secondary,
89
+ color: Colors.White,
90
+ borderRadius: '8px',
91
+ cursor: 'pointer',
92
+ fontSize: '16px',
93
+ fontWeight: '700',
94
+ paddingLeft: '24px',
95
+ paddingRight: '24px',
96
+ height: '48px',
97
+ width: '100%',
98
+ }, onClick: () => this.activateAccount() }, "Submit ", this.isSubmitting && (h("span", { class: "fs-spin", style: { marginLeft: '4px' } }, h("i", { class: "ri-loader-4-line" }))))), h("div", { style: { marginTop: '16px' } }, h("button", { type: "button", disabled: this.isSubmitting, style: {
99
+ border: `1px solid ${Colors.Gray02}`,
100
+ background: Colors.White,
101
+ color: Colors.TextColor,
102
+ borderRadius: '8px',
103
+ cursor: 'pointer',
104
+ fontSize: '16px',
105
+ paddingLeft: '24px',
106
+ paddingRight: '24px',
107
+ height: '48px',
108
+ width: '100%',
109
+ }, onClick: () => this.sendLoginCode(true) }, "Did not get the code?"))));
110
+ }
111
+ return (h("div", { class: "wizard-existing-user" }, this.errorMessage && (h("div", { style: {
112
+ backgroundColor: Colors.Red01,
113
+ border: `1px solid ${Colors.Red02}`,
114
+ marginBottom: '24px',
115
+ padding: '16px',
116
+ } }, this.errorMessage)), h("div", { style: { marginBottom: '24px' } }, h("div", { style: {
117
+ fontSize: '20px',
118
+ fontWeight: '600',
119
+ } }, "Need verification"), h("div", { style: { marginTop: '4px' } }, "We will send you a code to verify your idenity to protect your account"), h("div", { style: { marginTop: '8px', color: Colors.Red03 } }, "Agreed to receive SMS to phone ", this.inputtedPhone)), h("div", { style: { textAlign: 'right' } }, h("button", { type: "button", disabled: this.isSubmitting, style: {
120
+ border: `1px solid ${Colors.Gray03}`,
121
+ background: Colors.White,
122
+ color: Colors.TextColor,
123
+ borderRadius: '8px',
124
+ cursor: 'pointer',
125
+ fontSize: '16px',
126
+ paddingLeft: '24px',
127
+ paddingRight: '24px',
128
+ height: '48px',
129
+ marginRight: '16px',
130
+ }, onClick: () => this.onClose() }, "Cancel"), h("button", { type: "button", disabled: this.isSubmitting, style: {
131
+ border: `1px solid ${Colors.Secondary}`,
132
+ background: Colors.Secondary,
133
+ color: Colors.White,
134
+ borderRadius: '8px',
135
+ cursor: 'pointer',
136
+ fontSize: '16px',
137
+ fontWeight: '700',
138
+ paddingLeft: '24px',
139
+ paddingRight: '24px',
140
+ height: '48px',
141
+ }, onClick: () => this.sendLoginCode() }, "Verify now ", this.isSubmitting && (h("span", { class: "fs-spin", style: { marginLeft: '4px' } }, h("i", { class: "ri-loader-4-line" })))))));
142
+ }
143
+ };
144
+ WizardExistingUser.style = wizardExistingUserCss;
145
+
146
+ export { WizardExistingUser as wizard_existing_user };
@@ -0,0 +1,178 @@
1
+ import { r as registerInstance, h } from './index-888e99e3.js';
2
+ import { H as HttpService, g as get_1 } from './services-82948efc.js';
3
+ import { C as Colors } from './colors-ea36347a.js';
4
+ import './_commonjsHelpers-9bc404fc.js';
5
+
6
+ const wizardNewUserCss = ".wizard-new-user *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}";
7
+
8
+ var FormStep;
9
+ (function (FormStep) {
10
+ FormStep["Info"] = "Info";
11
+ FormStep["Activate"] = "Activate";
12
+ FormStep["NoCode"] = "No Code";
13
+ })(FormStep || (FormStep = {}));
14
+ const WizardNewUser = class {
15
+ constructor(hostRef) {
16
+ registerInstance(this, hostRef);
17
+ this.sendLoginCode = async (resend) => {
18
+ this.isSubmitting = true;
19
+ this.errorMessage = null;
20
+ try {
21
+ await HttpService().sendLoginCode(this.inputtedPhone, this.salonId);
22
+ if (!resend) {
23
+ this.step = FormStep.Activate;
24
+ }
25
+ }
26
+ catch (error) {
27
+ let errorMessage = get_1(error, 'response.data.message');
28
+ if (!errorMessage || errorMessage === 'Error!') {
29
+ const twilioErrorMessages = get_1(error, 'response.data.data.twilio_error', []);
30
+ if (twilioErrorMessages.length > 0) {
31
+ errorMessage = twilioErrorMessages[0].note || `Failed to send activate code to your phone. Please try again or contact us via info@favesalon.com for assistance`;
32
+ }
33
+ }
34
+ this.errorMessage = errorMessage || 'Something went wrong when re-sending the code';
35
+ }
36
+ this.isSubmitting = false;
37
+ };
38
+ this.activateAccount = async () => {
39
+ this.isSubmitting = true;
40
+ this.errorMessage = null;
41
+ try {
42
+ const currentUser = await HttpService().activateUserAccount({
43
+ email: `${this.inputtedPhone}@favesalon.com`,
44
+ code: this.activatCode,
45
+ });
46
+ setTimeout(() => this.onSuccess(currentUser), 300);
47
+ }
48
+ catch (error) {
49
+ let errorMessage = get_1(error, 'response.data.message', null);
50
+ if ((errorMessage || '').indexOf('Email has been exists') > -1) {
51
+ errorMessage = 'There was an existing account with your inputted info';
52
+ }
53
+ this.errorMessage = errorMessage || `Something went wrong when creating your account`;
54
+ }
55
+ this.isSubmitting = false;
56
+ };
57
+ this.verifyAccount = async () => {
58
+ this.isSubmitting = true;
59
+ this.errorMessage = null;
60
+ try {
61
+ await HttpService().createAccount({
62
+ email: `${this.inputtedPhone}@favesalon.com`,
63
+ mobile_phone: this.inputtedPhone,
64
+ first_name: this.firstName,
65
+ last_name: this.lastName,
66
+ password: '12345abc!',
67
+ user_type: 1, // Consumer account
68
+ });
69
+ this.step = FormStep.Activate;
70
+ }
71
+ catch (error) {
72
+ let errorMessage = get_1(error, 'response.data.message', null);
73
+ if (!errorMessage || errorMessage === 'Error!') {
74
+ const twilioErrorMessages = get_1(error, 'response.data.data.twilio_error', []);
75
+ if (twilioErrorMessages.length > 0) {
76
+ errorMessage = twilioErrorMessages[0].note || `Failed to send activate code to your phone. Please try again or contact us via info@favesalon.com for assistance`;
77
+ }
78
+ }
79
+ if ((errorMessage || '').indexOf('Email has been exists') > -1) {
80
+ errorMessage = 'There was an existing account with your inputted info';
81
+ }
82
+ this.errorMessage = errorMessage || `Something went wrong when creating your account`;
83
+ }
84
+ this.isSubmitting = false;
85
+ };
86
+ this.salonId = undefined;
87
+ this.inputtedPhone = undefined;
88
+ this.firstName = undefined;
89
+ this.lastName = undefined;
90
+ this.onClose = undefined;
91
+ this.onSuccess = undefined;
92
+ this.step = FormStep.Info;
93
+ this.errorMessage = undefined;
94
+ this.isSubmitting = undefined;
95
+ this.activatCode = undefined;
96
+ }
97
+ render() {
98
+ if (this.step === FormStep.Activate) {
99
+ return (h("div", { class: "wizard-new-user" }, this.errorMessage && (h("div", { style: {
100
+ backgroundColor: Colors.Red01,
101
+ border: `1px solid ${Colors.Red02}`,
102
+ marginBottom: '24px',
103
+ padding: '16px',
104
+ } }, this.errorMessage)), h("div", { style: { marginBottom: '24px' } }, h("div", { style: {
105
+ fontSize: '20px',
106
+ fontWeight: '600',
107
+ } }, "Phone verification code sent!"), h("div", { style: {
108
+ marginTop: '4px',
109
+ } }, "You should receive a text message within 30 seconds")), h("div", { style: { marginBottom: '24px' } }, h("input", { type: "text", value: this.activatCode, onInput: (evt) => this.activatCode = evt.target.value, style: {
110
+ border: `1px solid ${Colors.Gray02}`,
111
+ backgroundColor: Colors.White,
112
+ borderRadius: '8px',
113
+ padding: '8px 16px',
114
+ height: '48px',
115
+ width: '100%',
116
+ fontSize: '22px',
117
+ fontWeight: '700',
118
+ } })), h("div", null, h("button", { type: "button", disabled: this.isSubmitting, style: {
119
+ border: `1px solid ${Colors.Secondary}`,
120
+ background: Colors.Secondary,
121
+ color: Colors.White,
122
+ borderRadius: '8px',
123
+ cursor: 'pointer',
124
+ fontSize: '16px',
125
+ fontWeight: '700',
126
+ paddingLeft: '24px',
127
+ paddingRight: '24px',
128
+ height: '48px',
129
+ width: '100%',
130
+ }, onClick: () => this.activateAccount() }, "Submit ", this.isSubmitting && (h("span", { class: "fs-spin", style: { marginLeft: '4px' } }, h("i", { class: "ri-loader-4-line" }))))), h("div", { style: { marginTop: '16px' } }, h("button", { type: "button", disabled: this.isSubmitting, style: {
131
+ border: `1px solid ${Colors.Gray02}`,
132
+ background: Colors.White,
133
+ color: Colors.TextColor,
134
+ borderRadius: '8px',
135
+ cursor: 'pointer',
136
+ fontSize: '16px',
137
+ paddingLeft: '24px',
138
+ paddingRight: '24px',
139
+ height: '48px',
140
+ width: '100%',
141
+ }, onClick: () => this.sendLoginCode(true) }, "Did not get the code?"))));
142
+ }
143
+ return (h("div", { class: "wizard-new-user" }, this.errorMessage && (h("div", { style: {
144
+ backgroundColor: Colors.Red01,
145
+ border: `1px solid ${Colors.Red02}`,
146
+ marginBottom: '24px',
147
+ padding: '16px',
148
+ } }, this.errorMessage)), h("div", { style: { marginBottom: '24px' } }, h("div", { style: {
149
+ fontSize: '20px',
150
+ fontWeight: '600',
151
+ } }, "Your first time purchase gift card"), h("div", { style: { marginTop: '4px' } }, "We need to verify your phone number to prevent online spam purchases."), h("div", { style: { marginTop: '12px' } }, "You agreed to receive SMS to the phone number provided. ", h("br", null), "Message frequency varies. Msg & data rates may apply. Reply STOP to Opt-Out. Reply HELP for help."), h("div", { style: { marginTop: '4px' } }, "View our ", h("a", { target: "_blank", rel: "noopener noreferrer", href: "https://fave.salon/r/privacy-policy", style: { color: Colors.TextColor, textDecoration: 'underline' } }, "Privacy Policy"), " and ", h("a", { target: "_blank", rel: "noopener noreferrer", href: "https://fave.salon//r/terms-for-client", style: { color: Colors.TextColor, textDecoration: 'underline' } }, "Terms of Service"))), h("div", { style: { textAlign: 'right' } }, h("button", { type: "button", disabled: this.isSubmitting, style: {
152
+ border: `1px solid ${Colors.Gray03}`,
153
+ background: Colors.White,
154
+ color: Colors.TextColor,
155
+ borderRadius: '8px',
156
+ cursor: 'pointer',
157
+ fontSize: '16px',
158
+ paddingLeft: '24px',
159
+ paddingRight: '24px',
160
+ height: '48px',
161
+ marginRight: '16px',
162
+ }, onClick: () => this.onClose() }, "Cancel"), h("button", { type: "button", disabled: this.isSubmitting, style: {
163
+ border: `1px solid ${Colors.Secondary}`,
164
+ background: Colors.Secondary,
165
+ color: Colors.White,
166
+ borderRadius: '8px',
167
+ cursor: 'pointer',
168
+ fontSize: '16px',
169
+ fontWeight: '700',
170
+ paddingLeft: '24px',
171
+ paddingRight: '24px',
172
+ height: '48px',
173
+ }, onClick: () => this.verifyAccount() }, "Verify now ", this.isSubmitting && (h("span", { class: "fs-spin", style: { marginLeft: '4px' } }, h("i", { class: "ri-loader-4-line" })))))));
174
+ }
175
+ };
176
+ WizardNewUser.style = wizardNewUserCss;
177
+
178
+ export { WizardNewUser as wizard_new_user };
@@ -0,0 +1,57 @@
1
+ import { User } from '../../types/user';
2
+ import { Salon } from '../../types/salon';
3
+ declare enum DeliveryType {
4
+ Email = 0,
5
+ SMS = 1
6
+ }
7
+ declare enum FormStep {
8
+ GiftCardInfo = "Gift Card Info",
9
+ PaymentInfo = "Payment Info",
10
+ PaymentSucceed = "Payment Succeed"
11
+ }
12
+ export declare class BuyGiftcardForm {
13
+ salonId: string;
14
+ teConnect: any;
15
+ isLoading: boolean;
16
+ isSubmitting: boolean;
17
+ errorMessage: string;
18
+ userInfo: User;
19
+ salonInfo: Salon;
20
+ giftCardSettings: any;
21
+ magensaCredentials: any;
22
+ step: FormStep;
23
+ selectedAmount: number;
24
+ customAmount: number;
25
+ deliveryType: DeliveryType;
26
+ deliveryDate: string;
27
+ recipientFirstName: string;
28
+ recipientLastName: string;
29
+ recipientEmail: string;
30
+ recipientEmailConfirm: string;
31
+ recipientMessage: string;
32
+ isInvalidEmails: boolean;
33
+ isInvalidPhones: boolean;
34
+ selectedStyleId: number;
35
+ isDeliveryDoneVisible: boolean;
36
+ componentDidLoad(): Promise<void>;
37
+ private fetchMagensaCredentials;
38
+ private fetchSalonInfo;
39
+ private fetchGiftCardSettings;
40
+ private initMagensaPayment;
41
+ private onClickDeliveryDone;
42
+ private renderPaymentOnlineDisabled;
43
+ private renderUserVerificationForm;
44
+ private onChangeEmail;
45
+ private onChangeConfirmEmail;
46
+ private onSubmitGiftCardForm;
47
+ private renderGiftCardForm;
48
+ private renderPaymentSucceed;
49
+ private createCardPayment;
50
+ private processCardToken;
51
+ private onSubmitPaymentForm;
52
+ private renderPaymentForm;
53
+ private renderSalonInfo;
54
+ private renderSkeletons;
55
+ render(): any;
56
+ }
57
+ export {};
@@ -0,0 +1,23 @@
1
+ import { User } from '../../types/user';
2
+ declare enum FormStep {
3
+ InputPhone = "Input Phone",
4
+ BookingGuests = "Booking Guests",
5
+ UserLogin = "User Login",
6
+ UserRegister = "Booking Register"
7
+ }
8
+ export declare class BuyGiftcardVerification {
9
+ nativeInput?: HTMLInputElement;
10
+ salonId: string;
11
+ onSuccess: (user: User) => void;
12
+ step: FormStep;
13
+ userInfo: User;
14
+ inputtedPhone: string;
15
+ isSearchingUser: boolean;
16
+ componentDidLoad(): void;
17
+ private onSubmitUserInfo;
18
+ private renderUserInfoForm;
19
+ private onSearchClient;
20
+ private renderSearchClientForm;
21
+ render(): any;
22
+ }
23
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare class CreditCardTypes {
2
+ css: any;
3
+ render(): any;
4
+ }
@@ -0,0 +1,4 @@
1
+ export declare class PoweredByFavesalon {
2
+ css: any;
3
+ render(): any;
4
+ }
@@ -0,0 +1,19 @@
1
+ import { User } from '../../types/user';
2
+ declare enum FormStep {
3
+ Info = "Info",
4
+ Activate = "Activate"
5
+ }
6
+ export declare class WizardExistingUser {
7
+ salonId: string;
8
+ inputtedPhone: string;
9
+ onClose: () => void;
10
+ onSuccess: (user: User) => void;
11
+ step: FormStep;
12
+ errorMessage: string;
13
+ isSubmitting: boolean;
14
+ activatCode: string;
15
+ private activateAccount;
16
+ private sendLoginCode;
17
+ render(): any;
18
+ }
19
+ export {};
@@ -0,0 +1,23 @@
1
+ import { User } from '../../types/user';
2
+ declare enum FormStep {
3
+ Info = "Info",
4
+ Activate = "Activate",
5
+ NoCode = "No Code"
6
+ }
7
+ export declare class WizardNewUser {
8
+ salonId: string;
9
+ inputtedPhone: string;
10
+ firstName: string;
11
+ lastName: string;
12
+ onClose: () => void;
13
+ onSuccess: (user: User) => void;
14
+ step: FormStep;
15
+ errorMessage: string;
16
+ isSubmitting: boolean;
17
+ activatCode: string;
18
+ private sendLoginCode;
19
+ private activateAccount;
20
+ private verifyAccount;
21
+ render(): any;
22
+ }
23
+ export {};