favesalon-embed 0.0.4 → 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 (241) hide show
  1. package/LICENSE +21 -0
  2. package/{cjs → dist/cjs}/_commonjsHelpers-5cfcba41.js +0 -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/{cjs/index-48ac68d0.js → dist/cjs/index-7f190886.js} +1924 -0
  8. package/{cjs/index-d5de0b9d.js → dist/cjs/index-e6bea8f5.js} +10 -0
  9. package/{cjs → dist/cjs}/index.cjs.js +0 -0
  10. package/dist/cjs/loader.cjs.js +22 -0
  11. package/{cjs → dist/cjs}/salon-booking-modal.cjs.entry.js +5 -5
  12. package/{cjs → dist/cjs}/salon-booking.cjs.entry.js +6 -7
  13. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +28 -0
  14. package/{cjs → dist/cjs}/salon-gift-card.cjs.entry.js +7 -7
  15. package/dist/cjs/salon-latest-reviews.cjs.entry.js +95 -0
  16. package/{cjs/salon-lookbook_2.cjs.entry.js → dist/cjs/salon-lookbook.cjs.entry.js} +23 -57
  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-f1102d4a.js → dist/cjs/services-eee8f251.js} +265 -393
  22. package/dist/cjs/style-detail.cjs.entry.js +310 -0
  23. package/dist/cjs/user-avatar.cjs.entry.js +41 -0
  24. package/{cjs → dist/cjs}/utils-c5a33b3c.js +0 -0
  25. package/{collection → dist/collection}/collection-manifest.json +2 -3
  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 +3 -3
  31. package/{collection → dist/collection}/components/salon-booking/salon-booking-modal.js +4 -4
  32. package/dist/collection/components/salon-gift-card/index.css +25 -0
  33. package/{collection → dist/collection}/components/salon-gift-card/index.js +4 -3
  34. package/{collection → dist/collection}/components/salon-gift-card/salon-gift-card-modal.js +24 -3
  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/{collection → dist/collection}/components/salon-lookbook/index.css +0 -9
  44. package/{collection → dist/collection}/components/salon-lookbook/index.js +19 -19
  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/{collection → dist/collection}/components/salon-reviews/index.css +0 -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 → dist/collection}/components/salon-services/index.css +0 -0
  52. package/{collection → dist/collection}/components/salon-services/index.js +51 -8
  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 → 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/{collection → dist/collection}/types/stylist.js +12 -9
  69. package/{favesalon-embed/index.esm.js → 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 -18
  73. package/{custom-elements → dist/custom-elements}/index.js +1227 -1035
  74. package/{esm → dist/esm}/_commonjsHelpers-098d5b27.js +0 -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-0f8eed73.js → dist/esm/index-6af0a03d.js} +10 -1
  80. package/{esm/index-67d677ba.js → dist/esm/index-80523fec.js} +1924 -1
  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/{esm → dist/esm}/salon-booking-modal.entry.js +5 -5
  90. package/{esm → dist/esm}/salon-booking.entry.js +5 -6
  91. package/dist/esm/salon-gift-card-modal.entry.js +24 -0
  92. package/{esm → dist/esm}/salon-gift-card.entry.js +6 -6
  93. package/dist/esm/salon-latest-reviews.entry.js +91 -0
  94. package/{esm/salon-lookbook_2.entry.js → dist/esm/salon-lookbook.entry.js} +24 -57
  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-74d84ca9.js → dist/esm/services-295247b1.js} +263 -392
  100. package/dist/esm/style-detail.entry.js +306 -0
  101. package/dist/esm/user-avatar.entry.js +37 -0
  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/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/{favesalon-embed → dist/favesalon-embed}/p-d6083940.js +0 -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 +0 -0
  131. package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +0 -0
  132. package/{types → dist/types}/components/salon-gift-card/index.d.ts +0 -0
  133. package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +1 -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 +3 -3
  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 +1 -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 +54 -59
  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 +1 -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 +24 -7
  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/index-95daad08.js +0 -1928
  172. package/cjs/loader.cjs.js +0 -22
  173. package/cjs/salon-contact_4.cjs.entry.js +0 -155
  174. package/cjs/salon-gift-card-modal.cjs.entry.js +0 -25
  175. package/cjs/salon-info.cjs.entry.js +0 -35
  176. package/cjs/salon-latest-reviews.cjs.entry.js +0 -58
  177. package/cjs/salon-lookbook-modal.cjs.entry.js +0 -141
  178. package/cjs/salon-reviews.cjs.entry.js +0 -205
  179. package/cjs/salon-services.cjs.entry.js +0 -47
  180. package/cjs/salon-stylists.cjs.entry.js +0 -54
  181. package/collection/components/google-map/index.js +0 -97
  182. package/collection/components/salon-contact/index.js +0 -88
  183. package/collection/components/salon-gift-card/index.css +0 -25
  184. package/collection/components/salon-info/index.css +0 -3
  185. package/collection/components/salon-latest-reviews/index.js +0 -108
  186. package/collection/components/salon-locations/index.js +0 -80
  187. package/collection/components/salon-lookbook/lookbook-modal.css +0 -72
  188. package/collection/components/salon-lookbook/salon-lookbook-modal.js +0 -248
  189. package/collection/components/salon-reviews/index.js +0 -317
  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-styles/index.css +0 -23
  193. package/collection/components/salon-styles/index.js +0 -100
  194. package/collection/components/salon-stylists/index.js +0 -96
  195. package/collection/constants/colors.js +0 -91
  196. package/collection/services/services.js +0 -225
  197. package/collection/types/common.js +0 -2
  198. package/collection/types/salon.js +0 -52
  199. package/collection/types/style.js +0 -103
  200. package/esm/colors-1ec90c5f.js +0 -93
  201. package/esm/favesalon-embed.js +0 -18
  202. package/esm/google-map.entry.js +0 -43
  203. package/esm/index-09d43e3e.js +0 -1926
  204. package/esm/loader.js +0 -18
  205. package/esm/salon-contact_4.entry.js +0 -148
  206. package/esm/salon-gift-card-modal.entry.js +0 -21
  207. package/esm/salon-info.entry.js +0 -31
  208. package/esm/salon-latest-reviews.entry.js +0 -54
  209. package/esm/salon-lookbook-modal.entry.js +0 -137
  210. package/esm/salon-reviews.entry.js +0 -201
  211. package/esm/salon-services.entry.js +0 -43
  212. package/esm/salon-stylists.entry.js +0 -50
  213. package/favesalon-embed/favesalon-embed.esm.js +0 -1
  214. package/favesalon-embed/p-0188d4dc.entry.js +0 -1
  215. package/favesalon-embed/p-0318501e.js +0 -1
  216. package/favesalon-embed/p-078f242d.entry.js +0 -1
  217. package/favesalon-embed/p-13e23c61.entry.js +0 -1
  218. package/favesalon-embed/p-17df13ad.js +0 -1
  219. package/favesalon-embed/p-1a3179c8.entry.js +0 -1
  220. package/favesalon-embed/p-20aa75de.js +0 -6
  221. package/favesalon-embed/p-2901a6d6.entry.js +0 -1
  222. package/favesalon-embed/p-2b861430.entry.js +0 -1
  223. package/favesalon-embed/p-44d810a0.js +0 -1
  224. package/favesalon-embed/p-4c68700f.entry.js +0 -1
  225. package/favesalon-embed/p-4e2d7b29.js +0 -1
  226. package/favesalon-embed/p-6b845bf1.entry.js +0 -1
  227. package/favesalon-embed/p-7350f6b5.entry.js +0 -1
  228. package/favesalon-embed/p-897c2b1c.entry.js +0 -1
  229. package/favesalon-embed/p-8e60f56f.entry.js +0 -1
  230. package/favesalon-embed/p-a49afdc1.entry.js +0 -1
  231. package/favesalon-embed/p-c93867c4.entry.js +0 -1
  232. package/favesalon-embed/p-ea6a097f.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-lookbook/salon-lookbook-modal.d.ts +0 -13
  236. package/types/components/salon-reviews/index.d.ts +0 -24
  237. package/types/components/salon-styles/index.d.ts +0 -9
  238. package/types/constants/colors.d.ts +0 -88
  239. package/types/services/services.d.ts +0 -26
  240. package/types/types/common.d.ts +0 -2
  241. package/types/types/style.d.ts +0 -59
@@ -0,0 +1,306 @@
1
+ import { r as registerInstance, h } from './index-6af0a03d.js';
2
+ import { d as dayjs_min, H as HttpService, i as isVideoMedia, g as getSalonImage, s as shortDateYearFormat } from './services-295247b1.js';
3
+ import { a as createCommonjsModule, c as commonjsGlobal } from './_commonjsHelpers-098d5b27.js';
4
+ import { C as Colors } from './colors-ea36347a.js';
5
+
6
+ var relativeTime = createCommonjsModule(function (module, exports) {
7
+ !function(r,e){module.exports=e();}(commonjsGlobal,(function(){return function(r,e,t){r=r||{};var n=e.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(r,e,t,o){return n.fromToBase(r,e,t,o)}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(f=d?t(e).diff(i,y.d,!0):i.diff(e,y.d,!0));var p=(r.rounding||Math.round)(Math.abs(f));if(s=f>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(""+p)),a="string"==typeof v?v.replace("%d",p):v(p,n,y.l,s);break}}if(n)return a;var M=s?l.future:l.past;return "function"==typeof M?M(a):M.replace("%s",a)},n.to=function(r,e){return i(r,e,this,!0)},n.from=function(r,e){return i(r,e,this)};var d=function(r){return r.$u?t.utc():t()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)};}}));
8
+ });
9
+
10
+ const indexCss = ".salon-modal.salon-modal--lookbook-detail .salon-modal--close{display:none !important}.salon-modal.salon-modal--lookbook-detail .salon-modal--content{background-color:#fff;position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:1000;overflow-y:auto}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--image{height:240px !important}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--thumbnails{text-align:center}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--thumbnail{display:inline-block;margin-top:12px;margin-right:12px;height:40px;width:60px}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--button{border:none;position:absolute;top:50%;z-index:20;height:40px;width:40px;-moz-border-radius:50px;-webkit-border-radius:50px;border-radius:50px;-moz-transform:translate(0, -50%);-webkit-transform:translate(0, -50%);transform:translate(0, -50%)}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--prev{left:24px}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--next{right:24px}@media (min-width: 768px){.salon-modal.salon-modal--lookbook-detail .style-detail--slides--image{height:360px !important}}@media (min-width: 992px){.salon-modal.salon-modal--lookbook-detail .style-detail--slides--image{height:480px !important}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--thumbnail{height:56px;width:72px}}";
11
+
12
+ dayjs_min.extend(relativeTime);
13
+ let StyleDetail = class {
14
+ constructor(hostRef) {
15
+ registerInstance(this, hostRef);
16
+ this.isModalOpen = true;
17
+ this.currentMediaIdx = 0;
18
+ this.albumMedias = [];
19
+ this.similarStyles = [];
20
+ this.totalComments = 0;
21
+ this.lookbookComments = [];
22
+ }
23
+ componentWillLoad() {
24
+ this.injectSDK();
25
+ if (!!this.salonLookbook) {
26
+ this.lookbookInfo = JSON.parse(this.salonLookbook);
27
+ this.fetchData();
28
+ }
29
+ }
30
+ componentDidRender() {
31
+ this.setupGridLayout();
32
+ }
33
+ injectSDK() {
34
+ return new Promise((resolve) => {
35
+ const script = document.createElement('script');
36
+ script.type = 'text/javascript';
37
+ script.src = 'https://cdn.jsdelivr.net/npm/macy@2';
38
+ document.body.appendChild(script);
39
+ return resolve(true);
40
+ });
41
+ }
42
+ setupGridLayout() {
43
+ if (!this.isLayoutSetup && this.similarStyles.length > 0 && document.querySelector('#similar-styles--grid')) {
44
+ const script = document.createElement('script');
45
+ script.type = 'text/javascript';
46
+ script.innerHTML = `
47
+ var masonry = new Macy({
48
+ container: '#similar-styles--grid',
49
+ useContainerForBreakpoints: true,
50
+ margin: 16,
51
+ columns: 2,
52
+ });
53
+ `;
54
+ document.body.appendChild(script);
55
+ this.isLayoutSetup = true;
56
+ }
57
+ }
58
+ fetchData() {
59
+ try {
60
+ const promises = [
61
+ HttpService().fetchStyleDetail(this.lookbookInfo.id).then(response => {
62
+ const { styleInfo, similarStyles } = response;
63
+ this.similarStyles = similarStyles;
64
+ if (styleInfo) {
65
+ this.lookbookInfo = styleInfo;
66
+ this.albumMedias = styleInfo.albumMedias || [];
67
+ this.currentMedia = (styleInfo.albumMedias || [])[0];
68
+ }
69
+ }),
70
+ HttpService().fetchStyleComments(this.lookbookInfo.id).then(response => {
71
+ this.totalComments = response.total;
72
+ this.lookbookComments = response.data;
73
+ }),
74
+ ];
75
+ return Promise.all(promises);
76
+ }
77
+ catch (e) { }
78
+ }
79
+ closeModal() {
80
+ this.isModalOpen = false;
81
+ const el = document.querySelector('style-detail');
82
+ el.remove();
83
+ }
84
+ onClickLookbook(style) {
85
+ const elLookbookModal = document.createElement('div');
86
+ elLookbookModal.innerHTML = `
87
+ <style-detail
88
+ salon-id=${this.salonId}
89
+ salon-lookbook='${JSON.stringify(style)}'
90
+ ></style-detail>
91
+ `;
92
+ document.body.appendChild(elLookbookModal);
93
+ }
94
+ onClickPrev() {
95
+ if (this.currentMediaIdx === 0) {
96
+ this.currentMediaIdx = this.albumMedias.length - 1;
97
+ this.currentMedia = this.albumMedias[this.currentMediaIdx];
98
+ }
99
+ else {
100
+ this.currentMediaIdx = this.currentMediaIdx - 1;
101
+ this.currentMedia = this.albumMedias[this.currentMediaIdx];
102
+ }
103
+ }
104
+ onClickNext() {
105
+ if (this.currentMediaIdx === this.albumMedias.length - 1) {
106
+ this.currentMediaIdx = 0;
107
+ this.currentMedia = this.albumMedias[0];
108
+ }
109
+ else {
110
+ this.currentMediaIdx = this.currentMediaIdx + 1;
111
+ this.currentMedia = this.albumMedias[this.currentMediaIdx];
112
+ }
113
+ }
114
+ render() {
115
+ const { createdDate, totalView, totalLike, totalBooking, album, salon, stylist, } = this.lookbookInfo;
116
+ if (this.isModalOpen) {
117
+ const { caption, description, mediaUrl } = this.currentMedia || {};
118
+ const isVideo = isVideoMedia((this.currentMedia || {}));
119
+ return (h("div", { class: "salon-modal salon-modal--lookbook-detail" }, h("div", { class: "salon-modal--inner" }, h("div", { class: "salon-modal--content" }, h("div", { class: "style-detail" }, h("div", { class: "style-detail--header" }, h("div", { style: {
120
+ position: 'relative',
121
+ overflow: 'hidden',
122
+ } }, h("div", { style: Object.assign({ backgroundColor: Colors.Gray01, backgroundSize: 'cover', backgroundRepeat: 'no-repeat', backgroundPosition: '0 0', filter: 'blur(30px)', position: 'absolute', inset: '0', zIndex: '1' }, this.currentMedia && !isVideoMedia(this.currentMedia) ? { backgroundImage: `url("${this.currentMedia.imageThumb}")` } : {}) }), h("div", { style: {
123
+ zIndex: '2',
124
+ position: 'relative',
125
+ width: '100%',
126
+ backgroundColor: 'rgba(0, 0, 0, 0.25)',
127
+ padding: '12px 16px',
128
+ overflow: 'hidden',
129
+ } }, h("span", { style: {
130
+ color: Colors.White,
131
+ border: 'none',
132
+ display: 'flex',
133
+ alignItems: 'center',
134
+ justifyContent: 'center',
135
+ height: '32px',
136
+ } }, h("span", null, this.currentMediaIdx + 1, " / ", this.albumMedias.length)), h("div", { style: {
137
+ display: 'flex',
138
+ alignItems: 'center',
139
+ position: 'absolute',
140
+ right: '16px',
141
+ top: '50%',
142
+ transform: 'translate(0, -50%)',
143
+ } }, h("button", { type: "text", class: "btn btn-light", style: {
144
+ backgroundColor: Colors.White,
145
+ borderColor: Colors.White,
146
+ border: 'none',
147
+ borderRadius: '50px',
148
+ display: 'flex',
149
+ alignItems: 'center',
150
+ justifyContent: 'center',
151
+ height: '32px',
152
+ width: '32px',
153
+ marginLeft: '12px',
154
+ }, onClick: () => this.closeModal() }, h("i", { class: "ri-close-fill", style: { fontSize: '16px', lineHeight: '1' } })))), h("div", { style: { position: 'relative', zIndex: "3" } }, h("div", { class: "style-detail--slides", style: {
155
+ marginTop: '16px',
156
+ marginBottom: '12px',
157
+ } }, h("div", { class: "style-detail--slides--image", style: {
158
+ width: '100%',
159
+ position: 'relative',
160
+ height: '360px',
161
+ } }, isVideo && (h("video", { muted: true, controls: true, width: "100%", height: "100%" }, h("source", { src: mediaUrl, type: "video/mp4" }))), !isVideo && (h("div", { style: {
162
+ position: 'absolute',
163
+ inset: '0',
164
+ zIndex: '2',
165
+ display: 'flex',
166
+ alignItems: 'center',
167
+ justifyContent: 'center',
168
+ } }, h("img", { src: mediaUrl, alt: caption, style: {
169
+ objectFit: 'contain',
170
+ maxHeight: '100%',
171
+ maxWidth: '100%',
172
+ } })))), h("div", { class: "style-detail--slides--thumbnails", style: {
173
+ width: '100%',
174
+ position: 'relative',
175
+ } }, this.albumMedias.map((media, idx) => {
176
+ const isStyleVideo = isVideoMedia(media);
177
+ return (h("div", { class: "style-detail--slides--thumbnail", style: Object.assign(Object.assign({ backgroundColor: Colors.Gray01, borderRadius: '4px', overflow: 'hidden', position: 'relative', cursor: 'pointer' }, this.currentMediaIdx !== idx ? { opacity: '0.75' } : {}), !isStyleVideo ? {
178
+ backgroundImage: `url("${media.imageThumb || media.imageThumbMedium}")`,
179
+ backgroundRepeat: 'no-repeat',
180
+ backgroundPosition: 'center center',
181
+ backgroundSize: 'cover',
182
+ } : {}), onClick: () => {
183
+ this.currentMedia = media;
184
+ this.currentMediaIdx = idx;
185
+ } }, isStyleVideo && (h("div", null, h("video", { muted: true, width: "100%", height: "100%", poster: media.imageThumb }, h("source", { src: media.mediaUrl, type: "video/mp4" })), h("i", { class: "ri-play-circle-fill", style: {
186
+ fontSize: '48px',
187
+ color: Colors.TextColor,
188
+ position: 'absolute',
189
+ left: '50%',
190
+ top: '50%',
191
+ transform: 'translate(-50%, -50%)',
192
+ } })))));
193
+ }))), this.albumMedias.length > 1 && (h("div", null, h("button", { type: "button btn-light", class: "style-detail--slides--button style-detail--slides--prev", onClick: () => this.onClickPrev() }, h("i", { class: "ri-arrow-left-line", style: { color: Colors.TextColor, fontSize: '18px' } })), h("button", { type: "button btn-light", class: "style-detail--slides--button style-detail--slides--next", onClick: () => this.onClickNext() }, h("i", { class: "ri-arrow-right-line", style: { color: Colors.TextColor, fontSize: '18px' } }))))))), h("div", { class: "style-detail--content" }, h("div", { class: "container" }, h("div", { style: {
194
+ paddingBottom: '24px',
195
+ paddingTop: '24px',
196
+ } }, h("div", { class: "row" }, h("div", { class: this.similarStyles.length > 0 ? 'col-md-8' : 'col-md-12', style: { marginBottom: '24px' } }, h("div", { class: "row" }, salon && (h("div", { class: "col-sm-6 col-md-5", style: { marginBottom: '24px' } }, h("div", { style: {
197
+ backgroundColor: Colors.Red01,
198
+ borderRadius: '4px',
199
+ padding: '8px',
200
+ display: 'flex',
201
+ alignItems: 'center',
202
+ justifyContent: 'space-between',
203
+ } }, h("div", { style: { paddingLeft: '8px' } }, h("div", { style: { color: Colors.Gray05, fontSize: '12px' } }, "At salon"), h("div", { style: {
204
+ color: Colors.Secondary,
205
+ fontSize: '20px',
206
+ lineHeight: '24px',
207
+ } }, salon.businessName)), h("div", { style: {
208
+ backgroundImage: `url("${getSalonImage(salon)}")`,
209
+ backgroundColor: Colors.Red02,
210
+ backgroundSize: 'cover',
211
+ backgroundRepeat: 'no-repeat',
212
+ backgroundPosition: '0 0',
213
+ borderRadius: '4px',
214
+ height: '48px',
215
+ width: '48px',
216
+ } })))), stylist && stylist.id && (h("div", { class: "col-sm-6 col-md-5", style: { marginBottom: '24px' } }, h("div", { style: {
217
+ backgroundColor: Colors.Yellow01,
218
+ borderRadius: '4px',
219
+ padding: '8px',
220
+ display: 'flex',
221
+ alignItems: 'center',
222
+ justifyContent: 'space-between',
223
+ } }, h("div", { style: { paddingLeft: '8px' } }, h("div", { style: { color: Colors.Gray05, fontSize: '12px' } }, "By stylist"), h("div", { style: {
224
+ color: Colors.Secondary,
225
+ fontSize: '20px',
226
+ lineHeight: '24px',
227
+ } }, stylist.fullName)), h("div", { style: {
228
+ backgroundImage: `url("${stylist.avatar}")`,
229
+ backgroundColor: Colors.Yellow02,
230
+ backgroundSize: 'cover',
231
+ backgroundRepeat: 'no-repeat',
232
+ backgroundPosition: '0 0',
233
+ borderRadius: '4px',
234
+ height: '48px',
235
+ width: '48px',
236
+ } }))))), h("div", { style: {
237
+ borderBottom: `1px solid ${Colors.Gray02}`,
238
+ borderTop: `1px solid ${Colors.Gray02}`,
239
+ display: 'flex',
240
+ alignItems: 'center',
241
+ justifyContent: 'space-between',
242
+ paddingBottom: '16px',
243
+ paddingTop: '16px',
244
+ } }, h("div", { style: {
245
+ display: 'flex',
246
+ alignItems: 'center',
247
+ justifyContent: 'space-around',
248
+ flexShrink: '1',
249
+ flexGrow: '1',
250
+ } }, h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, totalLike), h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "faves")), h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, totalBooking), h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "booked")), h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, totalView), h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "views")), h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, this.totalComments), h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "comments")))), (caption || description) && (h("div", { style: { paddingTop: '24px' } }, h("div", { style: { color: Colors.Gray04, fontSize: '14px' } }, createdDate && dayjs_min(createdDate).format(shortDateYearFormat)), h("div", { style: { fontSize: '24px' } }, caption), h("div", { style: {
251
+ fontSize: '16px',
252
+ paddingTop: caption ? '16px' : '0',
253
+ } }, description))), album && album.tags.length > 0 && (h("div", { style: {
254
+ paddingTop: '24px',
255
+ marginBottom: '-12px',
256
+ } }, album.tags.map((tag, idx) => (h("button", { class: "btn btn-light", key: `album--tag-${idx}`, style: {
257
+ backgroundColor: Colors.Gray01,
258
+ borderColor: Colors.Gray01,
259
+ borderRadius: '4px',
260
+ marginRight: '12px',
261
+ marginBottom: '12px',
262
+ } }, tag))))), h("div", { style: { marginTop: '32px' } }, this.lookbookComments && this.lookbookComments.length > 0 && (h("div", null, h("div", { style: { fontWeight: '600', marginBottom: '8px' } }, this.totalComments, " ", this.totalComments === 1 ? 'comment' : 'comments'), h("div", { class: "view view--style-comments", style: {
263
+ borderTop: `1px solid ${Colors.Gray02}`,
264
+ paddingTop: '24px',
265
+ paddingBottom: '24px',
266
+ } }, this.lookbookComments.map((comment, idx) => {
267
+ const { user, title, description, createdDate } = comment;
268
+ return (h("div", { key: `style-info--comment-${idx}`, style: idx > 0 ? {
269
+ borderTop: `1px solid ${Colors.Gray02}`,
270
+ marginTop: '24px',
271
+ paddingTop: '24px',
272
+ } : {} }, h("div", { style: { overflow: 'hidden' } }, h("user-avatar", { size: 48, avatar: user.avatar, name: h("div", null, h("div", { style: { color: Colors.Gray04, lineHeight: '1', fontSize: '12px', fontWeight: '400' } }, dayjs_min(createdDate).fromNow()), h("div", { style: { fontSize: '18px', fontWeight: '600' } }, user.fullName)), shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, nameStyle: { fontWeight: 'bold' } })), h("div", { style: {
273
+ color: Colors.Black,
274
+ fontSize: '16px',
275
+ paddingTop: '16px',
276
+ } }, title), description && (h("div", { style: {
277
+ color: Colors.Gray05,
278
+ paddingTop: '8px',
279
+ } }, description))));
280
+ })))))), h("div", { class: "col-md-4", style: { marginBottom: '24px' } }, h("div", { class: "block block--similar-styles" }, this.similarStyles.length > 0 && (h("div", { class: "block--content" }, h("h3", { style: {
281
+ lineHeight: '1.2',
282
+ fontSize: '24px',
283
+ color: Colors.Secondary,
284
+ } }, "More like this"), h("div", { style: { marginTop: '16px' } }, h("div", { class: "similar-styles--grid", id: "similar-styles--grid" }, this.similarStyles.slice(0, 6).map(style => {
285
+ const { caption, imageThumbMedium, owner } = style;
286
+ return (h("div", { class: "similar-styles--grid-item", onClick: () => {
287
+ this.closeModal();
288
+ this.onClickLookbook(style);
289
+ } }, h("div", { class: "card", style: {
290
+ background: 'none',
291
+ border: 'none',
292
+ cursor: 'pointer',
293
+ } }, h("div", { class: "similar-styles--grid-item--image", style: {
294
+ borderRadius: '8px',
295
+ overflow: 'hidden',
296
+ minHeight: '80px',
297
+ background: Colors.Gray01,
298
+ } }, h("img", { src: imageThumbMedium, alt: caption, style: { maxWidth: '100%' } })), owner && (h("div", { class: "card-body", style: { paddingLeft: '0' } }, h("user-avatar", { name: owner.fullName, shortName: `${(owner.firstName || '').charAt(0)}${(owner.lastName || '').charAt(0)}`, avatar: owner.avatar }))))));
299
+ }))))))))))))))));
300
+ }
301
+ return null;
302
+ }
303
+ };
304
+ StyleDetail.style = indexCss;
305
+
306
+ export { StyleDetail as style_detail };
@@ -0,0 +1,37 @@
1
+ import { r as registerInstance, h } from './index-6af0a03d.js';
2
+ import { C as Colors } from './colors-ea36347a.js';
3
+
4
+ const indexCss = "";
5
+
6
+ let UserAvatar = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.size = 24;
10
+ }
11
+ render() {
12
+ return (h("div", { style: { display: "flex", alignItems: "center" } }, this.avatar && (h("div", { style: {
13
+ backgroundImage: `url("${this.avatar}")`,
14
+ backgroundColor: Colors.Gray01,
15
+ backgroundPosition: 'center center',
16
+ backgroundSize: 'cover',
17
+ borderRadius: '50%',
18
+ height: `${this.size}px`,
19
+ width: `${this.size}px`,
20
+ minWidth: `${this.size}px`,
21
+ } })), !this.avatar && (h("div", { style: {
22
+ backgroundColor: Colors.Gray01,
23
+ backgroundPosition: 'center center',
24
+ backgroundSize: 'cover',
25
+ borderRadius: '50%',
26
+ display: 'flex',
27
+ alignItems: 'center',
28
+ justifyContent: 'center',
29
+ height: `${this.size}px`,
30
+ width: `${this.size}px`,
31
+ minWidth: `${this.size}px`,
32
+ } }, this.shortName)), h("div", { style: Object.assign({ flexShrink: '1', flexGrow: '1', marginLeft: '12px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }, this.nameStyle) }, this.name)));
33
+ }
34
+ };
35
+ UserAvatar.style = indexCss;
36
+
37
+ export { UserAvatar as user_avatar };
File without changes