favesalon-embed 1.0.4 → 1.0.6
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.
- package/dist/custom-elements/index.d.ts +42 -0
- package/dist/{cjs/_commonjsHelpers-5cfcba41.js → favesalon-embed/_commonjsHelpers-a4f66ccd.js} +14 -6
- package/dist/favesalon-embed/activate-form.entry.js +70 -0
- package/dist/favesalon-embed/app-globals-74127f4b.js +7 -0
- package/dist/favesalon-embed/app-globals-f954a22f.js +7 -0
- package/dist/favesalon-embed/change-password-form.entry.js +81 -0
- package/dist/favesalon-embed/chat-box.entry.js +55 -0
- package/dist/{esm → favesalon-embed}/chat-button.entry.js +36 -13
- package/dist/favesalon-embed/chat-form.entry.js +39 -0
- package/dist/favesalon-embed/chat-messages.entry.js +71 -0
- package/dist/favesalon-embed/chat-rooms.entry.js +111 -0
- package/dist/favesalon-embed/css-shim-b7d3d95f.js +4 -0
- package/dist/favesalon-embed/dom-64053c71.js +73 -0
- package/dist/favesalon-embed/favesalon-embed.css +114 -1
- package/dist/favesalon-embed/favesalon-embed.esm.js +148 -1
- package/dist/{esm → favesalon-embed}/google-map.entry.js +1 -1
- package/dist/{esm/index-a1c7583c.js → favesalon-embed/index-00b83e1c.js} +425 -15
- package/dist/favesalon-embed/index-888e99e3.js +3371 -0
- package/dist/favesalon-embed/index-a229b3b5.js +3371 -0
- package/dist/favesalon-embed/index.esm.js +1 -0
- package/dist/{esm/chat-box_5.entry.js → favesalon-embed/lodash-d5526b38.js} +27 -243
- package/dist/favesalon-embed/login-form.entry.js +67 -0
- package/dist/{cjs/chat-button.cjs.entry.js → favesalon-embed/notify-sounds.entry.js} +20 -44
- package/dist/favesalon-embed/register-form.entry.js +88 -0
- package/dist/favesalon-embed/relativeTime-268e64b0.js +7 -0
- package/dist/favesalon-embed/reset-password-form.entry.js +47 -0
- package/dist/{esm → favesalon-embed}/salon-booking-modal.entry.js +1 -1
- package/dist/{esm → favesalon-embed}/salon-booking.entry.js +4 -4
- package/dist/{esm → favesalon-embed}/salon-gift-card-modal.entry.js +1 -1
- package/dist/{esm → favesalon-embed}/salon-gift-card.entry.js +4 -4
- package/dist/{esm → favesalon-embed}/salon-info.entry.js +3 -3
- package/dist/{esm → favesalon-embed}/salon-latest-reviews.entry.js +22 -6
- package/dist/{collection/components/salon-latest-styles/index.js → favesalon-embed/salon-latest-styles.entry.js} +27 -105
- package/dist/{collection/components/salon-locations/index.js → favesalon-embed/salon-locations.entry.js} +15 -95
- package/dist/{esm → favesalon-embed}/salon-lookbook.entry.js +18 -6
- package/dist/{esm → favesalon-embed}/salon-ranking.entry.js +1 -1
- package/dist/{esm → favesalon-embed}/salon-reviews.entry.js +20 -6
- package/dist/{collection/components/salon-schedules/index.js → favesalon-embed/salon-schedules.entry.js} +14 -95
- package/dist/{esm → favesalon-embed}/salon-services.entry.js +25 -13
- package/dist/{esm → favesalon-embed}/salon-stylists.entry.js +3 -3
- package/dist/{esm/services-257442e2.js → favesalon-embed/services-5a4c43a6.js} +2608 -188
- package/dist/{cjs/services-d1bdf299.js → favesalon-embed/services-d71be591.js} +2616 -191
- package/dist/favesalon-embed/shadow-css-98135883.js +387 -0
- package/dist/{esm → favesalon-embed}/style-detail.entry.js +29 -11
- package/dist/favesalon-embed/user-avatar.entry.js +52 -0
- package/dist/favesalon-embed/user-form.entry.js +44 -0
- package/dist/{collection/utils/utils.js → favesalon-embed/utils-fd30fb29.js} +14 -5
- package/dist/types/components/activate-form/activate-form.d.ts +12 -0
- package/dist/types/components/activate-form/test/activate-form.spec.d.ts +1 -0
- package/dist/types/components/change-password-form/change-password-form.d.ts +12 -0
- package/dist/types/components/chat-box/index.d.ts +1 -0
- package/dist/types/components/chat-button/index.d.ts +6 -2
- package/dist/types/components/chat-button/notify-sounds.d.ts +5 -0
- package/dist/types/components/chat-rooms/index.d.ts +6 -0
- package/dist/types/components/login-form/login-form.d.ts +10 -0
- package/dist/types/components/register-form/register-form.d.ts +13 -0
- package/dist/types/components/reset-password-form/reset-password-form.d.ts +9 -0
- package/dist/types/components/user-form/user-form.d.ts +7 -0
- package/dist/types/components.d.ts +127 -2
- package/dist/types/services/services.d.ts +17 -0
- package/dist/types/types/chat.d.ts +1 -0
- package/dist/types/types/user.d.ts +16 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/types/utils/utils.spec.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/chat-box_5.cjs.entry.js +0 -17439
- package/dist/cjs/colors-38421769.js +0 -69
- package/dist/cjs/favesalon-embed.cjs.js +0 -23
- package/dist/cjs/google-map.cjs.entry.js +0 -52
- package/dist/cjs/index-7f190886.js +0 -4396
- package/dist/cjs/index-dd8176c4.js +0 -1531
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -22
- package/dist/cjs/relativeTime-3721080d.js +0 -9
- package/dist/cjs/salon-booking-modal.cjs.entry.js +0 -30
- package/dist/cjs/salon-booking.cjs.entry.js +0 -51
- package/dist/cjs/salon-gift-card-modal.cjs.entry.js +0 -29
- package/dist/cjs/salon-gift-card.cjs.entry.js +0 -51
- package/dist/cjs/salon-info.cjs.entry.js +0 -33
- package/dist/cjs/salon-latest-reviews.cjs.entry.js +0 -97
- package/dist/cjs/salon-latest-styles_3.cjs.entry.js +0 -241
- package/dist/cjs/salon-lookbook.cjs.entry.js +0 -222
- package/dist/cjs/salon-ranking.cjs.entry.js +0 -60
- package/dist/cjs/salon-reviews.cjs.entry.js +0 -193
- package/dist/cjs/salon-services.cjs.entry.js +0 -81
- package/dist/cjs/salon-stylists.cjs.entry.js +0 -118
- package/dist/cjs/style-detail.cjs.entry.js +0 -312
- package/dist/cjs/utils-c5a33b3c.js +0 -23
- package/dist/collection/collection-manifest.json +0 -33
- package/dist/collection/components/chat-box/index.css +0 -105
- package/dist/collection/components/chat-box/index.js +0 -138
- package/dist/collection/components/chat-button/index.css +0 -101
- package/dist/collection/components/chat-button/index.js +0 -155
- package/dist/collection/components/chat-form/index.css +0 -40
- package/dist/collection/components/chat-form/index.js +0 -79
- package/dist/collection/components/chat-messages/index.css +0 -48
- package/dist/collection/components/chat-messages/index.js +0 -142
- package/dist/collection/components/chat-rooms/index.css +0 -102
- package/dist/collection/components/chat-rooms/index.js +0 -157
- package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
- package/dist/collection/components/google-map/index.css +0 -5
- package/dist/collection/components/google-map/index.js +0 -90
- package/dist/collection/components/salon-booking/index.css +0 -30
- package/dist/collection/components/salon-booking/index.js +0 -126
- package/dist/collection/components/salon-booking/salon-booking-modal.js +0 -92
- package/dist/collection/components/salon-gift-card/index.css +0 -30
- package/dist/collection/components/salon-gift-card/index.js +0 -126
- package/dist/collection/components/salon-gift-card/salon-gift-card-modal.js +0 -73
- package/dist/collection/components/salon-info/index.css +0 -1
- package/dist/collection/components/salon-info/index.js +0 -77
- package/dist/collection/components/salon-latest-reviews/index.css +0 -11
- package/dist/collection/components/salon-latest-reviews/index.js +0 -163
- package/dist/collection/components/salon-latest-styles/index.css +0 -12
- package/dist/collection/components/salon-locations/index.css +0 -24
- package/dist/collection/components/salon-lookbook/index.css +0 -15
- package/dist/collection/components/salon-lookbook/index.js +0 -368
- package/dist/collection/components/salon-ranking/index.css +0 -3
- package/dist/collection/components/salon-ranking/index.js +0 -117
- package/dist/collection/components/salon-reviews/index.css +0 -18
- package/dist/collection/components/salon-reviews/index.js +0 -249
- package/dist/collection/components/salon-schedules/index.css +0 -18
- package/dist/collection/components/salon-services/index.css +0 -1
- package/dist/collection/components/salon-services/index.js +0 -146
- package/dist/collection/components/salon-stylists/index.css +0 -43
- package/dist/collection/components/salon-stylists/index.js +0 -184
- package/dist/collection/components/style-detail/index.css +0 -76
- package/dist/collection/components/style-detail/index.js +0 -386
- package/dist/collection/components/user-avatar/index.css +0 -0
- package/dist/collection/components/user-avatar/index.js +0 -159
- package/dist/collection/constants/colors.js +0 -65
- package/dist/collection/global/global.js +0 -0
- package/dist/collection/mocks/users.js +0 -10
- package/dist/collection/services/services.js +0 -295
- package/dist/collection/types/chat.js +0 -23
- package/dist/collection/types/common.js +0 -11
- package/dist/collection/types/review.js +0 -39
- package/dist/collection/types/salon.js +0 -58
- package/dist/collection/types/service.js +0 -24
- package/dist/collection/types/style.js +0 -128
- package/dist/collection/types/stylist.js +0 -30
- package/dist/collection/types/user.js +0 -10
- package/dist/custom-elements/index.js +0 -44974
- package/dist/esm/_commonjsHelpers-66ac50f5.js +0 -32
- package/dist/esm/favesalon-embed.js +0 -18
- package/dist/esm/index-0494771f.js +0 -1504
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -18
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/relativeTime-baa50aa2.js +0 -7
- package/dist/esm/salon-latest-styles_3.entry.js +0 -235
- package/dist/esm/utils-e97485e0.js +0 -19
- package/dist/favesalon-embed/p-05a1c88a.entry.js +0 -1
- package/dist/favesalon-embed/p-0acf0447.entry.js +0 -1
- package/dist/favesalon-embed/p-0bc4f624.js +0 -1
- package/dist/favesalon-embed/p-1af1515f.entry.js +0 -1
- package/dist/favesalon-embed/p-1cba5fc9.entry.js +0 -1
- package/dist/favesalon-embed/p-39a4ef15.entry.js +0 -1
- package/dist/favesalon-embed/p-3e2cb05b.entry.js +0 -1
- package/dist/favesalon-embed/p-47e646f8.js +0 -1
- package/dist/favesalon-embed/p-487b311f.entry.js +0 -1
- package/dist/favesalon-embed/p-55387c2f.entry.js +0 -1
- package/dist/favesalon-embed/p-566f05b4.entry.js +0 -1
- package/dist/favesalon-embed/p-862a0de0.entry.js +0 -1
- package/dist/favesalon-embed/p-9fe0cbeb.js +0 -2
- package/dist/favesalon-embed/p-a33331cc.js +0 -1
- package/dist/favesalon-embed/p-aeeb7b5f.entry.js +0 -1
- package/dist/favesalon-embed/p-b08e5b54.js +0 -6
- package/dist/favesalon-embed/p-b5cca5fc.entry.js +0 -1
- package/dist/favesalon-embed/p-c7fb7af5.js +0 -1580
- package/dist/favesalon-embed/p-ccab56d8.js +0 -1
- package/dist/favesalon-embed/p-d6e13053.entry.js +0 -1
- package/dist/favesalon-embed/p-dee42d34.entry.js +0 -1
- package/dist/favesalon-embed/p-e661ca1d.entry.js +0 -1
- package/dist/favesalon-embed/p-eeceab9c.entry.js +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- /package/dist/{esm → favesalon-embed}/colors-ea36347a.js +0 -0
- /package/dist/{collection/index.js → types/components/activate-form/test/activate-form.e2e.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,138 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as Colors } from './colors-ea36347a.js';
|
|
3
|
-
import { H as HttpService, d as dayjs_min, a as dateFormat } from './services-257442e2.js';
|
|
4
|
-
import { r as relativeTime } from './relativeTime-baa50aa2.js';
|
|
5
|
-
import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers-66ac50f5.js';
|
|
6
|
-
|
|
7
|
-
const indexCss$4 = ".chat-widget,.chat-widget--sidebar,.chat-widget--content{display:flex;height:100%;width:100%}.chat-widget{font-size:16px;position:relative;font-family:'Roboto', sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.chat-widget--sidebar,.chat-widget--content{background-color:#fff;border:1px solid #EFEFEF;position:absolute;inset:0;flex-direction:column}.chat-widget .chat-widget--sidebar{z-index:10}.chat-widget .chat-widget--content{z-index:5}.chat-widget.has-chat-room .chat-widget--content{z-index:10}.chat-widget--content-header{background-color:#001529;border-bottom:1px solid #EFEFEF;display:flex;align-items:center;justify-content:space-between;padding:16px}.chat-widget--content-title{font-size:20px;font-weight:600;line-height:1;margin:0}.chat-widget--content-close{border:1px solid #fff;cursor:pointer;display:block;position:absolute;z-index:1000;top:50%;right:0;width:30px;height:30px;transform:translate(0, -50%);-moz-border-radius:30px;-webkit-border-radius:30px;border-radius:30px;background-size:contain;background-repeat:no-repeat;background-position:center center;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAAA3hJREFUaAXlm8+K00Acx7MiCIJH/yw+gA9g25O49SL4AO3Bp1jw5NvktC+wF88qevK4BU97EmzxUBCEolK/n5gp3W6TTJPfpNPNF37MNsl85/vN/DaTmU6PknC4K+pniqeKJ3k8UnkvDxXJzzy+q/yaxxeVHxW/FNHjgRSeKt4rFoplzaAuHHDBGR2eS9G54reirsmienDCTRt7xwsp+KAoEmt9nLaGitZxrBbPFNaGfPloGw2t4JVamSt8xYW6Dg1oCYo3Yv+rCGViV160oMkcd8SYKnYV1Nb1aEOjCe6L5ZOiLfF120EjWhuBu3YIZt1NQmujnk5F4MgOpURzLfAwOBSTmzp3fpDxuI/pabxpqOoz2r2HLAb0GMbZKlNV5/Hg9XJypguryA7lPF5KMdTZQzHjqxNPhWhzIuAruOl1eNqKEx1tSh5rfbxdw7mOxCq4qS68ZTjKS1YVvilu559vWvFHhh4rZrdyZ69Vmpgdj8fJbDZLJpNJ0uv1cnr/gjrUhQMuI+ANjyuwftQ0bbL6Erp0mM/ny8Fg4M3LtdRxgMtKl3jwmIHVxYXChFy94/Rmpa/pTbNUhstKV+4Rr8lLQ9KlUvJKLyG8yvQ2s9SBy1Jb7jV5a0yapfF6apaZLjLLcWtd4sNrmJUMHyM+1xibTjH82Zh01TNlhsrOhdKTe00uAzZQmN6+KW+sDa/JD2PSVQ873m29yf+1Q9VDzfEYlHi1G5LKBBWZbtEsHbFwb1oYDwr1ZiF/2bnCSg1OBE/pfr9/bWx26UxJL3ONPISOLKUvQza0LZUxSKyjpdTGa/vDEr25rddbMM0Q3O6Lx3rqFvU+x6UrRKQY7tyrZecmD9FODy8uLizTmilwNj0kraNcAJhOp5aGVwsAGD5VmJBrWWbJSgWT9zrzWepQF47RaGSiKfeGx6Szi3gzmX/HHbihwBser4B9UJYpFBNX4R6vTn3VQnez0SymnrHQMsRYGTr1dSk34ljRqS/EMd2pLQ8YBp3a1PLfcqCpo8gtHkZFHKkTX6fs3MY0blKnth66rKCnU0VRGu37ONrQaA4eZDFtWAu2fXj9zjFkxTBOo8F7t926gTp/83Kyzzcy2kZD6xiqxTYnHLRFm3vHiRSwNSjkz3hoIzo8lCKWUlg/YtGs7tObunDAZfpDLbfEI15zsEIY3U/x/gHHc/G1zltnAgAAAABJRU5ErkJggg==')}@media (min-width: 992px){.chat-widget--sidebar,.chat-widget--content{position:static;width:auto;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}.chat-widget--sidebar{min-width:320px;max-width:320px;margin-right:24px}.chat-widget--content{flex-grow:1;flex-shrink:1}.chat-rooms--search,.chat-widget--content-header{-moz-border-radius:8px 8px 0 0;-webkit-border-radius:8px 8px 0 0;border-radius:8px 8px 0 0}}";
|
|
8
|
-
|
|
9
|
-
const ChatBox = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
registerInstance(this, hostRef);
|
|
12
|
-
this.onClickRoom = (chatRoom) => {
|
|
13
|
-
this.activeRoom = chatRoom;
|
|
14
|
-
};
|
|
15
|
-
this.primaryColor = undefined;
|
|
16
|
-
this.accessToken = undefined;
|
|
17
|
-
this.senderId = undefined;
|
|
18
|
-
this.chatRooms = undefined;
|
|
19
|
-
this.activeRoom = undefined;
|
|
20
|
-
}
|
|
21
|
-
componentWillLoad() {
|
|
22
|
-
this.fetchData();
|
|
23
|
-
}
|
|
24
|
-
async fetchData() {
|
|
25
|
-
try {
|
|
26
|
-
this.chatRooms = await HttpService().fetchChatRooms(this.accessToken);
|
|
27
|
-
(this.chatRooms || []).forEach((chatRoom) => {
|
|
28
|
-
HttpService().fetchChatMessages(chatRoom.uid, (messages) => {
|
|
29
|
-
this.chatRooms = [...(this.chatRooms || [])].map((room) => {
|
|
30
|
-
if (chatRoom.uid === room.uid) {
|
|
31
|
-
room.messages = messages;
|
|
32
|
-
}
|
|
33
|
-
return room;
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
catch (e) {
|
|
39
|
-
this.chatRooms = [];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
render() {
|
|
43
|
-
const senderInfo = this.activeRoom ? (this.activeRoom.members || []).find(user => user.id === Number(this.senderId)) : null;
|
|
44
|
-
const receiverInfo = this.activeRoom ? (this.activeRoom.members || []).find(user => user.id !== Number(this.senderId)) : null;
|
|
45
|
-
return (h("div", { class: `chat-widget ${this.activeRoom ? 'has-chat-room' : ''}` }, h("div", { class: "chat-widget--sidebar" }, h("chat-rooms", { "sender-id": Number(this.senderId), activeRoom: this.activeRoom, chatRooms: this.chatRooms, onClickRoom: this.onClickRoom })), h("div", { class: "chat-widget--content" }, receiverInfo && (h("div", { class: "chat-widget--content-header" }, h("user-avatar", { size: 40, avatar: receiverInfo.avatar, name: h("div", { class: "chat-room--user-name", style: { color: '#fff' } }, receiverInfo.fullName), shortName: String(receiverInfo.fullName || '').charAt(0) }), h("div", { style: { position: 'relative' } }, h("div", { class: "chat-widget--content-close", onClick: () => this.onClickRoom(null) })))), h("div", { style: {
|
|
46
|
-
flexShrink: '1',
|
|
47
|
-
flexGrow: '1',
|
|
48
|
-
overflowY: 'auto',
|
|
49
|
-
padding: '16px',
|
|
50
|
-
} }, this.activeRoom && (h("chat-messages", { sender: senderInfo, receiver: receiverInfo, messages: this.activeRoom.messages || [], "chat-room-id": this.activeRoom.uid })), !this.activeRoom && (h("div", { style: { paddingTop: '72px', textAlign: 'center' } }, h("div", { class: "chat-widget--content-title" }, "Welcome back!"), h("div", { style: { marginTop: "12px" } }, "Select any user in left hand side to get started.")))), this.activeRoom && (h("div", { style: { borderTop: `1px solid ${Colors.Gray02}` } }, h("chat-form", { "sender-id": Number(senderInfo.id), "chat-room-id": this.activeRoom.uid }))))));
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
ChatBox.style = indexCss$4;
|
|
54
|
-
|
|
55
|
-
const indexCss$3 = ".chat-form{display:flex;height:56px;width:100%}.chat-form #chat-form--input{border:none;outline:none;flex-shrink:1;flex-grow:1;height:100%;font-size:16px;padding-left:16px;padding-right:16px;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px}.chat-form>button{background-color:#001529;border:none;color:#fff;cursor:pointer;font-size:16px;min-width:80px;height:42px;margin:7px;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}.chat-form>button:hover,.chat-form>button:focus,.chat-form>button:active{background-color:#001529}";
|
|
56
|
-
|
|
57
|
-
const ChatForm = class {
|
|
58
|
-
constructor(hostRef) {
|
|
59
|
-
registerInstance(this, hostRef);
|
|
60
|
-
this.onSubmitMessage = async () => {
|
|
61
|
-
try {
|
|
62
|
-
const elNewMessage = document.getElementById('chat-form--input');
|
|
63
|
-
if (!!elNewMessage.value) {
|
|
64
|
-
await HttpService().sendChatMessage({
|
|
65
|
-
message: elNewMessage.value,
|
|
66
|
-
senderId: this.senderId,
|
|
67
|
-
chatRoomId: this.chatRoomId,
|
|
68
|
-
});
|
|
69
|
-
elNewMessage.value = '';
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
catch (error) { }
|
|
73
|
-
};
|
|
74
|
-
this.senderId = undefined;
|
|
75
|
-
this.chatRoomId = undefined;
|
|
76
|
-
}
|
|
77
|
-
render() {
|
|
78
|
-
return (h("div", { class: "chat-form" }, h("input", { id: "chat-form--input", type: "text", placeholder: "Enter a message...", onKeyPress: (evt) => {
|
|
79
|
-
if (evt.key === 'Enter') {
|
|
80
|
-
evt.preventDefault();
|
|
81
|
-
this.onSubmitMessage();
|
|
82
|
-
}
|
|
83
|
-
} }), h("button", { type: "button", onClick: () => this.onSubmitMessage() }, "Send")));
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
ChatForm.style = indexCss$3;
|
|
87
|
-
|
|
88
|
-
const indexCss$2 = ".chat-message{overflow:hidden;clear:both;min-width:240px}.chat-message+.chat-message{margin-top:6px}.chat-message--meta{display:flex}.chat-message--title{background-color:#F1F1F1;padding:8px 12px;position:relative;float:left;margin-top:6px;-moz-border-radius:0 10px 10px 10px;-webkit-border-radius:0 10px 10px 10px;border-radius:0 10px 10px 10px}.chat-message--time{clear:both;color:#999;font-size:75%;padding-top:2px}.chat-message.is-owner .chat-message--content{margin-left:12px}.chat-message.is-guest .chat-message--meta{flex-direction:row-reverse}.chat-message.is-guest .chat-message--title{background-color:#EFF7FF;float:right;margin-right:12px;text-align:right;-moz-border-radius:10px 0 10px 10px;-webkit-border-radius:10px 0 10px 10px;border-radius:10px 0 10px 10px}";
|
|
89
|
-
|
|
90
|
-
dayjs_min.extend(relativeTime);
|
|
91
|
-
const ChatMessages = class {
|
|
92
|
-
constructor(hostRef) {
|
|
93
|
-
registerInstance(this, hostRef);
|
|
94
|
-
this.markMessagesAsRead = async () => {
|
|
95
|
-
try {
|
|
96
|
-
const unreadMessages = (this.messages || []).filter(message => {
|
|
97
|
-
return Boolean(message.unRead) && message.senderId !== this.sender.id;
|
|
98
|
-
});
|
|
99
|
-
if (unreadMessages.length > 0) {
|
|
100
|
-
await HttpService().markMessagesAsRead(this.chatRoomId, unreadMessages);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
catch (e) { }
|
|
104
|
-
};
|
|
105
|
-
this.scrollToLastMessage = () => {
|
|
106
|
-
const targetElement = document.getElementById('chat--last-message');
|
|
107
|
-
targetElement && targetElement.scrollIntoView();
|
|
108
|
-
};
|
|
109
|
-
this.renderMessage = (chatMessage) => {
|
|
110
|
-
const { message, senderId, timestamp } = chatMessage;
|
|
111
|
-
const isOwner = this.sender.id === senderId;
|
|
112
|
-
const todayStr = dayjs_min().format(dateFormat);
|
|
113
|
-
const messageDayStr = dayjs_min(timestamp).format(dateFormat);
|
|
114
|
-
return (h("div", { class: `chat-message ${isOwner ? 'is-owner' : 'is-guest'}` }, h("div", { class: "chat-message--meta" }, h("user-avatar", { size: 40, shortName: String(((isOwner ? this.sender : this.receiver) || {}).fullName || '').charAt(0), avatar: ((isOwner ? this.sender : this.receiver) || {}).avatar }), h("div", { class: "chat-message--content" }, h("div", { class: "chat-message--title" }, message), timestamp && (h("div", { class: "chat-message--time" }, todayStr === messageDayStr ? dayjs_min(timestamp).format('HH:mm') : dayjs_min(timestamp).fromNow()))))));
|
|
115
|
-
};
|
|
116
|
-
this.sender = {};
|
|
117
|
-
this.receiver = {};
|
|
118
|
-
this.messages = [];
|
|
119
|
-
this.chatRoomId = undefined;
|
|
120
|
-
}
|
|
121
|
-
componentDidLoad() {
|
|
122
|
-
this.markMessagesAsRead();
|
|
123
|
-
}
|
|
124
|
-
componentDidUpdate() {
|
|
125
|
-
this.scrollToLastMessage();
|
|
126
|
-
}
|
|
127
|
-
render() {
|
|
128
|
-
const isEmpty = (this.messages || []).length === 0;
|
|
129
|
-
return (h("div", { class: "chat-messages" }, !isEmpty && this.messages.map(this.renderMessage), isEmpty && (h("div", { style: { padding: '48px', textAlign: 'center' } }, h("div", { style: { color: Colors.Green04 } }, "No messages yet"))), h("div", { id: "chat--last-message" })));
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
ChatMessages.style = indexCss$2;
|
|
1
|
+
import { a as createCommonjsModule, c as commonjsGlobal } from './_commonjsHelpers-a4f66ccd.js';
|
|
133
2
|
|
|
134
3
|
var lodash = createCommonjsModule(function (module, exports) {
|
|
135
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Lodash <https://lodash.com/>
|
|
7
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
8
|
+
* Released under MIT license <https://lodash.com/license>
|
|
9
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
10
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
11
|
+
*/
|
|
12
|
+
;(function() {
|
|
136
13
|
|
|
137
14
|
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
|
138
15
|
var undefined$1;
|
|
@@ -562,7 +439,7 @@ var lodash = createCommonjsModule(function (module, exports) {
|
|
|
562
439
|
var root = freeGlobal || freeSelf || Function('return this')();
|
|
563
440
|
|
|
564
441
|
/** Detect free variable `exports`. */
|
|
565
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
442
|
+
var freeExports = 'object' == 'object' && exports && !exports.nodeType && exports;
|
|
566
443
|
|
|
567
444
|
/** Detect free variable `module`. */
|
|
568
445
|
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
@@ -17308,7 +17185,21 @@ var lodash = createCommonjsModule(function (module, exports) {
|
|
|
17308
17185
|
var _ = runInContext();
|
|
17309
17186
|
|
|
17310
17187
|
// Some AMD build optimizers, like r.js, check for condition patterns like:
|
|
17311
|
-
if (
|
|
17188
|
+
if (typeof undefined$1 == 'function' && typeof undefined$1.amd == 'object' && undefined$1.amd) {
|
|
17189
|
+
// Expose Lodash on the global object to prevent errors when Lodash is
|
|
17190
|
+
// loaded by a script tag in the presence of an AMD loader.
|
|
17191
|
+
// See http://requirejs.org/docs/errors.html#mismatch for more details.
|
|
17192
|
+
// Use `_.noConflict` to remove Lodash from the global object.
|
|
17193
|
+
root._ = _;
|
|
17194
|
+
|
|
17195
|
+
// Define as an anonymous module so, through path mapping, it can be
|
|
17196
|
+
// referenced as the "underscore" module.
|
|
17197
|
+
undefined$1(function() {
|
|
17198
|
+
return _;
|
|
17199
|
+
});
|
|
17200
|
+
}
|
|
17201
|
+
// Check for `exports` after `define` in case a build optimizer adds it.
|
|
17202
|
+
else if (freeModule) {
|
|
17312
17203
|
// Export for Node.js.
|
|
17313
17204
|
(freeModule.exports = _)._ = _;
|
|
17314
17205
|
// Export for CommonJS support.
|
|
@@ -17321,111 +17212,4 @@ var lodash = createCommonjsModule(function (module, exports) {
|
|
|
17321
17212
|
}.call(commonjsGlobal));
|
|
17322
17213
|
});
|
|
17323
17214
|
|
|
17324
|
-
|
|
17325
|
-
|
|
17326
|
-
const ChatRooms = class {
|
|
17327
|
-
constructor(hostRef) {
|
|
17328
|
-
registerInstance(this, hostRef);
|
|
17329
|
-
this.clickRoom = (chatRoom) => {
|
|
17330
|
-
this.onClickRoom(chatRoom);
|
|
17331
|
-
};
|
|
17332
|
-
this.onSearchRooms = lodash.debounce((keyword) => {
|
|
17333
|
-
this.keyword = keyword;
|
|
17334
|
-
}, 500);
|
|
17335
|
-
this.renderChatRoom = (chatRoom, index) => {
|
|
17336
|
-
const { uid, members, messages } = chatRoom;
|
|
17337
|
-
const receiverUser = members.find(user => user.id !== this.senderId);
|
|
17338
|
-
const isActiveRoom = (this.activeRoom || {}).uid === uid;
|
|
17339
|
-
let unreadMessages = 0;
|
|
17340
|
-
const lastMessage = lodash.last(messages || []);
|
|
17341
|
-
(messages || []).forEach(message => {
|
|
17342
|
-
if (Boolean(message.unRead) && message.senderId !== this.senderId) {
|
|
17343
|
-
unreadMessages += 1;
|
|
17344
|
-
}
|
|
17345
|
-
});
|
|
17346
|
-
return (h("div", { key: `chat-room--${uid}-${index}`, class: `chat-room ${isActiveRoom ? 'is-active' : ''}`, onClick: () => !isActiveRoom && this.clickRoom(chatRoom) }, h("div", { class: "chat-room--user" }, h("user-avatar", { size: 48, avatar: receiverUser.avatar, name: h("div", { class: "chat-room--user-name" }, receiverUser.fullName), description: lastMessage && (h("div", { class: "chat-room--latest-message" }, lastMessage.senderId === this.senderId ? 'You: ' : '', lastMessage.message)), shortName: String(receiverUser.fullName || '').charAt(0) })), unreadMessages > 0 && (h("div", { class: "chat-room--user-indicator" }))));
|
|
17347
|
-
};
|
|
17348
|
-
this.senderId = undefined;
|
|
17349
|
-
this.chatRooms = undefined;
|
|
17350
|
-
this.activeRoom = undefined;
|
|
17351
|
-
this.onClickRoom = undefined;
|
|
17352
|
-
this.keyword = undefined;
|
|
17353
|
-
}
|
|
17354
|
-
render() {
|
|
17355
|
-
const visibleRooms = (this.chatRooms || []).filter(chatRoom => {
|
|
17356
|
-
if (this.keyword) {
|
|
17357
|
-
const receiverUser = chatRoom.members.find(user => user.id !== this.senderId);
|
|
17358
|
-
return String(receiverUser.fullName).toLowerCase().indexOf(String(this.keyword).toLowerCase()) > -1;
|
|
17359
|
-
}
|
|
17360
|
-
return true;
|
|
17361
|
-
});
|
|
17362
|
-
return (h("div", { class: "chat-rooms" }, h("div", { class: "chat-rooms--search" }, h("input", { autoComplete: "off", placeholder: "Enter a name...", onInput: evt => this.onSearchRooms(evt.target.value) })), h("div", { class: "chat-rooms--list" }, !this.chatRooms && [1, 2, 3, 4].map(fakeId => (h("div", { key: `chat-room--${fakeId}`, class: "chat-room" }, h("div", { class: "chat-room--user" }, h("div", { style: { display: "flex", alignItems: "center" } }, h("div", { style: {
|
|
17363
|
-
backgroundColor: Colors.Gray02,
|
|
17364
|
-
borderRadius: '50%',
|
|
17365
|
-
height: `48px`,
|
|
17366
|
-
width: `48px`,
|
|
17367
|
-
minWidth: `48px`,
|
|
17368
|
-
} }), h("div", { style: {
|
|
17369
|
-
flexShrink: '1',
|
|
17370
|
-
flexGrow: '1',
|
|
17371
|
-
marginLeft: '12px',
|
|
17372
|
-
} }, h("div", { style: {
|
|
17373
|
-
backgroundColor: Colors.Gray02,
|
|
17374
|
-
height: '16px',
|
|
17375
|
-
width: '30%',
|
|
17376
|
-
} }), h("div", { style: {
|
|
17377
|
-
backgroundColor: Colors.Gray01,
|
|
17378
|
-
marginTop: '12px',
|
|
17379
|
-
height: '16px',
|
|
17380
|
-
width: '60%',
|
|
17381
|
-
} }))))))), this.chatRooms && visibleRooms.length > 0 && visibleRooms.map(this.renderChatRoom), this.chatRooms && visibleRooms.length === 0 && (h("div", { style: { color: Colors.Gray04, padding: '64px 24px', textAlign: 'center' } }, "No available users")))));
|
|
17382
|
-
}
|
|
17383
|
-
};
|
|
17384
|
-
ChatRooms.style = indexCss$1;
|
|
17385
|
-
|
|
17386
|
-
const indexCss = "";
|
|
17387
|
-
|
|
17388
|
-
const UserAvatar = class {
|
|
17389
|
-
constructor(hostRef) {
|
|
17390
|
-
registerInstance(this, hostRef);
|
|
17391
|
-
this.size = 24;
|
|
17392
|
-
this.name = undefined;
|
|
17393
|
-
this.description = undefined;
|
|
17394
|
-
this.nameStyle = undefined;
|
|
17395
|
-
this.shortName = undefined;
|
|
17396
|
-
this.avatar = undefined;
|
|
17397
|
-
}
|
|
17398
|
-
render() {
|
|
17399
|
-
return (h("div", { style: { display: "flex", alignItems: "center" } }, this.avatar && (h("div", { style: {
|
|
17400
|
-
border: `1px solid ${Colors.White}`,
|
|
17401
|
-
backgroundImage: `url("${this.avatar}")`,
|
|
17402
|
-
backgroundColor: Colors.Gray01,
|
|
17403
|
-
backgroundPosition: 'center center',
|
|
17404
|
-
backgroundSize: 'cover',
|
|
17405
|
-
borderRadius: '50%',
|
|
17406
|
-
height: `${this.size}px`,
|
|
17407
|
-
width: `${this.size}px`,
|
|
17408
|
-
minWidth: `${this.size}px`,
|
|
17409
|
-
} })), !this.avatar && (h("div", { style: {
|
|
17410
|
-
border: `1px solid ${Colors.White}`,
|
|
17411
|
-
backgroundColor: Colors.Gray01,
|
|
17412
|
-
borderRadius: '50%',
|
|
17413
|
-
display: 'flex',
|
|
17414
|
-
alignItems: 'center',
|
|
17415
|
-
justifyContent: 'center',
|
|
17416
|
-
height: `${this.size}px`,
|
|
17417
|
-
width: `${this.size}px`,
|
|
17418
|
-
minWidth: `${this.size}px`,
|
|
17419
|
-
} }, this.shortName)), this.name && (h("div", { style: {
|
|
17420
|
-
flexShrink: '1',
|
|
17421
|
-
flexGrow: '1',
|
|
17422
|
-
marginLeft: '12px',
|
|
17423
|
-
overflow: 'hidden',
|
|
17424
|
-
whiteSpace: 'nowrap',
|
|
17425
|
-
textOverflow: 'ellipsis',
|
|
17426
|
-
} }, h("div", { style: Object.assign({}, this.nameStyle) }, this.name), this.description && h("div", { style: { color: '#999999' } }, this.description)))));
|
|
17427
|
-
}
|
|
17428
|
-
};
|
|
17429
|
-
UserAvatar.style = indexCss;
|
|
17430
|
-
|
|
17431
|
-
export { ChatBox as chat_box, ChatForm as chat_form, ChatMessages as chat_messages, ChatRooms as chat_rooms, UserAvatar as user_avatar };
|
|
17215
|
+
export { lodash as l };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
|
+
import { C as Colors } from './colors-ea36347a.js';
|
|
3
|
+
import { H as HttpService } from './services-d71be591.js';
|
|
4
|
+
import './_commonjsHelpers-a4f66ccd.js';
|
|
5
|
+
|
|
6
|
+
const loginFormCss = ".form--user-login .form--login-label{cursor:pointer;display:block;margin-bottom:6px}.form--user-login input,.form--user-login button{border:1px solid #cecece;box-sizing:border-box;display:inline-block;width:100%;padding:4px 11px;min-height:40px;-moz-transition:all 0.3s;-webkit-transition:all 0.3s;transition:all 0.3s;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px}.form--user-login button{background-color:#001529;border:1px solid #001529;color:#fff;cursor:pointer}.form--user-login button:disabled{background-color:#cecece;border:1px solid #cecece;color:#212121}";
|
|
7
|
+
|
|
8
|
+
const LoginForm = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.onSuccess = undefined;
|
|
12
|
+
this.isSubmitting = undefined;
|
|
13
|
+
this.error = undefined;
|
|
14
|
+
this.username = undefined;
|
|
15
|
+
this.password = undefined;
|
|
16
|
+
}
|
|
17
|
+
async onSubmit(evt) {
|
|
18
|
+
evt.preventDefault();
|
|
19
|
+
this.error = null;
|
|
20
|
+
this.isSubmitting = true;
|
|
21
|
+
if (this.username && this.password) {
|
|
22
|
+
try {
|
|
23
|
+
const apiUrl = window.location.origin.indexOf('localhost') > -1 || window.location.origin.indexOf('favesalon.com')
|
|
24
|
+
? 'https://favesalon.com'
|
|
25
|
+
: window.location.origin;
|
|
26
|
+
const userInfo = await HttpService().login(apiUrl, {
|
|
27
|
+
email: this.username,
|
|
28
|
+
password: this.password,
|
|
29
|
+
});
|
|
30
|
+
this.onSuccess(userInfo);
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
let errorMessage = e.message || `Something went wrong when logging your account`;
|
|
34
|
+
if (errorMessage.indexOf('404') > -1) {
|
|
35
|
+
errorMessage = 'You have entered an invalid username or password';
|
|
36
|
+
}
|
|
37
|
+
this.error = errorMessage;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.error = 'Please enter your username and password';
|
|
42
|
+
}
|
|
43
|
+
this.isSubmitting = false;
|
|
44
|
+
}
|
|
45
|
+
render() {
|
|
46
|
+
return (h("form", { class: "form--user-login", onSubmit: (evt) => this.onSubmit(evt) }, this.error && (h("div", { style: {
|
|
47
|
+
backgroundColor: Colors.Red01,
|
|
48
|
+
border: `1px solid ${Colors.Red02}`,
|
|
49
|
+
marginBottom: '24px',
|
|
50
|
+
padding: '12px',
|
|
51
|
+
} }, this.error)), h("div", { style: { marginBottom: '24px' } }, h("label", { ...{ for: "form--login-username" }, class: "form--login-label" }, "Phone or Email"), h("input", { id: "form--login-username", type: "text", onInput: (evt) => {
|
|
52
|
+
this.username = evt.target.value;
|
|
53
|
+
} })), h("div", { style: {
|
|
54
|
+
display: 'flex',
|
|
55
|
+
marginBottom: '24px',
|
|
56
|
+
width: '100%',
|
|
57
|
+
} }, h("div", { style: {
|
|
58
|
+
flexShrink: '1',
|
|
59
|
+
flexGrow: '1',
|
|
60
|
+
} }, h("label", { ...{ for: "form--login-password" }, class: "form--login-label" }, "Password"), h("input", { id: "form--login-password", type: "password", onInput: (evt) => {
|
|
61
|
+
this.password = evt.target.value;
|
|
62
|
+
} })), h("div", { style: { width: '100px', marginLeft: '12px' } }, h("label", { style: { display: 'inline-block', marginBottom: '6px' } }, "\u00A0"), h("button", { type: "submit", disabled: this.isSubmitting }, "SIGN IN")))));
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
LoginForm.style = loginFormCss;
|
|
66
|
+
|
|
67
|
+
export { LoginForm as login_form };
|
|
@@ -1,55 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-dd8176c4.js');
|
|
6
|
-
const colors = require('./colors-38421769.js');
|
|
7
|
-
const services = require('./services-d1bdf299.js');
|
|
8
|
-
require('./_commonjsHelpers-5cfcba41.js');
|
|
1
|
+
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
9
2
|
|
|
10
3
|
const indexCss = "@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap'); chat-button{position:relative}.chat-button--indicator{cursor:pointer;position:absolute;inset:0}.chat-button--counter{background-color:rgb(240, 90, 97);border:1px solid rgb(255, 255, 255);position:absolute;right:6px;top:0px;height:8px;width:8px;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}.chat-box{font-family:'Roboto', sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-color:#fff;display:flex;flex-direction:column;position:fixed;inset:0px;z-index:20000;font-size:16px;text-align:left;color:#141414}.chat-box--header{display:flex;justify-content:space-between;padding:16px;position:relative}.chat-box--title{color:#fff;font-size:20px;font-weight:600;line-height:1;display:flex;align-items:center;justify-content:space-between;margin:0}.chat-box--close{cursor:pointer;display:block;position:absolute;z-index:1000;top:50%;right:0;width:30px;height:30px;transform:translate(0, -50%);background-size:contain;background-repeat:no-repeat;background-position:center center;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAAA3hJREFUaAXlm8+K00Acx7MiCIJH/yw+gA9g25O49SL4AO3Bp1jw5NvktC+wF88qevK4BU97EmzxUBCEolK/n5gp3W6TTJPfpNPNF37MNsl85/vN/DaTmU6PknC4K+pniqeKJ3k8UnkvDxXJzzy+q/yaxxeVHxW/FNHjgRSeKt4rFoplzaAuHHDBGR2eS9G54reirsmienDCTRt7xwsp+KAoEmt9nLaGitZxrBbPFNaGfPloGw2t4JVamSt8xYW6Dg1oCYo3Yv+rCGViV160oMkcd8SYKnYV1Nb1aEOjCe6L5ZOiLfF120EjWhuBu3YIZt1NQmujnk5F4MgOpURzLfAwOBSTmzp3fpDxuI/pabxpqOoz2r2HLAb0GMbZKlNV5/Hg9XJypguryA7lPF5KMdTZQzHjqxNPhWhzIuAruOl1eNqKEx1tSh5rfbxdw7mOxCq4qS68ZTjKS1YVvilu559vWvFHhh4rZrdyZ69Vmpgdj8fJbDZLJpNJ0uv1cnr/gjrUhQMuI+ANjyuwftQ0bbL6Erp0mM/ny8Fg4M3LtdRxgMtKl3jwmIHVxYXChFy94/Rmpa/pTbNUhstKV+4Rr8lLQ9KlUvJKLyG8yvQ2s9SBy1Jb7jV5a0yapfF6apaZLjLLcWtd4sNrmJUMHyM+1xibTjH82Zh01TNlhsrOhdKTe00uAzZQmN6+KW+sDa/JD2PSVQ873m29yf+1Q9VDzfEYlHi1G5LKBBWZbtEsHbFwb1oYDwr1ZiF/2bnCSg1OBE/pfr9/bWx26UxJL3ONPISOLKUvQza0LZUxSKyjpdTGa/vDEr25rddbMM0Q3O6Lx3rqFvU+x6UrRKQY7tyrZecmD9FODy8uLizTmilwNj0kraNcAJhOp5aGVwsAGD5VmJBrWWbJSgWT9zrzWepQF47RaGSiKfeGx6Szi3gzmX/HHbihwBser4B9UJYpFBNX4R6vTn3VQnez0SymnrHQMsRYGTr1dSk34ljRqS/EMd2pLQ8YBp3a1PLfcqCpo8gtHkZFHKkTX6fs3MY0blKnth66rKCnU0VRGu37ONrQaA4eZDFtWAu2fXj9zjFkxTBOo8F7t926gTp/83Kyzzcy2kZD6xiqxTYnHLRFm3vHiRSwNSjkz3hoIzo8lCKWUlg/YtGs7tObunDAZfpDLbfEI15zsEIY3U/x/gHHc/G1zltnAgAAAABJRU5ErkJggg==')}@media (min-width: 768px){.chat-box{border:1px solid #fff;left:unset;top:unset;right:1px;bottom:0px;height:420px;max-height:90vh;width:600px;-moz-border-radius:8px 8px 0px 0px;-webkit-border-radius:8px 8px 0px 0px;border-radius:8px 8px 0px 0px;-moz-box-shadow:rgba(0, 0, 0, 0.1) 0px 0px 24px;-webkit-box-shadow:rgba(0, 0, 0, 0.1) 0px 0px 24px;box-shadow:rgba(0, 0, 0, 0.1) 0px 0px 24px}.chat-box--header{-moz-border-radius:8px 8px 0px 0px;-webkit-border-radius:8px 8px 0px 0px;border-radius:8px 8px 0px 0px}}";
|
|
11
4
|
|
|
12
|
-
const
|
|
5
|
+
const NotifySounds = class {
|
|
13
6
|
constructor(hostRef) {
|
|
14
|
-
|
|
15
|
-
this.primaryColor = undefined;
|
|
16
|
-
this.accessToken = undefined;
|
|
17
|
-
this.senderId = undefined;
|
|
18
|
-
this.receiverId = undefined;
|
|
19
|
-
this.senderInfo = {};
|
|
20
|
-
this.receiverInfo = {};
|
|
21
|
-
this.chatRoom = {};
|
|
22
|
-
this.chatMessages = undefined;
|
|
23
|
-
this.isChatExpanded = undefined;
|
|
7
|
+
registerInstance(this, hostRef);
|
|
24
8
|
}
|
|
25
|
-
|
|
26
|
-
|
|
9
|
+
componentDidLoad() {
|
|
10
|
+
const btnPlaySound = document.getElementById('chat--play-sound');
|
|
11
|
+
btnPlaySound.click();
|
|
27
12
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (this.chatRoom) {
|
|
32
|
-
services.HttpService().fetchChatMessages(this.chatRoom.uid, (messages) => this.chatMessages = messages);
|
|
33
|
-
this.senderInfo = this.chatRoom.members.find(user => user.id === Number(this.senderId));
|
|
34
|
-
this.receiverInfo = this.chatRoom.members.find(user => user.id === Number(this.receiverId));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
catch (e) { }
|
|
13
|
+
playSound() {
|
|
14
|
+
const audioPlayer = new Audio('https://res.cloudinary.com/reckon-mini-sites/video/upload/v1696198815/favesalon/notification--message_i9wsj8.mp3');
|
|
15
|
+
audioPlayer.play();
|
|
38
16
|
}
|
|
17
|
+
;
|
|
39
18
|
render() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
overflowY: 'auto',
|
|
49
|
-
padding: '16px',
|
|
50
|
-
} }, index.h("chat-messages", { sender: this.senderInfo, receiver: this.receiverInfo, messages: this.chatMessages || [], "chat-room-id": this.chatRoom.uid })), index.h("div", { style: { borderTop: `1px solid ${colors.Colors.Gray02}` } }, index.h("chat-form", { "sender-id": this.senderInfo.id ? Number(this.senderInfo.id) : null, "chat-room-id": this.chatRoom.uid })))));
|
|
19
|
+
return (h("button", { id: "chat--play-sound", onClick: () => this.playSound(), style: {
|
|
20
|
+
border: 'none',
|
|
21
|
+
display: 'block',
|
|
22
|
+
overflow: 'hidden',
|
|
23
|
+
height: '1px',
|
|
24
|
+
width: '1px',
|
|
25
|
+
padding: '0',
|
|
26
|
+
} }, "Play"));
|
|
51
27
|
}
|
|
52
28
|
};
|
|
53
|
-
|
|
29
|
+
NotifySounds.style = indexCss;
|
|
54
30
|
|
|
55
|
-
|
|
31
|
+
export { NotifySounds as notify_sounds };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
|
+
import { C as Colors } from './colors-ea36347a.js';
|
|
3
|
+
import { H as HttpService } from './services-d71be591.js';
|
|
4
|
+
import './_commonjsHelpers-a4f66ccd.js';
|
|
5
|
+
|
|
6
|
+
const registerFormCss = ".form--user-register .form--login-label{cursor:pointer;display:block;margin-bottom:6px}.form--user-register input,.form--user-register button{border:1px solid #cecece;box-sizing:border-box;display:inline-block;width:100%;padding:4px 11px;min-height:40px;-moz-transition:all 0.3s;-webkit-transition:all 0.3s;transition:all 0.3s;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px}.form--user-register button{background-color:#001529;border:1px solid #001529;color:#fff;cursor:pointer}.form--user-register button:disabled{background-color:#cecece;border:1px solid #cecece;color:#212121}";
|
|
7
|
+
|
|
8
|
+
const RegisterForm = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.onSuccess = undefined;
|
|
12
|
+
this.isSubmitting = undefined;
|
|
13
|
+
this.error = undefined;
|
|
14
|
+
this.firstName = undefined;
|
|
15
|
+
this.lastName = undefined;
|
|
16
|
+
this.email = undefined;
|
|
17
|
+
this.phone = undefined;
|
|
18
|
+
this.password = undefined;
|
|
19
|
+
}
|
|
20
|
+
async onSubmit(evt) {
|
|
21
|
+
evt.preventDefault();
|
|
22
|
+
this.error = null;
|
|
23
|
+
this.isSubmitting = true;
|
|
24
|
+
if (this.firstName && this.lastName && this.email && this.phone && this.password) {
|
|
25
|
+
try {
|
|
26
|
+
await HttpService().register({
|
|
27
|
+
email: this.email,
|
|
28
|
+
password: this.password,
|
|
29
|
+
mobile_phone: this.phone,
|
|
30
|
+
first_name: this.firstName,
|
|
31
|
+
last_name: this.lastName,
|
|
32
|
+
user_type: 1, // Consumer account
|
|
33
|
+
});
|
|
34
|
+
this.onSuccess({
|
|
35
|
+
email: this.email,
|
|
36
|
+
password: this.password,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
let errorMessage = e.message || `Something went wrong when creating your account`;
|
|
41
|
+
if (errorMessage.indexOf('Email has been exists') > -1) {
|
|
42
|
+
errorMessage = 'There was an existing account with your inputted info';
|
|
43
|
+
}
|
|
44
|
+
this.error = errorMessage;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this.error = 'Please enter your username and password';
|
|
49
|
+
}
|
|
50
|
+
this.isSubmitting = false;
|
|
51
|
+
}
|
|
52
|
+
render() {
|
|
53
|
+
return (h("form", { class: "form--user-register", onSubmit: (evt) => this.onSubmit(evt) }, this.error && (h("div", { style: {
|
|
54
|
+
backgroundColor: Colors.Red01,
|
|
55
|
+
border: `1px solid ${Colors.Red02}`,
|
|
56
|
+
marginBottom: '24px',
|
|
57
|
+
padding: '12px',
|
|
58
|
+
} }, this.error)), h("div", { style: {
|
|
59
|
+
display: 'flex',
|
|
60
|
+
marginBottom: '24px',
|
|
61
|
+
width: '100%',
|
|
62
|
+
} }, h("div", { style: { width: '48%', marginRight: '4%' } }, h("label", { ...{ for: "form--login-firstname" }, class: "form--login-label" }, "First name"), h("input", { id: "form--login-firstname", type: "text", onInput: (evt) => {
|
|
63
|
+
this.firstName = evt.target.value;
|
|
64
|
+
} })), h("div", { style: { width: '48%' } }, h("label", { ...{ for: "form--login-lastname" }, class: "form--login-label" }, "Last name"), h("input", { id: "form--login-lastname", type: "text", onInput: (evt) => {
|
|
65
|
+
this.lastName = evt.target.value;
|
|
66
|
+
} }))), h("div", { style: {
|
|
67
|
+
display: 'flex',
|
|
68
|
+
marginBottom: '24px',
|
|
69
|
+
width: '100%',
|
|
70
|
+
} }, h("div", { style: { width: '48%', marginRight: '4%' } }, h("label", { ...{ for: "form--login-email" }, class: "form--login-label" }, "Email"), h("input", { id: "form--login-email", type: "text", onInput: (evt) => {
|
|
71
|
+
this.email = evt.target.value;
|
|
72
|
+
} })), h("div", { style: { width: '48%' } }, h("label", { ...{ for: "form--login-phone" }, class: "form--login-label" }, "Phone"), h("input", { id: "form--login-phone", type: "text", onInput: (evt) => {
|
|
73
|
+
this.phone = evt.target.value;
|
|
74
|
+
} }))), h("div", { style: {
|
|
75
|
+
display: 'flex',
|
|
76
|
+
marginBottom: '24px',
|
|
77
|
+
width: '100%',
|
|
78
|
+
} }, h("div", { style: {
|
|
79
|
+
flexShrink: '1',
|
|
80
|
+
flexGrow: '1',
|
|
81
|
+
} }, h("label", { ...{ for: "form--login-password" }, class: "form--login-label" }, "Password"), h("input", { id: "form--login-password", type: "password", onInput: (evt) => {
|
|
82
|
+
this.password = evt.target.value;
|
|
83
|
+
} })), h("div", { style: { width: '100px', marginLeft: '12px' } }, h("label", { style: { display: 'inline-block', marginBottom: '6px' } }, "\u00A0"), h("button", { type: "submit", disabled: this.isSubmitting }, "SIGN UP"))), h("div", { style: { marginBottom: '24px' } }, "By submitting, you agree to our ", h("a", { target: "_blank", rel: "noopener noreferrer", href: "https://fave.salon/r/terms-for-client", style: { color: Colors.TextColor, cursor: 'pointer', display: 'inline', textDecoration: 'underline' } }, "Terms of Clients"), ", ", h("a", { target: "_blank", rel: "noopener noreferrer", href: "https://fave.salon/r/terms-for-business", style: { color: Colors.TextColor, cursor: 'pointer', display: 'inline', textDecoration: 'underline' } }, "Terms of Salons & Stylist"), " and ", h("a", { target: "_blank", rel: "noopener noreferrer", href: "https://fave.salon/r/privacy-policy", style: { color: Colors.TextColor, cursor: 'pointer', display: 'inline', textDecoration: 'underline' } }, "Private Policy"))));
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
RegisterForm.style = registerFormCss;
|
|
87
|
+
|
|
88
|
+
export { RegisterForm as register_form };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { a as createCommonjsModule, c as commonjsGlobal } from './_commonjsHelpers-a4f66ccd.js';
|
|
2
|
+
|
|
3
|
+
var relativeTime = createCommonjsModule(function (module, exports) {
|
|
4
|
+
!function(r,e){"object"=='object'&&"undefined"!='object'?module.exports=e():"function"==typeof undefined&&undefined.amd?undefined(e):(r="undefined"!=typeof globalThis?globalThis:r||self).dayjs_plugin_relativeTime=e();}(commonjsGlobal,(function(){"use strict";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)};}}));
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export { relativeTime as r };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
|
+
import { C as Colors } from './colors-ea36347a.js';
|
|
3
|
+
import { H as HttpService } from './services-d71be591.js';
|
|
4
|
+
import './_commonjsHelpers-a4f66ccd.js';
|
|
5
|
+
|
|
6
|
+
const resetPasswordFormCss = ".form--user-reset-password .form--login-label{cursor:pointer;display:block;margin-bottom:6px}.form--user-reset-password input,.form--user-reset-password button{border:1px solid #cecece;box-sizing:border-box;display:inline-block;width:100%;padding:4px 11px;min-height:40px;-moz-transition:all 0.3s;-webkit-transition:all 0.3s;transition:all 0.3s;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px}.form--user-reset-password button{background-color:#001529;border:1px solid #001529;color:#fff;cursor:pointer}.form--user-reset-password button:disabled{background-color:#cecece;border:1px solid #cecece;color:#212121}";
|
|
7
|
+
|
|
8
|
+
const ResetPasswordForm = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.onSuccess = undefined;
|
|
12
|
+
this.isSubmitting = undefined;
|
|
13
|
+
this.error = undefined;
|
|
14
|
+
this.username = undefined;
|
|
15
|
+
}
|
|
16
|
+
async onSubmit(evt) {
|
|
17
|
+
evt.preventDefault();
|
|
18
|
+
this.error = null;
|
|
19
|
+
this.isSubmitting = true;
|
|
20
|
+
if (this.username) {
|
|
21
|
+
try {
|
|
22
|
+
await HttpService().resetPassword(this.username);
|
|
23
|
+
this.onSuccess({ email: this.username });
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
this.error = e.message || `Something went wrong when setting your new password`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.error = 'Please enter your phone or email to reset your password';
|
|
31
|
+
}
|
|
32
|
+
this.isSubmitting = false;
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return (h("form", { class: "form--user-reset-password", onSubmit: (evt) => this.onSubmit(evt) }, this.error && (h("div", { style: {
|
|
36
|
+
backgroundColor: Colors.Red01,
|
|
37
|
+
border: `1px solid ${Colors.Red02}`,
|
|
38
|
+
marginBottom: '24px',
|
|
39
|
+
padding: '12px',
|
|
40
|
+
} }, this.error)), h("div", { style: { marginBottom: '24px' } }, h("label", { ...{ for: "form--login-username" }, class: "form--login-label" }, "Phone or Email"), h("input", { id: "form--login-username", type: "text", onInput: (evt) => {
|
|
41
|
+
this.username = evt.target.value;
|
|
42
|
+
} })), h("div", { style: { marginBottom: '24px' } }, h("button", { type: "submit", disabled: this.isSubmitting }, "RESET NOW"))));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
ResetPasswordForm.style = resetPasswordFormCss;
|
|
46
|
+
|
|
47
|
+
export { ResetPasswordForm as reset_password_form };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
2
|
import { C as Colors } from './colors-ea36347a.js';
|
|
3
3
|
|
|
4
4
|
const indexCss = ".salon-modal.salon-modal--booking:before{display:none}.salon-modal.salon-modal--booking .salon-modal--inner,.salon-modal.salon-modal--booking .salon-modal--content{max-width:none;width:100%;height:100%}.salon-modal.salon-modal--booking .salon-modal--close{background-color:#EFEFEF;width:40px;height:40px;right:16px;top:16px;-moz-border-radius:50px;-webkit-border-radius:50px;border-radius:50px}@media (min-width: 768px){.salon-modal.salon-modal--booking .salon-modal--close{right:20px;top:20px}}";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
2
|
-
import { c as color, l as lib } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
|
+
import { c as color, l as lib } from './index-00b83e1c.js';
|
|
3
3
|
import { C as Colors } from './colors-ea36347a.js';
|
|
4
|
-
import './_commonjsHelpers-
|
|
4
|
+
import './_commonjsHelpers-a4f66ccd.js';
|
|
5
5
|
|
|
6
6
|
const indexCss = ".salon-modal.salon-modal--booking:before{display:none}.salon-modal.salon-modal--booking .salon-modal--inner,.salon-modal.salon-modal--booking .salon-modal--content{max-width:none;width:100%;height:100%}.salon-modal.salon-modal--booking .salon-modal--close{background-color:#EFEFEF;width:40px;height:40px;right:16px;top:16px;-moz-border-radius:50px;-webkit-border-radius:50px;border-radius:50px}@media (min-width: 768px){.salon-modal.salon-modal--booking .salon-modal--close{right:20px;top:20px}}";
|
|
7
7
|
|
|
@@ -39,7 +39,7 @@ const SalonBooking = class {
|
|
|
39
39
|
},
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
return (h("div", { class: "salon-booking" }, h("div", { class: "salon-booking--button" }, h("button",
|
|
42
|
+
return (h("div", { class: "salon-booking" }, h("div", { class: "salon-booking--button" }, h("button", { type: "button", class: buttonClass, onClick: () => this.openModal(), ...buttonStyle }, this.buttonText))));
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
SalonBooking.style = indexCss;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-888e99e3.js';
|
|
2
2
|
import { C as Colors } from './colors-ea36347a.js';
|
|
3
3
|
|
|
4
4
|
const indexCss = ".salon-modal.salon-modal--gift-card:before{display:none}.salon-modal.salon-modal--gift-card .salon-modal--inner,.salon-modal.salon-modal--gift-card .salon-modal--content{max-width:none;width:100%;height:100%}.salon-modal.salon-modal--gift-card .salon-modal--close{background-color:#EFEFEF;width:40px;height:40px;right:16px;top:16px;-moz-border-radius:50px;-webkit-border-radius:50px;border-radius:50px}@media (min-width: 768px){.salon-modal.salon-modal--gift-card .salon-modal--close{right:20px;top:20px}}";
|