favesalon-embed 1.0.2 → 1.0.4

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 (167) hide show
  1. package/dist/{favesalon-embed/_commonjsHelpers-a4f66ccd.js → cjs/_commonjsHelpers-5cfcba41.js} +6 -14
  2. package/dist/cjs/chat-box_5.cjs.entry.js +17439 -0
  3. package/dist/cjs/chat-button.cjs.entry.js +55 -0
  4. package/dist/cjs/colors-38421769.js +69 -0
  5. package/dist/cjs/favesalon-embed.cjs.js +23 -0
  6. package/dist/cjs/google-map.cjs.entry.js +52 -0
  7. package/dist/cjs/index-7f190886.js +4396 -0
  8. package/dist/cjs/index-dd8176c4.js +1531 -0
  9. package/dist/cjs/index.cjs.js +2 -0
  10. package/dist/cjs/loader.cjs.js +22 -0
  11. package/dist/cjs/relativeTime-3721080d.js +9 -0
  12. package/dist/cjs/salon-booking-modal.cjs.entry.js +30 -0
  13. package/dist/cjs/salon-booking.cjs.entry.js +51 -0
  14. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +29 -0
  15. package/dist/cjs/salon-gift-card.cjs.entry.js +51 -0
  16. package/dist/cjs/salon-info.cjs.entry.js +33 -0
  17. package/dist/cjs/salon-latest-reviews.cjs.entry.js +97 -0
  18. package/dist/cjs/salon-latest-styles_3.cjs.entry.js +241 -0
  19. package/dist/cjs/salon-lookbook.cjs.entry.js +222 -0
  20. package/dist/cjs/salon-ranking.cjs.entry.js +60 -0
  21. package/dist/cjs/salon-reviews.cjs.entry.js +193 -0
  22. package/dist/cjs/salon-services.cjs.entry.js +81 -0
  23. package/dist/cjs/salon-stylists.cjs.entry.js +118 -0
  24. package/dist/cjs/services-d1bdf299.js +21494 -0
  25. package/dist/cjs/style-detail.cjs.entry.js +312 -0
  26. package/dist/cjs/utils-c5a33b3c.js +23 -0
  27. package/dist/collection/collection-manifest.json +33 -0
  28. package/dist/collection/components/chat-box/index.css +105 -0
  29. package/dist/collection/components/chat-box/index.js +138 -0
  30. package/dist/collection/components/chat-button/index.css +101 -0
  31. package/dist/collection/components/chat-button/index.js +155 -0
  32. package/dist/collection/components/chat-form/index.css +40 -0
  33. package/dist/collection/components/chat-form/index.js +79 -0
  34. package/dist/collection/components/chat-messages/index.css +48 -0
  35. package/dist/collection/components/chat-messages/index.js +142 -0
  36. package/dist/collection/components/chat-rooms/index.css +102 -0
  37. package/dist/collection/components/chat-rooms/index.js +157 -0
  38. package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
  39. package/dist/collection/components/google-map/index.css +5 -0
  40. package/dist/collection/components/google-map/index.js +90 -0
  41. package/dist/collection/components/salon-booking/index.css +30 -0
  42. package/dist/collection/components/salon-booking/index.js +126 -0
  43. package/dist/collection/components/salon-booking/salon-booking-modal.js +92 -0
  44. package/dist/collection/components/salon-gift-card/index.css +30 -0
  45. package/dist/collection/components/salon-gift-card/index.js +126 -0
  46. package/dist/collection/components/salon-gift-card/salon-gift-card-modal.js +73 -0
  47. package/dist/collection/components/salon-info/index.css +1 -0
  48. package/dist/collection/components/salon-info/index.js +77 -0
  49. package/dist/collection/components/salon-latest-reviews/index.css +11 -0
  50. package/dist/collection/components/salon-latest-reviews/index.js +163 -0
  51. package/dist/collection/components/salon-latest-styles/index.css +12 -0
  52. package/dist/{favesalon-embed/salon-latest-styles.entry.js → collection/components/salon-latest-styles/index.js} +99 -14
  53. package/dist/collection/components/salon-locations/index.css +24 -0
  54. package/dist/{favesalon-embed/salon-locations.entry.js → collection/components/salon-locations/index.js} +95 -15
  55. package/dist/collection/components/salon-lookbook/index.css +15 -0
  56. package/dist/collection/components/salon-lookbook/index.js +368 -0
  57. package/dist/collection/components/salon-ranking/index.css +3 -0
  58. package/dist/collection/components/salon-ranking/index.js +117 -0
  59. package/dist/collection/components/salon-reviews/index.css +18 -0
  60. package/dist/collection/components/salon-reviews/index.js +249 -0
  61. package/dist/collection/components/salon-schedules/index.css +18 -0
  62. package/dist/{favesalon-embed/salon-schedules.entry.js → collection/components/salon-schedules/index.js} +95 -14
  63. package/dist/collection/components/salon-services/index.css +1 -0
  64. package/dist/collection/components/salon-services/index.js +146 -0
  65. package/dist/collection/components/salon-stylists/index.css +43 -0
  66. package/dist/collection/components/salon-stylists/index.js +184 -0
  67. package/dist/collection/components/style-detail/index.css +76 -0
  68. package/dist/collection/components/style-detail/index.js +386 -0
  69. package/dist/collection/components/user-avatar/index.css +0 -0
  70. package/dist/collection/components/user-avatar/index.js +159 -0
  71. package/dist/collection/constants/colors.js +65 -0
  72. package/dist/collection/global/global.js +0 -0
  73. package/dist/collection/index.js +1 -0
  74. package/dist/collection/mocks/users.js +10 -0
  75. package/dist/collection/services/services.js +295 -0
  76. package/dist/collection/types/chat.js +23 -0
  77. package/dist/collection/types/common.js +11 -0
  78. package/dist/collection/types/review.js +39 -0
  79. package/dist/collection/types/salon.js +58 -0
  80. package/dist/collection/types/service.js +24 -0
  81. package/dist/collection/types/style.js +128 -0
  82. package/dist/collection/types/stylist.js +30 -0
  83. package/dist/collection/types/user.js +10 -0
  84. package/dist/collection/utils/utils.js +23 -0
  85. package/dist/custom-elements/index.d.ts +12 -0
  86. package/dist/custom-elements/index.js +44974 -0
  87. package/dist/esm/_commonjsHelpers-66ac50f5.js +32 -0
  88. package/dist/esm/chat-box_5.entry.js +17431 -0
  89. package/dist/{favesalon-embed → esm}/chat-button.entry.js +5 -10
  90. package/dist/esm/favesalon-embed.js +18 -0
  91. package/dist/{favesalon-embed → esm}/google-map.entry.js +1 -1
  92. package/dist/esm/index-0494771f.js +1504 -0
  93. package/dist/{favesalon-embed/index-00b83e1c.js → esm/index-a1c7583c.js} +15 -425
  94. package/dist/esm/index.js +1 -0
  95. package/dist/esm/loader.js +18 -0
  96. package/dist/esm/polyfills/core-js.js +11 -0
  97. package/dist/esm/polyfills/css-shim.js +1 -0
  98. package/dist/esm/polyfills/dom.js +79 -0
  99. package/dist/esm/polyfills/es5-html-element.js +1 -0
  100. package/dist/esm/polyfills/index.js +34 -0
  101. package/dist/esm/polyfills/system.js +6 -0
  102. package/dist/esm/relativeTime-baa50aa2.js +7 -0
  103. package/dist/{favesalon-embed → esm}/salon-booking-modal.entry.js +1 -1
  104. package/dist/{favesalon-embed → esm}/salon-booking.entry.js +3 -3
  105. package/dist/{favesalon-embed → esm}/salon-gift-card-modal.entry.js +1 -1
  106. package/dist/{favesalon-embed → esm}/salon-gift-card.entry.js +3 -3
  107. package/dist/{favesalon-embed → esm}/salon-info.entry.js +3 -3
  108. package/dist/{favesalon-embed → esm}/salon-latest-reviews.entry.js +4 -4
  109. package/dist/esm/salon-latest-styles_3.entry.js +235 -0
  110. package/dist/{favesalon-embed → esm}/salon-lookbook.entry.js +3 -3
  111. package/dist/{favesalon-embed → esm}/salon-ranking.entry.js +1 -1
  112. package/dist/{favesalon-embed → esm}/salon-reviews.entry.js +3 -3
  113. package/dist/{favesalon-embed → esm}/salon-services.entry.js +3 -3
  114. package/dist/{favesalon-embed → esm}/salon-stylists.entry.js +3 -3
  115. package/dist/{favesalon-embed/services-7cb8f2a6.js → esm/services-257442e2.js} +99 -2467
  116. package/dist/{favesalon-embed → esm}/style-detail.entry.js +4 -4
  117. package/dist/{favesalon-embed/utils-7de9628a.js → esm/utils-e97485e0.js} +0 -3
  118. package/dist/favesalon-embed/favesalon-embed.css +1 -2439
  119. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -148
  120. package/dist/favesalon-embed/index.esm.js +0 -1
  121. package/dist/favesalon-embed/p-05a1c88a.entry.js +1 -0
  122. package/dist/favesalon-embed/p-0acf0447.entry.js +1 -0
  123. package/dist/favesalon-embed/p-0bc4f624.js +1 -0
  124. package/dist/favesalon-embed/p-1af1515f.entry.js +1 -0
  125. package/dist/favesalon-embed/p-1cba5fc9.entry.js +1 -0
  126. package/dist/favesalon-embed/p-39a4ef15.entry.js +1 -0
  127. package/dist/favesalon-embed/p-3e2cb05b.entry.js +1 -0
  128. package/dist/favesalon-embed/p-47e646f8.js +1 -0
  129. package/dist/favesalon-embed/p-487b311f.entry.js +1 -0
  130. package/dist/favesalon-embed/p-55387c2f.entry.js +1 -0
  131. package/dist/favesalon-embed/p-566f05b4.entry.js +1 -0
  132. package/dist/favesalon-embed/p-862a0de0.entry.js +1 -0
  133. package/dist/favesalon-embed/p-9fe0cbeb.js +2 -0
  134. package/dist/favesalon-embed/p-a33331cc.js +1 -0
  135. package/dist/favesalon-embed/p-aeeb7b5f.entry.js +1 -0
  136. package/dist/favesalon-embed/p-b08e5b54.js +6 -0
  137. package/dist/favesalon-embed/p-b5cca5fc.entry.js +1 -0
  138. package/dist/favesalon-embed/p-c7fb7af5.js +1580 -0
  139. package/dist/favesalon-embed/p-ccab56d8.js +1 -0
  140. package/dist/favesalon-embed/p-d6e13053.entry.js +1 -0
  141. package/dist/favesalon-embed/p-dee42d34.entry.js +1 -0
  142. package/dist/favesalon-embed/p-e661ca1d.entry.js +1 -0
  143. package/dist/favesalon-embed/p-eeceab9c.entry.js +1 -0
  144. package/dist/index.cjs.js +1 -0
  145. package/dist/index.js +1 -0
  146. package/dist/types/components/chat-box/index.d.ts +12 -0
  147. package/dist/types/components/chat-rooms/index.d.ts +12 -0
  148. package/dist/types/components/user-avatar/index.d.ts +2 -1
  149. package/dist/types/components.d.ts +45 -2
  150. package/dist/types/utils/utils.d.ts +1 -0
  151. package/package.json +1 -1
  152. package/dist/favesalon-embed/app-globals-15861a7f.js +0 -712
  153. package/dist/favesalon-embed/app-globals-270fe240.js +0 -712
  154. package/dist/favesalon-embed/app-globals-437cc3f3.js +0 -712
  155. package/dist/favesalon-embed/app-globals-b8b0fc7a.js +0 -712
  156. package/dist/favesalon-embed/chat-form.entry.js +0 -39
  157. package/dist/favesalon-embed/chat-messages.entry.js +0 -51
  158. package/dist/favesalon-embed/css-shim-b7d3d95f.js +0 -4
  159. package/dist/favesalon-embed/dom-64053c71.js +0 -73
  160. package/dist/favesalon-embed/index-888e99e3.js +0 -3371
  161. package/dist/favesalon-embed/index-9ad82b12.js +0 -3371
  162. package/dist/favesalon-embed/index-aa906326.js +0 -3371
  163. package/dist/favesalon-embed/index-b97af793.js +0 -3371
  164. package/dist/favesalon-embed/relativeTime-268e64b0.js +0 -7
  165. package/dist/favesalon-embed/shadow-css-98135883.js +0 -387
  166. package/dist/favesalon-embed/user-avatar.entry.js +0 -42
  167. /package/dist/{favesalon-embed → esm}/colors-ea36347a.js +0 -0
@@ -0,0 +1 @@
1
+ import{c as r,a as n}from"./p-0bc4f624.js";var t=r((function(r){r.exports=function(r,n,t){r=r||{};var a=n.prototype,u={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 o(r,n,t,u){return a.fromToBase(r,n,t,u)}t.en.relativeTime=u,a.fromToBase=function(n,a,o,s,i){for(var d,e,h,f=o.$locale().relativeTime||u,c=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=c.length,y=0;y<m;y+=1){var l=c[y];l.d&&(d=s?t(n).diff(o,l.d,!0):o.diff(n,l.d,!0));var v=(r.rounding||Math.round)(Math.abs(d));if(h=d>0,v<=l.r||!l.r){v<=1&&y>0&&(l=c[y-1]);var M=f[l.l];i&&(v=i(""+v)),e="string"==typeof M?M.replace("%d",v):M(v,a,l.l,h);break}}if(a)return e;var p=h?f.future:f.past;return"function"==typeof p?p(e):p.replace("%s",e)},a.to=function(r,n){return o(r,n,this,!0)},a.from=function(r,n){return o(r,n,this)};var s=function(r){return r.$u?t.utc():t()};a.toNow=function(r){return this.to(s(this),r)},a.fromNow=function(r){return this.from(s(this),r)}}}));export{t as r}
@@ -0,0 +1 @@
1
+ import{r as s,h as i}from"./p-9fe0cbeb.js";import{C as t}from"./p-a33331cc.js";import{H as e,i as o,B as l}from"./p-c7fb7af5.js";import{f as a,a as n}from"./p-47e646f8.js";import"./p-0bc4f624.js";const d=class{constructor(i){s(this,i),this.salonId=void 0,this.isLoading=void 0,this.withBorder=void 0,this.isLoadingState=void 0,this.latestStyles=void 0}componentDidLoad(){this.fetchData()}async fetchData(){this.isLoadingState=!0;try{const s=[e().fetchSalonLatestStyles(this.salonId,{limit:6}).then((s=>this.latestStyles=s))];return Promise.all(s).then((()=>this.isLoadingState=!1)).catch((()=>this.isLoadingState=!1))}catch(s){}}onClickLookbook(s){const i=document.createElement("div");i.innerHTML=`\n <style-detail\n salon-id=${this.salonId}\n salon-lookbook='${JSON.stringify(s)}'\n ></style-detail>\n `,document.body.appendChild(i)}render(){return i("div",{class:"view view--salon-styles"},this.isLoading||this.isLoadingState?i("div",{class:"view-content",style:this.withBorder?{border:`1px solid ${t.Gray02}`,borderRadius:"4px"}:{padding:"0px"}},i("div",{style:{backgroundColor:t.Gray02,height:"20px",width:"120px"}}),i("div",{style:{marginTop:"24px"}},i("div",{style:{overflow:"hidden",marginLeft:"-16px",marginBottom:"-16px"}},[1,2,3,4,5,6,7,8,9,10].map(((s,e)=>i("div",{key:`style-listing--item-${s}-${e}`,style:{float:"left",paddingLeft:"16px",marginBottom:"16px"}},i("div",{style:{backgroundColor:t.Gray01,borderRadius:"8px",width:"120px",height:"120px",overflow:"hidden",position:"relative",cursor:"pointer"}}))))))):i("div",{class:"view-content",style:this.withBorder?{border:`1px solid ${t.Gray02}`,borderRadius:"4px"}:{padding:"0px"}},i("div",{style:{fontSize:"18px",fontWeight:"bold"}},"Photos"),i("div",{style:{overflow:"hidden",marginLeft:"-16px",marginBottom:"-16px",marginTop:"16px"}},(this.latestStyles||[]).map(((s,e)=>{const{imageThumb:l,albumMedias:a}=s,n=a.length>0?a[0]:null,d=!!n&&o(n);return i("div",{key:`style-listing--item-${s.id}-${e}`,style:{float:"left",paddingLeft:"16px",marginBottom:"16px"}},i("div",{class:"view--salon-styles--item",style:Object.assign({backgroundColor:t.Gray01,borderRadius:"8px",overflow:"hidden",position:"relative",cursor:"pointer"},!d&&n?{backgroundImage:`url("${n.imageThumb||n.imageThumbMedium}")`,backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"cover"}:{}),onClick:()=>this.onClickLookbook(s)},d&&n&&i("div",null,i("video",{muted:!0,width:"100%",height:"100%",poster:l},i("source",{src:n.mediaUrl,type:"video/mp4"})),i("i",{class:"ri-play-circle-fill",style:{fontSize:"48px",color:t.TextColor,position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}}))))})))))}};d.style="salon-latest-styles .view--salon-styles--item{width:120px;height:120px}@media (min-width: 1024px){salon-latest-styles .view--salon-styles--item{width:200px;height:200px}}";const c=class{constructor(i){s(this,i),this.salonId=void 0,this.salonInfo=void 0,this.isLoading=void 0,this.withBorder=void 0,this.salonInfoState=void 0}componentWillLoad(){this.salonInfo?this.salonInfoState=JSON.parse(this.salonInfo):this.fetchData()}fetchData(){try{e().fetchSalonInfo(this.salonId).then((s=>this.salonInfoState=s))}catch(s){}}render(){if(this.isLoading)return i("div",{class:"view view--salon-locations"},i("div",{class:"view-content",style:this.withBorder?{border:`1px solid ${t.Gray02}`,borderRadius:"4px"}:{padding:"0px"}},i("div",{style:{backgroundColor:t.Gray02,height:"20px",width:"120px"}}),i("div",{style:{marginTop:"24px"}},i("div",{style:{backgroundColor:t.Gray01,height:"16px",width:"50%"}}),i("div",{style:{backgroundColor:t.Gray01,height:"16px",width:"50%",marginTop:"8px"}}),i("div",{style:{backgroundColor:t.Gray01,height:"192px",width:"100%",marginTop:"24px"}}))));const{businessPhone:s,businessName:e,website:o,email:l}=this.salonInfoState||{},d=a(o),c=n(this.salonInfoState);return i("div",{class:"view view--salon-locations"},i("div",{class:"view-content",style:this.withBorder?{border:`1px solid ${t.Gray02}`,borderRadius:"4px"}:{padding:"0px"}},i("div",{style:{fontSize:"18px",fontWeight:"bold"}},"Contact"),i("div",{class:"salon-contact--links",style:{marginTop:"16px"}},s&&i("div",{class:"salon-contact--links-item"},i("i",{class:"ri-phone-line",style:{color:t.Gray04,fontSize:"18px",marginRight:"6px"}})," ",i("a",{href:`tel:${s}`,style:{color:t.TextColor,textDecoration:"none"}},s)),d&&i("div",{class:"salon-contact--links-item"},i("i",{class:"ri-links-line",style:{color:t.Gray04,fontSize:"18px",marginRight:"6px"}})," ",i("a",{target:d&&-1===d.indexOf(window.location.hostname)?"_blank":void 0,href:d,style:{color:t.TextColor,textDecoration:"none"}},d)),l&&i("div",{class:"salon-contact--links-item"},i("i",{class:"ri-mail-line",style:{color:t.Gray04,fontSize:"18px",marginRight:"6px"}})," ",i("a",{href:`mailto:${l}`,style:{color:t.TextColor,textDecoration:"none"}},l))),i("div",{class:"view--salon-info--map",style:{marginTop:"24px"}},i("google-map",{"location-name":e,"location-address":c}))))}};c.style="@media (min-width: 768px){salon-locations .salon-contact--links{overflow:hidden;margin-left:-32px}salon-locations .salon-contact--links-item{float:left;display:flex;flex-direction:row;align-items:center;font-size:16px;min-width:300px;padding-left:32px}salon-locations .salon-contact--links-item:nth-child(2n+1){clear:left}salon-locations .salon-contact--links-item+.salon-contact--links-item{margin-top:8px}}";const r=class{constructor(i){s(this,i),this.salonId=void 0,this.salonInfo=void 0,this.isLoading=void 0,this.withBorder=void 0,this.salonInfoState=void 0}componentWillLoad(){this.salonInfo?this.salonInfoState=JSON.parse(this.salonInfo):this.fetchData()}fetchData(){try{e().fetchSalonInfo(this.salonId).then((s=>this.salonInfoState=s))}catch(s){}}renderBusinessHour(s){return s.status===l.ByAppointment?"By Appointment":s.status===l.Close?"Close":`${s.openTime} - ${s.closeTime}`}render(){if(this.isLoading)return i("div",{class:"view view--salon-contact"},i("div",{class:"view-content",style:this.withBorder?{border:`1px solid ${t.Gray02}`,borderRadius:"4px"}:{padding:"0px"}},i("div",{style:{backgroundColor:t.Gray02,height:"20px",width:"120px"}}),i("div",{style:{marginTop:"24px"}},i("div",{style:{backgroundColor:t.Gray01,height:"16px",width:"30%"}}),i("div",{style:{backgroundColor:t.Gray01,height:"16px",width:"40%",marginTop:"8px"}}),i("div",{style:{backgroundColor:t.Gray01,height:"16px",width:"75%",marginTop:"12px"}}),i("div",{style:{backgroundColor:t.Gray01,height:"16px",width:"75%",marginTop:"8px"}})),i("div",{style:{marginTop:"24px"}},i("div",{style:{overflow:"hidden",marginLeft:"-16px",marginBottom:"-16px"}},[1,2,3,4,5,6,7].map(((s,e)=>i("div",{key:`style-listing--item-${s}-${e}`,style:{float:"left",paddingLeft:"16px",marginBottom:"16px"}},i("div",{style:{backgroundColor:t.Gray01,width:"120px",height:"20px"}}))))))));const{about:s,businessHours:e}=this.salonInfoState||{};return i("div",{class:"view view--salon-contact"},i("div",{class:"view-content",style:this.withBorder?{border:`1px solid ${t.Gray02}`,borderRadius:"4px"}:{padding:"0px"}},i("div",{style:{fontSize:"18px",fontWeight:"bold"}},"About"),s&&i("div",{class:"salon-contact--info--desc",style:{fontSize:"16px",marginTop:"16px"},innerHTML:s}),e&&e.length>0&&i("div",{class:"salon-schedules",style:{marginTop:"24px"}},i("div",{class:"salon-schedules--title",style:{fontSize:"16px",fontWeight:"bold"}},"Working hours"),i("div",{class:"salon-schedules--dates"},i("div",{class:"salon-schedules--day",style:{marginTop:"8px"}},i("div",{class:"salon-schedules--day-name",style:{fontWeight:"bold",minWidth:"40px"}},"Mon"),i("div",{class:"salon-schedules--day-time"},this.renderBusinessHour(e[0]))),i("div",{class:"salon-schedules--day",style:{marginTop:"8px"}},i("div",{class:"salon-schedules--day-name",style:{fontWeight:"bold",minWidth:"40px"}},"Tue"),i("div",{class:"salon-schedules--day-time"},this.renderBusinessHour(e[1]))),i("div",{class:"salon-schedules--day",style:{marginTop:"8px"}},i("div",{class:"salon-schedules--day-name",style:{fontWeight:"bold",minWidth:"40px"}},"Wed"),i("div",{class:"salon-schedules--day-time"},this.renderBusinessHour(e[2]))),i("div",{class:"salon-schedules--day",style:{marginTop:"8px"}},i("div",{class:"salon-schedules--day-name",style:{fontWeight:"bold",minWidth:"40px"}},"Thur"),i("div",{class:"salon-schedules--day-time"},this.renderBusinessHour(e[3]))),i("div",{class:"salon-schedules--day",style:{marginTop:"8px"}},i("div",{class:"salon-schedules--day-name",style:{fontWeight:"bold",minWidth:"40px"}},"Fri"),i("div",{class:"salon-schedules--day-time"},this.renderBusinessHour(e[4]))),i("div",{class:"salon-schedules--day",style:{marginTop:"8px"}},i("div",{class:"salon-schedules--day-name",style:{fontWeight:"bold",minWidth:"40px"}},"Sat"),i("div",{class:"salon-schedules--day-time"},this.renderBusinessHour(e[5]))),i("div",{class:"salon-schedules--day",style:{marginTop:"8px"}},i("div",{class:"salon-schedules--day-name",style:{fontWeight:"bold",minWidth:"40px"}},"Sun"),i("div",{class:"salon-schedules--day-time"},this.renderBusinessHour(e[6])))))))}};r.style="salon-schedules .salon-schedules--day{display:flex;flex-direction:row;min-width:240px}@media (min-width: 768px){salon-schedules .salon-schedules--dates{overflow:hidden;margin-left:-32px}salon-schedules .salon-schedules--day{float:left;padding-left:32px}}";export{d as salon_latest_styles,c as salon_locations,r as salon_schedules}
@@ -0,0 +1 @@
1
+ import{r as s,h as o}from"./p-9fe0cbeb.js";import{H as i}from"./p-c7fb7af5.js";import"./p-0bc4f624.js";import"./p-a33331cc.js";const t=class{constructor(o){s(this,o),this.salonId=void 0,this.salonInfo=void 0}componentWillLoad(){this.fetchData()}async fetchData(){try{this.salonInfo=await i().fetchSalonInfo(this.salonId)}catch(s){}}render(){return o("div",{class:"salon-info"},o("div",{class:"container"},o("div",{class:"salon-info--schedules",style:{marginBottom:"24px"}},o("salon-schedules",{"with-border":!0,"is-loading":!this.salonInfo,"salon-id":49989,"salon-info":JSON.stringify(this.salonInfo)})),o("div",{class:"row"},o("div",{class:"col-md-5",style:{marginBottom:"24px"}},o("salon-locations",{"with-border":!0,"is-loading":!this.salonInfo,"salon-id":49989,"salon-info":JSON.stringify(this.salonInfo)})),o("div",{class:"col-md-7",style:{marginBottom:"24px"}},o("salon-latest-styles",{"with-border":!0,"is-loading":!this.salonInfo,"salon-id":49989,"salon-info":JSON.stringify(this.salonInfo)})))))}};t.style="";export{t as salon_info}
@@ -0,0 +1 @@
1
+ import{r as e,g as t,h as o}from"./p-9fe0cbeb.js";import{C as r}from"./p-a33331cc.js";const s=class{constructor(t){e(this,t),this.locationName=void 0,this.locationAddress=void 0}render(){const e=t("./assets/map--placeholder.jpeg");return o("div",{style:{backgroundImage:`url("${e}")`,backgroundColor:r.Gray01,backgroundPosition:"center center",backgroundRepeat:"no-repeat",backgroundSize:"cover",borderRadius:"8px",position:"relative",height:"296px"}},o("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}},o("a",{target:"_blank",rel:"noopener noreferrer",href:`https://www.google.com/maps/search/?api=1&query=${this.locationAddress}`,style:{backgroundColor:r.Red01,border:`1px solid ${r.Red02}`,borderRadius:"4px",color:r.TextColor,padding:"12px",display:"flex",flexWrap:"wrap",height:"auto",width:"auto",whiteSpace:"normal",textAlign:"left",maxWidth:"320px",textDecoration:"none"}},this.locationName&&o("span",{style:{fontSize:"16px",marginBottom:"4px"}},this.locationName),this.locationAddress&&o("span",{style:{fontSize:"12px"}},this.locationAddress)),o("div",{style:{marginTop:"8px",textAlign:"center"}},o("i",{class:"ri-map-pin-fill",style:{fontSize:"24px"}}))))}static get assetsDirs(){return["assets"]}};s.style="google-map{display:block;width:100%;height:100%}";export{s as google_map}
@@ -0,0 +1 @@
1
+ import{r as e,h as i}from"./p-9fe0cbeb.js";import{H as t,d as s,s as o}from"./p-c7fb7af5.js";import{C as a}from"./p-a33331cc.js";import{g as r}from"./p-47e646f8.js";import"./p-0bc4f624.js";const l=class{constructor(i){e(this,i),this.salonId=void 0,this.primaryColor=a.Primary,this.salonReviews=[],this.isLoading=void 0}componentWillLoad(){this.fetchData()}async fetchData(){this.isLoading=!0;try{const{data:e}=await t().fetchSalonReviews(this.salonId,{limit:5});this.salonReviews=[...e]}catch(e){}this.isLoading=!1}render(){if(this.isLoading)return i("div",{class:"salon-latest-reviews",style:{overflow:"hidden"}},i("div",{style:{display:"flex",whiteSpace:"nowrap"}},[1,2,3,4,5].map(((e,t)=>i("div",{key:`salon-latest-review--${e}`,class:"salon-review",style:Object.assign({border:`1px solid ${a.Gray02}`,background:a.White,borderRadius:"8px",overflow:"hidden"},t>0?{marginLeft:"16px"}:{})},i("div",{class:"card",style:{border:"none"}},i("div",{class:"card-body"},i("div",{class:"salon-review--user",style:{marginBottom:"16px",overflow:"hidden"}},i("div",{style:{backgroundColor:a.Gray02,borderRadius:"50px",height:"48px",width:"48px",float:"left"}}),i("div",{style:{backgroundColor:a.Gray01,height:"16px",width:"120px",marginLeft:"16px",marginTop:"14px",float:"left"}})),i("div",{class:"salon-review--rating",style:{display:"flex",flexDirection:"row",marginBottom:"4px"}},[1,2,3,4,5].map((()=>i("div",{style:{backgroundColor:a.Gray01,height:"20px",width:"20px",marginRight:"8px",float:"left"}})))),i("div",{class:"salon-review--rating-text",style:{fontSize:"16px",fontWeight:"bold",marginTop:"16px"}},i("div",{style:{backgroundColor:a.Gray01,height:"16px",width:"132px"}})),i("div",{class:"salon-review--detail",style:{marginTop:"8px"}},i("div",{class:"salon-review--description",style:{fontSize:"16px",lineHeight:"26px",overflow:"hidden"}},i("div",{style:{backgroundColor:a.Gray01,height:"16px",width:"240px",float:"left"}}))))))))));const e=r();return i("div",{class:"salon-latest-reviews",style:{overflowX:"auto"}},i("div",{style:{display:"flex",whiteSpace:"nowrap"}},(this.salonReviews||[]).map(((t,r)=>{const{user:l}=t;return i("div",{class:"salon-review",style:Object.assign({border:`1px solid ${a.Gray02}`,background:a.White,borderRadius:"8px",overflow:"hidden"},r>0?{marginLeft:"16px"}:{})},i("div",{class:"card",style:{border:"none"}},i("div",{class:"card-body"},i("div",{class:"salon-review--user",style:{marginBottom:"16px"}},i("user-avatar",{size:48,name:i("div",{style:{fontSize:"18px",fontWeight:"600"}},l.fullName),shortName:`${(l.firstName||"").charAt(0)}${(l.lastName||"").charAt(0)}`,avatar:l.avatar,nameStyle:{fontWeight:"bold"}})),i("div",{class:"salon-review--rating",style:{display:"flex",flexDirection:"row",marginBottom:"4px"}},[1,2,3,4,5].map((e=>i("i",{class:e<=t.point?"ri-heart-fill":"ri-heart-line",style:Object.assign({fontSize:"16px",marginRight:"4px"},e<=t.point?{color:this.primaryColor}:{color:a.Gray04})}))),i("div",{class:"salon-review--rating--date",style:{fontSize:"14px",color:a.Gray04,marginLeft:"16px",position:"relative",top:"2px"}},s(t.createdDate).format(o))),i("div",{class:"salon-review--rating-text",style:{fontSize:"16px",fontWeight:"bold"}},e[t.point]),(t.title||t.description)&&i("div",{class:"salon-review--detail",style:{marginTop:"16px"}},i("div",{class:"salon-review--description",style:{fontSize:"16px",lineHeight:"26px",overflow:"hidden",maxHeight:t.photos.length>0?"52px":"104px"}},t.title||t.description)),t.photos.length>0&&i("div",{style:{display:"flex",flexDirection:"row",overflowX:"auto"}},t.photos.map((e=>i("div",{style:{border:"1px solid #d9d9d9",position:"relative",cursor:"pointer",borderRadius:"2px",height:"66px",marginTop:"12px",marginRight:"12px"}},i("img",{alt:"",src:e.imageUrlThumb,height:"64",style:{width:"auto"}}))))))))}))))}};l.style=".salon-latest-reviews .salon-review{min-width:280px}@media (min-width: 768px){.salon-latest-reviews .salon-review{min-width:300px}}";export{l as salon_latest_reviews}
@@ -0,0 +1 @@
1
+ module.exports = require('./cjs/index.cjs.js');
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './esm/index.js';
@@ -0,0 +1,12 @@
1
+ import { ChatRoom } from '../../types/chat';
2
+ export declare class ChatBox {
3
+ primaryColor: string;
4
+ accessToken: string;
5
+ senderId: string;
6
+ chatRooms: ChatRoom[];
7
+ activeRoom: ChatRoom;
8
+ componentWillLoad(): void;
9
+ fetchData(): Promise<void>;
10
+ private onClickRoom;
11
+ render(): any;
12
+ }
@@ -0,0 +1,12 @@
1
+ import { ChatRoom } from '../../types/chat';
2
+ export declare class ChatRooms {
3
+ senderId: number;
4
+ chatRooms: ChatRoom[];
5
+ activeRoom: ChatRoom;
6
+ onClickRoom: (chatRoom: ChatRoom) => void;
7
+ keyword: string;
8
+ private clickRoom;
9
+ private onSearchRooms;
10
+ private renderChatRoom;
11
+ render(): any;
12
+ }
@@ -1,6 +1,7 @@
1
1
  export declare class UserAvatar {
2
2
  size: number;
3
- name: string;
3
+ name?: string;
4
+ description?: string;
4
5
  nameStyle?: object;
5
6
  shortName: string;
6
7
  avatar: string;
@@ -6,8 +6,14 @@
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  import { User } from "./types/user";
9
- import { ChatMessage } from "./types/chat";
9
+ import { ChatMessage, ChatRoom } from "./types/chat";
10
10
  export namespace Components {
11
+ interface ChatBox {
12
+ "accessToken": string;
13
+ "fetchData": () => Promise<void>;
14
+ "primaryColor": string;
15
+ "senderId": string;
16
+ }
11
17
  interface ChatButton {
12
18
  "accessToken": string;
13
19
  "fetchData": () => Promise<void>;
@@ -25,6 +31,12 @@ export namespace Components {
25
31
  "receiver": User;
26
32
  "sender": User;
27
33
  }
34
+ interface ChatRooms {
35
+ "activeRoom": ChatRoom;
36
+ "chatRooms": ChatRoom[];
37
+ "onClickRoom": (chatRoom: ChatRoom) => void;
38
+ "senderId": number;
39
+ }
28
40
  interface GoogleMap {
29
41
  "locationAddress"?: string;
30
42
  "locationName"?: string;
@@ -112,13 +124,20 @@ export namespace Components {
112
124
  }
113
125
  interface UserAvatar {
114
126
  "avatar": string;
115
- "name": string;
127
+ "description"?: string;
128
+ "name"?: string;
116
129
  "nameStyle"?: object;
117
130
  "shortName": string;
118
131
  "size": number;
119
132
  }
120
133
  }
121
134
  declare global {
135
+ interface HTMLChatBoxElement extends Components.ChatBox, HTMLStencilElement {
136
+ }
137
+ var HTMLChatBoxElement: {
138
+ prototype: HTMLChatBoxElement;
139
+ new (): HTMLChatBoxElement;
140
+ };
122
141
  interface HTMLChatButtonElement extends Components.ChatButton, HTMLStencilElement {
123
142
  }
124
143
  var HTMLChatButtonElement: {
@@ -137,6 +156,12 @@ declare global {
137
156
  prototype: HTMLChatMessagesElement;
138
157
  new (): HTMLChatMessagesElement;
139
158
  };
159
+ interface HTMLChatRoomsElement extends Components.ChatRooms, HTMLStencilElement {
160
+ }
161
+ var HTMLChatRoomsElement: {
162
+ prototype: HTMLChatRoomsElement;
163
+ new (): HTMLChatRoomsElement;
164
+ };
140
165
  interface HTMLGoogleMapElement extends Components.GoogleMap, HTMLStencilElement {
141
166
  }
142
167
  var HTMLGoogleMapElement: {
@@ -240,9 +265,11 @@ declare global {
240
265
  new (): HTMLUserAvatarElement;
241
266
  };
242
267
  interface HTMLElementTagNameMap {
268
+ "chat-box": HTMLChatBoxElement;
243
269
  "chat-button": HTMLChatButtonElement;
244
270
  "chat-form": HTMLChatFormElement;
245
271
  "chat-messages": HTMLChatMessagesElement;
272
+ "chat-rooms": HTMLChatRoomsElement;
246
273
  "google-map": HTMLGoogleMapElement;
247
274
  "salon-booking": HTMLSalonBookingElement;
248
275
  "salon-booking-modal": HTMLSalonBookingModalElement;
@@ -263,6 +290,11 @@ declare global {
263
290
  }
264
291
  }
265
292
  declare namespace LocalJSX {
293
+ interface ChatBox {
294
+ "accessToken"?: string;
295
+ "primaryColor"?: string;
296
+ "senderId"?: string;
297
+ }
266
298
  interface ChatButton {
267
299
  "accessToken"?: string;
268
300
  "primaryColor"?: string;
@@ -279,6 +311,12 @@ declare namespace LocalJSX {
279
311
  "receiver"?: User;
280
312
  "sender"?: User;
281
313
  }
314
+ interface ChatRooms {
315
+ "activeRoom"?: ChatRoom;
316
+ "chatRooms"?: ChatRoom[];
317
+ "onClickRoom"?: (chatRoom: ChatRoom) => void;
318
+ "senderId"?: number;
319
+ }
282
320
  interface GoogleMap {
283
321
  "locationAddress"?: string;
284
322
  "locationName"?: string;
@@ -353,15 +391,18 @@ declare namespace LocalJSX {
353
391
  }
354
392
  interface UserAvatar {
355
393
  "avatar"?: string;
394
+ "description"?: string;
356
395
  "name"?: string;
357
396
  "nameStyle"?: object;
358
397
  "shortName"?: string;
359
398
  "size"?: number;
360
399
  }
361
400
  interface IntrinsicElements {
401
+ "chat-box": ChatBox;
362
402
  "chat-button": ChatButton;
363
403
  "chat-form": ChatForm;
364
404
  "chat-messages": ChatMessages;
405
+ "chat-rooms": ChatRooms;
365
406
  "google-map": GoogleMap;
366
407
  "salon-booking": SalonBooking;
367
408
  "salon-booking-modal": SalonBookingModal;
@@ -385,9 +426,11 @@ export { LocalJSX as JSX };
385
426
  declare module "@stencil/core" {
386
427
  export namespace JSX {
387
428
  interface IntrinsicElements {
429
+ "chat-box": LocalJSX.ChatBox & JSXBase.HTMLAttributes<HTMLChatBoxElement>;
388
430
  "chat-button": LocalJSX.ChatButton & JSXBase.HTMLAttributes<HTMLChatButtonElement>;
389
431
  "chat-form": LocalJSX.ChatForm & JSXBase.HTMLAttributes<HTMLChatFormElement>;
390
432
  "chat-messages": LocalJSX.ChatMessages & JSXBase.HTMLAttributes<HTMLChatMessagesElement>;
433
+ "chat-rooms": LocalJSX.ChatRooms & JSXBase.HTMLAttributes<HTMLChatRoomsElement>;
391
434
  "google-map": LocalJSX.GoogleMap & JSXBase.HTMLAttributes<HTMLGoogleMapElement>;
392
435
  "salon-booking": LocalJSX.SalonBooking & JSXBase.HTMLAttributes<HTMLSalonBookingElement>;
393
436
  "salon-booking-modal": LocalJSX.SalonBookingModal & JSXBase.HTMLAttributes<HTMLSalonBookingModalElement>;
@@ -1,4 +1,5 @@
1
1
  import { Salon } from "../types/salon";
2
+ export declare function wait(time?: number): Promise<unknown>;
2
3
  export declare function format(first: string, middle: string, last: string): string;
3
4
  export declare function formatWebsiteUrl(website: string): string;
4
5
  export declare function formatFullAddress(salon: Salon): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "favesalon-embed",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Favesalon Embed",
5
5
  "author": "Trung Luu <trung@favesalon.com> (https://favesalon.com)",
6
6
  "main": "dist/index.cjs.js",