favesalon-embed 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/_commonjsHelpers-5cfcba41.js +36 -0
  3. package/dist/cjs/colors-38421769.js +69 -0
  4. package/dist/cjs/favesalon-embed.cjs.js +20 -0
  5. package/{cjs → dist/cjs}/global-9073d10e.js +0 -0
  6. package/dist/cjs/google-map_5.cjs.entry.js +291 -0
  7. package/dist/cjs/index-7f190886.js +4396 -0
  8. package/{cjs/index-7d179a70.js → dist/cjs/index-e6bea8f5.js} +87 -3
  9. package/{cjs → dist/cjs}/index.cjs.js +0 -0
  10. package/dist/cjs/loader.cjs.js +22 -0
  11. package/dist/cjs/salon-booking-modal.cjs.entry.js +29 -0
  12. package/dist/cjs/salon-booking.cjs.entry.js +50 -0
  13. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +28 -0
  14. package/dist/cjs/salon-gift-card.cjs.entry.js +50 -0
  15. package/dist/cjs/salon-latest-reviews.cjs.entry.js +95 -0
  16. package/dist/cjs/salon-lookbook.cjs.entry.js +218 -0
  17. package/{cjs → dist/cjs}/salon-ranking.cjs.entry.js +7 -7
  18. package/dist/cjs/salon-reviews.cjs.entry.js +186 -0
  19. package/dist/cjs/salon-services.cjs.entry.js +78 -0
  20. package/dist/cjs/salon-stylists.cjs.entry.js +112 -0
  21. package/{cjs/services-d6f8214c.js → dist/cjs/services-eee8f251.js} +317 -361
  22. package/dist/cjs/style-detail.cjs.entry.js +310 -0
  23. package/{cjs → dist/cjs}/user-avatar.cjs.entry.js +4 -4
  24. package/{cjs → dist/cjs}/utils-c5a33b3c.js +0 -0
  25. package/{collection → dist/collection}/collection-manifest.json +2 -2
  26. package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
  27. package/{collection → dist/collection}/components/google-map/index.css +0 -1
  28. package/dist/collection/components/google-map/index.js +86 -0
  29. package/{collection → dist/collection}/components/salon-booking/index.css +10 -24
  30. package/{collection → dist/collection}/components/salon-booking/index.js +29 -11
  31. package/{collection → dist/collection}/components/salon-booking/salon-booking-modal.js +12 -6
  32. package/dist/collection/components/salon-gift-card/index.css +25 -0
  33. package/{collection → dist/collection}/components/salon-gift-card/index.js +44 -6
  34. package/{collection → dist/collection}/components/salon-gift-card/salon-gift-card-modal.js +30 -4
  35. package/{collection/components/salon-locations → dist/collection/components/salon-info}/index.css +0 -0
  36. package/{collection → dist/collection}/components/salon-info/index.js +6 -32
  37. package/{collection → dist/collection}/components/salon-latest-reviews/index.css +0 -3
  38. package/dist/collection/components/salon-latest-reviews/index.js +176 -0
  39. package/dist/collection/components/salon-latest-styles/index.css +10 -0
  40. package/dist/collection/components/salon-latest-styles/index.js +178 -0
  41. package/{collection/components/salon-contact → dist/collection/components/salon-locations}/index.css +6 -6
  42. package/dist/collection/components/salon-locations/index.js +151 -0
  43. package/dist/collection/components/salon-lookbook/index.css +12 -0
  44. package/{collection → dist/collection}/components/salon-lookbook/index.js +122 -49
  45. package/{collection → dist/collection}/components/salon-ranking/index.css +0 -0
  46. package/{collection → dist/collection}/components/salon-ranking/index.js +5 -5
  47. package/dist/collection/components/salon-reviews/index.css +15 -0
  48. package/dist/collection/components/salon-reviews/index.js +286 -0
  49. package/dist/collection/components/salon-schedules/index.css +15 -0
  50. package/dist/collection/components/salon-schedules/index.js +189 -0
  51. package/{collection/components/salon-reviews → dist/collection/components/salon-services}/index.css +0 -0
  52. package/dist/collection/components/salon-services/index.js +156 -0
  53. package/{collection → dist/collection}/components/salon-stylists/index.css +0 -8
  54. package/dist/collection/components/salon-stylists/index.js +183 -0
  55. package/dist/collection/components/style-detail/index.css +62 -0
  56. package/dist/collection/components/style-detail/index.js +461 -0
  57. package/{collection/components/salon-services → dist/collection/components/user-avatar}/index.css +0 -0
  58. package/{collection → dist/collection}/components/user-avatar/index.js +2 -2
  59. package/dist/collection/constants/colors.js +65 -0
  60. package/{collection → dist/collection}/global/global.js +0 -0
  61. package/{collection → dist/collection}/index.js +0 -0
  62. package/dist/collection/services/services.js +174 -0
  63. package/dist/collection/types/common.js +11 -0
  64. package/{collection → dist/collection}/types/review.js +9 -5
  65. package/dist/collection/types/salon.js +58 -0
  66. package/{collection → dist/collection}/types/service.js +0 -0
  67. package/dist/collection/types/style.js +128 -0
  68. package/dist/collection/types/stylist.js +30 -0
  69. package/{collection/components/user-avatar/index.css → dist/collection/types/tmp.js} +0 -0
  70. package/{collection → dist/collection}/types/user.js +2 -2
  71. package/{collection → dist/collection}/utils/utils.js +0 -0
  72. package/{custom-elements → dist/custom-elements}/index.d.ts +12 -12
  73. package/{custom-elements → dist/custom-elements}/index.js +5783 -870
  74. package/dist/esm/_commonjsHelpers-098d5b27.js +32 -0
  75. package/dist/esm/colors-ea36347a.js +67 -0
  76. package/dist/esm/favesalon-embed.js +18 -0
  77. package/{esm → dist/esm}/global-e1089ffd.js +0 -0
  78. package/dist/esm/google-map_5.entry.js +283 -0
  79. package/{esm/index-2160b80b.js → dist/esm/index-6af0a03d.js} +87 -4
  80. package/dist/esm/index-80523fec.js +4393 -0
  81. package/{esm → dist/esm}/index.js +0 -0
  82. package/dist/esm/loader.js +18 -0
  83. package/{esm → dist/esm}/polyfills/core-js.js +0 -0
  84. package/{esm → dist/esm}/polyfills/css-shim.js +0 -0
  85. package/{esm → dist/esm}/polyfills/dom.js +0 -0
  86. package/{esm → dist/esm}/polyfills/es5-html-element.js +0 -0
  87. package/{esm → dist/esm}/polyfills/index.js +0 -0
  88. package/{esm → dist/esm}/polyfills/system.js +0 -0
  89. package/dist/esm/salon-booking-modal.entry.js +25 -0
  90. package/dist/esm/salon-booking.entry.js +46 -0
  91. package/dist/esm/salon-gift-card-modal.entry.js +24 -0
  92. package/dist/esm/salon-gift-card.entry.js +46 -0
  93. package/dist/esm/salon-latest-reviews.entry.js +91 -0
  94. package/dist/esm/salon-lookbook.entry.js +214 -0
  95. package/{esm → dist/esm}/salon-ranking.entry.js +7 -7
  96. package/dist/esm/salon-reviews.entry.js +182 -0
  97. package/dist/esm/salon-services.entry.js +74 -0
  98. package/dist/esm/salon-stylists.entry.js +108 -0
  99. package/{esm/services-57fadd0a.js → dist/esm/services-295247b1.js} +310 -355
  100. package/dist/esm/style-detail.entry.js +306 -0
  101. package/{esm → dist/esm}/user-avatar.entry.js +4 -4
  102. package/{esm → dist/esm}/utils-e97485e0.js +0 -0
  103. package/dist/favesalon-embed/assets/map--placeholder.jpeg +0 -0
  104. package/{favesalon-embed → dist/favesalon-embed}/favesalon-embed.css +1 -1
  105. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -0
  106. package/{favesalon-embed → dist/favesalon-embed}/index.esm.js +0 -0
  107. package/dist/favesalon-embed/p-292b97ba.entry.js +1 -0
  108. package/{favesalon-embed → dist/favesalon-embed}/p-47e646f8.js +0 -0
  109. package/dist/favesalon-embed/p-4869dfed.entry.js +1 -0
  110. package/{favesalon-embed → dist/favesalon-embed}/p-4a5eca9a.js +0 -0
  111. package/dist/favesalon-embed/p-4aee4fd9.entry.js +1 -0
  112. package/dist/favesalon-embed/p-5528c705.entry.js +1 -0
  113. package/dist/favesalon-embed/p-612ad685.entry.js +1 -0
  114. package/dist/favesalon-embed/p-75aef7e0.entry.js +1 -0
  115. package/dist/favesalon-embed/p-8c780874.entry.js +1 -0
  116. package/dist/favesalon-embed/p-8dbf04c5.js +1 -0
  117. package/dist/favesalon-embed/p-9f31061a.entry.js +1 -0
  118. package/dist/favesalon-embed/p-a33331cc.js +1 -0
  119. package/dist/favesalon-embed/p-a60d78e9.entry.js +1 -0
  120. package/dist/favesalon-embed/p-a6debdae.entry.js +1 -0
  121. package/dist/favesalon-embed/p-bad1e9a7.entry.js +1 -0
  122. package/dist/favesalon-embed/p-c2ecb365.js +1 -0
  123. package/dist/favesalon-embed/p-c7dea70c.entry.js +1 -0
  124. package/dist/favesalon-embed/p-d6083940.js +1 -0
  125. package/dist/favesalon-embed/p-f0e14641.entry.js +1 -0
  126. package/dist/favesalon-embed/p-fc9a5551.js +6 -0
  127. package/{index.cjs.js → dist/index.cjs.js} +0 -0
  128. package/{index.js → dist/index.js} +0 -0
  129. package/dist/types/components/google-map/index.d.ts +5 -0
  130. package/{types → dist/types}/components/salon-booking/index.d.ts +1 -1
  131. package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +1 -0
  132. package/{types → dist/types}/components/salon-gift-card/index.d.ts +2 -1
  133. package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +2 -0
  134. package/{types → dist/types}/components/salon-info/index.d.ts +0 -1
  135. package/{types → dist/types}/components/salon-latest-reviews/index.d.ts +2 -0
  136. package/dist/types/components/salon-latest-styles/index.d.ts +12 -0
  137. package/{types → dist/types}/components/salon-locations/index.d.ts +2 -0
  138. package/{types → dist/types}/components/salon-lookbook/index.d.ts +7 -2
  139. package/{types → dist/types}/components/salon-ranking/index.d.ts +0 -0
  140. package/dist/types/components/salon-reviews/index.d.ts +24 -0
  141. package/{types → dist/types}/components/salon-schedules/index.d.ts +2 -0
  142. package/{types → dist/types}/components/salon-services/index.d.ts +2 -0
  143. package/{types → dist/types}/components/salon-stylists/index.d.ts +6 -0
  144. package/dist/types/components/style-detail/index.d.ts +24 -0
  145. package/{types → dist/types}/components/user-avatar/index.d.ts +0 -0
  146. package/{types → dist/types}/components.d.ts +62 -41
  147. package/dist/types/constants/colors.d.ts +65 -0
  148. package/{types → dist/types}/index.d.ts +0 -0
  149. package/dist/types/services/services.d.ts +60 -0
  150. package/{types → dist/types}/stencil-public-runtime.d.ts +0 -0
  151. package/dist/types/types/common.d.ts +11 -0
  152. package/{types → dist/types}/types/review.d.ts +4 -0
  153. package/{types → dist/types}/types/salon.d.ts +3 -1
  154. package/{types → dist/types}/types/service.d.ts +0 -0
  155. package/dist/types/types/style.d.ts +88 -0
  156. package/{types → dist/types}/types/stylist.d.ts +2 -1
  157. package/dist/types/types/tmp.d.ts +0 -0
  158. package/{types → dist/types}/types/user.d.ts +2 -2
  159. package/{types → dist/types}/utils/utils.d.ts +0 -0
  160. package/loader/cdn.js +3 -0
  161. package/loader/index.cjs.js +3 -0
  162. package/loader/index.d.ts +12 -0
  163. package/loader/index.es2017.js +3 -0
  164. package/loader/index.js +4 -0
  165. package/loader/package.json +10 -0
  166. package/package.json +18 -13
  167. package/readme.md +23 -2
  168. package/cjs/colors-7f354880.js +0 -95
  169. package/cjs/favesalon-embed.cjs.js +0 -20
  170. package/cjs/google-map.cjs.entry.js +0 -47
  171. package/cjs/loader.cjs.js +0 -22
  172. package/cjs/salon-booking-modal.cjs.entry.js +0 -23
  173. package/cjs/salon-booking_2.cjs.entry.js +0 -56
  174. package/cjs/salon-contact_4.cjs.entry.js +0 -154
  175. package/cjs/salon-gift-card-modal.cjs.entry.js +0 -20
  176. package/cjs/salon-info.cjs.entry.js +0 -34
  177. package/cjs/salon-latest-reviews.cjs.entry.js +0 -57
  178. package/cjs/salon-lookbook.cjs.entry.js +0 -187
  179. package/cjs/salon-reviews.cjs.entry.js +0 -196
  180. package/cjs/salon-services.cjs.entry.js +0 -40
  181. package/cjs/salon-stylists.cjs.entry.js +0 -53
  182. package/collection/components/google-map/index.js +0 -97
  183. package/collection/components/salon-contact/index.js +0 -88
  184. package/collection/components/salon-gift-card/index.css +0 -25
  185. package/collection/components/salon-info/index.css +0 -3
  186. package/collection/components/salon-latest-reviews/index.js +0 -108
  187. package/collection/components/salon-locations/index.js +0 -80
  188. package/collection/components/salon-lookbook/index.css +0 -12
  189. package/collection/components/salon-reviews/index.js +0 -291
  190. package/collection/components/salon-schedules/index.css +0 -14
  191. package/collection/components/salon-schedules/index.js +0 -103
  192. package/collection/components/salon-services/index.js +0 -86
  193. package/collection/components/salon-styles/index.css +0 -23
  194. package/collection/components/salon-styles/index.js +0 -100
  195. package/collection/components/salon-stylists/index.js +0 -96
  196. package/collection/constants/colors.js +0 -91
  197. package/collection/services/services.js +0 -203
  198. package/collection/types/common.js +0 -2
  199. package/collection/types/salon.js +0 -52
  200. package/collection/types/style.js +0 -28
  201. package/collection/types/stylist.js +0 -13
  202. package/esm/colors-1ec90c5f.js +0 -93
  203. package/esm/favesalon-embed.js +0 -18
  204. package/esm/google-map.entry.js +0 -43
  205. package/esm/loader.js +0 -18
  206. package/esm/salon-booking-modal.entry.js +0 -19
  207. package/esm/salon-booking_2.entry.js +0 -51
  208. package/esm/salon-contact_4.entry.js +0 -147
  209. package/esm/salon-gift-card-modal.entry.js +0 -16
  210. package/esm/salon-info.entry.js +0 -30
  211. package/esm/salon-latest-reviews.entry.js +0 -53
  212. package/esm/salon-lookbook.entry.js +0 -183
  213. package/esm/salon-reviews.entry.js +0 -192
  214. package/esm/salon-services.entry.js +0 -36
  215. package/esm/salon-stylists.entry.js +0 -49
  216. package/favesalon-embed/favesalon-embed.esm.js +0 -1
  217. package/favesalon-embed/p-14a46adf.entry.js +0 -1
  218. package/favesalon-embed/p-2da2ed75.js +0 -1
  219. package/favesalon-embed/p-3712d9ab.entry.js +0 -1
  220. package/favesalon-embed/p-38066f9f.entry.js +0 -1
  221. package/favesalon-embed/p-4e2d7b29.js +0 -1
  222. package/favesalon-embed/p-520c8ffb.entry.js +0 -1
  223. package/favesalon-embed/p-54a1c294.entry.js +0 -1
  224. package/favesalon-embed/p-762520f2.js +0 -1
  225. package/favesalon-embed/p-94a0991e.entry.js +0 -1
  226. package/favesalon-embed/p-94b179eb.entry.js +0 -1
  227. package/favesalon-embed/p-977bd8bc.entry.js +0 -1
  228. package/favesalon-embed/p-bc363938.entry.js +0 -1
  229. package/favesalon-embed/p-bf9c83a3.entry.js +0 -1
  230. package/favesalon-embed/p-c5ebd3c9.entry.js +0 -1
  231. package/favesalon-embed/p-d84b61b0.entry.js +0 -1
  232. package/favesalon-embed/p-f15bcb43.entry.js +0 -1
  233. package/types/components/google-map/index.d.ts +0 -10
  234. package/types/components/salon-contact/index.d.ts +0 -9
  235. package/types/components/salon-reviews/index.d.ts +0 -23
  236. package/types/components/salon-styles/index.d.ts +0 -9
  237. package/types/constants/colors.d.ts +0 -88
  238. package/types/services/services.d.ts +0 -24
  239. package/types/types/common.d.ts +0 -2
  240. package/types/types/style.d.ts +0 -49
@@ -1,154 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-7d179a70.js');
6
- const colors = require('./colors-7f354880.js');
7
- const utils = require('./utils-c5a33b3c.js');
8
- const services = require('./services-d6f8214c.js');
9
-
10
- const indexCss$3 = "@media (min-width: 768px){.salon-contact--links{overflow:hidden;margin-left:-32px}.salon-contact--links .salon-contact--links-item{float:left;display:flex;flex-direction:row;align-items:center;font-size:16px;min-width:300px;padding-left:32px;margin-top:8px}.salon-contact--links .salon-contact--links-item:nth-child(2n+1){clear:left}}";
11
-
12
- let SalonContact = class {
13
- constructor(hostRef) {
14
- index.registerInstance(this, hostRef);
15
- }
16
- componentWillLoad() {
17
- if (this.salonInfo) {
18
- this.salonInfoState = JSON.parse(this.salonInfo);
19
- }
20
- else {
21
- this.fetchData();
22
- }
23
- }
24
- fetchData() {
25
- try {
26
- services.HttpService().fetchSalonInfo(this.salonId)
27
- .then(salonInfo => this.salonInfoState = salonInfo);
28
- }
29
- catch (e) { }
30
- }
31
- render() {
32
- const { about, email, website, businessPhone, } = (this.salonInfoState || {});
33
- const websiteUrl = utils.formatWebsiteUrl(website);
34
- return (index.h("div", { class: "view view--salon-contact" }, index.h("div", { class: "view-content" }, index.h("div", { style: { fontSize: '16px', fontWeight: 'bold' } }, "Contact info"), index.h("div", { class: "salon-contact--links" }, businessPhone && (index.h("div", { class: "salon-contact--links-item" }, index.h("i", { class: "ri-phone-line", style: { color: colors.Colors.Gray03, fontSize: '18px', marginRight: '6px' } }), " ", businessPhone)), websiteUrl && (index.h("div", { class: "salon-contact--links-item" }, index.h("i", { class: "ri-links-line", style: { color: colors.Colors.Gray03, fontSize: '18px', marginRight: '6px' } }), " ", index.h("a", { target: websiteUrl && websiteUrl.indexOf(window.location.hostname) === -1 ? '_blank' : undefined, href: websiteUrl, style: { color: colors.Colors.Gray01, textDecoration: 'none' } }, websiteUrl))), email && (index.h("div", { class: "salon-contact--links-item" }, index.h("i", { class: "ri-mail-line", style: { color: colors.Colors.Gray03, fontSize: '18px', marginRight: '6px' } }), " ", index.h("a", { href: `mailto:${email}`, style: { color: colors.Colors.Gray01, textDecoration: 'none' } }, email)))), index.h("div", { class: "salon-contact--info--desc", style: { fontSize: '16px', marginTop: '16px' }, innerHTML: about }))));
35
- }
36
- };
37
- SalonContact.style = indexCss$3;
38
-
39
- const indexCss$2 = "";
40
-
41
- let SalonLocations = class {
42
- constructor(hostRef) {
43
- index.registerInstance(this, hostRef);
44
- }
45
- componentWillLoad() {
46
- if (this.salonInfo) {
47
- this.salonInfoState = JSON.parse(this.salonInfo);
48
- }
49
- else {
50
- this.fetchData();
51
- }
52
- }
53
- fetchData() {
54
- try {
55
- services.HttpService().fetchSalonInfo(this.salonId)
56
- .then(salonInfo => this.salonInfoState = salonInfo);
57
- }
58
- catch (e) { }
59
- }
60
- render() {
61
- const { businessLocationLat: lat, businessLocationLng: lng } = this.salonInfoState || {};
62
- return (index.h("div", { class: "view view--salon-locations" }, index.h("div", { class: "view-content", style: { height: '380px' } }, index.h("div", { style: {
63
- fontSize: '16px',
64
- lineHeight: '26px',
65
- maxHeight: '52px',
66
- marginBottom: '16px',
67
- overflow: 'hidden',
68
- textOverflow: 'ellipsis',
69
- } }, utils.formatFullAddress(this.salonInfoState)), index.h("div", { class: "view--salon-info--map", style: { height: '264px' } }, lat && lng && index.h("google-map", { lat: lat, lng: lng })))));
70
- }
71
- };
72
- SalonLocations.style = indexCss$2;
73
-
74
- const indexCss$1 = "@media (min-width: 768px){.salon-schedules--dates{overflow:hidden;margin-left:-32px}.salon-schedules--dates .salon-schedules--day{float:left;display:flex;flex-direction:row;min-width:240px;padding-left:32px}}";
75
-
76
- let SalonSchedules = class {
77
- constructor(hostRef) {
78
- index.registerInstance(this, hostRef);
79
- }
80
- componentWillLoad() {
81
- if (this.salonInfo) {
82
- this.salonInfoState = JSON.parse(this.salonInfo);
83
- }
84
- else {
85
- this.fetchData();
86
- }
87
- }
88
- fetchData() {
89
- try {
90
- services.HttpService().fetchSalonInfo(this.salonId)
91
- .then(salonInfo => this.salonInfoState = salonInfo);
92
- }
93
- catch (e) { }
94
- }
95
- renderBusinessHour(businessHour) {
96
- if (businessHour.status === services.BusinessHourStatus.ByAppointment) {
97
- return 'By Appointment';
98
- }
99
- if (businessHour.status === services.BusinessHourStatus.Close) {
100
- return 'Close';
101
- }
102
- return `${businessHour.openTime} - ${businessHour.closeTime}`;
103
- }
104
- render() {
105
- const businessHours = (this.salonInfoState && this.salonInfoState.businessHours) || [];
106
- return (index.h("div", { class: "view view--salon-schedules" }, index.h("div", { class: "view-content" }, businessHours.length > 0 && (index.h("div", { class: "salon-schedules" }, index.h("div", { style: { fontSize: '16px', fontWeight: 'bold' } }, "Working hours"), index.h("div", { class: "salon-schedules--dates" }, index.h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, index.h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Mon"), index.h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[0]))), index.h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, index.h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Tue"), index.h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[1]))), index.h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, index.h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Wed"), index.h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[2]))), index.h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, index.h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Thur"), index.h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[3]))), index.h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, index.h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Fri"), index.h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[4]))), index.h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, index.h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Sat"), index.h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[5]))), index.h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, index.h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Sun"), index.h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[6])))))))));
107
- }
108
- };
109
- SalonSchedules.style = indexCss$1;
110
-
111
- const indexCss = ".salon-styles--item-background{-moz-filter:blur(32px);-webkit-filter:blur(32px);filter:blur(32px)}.salon-styles--item .salon-styles--item-background{z-index:1}.salon-styles--item .salon-styles--item-image{position:relative;z-index:2}.salon-styles--item .carousel-caption{padding-bottom:0;z-index:2}.salon-styles--slides .carousel-control-prev{z-index:2}";
112
-
113
- let SalonStyles = class {
114
- constructor(hostRef) {
115
- index.registerInstance(this, hostRef);
116
- }
117
- componentDidLoad() {
118
- this.fetchData();
119
- }
120
- async fetchData() {
121
- try {
122
- const promises = [
123
- services.HttpService().fetchSalonPhotos(this.salonId).then(salonStyles => this.firstPageStyles = salonStyles),
124
- services.HttpService().fetchAllSalonPhotos(this.salonId, { page: 2 }).then(nestPageStyles => this.nestPageStyles = nestPageStyles),
125
- ];
126
- return Promise.all(promises);
127
- }
128
- catch (e) { }
129
- }
130
- render() {
131
- return (index.h("div", { class: "view view--salon-styles" }, index.h("div", { class: "view-content" }, index.h("div", { class: "salon-styles--slides" }, index.h("div", { id: "salon-styles-carousel", class: "carousel slide", "data-bs-ride": "carousel" }, index.h("div", { class: "carousel-inner" }, (this.firstPageStyles || []).concat(this.nestPageStyles || []).map((photo, index$1) => {
132
- const { caption, description,
133
- // mediaType,
134
- fullImageUrl, fullImageUrlThumb, fullImageUrlMedium, imgWidth, imgHeight, } = photo;
135
- const isLandscape = imgWidth > imgHeight;
136
- return (index.h("div", { class: `carousel-item salon-styles--item ${index$1 === 0 ? 'active' : ''}` }, index.h("div", { class: "salon-styles--item", style: {
137
- flexDirection: isLandscape ? 'column' : 'row',
138
- justifyContent: 'center',
139
- alignItems: 'center',
140
- overflow: 'hidden',
141
- position: 'relative',
142
- display: 'flex',
143
- height: '380px',
144
- borderRadius: '8px',
145
- } }, index.h("div", { class: "salon-styles--item-background", style: Object.assign(Object.assign({}, fullImageUrlThumb ? { backgroundImage: `url(${fullImageUrlThumb})` } : {}), { backgroundColor: colors.Colors.Gray06, backgroundPosition: 'center', backgroundRepeat: 'no-repeat', backgroundSize: 'cover', position: 'absolute', bottom: '0px', right: '0px', left: '0px', top: '0px' }) }), index.h("img", { alt: caption, class: "salon-styles--item-image", src: fullImageUrlMedium || fullImageUrl, style: Object.assign({ display: 'inline-block' }, isLandscape ? { width: '100%' } : { height: '100%' }) }), index.h("div", { class: "carousel-caption d-none d-md-block" }, caption && index.h("h5", null, caption), description && index.h("p", null, description)))));
146
- })), index.h("button", { type: "button", "data-bs-slide": "prev", class: "carousel-control-prev", "data-bs-target": "#salon-styles-carousel" }, index.h("span", { class: "carousel-control-prev-icon", "aria-hidden": "true" }), index.h("span", { class: "visually-hidden" }, "Previous")), index.h("button", { type: "button", "data-bs-slide": "next", class: "carousel-control-next", "data-bs-target": "#salon-styles-carousel" }, index.h("span", { class: "carousel-control-next-icon", "aria-hidden": "true" }), index.h("span", { class: "visually-hidden" }, "Next")))))));
147
- }
148
- };
149
- SalonStyles.style = indexCss;
150
-
151
- exports.salon_contact = SalonContact;
152
- exports.salon_locations = SalonLocations;
153
- exports.salon_schedules = SalonSchedules;
154
- exports.salon_styles = SalonStyles;
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-7d179a70.js');
6
-
7
- const indexCss = ".salon-modal.salon-modal--gift-card .salon-modal--title{margin:0}.salon-modal.salon-modal--gift-card .salon-modal--close{width:40px;height:40px;right:16px;top:16px}.salon-modal.salon-modal--gift-card .salon-modal--header{height:72px;padding:16px}.salon-modal.salon-modal--gift-card .salon-modal--inner{height:90vh}.salon-modal.salon-modal--gift-card .salon-modal--content{height:90vh;padding:0 16px;overflow-y:auto}";
8
-
9
- let SalonGiftCardModal = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.isModalOpen = true;
13
- }
14
- render() {
15
- return (index.h("div", { class: "salon-gift-card--modal" }, this.isModalOpen && (index.h("div", { class: "salon-modal salon-modal--gift-card" }, index.h("div", { class: "salon-modal--backdrop", onClick: () => this.isModalOpen = false }), index.h("div", { class: "salon-modal--inner" }, index.h("div", { class: "salon-modal--close", onClick: () => this.isModalOpen = false }), index.h("div", { class: "salon-modal--content" }, index.h("iframe", { height: "100%", width: "100%", style: { border: 'none', display: 'block', height: '100%' }, src: `https://www.favesalon.com/salon/detail/${this.salonId}/gift-cards.html` })))))));
16
- }
17
- };
18
- SalonGiftCardModal.style = indexCss;
19
-
20
- exports.salon_gift_card_modal = SalonGiftCardModal;
@@ -1,34 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-7d179a70.js');
6
- const services = require('./services-d6f8214c.js');
7
- const colors = require('./colors-7f354880.js');
8
-
9
- const indexCss = ".salon-info .view--salon-styles .view-content{padding:0}";
10
-
11
- let SalonInfo = class {
12
- constructor(hostRef) {
13
- index.registerInstance(this, hostRef);
14
- this.backgroundColor = colors.Colors.Gray06;
15
- }
16
- componentWillLoad() {
17
- this.fetchData();
18
- }
19
- async fetchData() {
20
- try {
21
- this.salonInfo = await services.HttpService().fetchSalonInfo(this.salonId);
22
- }
23
- catch (e) { }
24
- }
25
- render() {
26
- if (this.salonInfo) {
27
- return (index.h("div", { class: "salon-info", style: { background: this.backgroundColor } }, index.h("div", { class: "row" }, index.h("div", { class: "col-md-5", style: { marginBottom: '24px' } }, index.h("salon-locations", { "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) })), index.h("div", { class: "col-md-7", style: { marginBottom: '24px' } }, index.h("salon-styles", { "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) }))), index.h("div", { class: "salon-info--schedules", style: { marginBottom: '24px' } }, index.h("salon-schedules", { "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) })), index.h("div", { class: "salon-info--contact" }, index.h("salon-contact", { "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) }))));
28
- }
29
- return (index.h("div", { class: "salon-info", style: { padding: '24px', textAlign: 'center' } }, "Loading..."));
30
- }
31
- };
32
- SalonInfo.style = indexCss;
33
-
34
- exports.salon_info = SalonInfo;
@@ -1,57 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-7d179a70.js');
6
- const services = require('./services-d6f8214c.js');
7
- const colors = require('./colors-7f354880.js');
8
- const utils = require('./utils-c5a33b3c.js');
9
-
10
- const indexCss = ".salon-latest-reviews .salon-review{min-width:280px}@media (min-width: 768px){.salon-latest-reviews .salon-review{min-width:300px}}";
11
-
12
- let SalonLatestReviews = class {
13
- constructor(hostRef) {
14
- index.registerInstance(this, hostRef);
15
- this.salonReviews = [];
16
- }
17
- componentWillLoad() {
18
- this.fetchData();
19
- }
20
- async fetchData() {
21
- try {
22
- const { allItems } = await services.HttpService().fetchSalonReviews(this.salonId, { noLoop: true });
23
- this.salonReviews = [...allItems];
24
- }
25
- catch (e) { }
26
- }
27
- render() {
28
- const ratingTexts = utils.getRatingText();
29
- return (index.h("div", { class: "salon-latest-reviews", style: { overflowX: 'auto' } }, index.h("div", { style: { display: 'flex', whiteSpace: 'nowrap' } }, (this.salonReviews || []).map((review, index$1) => {
30
- const { user } = review;
31
- return (index.h("div", { class: "salon-review", style: Object.assign({ border: `1px solid ${colors.Colors.Gray05}`, background: colors.Colors.White, borderRadius: '8px', overflow: 'hidden' }, index$1 > 0 ? { marginLeft: '16px' } : {}) }, index.h("div", { class: "card", style: { border: 'none' } }, index.h("div", { class: "card-body" }, index.h("div", { class: "salon-review--user", style: { marginBottom: '16px' } }, index.h("user-avatar", { size: 48, name: user.name, shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, avatar: user.avatar, nameStyle: { fontWeight: 'bold' } })), index.h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } }, [1, 2, 3, 4, 5].map(score => (index.h("i", { class: score <= review.point ? 'ri-heart-fill' : 'ri-heart-line', style: {
32
- fontSize: '16px',
33
- marginRight: '4px',
34
- } }))), index.h("div", { class: "salon-review--rating--date", style: { color: colors.Colors.Gray03, marginLeft: '16px' } }, services.dayjs_min(review.createdDate).format(services.shortDate))), index.h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: 'bold' } }, ratingTexts[review.point]), (review.title || review.description) && (index.h("div", { class: "salon-review--detail", style: { marginTop: '16px' } }, index.h("div", { class: "salon-review--description", style: {
35
- fontSize: '16px',
36
- lineHeight: '26px',
37
- overflow: 'hidden',
38
- maxHeight: review.photos.length > 0 ? '52px' : '104px',
39
- } }, review.title || review.description))), review.photos.length > 0 && (index.h("div", { style: {
40
- display: 'flex',
41
- flexDirection: 'row',
42
- overflowX: 'auto',
43
- } }, review.photos.map(photo => (index.h("div", { style: {
44
- border: '1px solid #d9d9d9',
45
- position: 'relative',
46
- cursor: 'pointer',
47
- borderRadius: '2px',
48
- height: '66px',
49
- marginTop: '16px',
50
- marginRight: '16px',
51
- } }, index.h("img", { alt: "", src: photo.imageUrlThumb, height: "64", style: { width: 'auto' } }))))))))));
52
- }))));
53
- }
54
- };
55
- SalonLatestReviews.style = indexCss;
56
-
57
- exports.salon_latest_reviews = SalonLatestReviews;
@@ -1,187 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-7d179a70.js');
6
- const colors = require('./colors-7f354880.js');
7
- const services = require('./services-d6f8214c.js');
8
-
9
- const indexCss = ".salon-loobooks--grid-item{float:left;max-width:150px}@media (min-width: 768px){.salon-loobooks--grid-item{max-width:200px}}";
10
-
11
- const lookbookSortOptions = [{
12
- value: 'like',
13
- label: 'Most popular',
14
- }, {
15
- value: 'newest',
16
- label: 'Newest first',
17
- }, {
18
- value: 'oldest',
19
- label: 'Oldest first',
20
- }];
21
- const lookbookFilterOptions = [{
22
- value: 'all',
23
- label: 'All Category',
24
- }];
25
- let SalonLookbook = class {
26
- constructor(hostRef) {
27
- index.registerInstance(this, hostRef);
28
- this.isLoading = true;
29
- this.currentPage = 1;
30
- this.totalLookbooks = 0;
31
- this.salonCategories = [];
32
- this.salonLookbooks = [];
33
- }
34
- componentWillLoad() {
35
- this.fetchData();
36
- this.injectSDK();
37
- }
38
- componentDidRender() {
39
- this.setupGridLayout();
40
- }
41
- injectSDK() {
42
- return new Promise((resolve) => {
43
- const script = document.createElement('script');
44
- script.type = 'text/javascript';
45
- script.src = 'https://cdn.jsdelivr.net/npm/macy@2';
46
- document.body.appendChild(script);
47
- return resolve(true);
48
- });
49
- }
50
- setupGridLayout() {
51
- if (!this.isLayoutSetup && document.querySelector('#salon-loobooks--grid')) {
52
- const script = document.createElement('script');
53
- script.type = 'text/javascript';
54
- script.innerHTML = `
55
- var masonry = new Macy({
56
- container: '#salon-loobooks--grid',
57
- useContainerForBreakpoints: true,
58
- margin: 12,
59
- columns: 7,
60
- breakAt: {
61
- 1200: {
62
- margin: 16,
63
- columns: 6,
64
- },
65
- 992: {
66
- margin: 16,
67
- columns: 5,
68
- },
69
- 768: {
70
- margin: 16,
71
- columns: 3,
72
- },
73
- 576: {
74
- margin: 16,
75
- columns: 2,
76
- },
77
- },
78
- });
79
- `;
80
- document.body.appendChild(script);
81
- this.isLayoutSetup = true;
82
- }
83
- }
84
- async fetchData() {
85
- try {
86
- const promises = [
87
- this.fetchLookbooks({ page: 1 }),
88
- this.fetchCategories(),
89
- ];
90
- return Promise.all(promises);
91
- }
92
- catch (e) { }
93
- }
94
- async fetchLookbooks(options, isLoadingMore) {
95
- if (isLoadingMore) {
96
- this.isLoadingMore = true;
97
- }
98
- else {
99
- this.isLoading = true;
100
- }
101
- try {
102
- const { total, allLookbooks } = await services.HttpService().fetchSalonLookbooks(this.salonId, options);
103
- this.totalLookbooks = total;
104
- this.salonLookbooks = this.salonLookbooks.concat(allLookbooks);
105
- this.hideLoadMore = allLookbooks.length < 20;
106
- }
107
- catch (error) { }
108
- if (isLoadingMore) {
109
- this.isLoadingMore = false;
110
- }
111
- else {
112
- this.isLoading = false;
113
- }
114
- }
115
- async onLoadMore() {
116
- try {
117
- this.currentPage += 1;
118
- await this.fetchLookbooks({ page: this.currentPage }, true);
119
- if (window.masonry) {
120
- this.isLayoutSetup = false;
121
- }
122
- }
123
- catch (error) { }
124
- }
125
- async fetchCategories() {
126
- try {
127
- this.salonCategories = await services.HttpService().fetchSalonCategories();
128
- }
129
- catch (error) { }
130
- }
131
- renderHeader() {
132
- const allFilterOptions = lookbookFilterOptions.concat(([...this.salonCategories]).map(category => {
133
- return {
134
- value: category.id,
135
- label: category.name,
136
- };
137
- }));
138
- return (index.h("div", { class: "view-header", style: {
139
- display: 'flex',
140
- flexDirection: 'row',
141
- justifyContent: 'space-between',
142
- alignItems: 'center',
143
- marginBottom: '24px',
144
- } }, index.h("div", null, this.totalLookbooks, " ", this.totalLookbooks === 1 ? 'result' : 'results'), index.h("div", { style: {
145
- display: 'flex',
146
- flexDirection: 'row',
147
- alignItems: 'center',
148
- } }, index.h("div", { style: {
149
- display: 'flex',
150
- flexDirection: 'row',
151
- alignItems: 'center',
152
- marginRight: '16px',
153
- } }, index.h("label", { style: { marginRight: '8px' } }, "Filter by"), index.h("select", {
154
- // placeholder="Filter by"
155
- // value={filterBy}
156
- // onChange={onChangeCategory}
157
- class: "form-select", style: { width: '160px' }
158
- }, allFilterOptions.map(filterOption => (index.h("option", { value: filterOption.value }, filterOption.label))))), index.h("div", { class: "search--header--sort-wrapper", style: {
159
- display: 'flex',
160
- flexDirection: 'row',
161
- alignItems: 'center',
162
- } }, index.h("label", { style: { marginRight: '8px' } }, "Sort by"), index.h("select", {
163
- // placeholder="Sort by"
164
- // value={sortBy}
165
- // onChange={onChangeSorting}
166
- class: "form-select", style: { width: '160px' }
167
- }, lookbookSortOptions.map(sortOption => (index.h("option", { value: sortOption.value }, sortOption.label))))))));
168
- }
169
- render() {
170
- return (index.h("div", { class: "salon-loobooks" }, this.salonLookbooks.length > 0 && (index.h("div", null, index.h("div", { class: "view-content" }, this.renderHeader(), index.h("div", { class: "salon-loobooks--grid", id: "salon-loobooks--grid" }, this.salonLookbooks.map(style => {
171
- const { caption, fullImageUrlThumb, owner } = style;
172
- return (index.h("div", { class: "salon-lookbook salon-loobooks--grid-item" }, index.h("div", { class: "card", style: {
173
- background: 'none',
174
- border: 'none',
175
- maxWidth: '200px',
176
- } }, index.h("div", { class: "salon-lookbook--image", style: {
177
- borderRadius: '8px',
178
- overflow: 'hidden',
179
- minHeight: '80px',
180
- background: colors.Colors.Gray06,
181
- } }, index.h("img", { src: fullImageUrlThumb, alt: caption })), owner && (index.h("div", { class: "card-body", style: { paddingLeft: '0' } }, index.h("user-avatar", { name: owner.name, shortName: `${(owner.firstName || '').charAt(0)}${(owner.lastName || '').charAt(0)}`, avatar: owner.avatar }))))));
182
- }))), !this.hideLoadMore && (index.h("div", { class: "view-footer", style: { paddingTop: '16px', textAlign: 'center' } }, index.h("button", { type: "button", class: "btn btn-light", onClick: () => this.onLoadMore() }, this.isLoadingMore ? 'Loading' : 'Load more')))))));
183
- }
184
- };
185
- SalonLookbook.style = indexCss;
186
-
187
- exports.salon_lookbook = SalonLookbook;
@@ -1,196 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-7d179a70.js');
6
- const services = require('./services-d6f8214c.js');
7
- const colors = require('./colors-7f354880.js');
8
- const utils = require('./utils-c5a33b3c.js');
9
-
10
- const indexCss = "";
11
-
12
- const pageLimited = 20;
13
- const sortOptions = [{
14
- value: 'newest',
15
- label: 'Newest first',
16
- }, {
17
- value: 'oldest',
18
- label: 'Oldest first',
19
- }, {
20
- value: 'rating_desc',
21
- label: 'High rating first',
22
- }, {
23
- value: 'rating_asc',
24
- label: 'Low rating first',
25
- }];
26
- const scoreValuesMapping = {
27
- all: 'all',
28
- star1: 1,
29
- star2: 2,
30
- star3: 3,
31
- star4: 4,
32
- star5: 5,
33
- };
34
- let SalonReviews = class {
35
- constructor(hostRef) {
36
- index.registerInstance(this, hostRef);
37
- this.totalReviews = 0;
38
- this.salonReviews = [];
39
- this.pageOffset = pageLimited;
40
- this.ratings = [scoreValuesMapping.all, 'star1', 'star2', 'star3', 'star4', 'star5'];
41
- this.sorting = sortOptions[0].value;
42
- this.renderReviewsList = () => {
43
- const ratingTexts = utils.getRatingText();
44
- const filteredReviews = this.getFilteredReviews(this.pageOffset);
45
- const filteredReviewsCount = this.ratings.indexOf(scoreValuesMapping.all) > -1
46
- ? this.totalReviews : filteredReviews.length;
47
- return (index.h("div", { class: "reviews-list" }, index.h("div", { class: "reviews-list--header", style: {
48
- display: 'flex',
49
- flexDirection: 'row',
50
- justifyContent: 'space-between',
51
- alignItems: 'center',
52
- marginBottom: '24px',
53
- } }, index.h("div", { class: "reviews-list--couter", style: { fontWeight: 'bold' } }, filteredReviewsCount, " ", filteredReviewsCount === 1 ? `review` : `reviews`), index.h("div", { class: "reviews-list--sorting", style: {
54
- display: 'flex',
55
- flexDirection: 'row',
56
- alignItems: 'center',
57
- } }, index.h("label", { style: { marginRight: '8px' } }, "Sort by"), index.h("select", { class: "form-select", style: { width: '160px' }, onChange: (evt) => this.onChangeSorting(evt.target.value) }, sortOptions.map(sortOption => (index.h("option", { value: sortOption.value, selected: sortOption.value === this.sorting }, sortOption.label)))))), index.h("div", { class: "view-content" }, filteredReviewsCount > 0 && filteredReviews.map(review => {
58
- const { user } = review;
59
- return (index.h("div", { class: "salon-review", style: {
60
- marginBottom: '24px',
61
- paddingBottom: '24px',
62
- borderBottom: `1px solid ${colors.Colors.Gray05}`,
63
- } }, index.h("div", { class: "salon-review--user", style: { marginBottom: '24px' } }, index.h("user-avatar", { size: 48, avatar: user.avatar, name: user.name, shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, nameStyle: { fontWeight: 'bold' } })), index.h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } }, [1, 2, 3, 4, 5].map(score => (index.h("i", { class: score <= review.point ? 'ri-heart-fill' : 'ri-heart-line', style: {
64
- fontSize: '16px',
65
- marginRight: '4px',
66
- } }))), review.createdDate && (index.h("div", { class: "salon-review--rating--date", style: { color: colors.Colors.Gray03, marginLeft: '16px' } }, services.dayjs_min(review.createdDate).format(services.shortDate)))), index.h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: 'bold' } }, ratingTexts[review.point]), (review.title || review.description) && (index.h("div", { class: "salon-review--detail", style: { marginTop: '24px' } }, index.h("div", { class: "salon-review--title", style: { fontSize: '18px', fontWeight: 'bold' }, innerHTML: review.title }), index.h("div", { class: "salon-review--description", style: { fontSize: '16px' }, innerHTML: review.description }))), review.photos.length > 0 && (index.h("div", { style: {
67
- display: 'flex',
68
- flexDirection: 'row',
69
- overflowX: 'auto',
70
- } }, review.photos.map(fileObj => (index.h("div", { style: {
71
- border: '1px solid #d9d9d9',
72
- position: 'relative',
73
- cursor: 'pointer',
74
- borderRadius: '2px',
75
- height: '66px',
76
- marginTop: '16px',
77
- marginRight: '16px',
78
- } }, index.h("img", { alt: "", src: fileObj.imageUrlThumb, height: "64", style: { width: 'auto' } }))))))));
79
- })), this.canLoadMore && (index.h("div", { class: "view-footer", style: { textAlign: 'center' } }, index.h("button", { type: "button", class: "btn btn-light", onClick: () => this.onLoadMore() }, this.isLoadingMore ? 'Loading' : 'Load more')))));
80
- };
81
- }
82
- componentWillLoad() {
83
- this.fetchData();
84
- }
85
- fetchData() {
86
- try {
87
- const promises = [
88
- services.HttpService().fetchSalonInfo(this.salonId).then(salonInfo => this.salonInfo = salonInfo),
89
- services.HttpService().fetchSalonReviews(this.salonId, { limit: pageLimited }).then(response => {
90
- const { total, allItems } = response;
91
- this.totalReviews = total;
92
- this.salonReviews = allItems;
93
- if (total > pageLimited) {
94
- this.canLoadMore = true;
95
- }
96
- }),
97
- ];
98
- return Promise.all(promises);
99
- }
100
- catch (e) { }
101
- }
102
- sortReviews(filteredReviews) {
103
- return services.sortBy_1(filteredReviews, [review => {
104
- if (this.sorting === 'rating_desc') {
105
- return -review.point;
106
- }
107
- if (this.sorting === 'rating_asc') {
108
- return review.point;
109
- }
110
- const createdTime = services.dayjs_min(review.createdDate).unix();
111
- return this.sorting === 'oldest' ? createdTime : -createdTime;
112
- }]);
113
- }
114
- getFilteredReviews(pageOffset) {
115
- let filteredReviews = [...this.salonReviews];
116
- if (this.ratings.indexOf(scoreValuesMapping.all) === -1) {
117
- const reviewRatingScores = this.ratings.map(r => scoreValuesMapping[r]);
118
- filteredReviews = [...filteredReviews].filter(review => reviewRatingScores.indexOf(review.point) > -1);
119
- }
120
- const sortedReviews = this.sortReviews(filteredReviews);
121
- return pageOffset ? sortedReviews.slice(0, pageOffset) : sortedReviews;
122
- }
123
- onLoadMore() {
124
- this.isLoadingMore = true;
125
- try {
126
- this.pageOffset += pageLimited;
127
- const totalResults = this.getFilteredReviews(this.pageOffset).length;
128
- if (this.pageOffset > totalResults) {
129
- this.canLoadMore = false;
130
- }
131
- }
132
- catch (error) { }
133
- this.isLoadingMore = false;
134
- }
135
- onChangeSorting(sorting) {
136
- this.sorting = sorting;
137
- this.pageOffset = pageLimited;
138
- this.canLoadMore = this.getFilteredReviews(pageLimited).length >= pageLimited;
139
- }
140
- ;
141
- onChangeFilterRating(rating) {
142
- if (rating === scoreValuesMapping.all) {
143
- this.ratings = [scoreValuesMapping.all, 'star1', 'star2', 'star3', 'star4', 'star5'];
144
- }
145
- else if (this.ratings.indexOf(rating) > -1) {
146
- this.ratings = this.ratings.filter(r => r !== scoreValuesMapping.all && r !== rating);
147
- }
148
- else {
149
- const needFilterByAll = this.ratings.concat([rating]).filter(r => r !== scoreValuesMapping.all).length === 5;
150
- this.ratings = needFilterByAll
151
- ? [scoreValuesMapping.all, 'star1', 'star2', 'star3', 'star4', 'star5']
152
- : this.ratings.concat([rating]);
153
- }
154
- this.pageOffset = pageLimited;
155
- this.canLoadMore = this.getFilteredReviews(pageLimited).length >= pageLimited;
156
- }
157
- ;
158
- renderReviewsFilters() {
159
- const reviewsByScore = services.groupBy_1(this.salonReviews, review => review.point);
160
- return (index.h("div", { class: "salon-reviews--filters-by-ratings" }, index.h("div", { style: {
161
- fontWeight: 'bold',
162
- marginBottom: '12px',
163
- marginTop: '32px',
164
- } }, "Filter by ratings"), index.h("div", { class: "salon-reviews--filters-by-ratings--options" }, index.h("div", { class: "antd-checkbox--wrapper", style: { marginBottom: '12px' } }, index.h("div", { class: "antd-checkbox--box" }, index.h("div", { class: "form-check" }, index.h("input", { type: "checkbox", class: "form-check-input", value: scoreValuesMapping.all, onChange: () => this.onChangeFilterRating(scoreValuesMapping.all), checked: this.ratings.indexOf(scoreValuesMapping.all) > -1 }), index.h("label", { class: "form-check-label" }, "All ratings")))), [5, 4, 3, 2, 1].filter(score => reviewsByScore[score]).map(score => {
165
- const scoreReviewCount = reviewsByScore[score].length;
166
- return (index.h("div", { style: {
167
- display: 'flex',
168
- flexDirection: 'row',
169
- justifyContent: 'space-between',
170
- marginBottom: '12px',
171
- } }, index.h("div", { class: "form-check" }, index.h("input", { value: "", type: "checkbox", class: "form-check-input", onChange: () => this.onChangeFilterRating(`star${score}`), checked: this.ratings.indexOf(scoreValuesMapping.all) > -1 || this.ratings.indexOf(`star${score}`) > -1 }), index.h("label", { class: "form-check-label" }, [1, 2, 3, 4, 5].slice(0, score).map(() => (index.h("i", { class: "ri-heart-fill", style: {
172
- fontSize: '16px',
173
- marginRight: '4px',
174
- } }))))), index.h("div", { style: { color: colors.Colors.Gray01 } }, scoreReviewCount)));
175
- }))));
176
- }
177
- render() {
178
- const { rating } = this.salonInfo || {};
179
- return (index.h("div", { class: "salon-reviews", style: { display: 'flex', flexDirection: 'row' } }, index.h("div", { class: "salon-reviews--filters", style: { width: '264px' } }, index.h("div", { class: "salon-reviews--score" }, index.h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row' } }, [1, 2, 3, 4, 5].map(score => (index.h("i", { class: score <= rating ? 'ri-heart-fill' : 'ri-heart-line', style: {
180
- fontSize: '32px',
181
- marginRight: '4px',
182
- } })))), index.h("div", { class: "salon-review--rating--date", style: {
183
- display: 'flex',
184
- flexDirection: 'row',
185
- alignItems: 'center',
186
- marginTop: '-8px',
187
- } }, index.h("span", { style: { fontSize: '24px' } }, rating, "/5"), " ", index.h("span", { style: { color: colors.Colors.Gray02, marginLeft: '8px' } }, "(", this.totalReviews, " reviews)"))), index.h("div", { class: "salon-reviews--filters--options" }, this.renderReviewsFilters())), index.h("div", { class: "salon-reviews--list", style: {
188
- flexGrow: '1',
189
- flexShrink: '1',
190
- paddingLeft: '64px',
191
- } }, this.renderReviewsList())));
192
- }
193
- };
194
- SalonReviews.style = indexCss;
195
-
196
- exports.salon_reviews = SalonReviews;