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,5 +1,8 @@
1
1
  'use strict';
2
2
 
3
+ const _commonjsHelpers = require('./_commonjsHelpers-5cfcba41.js');
4
+ const colors = require('./colors-38421769.js');
5
+
3
6
  /**
4
7
  * Appends the elements of `values` to `array`.
5
8
  *
@@ -21,24 +24,8 @@ function arrayPush(array, values) {
21
24
 
22
25
  var _arrayPush = arrayPush;
23
26
 
24
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
25
-
26
- function createCommonjsModule(fn, basedir, module) {
27
- return module = {
28
- path: basedir,
29
- exports: {},
30
- require: function (path, base) {
31
- return commonjsRequire();
32
- }
33
- }, fn(module, module.exports), module.exports;
34
- }
35
-
36
- function commonjsRequire () {
37
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
38
- }
39
-
40
27
  /** Detect free variable `global` from Node.js. */
41
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
28
+ var freeGlobal = typeof _commonjsHelpers.commonjsGlobal == 'object' && _commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.Object === Object && _commonjsHelpers.commonjsGlobal;
42
29
 
43
30
  var _freeGlobal = freeGlobal;
44
31
 
@@ -56,17 +43,17 @@ var Symbol = _root.Symbol;
56
43
  var _Symbol = Symbol;
57
44
 
58
45
  /** Used for built-in method references. */
59
- var objectProto$c = Object.prototype;
46
+ var objectProto$b = Object.prototype;
60
47
 
61
48
  /** Used to check objects for own properties. */
62
- var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
49
+ var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
63
50
 
64
51
  /**
65
52
  * Used to resolve the
66
53
  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
67
54
  * of values.
68
55
  */
69
- var nativeObjectToString$1 = objectProto$c.toString;
56
+ var nativeObjectToString$1 = objectProto$b.toString;
70
57
 
71
58
  /** Built-in value references. */
72
59
  var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
@@ -79,7 +66,7 @@ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
79
66
  * @returns {string} Returns the raw `toStringTag`.
80
67
  */
81
68
  function getRawTag(value) {
82
- var isOwn = hasOwnProperty$9.call(value, symToStringTag$1),
69
+ var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
83
70
  tag = value[symToStringTag$1];
84
71
 
85
72
  try {
@@ -101,14 +88,14 @@ function getRawTag(value) {
101
88
  var _getRawTag = getRawTag;
102
89
 
103
90
  /** Used for built-in method references. */
104
- var objectProto$b = Object.prototype;
91
+ var objectProto$a = Object.prototype;
105
92
 
106
93
  /**
107
94
  * Used to resolve the
108
95
  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
109
96
  * of values.
110
97
  */
111
- var nativeObjectToString = objectProto$b.toString;
98
+ var nativeObjectToString = objectProto$a.toString;
112
99
 
113
100
  /**
114
101
  * Converts `value` to a string using `Object.prototype.toString`.
@@ -195,13 +182,13 @@ function baseIsArguments(value) {
195
182
  var _baseIsArguments = baseIsArguments;
196
183
 
197
184
  /** Used for built-in method references. */
198
- var objectProto$a = Object.prototype;
185
+ var objectProto$9 = Object.prototype;
199
186
 
200
187
  /** Used to check objects for own properties. */
201
- var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
188
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
202
189
 
203
190
  /** Built-in value references. */
204
- var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
191
+ var propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable;
205
192
 
206
193
  /**
207
194
  * Checks if `value` is likely an `arguments` object.
@@ -222,7 +209,7 @@ var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
222
209
  * // => false
223
210
  */
224
211
  var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
225
- return isObjectLike_1(value) && hasOwnProperty$8.call(value, 'callee') &&
212
+ return isObjectLike_1(value) && hasOwnProperty$7.call(value, 'callee') &&
226
213
  !propertyIsEnumerable$1.call(value, 'callee');
227
214
  };
228
215
 
@@ -513,17 +500,17 @@ var reIsHostCtor = /^\[object .+?Constructor\]$/;
513
500
 
514
501
  /** Used for built-in method references. */
515
502
  var funcProto = Function.prototype,
516
- objectProto$9 = Object.prototype;
503
+ objectProto$8 = Object.prototype;
517
504
 
518
505
  /** Used to resolve the decompiled source of functions. */
519
506
  var funcToString = funcProto.toString;
520
507
 
521
508
  /** Used to check objects for own properties. */
522
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
509
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
523
510
 
524
511
  /** Used to detect if a method is native. */
525
512
  var reIsNative = RegExp('^' +
526
- funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
513
+ funcToString.call(hasOwnProperty$6).replace(reRegExpChar, '\\$&')
527
514
  .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
528
515
  );
529
516
 
@@ -615,10 +602,10 @@ var _hashDelete = hashDelete;
615
602
  var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
616
603
 
617
604
  /** Used for built-in method references. */
618
- var objectProto$8 = Object.prototype;
605
+ var objectProto$7 = Object.prototype;
619
606
 
620
607
  /** Used to check objects for own properties. */
621
- var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
608
+ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
622
609
 
623
610
  /**
624
611
  * Gets the hash value for `key`.
@@ -635,16 +622,16 @@ function hashGet(key) {
635
622
  var result = data[key];
636
623
  return result === HASH_UNDEFINED$2 ? undefined : result;
637
624
  }
638
- return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
625
+ return hasOwnProperty$5.call(data, key) ? data[key] : undefined;
639
626
  }
640
627
 
641
628
  var _hashGet = hashGet;
642
629
 
643
630
  /** Used for built-in method references. */
644
- var objectProto$7 = Object.prototype;
631
+ var objectProto$6 = Object.prototype;
645
632
 
646
633
  /** Used to check objects for own properties. */
647
- var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
634
+ var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
648
635
 
649
636
  /**
650
637
  * Checks if a hash value for `key` exists.
@@ -657,7 +644,7 @@ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
657
644
  */
658
645
  function hashHas(key) {
659
646
  var data = this.__data__;
660
- return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$5.call(data, key);
647
+ return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$4.call(data, key);
661
648
  }
662
649
 
663
650
  var _hashHas = hashHas;
@@ -1806,10 +1793,10 @@ function stubArray() {
1806
1793
  var stubArray_1 = stubArray;
1807
1794
 
1808
1795
  /** Used for built-in method references. */
1809
- var objectProto$6 = Object.prototype;
1796
+ var objectProto$5 = Object.prototype;
1810
1797
 
1811
1798
  /** Built-in value references. */
1812
- var propertyIsEnumerable = objectProto$6.propertyIsEnumerable;
1799
+ var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
1813
1800
 
1814
1801
  /* Built-in method references for those with the same name as other `lodash` methods. */
1815
1802
  var nativeGetSymbols = Object.getOwnPropertySymbols;
@@ -1873,7 +1860,7 @@ function stubFalse() {
1873
1860
 
1874
1861
  var stubFalse_1 = stubFalse;
1875
1862
 
1876
- var isBuffer_1 = createCommonjsModule(function (module, exports) {
1863
+ var isBuffer_1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
1877
1864
  /** Detect free variable `exports`. */
1878
1865
  var freeExports = exports && !exports.nodeType && exports;
1879
1866
 
@@ -2045,7 +2032,7 @@ function baseUnary(func) {
2045
2032
 
2046
2033
  var _baseUnary = baseUnary;
2047
2034
 
2048
- var _nodeUtil = createCommonjsModule(function (module, exports) {
2035
+ var _nodeUtil = _commonjsHelpers.createCommonjsModule(function (module, exports) {
2049
2036
  /** Detect free variable `exports`. */
2050
2037
  var freeExports = exports && !exports.nodeType && exports;
2051
2038
 
@@ -2101,10 +2088,10 @@ var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsType
2101
2088
  var isTypedArray_1 = isTypedArray;
2102
2089
 
2103
2090
  /** Used for built-in method references. */
2104
- var objectProto$5 = Object.prototype;
2091
+ var objectProto$4 = Object.prototype;
2105
2092
 
2106
2093
  /** Used to check objects for own properties. */
2107
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
2094
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
2108
2095
 
2109
2096
  /**
2110
2097
  * Creates an array of the enumerable property names of the array-like `value`.
@@ -2124,7 +2111,7 @@ function arrayLikeKeys(value, inherited) {
2124
2111
  length = result.length;
2125
2112
 
2126
2113
  for (var key in value) {
2127
- if ((inherited || hasOwnProperty$4.call(value, key)) &&
2114
+ if ((inherited || hasOwnProperty$3.call(value, key)) &&
2128
2115
  !(skipIndexes && (
2129
2116
  // Safari 9 has enumerable `arguments.length` in strict mode.
2130
2117
  key == 'length' ||
@@ -2144,7 +2131,7 @@ function arrayLikeKeys(value, inherited) {
2144
2131
  var _arrayLikeKeys = arrayLikeKeys;
2145
2132
 
2146
2133
  /** Used for built-in method references. */
2147
- var objectProto$4 = Object.prototype;
2134
+ var objectProto$3 = Object.prototype;
2148
2135
 
2149
2136
  /**
2150
2137
  * Checks if `value` is likely a prototype object.
@@ -2155,7 +2142,7 @@ var objectProto$4 = Object.prototype;
2155
2142
  */
2156
2143
  function isPrototype(value) {
2157
2144
  var Ctor = value && value.constructor,
2158
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$4;
2145
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$3;
2159
2146
 
2160
2147
  return value === proto;
2161
2148
  }
@@ -2184,10 +2171,10 @@ var nativeKeys = _overArg(Object.keys, Object);
2184
2171
  var _nativeKeys = nativeKeys;
2185
2172
 
2186
2173
  /** Used for built-in method references. */
2187
- var objectProto$3 = Object.prototype;
2174
+ var objectProto$2 = Object.prototype;
2188
2175
 
2189
2176
  /** Used to check objects for own properties. */
2190
- var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
2177
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
2191
2178
 
2192
2179
  /**
2193
2180
  * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
@@ -2202,7 +2189,7 @@ function baseKeys(object) {
2202
2189
  }
2203
2190
  var result = [];
2204
2191
  for (var key in Object(object)) {
2205
- if (hasOwnProperty$3.call(object, key) && key != 'constructor') {
2192
+ if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
2206
2193
  result.push(key);
2207
2194
  }
2208
2195
  }
@@ -2293,10 +2280,10 @@ var _getAllKeys = getAllKeys;
2293
2280
  var COMPARE_PARTIAL_FLAG$3 = 1;
2294
2281
 
2295
2282
  /** Used for built-in method references. */
2296
- var objectProto$2 = Object.prototype;
2283
+ var objectProto$1 = Object.prototype;
2297
2284
 
2298
2285
  /** Used to check objects for own properties. */
2299
- var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
2286
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
2300
2287
 
2301
2288
  /**
2302
2289
  * A specialized version of `baseIsEqualDeep` for objects with support for
@@ -2324,7 +2311,7 @@ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
2324
2311
  var index = objLength;
2325
2312
  while (index--) {
2326
2313
  var key = objProps[index];
2327
- if (!(isPartial ? key in other : hasOwnProperty$2.call(other, key))) {
2314
+ if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
2328
2315
  return false;
2329
2316
  }
2330
2317
  }
@@ -2458,10 +2445,10 @@ var argsTag = '[object Arguments]',
2458
2445
  objectTag = '[object Object]';
2459
2446
 
2460
2447
  /** Used for built-in method references. */
2461
- var objectProto$1 = Object.prototype;
2448
+ var objectProto = Object.prototype;
2462
2449
 
2463
2450
  /** Used to check objects for own properties. */
2464
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
2451
+ var hasOwnProperty = objectProto.hasOwnProperty;
2465
2452
 
2466
2453
  /**
2467
2454
  * A specialized version of `baseIsEqual` for arrays and objects which performs
@@ -2504,8 +2491,8 @@ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
2504
2491
  : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
2505
2492
  }
2506
2493
  if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
2507
- var objIsWrapped = objIsObj && hasOwnProperty$1.call(object, '__wrapped__'),
2508
- othIsWrapped = othIsObj && hasOwnProperty$1.call(other, '__wrapped__');
2494
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
2495
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
2509
2496
 
2510
2497
  if (objIsWrapped || othIsWrapped) {
2511
2498
  var objUnwrapped = objIsWrapped ? object.value() : object,
@@ -3439,131 +3426,6 @@ var sortBy = _baseRest(function(collection, iteratees) {
3439
3426
 
3440
3427
  var sortBy_1 = sortBy;
3441
3428
 
3442
- /**
3443
- * The base implementation of `assignValue` and `assignMergeValue` without
3444
- * value checks.
3445
- *
3446
- * @private
3447
- * @param {Object} object The object to modify.
3448
- * @param {string} key The key of the property to assign.
3449
- * @param {*} value The value to assign.
3450
- */
3451
- function baseAssignValue(object, key, value) {
3452
- if (key == '__proto__' && _defineProperty) {
3453
- _defineProperty(object, key, {
3454
- 'configurable': true,
3455
- 'enumerable': true,
3456
- 'value': value,
3457
- 'writable': true
3458
- });
3459
- } else {
3460
- object[key] = value;
3461
- }
3462
- }
3463
-
3464
- var _baseAssignValue = baseAssignValue;
3465
-
3466
- /**
3467
- * A specialized version of `baseAggregator` for arrays.
3468
- *
3469
- * @private
3470
- * @param {Array} [array] The array to iterate over.
3471
- * @param {Function} setter The function to set `accumulator` values.
3472
- * @param {Function} iteratee The iteratee to transform keys.
3473
- * @param {Object} accumulator The initial aggregated object.
3474
- * @returns {Function} Returns `accumulator`.
3475
- */
3476
- function arrayAggregator(array, setter, iteratee, accumulator) {
3477
- var index = -1,
3478
- length = array == null ? 0 : array.length;
3479
-
3480
- while (++index < length) {
3481
- var value = array[index];
3482
- setter(accumulator, value, iteratee(value), array);
3483
- }
3484
- return accumulator;
3485
- }
3486
-
3487
- var _arrayAggregator = arrayAggregator;
3488
-
3489
- /**
3490
- * Aggregates elements of `collection` on `accumulator` with keys transformed
3491
- * by `iteratee` and values set by `setter`.
3492
- *
3493
- * @private
3494
- * @param {Array|Object} collection The collection to iterate over.
3495
- * @param {Function} setter The function to set `accumulator` values.
3496
- * @param {Function} iteratee The iteratee to transform keys.
3497
- * @param {Object} accumulator The initial aggregated object.
3498
- * @returns {Function} Returns `accumulator`.
3499
- */
3500
- function baseAggregator(collection, setter, iteratee, accumulator) {
3501
- _baseEach(collection, function(value, key, collection) {
3502
- setter(accumulator, value, iteratee(value), collection);
3503
- });
3504
- return accumulator;
3505
- }
3506
-
3507
- var _baseAggregator = baseAggregator;
3508
-
3509
- /**
3510
- * Creates a function like `_.groupBy`.
3511
- *
3512
- * @private
3513
- * @param {Function} setter The function to set accumulator values.
3514
- * @param {Function} [initializer] The accumulator object initializer.
3515
- * @returns {Function} Returns the new aggregator function.
3516
- */
3517
- function createAggregator(setter, initializer) {
3518
- return function(collection, iteratee) {
3519
- var func = isArray_1(collection) ? _arrayAggregator : _baseAggregator,
3520
- accumulator = initializer ? initializer() : {};
3521
-
3522
- return func(collection, setter, _baseIteratee(iteratee), accumulator);
3523
- };
3524
- }
3525
-
3526
- var _createAggregator = createAggregator;
3527
-
3528
- /** Used for built-in method references. */
3529
- var objectProto = Object.prototype;
3530
-
3531
- /** Used to check objects for own properties. */
3532
- var hasOwnProperty = objectProto.hasOwnProperty;
3533
-
3534
- /**
3535
- * Creates an object composed of keys generated from the results of running
3536
- * each element of `collection` thru `iteratee`. The order of grouped values
3537
- * is determined by the order they occur in `collection`. The corresponding
3538
- * value of each key is an array of elements responsible for generating the
3539
- * key. The iteratee is invoked with one argument: (value).
3540
- *
3541
- * @static
3542
- * @memberOf _
3543
- * @since 0.1.0
3544
- * @category Collection
3545
- * @param {Array|Object} collection The collection to iterate over.
3546
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
3547
- * @returns {Object} Returns the composed aggregate object.
3548
- * @example
3549
- *
3550
- * _.groupBy([6.1, 4.2, 6.3], Math.floor);
3551
- * // => { '4': [4.2], '6': [6.1, 6.3] }
3552
- *
3553
- * // The `_.property` iteratee shorthand.
3554
- * _.groupBy(['one', 'two', 'three'], 'length');
3555
- * // => { '3': ['one', 'two'], '5': ['three'] }
3556
- */
3557
- var groupBy = _createAggregator(function(result, value, key) {
3558
- if (hasOwnProperty.call(result, key)) {
3559
- result[key].push(value);
3560
- } else {
3561
- _baseAssignValue(result, key, [value]);
3562
- }
3563
- });
3564
-
3565
- var groupBy_1 = groupBy;
3566
-
3567
3429
  var bind = function bind(fn, thisArg) {
3568
3430
  return function wrap() {
3569
3431
  var args = new Array(arguments.length);
@@ -5308,6 +5170,11 @@ axios_1.default = _default;
5308
5170
 
5309
5171
  var axios = axios_1;
5310
5172
 
5173
+ const dateTimeFormat = 'YYYY-MM-DD HH:mm:ss';
5174
+ const shortDateYearFormat = 'ddd, MMM DD YYYY';
5175
+ const apiV1Prefix = 'api';
5176
+ const defaultImage = 'https://res.cloudinary.com/reckon-mini-sites/image/upload/v1636477599/FaveSalon%20Social%20Website/default/default--picture_w3jvfh.png';
5177
+
5311
5178
  exports.BusinessHourStatus = void 0;
5312
5179
  (function (BusinessHourStatus) {
5313
5180
  BusinessHourStatus[BusinessHourStatus["Open"] = 0] = "Open";
@@ -5315,40 +5182,34 @@ exports.BusinessHourStatus = void 0;
5315
5182
  BusinessHourStatus[BusinessHourStatus["ByAppointment"] = 2] = "ByAppointment";
5316
5183
  })(exports.BusinessHourStatus || (exports.BusinessHourStatus = {}));
5317
5184
  function createSalon(blob) {
5318
- const salonGeoLocations = blob.salon_geolocation || [];
5319
- const themeColors = {
5320
- 'allure24-blue': '89c8d2',
5321
- 'allure24-pink': 'ff7fa2',
5322
- 'the-shave': 'af8c45',
5323
- 'theme2-dark-green': '90c245',
5324
- 'theme2-green': 'bed451',
5325
- 'theme2-light-pink': 'd47b99',
5326
- 'theme2-purple': 'ab345c',
5327
- 'theme3-blue': '076dec',
5328
- 'theme3-layout1': 'd59b76',
5329
- 'theme3-layout2': 'b02858',
5330
- 'theme4-green': '5da826',
5331
- 'theme4': '08b89d',
5332
- 'theme5': 'f64c4d',
5333
- };
5185
+ const geoLocations = blob.salon_geolocation || [];
5186
+ let salonImages = [];
5187
+ if (blob.salon_miniwebsite) {
5188
+ const activeSite = Array.isArray(blob.salon_miniwebsite) ? blob.salon_miniwebsite[0] : (blob.salon_miniwebsite || {});
5189
+ salonImages = [
5190
+ activeSite.full_small_slider_img1,
5191
+ activeSite.full_small_slider_img2,
5192
+ activeSite.full_small_slider_img3,
5193
+ ].filter(image => !!image);
5194
+ }
5334
5195
  return {
5335
5196
  id: blob.id,
5336
5197
  about: blob.about,
5337
5198
  email: blob.email,
5199
+ ownerName: blob.owner_name,
5338
5200
  fullProfileImage: blob.full_profile_image,
5339
5201
  fullCoverImage: blob.full_cover_image,
5340
- ownerName: blob.owner_name,
5341
5202
  subdomain: blob.subdomain,
5342
5203
  website: blob.website,
5343
5204
  businessName: blob.business_name,
5344
5205
  businessPhone: blob.business_phone,
5345
5206
  businessAddress: blob.business_address,
5346
- businessLocationLat: salonGeoLocations.length > 0 ? salonGeoLocations[0].location_lat : null,
5347
- businessLocationLng: salonGeoLocations.length > 0 ? salonGeoLocations[0].location_lng : null,
5207
+ businessLocationLat: geoLocations.length > 0 ? geoLocations[0].location_lat : null,
5208
+ businessLocationLng: geoLocations.length > 0 ? geoLocations[0].location_lng : null,
5348
5209
  city: blob.city,
5349
5210
  state: blob.state,
5350
5211
  zipcode: blob.zipcode ? Number(blob.zipcode) : null,
5351
- businessHours: (blob.business_hours || blob.salon_workingtime || []).map(bh => {
5212
+ businessHours: (blob.business_hours || blob.salon_working_time || []).map(bh => {
5352
5213
  return {
5353
5214
  dayName: bh.day_name,
5354
5215
  openTime: bh.open_time,
@@ -5357,53 +5218,23 @@ function createSalon(blob) {
5357
5218
  };
5358
5219
  }),
5359
5220
  rating: Number(blob.rating_point),
5360
- primaryColor: themeColors[blob.default_mini_site_template] || themeColors['allure24-blue'],
5221
+ primaryColor: blob.primary_color || colors.Colors.Primary,
5222
+ salonImages,
5361
5223
  };
5362
5224
  }
5363
-
5364
- var dayjs_min = createCommonjsModule(function (module, exports) {
5365
- !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},D="en",v={};v[D]=M;var p=function(t){return t instanceof _},S=function(t,e,n){var r;if(!t)return D;if("string"==typeof t)v[t]&&(r=t),e&&(v[t]=e,r=t);else {var i=t.name;v[i]=t,r=i;}return !n&&r&&(D=r),r||!n&&D},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var D=this.$locale().weekStart||0,v=(y<D?y+7:y)-D;return $(r?m-v:m+(6-v),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].substr(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,D=O.m(this,M);return D=(l={},l[c]=D/12,l[f]=D,l[h]=D/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?D:O.a(D)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return v[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),b=_.prototype;return w.prototype=b,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){b[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=v[D],w.Ls=v,w.p={},w}));
5366
- });
5367
-
5368
- const shortDate = 'DD MMM YYYY';
5369
- const apiDateFormat = 'YYYY-MM-DD HH:mm:ss';
5370
-
5371
- function createUser(blob) {
5372
- const userNames = [blob.first_name, blob.last_name].filter(name => !!name);
5373
- return {
5374
- id: blob.user_id,
5375
- name: userNames.length > 0 ? userNames.join(' ') : blob.username,
5376
- firstName: blob.first_name,
5377
- lastName: blob.last_name,
5378
- avatar: blob.full_profile_image_thumb,
5379
- };
5225
+ function getSalonImage({ salonImages, fullProfileImage }) {
5226
+ if (salonImages && salonImages.length > 0) {
5227
+ return salonImages[0];
5228
+ }
5229
+ if (fullProfileImage) {
5230
+ return fullProfileImage;
5231
+ }
5232
+ return defaultImage;
5380
5233
  }
5381
5234
 
5382
- function createFavesalonStyle(blob) {
5383
- const [createdDay, createdTime] = String(blob.create_date).split(' ');
5384
- const [updatedDay, updatedTime] = String(blob.update_date).split(' ');
5385
- return {
5386
- id: blob.id,
5387
- caption: blob.caption,
5388
- description: blob.description,
5389
- createdDate: dayjs_min(`${createdDay} ${createdTime}`, apiDateFormat).valueOf(),
5390
- updatedDate: dayjs_min(`${updatedDay} ${updatedTime}`, apiDateFormat).valueOf(),
5391
- mediaType: blob.media_type,
5392
- fullImageUrl: blob.full_image_url,
5393
- fullImageUrlThumb: blob.full_image_url_thumb,
5394
- fullImageUrlMedium: blob.full_image_url_medium,
5395
- imgWidth: blob.img_w,
5396
- imgHeight: blob.img_h,
5397
- s3ImgWidth: blob.s3_img_w,
5398
- s3ImgHeight: blob.s3_img_h,
5399
- totalLike: blob.total_like,
5400
- totalDislike: blob.total_dislike,
5401
- totalShare: blob.total_shared,
5402
- totalView: blob.view_count,
5403
- totalBooking: blob.total_booking,
5404
- owner: blob.user ? createUser(blob.user) : null,
5405
- };
5406
- }
5235
+ var dayjs_min = _commonjsHelpers.createCommonjsModule(function (module, exports) {
5236
+ !function(t,e){module.exports=e();}(_commonjsHelpers.commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},D="en",v={};v[D]=M;var p=function(t){return t instanceof _},S=function(t,e,n){var r;if(!t)return D;if("string"==typeof t)v[t]&&(r=t),e&&(v[t]=e,r=t);else {var i=t.name;v[i]=t,r=i;}return !n&&r&&(D=r),r||!n&&D},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var D=this.$locale().weekStart||0,v=(y<D?y+7:y)-D;return $(r?m-v:m+(6-v),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].substr(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,D=O.m(this,M);return D=(l={},l[c]=D/12,l[f]=D,l[h]=D/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?D:O.a(D)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return v[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),b=_.prototype;return w.prototype=b,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){b[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=v[D],w.Ls=v,w.p={},w}));
5237
+ });
5407
5238
 
5408
5239
  function createService(blob) {
5409
5240
  const photos = (blob.photo_link || []).map(photo => {
@@ -5432,18 +5263,169 @@ function createService(blob) {
5432
5263
 
5433
5264
  function createStylist(blob) {
5434
5265
  const ratingPercentage = blob.rating_percent ? Number(blob.rating_percent) : 0;
5266
+ const { first_name, last_name, mobile_phone, avatar, full_profile_image, } = blob.user || {};
5267
+ const userNames = [first_name, last_name].filter(name => !!name);
5435
5268
  return {
5436
- id: Number(blob.stylist_id),
5437
- name: blob.title || [blob.first_name, blob.last_name].filter(field => !!field).join(' '),
5438
- firstName: blob.first_name,
5439
- lastName: blob.last_name,
5440
- avatar: blob.avatar,
5441
- phone: blob.mobile_phone,
5269
+ id: Number(blob.id),
5270
+ firstName: first_name,
5271
+ lastName: last_name,
5272
+ fullName: userNames.length > 0 ? userNames.join(' ') : blob.email,
5273
+ avatar: avatar || full_profile_image,
5274
+ phone: mobile_phone,
5275
+ expertise: Boolean(blob.expertise),
5276
+ rating: Math.ceil((ratingPercentage * 5) / 100),
5277
+ };
5278
+ }
5279
+ function createStylistFromLookbook(blob) {
5280
+ const { user } = blob;
5281
+ const ratingPercentage = blob.rating_percent ? Number(blob.rating_percent) : 0;
5282
+ const userNames = [user.first_name, user.last_name].filter(name => !!name);
5283
+ return {
5284
+ id: Number(blob.id),
5285
+ firstName: user.first_name,
5286
+ lastName: user.last_name,
5287
+ fullName: userNames.length > 0 ? userNames.join(' ') : (blob.fullName || blob.name || blob.title),
5288
+ avatar: user.full_avatar || user.full_profile_image_thumb,
5289
+ phone: user.mobile_phone,
5442
5290
  expertise: Boolean(blob.expertise),
5443
5291
  rating: Math.ceil((ratingPercentage * 5) / 100),
5444
5292
  };
5445
5293
  }
5446
5294
 
5295
+ function createUser(blob) {
5296
+ const userNames = [blob.first_name, blob.last_name].filter(name => !!name);
5297
+ return {
5298
+ id: blob.user_id,
5299
+ firstName: blob.first_name,
5300
+ lastName: blob.last_name,
5301
+ fullName: userNames.length > 0 ? userNames.join(' ') : (blob.fullName || blob.name || blob.username),
5302
+ avatar: blob.avatar || blob.full_profile_image_thumb,
5303
+ };
5304
+ }
5305
+
5306
+ var MediaType;
5307
+ (function (MediaType) {
5308
+ MediaType[MediaType["Photo"] = 0] = "Photo";
5309
+ MediaType[MediaType["Video"] = 1] = "Video";
5310
+ })(MediaType || (MediaType = {}));
5311
+ class AlbumMedia {
5312
+ constructor(fields) {
5313
+ Object.assign(this, fields);
5314
+ }
5315
+ }
5316
+ function createAlbumMedia(blob) {
5317
+ const [createdDay, createdTime] = blob.create_date ? String(blob.create_date).split(' ') : [];
5318
+ const createdDateTime = createdDay && createdTime ? dayjs_min(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf() : null;
5319
+ const [updatedDay, updatedTime] = blob.update_date ? String(blob.update_date).split(' ') : [];
5320
+ const updatedDateTime = updatedDay && updatedTime ? dayjs_min(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf() : null;
5321
+ const isVideo = blob.media_type === MediaType.Video || blob.full_image_url.indexOf('.mp4') > -1;
5322
+ return new AlbumMedia({
5323
+ id: blob.id,
5324
+ caption: blob.caption,
5325
+ description: blob.description,
5326
+ createdDate: createdDateTime,
5327
+ updatedDate: updatedDateTime,
5328
+ mediaUrl: blob.full_image_url,
5329
+ imageThumb: !isVideo ? blob.full_image_url_thumb : null,
5330
+ imageThumbMedium: !isVideo ? blob.full_image_url_medium : null,
5331
+ imageWidth: !isVideo ? blob.img_w : 400,
5332
+ imageHeight: !isVideo ? blob.img_h : 300,
5333
+ mediaType: isVideo ? MediaType.Video : blob.media_type,
5334
+ totalLike: blob.total_like,
5335
+ totalDislike: blob.total_dislike,
5336
+ totalShare: blob.total_shared,
5337
+ totalView: blob.view_count,
5338
+ totalBooking: blob.total_booking,
5339
+ });
5340
+ }
5341
+ class Album {
5342
+ constructor(fields) {
5343
+ Object.assign(this, fields);
5344
+ }
5345
+ }
5346
+ function createAlbum(blob) {
5347
+ return new Album({
5348
+ id: blob.id,
5349
+ name: blob.name,
5350
+ caption: blob.caption,
5351
+ description: blob.description,
5352
+ tags: blob.tags ? blob.tags.filter(tag => !!tag) : [],
5353
+ salonId: blob.salon_id,
5354
+ stylistId: blob.stylist_id,
5355
+ totalMedias: blob.total_medias || 0,
5356
+ service: blob.service ? createService(blob.service) : null,
5357
+ isPublic: (typeof blob.is_public !== 'undefined') ? Boolean(blob.is_public) : true,
5358
+ });
5359
+ }
5360
+ class FaveStyleComment {
5361
+ constructor(fields) {
5362
+ Object.assign(this, fields);
5363
+ }
5364
+ }
5365
+ function createFaveStyleComment(blob) {
5366
+ const [createdDay, createdTime] = blob.create_date ? String(blob.create_date).split(' ') : [];
5367
+ const createdDateTime = createdDay && createdTime ? dayjs_min(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf() : null;
5368
+ const [updatedDay, updatedTime] = blob.update_date ? String(blob.update_date).split(' ') : [];
5369
+ const updatedDateTime = updatedDay && updatedTime ? dayjs_min(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf() : null;
5370
+ return new FaveStyleComment({
5371
+ id: blob.id,
5372
+ type: blob.type,
5373
+ title: blob.content,
5374
+ description: blob.description,
5375
+ createdDate: createdDateTime,
5376
+ updatedDate: updatedDateTime,
5377
+ parentCommentId: blob.parentCommentId,
5378
+ childComments: blob.child_comment ? blob.child_comment.map(createFaveStyleComment) : [],
5379
+ user: createUser(blob.user),
5380
+ });
5381
+ }
5382
+ class FaveStyle {
5383
+ constructor(fields) {
5384
+ Object.assign(this, fields);
5385
+ }
5386
+ }
5387
+ function createFaveStyle(blob) {
5388
+ const [createdDay, createdTime] = blob.create_date ? String(blob.create_date).split(' ') : [];
5389
+ const createdDateTime = createdDay && createdTime ? dayjs_min(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf() : null;
5390
+ const [updatedDay, updatedTime] = blob.update_date ? String(blob.update_date).split(' ') : [];
5391
+ const updatedDateTime = updatedDay && updatedTime ? dayjs_min(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf() : null;
5392
+ const albumMedias = [createAlbumMedia(blob)].concat(blob.album_medias ? blob.album_medias.map(createAlbumMedia).filter(ap => ap.id !== blob.id) : []);
5393
+ const { total_booked: totalBooked, total_like: totalLike, total_share: totalShare, total_view: totalView, } = blob.style_activity || {};
5394
+ return new FaveStyle({
5395
+ id: blob.id,
5396
+ caption: blob.caption,
5397
+ description: blob.description,
5398
+ createdDate: createdDateTime,
5399
+ updatedDate: updatedDateTime,
5400
+ imageUrl: blob.full_image_url,
5401
+ imageThumb: blob.full_image_url_thumb,
5402
+ imageThumbMedium: blob.full_image_url_medium,
5403
+ imageWidth: blob.img_w,
5404
+ imageHeight: blob.img_h,
5405
+ mediaType: blob.media_type,
5406
+ isPublic: (typeof blob.is_public !== 'undefined') ? Boolean(blob.is_public) : true,
5407
+ totalBooking: totalBooked || 0,
5408
+ totalLike: totalLike || 0,
5409
+ totalDislike: blob.total_dislike || 0,
5410
+ totalShare: totalShare || 0,
5411
+ totalView: totalView || 0,
5412
+ albumMedias,
5413
+ album: blob.album ? createAlbum(blob.album) : null,
5414
+ owner: blob.user ? createUser(blob.user) : null,
5415
+ salonId: blob.salon_id ? Number(blob.salon_id) : null,
5416
+ salon: blob.salon ? createSalon(blob.salon) : null,
5417
+ stylistId: blob.stylist_id ? Number(blob.stylist_id) : null,
5418
+ stylist: blob.stylist ? createStylistFromLookbook(blob.stylist) : null,
5419
+ isLiked: blob.my_activity && blob.my_activity.liked,
5420
+ serviceId: blob.service_id ? Number(blob.service_id) : null,
5421
+ salonServiceId: blob.category_service_id ? Number(blob.category_service_id) : null,
5422
+ productBrand: blob.product_brand_used || '',
5423
+ });
5424
+ }
5425
+ function isVideoMedia({ mediaType }) {
5426
+ return mediaType === MediaType.Video;
5427
+ }
5428
+
5447
5429
  function createReviewPhoto(blob) {
5448
5430
  return {
5449
5431
  id: blob.id,
@@ -5453,15 +5435,15 @@ function createReviewPhoto(blob) {
5453
5435
  };
5454
5436
  }
5455
5437
  function createReview(blob) {
5456
- const reviewPhotos = blob.salon_review_photo || blob.beautician_review_photo || [];
5438
+ const reviewPhotos = blob.review_photo || [];
5457
5439
  const [createdDay, createdTime] = String(blob.create_date).split(' ');
5458
5440
  const [updatedDay, updatedTime] = String(blob.update_date).split(' ');
5459
5441
  return {
5460
5442
  title: blob.title,
5461
- point: Math.ceil(Number(blob.avg_point)),
5462
5443
  description: blob.comment,
5463
- createdDate: dayjs_min(`${createdDay} ${createdTime}`, apiDateFormat).valueOf(),
5464
- updatedDate: dayjs_min(`${updatedDay} ${updatedTime}`, apiDateFormat).valueOf(),
5444
+ createdDate: dayjs_min(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf(),
5445
+ updatedDate: dayjs_min(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf(),
5446
+ point: Math.ceil(Number(blob.avg_point)),
5465
5447
  pointView: blob.view_point,
5466
5448
  pointPrice: blob.price_point,
5467
5449
  pointProduct: blob.product_point,
@@ -5471,69 +5453,58 @@ function createReview(blob) {
5471
5453
  helpful: blob.helpful,
5472
5454
  recommend: blob.recommend,
5473
5455
  user: blob.user ? createUser(blob.user) : null,
5456
+ salon: blob.salon ? createSalon(blob.salon) : null,
5457
+ stylist: blob.stylist && blob.stylist.user ? createStylist(blob.stylist) : null,
5474
5458
  photos: reviewPhotos.map(createReviewPhoto),
5475
5459
  };
5476
5460
  }
5477
5461
 
5478
- var __rest = (undefined && undefined.__rest) || function (s, e) {
5479
- var t = {};
5480
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5481
- t[p] = s[p];
5482
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
5483
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
5484
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
5485
- t[p[i]] = s[p[i]];
5486
- }
5487
- return t;
5488
- };
5462
+ const apiV2Prefix = 'api-ver2';
5489
5463
  class HttpService {
5490
5464
  constructor() {
5491
5465
  this.http = null;
5492
5466
  this.http = axios.create({
5493
5467
  baseURL: 'https://favesalon.com',
5468
+ // baseURL: 'http://13.57.216.170',
5494
5469
  headers: {},
5495
5470
  });
5496
5471
  }
5497
- fetchSalonInfo(salonId) {
5498
- const url = 'api/salon/settings-public';
5499
- return this.http.post(url, { salon_id: salonId })
5500
- .then((response) => {
5501
- const { status, data } = response.data;
5502
- return status && data ? createSalon(data.Salon) : null;
5503
- })
5504
- .catch(() => (null));
5505
- }
5506
- fetchReviews(url, options, allReviews) {
5507
- const { noLoop } = options, restOptions = __rest(options, ["noLoop"]);
5508
- return this.http.post(url, restOptions)
5472
+ fetchStyleDetail(styleId) {
5473
+ return this.http.get(`${apiV2Prefix}/style/${styleId}/detail`)
5509
5474
  .then((response) => {
5510
5475
  const { status, data } = response.data;
5511
5476
  if (status) {
5512
- const reviews = (data || []).filter(blob => Math.ceil(Number(blob.avg_point)) > 0).map(createReview);
5513
- // fetch next page's reviews
5514
- if (!noLoop && reviews.length >= options.limit) {
5515
- return this.fetchReviews(url, Object.assign(Object.assign({}, options), { page: options.page + 1 }), allReviews.concat(reviews));
5477
+ let styleInfo = null, similarStyles = [];
5478
+ try {
5479
+ styleInfo = createFaveStyle(data);
5480
+ similarStyles = (data.style_similars || []).map(createFaveStyle);
5516
5481
  }
5517
- const finalReviews = options.page === 1 ? reviews : allReviews.concat(reviews);
5518
- return {
5519
- totalReviews: finalReviews.length || 0,
5520
- allReviews: finalReviews,
5521
- };
5482
+ catch (e) { }
5483
+ return { styleInfo, similarStyles };
5522
5484
  }
5523
- return { totalReviews: 0, allReviews: [] };
5485
+ return { styleInfo: null, similarStyles: [] };
5486
+ })
5487
+ .catch(() => {
5488
+ return { styleInfo: null, similarStyles: [] };
5524
5489
  });
5525
5490
  }
5526
- fetchSalonReviews(salonId, options) {
5527
- const url = '/api/salon/reviews';
5528
- return this.fetchReviews(url, Object.assign({ page: 1, limit: 5, salon_id: salonId, avg_point_greater_than: 0 }, options), [])
5491
+ fetchSalonInfo(salonId) {
5492
+ const url = `${apiV2Prefix}/salon/${salonId}/detail`;
5493
+ return this.http.get(url)
5494
+ .then((response) => {
5495
+ const { status, data } = response.data;
5496
+ return status && data ? createSalon(data) : null;
5497
+ })
5498
+ .catch(() => (null));
5499
+ }
5500
+ fetchSalonLatestStyles(salonId, options) {
5501
+ const url = `${apiV2Prefix}/salon/${salonId}/styles`;
5502
+ return this.http.post(url, Object.assign(Object.assign({}, options), { sort: 'newest' }))
5529
5503
  .then(response => {
5530
- const { totalReviews, allReviews } = response;
5531
- return {
5532
- total: totalReviews,
5533
- allItems: allReviews,
5534
- };
5504
+ const { data } = response.data;
5505
+ return (data || []).slice(0, options.limit).map(createFaveStyle);
5535
5506
  })
5536
- .catch(() => ({ total: 0, allItems: [] }));
5507
+ .catch(() => ([]));
5537
5508
  }
5538
5509
  decorateServiceGroups(groups) {
5539
5510
  return groups.map((cate, index) => {
@@ -5560,7 +5531,7 @@ class HttpService {
5560
5531
  });
5561
5532
  }
5562
5533
  fetchSalonServices(salonId) {
5563
- const url = `api/salon/services?v=2&id=${salonId}`;
5534
+ const url = `${apiV1Prefix}/salon/services?v=2&id=${salonId}`;
5564
5535
  return this.http.get(url)
5565
5536
  .then(response => {
5566
5537
  const { status, data } = response.data;
@@ -5571,34 +5542,42 @@ class HttpService {
5571
5542
  })
5572
5543
  .catch(() => ([]));
5573
5544
  }
5574
- fetchSalonStylists(salonId) {
5575
- const fetchStylistSchedules = this.http.get(`api/calendar/resource/stylists?salon_id=${salonId}`)
5576
- .then((response) => {
5577
- const { status, data } = response.data;
5578
- return status ? (data || []) : [];
5579
- })
5580
- .catch(() => ([]));
5581
- const fetchStylistSkills = this.http.get(`api/salon/skill-stylists/${salonId}`)
5582
- .then((response) => {
5583
- const { status, data } = response.data;
5584
- return status ? (data || []).map(blob => (Object.assign(Object.assign({}, blob), { id: blob.stylist_id }))) : [];
5545
+ fetchSalonStylists(salonId, options = { page: 1, limit: 12 }) {
5546
+ const url = `${apiV2Prefix}/salon/${salonId}/stylists?page=${options.page}&limit=${options.limit}`;
5547
+ return this.http.get(url)
5548
+ .then(response => {
5549
+ const { paging, data } = response.data;
5550
+ return {
5551
+ total: paging.total_item || data.length,
5552
+ data: data.map(createStylist),
5553
+ };
5585
5554
  })
5586
- .catch(() => ([]));
5587
- return Promise.all([fetchStylistSchedules, fetchStylistSkills])
5588
- .then(results => {
5589
- const [stylistSchedules, stylistSkills] = results;
5590
- const allStylistGroups = groupBy_1(stylistSchedules.concat(stylistSkills), stylist => stylist.id);
5591
- return Object.keys(allStylistGroups)
5592
- .filter(stylistId => Number(stylistId) > 0)
5593
- .map(stylistId => {
5594
- const [schedule, skills] = allStylistGroups[stylistId];
5595
- return createStylist(Object.assign(Object.assign({}, schedule), skills));
5596
- });
5555
+ .catch(() => ({ total: 0, data: [] }));
5556
+ }
5557
+ fetchSalonReviews(salonId, options) {
5558
+ const url = `${apiV2Prefix}/salon/${salonId}/reviews`;
5559
+ return this.http.post(url, Object.assign({ avg_point_greater_than: 0 }, options))
5560
+ .then(response => {
5561
+ const { data, paging } = response.data || {};
5562
+ const { total_1star: onestar, total_2star: twoStar, total_3star: threeStar, total_4star: fourStar, total_5star: fiveStar, total_review: totalReviews, avg_point: reviewPoint, } = paging.review_detail || {};
5563
+ return {
5564
+ total: paging.total_item || 0,
5565
+ stats: {
5566
+ totalReviews,
5567
+ reviewPoint: reviewPoint ? Math.ceil(reviewPoint) : 0,
5568
+ '1': onestar ? Math.ceil(onestar) : 0,
5569
+ '2': twoStar ? Math.ceil(twoStar) : 0,
5570
+ '3': threeStar ? Math.ceil(threeStar) : 0,
5571
+ '4': fourStar ? Math.ceil(fourStar) : 0,
5572
+ '5': fiveStar ? Math.ceil(fiveStar) : 0,
5573
+ },
5574
+ data: data.map(createReview),
5575
+ };
5597
5576
  })
5598
- .catch(() => []);
5577
+ .catch(() => ({ total: 0, stats: {}, data: [] }));
5599
5578
  }
5600
5579
  fetchSalonCategories() {
5601
- return this.http.post('api/home/get-service', { limit: 50 })
5580
+ return this.http.post(`${apiV2Prefix}/search/get-services`, { limit: 50 })
5602
5581
  .then((response) => {
5603
5582
  const { status, data } = response.data;
5604
5583
  if (status) {
@@ -5617,62 +5596,39 @@ class HttpService {
5617
5596
  }
5618
5597
  fetchSalonLookbooks(salonId, options) {
5619
5598
  const noResult = { total: 0, allLookbooks: [] };
5620
- return this.http.post('api/style/filter', Object.assign({ page: 1, limit: 20, salon_id: salonId }, options))
5621
- .then((response) => {
5599
+ const url = `${apiV2Prefix}/salon/${salonId}/styles`;
5600
+ const postData = Object.assign({ page: 1, limit: 20 }, options);
5601
+ return this.http.post(url, postData)
5602
+ .then(response => {
5622
5603
  const { status, data, paging } = response.data;
5623
5604
  if (status) {
5624
5605
  return {
5625
5606
  total: paging.total_item || 0,
5626
- allLookbooks: (data || []).map(createFavesalonStyle),
5607
+ allLookbooks: (data || []).map(createFaveStyle),
5627
5608
  };
5628
5609
  }
5629
5610
  return noResult;
5630
5611
  })
5631
5612
  .catch(() => (noResult));
5632
5613
  }
5633
- fetchSalonPhotos(salonId) {
5634
- return this.http
5635
- .post('api/style/filter', {
5636
- page: 1,
5637
- limit: 20,
5638
- salon_id: salonId,
5639
- })
5640
- .then((response) => {
5641
- const { status, data } = response.data;
5642
- if (status) {
5643
- return (data || []).map(createFavesalonStyle);
5644
- }
5645
- return [];
5614
+ fetchStyleComments(styleId) {
5615
+ const url = `${apiV2Prefix}/style/comment?photo_id=${styleId}`;
5616
+ return this.http.get(url)
5617
+ .then(response => {
5618
+ const { paging, data } = response.data;
5619
+ return {
5620
+ total: paging.total_item || 0,
5621
+ data: data.map(createFaveStyleComment),
5622
+ };
5646
5623
  })
5647
- .catch(() => {
5648
- return [];
5649
- });
5650
- }
5651
- fetchAllStyles(url, options, allStyles) {
5652
- return this.http.post(url, options)
5653
- .then((response) => {
5654
- const { status, data } = response.data;
5655
- if (status) {
5656
- const styles = (data || []).map(createFavesalonStyle);
5657
- // fetch next page styles
5658
- if (styles.length >= options.limit) {
5659
- return this.fetchAllStyles(url, Object.assign(Object.assign({}, options), { page: options.page + 1 }), allStyles.concat(styles));
5660
- }
5661
- return options.page === 1 ? styles : allStyles;
5662
- }
5663
- return allStyles;
5664
- });
5665
- }
5666
- fetchAllSalonPhotos(salonId, options) {
5667
- return this.fetchAllStyles('api/style/filter', Object.assign({ page: 1, limit: 20, salon_id: salonId }, options), []).catch(() => {
5668
- return [];
5669
- });
5624
+ .catch(() => ({ total: 0, data: [] }));
5670
5625
  }
5671
5626
  }
5672
5627
  const HttpService$1 = () => new HttpService();
5673
5628
 
5674
5629
  exports.HttpService = HttpService$1;
5675
5630
  exports.dayjs_min = dayjs_min;
5676
- exports.groupBy_1 = groupBy_1;
5677
- exports.shortDate = shortDate;
5631
+ exports.getSalonImage = getSalonImage;
5632
+ exports.isVideoMedia = isVideoMedia;
5633
+ exports.shortDateYearFormat = shortDateYearFormat;
5678
5634
  exports.sortBy_1 = sortBy_1;