@bcrumbs.net/bc-chat 1.0.50 → 1.0.52
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/build/index.d.ts +53 -53
- package/build/index.es.js +7 -8
- package/build/index.es.js.map +1 -1
- package/build/index.js +6 -7
- package/build/index.js.map +1 -1
- package/package.json +114 -113
package/build/index.d.ts
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { MessageDto, MessageStatus } from 'graphql.autogenerated';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* MessageType is an enum of the message types.
|
|
6
|
-
* It can be:
|
|
7
|
-
* - text: Text message.
|
|
8
|
-
* - image: Image message.
|
|
9
|
-
* - audio: Audio message.
|
|
10
|
-
* - document: Document message (Files, PDFs, etc.).
|
|
11
|
-
* - video: Video message.
|
|
12
|
-
* - location: Location message.
|
|
13
|
-
* - interactive: Interactive message.
|
|
14
|
-
* - template: Template message (WhatsApp only).
|
|
15
|
-
* - note: Note message (Internal note).
|
|
16
|
-
*/
|
|
17
|
-
declare const MessageType: {
|
|
18
|
-
readonly AUDIO: "audio";
|
|
19
|
-
readonly DOCUMENT: "document";
|
|
20
|
-
readonly IMAGE: "image";
|
|
21
|
-
readonly INTERACTIVE: "interactive";
|
|
22
|
-
readonly LOCATION: "location";
|
|
23
|
-
readonly NOTE: "note";
|
|
24
|
-
readonly TEMPLATE: "template";
|
|
25
|
-
readonly TEXT: "text";
|
|
26
|
-
readonly VIDEO: "video";
|
|
27
|
-
};
|
|
4
|
+
/**
|
|
5
|
+
* MessageType is an enum of the message types.
|
|
6
|
+
* It can be:
|
|
7
|
+
* - text: Text message.
|
|
8
|
+
* - image: Image message.
|
|
9
|
+
* - audio: Audio message.
|
|
10
|
+
* - document: Document message (Files, PDFs, etc.).
|
|
11
|
+
* - video: Video message.
|
|
12
|
+
* - location: Location message.
|
|
13
|
+
* - interactive: Interactive message.
|
|
14
|
+
* - template: Template message (WhatsApp only).
|
|
15
|
+
* - note: Note message (Internal note).
|
|
16
|
+
*/
|
|
17
|
+
declare const MessageType: {
|
|
18
|
+
readonly AUDIO: "audio";
|
|
19
|
+
readonly DOCUMENT: "document";
|
|
20
|
+
readonly IMAGE: "image";
|
|
21
|
+
readonly INTERACTIVE: "interactive";
|
|
22
|
+
readonly LOCATION: "location";
|
|
23
|
+
readonly NOTE: "note";
|
|
24
|
+
readonly TEMPLATE: "template";
|
|
25
|
+
readonly TEXT: "text";
|
|
26
|
+
readonly VIDEO: "video";
|
|
27
|
+
};
|
|
28
28
|
type MessageType = typeof MessageType[keyof typeof MessageType];
|
|
29
29
|
|
|
30
|
-
type Lang = "EN" | "AR" | "TR";
|
|
31
|
-
type ChatConfig = {
|
|
32
|
-
backgroundImage?: string;
|
|
33
|
-
backgroundColor?: string;
|
|
34
|
-
brandLogo?: string;
|
|
35
|
-
brandName?: string;
|
|
36
|
-
inputPlaceholder?: string;
|
|
37
|
-
whiteLabeled?: boolean;
|
|
38
|
-
inputDisabled?: boolean;
|
|
39
|
-
language?: Lang;
|
|
40
|
-
hideHeader?: boolean;
|
|
41
|
-
isAgent?: boolean;
|
|
42
|
-
};
|
|
43
|
-
type UtilMessage = {
|
|
44
|
-
type: 'seperator';
|
|
45
|
-
content?: string;
|
|
46
|
-
};
|
|
47
|
-
type ChatMessage = Partial<MessageDto> & {
|
|
48
|
-
status?: MessageStatus;
|
|
49
|
-
agentId?: string;
|
|
30
|
+
type Lang = "EN" | "AR" | "TR";
|
|
31
|
+
type ChatConfig = {
|
|
32
|
+
backgroundImage?: string;
|
|
33
|
+
backgroundColor?: string;
|
|
34
|
+
brandLogo?: string;
|
|
35
|
+
brandName?: string;
|
|
36
|
+
inputPlaceholder?: string;
|
|
37
|
+
whiteLabeled?: boolean;
|
|
38
|
+
inputDisabled?: boolean;
|
|
39
|
+
language?: Lang;
|
|
40
|
+
hideHeader?: boolean;
|
|
41
|
+
isAgent?: boolean;
|
|
42
|
+
};
|
|
43
|
+
type UtilMessage = {
|
|
44
|
+
type: 'seperator';
|
|
45
|
+
content?: string;
|
|
46
|
+
};
|
|
47
|
+
type ChatMessage = Partial<MessageDto> & {
|
|
48
|
+
status?: MessageStatus;
|
|
49
|
+
agentId?: string;
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
interface ChatProps {
|
|
53
|
-
config?: ChatConfig;
|
|
54
|
-
messages?: (ChatMessage | UtilMessage)[];
|
|
55
|
-
sendMessage: (type: MessageType, messageContent: string) => void;
|
|
56
|
-
onReachingUp?: () => void;
|
|
57
|
-
minimize?: () => void;
|
|
58
|
-
debug?: boolean;
|
|
59
|
-
agentsIdsAvatarsMap?: Record<string, string>;
|
|
60
|
-
}
|
|
52
|
+
interface ChatProps {
|
|
53
|
+
config?: ChatConfig;
|
|
54
|
+
messages?: (ChatMessage | UtilMessage)[];
|
|
55
|
+
sendMessage: (type: MessageType, messageContent: string) => void;
|
|
56
|
+
onReachingUp?: () => void;
|
|
57
|
+
minimize?: () => void;
|
|
58
|
+
debug?: boolean;
|
|
59
|
+
agentsIdsAvatarsMap?: Record<string, string>;
|
|
60
|
+
}
|
|
61
61
|
declare const Chat: ({ config, messages, sendMessage, debug, minimize, onReachingUp, agentsIdsAvatarsMap, }: ChatProps) => react_jsx_runtime.JSX.Element;
|
|
62
62
|
|
|
63
63
|
export { Chat as BCChat };
|
package/build/index.es.js
CHANGED
|
@@ -52,12 +52,12 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
|
|
|
52
52
|
-ms-filter: brightness(80%);
|
|
53
53
|
filter: brightness(80%);
|
|
54
54
|
}
|
|
55
|
-
`,
|
|
55
|
+
`,D=d.div`
|
|
56
56
|
display: flex;
|
|
57
57
|
flex-direction: row;
|
|
58
58
|
align-items: center;
|
|
59
59
|
gap: 5px;
|
|
60
|
-
`,
|
|
60
|
+
`,z=d.span`
|
|
61
61
|
color: ${e=>e.color};
|
|
62
62
|
`;const B=d.i`
|
|
63
63
|
background-image: ${e=>`url("data:image/svg+xml,%3Csvg%20width%3D%2215%22%20height%3D%2215%22%20viewBox%3D%220%200%2015%2015%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M9.62129%201.13607C9.81656%200.940808%2010.1331%200.940809%2010.3284%201.13607L11.3891%202.19673L12.8033%203.61094L13.8639%204.6716C14.0592%204.86687%2014.0592%205.18345%2013.8639%205.37871C13.6687%205.57397%2013.3521%205.57397%2013.1568%205.37871L12.5038%204.7257L8.86727%209.57443L9.97485%2010.682C10.1701%2010.8773%2010.1701%2011.1939%209.97485%2011.3891C9.77959%2011.5844%209.463%2011.5844%209.26774%2011.3891L7.85353%209.97491L6.79287%208.91425L3.5225%2012.1846C3.32724%2012.3799%203.01065%2012.3799%202.81539%2012.1846C2.62013%2011.9894%202.62013%2011.6728%202.81539%2011.4775L6.08576%208.20714L5.0251%207.14648L3.61089%205.73226C3.41563%205.537%203.41562%205.22042%203.61089%205.02516C3.80615%204.8299%204.12273%204.8299%204.31799%205.02516L5.42557%206.13274L10.2743%202.49619L9.62129%201.84318C9.42603%201.64792%209.42603%201.33133%209.62129%201.13607Z%22%20fill%3D%22currentColor%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M9.62129%201.13607C9.81656%200.940808%2010.1331%200.940809%2010.3284%201.13607L11.3891%202.19673L12.8033%203.61094L13.8639%204.6716C14.0592%204.86687%2014.0592%205.18345%2013.8639%205.37871C13.6687%205.57397%2013.3521%205.57397%2013.1568%205.37871L12.5038%204.7257L8.86727%209.57443L9.97485%2010.682C10.1701%2010.8773%2010.1701%2011.1939%209.97485%2011.3891C9.77959%2011.5844%209.463%2011.5844%209.26774%2011.3891L7.85353%209.97491L6.79287%208.91425L3.5225%2012.1846C3.32724%2012.3799%203.01065%2012.3799%202.81539%2012.1846C2.62013%2011.9894%202.62013%2011.6728%202.81539%2011.4775L6.08576%208.20714L5.0251%207.14648L3.61089%205.73226C3.41563%205.537%203.41562%205.22042%203.61089%205.02516C3.80615%204.8299%204.12273%204.8299%204.31799%205.02516L5.42557%206.13274L10.2743%202.49619L9.62129%201.84318C9.42603%201.64792%209.42603%201.33133%209.62129%201.13607Z%22%20fill%3D%22%23${e.color}%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E")`};
|
|
@@ -66,7 +66,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
|
|
|
66
66
|
background-repeat: no-repeat;
|
|
67
67
|
width: 15px;
|
|
68
68
|
height: 15px;
|
|
69
|
-
`,F={document:({message:t,config:i})=>{let o=t.content.split("/"),a=o[o.length-1];return e(I,{className:"bc-fileMessage",...t,isMyMessage:i.isAgent===t.isAgent,children:n(E,{href:t.content,target:"_blank",download:a,rel:"noopener noreferrer",isMyMessage:i.isAgent===t.isAgent,children:[e(L,{color:(r=i.isAgent===t.isAgent,r.isAgent,"000000")}),e("span",{children:a})]})});var r},image:({message:n,config:t})=>e("div",{className:"bc-mediaMessage",style:{backgroundImage:v(t.isAgent===n.isAgent),color:w(t.isAgent===n.isAgent),borderColor:y(t.isAgent===n.isAgent),borderWidth:"1px",borderStyle:"solid",padding:0},children:e("a",{href:n.content,target:"_blank",rel:"noreferrer",children:e("img",{src:n.content,alt:"message content"})})}),location:({message:t,config:i})=>{return e(S,{href:"https://www.google.com/maps/?q="+t.content,target:"_blank",rel:"noopener noreferrer",className:"bc-locationMessage",isMyMessage:t.isAgent===i.isAgent,children:n(z,{children:[e(B,{color:(o=i.isAgent===t.isAgent,o.isAgent,"000000")}),e(D,{color:w(i.isAgent===t.isAgent),children:"Open location"})]})});var o},text:({message:t,config:i})=>{const o=p(t.content);return n("div",{className:"bc-textMessage",style:{backgroundImage:v(i.isAgent===t.isAgent),color:w(i.isAgent===t.isAgent),borderColor:y(i.isAgent===t.isAgent),borderWidth:"1px",borderStyle:"solid",direction:"arb"===o?"rtl":"ltr",maxWidth:"80%"},children:[t.context&&t.context.replyToId?e(M,{context:t.context,isAgent:t.isAgent,language:o}):null,(t.content&&t.content.indexOf("\n")>-1?t.content.split("\n"):[t.content]).map(((n,i)=>e(g,{children:n},`${t.messageId}-${i}`)))]})},video:k,audio:k,interactive:null,template:({message:t,config:i})=>{const o=c((()=>{try{return JSON.parse(t.content)}catch(e){return void console.log(e.message)}}),[t]);return n("div",{style:{backgroundImage:v(i.isAgent===t.isAgent),color:w(i.isAgent===t.isAgent),borderColor:y(i.isAgent===t.isAgent),borderWidth:"1px",borderStyle:"solid"},children:[e("b",{children:"Template message:"})," ",o.name," ",o.language?.code?`/ ${o.language.code}`:null]})},note:({message:n})=>e("div",{children:n.content})},N=()=>n("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{d:"M1.5 12.5L5.57574 16.5757C5.81005 16.8101 6.18995 16.8101 6.42426 16.5757L9 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e("path",{d:"M16 7L12 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e("path",{d:"M7 12L11.5757 16.5757C11.8101 16.8101 12.1899 16.8101 12.4243 16.5757L22 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),R={delivered:N,failed:()=>e("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),read:N,sent:()=>e("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M5 13L9 17L19 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),pending:()=>e("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M7.50009 0.877014C3.84241 0.877014 0.877258 3.84216 0.877258 7.49984C0.877258 11.1575 3.8424 14.1227 7.50009 14.1227C11.1578 14.1227 14.1229 11.1575 14.1229 7.49984C14.1229 3.84216 11.1577 0.877014 7.50009 0.877014ZM1.82726 7.49984C1.82726 4.36683 4.36708 1.82701 7.50009 1.82701C10.6331 1.82701 13.1729 4.36683 13.1729 7.49984C13.1729 10.6328 10.6331 13.1727 7.50009 13.1727C4.36708 13.1727 1.82726 10.6328 1.82726 7.49984ZM8 4.50001C8 4.22387 7.77614 4.00001 7.5 4.00001C7.22386 4.00001 7 4.22387 7 4.50001V7.50001C7 7.63262 7.05268 7.7598 7.14645 7.85357L9.14645 9.85357C9.34171 10.0488 9.65829 10.0488 9.85355 9.85357C10.0488 9.65831 10.0488 9.34172 9.85355 9.14646L8 7.29291V4.50001Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})},Z=({message:n})=>{if(!n.status)return null;const t=R[n.status];return e("div",{className:`status-icon ${n.status||""}`,children:e(t,{})})};function G(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}G("/* Shared styles between agent and client messages */\n.bc-otherMessage,\n.bc-myMessage {\n margin: 10px 15px;\n font-size: var(--bc-chat-fontSize-sm);\n}\n.bc-otherMessage div p,\n.bc-myMessage div p {\n padding: 0;\n margin: 0;\n}\n.bc-otherMessage > div,\n.bc-myMessage > div {\n display: inline-block;\n padding: 8px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n}\n.bc-otherMessage .bc-fileMessage,\n.bc-myMessage .bc-fileMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer;\n}\n.bc-otherMessage .bc-fileMessage img,\n.bc-myMessage .bc-fileMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 15px;\n height: 16px;\n}\n.bc-otherMessage .bc-locationMessage,\n.bc-myMessage .bc-locationMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer;\n}\n.bc-otherMessage .bc-locationMessage img,\n.bc-myMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px;\n}\n\n/* Styles for agent messages */\n.bc-otherMessage {\n text-align: left;\n display: flex;\n align-items: flex-end;\n flex-wrap: wrap;\n gap: 5px;\n}\n.bc-otherMessage:first-child {\n flex: 1 0 50%;\n}\n.bc-otherMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%;\n}\n.bc-otherMessage .bc-fileMessage,\n.bc-otherMessage .bc-locationMessage {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer;\n}\n.bc-otherMessage .bc-fileMessage img,\n.bc-otherMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px;\n}\n.bc-otherMessage > div,\n.bc-otherMessage .bc-fileMessage,\n.bc-otherMessage .bc-locationMessage,\n.bc-otherMessage audio {\n border-bottom-left-radius: 0;\n}\n\n/* Styles for other messages */\n.bc-note {\n text-align: center;\n gap: 5px;\n}\n.bc-note > div {\n display: inline-block;\n padding: 8px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n border: 1px solid #999;\n max-width: 60%;\n background-color: #fff3cd !important;\n}\n\n.bc-myMessage {\n text-align: right;\n}\n.bc-myMessage > div:not(.bc-debugCon),\n.bc-myMessage .bc-fileMessage,\n.bc-myMessage .bc-locationMessage,\n.bc-myMessage audio {\n color: #fff;\n border-bottom-right-radius: 0;\n}\n.bc-myMessage svg path:nth-child(2) {\n fill: #fff;\n}\n\n.bc-mediaMessage {\n position: relative;\n}\n.bc-mediaMessage video,\n.bc-mediaMessage img,\n.bc-mediaMessage audio {\n width: 300px;\n margin-bottom: -5px;\n}\n.bc-mediaMessage audio {\n -webkit-appearance: none;\n -webkit-border-radius: 0;\n border-radius: 0;\n}\n.bc-mediaMessage audio::-webkit-media-controls-panel {\n background-color: transparent;\n}\n.bc-mediaMessage audio::-webkit-media-controls-play-button {\n background-color: transparent;\n}\n.bc-mediaMessage audio::-webkit-media-controls-timeline {\n background-color: transparent;\n}\n.bc-mediaMessage audio::-webkit-media-controls-current-time-display, .bc-mediaMessage audio::-webkit-media-controls-time-remaining-display {\n color: inherit;\n}\n.bc-mediaMessage audio {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n height: 40px !important;\n width: 100% !important;\n max-width: 400px !important;\n position: static !important;\n -webkit-appearance: none !important;\n -webkit-border-radius: 0 !important;\n border-radius: 0 !important;\n}\n.bc-mediaMessage audio::-webkit-media-controls {\n display: flex !important;\n visibility: visible !important;\n opacity: 1 !important;\n}\n.bc-mediaMessage audio::-webkit-media-controls-panel {\n display: flex !important;\n visibility: visible !important;\n background-color: #f0f0f0 !important;\n opacity: 1 !important;\n}\n.bc-mediaMessage audio::-webkit-media-controls-play-button {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n}\n.bc-mediaMessage audio::-webkit-media-controls-timeline {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n}\n.bc-mediaMessage audio::-webkit-media-controls-volume-slider {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n}\n.bc-mediaMessage audio::-webkit-media-controls-current-time-display, .bc-mediaMessage audio::-webkit-media-controls-time-remaining-display {\n display: block !important;\n visibility: visible !important;\n color: #000 !important;\n}\n.bc-mediaMessage audio::-webkit-media-controls-mute-button {\n display: block !important;\n visibility: visible !important;\n}\n\n.bc-mediaMessage.audio {\n height: 40px;\n width: 300px;\n min-height: 40px !important;\n}\n.bc-mediaMessage.audio audio {\n height: 40px;\n}\n\n.bc-selectionContainer {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap;\n}\n\n.bc-selectionContainer:first-child {\n flex: 1 0 50%;\n}\n\n.status-icon {\n color: var(--bc-chat-light-gray-color) !important;\n}\n.status-icon.read {\n color: var(--bc-chat-success-color) !important;\n}\n.status-icon.failed {\n color: var(--bc-chat-danger-color) !important;\n}\n.status-icon.failed .resend {\n color: var(--bc-chat-dark-gray-color) !important;\n cursor: pointer;\n margin: 0 10px;\n}");const j=d.i`
|
|
69
|
+
`,F={document:({message:t,config:i})=>{let o=t.content.split("/"),a=o[o.length-1];return e(I,{className:"bc-fileMessage",...t,isMyMessage:i.isAgent===t.isAgent,children:n(E,{href:t.content,target:"_blank",download:a,rel:"noopener noreferrer",isMyMessage:i.isAgent===t.isAgent,children:[e(L,{color:(r=i.isAgent===t.isAgent,r.isAgent,"000000")}),e("span",{children:a})]})});var r},image:({message:n,config:t})=>e("div",{className:"bc-mediaMessage",style:{backgroundImage:v(t.isAgent===n.isAgent),color:w(t.isAgent===n.isAgent),borderColor:y(t.isAgent===n.isAgent),borderWidth:"1px",borderStyle:"solid",padding:0},children:e("a",{href:n.content,target:"_blank",rel:"noreferrer",children:e("img",{src:n.content,alt:"message content"})})}),location:({message:t,config:i})=>{return e(S,{href:"https://www.google.com/maps/?q="+t.content,target:"_blank",rel:"noopener noreferrer",className:"bc-locationMessage",isMyMessage:t.isAgent===i.isAgent,children:n(D,{children:[e(B,{color:(o=i.isAgent===t.isAgent,o.isAgent,"000000")}),e(z,{color:w(i.isAgent===t.isAgent),children:"Open location"})]})});var o},text:({message:t,config:i})=>{const o=p(t.content);return n("div",{className:"bc-textMessage",style:{backgroundImage:v(i.isAgent===t.isAgent),color:w(i.isAgent===t.isAgent),borderColor:y(i.isAgent===t.isAgent),borderWidth:"1px",borderStyle:"solid",direction:"arb"===o?"rtl":"ltr",maxWidth:"80%"},children:[t.context&&t.context.replyToId?e(M,{context:t.context,isAgent:t.isAgent,language:o}):null,(t.content&&t.content.indexOf("\n")>-1?t.content.split("\n"):[t.content]).map(((n,i)=>e(g,{children:n},`${t.messageId}-${i}`)))]})},video:k,audio:k,interactive:null,template:({message:t,config:i})=>{const o=c((()=>{try{return JSON.parse(t.content)}catch(e){return void console.log(e.message)}}),[t]);return n("div",{style:{backgroundImage:v(i.isAgent===t.isAgent),color:w(i.isAgent===t.isAgent),borderColor:y(i.isAgent===t.isAgent),borderWidth:"1px",borderStyle:"solid"},children:[e("b",{children:"Template message:"})," ",o.name," ",o.language?.code?`/ ${o.language.code}`:null]})},note:({message:n})=>e("div",{children:n.content})},N=()=>n("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{d:"M1.5 12.5L5.57574 16.5757C5.81005 16.8101 6.18995 16.8101 6.42426 16.5757L9 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e("path",{d:"M16 7L12 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e("path",{d:"M7 12L11.5757 16.5757C11.8101 16.8101 12.1899 16.8101 12.4243 16.5757L22 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),R={delivered:N,failed:()=>e("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),read:N,sent:()=>e("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M5 13L9 17L19 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),pending:()=>e("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M7.50009 0.877014C3.84241 0.877014 0.877258 3.84216 0.877258 7.49984C0.877258 11.1575 3.8424 14.1227 7.50009 14.1227C11.1578 14.1227 14.1229 11.1575 14.1229 7.49984C14.1229 3.84216 11.1577 0.877014 7.50009 0.877014ZM1.82726 7.49984C1.82726 4.36683 4.36708 1.82701 7.50009 1.82701C10.6331 1.82701 13.1729 4.36683 13.1729 7.49984C13.1729 10.6328 10.6331 13.1727 7.50009 13.1727C4.36708 13.1727 1.82726 10.6328 1.82726 7.49984ZM8 4.50001C8 4.22387 7.77614 4.00001 7.5 4.00001C7.22386 4.00001 7 4.22387 7 4.50001V7.50001C7 7.63262 7.05268 7.7598 7.14645 7.85357L9.14645 9.85357C9.34171 10.0488 9.65829 10.0488 9.85355 9.85357C10.0488 9.65831 10.0488 9.34172 9.85355 9.14646L8 7.29291V4.50001Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})},Z=({message:n})=>{if(!n.status)return null;const t=R[n.status];return e("div",{className:`status-icon ${n.status||""}`,children:e(t,{})})};function G(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}G("/* Shared styles between agent and client messages */\n.bc-otherMessage,\n.bc-myMessage {\n margin: 10px 15px;\n font-size: var(--bc-chat-fontSize-sm);\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 5px; }\n .bc-otherMessage div p,\n .bc-myMessage div p {\n padding: 0;\n margin: 0; }\n .bc-otherMessage > div,\n .bc-myMessage > div {\n display: inline-block;\n padding: 8px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent; }\n .bc-otherMessage .bc-fileMessage,\n .bc-myMessage .bc-fileMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer; }\n .bc-otherMessage .bc-fileMessage img,\n .bc-myMessage .bc-fileMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 15px;\n height: 16px; }\n .bc-otherMessage .bc-locationMessage,\n .bc-myMessage .bc-locationMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer; }\n .bc-otherMessage .bc-locationMessage img,\n .bc-myMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n\n/* Styles for agent messages */\n.bc-otherMessage {\n justify-content: flex-start; }\n .bc-otherMessage:first-child {\n flex: 1 0 50%; }\n .bc-otherMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%; }\n .bc-otherMessage .bc-fileMessage,\n .bc-otherMessage .bc-locationMessage {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer; }\n .bc-otherMessage .bc-fileMessage img,\n .bc-otherMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n\n/* Styles for other messages */\n.bc-note {\n text-align: center;\n gap: 5px; }\n .bc-note > div {\n display: inline-block;\n padding: 8px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n border: 1px solid #999;\n max-width: 60%;\n background-color: #fff3cd !important; }\n\n.bc-myMessage {\n justify-content: flex-end; }\n .bc-myMessage > div:not(.bc-debugCon),\n .bc-myMessage .bc-fileMessage,\n .bc-myMessage .bc-locationMessage,\n .bc-myMessage audio {\n color: #fff; }\n .bc-myMessage svg path:nth-child(2) {\n fill: #fff; }\n\n.bc-mediaMessage {\n position: relative; }\n .bc-mediaMessage video,\n .bc-mediaMessage img,\n .bc-mediaMessage audio {\n width: 300px;\n margin-bottom: -5px; }\n .bc-mediaMessage audio {\n -webkit-appearance: none;\n -webkit-border-radius: 0;\n border-radius: 0; }\n .bc-mediaMessage audio::-webkit-media-controls-panel {\n background-color: transparent; }\n .bc-mediaMessage audio::-webkit-media-controls-play-button {\n background-color: transparent; }\n .bc-mediaMessage audio::-webkit-media-controls-timeline {\n background-color: transparent; }\n .bc-mediaMessage audio::-webkit-media-controls-current-time-display, .bc-mediaMessage audio::-webkit-media-controls-time-remaining-display {\n color: inherit; }\n .bc-mediaMessage audio {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n height: 40px !important;\n width: 100% !important;\n max-width: 400px !important;\n position: static !important;\n -webkit-appearance: none !important;\n -webkit-border-radius: 0 !important;\n border-radius: 0 !important; }\n .bc-mediaMessage audio::-webkit-media-controls {\n display: flex !important;\n visibility: visible !important;\n opacity: 1 !important; }\n .bc-mediaMessage audio::-webkit-media-controls-panel {\n display: flex !important;\n visibility: visible !important;\n background-color: #f0f0f0 !important;\n opacity: 1 !important; }\n .bc-mediaMessage audio::-webkit-media-controls-play-button {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important; }\n .bc-mediaMessage audio::-webkit-media-controls-timeline {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important; }\n .bc-mediaMessage audio::-webkit-media-controls-volume-slider {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important; }\n .bc-mediaMessage audio::-webkit-media-controls-current-time-display, .bc-mediaMessage audio::-webkit-media-controls-time-remaining-display {\n display: block !important;\n visibility: visible !important;\n color: #000 !important; }\n .bc-mediaMessage audio::-webkit-media-controls-mute-button {\n display: block !important;\n visibility: visible !important; }\n\n.bc-mediaMessage.audio {\n height: 40px;\n width: 300px;\n min-height: 40px !important; }\n .bc-mediaMessage.audio audio {\n height: 40px; }\n\n.bc-selectionContainer {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap; }\n\n.bc-selectionContainer:first-child {\n flex: 1 0 50%; }\n\n.status-icon {\n color: var(--bc-chat-light-gray-color) !important; }\n .status-icon.read {\n color: var(--bc-chat-success-color) !important; }\n .status-icon.failed {\n color: var(--bc-chat-danger-color) !important; }\n .status-icon.failed .resend {\n color: var(--bc-chat-dark-gray-color) !important;\n cursor: pointer;\n margin: 0 10px; }\n");const j=d.i`
|
|
70
70
|
background-image: url(${e=>e.avatar||x});
|
|
71
71
|
width: 30px;
|
|
72
72
|
height: 30px;
|
|
@@ -75,8 +75,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
|
|
|
75
75
|
display: inline-block;
|
|
76
76
|
border-radius: 50%;
|
|
77
77
|
background-repeat: no-repeat;
|
|
78
|
-
|
|
79
|
-
`;function J(e,n,t){return"note"===e?"bc-note":t.isAgent?n?"bc-myMessage":"bc-otherMessage":n?"bc-otherMessage":"bc-myMessage"}const K=t=>{const{type:i,isAgent:o}=t.message,a=t.message.isAgent&&t.message.agentId&&t.agentsIdsAvatarsMap?.[t.message.agentId]||t.config?.brandLogo,r=F[i]??null;return r?(console.log(t.message.messageId,t.config.isAgent==t.message.isAgent&&"note"!==i),n("div",{className:J(i,o,t.config),id:t.message.messageId,children:[t.config.isAgent==t.message.isAgent&&"note"!==i?e(Z,{message:t.message,config:t.config}):null,e(r,{message:t.message,config:t.config}),t.config.isAgent&&o&&"note"!==i?e(j,{avatar:a}):null]})):null},T=d.div`
|
|
78
|
+
`;function J(e,n,t){return"note"===e?"bc-note":t.isAgent?n?"bc-myMessage":"bc-otherMessage":n?"bc-otherMessage":"bc-myMessage"}const K=t=>{const{type:i,isAgent:o}=t.message,a=t.message.isAgent&&t.message.agentId&&t.agentsIdsAvatarsMap?.[t.message.agentId]||t.config?.brandLogo,r=F[i]??null;return r?n("div",{className:J(i,o,t.config),id:t.message.messageId,style:{flexDirection:"AR"===t.config.language?"row-reverse":"row"},children:[t.config.isAgent==t.message.isAgent&&"note"!==i?e(Z,{message:t.message,config:t.config}):null,e(r,{message:t.message,config:t.config}),t.config.isAgent&&o&&"note"!==i?e(j,{avatar:a}):null]}):null},T=d.div`
|
|
80
79
|
width: 100%;
|
|
81
80
|
display: flex;
|
|
82
81
|
align-items: center;
|
|
@@ -144,7 +143,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
|
|
|
144
143
|
cursor: pointer;
|
|
145
144
|
display: block;
|
|
146
145
|
}
|
|
147
|
-
`,be=({setView:t,setFile:i,setProgress:o,setError:r,text:s,setText:c,send:l})=>{const[d,g]=a(!1);return n("div",{className:"bc-inputActions",id:"bc-inputActions",children:[n(he,{id:"iconsContainer",children:[e(me,{setFile:i,setProgress:o,setError:r}),e(de,{onClick:()=>g(!0)}),e(se,{setFile:i,setError:r,setProgress:o,send:l})]}),d?e(ge,{text:s,setText:c,onClick:()=>g(!1)}):null]})};G('.bc-trademark {\n height: 40px;\n width: 100%;\n box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.1);\n background-color: #fff;\n overflow-y: hidden;\n border-bottom-left-radius: 15px;\n border-bottom-right-radius: 15px;\n padding: 15px 0
|
|
146
|
+
`,be=({setView:t,setFile:i,setProgress:o,setError:r,text:s,setText:c,send:l})=>{const[d,g]=a(!1);return n("div",{className:"bc-inputActions",id:"bc-inputActions",children:[n(he,{id:"iconsContainer",children:[e(me,{setFile:i,setProgress:o,setError:r}),e(de,{onClick:()=>g(!0)}),e(se,{setFile:i,setError:r,setProgress:o,send:l})]}),d?e(ge,{text:s,setText:c,onClick:()=>g(!1)}):null]})};G('.bc-trademark {\n height: 40px;\n width: 100%;\n box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.1);\n background-color: #fff;\n overflow-y: hidden;\n border-bottom-left-radius: 15px;\n border-bottom-right-radius: 15px;\n padding: 15px 0; }\n\n.bc-messageInput {\n min-height: 30px;\n max-height: 100%;\n border: 1px solid #d9d9d9;\n background-color: #fff;\n overflow-y: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 20px; }\n .bc-messageInput .bc-messageInputTextArea {\n color: var(--bc-chat-dark-gray-color);\n display: block;\n min-height: 36px;\n background-color: #fff;\n box-sizing: border-box;\n font-size: var(--bc-chat-fontSize-md);\n padding: 10px 16px;\n resize: none;\n overflow: auto;\n border-width: 0;\n width: calc(100% - 20px);\n word-wrap: break-word;\n border: none;\n overflow: hidden;\n outline: none;\n -webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none; }\n\n.bc-inputActions {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n height: 38px; }\n .bc-inputActions .bc-fileUpload {\n display: none; }\n .bc-inputActions i {\n display: block;\n margin: 0 5px; }\n\n.bc-emojiPicker {\n position: absolute;\n bottom: 40px;\n right: 0;\n width: 200px;\n background: #ffffff 0% 0% no-repeat padding-box;\n box-shadow: 0px 0px 15px #0000001a;\n border-radius: 10px;\n opacity: 1;\n padding: 10px;\n z-index: 10;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap; }\n\n.bc-uploadFileDetails {\n background-color: transparent;\n display: flex;\n align-items: center;\n max-width: calc(100% - 40px);\n width: calc(100% - 40px);\n height: 32px;\n border-radius: 20px;\n padding: 2px 10px; }\n .bc-uploadFileDetails .bc-uploadedFile {\n max-width: 32px;\n max-height: 32px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadedFile .bc-imageFile {\n max-width: 100%;\n max-height: 100%;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadedFile .bc-documentFile {\n max-width: 100%;\n max-height: 100%;\n margin-top: 4px;\n min-width: 25px;\n min-height: 25px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileName {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileName span {\n padding: 10px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileCancel {\n cursor: pointer;\n margin-bottom: -6px; }\n\n.mic-container {\n position: relative; }\n .mic-container i {\n transition: 0.9s;\n z-index: 10;\n position: relative; }\n .mic-container .circle {\n z-index: 4;\n top: -2px;\n left: 2px;\n position: absolute;\n background-color: transparent;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 1;\n transition: 0.5s; }\n .mic-container .circle:before {\n content: "";\n width: 30px;\n height: 30px;\n border-radius: 50%;\n opacity: 0.5;\n z-index: 3;\n position: absolute; }\n .mic-container .circle.active {\n background-color: #A8E6A3; }\n .mic-container .circle.active:before {\n background: #A8E6A3; }\n\n@keyframes bounce {\n 0% {\n transform: scale(1); }\n 25% {\n transform: scale(1.4); }\n 75% {\n transform: scale(1); }\n 100% {\n transform: scale(1.3); } }\n');const ue=d.div`
|
|
148
147
|
width: calc(100% - 40px);
|
|
149
148
|
background-color: #d9d9d94d;
|
|
150
149
|
padding: 10px 20px;
|
|
@@ -251,7 +250,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
|
|
|
251
250
|
border-radius: 0px 0px 10px 10px;
|
|
252
251
|
opacity: 1;
|
|
253
252
|
}
|
|
254
|
-
`,Ee=i.forwardRef((({forRate:t},i)=>n(Le,{className:""+(t?"bc-ratingPositioning":""),children:[e("i",{}),e("span",{children:"Powered by Bread Crumbs"})]})));G('@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");\n:root {\n --bc-chat-font-stack: "Montserrat", sans-serif;\n --bc-chat-fontSize-xs: 10px;\n --bc-chat-fontSize-sm: 12px;\n --bc-chat-fontSize-md: 14px;\n --bc-chat-fontSize-lg: 18px;\n --bc-chat-fontSize-xl: 22px;\n --bc-chat-fontSize-xxl: 26px;\n --bc-chat-fontWeight-light: 100;\n --bc-chat-fontWeight-regular: 400;\n --bc-chat-fontWeight-medium: 500;\n --bc-chat-fontWeight-bold: 700;\n --bc-chat-lineHeight-xs: 18px;\n --bc-chat-lineHeight-sm: 22px;\n --bc-chat-lineHeight-md: 28px;\n --bc-chat-light-gray-color: #9b9b9b;\n --bc-chat-dark-gray-color: #4d4d4d;\n --bc-chat-other-message-border-color: #95D5B2;\n --bc-chat-other-message-background-start-color: #fff;\n --bc-chat-other-message-background-end-color: #fff;\n --bc-chat-other-message-text-color: #000;\n --bc-chat-my-message-border-color: #95D5B2;\n --bc-chat-my-message-background-start-color: #95D5B2;\n --bc-chat-my-message-background-end-color: #95D5B2;\n --bc-chat-my-message-text-color: #000;\n --bc-chat-danger-color: #d6312e;\n --bc-chat-success-color: #58aa18;\n --bc-chat-white-color: #fff;\n --bc-chat-radius: 5px
|
|
253
|
+
`,Ee=i.forwardRef((({forRate:t},i)=>n(Le,{className:""+(t?"bc-ratingPositioning":""),children:[e("i",{}),e("span",{children:"Powered by Bread Crumbs"})]})));G('@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");\n:root {\n --bc-chat-font-stack: "Montserrat", sans-serif;\n --bc-chat-fontSize-xs: 10px;\n --bc-chat-fontSize-sm: 12px;\n --bc-chat-fontSize-md: 14px;\n --bc-chat-fontSize-lg: 18px;\n --bc-chat-fontSize-xl: 22px;\n --bc-chat-fontSize-xxl: 26px;\n --bc-chat-fontWeight-light: 100;\n --bc-chat-fontWeight-regular: 400;\n --bc-chat-fontWeight-medium: 500;\n --bc-chat-fontWeight-bold: 700;\n --bc-chat-lineHeight-xs: 18px;\n --bc-chat-lineHeight-sm: 22px;\n --bc-chat-lineHeight-md: 28px;\n --bc-chat-light-gray-color: #9b9b9b;\n --bc-chat-dark-gray-color: #4d4d4d;\n --bc-chat-other-message-border-color: #95D5B2;\n --bc-chat-other-message-background-start-color: #fff;\n --bc-chat-other-message-background-end-color: #fff;\n --bc-chat-other-message-text-color: #000;\n --bc-chat-my-message-border-color: #95D5B2;\n --bc-chat-my-message-background-start-color: #95D5B2;\n --bc-chat-my-message-background-end-color: #95D5B2;\n --bc-chat-my-message-text-color: #000;\n --bc-chat-danger-color: #d6312e;\n --bc-chat-success-color: #58aa18;\n --bc-chat-white-color: #fff;\n --bc-chat-radius: 5px; }\n');const Se=d.div`
|
|
255
254
|
height: 100%;
|
|
256
255
|
display: flex;
|
|
257
256
|
flex-direction: column;
|
|
@@ -277,5 +276,5 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
|
|
|
277
276
|
line-height: inherit;
|
|
278
277
|
font-weight: inherit;
|
|
279
278
|
}
|
|
280
|
-
`,
|
|
279
|
+
`,De=({config:t={language:"EN",backgroundColor:"#dedede"},messages:i=[],sendMessage:o,debug:r,minimize:s,onReachingUp:c,agentsIdsAvatarsMap:l})=>{const[d,g]=a("MESSAGE_LIST"),p="interactive"===(i&&i.length>0&&i[i.length-1].type);return n(Se,{className:"bc-chat",children:[t.hideHeader?null:e(Ie,{config:t,minimize:s}),"MESSAGE_LIST"===d?e(W,{messages:i,sendMessage:o,debug:r,config:t,onReachingUp:c,agentsIdsAvatarsMap:l},"message-list"):null,p?e(Ee,{forRate:!0}):t.inputDisabled?null:e(xe,{sendMessage:o,setView:g,config:t},"message-input")]})};export{De as BCChat};
|
|
281
280
|
//# sourceMappingURL=index.es.js.map
|
package/build/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uzJAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBY,CAqB1D
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uzJAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBY,CAqB1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/index.js
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
background-repeat: no-repeat;
|
|
67
67
|
width: 15px;
|
|
68
68
|
height: 15px;
|
|
69
|
-
`,j={document:({message:n,config:t})=>{let i=n.content.split("/"),o=i[i.length-1];return e.jsx(y,{className:"bc-fileMessage",...n,isMyMessage:t.isAgent===n.isAgent,children:e.jsxs(A,{href:n.content,target:"_blank",download:o,rel:"noopener noreferrer",isMyMessage:t.isAgent===n.isAgent,children:[e.jsx(w,{color:(a=t.isAgent===n.isAgent,a.isAgent,"000000")}),e.jsx("span",{children:o})]})});var a},image:({message:n,config:t})=>e.jsx("div",{className:"bc-mediaMessage",style:{backgroundImage:h(t.isAgent===n.isAgent),color:x(t.isAgent===n.isAgent),borderColor:b(t.isAgent===n.isAgent),borderWidth:"1px",borderStyle:"solid",padding:0},children:e.jsx("a",{href:n.content,target:"_blank",rel:"noreferrer",children:e.jsx("img",{src:n.content,alt:"message content"})})}),location:({message:n,config:t})=>{return e.jsx(M,{href:"https://www.google.com/maps/?q="+n.content,target:"_blank",rel:"noopener noreferrer",className:"bc-locationMessage",isMyMessage:n.isAgent===t.isAgent,children:e.jsxs(k,{children:[e.jsx(L,{color:(i=t.isAgent===n.isAgent,i.isAgent,"000000")}),e.jsx(I,{color:x(t.isAgent===n.isAgent),children:"Open location"})]})});var i},text:({message:n,config:t})=>{const i=o.franc(n.content);return e.jsxs("div",{className:"bc-textMessage",style:{backgroundImage:h(t.isAgent===n.isAgent),color:x(t.isAgent===n.isAgent),borderColor:b(t.isAgent===n.isAgent),borderWidth:"1px",borderStyle:"solid",direction:"arb"===i?"rtl":"ltr",maxWidth:"80%"},children:[n.context&&n.context.replyToId?e.jsx(C,{context:n.context,isAgent:n.isAgent,language:i}):null,(n.content&&n.content.indexOf("\n")>-1?n.content.split("\n"):[n.content]).map(((t,i)=>e.jsx(d.default,{children:t},`${n.messageId}-${i}`)))]})},video:v,audio:v,interactive:null,template:({message:t,config:i})=>{const o=n.useMemo((()=>{try{return JSON.parse(t.content)}catch(e){return void console.log(e.message)}}),[t]);return e.jsxs("div",{style:{backgroundImage:h(i.isAgent===t.isAgent),color:x(i.isAgent===t.isAgent),borderColor:b(i.isAgent===t.isAgent),borderWidth:"1px",borderStyle:"solid"},children:[e.jsx("b",{children:"Template message:"})," ",o.name," ",o.language?.code?`/ ${o.language.code}`:null]})},note:({message:n})=>e.jsx("div",{children:n.content})},E=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M1.5 12.5L5.57574 16.5757C5.81005 16.8101 6.18995 16.8101 6.42426 16.5757L9 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M16 7L12 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M7 12L11.5757 16.5757C11.8101 16.8101 12.1899 16.8101 12.4243 16.5757L22 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),S={delivered:E,failed:()=>e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),read:E,sent:()=>e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M5 13L9 17L19 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),pending:()=>e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M7.50009 0.877014C3.84241 0.877014 0.877258 3.84216 0.877258 7.49984C0.877258 11.1575 3.8424 14.1227 7.50009 14.1227C11.1578 14.1227 14.1229 11.1575 14.1229 7.49984C14.1229 3.84216 11.1577 0.877014 7.50009 0.877014ZM1.82726 7.49984C1.82726 4.36683 4.36708 1.82701 7.50009 1.82701C10.6331 1.82701 13.1729 4.36683 13.1729 7.49984C13.1729 10.6328 10.6331 13.1727 7.50009 13.1727C4.36708 13.1727 1.82726 10.6328 1.82726 7.49984ZM8 4.50001C8 4.22387 7.77614 4.00001 7.5 4.00001C7.22386 4.00001 7 4.22387 7 4.50001V7.50001C7 7.63262 7.05268 7.7598 7.14645 7.85357L9.14645 9.85357C9.34171 10.0488 9.65829 10.0488 9.85355 9.85357C10.0488 9.65831 10.0488 9.34172 9.85355 9.14646L8 7.29291V4.50001Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})},z=({message:n})=>{if(!n.status)return null;const t=S[n.status];return e.jsx("div",{className:`status-icon ${n.status||""}`,children:e.jsx(t,{})})};function D(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}D("/* Shared styles between agent and client messages */\n.bc-otherMessage,\n.bc-myMessage {\n margin: 10px 15px;\n font-size: var(--bc-chat-fontSize-sm);\n}\n.bc-otherMessage div p,\n.bc-myMessage div p {\n padding: 0;\n margin: 0;\n}\n.bc-otherMessage > div,\n.bc-myMessage > div {\n display: inline-block;\n padding: 8px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n}\n.bc-otherMessage .bc-fileMessage,\n.bc-myMessage .bc-fileMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer;\n}\n.bc-otherMessage .bc-fileMessage img,\n.bc-myMessage .bc-fileMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 15px;\n height: 16px;\n}\n.bc-otherMessage .bc-locationMessage,\n.bc-myMessage .bc-locationMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer;\n}\n.bc-otherMessage .bc-locationMessage img,\n.bc-myMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px;\n}\n\n/* Styles for agent messages */\n.bc-otherMessage {\n text-align: left;\n display: flex;\n align-items: flex-end;\n flex-wrap: wrap;\n gap: 5px;\n}\n.bc-otherMessage:first-child {\n flex: 1 0 50%;\n}\n.bc-otherMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%;\n}\n.bc-otherMessage .bc-fileMessage,\n.bc-otherMessage .bc-locationMessage {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer;\n}\n.bc-otherMessage .bc-fileMessage img,\n.bc-otherMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px;\n}\n.bc-otherMessage > div,\n.bc-otherMessage .bc-fileMessage,\n.bc-otherMessage .bc-locationMessage,\n.bc-otherMessage audio {\n border-bottom-left-radius: 0;\n}\n\n/* Styles for other messages */\n.bc-note {\n text-align: center;\n gap: 5px;\n}\n.bc-note > div {\n display: inline-block;\n padding: 8px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n border: 1px solid #999;\n max-width: 60%;\n background-color: #fff3cd !important;\n}\n\n.bc-myMessage {\n text-align: right;\n}\n.bc-myMessage > div:not(.bc-debugCon),\n.bc-myMessage .bc-fileMessage,\n.bc-myMessage .bc-locationMessage,\n.bc-myMessage audio {\n color: #fff;\n border-bottom-right-radius: 0;\n}\n.bc-myMessage svg path:nth-child(2) {\n fill: #fff;\n}\n\n.bc-mediaMessage {\n position: relative;\n}\n.bc-mediaMessage video,\n.bc-mediaMessage img,\n.bc-mediaMessage audio {\n width: 300px;\n margin-bottom: -5px;\n}\n.bc-mediaMessage audio {\n -webkit-appearance: none;\n -webkit-border-radius: 0;\n border-radius: 0;\n}\n.bc-mediaMessage audio::-webkit-media-controls-panel {\n background-color: transparent;\n}\n.bc-mediaMessage audio::-webkit-media-controls-play-button {\n background-color: transparent;\n}\n.bc-mediaMessage audio::-webkit-media-controls-timeline {\n background-color: transparent;\n}\n.bc-mediaMessage audio::-webkit-media-controls-current-time-display, .bc-mediaMessage audio::-webkit-media-controls-time-remaining-display {\n color: inherit;\n}\n.bc-mediaMessage audio {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n height: 40px !important;\n width: 100% !important;\n max-width: 400px !important;\n position: static !important;\n -webkit-appearance: none !important;\n -webkit-border-radius: 0 !important;\n border-radius: 0 !important;\n}\n.bc-mediaMessage audio::-webkit-media-controls {\n display: flex !important;\n visibility: visible !important;\n opacity: 1 !important;\n}\n.bc-mediaMessage audio::-webkit-media-controls-panel {\n display: flex !important;\n visibility: visible !important;\n background-color: #f0f0f0 !important;\n opacity: 1 !important;\n}\n.bc-mediaMessage audio::-webkit-media-controls-play-button {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n}\n.bc-mediaMessage audio::-webkit-media-controls-timeline {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n}\n.bc-mediaMessage audio::-webkit-media-controls-volume-slider {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n}\n.bc-mediaMessage audio::-webkit-media-controls-current-time-display, .bc-mediaMessage audio::-webkit-media-controls-time-remaining-display {\n display: block !important;\n visibility: visible !important;\n color: #000 !important;\n}\n.bc-mediaMessage audio::-webkit-media-controls-mute-button {\n display: block !important;\n visibility: visible !important;\n}\n\n.bc-mediaMessage.audio {\n height: 40px;\n width: 300px;\n min-height: 40px !important;\n}\n.bc-mediaMessage.audio audio {\n height: 40px;\n}\n\n.bc-selectionContainer {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap;\n}\n\n.bc-selectionContainer:first-child {\n flex: 1 0 50%;\n}\n\n.status-icon {\n color: var(--bc-chat-light-gray-color) !important;\n}\n.status-icon.read {\n color: var(--bc-chat-success-color) !important;\n}\n.status-icon.failed {\n color: var(--bc-chat-danger-color) !important;\n}\n.status-icon.failed .resend {\n color: var(--bc-chat-dark-gray-color) !important;\n cursor: pointer;\n margin: 0 10px;\n}");const B=l.default.i`
|
|
69
|
+
`,j={document:({message:n,config:t})=>{let i=n.content.split("/"),o=i[i.length-1];return e.jsx(y,{className:"bc-fileMessage",...n,isMyMessage:t.isAgent===n.isAgent,children:e.jsxs(A,{href:n.content,target:"_blank",download:o,rel:"noopener noreferrer",isMyMessage:t.isAgent===n.isAgent,children:[e.jsx(w,{color:(a=t.isAgent===n.isAgent,a.isAgent,"000000")}),e.jsx("span",{children:o})]})});var a},image:({message:n,config:t})=>e.jsx("div",{className:"bc-mediaMessage",style:{backgroundImage:h(t.isAgent===n.isAgent),color:x(t.isAgent===n.isAgent),borderColor:b(t.isAgent===n.isAgent),borderWidth:"1px",borderStyle:"solid",padding:0},children:e.jsx("a",{href:n.content,target:"_blank",rel:"noreferrer",children:e.jsx("img",{src:n.content,alt:"message content"})})}),location:({message:n,config:t})=>{return e.jsx(M,{href:"https://www.google.com/maps/?q="+n.content,target:"_blank",rel:"noopener noreferrer",className:"bc-locationMessage",isMyMessage:n.isAgent===t.isAgent,children:e.jsxs(k,{children:[e.jsx(L,{color:(i=t.isAgent===n.isAgent,i.isAgent,"000000")}),e.jsx(I,{color:x(t.isAgent===n.isAgent),children:"Open location"})]})});var i},text:({message:n,config:t})=>{const i=o.franc(n.content);return e.jsxs("div",{className:"bc-textMessage",style:{backgroundImage:h(t.isAgent===n.isAgent),color:x(t.isAgent===n.isAgent),borderColor:b(t.isAgent===n.isAgent),borderWidth:"1px",borderStyle:"solid",direction:"arb"===i?"rtl":"ltr",maxWidth:"80%"},children:[n.context&&n.context.replyToId?e.jsx(C,{context:n.context,isAgent:n.isAgent,language:i}):null,(n.content&&n.content.indexOf("\n")>-1?n.content.split("\n"):[n.content]).map(((t,i)=>e.jsx(d.default,{children:t},`${n.messageId}-${i}`)))]})},video:v,audio:v,interactive:null,template:({message:t,config:i})=>{const o=n.useMemo((()=>{try{return JSON.parse(t.content)}catch(e){return void console.log(e.message)}}),[t]);return e.jsxs("div",{style:{backgroundImage:h(i.isAgent===t.isAgent),color:x(i.isAgent===t.isAgent),borderColor:b(i.isAgent===t.isAgent),borderWidth:"1px",borderStyle:"solid"},children:[e.jsx("b",{children:"Template message:"})," ",o.name," ",o.language?.code?`/ ${o.language.code}`:null]})},note:({message:n})=>e.jsx("div",{children:n.content})},E=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M1.5 12.5L5.57574 16.5757C5.81005 16.8101 6.18995 16.8101 6.42426 16.5757L9 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M16 7L12 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M7 12L11.5757 16.5757C11.8101 16.8101 12.1899 16.8101 12.4243 16.5757L22 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),S={delivered:E,failed:()=>e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),read:E,sent:()=>e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M5 13L9 17L19 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),pending:()=>e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M7.50009 0.877014C3.84241 0.877014 0.877258 3.84216 0.877258 7.49984C0.877258 11.1575 3.8424 14.1227 7.50009 14.1227C11.1578 14.1227 14.1229 11.1575 14.1229 7.49984C14.1229 3.84216 11.1577 0.877014 7.50009 0.877014ZM1.82726 7.49984C1.82726 4.36683 4.36708 1.82701 7.50009 1.82701C10.6331 1.82701 13.1729 4.36683 13.1729 7.49984C13.1729 10.6328 10.6331 13.1727 7.50009 13.1727C4.36708 13.1727 1.82726 10.6328 1.82726 7.49984ZM8 4.50001C8 4.22387 7.77614 4.00001 7.5 4.00001C7.22386 4.00001 7 4.22387 7 4.50001V7.50001C7 7.63262 7.05268 7.7598 7.14645 7.85357L9.14645 9.85357C9.34171 10.0488 9.65829 10.0488 9.85355 9.85357C10.0488 9.65831 10.0488 9.34172 9.85355 9.14646L8 7.29291V4.50001Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})},D=({message:n})=>{if(!n.status)return null;const t=S[n.status];return e.jsx("div",{className:`status-icon ${n.status||""}`,children:e.jsx(t,{})})};function z(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}z("/* Shared styles between agent and client messages */\n.bc-otherMessage,\n.bc-myMessage {\n margin: 10px 15px;\n font-size: var(--bc-chat-fontSize-sm);\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 5px; }\n .bc-otherMessage div p,\n .bc-myMessage div p {\n padding: 0;\n margin: 0; }\n .bc-otherMessage > div,\n .bc-myMessage > div {\n display: inline-block;\n padding: 8px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent; }\n .bc-otherMessage .bc-fileMessage,\n .bc-myMessage .bc-fileMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer; }\n .bc-otherMessage .bc-fileMessage img,\n .bc-myMessage .bc-fileMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 15px;\n height: 16px; }\n .bc-otherMessage .bc-locationMessage,\n .bc-myMessage .bc-locationMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer; }\n .bc-otherMessage .bc-locationMessage img,\n .bc-myMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n\n/* Styles for agent messages */\n.bc-otherMessage {\n justify-content: flex-start; }\n .bc-otherMessage:first-child {\n flex: 1 0 50%; }\n .bc-otherMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%; }\n .bc-otherMessage .bc-fileMessage,\n .bc-otherMessage .bc-locationMessage {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer; }\n .bc-otherMessage .bc-fileMessage img,\n .bc-otherMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n\n/* Styles for other messages */\n.bc-note {\n text-align: center;\n gap: 5px; }\n .bc-note > div {\n display: inline-block;\n padding: 8px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n border: 1px solid #999;\n max-width: 60%;\n background-color: #fff3cd !important; }\n\n.bc-myMessage {\n justify-content: flex-end; }\n .bc-myMessage > div:not(.bc-debugCon),\n .bc-myMessage .bc-fileMessage,\n .bc-myMessage .bc-locationMessage,\n .bc-myMessage audio {\n color: #fff; }\n .bc-myMessage svg path:nth-child(2) {\n fill: #fff; }\n\n.bc-mediaMessage {\n position: relative; }\n .bc-mediaMessage video,\n .bc-mediaMessage img,\n .bc-mediaMessage audio {\n width: 300px;\n margin-bottom: -5px; }\n .bc-mediaMessage audio {\n -webkit-appearance: none;\n -webkit-border-radius: 0;\n border-radius: 0; }\n .bc-mediaMessage audio::-webkit-media-controls-panel {\n background-color: transparent; }\n .bc-mediaMessage audio::-webkit-media-controls-play-button {\n background-color: transparent; }\n .bc-mediaMessage audio::-webkit-media-controls-timeline {\n background-color: transparent; }\n .bc-mediaMessage audio::-webkit-media-controls-current-time-display, .bc-mediaMessage audio::-webkit-media-controls-time-remaining-display {\n color: inherit; }\n .bc-mediaMessage audio {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n height: 40px !important;\n width: 100% !important;\n max-width: 400px !important;\n position: static !important;\n -webkit-appearance: none !important;\n -webkit-border-radius: 0 !important;\n border-radius: 0 !important; }\n .bc-mediaMessage audio::-webkit-media-controls {\n display: flex !important;\n visibility: visible !important;\n opacity: 1 !important; }\n .bc-mediaMessage audio::-webkit-media-controls-panel {\n display: flex !important;\n visibility: visible !important;\n background-color: #f0f0f0 !important;\n opacity: 1 !important; }\n .bc-mediaMessage audio::-webkit-media-controls-play-button {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important; }\n .bc-mediaMessage audio::-webkit-media-controls-timeline {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important; }\n .bc-mediaMessage audio::-webkit-media-controls-volume-slider {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important; }\n .bc-mediaMessage audio::-webkit-media-controls-current-time-display, .bc-mediaMessage audio::-webkit-media-controls-time-remaining-display {\n display: block !important;\n visibility: visible !important;\n color: #000 !important; }\n .bc-mediaMessage audio::-webkit-media-controls-mute-button {\n display: block !important;\n visibility: visible !important; }\n\n.bc-mediaMessage.audio {\n height: 40px;\n width: 300px;\n min-height: 40px !important; }\n .bc-mediaMessage.audio audio {\n height: 40px; }\n\n.bc-selectionContainer {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap; }\n\n.bc-selectionContainer:first-child {\n flex: 1 0 50%; }\n\n.status-icon {\n color: var(--bc-chat-light-gray-color) !important; }\n .status-icon.read {\n color: var(--bc-chat-success-color) !important; }\n .status-icon.failed {\n color: var(--bc-chat-danger-color) !important; }\n .status-icon.failed .resend {\n color: var(--bc-chat-dark-gray-color) !important;\n cursor: pointer;\n margin: 0 10px; }\n");const B=l.default.i`
|
|
70
70
|
background-image: url(${e=>e.avatar||p});
|
|
71
71
|
width: 30px;
|
|
72
72
|
height: 30px;
|
|
@@ -75,8 +75,7 @@
|
|
|
75
75
|
display: inline-block;
|
|
76
76
|
border-radius: 50%;
|
|
77
77
|
background-repeat: no-repeat;
|
|
78
|
-
|
|
79
|
-
`;function F(e,n,t){return"note"===e?"bc-note":t.isAgent?n?"bc-myMessage":"bc-otherMessage":n?"bc-otherMessage":"bc-myMessage"}const N=n=>{const{type:t,isAgent:i}=n.message,o=n.message.isAgent&&n.message.agentId&&n.agentsIdsAvatarsMap?.[n.message.agentId]||n.config?.brandLogo,a=j[t]??null;return a?(console.log(n.message.messageId,n.config.isAgent==n.message.isAgent&&"note"!==t),e.jsxs("div",{className:F(t,i,n.config),id:n.message.messageId,children:[n.config.isAgent==n.message.isAgent&&"note"!==t?e.jsx(z,{message:n.message,config:n.config}):null,e.jsx(a,{message:n.message,config:n.config}),n.config.isAgent&&i&&"note"!==t?e.jsx(B,{avatar:o}):null]})):null},R=l.default.div`
|
|
78
|
+
`;function F(e,n,t){return"note"===e?"bc-note":t.isAgent?n?"bc-myMessage":"bc-otherMessage":n?"bc-otherMessage":"bc-myMessage"}const R=n=>{const{type:t,isAgent:i}=n.message,o=n.message.isAgent&&n.message.agentId&&n.agentsIdsAvatarsMap?.[n.message.agentId]||n.config?.brandLogo,a=j[t]??null;return a?e.jsxs("div",{className:F(t,i,n.config),id:n.message.messageId,style:{flexDirection:"AR"===n.config.language?"row-reverse":"row"},children:[n.config.isAgent==n.message.isAgent&&"note"!==t?e.jsx(D,{message:n.message,config:n.config}):null,e.jsx(a,{message:n.message,config:n.config}),n.config.isAgent&&i&&"note"!==t?e.jsx(B,{avatar:o}):null]}):null},N=l.default.div`
|
|
80
79
|
width: 100%;
|
|
81
80
|
display: flex;
|
|
82
81
|
align-items: center;
|
|
@@ -89,7 +88,7 @@
|
|
|
89
88
|
align-items: center;
|
|
90
89
|
${e=>e.centered?"":e.isMyMessage?"margin-right: 44px;":"margin-left: 8px;"}
|
|
91
90
|
}
|
|
92
|
-
`,Z=({message:n,config:t})=>e.jsx("div",{children:e.jsx(
|
|
91
|
+
`,Z=({message:n,config:t})=>e.jsx("div",{children:e.jsx(N,{isMyMessage:n.isAgent===t.isAgent,centered:"note"===n.type,children:e.jsx("div",{className:"date-seperator-content",children:new Date(n.createdAt).toLocaleString("en-US")})})}),G=l.default.div`
|
|
93
92
|
width: 90%;
|
|
94
93
|
display: flex;
|
|
95
94
|
align-items: center;
|
|
@@ -112,7 +111,7 @@
|
|
|
112
111
|
background-size: 100% 100%;
|
|
113
112
|
background-image: ${e=>`url(${e.config.backgroundImage})`};
|
|
114
113
|
${e=>e.config.backgroundColor&&`background-color: ${e.config.backgroundColor};`}
|
|
115
|
-
`,T=({sendMessage:t,debug:i,config:o,messages:a,onReachingUp:r,agentsIdsAvatarsMap:s})=>{const c=n.useRef(null),l=n.useRef(0);return n.useEffect((()=>{const e=document.getElementById(u);if(!e)return;l.current=e.scrollHeight;const n=()=>{0===e.scrollTop&&r?.()};return e.addEventListener("scroll",n),()=>{e.removeEventListener("scroll",n)}}),[r]),n.useLayoutEffect((()=>{const e=c.current;if(!e)return;const n=l.current;if(e.scrollHeight-e.scrollTop<=e.clientHeight+200){const n=e.scrollHeight;e.style.scrollBehavior="smooth",e.style.overscrollBehavior="contain",e.scroll(0,n)}else{const t=e.scrollHeight-n;e.style.scrollBehavior="auto",e.scrollTop=e.scrollTop+t}l.current=e.scrollHeight}),[a]),e.jsx(K,{ref:c,id:u,config:o,children:a?.map(((n,r)=>"seperator"===n.type?e.jsx(J,{data:n,config:o}):e.jsxs("div",{children:[e.jsx(
|
|
114
|
+
`,T=({sendMessage:t,debug:i,config:o,messages:a,onReachingUp:r,agentsIdsAvatarsMap:s})=>{const c=n.useRef(null),l=n.useRef(0);return n.useEffect((()=>{const e=document.getElementById(u);if(!e)return;l.current=e.scrollHeight;const n=()=>{0===e.scrollTop&&r?.()};return e.addEventListener("scroll",n),()=>{e.removeEventListener("scroll",n)}}),[r]),n.useLayoutEffect((()=>{const e=c.current;if(!e)return;const n=l.current;if(e.scrollHeight-e.scrollTop<=e.clientHeight+200){const n=e.scrollHeight;e.style.scrollBehavior="smooth",e.style.overscrollBehavior="contain",e.scroll(0,n)}else{const t=e.scrollHeight-n;e.style.scrollBehavior="auto",e.scrollTop=e.scrollTop+t}l.current=e.scrollHeight}),[a]),e.jsx(K,{ref:c,id:u,config:o,children:a?.map(((n,r)=>"seperator"===n.type?e.jsx(J,{data:n,config:o}):e.jsxs("div",{children:[e.jsx(R,{message:n,index:r,sendMessage:t,messageActionsEnabled:a.length-1===r,debug:i,config:o,agentsIdsAvatarsMap:s}),e.jsx(Z,{message:n,config:o})]},n.messageId?n.messageId:"message"+r)))},u)},P="text";var H={EN:{share_my_location:"Share My Location",share_my_current_location:"Share My Current Location",placeholder:"Type a Message",see_your_location:"See Your Location",location_permission:"Please give location permission"},TR:{share_my_location:"Konumumu paylaş",share_my_current_location:"Güncel konumumu paylaş",placeholder:"Mesajınızı yazın",see_your_location:"Konumunuzu Görüntüleyin",location_permission:"Lütfen konum paylaşımı için izin verin"},DE:{share_my_location:"Standortfreigabe",share_my_current_location:"Meinen aktuellen Standort teilen",placeholder:"Geben Sie eine Nachricht ein",see_your_location:"Sehen Sie Ihren Standort",location_permission:"Bitte geben Sie Ihren Standort frei"}};const Q=l.default.span`
|
|
116
115
|
cursor: pointer;
|
|
117
116
|
width: 20px;
|
|
118
117
|
height: 20px;
|
|
@@ -144,7 +143,7 @@
|
|
|
144
143
|
cursor: pointer;
|
|
145
144
|
display: block;
|
|
146
145
|
}
|
|
147
|
-
`,de=({setView:t,setFile:i,setProgress:o,setError:a,text:r,setText:s,send:c})=>{const[l,d]=n.useState(!1);return e.jsxs("div",{className:"bc-inputActions",id:"bc-inputActions",children:[e.jsxs(le,{id:"iconsContainer",children:[e.jsx(ce,{setFile:i,setProgress:o,setError:a}),e.jsx(ae,{onClick:()=>d(!0)}),e.jsx(te,{setFile:i,setError:a,setProgress:o,send:c})]}),l?e.jsx(re,{text:r,setText:s,onClick:()=>d(!1)}):null]})};
|
|
146
|
+
`,de=({setView:t,setFile:i,setProgress:o,setError:a,text:r,setText:s,send:c})=>{const[l,d]=n.useState(!1);return e.jsxs("div",{className:"bc-inputActions",id:"bc-inputActions",children:[e.jsxs(le,{id:"iconsContainer",children:[e.jsx(ce,{setFile:i,setProgress:o,setError:a}),e.jsx(ae,{onClick:()=>d(!0)}),e.jsx(te,{setFile:i,setError:a,setProgress:o,send:c})]}),l?e.jsx(re,{text:r,setText:s,onClick:()=>d(!1)}):null]})};z('.bc-trademark {\n height: 40px;\n width: 100%;\n box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.1);\n background-color: #fff;\n overflow-y: hidden;\n border-bottom-left-radius: 15px;\n border-bottom-right-radius: 15px;\n padding: 15px 0; }\n\n.bc-messageInput {\n min-height: 30px;\n max-height: 100%;\n border: 1px solid #d9d9d9;\n background-color: #fff;\n overflow-y: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 20px; }\n .bc-messageInput .bc-messageInputTextArea {\n color: var(--bc-chat-dark-gray-color);\n display: block;\n min-height: 36px;\n background-color: #fff;\n box-sizing: border-box;\n font-size: var(--bc-chat-fontSize-md);\n padding: 10px 16px;\n resize: none;\n overflow: auto;\n border-width: 0;\n width: calc(100% - 20px);\n word-wrap: break-word;\n border: none;\n overflow: hidden;\n outline: none;\n -webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none; }\n\n.bc-inputActions {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n height: 38px; }\n .bc-inputActions .bc-fileUpload {\n display: none; }\n .bc-inputActions i {\n display: block;\n margin: 0 5px; }\n\n.bc-emojiPicker {\n position: absolute;\n bottom: 40px;\n right: 0;\n width: 200px;\n background: #ffffff 0% 0% no-repeat padding-box;\n box-shadow: 0px 0px 15px #0000001a;\n border-radius: 10px;\n opacity: 1;\n padding: 10px;\n z-index: 10;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap; }\n\n.bc-uploadFileDetails {\n background-color: transparent;\n display: flex;\n align-items: center;\n max-width: calc(100% - 40px);\n width: calc(100% - 40px);\n height: 32px;\n border-radius: 20px;\n padding: 2px 10px; }\n .bc-uploadFileDetails .bc-uploadedFile {\n max-width: 32px;\n max-height: 32px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadedFile .bc-imageFile {\n max-width: 100%;\n max-height: 100%;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadedFile .bc-documentFile {\n max-width: 100%;\n max-height: 100%;\n margin-top: 4px;\n min-width: 25px;\n min-height: 25px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileName {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileName span {\n padding: 10px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileCancel {\n cursor: pointer;\n margin-bottom: -6px; }\n\n.mic-container {\n position: relative; }\n .mic-container i {\n transition: 0.9s;\n z-index: 10;\n position: relative; }\n .mic-container .circle {\n z-index: 4;\n top: -2px;\n left: 2px;\n position: absolute;\n background-color: transparent;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 1;\n transition: 0.5s; }\n .mic-container .circle:before {\n content: "";\n width: 30px;\n height: 30px;\n border-radius: 50%;\n opacity: 0.5;\n z-index: 3;\n position: absolute; }\n .mic-container .circle.active {\n background-color: #A8E6A3; }\n .mic-container .circle.active:before {\n background: #A8E6A3; }\n\n@keyframes bounce {\n 0% {\n transform: scale(1); }\n 25% {\n transform: scale(1.4); }\n 75% {\n transform: scale(1); }\n 100% {\n transform: scale(1.3); } }\n');const ge=l.default.div`
|
|
148
147
|
width: calc(100% - 40px);
|
|
149
148
|
background-color: #d9d9d94d;
|
|
150
149
|
padding: 10px 20px;
|
|
@@ -251,7 +250,7 @@
|
|
|
251
250
|
border-radius: 0px 0px 10px 10px;
|
|
252
251
|
opacity: 1;
|
|
253
252
|
}
|
|
254
|
-
`,Ae=c.default.forwardRef((({forRate:n},t)=>e.jsxs(we,{className:""+(n?"bc-ratingPositioning":""),children:[e.jsx("i",{}),e.jsx("span",{children:"Powered by Bread Crumbs"})]})));
|
|
253
|
+
`,Ae=c.default.forwardRef((({forRate:n},t)=>e.jsxs(we,{className:""+(n?"bc-ratingPositioning":""),children:[e.jsx("i",{}),e.jsx("span",{children:"Powered by Bread Crumbs"})]})));z('@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");\n:root {\n --bc-chat-font-stack: "Montserrat", sans-serif;\n --bc-chat-fontSize-xs: 10px;\n --bc-chat-fontSize-sm: 12px;\n --bc-chat-fontSize-md: 14px;\n --bc-chat-fontSize-lg: 18px;\n --bc-chat-fontSize-xl: 22px;\n --bc-chat-fontSize-xxl: 26px;\n --bc-chat-fontWeight-light: 100;\n --bc-chat-fontWeight-regular: 400;\n --bc-chat-fontWeight-medium: 500;\n --bc-chat-fontWeight-bold: 700;\n --bc-chat-lineHeight-xs: 18px;\n --bc-chat-lineHeight-sm: 22px;\n --bc-chat-lineHeight-md: 28px;\n --bc-chat-light-gray-color: #9b9b9b;\n --bc-chat-dark-gray-color: #4d4d4d;\n --bc-chat-other-message-border-color: #95D5B2;\n --bc-chat-other-message-background-start-color: #fff;\n --bc-chat-other-message-background-end-color: #fff;\n --bc-chat-other-message-text-color: #000;\n --bc-chat-my-message-border-color: #95D5B2;\n --bc-chat-my-message-background-start-color: #95D5B2;\n --bc-chat-my-message-background-end-color: #95D5B2;\n --bc-chat-my-message-text-color: #000;\n --bc-chat-danger-color: #d6312e;\n --bc-chat-success-color: #58aa18;\n --bc-chat-white-color: #fff;\n --bc-chat-radius: 5px; }\n');const Me=l.default.div`
|
|
255
254
|
height: 100%;
|
|
256
255
|
display: flex;
|
|
257
256
|
flex-direction: column;
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;s8JAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBY,CAqB1D
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;s8JAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBY,CAqB1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,113 +1,114 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@bcrumbs.net/bc-chat",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"main": "build/index.js",
|
|
5
|
-
"module": "build/index.es.js",
|
|
6
|
-
"jsnext:main": "build/index.es.js",
|
|
7
|
-
"engines": {
|
|
8
|
-
"node": ">=20",
|
|
9
|
-
"npm": ">=10"
|
|
10
|
-
},
|
|
11
|
-
"keywords": [
|
|
12
|
-
"Bread Crumbs",
|
|
13
|
-
"BC-Chat"
|
|
14
|
-
],
|
|
15
|
-
"author": "Ahmad Mhaish",
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"@azure/storage-blob": "^12.26.0",
|
|
19
|
-
"@emotion/react": "^11.11.3",
|
|
20
|
-
"@emotion/styled": "11.11.0",
|
|
21
|
-
"@react-google-maps/api": "^2.19.3",
|
|
22
|
-
"@types/node": "^16.18.119",
|
|
23
|
-
"@types/react": "^18.3.1",
|
|
24
|
-
"@types/react-dom": "^18.3.0",
|
|
25
|
-
"ajv": "^8.17.1",
|
|
26
|
-
"ajv-keywords": "^5.1.0",
|
|
27
|
-
"franc-min": "^6.2.0",
|
|
28
|
-
"mapbox-gl": "^1.13.0",
|
|
29
|
-
"mediaelement": "^4.2.14",
|
|
30
|
-
"react-input-mask": "^2.0.4",
|
|
31
|
-
"react-mapbox-gl": "^3.9.2",
|
|
32
|
-
"react-markdown": "^9.0.1",
|
|
33
|
-
"react-phone-number-input": "^3.1.9",
|
|
34
|
-
"react-redux": "^5.1.1",
|
|
35
|
-
"react-tippy": "^1.4.0",
|
|
36
|
-
"redux": "^4.0.1",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"react
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"lib
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"react-app
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
"not
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"last 1
|
|
70
|
-
"last 1
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"@babel/preset-
|
|
76
|
-
"@
|
|
77
|
-
"@rollup/plugin-
|
|
78
|
-
"@rollup/plugin-
|
|
79
|
-
"@
|
|
80
|
-
"@svgr/
|
|
81
|
-
"
|
|
82
|
-
"babel-
|
|
83
|
-
"babel-plugin-
|
|
84
|
-
"babel-plugin-transform-
|
|
85
|
-
"babel-
|
|
86
|
-
"babel-preset-
|
|
87
|
-
"babel-preset-
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"react
|
|
93
|
-
"react-
|
|
94
|
-
"
|
|
95
|
-
"redux-
|
|
96
|
-
"
|
|
97
|
-
"rollup
|
|
98
|
-
"rollup-plugin-
|
|
99
|
-
"rollup-plugin-
|
|
100
|
-
"rollup-plugin-
|
|
101
|
-
"rollup-plugin-
|
|
102
|
-
"rollup-plugin-
|
|
103
|
-
"rollup-plugin-
|
|
104
|
-
"rollup-plugin-
|
|
105
|
-
"rollup-plugin-
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@bcrumbs.net/bc-chat",
|
|
3
|
+
"version": "1.0.52",
|
|
4
|
+
"main": "build/index.js",
|
|
5
|
+
"module": "build/index.es.js",
|
|
6
|
+
"jsnext:main": "build/index.es.js",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=20",
|
|
9
|
+
"npm": ">=10"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"Bread Crumbs",
|
|
13
|
+
"BC-Chat"
|
|
14
|
+
],
|
|
15
|
+
"author": "Ahmad Mhaish",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@azure/storage-blob": "^12.26.0",
|
|
19
|
+
"@emotion/react": "^11.11.3",
|
|
20
|
+
"@emotion/styled": "11.11.0",
|
|
21
|
+
"@react-google-maps/api": "^2.19.3",
|
|
22
|
+
"@types/node": "^16.18.119",
|
|
23
|
+
"@types/react": "^18.3.1",
|
|
24
|
+
"@types/react-dom": "^18.3.0",
|
|
25
|
+
"ajv": "^8.17.1",
|
|
26
|
+
"ajv-keywords": "^5.1.0",
|
|
27
|
+
"franc-min": "^6.2.0",
|
|
28
|
+
"mapbox-gl": "^1.13.0",
|
|
29
|
+
"mediaelement": "^4.2.14",
|
|
30
|
+
"react-input-mask": "^2.0.4",
|
|
31
|
+
"react-mapbox-gl": "^3.9.2",
|
|
32
|
+
"react-markdown": "^9.0.1",
|
|
33
|
+
"react-phone-number-input": "^3.1.9",
|
|
34
|
+
"react-redux": "^5.1.1",
|
|
35
|
+
"react-tippy": "^1.4.0",
|
|
36
|
+
"redux": "^4.0.1",
|
|
37
|
+
"rehype-raw": "^7.0.0",
|
|
38
|
+
"rollup-plugin-ignore-import": "^1.3.2",
|
|
39
|
+
"uuid": "^8.3.2",
|
|
40
|
+
"web-vitals": "^2.1.4"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"react": "18.3.1",
|
|
44
|
+
"react-dom": "18.3.1"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"start": "react-scripts start",
|
|
48
|
+
"build": "react-scripts build",
|
|
49
|
+
"test": "react-scripts test",
|
|
50
|
+
"eject": "react-scripts eject",
|
|
51
|
+
"coverage": "npm test -- --coverage --watchAll",
|
|
52
|
+
"build-lib": "rm -rf build && rollup -c",
|
|
53
|
+
"lib-watch": "rm -rf build && rollup -c -w",
|
|
54
|
+
"format": "prettier --write 'src/**/*.{ts,tsx,js}'"
|
|
55
|
+
},
|
|
56
|
+
"eslintConfig": {
|
|
57
|
+
"extends": [
|
|
58
|
+
"react-app",
|
|
59
|
+
"react-app/jest"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"browserslist": {
|
|
63
|
+
"production": [
|
|
64
|
+
">0.2%",
|
|
65
|
+
"not dead",
|
|
66
|
+
"not op_mini all"
|
|
67
|
+
],
|
|
68
|
+
"development": [
|
|
69
|
+
"last 1 chrome version",
|
|
70
|
+
"last 1 firefox version",
|
|
71
|
+
"last 1 safari version"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@babel/preset-react": "^7.25.9",
|
|
76
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
77
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
78
|
+
"@rollup/plugin-commonjs": "^28.0.1",
|
|
79
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
80
|
+
"@svgr/rollup": "8.1.0",
|
|
81
|
+
"@svgr/webpack": "8.0.1",
|
|
82
|
+
"babel-core": "^6.26.3",
|
|
83
|
+
"babel-plugin-external-helpers": "^6.22.0",
|
|
84
|
+
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
85
|
+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
|
86
|
+
"babel-preset-env": "^1.7.0",
|
|
87
|
+
"babel-preset-react": "^6.24.1",
|
|
88
|
+
"babel-preset-stage-0": "^6.24.1",
|
|
89
|
+
"browserslist": "^4.16.1",
|
|
90
|
+
"chance": "^1.1.7",
|
|
91
|
+
"prettier": "2.3.1",
|
|
92
|
+
"react": "^18.3.1",
|
|
93
|
+
"react-dom": "^18.3.1",
|
|
94
|
+
"react-scripts": "5.0.1",
|
|
95
|
+
"redux-mock-store": "^1.5.4",
|
|
96
|
+
"redux-thunk": "^2.3.0",
|
|
97
|
+
"rollup": "^2.79.1",
|
|
98
|
+
"rollup-plugin-copy-assets-to": "^1.0.0",
|
|
99
|
+
"rollup-plugin-dts": "^6.1.1",
|
|
100
|
+
"rollup-plugin-ignore": "^1.0.9",
|
|
101
|
+
"rollup-plugin-json": "^4.0.0",
|
|
102
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
103
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
104
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
105
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
106
|
+
"rollup-plugin-url": "^1.4.0",
|
|
107
|
+
"sass": "^1.89.2",
|
|
108
|
+
"typescript": "^4.9.5"
|
|
109
|
+
},
|
|
110
|
+
"files": [
|
|
111
|
+
"build/**/*"
|
|
112
|
+
],
|
|
113
|
+
"types": "build/index.d.ts"
|
|
114
|
+
}
|