@bcrumbs.net/bc-chat 1.0.44 → 1.0.45

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 CHANGED
@@ -1,49 +1,49 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { MessageDto, MessageStatus } from 'graphql.autogenerated';
3
3
 
4
- declare const MessageType: {
5
- readonly AUDIO: "audio";
6
- readonly DOCUMENT: "document";
7
- readonly IMAGE: "image";
8
- readonly INTERACTIVE: "interactive";
9
- readonly LOCATION: "location";
10
- readonly NOTE: "note";
11
- readonly TEMPLATE: "template";
12
- readonly TEXT: "text";
13
- readonly VIDEO: "video";
14
- };
4
+ declare const MessageType: {
5
+ readonly AUDIO: "audio";
6
+ readonly DOCUMENT: "document";
7
+ readonly IMAGE: "image";
8
+ readonly INTERACTIVE: "interactive";
9
+ readonly LOCATION: "location";
10
+ readonly NOTE: "note";
11
+ readonly TEMPLATE: "template";
12
+ readonly TEXT: "text";
13
+ readonly VIDEO: "video";
14
+ };
15
15
  type MessageType = typeof MessageType[keyof typeof MessageType];
16
16
 
17
- type Lang = "EN" | "AR" | "TR";
18
- type ChatConfig = {
19
- backgroundImage?: string;
20
- backgroundColor?: string;
21
- brandLogo?: string;
22
- brandName?: string;
23
- inputPlaceholder?: string;
24
- whiteLabeled?: boolean;
25
- inputDisabled?: boolean;
26
- language?: Lang;
27
- hideHeader?: boolean;
28
- };
29
- type UtilMessage = {
30
- type: 'seperator';
31
- content?: string;
32
- };
33
- type ChatMessage = Partial<MessageDto> & {
34
- status?: MessageStatus;
35
- agentId?: string;
17
+ type Lang = "EN" | "AR" | "TR";
18
+ type ChatConfig = {
19
+ backgroundImage?: string;
20
+ backgroundColor?: string;
21
+ brandLogo?: string;
22
+ brandName?: string;
23
+ inputPlaceholder?: string;
24
+ whiteLabeled?: boolean;
25
+ inputDisabled?: boolean;
26
+ language?: Lang;
27
+ hideHeader?: boolean;
28
+ };
29
+ type UtilMessage = {
30
+ type: 'seperator';
31
+ content?: string;
32
+ };
33
+ type ChatMessage = Partial<MessageDto> & {
34
+ status?: MessageStatus;
35
+ agentId?: string;
36
36
  };
37
37
 
38
- interface ChatProps {
39
- config?: ChatConfig;
40
- messages?: (ChatMessage | UtilMessage)[];
41
- sendMessage: (type: MessageType, messageContent: string) => void;
42
- onReachingUp?: () => void;
43
- minimize?: () => void;
44
- debug?: boolean;
45
- agentsIdsAvatarsMap?: Record<string, string>;
46
- }
38
+ interface ChatProps {
39
+ config?: ChatConfig;
40
+ messages?: (ChatMessage | UtilMessage)[];
41
+ sendMessage: (type: MessageType, messageContent: string) => void;
42
+ onReachingUp?: () => void;
43
+ minimize?: () => void;
44
+ debug?: boolean;
45
+ agentsIdsAvatarsMap?: Record<string, string>;
46
+ }
47
47
  declare const Chat: ({ config, messages, sendMessage, debug, minimize, onReachingUp, agentsIdsAvatarsMap, }: ChatProps) => react_jsx_runtime.JSX.Element;
48
48
 
49
49
  export { Chat as BCChat };
package/build/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCallback as o,useState as a,useRef as r,useEffect as c,useMemo as s,useLayoutEffect as l}from"react";import d from"@emotion/styled";import g from"react-markdown";import{franc as p}from"franc-min";import{v4 as h}from"uuid";import{BlobServiceClient as m,AnonymousCredential as u}from"@azure/storage-blob";const b={MaxFileSize:52428800,SupportedFormats:["png","jpg","jpeg","gif","bmp","pdf","doc","xls","xlsx","docx","ppt","pptx","avi","m4a","m4v","mov","mp4","wav","wma","wmv"],SupportedImageFormats:["png","jpg","jpeg","gif","bmp","webp"],SupportedAudioFormats:["mp3","acc","m4a","ogg","amr"]},x="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAABBCAYAAACO98lFAAAACXBIWXMAAAsSAAALEgHS3X78AAAFa0lEQVR42u2bX0xTVxzHvzqqVOqQrtJC2gmF4ooMWNg6FEJE3NhCl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Xe5YR5N4qrHGtea5+51cdpvpKmJOXynxf8aE2oUOZz2Ied1sPOM5lc9VsIV1qlWE/P+YJzigrBJW8ppM48mUd/VNGcQjlEvDjmvE67AJ9t3B1zigqCTawhV2DIWQH1XExyj3tjyj4E27Lp9Gswjrp/vyCnjvaqfinMnJERP+LxkM1qufMsJVpaxACydP2HbyjzUaEqgfTGTSME7/H/iylAv4QLTN0I+8fWyq1OcypJMIsXh14zY0tFEjDXet6Pxvv1xbiFLWgr3eBB3JtmI65WnKLD/za0xaxeiuSwVK/NwrHgT57SYaZaxAMyjvlkBfF1u4k2Svr/dLEhVSlAIVr+d0y5TF+KYYeu8lZ9d6uKIAFo93YJJ7oK6Q2PfNaKSpJNrcLSyDpcc7TjtuhmT+mxS6fHhK5XIkPHD6wu4sdd2XrD3Fjwm7Gw/iWOGrYQgWq01oFprgI9l0D3kgD80DEfQj+DUBFTJqVBKU5GTqkKRUhdVH+gLuLGz/aSgxVnBIQxNTUYEAfxbbY70C89mrZ5u7LWdF7w6nZDAODQ1ifctDThjvybIemw4hH1tjdhp/SUh5fmEfp9Qb29Bk+sWduSURa1SRzIfy+CyqzPmOuZTh+APjRCnQTBMvqhtIojdvRdR0N+K9StzUKTIgnZFJq9LTJfsHSODaB2y48KwF0/DFtE/h1JliUKgECgECoFCoBAi2D8QCAe+XuY7HAAAAABJRU5ErkJggg==",C=["🤓","🙃","😕","â˜šī¸","😲","đŸ˜ŗ","😠","😇","😀","😁","😂","đŸ¤Ŗ","😃","😄","😅","😆","😉","😊","😏","đŸ˜Ŗ","đŸ˜Ĩ","😮","😴","😌","😋","😎","😍","🙂","🤗","🤔","😐","😑","đŸ˜ļ","🙄"],f="bc-message-list-content";function v(e){return e.isAgent?"linear-gradient(104deg,var(--bc-chat-agent-message-background-start-color),var(--bc-chat-agent-message-background-end-color))":"linear-gradient(104deg,var(--bc-chat-client-message-background-start-color),var(--bc-chat-client-message-background-end-color))"}function w(e){return e.isAgent?"var(--bc-chat-agent-message-border-color)":"var(--bc-chat-client-message-border-color)"}function A(e){return e.isAgent?"var(--bc-chat-agent-message-text-color)":"var(--bc-chat-client-message-text-color)"}const y=d.div`
1
+ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCallback as o,useState as a,useRef as r,useEffect as c,useMemo as s,useLayoutEffect as l}from"react";import d from"@emotion/styled";import g from"react-markdown";import{franc as p}from"franc-min";import{v4 as m}from"uuid";import{BlobServiceClient as h,AnonymousCredential as b}from"@azure/storage-blob";const u={MaxFileSize:52428800,SupportedFormats:["png","jpg","jpeg","gif","bmp","pdf","doc","xls","xlsx","docx","ppt","pptx","avi","m4a","m4v","mov","mp4","wav","wma","wmv"],SupportedImageFormats:["png","jpg","jpeg","gif","bmp","webp"],SupportedAudioFormats:["mp3","acc","m4a","ogg","amr"]},x="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAABBCAYAAACO98lFAAAACXBIWXMAAAsSAAALEgHS3X78AAAFa0lEQVR42u2bX0xTVxzHvzqqVOqQrtJC2gmF4ooMWNg6FEJE3NhClpnG8aBzsTHugbgsLltiJg/6NI3J5pLFLbpIIjEjLuriiH9qnESlI6BQWcGsSEvT2lK8q0CvFChme1hwXs5tKfTWXfT83s6fe3Lz6fn9zvl9f7eL9L/u/xvPuS0GNQqBQqAQKAQKYaYlzfdBk0qPtzRFnL7L7ttoGLzz/EBQSlNRrMzj9HUzA9QdaEygECgECoFCoBAoBAqBQqAQKASaRQph6UlLUCJToCjtZcgkydCmqh6PPQyPo39kEP7QCDoeeGCbCD5bEN5dkQljlgFl6sKo854c97EMfvf2osl1K+FAEgqhPEWBuvyNRModi2XIFDDmVcCYV4FLjnZ8Zf8NQ1OTCysmmFR6HK2smxeAmVatNaC56lPUKrIXzk74Jv8dVGsNEcfZcAh3A25OX4pECp1cE/EZmUSKfaXbUGi/hnp7i7gh7Mku5QXAhkMwOztw8Z4NNx4yEZ+vVWRjbfrqiBCNeRVISUrG7t6L4oRQqMji3f4nesw47u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hdVH+gLuLGz/aSgxVnBIQxNTUYEAfxbbY70C89mrZ5u7LWdF7w6nZDAODQ1ifctDThjvybIemw4hH1tjdhp/SUh5fmEfp9Qb29Bk+sWduSURa1SRzIfy+CyqzPmOuZTh+APjRCnQTBMvqhtIojdvRdR0N+K9StzUKTIgnZFJq9LTJfsHSODaB2y48KwF0/DFtE/h1JliUKgECgECoFCoBAi2D8QCAe+XuY7HAAAAABJRU5ErkJggg==",C=["🤓","🙃","😕","â˜šī¸","😲","đŸ˜ŗ","😠","😇","😀","😁","😂","đŸ¤Ŗ","😃","😄","😅","😆","😉","😊","😏","đŸ˜Ŗ","đŸ˜Ĩ","😮","😴","😌","😋","😎","😍","🙂","🤗","🤔","😐","😑","đŸ˜ļ","🙄"],f="bc-message-list-content";function v(e){return e.isAgent?"linear-gradient(104deg,var(--bc-chat-agent-message-background-start-color),var(--bc-chat-agent-message-background-end-color))":"linear-gradient(104deg,var(--bc-chat-client-message-background-start-color),var(--bc-chat-client-message-background-end-color))"}function w(e){return e.isAgent?"var(--bc-chat-agent-message-border-color)":"var(--bc-chat-client-message-border-color)"}function y(e){return e.isAgent?"var(--bc-chat-agent-message-text-color)":"var(--bc-chat-client-message-text-color)"}const A=d.div`
2
2
  padding: 8px;
3
3
  margin-bottom: 4px;
4
4
  ${e=>e.isAgent?"border-left: 2px solid #ccc;":"border-right: 2px solid #777;"}
@@ -11,9 +11,9 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
11
11
  white-space: nowrap;
12
12
  direction: ${e=>"arb"===e.language?"rtl":"ltr"};
13
13
  cursor: pointer;
14
- `,I=({className:n,context:t,isAgent:i,language:a})=>{const r=o((()=>{const e=document.getElementById(f),n=document.getElementById(t.replyToId);e&&n&&(e.style.scrollBehavior="smooth",n.scrollIntoView())}),[t.replyToId]);return e(y,{className:n,isAgent:i,language:a,onClick:r,children:"image"===t.replyToType?e("img",{src:t.replyToContent,alt:"Media preview",style:{width:"30px",height:"30px",objectFit:"cover",marginLeft:"8px",verticalAlign:"middle"}}):t.replyToContent})},M=({message:t})=>{const[i,o]=a(!1),s=r(null);return c((()=>{const e=()=>{document.querySelectorAll("video, audio").forEach((e=>{e!==s.current&&e.pause()}))},n=s.current;return n&&n.addEventListener("play",e),()=>{n&&n.removeEventListener("play",e)}}),[]),i?n("div",{className:"bc-mediaMessage"+("audio"===t.type?" audio":""),style:{padding:"10px",border:"1px solid #ccc",borderRadius:"4px",backgroundColor:"#f8f8f8"},children:[n("p",{style:{margin:0,color:"#666"},children:["Unable to load ","audio"===t.type?"audio":"video"," file."]}),n("a",{href:t.content,target:"_blank",rel:"noopener noreferrer",style:{color:"#007bff",textDecoration:"none"},children:["Open ","audio"===t.type?"audio":"video"," in new tab"]})]}):e("div",{className:"bc-mediaMessage"+("audio"===t.type?" audio":""),style:{padding:0,position:"relative"},children:e("video",{ref:s,src:t.content,controls:!0,preload:"metadata",playsInline:!0,onError:()=>{o(!0)},style:{width:"100%",maxWidth:"400px",height:"auto",opacity:1}})})},k=d.div`
14
+ `,M=({className:n,context:t,isAgent:i,language:a})=>{const r=o((()=>{const e=document.getElementById(f),n=document.getElementById(t.replyToId);e&&n&&(e.style.scrollBehavior="smooth",n.scrollIntoView())}),[t.replyToId]);return e(A,{className:n,isAgent:i,language:a,onClick:r,children:"image"===t.replyToType?e("img",{src:t.replyToContent,alt:"Media preview",style:{width:"30px",height:"30px",objectFit:"cover",marginLeft:"8px",verticalAlign:"middle"}}):t.replyToContent})},k=({message:t})=>{const[i,o]=a(!1),[s,l]=a(!0),d=r(null),g=()=>{const e=d.current;e&&console.error("Media playback error:",{src:e.src,error:e.error,networkState:e.networkState,readyState:e.readyState,messageType:t.type}),o(!0),l(!1)},p=()=>{console.log("Media loaded successfully:",t.content),l(!1)},m=()=>{console.log("Media can play:",t.content),l(!1)},h=()=>{console.log("Media load started:",t.content)};return c((()=>{console.log("MediaMessage component mounted for:",t.content,"type:",t.type);const e=()=>{document.querySelectorAll("video, audio").forEach((e=>{e!==d.current&&e.pause()}))},n=d.current;if(n){n.addEventListener("play",e),n.addEventListener("loadeddata",p),n.addEventListener("canplay",m),n.addEventListener("error",g),n.addEventListener("loadstart",h);const i=setTimeout((()=>{console.log("Loading timeout reached for:",t.content),l(!1)}),5e3);return()=>{n&&(n.removeEventListener("play",e),n.removeEventListener("loadeddata",p),n.removeEventListener("canplay",m),n.removeEventListener("error",g),n.removeEventListener("loadstart",h)),clearTimeout(i)}}}),[t.content]),i?n("div",{className:"bc-mediaMessage"+("audio"===t.type?" audio":""),style:{padding:"10px",border:"1px solid #ccc",borderRadius:"4px",backgroundColor:"#f8f8f8"},children:[n("p",{style:{margin:0,color:"#666"},children:["Unable to load ","audio"===t.type?"audio":"video"," file."]}),n("a",{href:t.content,target:"_blank",rel:"noopener noreferrer",style:{color:"#007bff",textDecoration:"none"},children:["Open ","audio"===t.type?"audio":"video"," in new tab"]})]}):"audio"===t.type?n("div",{className:"bc-mediaMessage audio",children:[e("audio",{ref:d,src:t.content,controls:!0,preload:"metadata",onError:g,onLoadedData:p,onCanPlay:m,onLoadStart:h}),s&&e("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:"14px",zIndex:1},children:"Loading audio..."})]}):n("div",{className:"bc-mediaMessage",children:[e("video",{ref:d,src:t.content,controls:!0,preload:"metadata",playsInline:!0,onError:g,onLoadedData:p,onCanPlay:m,onLoadStart:h}),s&&e("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:"14px",zIndex:1},children:"Loading video..."})]})},I=d.div`
15
15
  background-image: ${e=>v(e)};
16
- color: ${e=>A(e)};
16
+ color: ${e=>y(e)};
17
17
  border-color: ${e=>w(e)};
18
18
  border-width: 1px;
19
19
  border-style: solid;
@@ -36,12 +36,12 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
36
36
  align-item: center;
37
37
  text-decoration: auto;
38
38
  gap: 5px;
39
- color: ${e=>`${A(e)}`};
39
+ color: ${e=>`${y(e)}`};
40
40
  font-size: var(--bc-chat-fontSize-sm);
41
41
  `,S=d.a`
42
42
  font-size: var(--bc-chat-fontSize-sm);
43
43
  background-image: ${e=>v(e)};
44
- color: ${e=>A(e)};
44
+ color: ${e=>y(e)};
45
45
  border-color: ${e=>w(e)};
46
46
  border-width: 1px;
47
47
  border-style: solid;
@@ -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
- `,D=d.div`
55
+ `,z=d.div`
56
56
  display: flex;
57
57
  flex-direction: row;
58
58
  align-items: center;
59
59
  gap: 5px;
60
- `,z=d.span`
60
+ `,D=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})=>{let i=t.content.split("/"),o=i[i.length-1];return e(k,{className:"bc-fileMessage",...t,children:n(E,{href:t.content,target:"_blank",download:o,rel:"noopener noreferrer",...t,children:[e(L,{color:(a=t,a.isAgent,"000000")}),e("span",{children:o})]})});var a},image:({message:n})=>e("div",{className:"bc-mediaMessage",style:{backgroundImage:v(n),color:A(n),borderColor:w(n),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})=>{return e(S,{href:"https://www.google.com/maps/?q="+t.content,target:"_blank",rel:"noopener noreferrer",className:"bc-locationMessage",isAgent:t.isAgent,children:n(D,{children:[e(B,{color:(i=t,i.isAgent,"000000")}),e(z,{color:A(t),children:"Open location"})]})});var i},text:({message:t})=>{const i=p(t.content);return n("div",{className:"bc-textMessage",style:{backgroundImage:v(t),color:A(t),borderColor:w(t),borderWidth:"1px",borderStyle:"solid",direction:"arb"===i?"rtl":"ltr"},children:[t.context&&t.context.replyToId?e(I,{context:t.context,isAgent:t.isAgent,language:i}):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:M,audio:M,interactive:null,template:({message:t})=>{const i=s((()=>{try{return JSON.parse(t.content)}catch(e){return void console.log(e.message)}}),[t]);return n("div",{style:{backgroundImage:v(t),color:A(t),borderColor:w(t),borderWidth:"1px",borderStyle:"solid"},children:[e("b",{children:"Template message:"})," ",i.name," ",i.language?.code?`/ ${i.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(".bc-agentMessage,\n.bc-clientMessage {\n margin: 10px 15px;\n font-size: var(--bc-chat-fontSize-sm); }\n .bc-agentMessage div p,\n .bc-clientMessage div p {\n padding: 0;\n margin: 0; }\n\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.status-icon.read {\n color: var(--bc-chat-success-color); }\n\n.status-icon.failed {\n color: var(--bc-chat-danger-color); }\n .status-icon.failed .resend {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer;\n margin: 0 10px; }\n\n.bc-agentMessage > div:not(.bc-debugCon),\n.bc-clientMessage > div:not(.bc-debugCon) {\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-agentMessage .bc-fileMessage,\n.bc-clientMessage .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-agentMessage .bc-fileMessage img,\n .bc-clientMessage .bc-fileMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 15px;\n height: 16px; }\n\n.bc-agentMessage .bc-locationMessage,\n.bc-clientMessage .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-agentMessage .bc-locationMessage img,\n .bc-clientMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n\n.bc-agentMessage {\n text-align: left;\n display: flex;\n align-items: flex-end;\n flex-wrap: wrap;\n gap: 5px; }\n .bc-agentMessage .bc-fileMessage,\n .bc-agentMessage .bc-locationMessage {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer; }\n .bc-agentMessage .bc-fileMessage img,\n .bc-agentMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n .bc-agentMessage > div:not(.bc-debugCon),\n .bc-agentMessage .bc-fileMessage,\n .bc-agentMessage .bc-locationMessage,\n .bc-agentMessage audio {\n border-bottom-left-radius: 0; }\n\n.bc-agentMessage:first-child {\n flex: 1 0 50%; }\n\n.bc-agentMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%; }\n\n.bc-clientMessage {\n padding-left: 20px;\n text-align: right; }\n .bc-clientMessage > div:not(.bc-debugCon),\n .bc-clientMessage .bc-fileMessage,\n .bc-clientMessage .bc-locationMessage,\n .bc-clientMessage audio {\n color: #fff;\n border-bottom-right-radius: 0; }\n .bc-clientMessage svg path:nth-child(2) {\n fill: #fff; }\n\n.bc-mediaMessage video,\n.bc-mediaMessage img {\n width: 300px;\n margin-bottom: -5px; }\n\n.bc-mediaMessage.audio video {\n height: 40px; }\n\n.bc-response-debug {\n background-color: transparent;\n color: #f5a623;\n padding: 0; }\n .bc-response-debug span {\n text-decoration: underline; }\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");const j=d.i`
69
+ `,F={document:({message:t})=>{let i=t.content.split("/"),o=i[i.length-1];return e(I,{className:"bc-fileMessage",...t,children:n(E,{href:t.content,target:"_blank",download:o,rel:"noopener noreferrer",...t,children:[e(L,{color:(a=t,a.isAgent,"000000")}),e("span",{children:o})]})});var a},image:({message:n})=>e("div",{className:"bc-mediaMessage",style:{backgroundImage:v(n),color:y(n),borderColor:w(n),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})=>{return e(S,{href:"https://www.google.com/maps/?q="+t.content,target:"_blank",rel:"noopener noreferrer",className:"bc-locationMessage",isAgent:t.isAgent,children:n(z,{children:[e(B,{color:(i=t,i.isAgent,"000000")}),e(D,{color:y(t),children:"Open location"})]})});var i},text:({message:t})=>{const i=p(t.content);return n("div",{className:"bc-textMessage",style:{backgroundImage:v(t),color:y(t),borderColor:w(t),borderWidth:"1px",borderStyle:"solid",direction:"arb"===i?"rtl":"ltr"},children:[t.context&&t.context.replyToId?e(M,{context:t.context,isAgent:t.isAgent,language:i}):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})=>{const i=s((()=>{try{return JSON.parse(t.content)}catch(e){return void console.log(e.message)}}),[t]);return n("div",{style:{backgroundImage:v(t),color:y(t),borderColor:w(t),borderWidth:"1px",borderStyle:"solid"},children:[e("b",{children:"Template message:"})," ",i.name," ",i.language?.code?`/ ${i.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(".bc-agentMessage,\n.bc-clientMessage {\n margin: 10px 15px;\n font-size: var(--bc-chat-fontSize-sm);\n}\n.bc-agentMessage div p,\n.bc-clientMessage div p {\n padding: 0;\n margin: 0;\n}\n\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.status-icon.read {\n color: var(--bc-chat-success-color);\n}\n.status-icon.failed {\n color: var(--bc-chat-danger-color);\n}\n.status-icon.failed .resend {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer;\n margin: 0 10px;\n}\n\n.bc-agentMessage > div:not(.bc-debugCon),\n.bc-clientMessage > div:not(.bc-debugCon) {\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-agentMessage .bc-fileMessage,\n.bc-clientMessage .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-agentMessage .bc-fileMessage img,\n.bc-clientMessage .bc-fileMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 15px;\n height: 16px;\n}\n.bc-agentMessage .bc-locationMessage,\n.bc-clientMessage .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-agentMessage .bc-locationMessage img,\n.bc-clientMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px;\n}\n\n.bc-agentMessage {\n text-align: left;\n display: flex;\n align-items: flex-end;\n flex-wrap: wrap;\n gap: 5px;\n}\n.bc-agentMessage .bc-fileMessage,\n.bc-agentMessage .bc-locationMessage {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer;\n}\n.bc-agentMessage .bc-fileMessage img,\n.bc-agentMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px;\n}\n.bc-agentMessage > div:not(.bc-debugCon),\n.bc-agentMessage .bc-fileMessage,\n.bc-agentMessage .bc-locationMessage,\n.bc-agentMessage audio {\n border-bottom-left-radius: 0;\n}\n\n.bc-agentMessage:first-child {\n flex: 1 0 50%;\n}\n\n.bc-agentMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%;\n}\n\n.bc-clientMessage {\n padding-left: 20px;\n text-align: right;\n}\n.bc-clientMessage > div:not(.bc-debugCon),\n.bc-clientMessage .bc-fileMessage,\n.bc-clientMessage .bc-locationMessage,\n.bc-clientMessage audio {\n color: #fff;\n border-bottom-right-radius: 0;\n}\n.bc-clientMessage 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-response-debug {\n background-color: transparent;\n color: #f5a623;\n padding: 0;\n}\n.bc-response-debug span {\n text-decoration: underline;\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}");const j=d.i`
70
70
  background-image: url(${e=>e.avatar||x});
71
71
  width: 30px;
72
72
  height: 30px;
@@ -117,11 +117,11 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
117
117
  width: 20px;
118
118
  height: 20px;
119
119
  margin: 5px;
120
- `,q=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),X=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),$=({file:t,isFileSelected:i,cancelFileUpload:o})=>n("div",{className:"bc-uploadFileDetails",style:{border:i?"green dashed 1px":""},id:"uploadFileDetails",children:[e("div",{className:"bc-uploadedFile",children:b.SupportedImageFormats.indexOf(t.extension)>=0?e("img",{src:t.fileUrl,alt:"",className:"bc-imageFile"}):e("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPq0lEQVR4nO2caXQUVRbHc2bmw8wXP82MJiyByKiDEHCYccN9QXFFEURxZlRcZkBRXHAXN0TZ3FAIKqABEQggSxKWRBwdBR0cUMCQQEhn6e5s3Z1OSIcl/e6c11WVfvXqvlevqjvCHOqe8zt+qeqU95f/va9aMCPDK6+88sorr7zyyiuvvPLKK6+8Os4rVnrKRbGSrCmx0sy5sZKsPEq7iZ557Zt65rXZ0jsvStnIkq1RnODt1uLek1uKsse0FvX73bH+9z7uqq3k9yfHSjO3xEqzQKMHxEo02rvoCe2be8JBE70StG0y07qpN7RuNBPdmA3RDUlaEvSBSHH20UhRn+LQht7nH+s+HBcF3/T8Tawkc2dHl4ykk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8bQZDbNCvswjCxCTTcuRbZIe0bBtDZOPK/BW7u6Nut6Vju6oMdkTZiLAI+JMinCCTHEYMk5bm4nOt/89Ff0Fm6Eg5drpClnmZyjJPIR07nO4Nm52BjSiTDJEIVQl2cjAx2s8/tPUSKF/Qt9kiJLiyx9zaFVnQ8eMEbY+gpyu7caXyVp5iOr6Xp0NdBpsKVkSqEhTFfHcuHPziQihbkA0VH/WbYxECUzJ+5S/IrK9ddjL4V2ZD5MvhEN12K0S3jdYZpXMLRLdSRkJ0680Q3XqTzgiIbr0Rot8Y3ADRrynX61wH0a+v1bkGol8PT/Lvq3WGQfQrnS+v1LkCWij/ulzji8sgssXgEo3PKRdDS+lFEElwIYQpmylDIbyJcr7OeRDaaHAuhDacA6ENZ/+s1K89C8oX5kDZB71pOoK09xlYNRf1OylQkLmzdtkpQMUcC2o+pZwC1Ut1PjkFfJ9kgm9JJlRRFmfCgcVZGvlZUEn5uAfsp3zUA/ZRFvWECspCSi8oX6Cx90NK70Qjjgf2LsrZUZHf7yRUhllM7/7BVVmzgyuz8ln8tvR0QK8kBb3y63RqllOyk3yapJpnaXZ+FWVJH43FSQ4kyMnfv/jU/P0fa+wz+OjYsv/jfjMr8vv3txXhlVdeeeWVV1555ZVXXnnllVdeeeWVV1555VXG/2f9D+lROV6EKZDWAAAAAElFTkSuQmCC",alt:"",className:"bc-documentFile"})}),e("div",{className:"bc-uploadFileName",children:e("span",{children:t.fileName})}),e("div",{className:"bc-uploadFileCancel",children:e("span",{onClick:o,children:e(X,{})})})]}),_=({text:n,setText:t,config:i,send:a})=>{const s=r(null),l=o((()=>{const e=s.current;e.style.height="20px";const n=e.scrollHeight;n!==e.offsetHeight&&(e.style.height=n+"px")}),[]);return c((()=>{n||(l(),s.current.focus())}),[l,n]),e("textarea",{ref:s,value:n,className:"bc-messageInputTextArea",id:"textInput",placeholder:i.inputPlaceholder||V[i.language]?.placeholder,maxLength:1024,onKeyDown:e=>{if("Enter"===e.key&&(e.shiftKey||e.ctrlKey||e.altKey)){e.preventDefault();const i=s.current.selectionStart,o=n.slice(0,i)+"\n"+n.slice(i);return t(o),void l()}"Enter"===e.key&&(e.preventDefault(),a(),l())},onChange:e=>{t(e.target.value),l()}})},ee=({config:t,send:i,file:o,isFileSelected:a,text:r,setText:c,cancelFileUpload:s})=>n("div",{className:"bc-messageInput",children:[o?e($,{file:o,isFileSelected:a,cancelFileUpload:s}):e(_,{text:r,setText:c,config:t,send:i}),e(O,{onClick:()=>i(),children:r||o?e(q,{}):null})]});async function ne(e,n,t){const i=new m("https://bcuserres.blob.core.windows.net?sp=rc&st=2024-12-31T17:52:49Z&se=2026-01-01T01:52:49Z&spr=https&sv=2022-11-02&sr=c&sig=ZM%2Fdd4vGMglDs%2F9GtJ8y510iYCcXpUO%2Bj5CvVAq8QDg%3D",new u).getContainerClient("anonymous"),o=new Date,a=`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,"0")}`,r=i.getBlockBlobClient(`${a}/${h()}`);try{await r.uploadBrowserData(e,{onProgress:t=>{const i=Math.round(t.loadedBytes/e.size*100);n(i)},blockSize:4194304,concurrency:20,blobHTTPHeaders:{blobContentType:e.type}});t(r.url.split("?")[0])}catch(e){t(void 0,"Error uploading file:"+e.message)}}const te=(e,n)=>`\n &:hover {\n background-image: ${e.replaceAll("%23a3a3a3",n.activeColor)};\n }\n background-image: ${n.isActive?e.replaceAll("%23a3a3a3",n.activeColor):e};\n`,ie=d.i`
120
+ `,q=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),X=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),$=({file:t,isFileSelected:i,cancelFileUpload:o})=>n("div",{className:"bc-uploadFileDetails",style:{border:i?"green dashed 1px":""},id:"uploadFileDetails",children:[e("div",{className:"bc-uploadedFile",children:u.SupportedImageFormats.indexOf(t.extension)>=0?e("img",{src:t.fileUrl,alt:"",className:"bc-imageFile"}):e("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPq0lEQVR4nO2caXQUVRbHc2bmw8wXP82MJiyByKiDEHCYccN9QXFFEURxZlRcZkBRXHAXN0TZ3FAIKqABEQggSxKWRBwdBR0cUMCQQEhn6e5s3Z1OSIcl/e6c11WVfvXqvlevqjvCHOqe8zt+qeqU95f/va9aMCPDK6+88sorr7zyyiuvvPLKK6+8Os4r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IMtcdtR1kw4Xo2oHL4NPh4oMNhXMaLKIQAR8e44LMDkyMZeKhLBfsVvTYb/MXZysXKfjapcy2FQIRJiaezbCXziwa+zksGIusRHiaJk7eSu3ScfOVGRcIZDBjShTKkQiZM3/swCZJP1zTWKSiYljCenc97xgXImWueyom0o6RjD/cUkmgxPiSoZIBNf8bQZDbNCvswjCxCTTcuRbZIe0bBtDZOPK/BW7u6Nut6Vju6oMdkTZiLAI+JMinCCTHEYMk5bm4nOt/89Ff0Fm6Eg5drpClnmZyjJPIR07nO4Nm52BjSiTDJEIVQl2cjAx2s8/tPUSKF/Qt9kiJLiyx9zaFVnQ8eMEbY+gpyu7caXyVp5iOr6Xp0NdBpsKVkSqEhTFfHcuHPziQihbkA0VH/WbYxECUzJ+5S/IrK9ddjL4V2ZD5MvhEN12K0S3jdYZpXMLRLdSRkJ0680Q3XqTzgiIbr0Rot8Y3ADRrynX61wH0a+v1bkGol8PT/Lvq3WGQfQrnS+v1LkCWij/ulzji8sgssXgEo3PKRdDS+lFEElwIYQpmylDIbyJcr7OeRDaaHAuhDacA6ENZ/+s1K89C8oX5kDZB71pOoK09xlYNRf1OylQkLmzdtkpQMUcC2o+pZwC1Ut1PjkFfJ9kgm9JJlRRFmfCgcVZGvlZUEn5uAfsp3zUA/ZRFvWECspCSi8oX6Cx90NK70Qjjgf2LsrZUZHf7yRUhllM7/7BVVmzgyuz8ln8tvR0QK8kBb3y63RqllOyk3yapJpnaXZ+FWVJH43FSQ4kyMnfv/jU/P0fa+wz+OjYsv/jfjMr8vv3txXhlVdeeeWVV1555ZVXXnnllVdeeeWVV1555VXG/2f9D+lROV6EKZDWAAAAAElFTkSuQmCC",alt:"",className:"bc-documentFile"})}),e("div",{className:"bc-uploadFileName",children:e("span",{children:t.fileName})}),e("div",{className:"bc-uploadFileCancel",children:e("span",{onClick:o,children:e(X,{})})})]}),_=({text:n,setText:t,config:i,send:a})=>{const s=r(null),l=o((()=>{const e=s.current;e.style.height="20px";const n=e.scrollHeight;n!==e.offsetHeight&&(e.style.height=n+"px")}),[]);return c((()=>{n||(l(),s.current.focus())}),[l,n]),e("textarea",{ref:s,value:n,className:"bc-messageInputTextArea",id:"textInput",placeholder:i.inputPlaceholder||V[i.language]?.placeholder,maxLength:1024,onKeyDown:e=>{if("Enter"===e.key&&(e.shiftKey||e.ctrlKey||e.altKey)){e.preventDefault();const i=s.current.selectionStart,o=n.slice(0,i)+"\n"+n.slice(i);return t(o),void l()}"Enter"===e.key&&(e.preventDefault(),a(),l())},onChange:e=>{t(e.target.value),l()}})},ee=({config:t,send:i,file:o,isFileSelected:a,text:r,setText:c,cancelFileUpload:s})=>n("div",{className:"bc-messageInput",children:[o?e($,{file:o,isFileSelected:a,cancelFileUpload:s}):e(_,{text:r,setText:c,config:t,send:i}),e(O,{onClick:()=>i(),children:r||o?e(q,{}):null})]});async function ne(e,n,t){const i=new h("https://bcuserres.blob.core.windows.net?sp=rc&st=2024-12-31T17:52:49Z&se=2026-01-01T01:52:49Z&spr=https&sv=2022-11-02&sr=c&sig=ZM%2Fdd4vGMglDs%2F9GtJ8y510iYCcXpUO%2Bj5CvVAq8QDg%3D",new b).getContainerClient("anonymous"),o=new Date,a=`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,"0")}`,r=i.getBlockBlobClient(`${a}/${m()}`);try{await r.uploadBrowserData(e,{onProgress:t=>{const i=Math.round(t.loadedBytes/e.size*100);n(i)},blockSize:4194304,concurrency:20,blobHTTPHeaders:{blobContentType:e.type}});t(r.url.split("?")[0])}catch(e){t(void 0,"Error uploading file:"+e.message)}}const te=(e,n)=>`\n &:hover {\n background-image: ${e.replaceAll("%23a3a3a3",n.activeColor)};\n }\n background-image: ${n.isActive?e.replaceAll("%23a3a3a3",n.activeColor):e};\n`,ie=d.i`
121
121
  ${e=>te("url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='50' height='50' viewBox='0 0 48 48'%3E%3Cpath d='M 19.5 3 C 17.585045 3 16 4.5850452 16 6.5 L 16 23.253906 A 1.50015 1.50015 0 0 0 16 23.740234 L 16 32.5 C 16 34.414955 17.585045 36 19.5 36 L 30.5 36 C 32.414955 36 34 34.414955 34 32.5 L 34 23.746094 A 1.50015 1.50015 0 0 0 34 23.259766 L 34 6.5 C 34 4.5850452 32.414955 3 30.5 3 L 19.5 3 z M 19.5 6 L 30.5 6 C 30.795045 6 31 6.2049548 31 6.5 L 31 22 L 19 22 L 19 6.5 C 19 6.2049548 19.204955 6 19.5 6 z M 11.476562 21.978516 A 1.50015 1.50015 0 0 0 10 23.5 L 10 32.5 C 10 37.728774 14.271226 42 19.5 42 L 23.5 42 L 23.5 46 A 1.50015 1.50015 0 1 0 26.5 46 L 26.5 42 L 30.5 42 C 35.728774 42 40 37.728774 40 32.5 L 40 23.5 A 1.50015 1.50015 0 1 0 37 23.5 L 37 32.5 C 37 36.107226 34.107226 39 30.5 39 L 19.5 39 C 15.892774 39 13 36.107226 13 32.5 L 13 23.5 A 1.50015 1.50015 0 0 0 11.476562 21.978516 z M 19 25 L 31 25 L 31 32.5 C 31 32.795045 30.795045 33 30.5 33 L 19.5 33 C 19.204955 33 19 32.795045 19 32.5 L 19 25 z M 25 27 A 2 2 0 0 0 25 31 A 2 2 0 0 0 25 27 z' fill='%23a3a3a3'%3E%3C/path%3E%3C/svg%3E%0A\");",e)}
122
122
  `,oe=d.div`
123
123
  ${e=>e.isRecording&&`\n &:before {\n transform: scale(${1+e.audioLevel/255});\n opacity: ${.6+e.audioLevel/255*.4};\n }\n `}
124
- `,ae=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"#666",fillRule:"evenodd",clipRule:"evenodd"})}),re=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),ce=({setProgress:i,setFile:s,setError:l,send:d})=>{const[g,p]=a(!1),[h,m]=a(0),u=r(null),b=r(null),x=r(null),C=r(null),f=r(null),v=r(null);c((()=>{const e=document.createElement("script");return e.src="https://cdn.bcrumbs.net/bc-assets/scripts/mic-recorder-to-mp3.js",e.async=!0,e.onload=()=>console.log("Voice recording library loaded successfully"),e.onerror=()=>{console.error("Failed to load voice recording library"),l("Failed to load voice recording library. Please refresh the page.")},document.body.appendChild(e),()=>{document.body.contains(e)&&document.body.removeChild(e)}}),[l]);const w=o((e=>{try{if(!e.active)return void navigator.mediaDevices.getUserMedia({audio:{sampleRate:48e3,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,googEchoCancellation:!0,googAutoGainControl:!0,googNoiseSuppression:!0,googHighpassFilter:!0,googTypingNoiseDetection:!0,googAudioMirroring:!1}}).then((e=>{b.current=e,w(e)})).catch((e=>{console.error("Failed to get fresh stream:",e)}));x.current=new(window.AudioContext||window.webkitAudioContext),"suspended"===x.current.state&&x.current.resume().then((()=>{}));const n=x.current.createMediaStreamSource(e);C.current=x.current.createAnalyser(),C.current.fftSize=256,C.current.smoothingTimeConstant=.8,C.current.minDecibels=-90,C.current.maxDecibels=-10,n.connect(C.current);const t=C.current.frequencyBinCount;f.current=new Uint8Array(t);const i=()=>{if(!C.current)return void console.log("No analyser available, stopping update loop");C.current.getByteFrequencyData(f.current);let e=0;for(let n=0;n<t;n++)e+=f.current[n]*f.current[n];const n=Math.sqrt(e/t),o=Math.min(255,2*n);m(o),v.current=requestAnimationFrame(i)};i()}catch(e){console.error("Audio level monitoring error:",e)}}),[]),A=o((()=>{v.current&&(cancelAnimationFrame(v.current),v.current=null),x.current&&(x.current.close(),x.current=null),m(0)}),[]);c((()=>()=>{u.current&&g&&u.current.stop(),b.current&&b.current.getTracks().forEach((e=>e.stop())),A()}),[g,A]);const y=o((()=>{if(!u.current){if("function"!=typeof MicRecorder)return void l("Please wait a little until voice library is loaded");u.current=new MicRecorder({bitRate:256,sampleRate:48e3})}l(void 0),g?u.current.stop().getMp3().then((([e,n])=>{if(p(!1),A(),n.size<1e3)return void l("Recording seems too short. Please try again.");ne(new File([n],"recording.mp3",{type:"audio/mpeg"}),i,((e,n)=>{e?d({fileUrl:e,fileName:"recording",extension:"mp3"}):n&&l(n)}))})).catch((e=>{p(!1),A(),l(`Recording failed: ${e.message}`)})):navigator.mediaDevices.getUserMedia({audio:{sampleRate:48e3,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,googEchoCancellation:!0,googAutoGainControl:!0,googNoiseSuppression:!0,googHighpassFilter:!0,googTypingNoiseDetection:!0,googAudioMirroring:!1}}).then((e=>{b.current=e,u.current.start().then((()=>{p(!0),setTimeout((()=>{x.current&&"suspended"===x.current.state?x.current.resume().then((()=>{w(e)})):w(e)}),100)})).catch((n=>{l(`Failed to start recording: ${n.message}`),e.getTracks().forEach((e=>e.stop()))}))})).catch((e=>{"NotAllowedError"===e.name?l("Microphone access denied. Please allow microphone access and try again."):"NotFoundError"===e.name?l("No microphone found. Please connect a microphone and try again."):l(`Microphone error: ${e.message}`)}))}),[g,l,i,d,w,A]),I=o((()=>{u.current&&g&&u.current.stop(),p(!1),A(),l(void 0)}),[g,A,l]);return n(t,{children:[g?e("i",{onClick:I,children:e(re,{})}):null,n("div",{id:"voiceRecorderIcon",className:"mic-container",children:[g?e("i",{onClick:y,children:e(ae,{})}):e(ie,{onClick:y,activeColor:"var(--bc-chat-dark-gray-color)"}),e(oe,{className:"circle "+(g?"active":""),isRecording:g,audioLevel:h})]})]})};const se=d.i`
124
+ `,ae=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"#666",fillRule:"evenodd",clipRule:"evenodd"})}),re=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),ce=({setProgress:i,setFile:s,setError:l,send:d})=>{const[g,p]=a(!1),[m,h]=a(0),b=r(null),u=r(null),x=r(null),C=r(null),f=r(null),v=r(null);c((()=>{const e=document.createElement("script");return e.src="https://cdn.bcrumbs.net/bc-assets/scripts/mic-recorder-to-mp3.js",e.async=!0,e.onload=()=>console.log("Voice recording library loaded successfully"),e.onerror=()=>{console.error("Failed to load voice recording library"),l("Failed to load voice recording library. Please refresh the page.")},document.body.appendChild(e),()=>{document.body.contains(e)&&document.body.removeChild(e)}}),[l]);const w=o((e=>{try{if(!e.active)return void navigator.mediaDevices.getUserMedia({audio:{sampleRate:48e3,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,googEchoCancellation:!0,googAutoGainControl:!0,googNoiseSuppression:!0,googHighpassFilter:!0,googTypingNoiseDetection:!0,googAudioMirroring:!1}}).then((e=>{u.current=e,w(e)})).catch((e=>{console.error("Failed to get fresh stream:",e)}));x.current=new(window.AudioContext||window.webkitAudioContext),"suspended"===x.current.state&&x.current.resume().then((()=>{}));const n=x.current.createMediaStreamSource(e);C.current=x.current.createAnalyser(),C.current.fftSize=256,C.current.smoothingTimeConstant=.8,C.current.minDecibels=-90,C.current.maxDecibels=-10,n.connect(C.current);const t=C.current.frequencyBinCount;f.current=new Uint8Array(t);const i=()=>{if(!C.current)return void console.log("No analyser available, stopping update loop");C.current.getByteFrequencyData(f.current);let e=0;for(let n=0;n<t;n++)e+=f.current[n]*f.current[n];const n=Math.sqrt(e/t),o=Math.min(255,2*n);h(o),v.current=requestAnimationFrame(i)};i()}catch(e){console.error("Audio level monitoring error:",e)}}),[]),y=o((()=>{v.current&&(cancelAnimationFrame(v.current),v.current=null),x.current&&(x.current.close(),x.current=null),h(0)}),[]);c((()=>()=>{b.current&&g&&b.current.stop(),u.current&&u.current.getTracks().forEach((e=>e.stop())),y()}),[g,y]);const A=o((()=>{if(!b.current){if("function"!=typeof MicRecorder)return void l("Please wait a little until voice library is loaded");b.current=new MicRecorder({bitRate:256,sampleRate:48e3})}l(void 0),g?b.current.stop().getMp3().then((([e,n])=>{if(p(!1),y(),n.size<1e3)return void l("Recording seems too short. Please try again.");ne(new File([n],"recording.mp3",{type:"audio/mpeg"}),i,((e,n)=>{e?d({fileUrl:e,fileName:"recording",extension:"mp3"}):n&&l(n)}))})).catch((e=>{p(!1),y(),l(`Recording failed: ${e.message}`)})):navigator.mediaDevices.getUserMedia({audio:{sampleRate:48e3,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,googEchoCancellation:!0,googAutoGainControl:!0,googNoiseSuppression:!0,googHighpassFilter:!0,googTypingNoiseDetection:!0,googAudioMirroring:!1}}).then((e=>{u.current=e,b.current.start().then((()=>{p(!0),setTimeout((()=>{x.current&&"suspended"===x.current.state?x.current.resume().then((()=>{w(e)})):w(e)}),100)})).catch((n=>{l(`Failed to start recording: ${n.message}`),e.getTracks().forEach((e=>e.stop()))}))})).catch((e=>{"NotAllowedError"===e.name?l("Microphone access denied. Please allow microphone access and try again."):"NotFoundError"===e.name?l("No microphone found. Please connect a microphone and try again."):l(`Microphone error: ${e.message}`)}))}),[g,l,i,d,w,y]),M=o((()=>{b.current&&g&&b.current.stop(),p(!1),y(),l(void 0)}),[g,y,l]);return n(t,{children:[g?e("i",{onClick:M,children:e(re,{})}):null,n("div",{id:"voiceRecorderIcon",className:"mic-container",children:[g?e("i",{onClick:A,children:e(ae,{})}):e(ie,{onClick:A,activeColor:"var(--bc-chat-dark-gray-color)"}),e(oe,{className:"circle "+(g?"active":""),isRecording:g,audioLevel:m})]})]})};const se=d.i`
125
125
  ${e=>te("url(\"data:image/svg+xml,%3Csvg id='Component_25_5' data-name='Component 25 – 5' xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 15.999 16'%3E%3Cpath id='Path_805' data-name='Path 805' d='M8,16a8,8,0,1,1,8-8,8.009,8.009,0,0,1-8,8M8,1.211A6.789,6.789,0,1,0,14.788,8,6.8,6.8,0,0,0,8,1.211' fill='%23a3a3a3'/%3E%3Cpath id='Path_806' data-name='Path 806' d='M10.908,19.478a4.716,4.716,0,0,1-3.359-1.392.605.605,0,0,1,.856-.856,3.537,3.537,0,0,0,5,0,.605.605,0,1,1,.856.856,4.716,4.716,0,0,1-3.359,1.392' transform='translate(-2.908 -6.728)' fill='%23a3a3a3'/%3E%3Cpath id='Path_807' data-name='Path 807' d='M7.306,10.925A1.635,1.635,0,1,1,8.942,9.289a1.638,1.638,0,0,1-1.635,1.635m0-2.06a.424.424,0,1,0,.424.424.425.425,0,0,0-.424-.424' transform='translate(-2.237 -3.02)' fill='%23a3a3a3'/%3E%3Cpath id='Path_808' data-name='Path 808' d='M16.986,10.925a1.635,1.635,0,1,1,1.635-1.635,1.638,1.638,0,0,1-1.635,1.635m0-2.06a.424.424,0,1,0,.424.424.425.425,0,0,0-.424-.424' transform='translate(-6.056 -3.02)' fill='%23a3a3a3'/%3E%3C/svg%3E%0A\");",e)}
126
126
  `,le=d.span`
127
127
  margin: 8px;
@@ -129,7 +129,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
129
129
  font-size: var(--bc-chat-fontSize-xl);
130
130
  `,de=({onClick:n})=>e("div",{id:"emojiIcon",children:e(se,{onClick:n,activeColor:"var(--bc-chat-dark-gray-color)"})}),ge=({text:n,setText:t,onClick:i})=>{const a=function(e){const n=r(null);return c((()=>{const t=t=>{n.current&&!n.current.contains(t.target)&&e()};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}}),[e]),n}(i),s=o((e=>{t(n+e)}),[t,n]),l=C.map(((n,t)=>e(le,{className:"emoji",onClick:e=>s(e.target.innerText),children:n},"emoji"+t)));return e("div",{ref:a,children:e("div",{className:"bc-emojiPicker",id:"emojiPicker",children:l})})},pe=d.i`
131
131
  ${e=>te("url(\"data:image/svg+xml,%3Csvg id='attach' xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 15.317 16'%3E%3Cpath id='Path_690' data-name='Path 690' d='M-431.392,1429.762a4.112,4.112,0,0,1-2.928-1.213,4.145,4.145,0,0,1,0-5.854l8.066-8.065a2.94,2.94,0,0,1,2.094-.867,2.94,2.94,0,0,1,2.094.867,2.941,2.941,0,0,1,.867,2.094,2.94,2.94,0,0,1-.867,2.094l-8.065,8.066a1.826,1.826,0,0,1-2.523,0,1.773,1.773,0,0,1-.522-1.261,1.773,1.773,0,0,1,.523-1.262l8.065-8.065a.606.606,0,0,1,.857,0,.6.6,0,0,1,0,.856l-8.065,8.066a.566.566,0,0,0-.168.4.569.569,0,0,0,.168.4.585.585,0,0,0,.809,0l8.066-8.066a1.738,1.738,0,0,0,.512-1.238,1.739,1.739,0,0,0-.512-1.238,1.792,1.792,0,0,0-2.475,0l-8.066,8.065a2.933,2.933,0,0,0,0,4.141,2.933,2.933,0,0,0,4.141,0l8.075-8.075a.6.6,0,0,1,.857,0,.6.6,0,0,1,0,.856l-8.075,8.075A4.111,4.111,0,0,1-431.392,1429.762Z' transform='translate(435.53 -1413.762)' fill='%23a3a3a3'/%3E%3C/svg%3E%0A\");",e)}
132
- `,he=({setProgress:t,setFile:i,setError:a})=>{const r=o((e=>{i(void 0),a(void 0);const n=Array.from(e.target.files);if(e.target.value="",n.length<1)return;const o=n[0],{name:r,size:c}=o,s=r.substring(r.lastIndexOf(".")+1).toLowerCase();return b.SupportedFormats.indexOf(s)<0?a("File type is not valid."):c>b.MaxFileSize?a("Maximum limit is 20 MBs"):void ne(o,t,((e,n)=>{e?i({fileUrl:e,fileName:r,extension:s}):n&&a(n)}))}),[t,i,a]);return n("div",{id:"attachIcon",children:[e("label",{htmlFor:"fileInput",children:e(pe,{activeColor:"var(--bc-chat-dark-gray-color)"})}),e("input",{type:"file",className:"bc-fileUpload",id:"fileInput",onChange:r})]})},me=d.div`
132
+ `,me=({setProgress:t,setFile:i,setError:a})=>{const r=o((e=>{i(void 0),a(void 0);const n=Array.from(e.target.files);if(e.target.value="",n.length<1)return;const o=n[0],{name:r,size:c}=o,s=r.substring(r.lastIndexOf(".")+1).toLowerCase();return u.SupportedFormats.indexOf(s)<0?a("File type is not valid."):c>u.MaxFileSize?a("Maximum limit is 20 MBs"):void ne(o,t,((e,n)=>{e?i({fileUrl:e,fileName:r,extension:s}):n&&a(n)}))}),[t,i,a]);return n("div",{id:"attachIcon",children:[e("label",{htmlFor:"fileInput",children:e(pe,{activeColor:"var(--bc-chat-dark-gray-color)"})}),e("input",{type:"file",className:"bc-fileUpload",id:"fileInput",onChange:r})]})},he=d.div`
133
133
  padding: 0px 0px 0px 10px;
134
134
  margin: 0px;
135
135
  width: fit-content;
@@ -144,7 +144,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
144
144
  cursor: pointer;
145
145
  display: block;
146
146
  }
147
- `,ue=({setView:t,setFile:i,setProgress:o,setError:r,text:c,setText:s,send:l})=>{const[d,g]=a(!1);return n("div",{className:"bc-inputActions",id:"bc-inputActions",children:[n(me,{id:"iconsContainer",children:[e(he,{setFile:i,setProgress:o,setError:r}),e(de,{onClick:()=>g(!0)}),e(ce,{setFile:i,setError:r,setProgress:o,send:l})]}),d?e(ge,{text:c,setText:s,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 be=d.div`
147
+ `,be=({setView:t,setFile:i,setProgress:o,setError:r,text:c,setText:s,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(ce,{setFile:i,setError:r,setProgress:o,send:l})]}),d?e(ge,{text:c,setText:s,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\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}\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\n.bc-inputActions {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n height: 38px;\n}\n.bc-inputActions .bc-fileUpload {\n display: none;\n}\n.bc-inputActions i {\n display: block;\n margin: 0 5px;\n}\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 rgba(0, 0, 0, 0.1019607843);\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\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}\n.bc-uploadFileDetails .bc-uploadedFile {\n max-width: 32px;\n max-height: 32px;\n pointer-events: none;\n}\n.bc-uploadFileDetails .bc-uploadedFile .bc-imageFile {\n max-width: 100%;\n max-height: 100%;\n pointer-events: none;\n}\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}\n.bc-uploadFileDetails .bc-uploadFileName {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n pointer-events: none;\n}\n.bc-uploadFileDetails .bc-uploadFileName span {\n padding: 10px;\n pointer-events: none;\n}\n.bc-uploadFileDetails .bc-uploadFileCancel {\n cursor: pointer;\n margin-bottom: -6px;\n}\n\n.mic-container {\n position: relative;\n}\n.mic-container i {\n transition: 0.9s;\n z-index: 10;\n position: relative;\n}\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}\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}\n.mic-container .circle.active {\n background-color: #A8E6A3;\n}\n.mic-container .circle.active:before {\n background: #A8E6A3;\n}\n\n@keyframes bounce {\n 0% {\n transform: scale(1);\n }\n 25% {\n transform: scale(1.4);\n }\n 75% {\n transform: scale(1);\n }\n 100% {\n transform: scale(1.3);\n }\n}');const ue=d.div`
148
148
  width: calc(100% - 40px);
149
149
  background-color: #d9d9d94d;
150
150
  padding: 10px 20px;
@@ -162,7 +162,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
162
162
  margin-top: 6px;
163
163
  text-align: center;
164
164
  }
165
- `,xe=({config:t,sendMessage:i,setView:r})=>{const[c,s]=a(),[l,d]=a(),[g,p]=a(),[h,m]=a(0),u=o((e=>{if(e){const{fileUrl:n,extension:t}=e;i(b.SupportedImageFormats.indexOf(t)>=0?"image":b.SupportedAudioFormats.indexOf(t)>=0?"audio":"document",n)}else if(l){const{fileUrl:e,extension:n}=l;i(b.SupportedImageFormats.indexOf(n)>=0?"image":b.SupportedAudioFormats.indexOf(n)>=0?"audio":"document",e),d(void 0)}else i(Y,c),s("")}),[l,c,i]);return n(be,{children:[e("div",{className:"bc-InputArea",children:e(ee,{config:t,send:u,text:c,setText:s,file:l,isFileSelected:!!l,cancelFileUpload:()=>d(void 0)})}),e("div",{className:"bc-CommandsArea",children:e(ue,{setView:r,setFile:d,setProgress:m,setError:p,setText:s,text:c,send:u})}),g?e("div",{className:"bc-uploadFileError",children:g}):null]})},Ce="bc-chat-header-banner",fe=390,ve=d.div`
165
+ `,xe=({config:t,sendMessage:i,setView:r})=>{const[c,s]=a(),[l,d]=a(),[g,p]=a(),[m,h]=a(0),b=o((e=>{if(e){const{fileUrl:n,extension:t}=e;i(u.SupportedImageFormats.indexOf(t)>=0?"image":u.SupportedAudioFormats.indexOf(t)>=0?"audio":"document",n)}else if(l){const{fileUrl:e,extension:n}=l;i(u.SupportedImageFormats.indexOf(n)>=0?"image":u.SupportedAudioFormats.indexOf(n)>=0?"audio":"document",e),d(void 0)}else i(Y,c),s("")}),[l,c,i]);return n(ue,{children:[e("div",{className:"bc-InputArea",children:e(ee,{config:t,send:b,text:c,setText:s,file:l,isFileSelected:!!l,cancelFileUpload:()=>d(void 0)})}),e("div",{className:"bc-CommandsArea",children:e(be,{setView:r,setFile:d,setProgress:h,setError:p,setText:s,text:c,send:b})}),g?e("div",{className:"bc-uploadFileError",children:g}):null]})},Ce="bc-chat-header-banner",fe=390,ve=d.div`
166
166
  ${e=>e.bannerWidth>fe?"height: 60px;":"height: 90px;"}
167
167
  display: block;
168
168
  width: 100%;
@@ -176,11 +176,11 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
176
176
  align-items: center;
177
177
  background-image: ${e=>`linear-gradient(103deg, ${e.startColor},${e.endColor})`};
178
178
  ${e=>e.bannerWidth<=fe?'\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzkwIiBoZWlnaHQ9Ijg4LjM1NCIgdmlld0JveD0iMCAwIDM5MCA4OC4zNTQiPgogIDxkZWZzPgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQiIHgyPSIxIiB5Mj0iMSIgZ3JhZGllbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giPgog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LDAsMCwxLDEwLDAiIGZpbGw9InVybCgjbGluZWFyLWdyYWRpZW50KSIvPgo8L3N2Zz4K");\n mask-repeat: no-repeat;\n mask-size: auto;\n -webkit-mask-size: auto;\n -webkit-mask-repeat: no-repeat;\n height: 90px;\n ':"height: 60px;"}
179
- `,Ae=d.div`
179
+ `,ye=d.div`
180
180
  width: 100%;
181
181
  height: 100%;
182
182
  display: flex;
183
- `,ye=d.div`
183
+ `,Ae=d.div`
184
184
  ${e=>e.bannerWidth>fe?"padding-bottom: 0 !important;":""}
185
185
  display: flex;
186
186
  gap: 10px;
@@ -202,7 +202,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
202
202
  color: #fff;
203
203
  font-style: normal;
204
204
  }
205
- `,Ie=d.div`
205
+ `,Me=d.div`
206
206
  ${e=>e.bannerWidth>fe?"padding-bottom: 0 !important;":""}
207
207
  display: flex;
208
208
  flex-direction: row-reverse;
@@ -218,9 +218,9 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
218
218
  cursor: pointer;
219
219
  display: block;
220
220
  }
221
- `,Me=d.i`
221
+ `,ke=d.i`
222
222
  background-image: url("data:image/svg+xml;base64,PHN2ZyBpZD0ibWluaW1pemUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxLjgxNyIgdmlld0JveD0iMCAwIDE2IDEuODE3Ij4KICA8ZGVmcz4KICAgIDxjbGlwUGF0aCBpZD0iY2xpcC1wYXRoIj4KICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZV82OCIgZGF0YS1uYW1lPSJSZWN0YW5nbGUgNjgiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxLjgxNyIgZmlsbD0iIzAwMCIvPgogICAgPC9jbGlwUGF0aD4KICA8L2RlZnM+CiAgPGcgaWQ9Ikdyb3VwXzMwMSIgZGF0YS1uYW1lPSJHcm91cCAzMDEiIGNsaXAtcGF0aD0idXJsKCNjbGlwLXBhdGgpIj4KICAgIDxwYXRoIGlkPSJQYXRoXzgwNCIgZGF0YS1uYW1lPSJQYXRoIDgwNCIgZD0iTTE1LjM5NCwyLjIxMUguNjA2QS42MDYuNjA2LDAsMSwxLC42MDYsMUgxNS4zOTRhLjYwNi42MDYsMCwwLDEsMCwxLjIxMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtMC4zOTQpIiBmaWxsPSIjZmZmIi8+CiAgPC9nPgo8L3N2Zz4K");
223
- `,ke=({config:t,minimize:i})=>{const[o,r]=a();return c((()=>{new ResizeObserver((()=>{const e=document.getElementById(Ce)?.offsetWidth;e&&e>50&&e!==o&&r(e)})).observe(document.getElementById(Ce))}),[]),e(ve,{bannerWidth:o,className:"bc-header",children:e(we,{className:"bc-banner",id:Ce,startColor:"#065A60",endColor:"#006466",bannerWidth:o,children:n(Ae,{className:"bc-bannerContents",children:[n(ye,{className:"bc-companyInfo",bannerWidth:o,logo:t.brandLogo||x,children:[e("i",{}),e("span",{children:t.brandName||"BreadCrumbs"})]}),e(Ie,{className:"bc-bannerActions",bannerWidth:o,children:i?e(Me,{className:"bc-flow-minimize",onClick:()=>i()}):null})]})})})},Le=d.div`
223
+ `,Ie=({config:t,minimize:i})=>{const[o,r]=a();return c((()=>{new ResizeObserver((()=>{const e=document.getElementById(Ce)?.offsetWidth;e&&e>50&&e!==o&&r(e)})).observe(document.getElementById(Ce))}),[]),e(ve,{bannerWidth:o,className:"bc-header",children:e(we,{className:"bc-banner",id:Ce,startColor:"#065A60",endColor:"#006466",bannerWidth:o,children:n(ye,{className:"bc-bannerContents",children:[n(Ae,{className:"bc-companyInfo",bannerWidth:o,logo:t.brandLogo||x,children:[e("i",{}),e("span",{children:t.brandName||"BreadCrumbs"})]}),e(Me,{className:"bc-bannerActions",bannerWidth:o,children:i?e(ke,{className:"bc-flow-minimize",onClick:()=>i()}):null})]})})})},Le=d.div`
224
224
  width: 100%;
225
225
  text-align: center;
226
226
  i {
@@ -251,7 +251,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
251
251
  border-radius: 0px 0px 10px 10px;
252
252
  opacity: 1;
253
253
  }
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-agent-message-border-color: #95D5B2;\n --bc-chat-agent-message-background-start-color: #fff;\n --bc-chat-agent-message-background-end-color: #fff;\n --bc-chat-agent-message-text-color: #000;\n --bc-chat-client-message-border-color: #95D5B2;\n --bc-chat-client-message-background-start-color: #95D5B2;\n --bc-chat-client-message-background-end-color: #95D5B2;\n --bc-chat-client-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`
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-agent-message-border-color: #95D5B2;\n --bc-chat-agent-message-background-start-color: #fff;\n --bc-chat-agent-message-background-end-color: #fff;\n --bc-chat-agent-message-text-color: #000;\n --bc-chat-client-message-border-color: #95D5B2;\n --bc-chat-client-message-background-start-color: #95D5B2;\n --bc-chat-client-message-background-end-color: #95D5B2;\n --bc-chat-client-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
255
  height: 100%;
256
256
  display: flex;
257
257
  flex-direction: column;
@@ -277,5 +277,5 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useCal
277
277
  line-height: inherit;
278
278
  font-weight: inherit;
279
279
  }
280
- `,De=({config:t={language:"EN",backgroundColor:"#dedede"},messages:i=[],sendMessage:o,debug:r,minimize:c,onReachingUp:s,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(ke,{config:t,minimize:c}),"MESSAGE_LIST"===d?e(W,{messages:i,sendMessage:o,debug:r,config:t,onReachingUp:s,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};
280
+ `,ze=({config:t={language:"EN",backgroundColor:"#dedede"},messages:i=[],sendMessage:o,debug:r,minimize:c,onReachingUp:s,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:c}),"MESSAGE_LIST"===d?e(W,{messages:i,sendMessage:o,debug:r,config:t,onReachingUp:s,agentsIdsAvatarsMap:l},"message-list"):null,p?e(Ee,{forRate:!0}):t.inputDisabled?null:e(xe,{sendMessage:o,setView:g,config:t},"message-input")]})};export{ze as BCChat};
281
281
  //# sourceMappingURL=index.es.js.map
package/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("@emotion/styled"),a=require("react-markdown"),i=require("franc-min"),o=require("uuid"),r=require("@azure/storage-blob");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(n),l=s(t),d=s(a);const g={MaxFileSize:52428800,SupportedFormats:["png","jpg","jpeg","gif","bmp","pdf","doc","xls","xlsx","docx","ppt","pptx","avi","m4a","m4v","mov","mp4","wav","wma","wmv"],SupportedImageFormats:["png","jpg","jpeg","gif","bmp","webp"],SupportedAudioFormats:["mp3","acc","m4a","ogg","amr"]},p="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAABBCAYAAACO98lFAAAACXBIWXMAAA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EYhCA1BJknmtP0CyWLmUV/URA0AbrGMOCA8KZwCwIXAQNxrtvu5V+KCpct558UjvQmeSqcn/Xe5YR5N4qrHGtea5+51cdpvpKmJOXynxf8aE2oUOZz2Ied1sPOM5lc9VsIV1qlWE/P+YJzigrBJW8ppM48mUd/VNGcQjlEvDjmvE67AJ9t3B1zigqCTawhV2DIWQH1XExyj3tjyj4E27Lp9Gswjrp/vyCnjvaqfinMnJERP+LxkM1qufMsJVpaxACydP2HbyjzUaEqgfTGTSME7/H/iylAv4QLTN0I+8fWyq1OcypJMIsXh14zY0tFEjDXet6Pxvv1xbiFLWgr3eBB3JtmI65WnKLD/za0xaxeiuSwVK/NwrHgT57SYaZaxAMyjvlkBfF1u4k2Svr/dLEhVSlAIVr+d0y5TF+KYYeu8lZ9d6uKIAFo93YJJ7oK6Q2PfNaKSpJNrcLSyDpcc7TjtuhmT+mxS6fHhK5XIkPHD6wu4sdd2XrD3Fjwm7Gw/iWOGrYQgWq01oFprgI9l0D3kgD80DEfQj+DUBFTJqVBKU5GTqkKRUhdVH+gLuLGz/aSgxVnBIQxNTUYEAfxbbY70C89mrZ5u7LWdF7w6nZDAODQ1ifctDThjvybIemw4hH1tjdhp/SUh5fmEfp9Qb29Bk+sWduSURa1SRzIfy+CyqzPmOuZTh+APjRCnQTBMvqhtIojdvRdR0N+K9StzUKTIgnZFJq9LTJfsHSODaB2y48KwF0/DFtE/h1JliUKgECgECoFCoBAi2D8QCAe+XuY7HAAAAABJRU5ErkJggg==",u=["🤓","🙃","😕","â˜šī¸","😲","đŸ˜ŗ","😠","😇","😀","😁","😂","đŸ¤Ŗ","😃","😄","😅","😆","😉","😊","😏","đŸ˜Ŗ","đŸ˜Ĩ","😮","😴","😌","😋","😎","😍","🙂","🤗","🤔","😐","😑","đŸ˜ļ","🙄"],h="bc-message-list-content";function x(e){return e.isAgent?"linear-gradient(104deg,var(--bc-chat-agent-message-background-start-color),var(--bc-chat-agent-message-background-end-color))":"linear-gradient(104deg,var(--bc-chat-client-message-background-start-color),var(--bc-chat-client-message-background-end-color))"}function m(e){return e.isAgent?"var(--bc-chat-agent-message-border-color)":"var(--bc-chat-client-message-border-color)"}function b(e){return e.isAgent?"var(--bc-chat-agent-message-text-color)":"var(--bc-chat-client-message-text-color)"}const f=l.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("@emotion/styled"),i=require("react-markdown"),a=require("franc-min"),o=require("uuid"),r=require("@azure/storage-blob");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(n),l=s(t),d=s(i);const g={MaxFileSize:52428800,SupportedFormats:["png","jpg","jpeg","gif","bmp","pdf","doc","xls","xlsx","docx","ppt","pptx","avi","m4a","m4v","mov","mp4","wav","wma","wmv"],SupportedImageFormats:["png","jpg","jpeg","gif","bmp","webp"],SupportedAudioFormats:["mp3","acc","m4a","ogg","amr"]},p="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAABBCAYAAACO98lFAAAACXBIWXMAAAsSAAALEgHS3X78AAAFa0lEQVR42u2bX0xTVxzHvzqqVOqQrtJC2gmF4ooMWNg6FEJE3NhClpnG8aBzsTHugbgsLltiJg/6NI3J5pLFLbpIIjEjLuriiH9qnESlI6BQWcGsSEvT2lK8q0CvFChme1hwXs5tKfTWXfT83s6fe3Lz6fn9zvl9f7eL9L/u/xvPuS0GNQqBQqAQKAQKYaYlzfdBk0qPtzRFnL7L7ttoGLzz/EBQSlNRrMzj9HUzA9QdaEygECgECoFCoBAoBAqBQqAQKASaRQph6UlLUCJToCjtZcgkydCmqh6PPQyPo39kEP7QCDoeeGCbCD5bEN5dkQljlgFl6sKo854c97EMfvf2osl1K+FAEgqhPEWBuvyNRModi2XIFDDmVcCYV4FLjnZ8Zf8NQ1OTCysmmFR6HK2smxeAmVatNaC56lPUKrIXzk74Jv8dVGsNEcfZcAh3A25OX4pECp1cE/EZmUSKfaXbUGi/hnp7i7gh7Mku5QXA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fjwm7Gw/iWOGrYQgWq01oFprgI9l0D3kgD80DEfQj+DUBFTJqVBKU5GTqkKRUhdVH+gLuLGz/aSgxVnBIQxNTUYEAfxbbY70C89mrZ5u7LWdF7w6nZDAODQ1ifctDThjvybIemw4hH1tjdhp/SUh5fmEfp9Qb29Bk+sWduSURa1SRzIfy+CyqzPmOuZTh+APjRCnQTBMvqhtIojdvRdR0N+K9StzUKTIgnZFJq9LTJfsHSODaB2y48KwF0/DFtE/h1JliUKgECgECoFCoBAi2D8QCAe+XuY7HAAAAABJRU5ErkJggg==",u=["🤓","🙃","😕","â˜šī¸","😲","đŸ˜ŗ","😠","😇","😀","😁","😂","đŸ¤Ŗ","😃","😄","😅","😆","😉","😊","😏","đŸ˜Ŗ","đŸ˜Ĩ","😮","😴","😌","😋","😎","😍","🙂","🤗","🤔","😐","😑","đŸ˜ļ","🙄"],m="bc-message-list-content";function h(e){return e.isAgent?"linear-gradient(104deg,var(--bc-chat-agent-message-background-start-color),var(--bc-chat-agent-message-background-end-color))":"linear-gradient(104deg,var(--bc-chat-client-message-background-start-color),var(--bc-chat-client-message-background-end-color))"}function b(e){return e.isAgent?"var(--bc-chat-agent-message-border-color)":"var(--bc-chat-client-message-border-color)"}function x(e){return e.isAgent?"var(--bc-chat-agent-message-text-color)":"var(--bc-chat-client-message-text-color)"}const f=l.default.div`
2
2
  padding: 8px;
3
3
  margin-bottom: 4px;
4
4
  ${e=>e.isAgent?"border-left: 2px solid #ccc;":"border-right: 2px solid #777;"}
@@ -11,10 +11,10 @@
11
11
  white-space: nowrap;
12
12
  direction: ${e=>"arb"===e.language?"rtl":"ltr"};
13
13
  cursor: pointer;
14
- `,C=({className:t,context:a,isAgent:i,language:o})=>{const r=n.useCallback((()=>{const e=document.getElementById(h),n=document.getElementById(a.replyToId);e&&n&&(e.style.scrollBehavior="smooth",n.scrollIntoView())}),[a.replyToId]);return e.jsx(f,{className:t,isAgent:i,language:o,onClick:r,children:"image"===a.replyToType?e.jsx("img",{src:a.replyToContent,alt:"Media preview",style:{width:"30px",height:"30px",objectFit:"cover",marginLeft:"8px",verticalAlign:"middle"}}):a.replyToContent})},v=({message:t})=>{const[a,i]=n.useState(!1),o=n.useRef(null);return n.useEffect((()=>{const e=()=>{document.querySelectorAll("video, audio").forEach((e=>{e!==o.current&&e.pause()}))},n=o.current;return n&&n.addEventListener("play",e),()=>{n&&n.removeEventListener("play",e)}}),[]),a?e.jsxs("div",{className:"bc-mediaMessage"+("audio"===t.type?" audio":""),style:{padding:"10px",border:"1px solid #ccc",borderRadius:"4px",backgroundColor:"#f8f8f8"},children:[e.jsxs("p",{style:{margin:0,color:"#666"},children:["Unable to load ","audio"===t.type?"audio":"video"," file."]}),e.jsxs("a",{href:t.content,target:"_blank",rel:"noopener noreferrer",style:{color:"#007bff",textDecoration:"none"},children:["Open ","audio"===t.type?"audio":"video"," in new tab"]})]}):e.jsx("div",{className:"bc-mediaMessage"+("audio"===t.type?" audio":""),style:{padding:0,position:"relative"},children:e.jsx("video",{ref:o,src:t.content,controls:!0,preload:"metadata",playsInline:!0,onError:()=>{i(!0)},style:{width:"100%",maxWidth:"400px",height:"auto",opacity:1}})})},w=l.default.div`
15
- background-image: ${e=>x(e)};
16
- color: ${e=>b(e)};
17
- border-color: ${e=>m(e)};
14
+ `,C=({className:t,context:i,isAgent:a,language:o})=>{const r=n.useCallback((()=>{const e=document.getElementById(m),n=document.getElementById(i.replyToId);e&&n&&(e.style.scrollBehavior="smooth",n.scrollIntoView())}),[i.replyToId]);return e.jsx(f,{className:t,isAgent:a,language:o,onClick:r,children:"image"===i.replyToType?e.jsx("img",{src:i.replyToContent,alt:"Media preview",style:{width:"30px",height:"30px",objectFit:"cover",marginLeft:"8px",verticalAlign:"middle"}}):i.replyToContent})},v=({message:t})=>{const[i,a]=n.useState(!1),[o,r]=n.useState(!0),s=n.useRef(null),c=()=>{const e=s.current;e&&console.error("Media playback error:",{src:e.src,error:e.error,networkState:e.networkState,readyState:e.readyState,messageType:t.type}),a(!0),r(!1)},l=()=>{console.log("Media loaded successfully:",t.content),r(!1)},d=()=>{console.log("Media can play:",t.content),r(!1)},g=()=>{console.log("Media load started:",t.content)};return n.useEffect((()=>{console.log("MediaMessage component mounted for:",t.content,"type:",t.type);const e=()=>{document.querySelectorAll("video, audio").forEach((e=>{e!==s.current&&e.pause()}))},n=s.current;if(n){n.addEventListener("play",e),n.addEventListener("loadeddata",l),n.addEventListener("canplay",d),n.addEventListener("error",c),n.addEventListener("loadstart",g);const i=setTimeout((()=>{console.log("Loading timeout reached for:",t.content),r(!1)}),5e3);return()=>{n&&(n.removeEventListener("play",e),n.removeEventListener("loadeddata",l),n.removeEventListener("canplay",d),n.removeEventListener("error",c),n.removeEventListener("loadstart",g)),clearTimeout(i)}}}),[t.content]),i?e.jsxs("div",{className:"bc-mediaMessage"+("audio"===t.type?" audio":""),style:{padding:"10px",border:"1px solid #ccc",borderRadius:"4px",backgroundColor:"#f8f8f8"},children:[e.jsxs("p",{style:{margin:0,color:"#666"},children:["Unable to load ","audio"===t.type?"audio":"video"," file."]}),e.jsxs("a",{href:t.content,target:"_blank",rel:"noopener noreferrer",style:{color:"#007bff",textDecoration:"none"},children:["Open ","audio"===t.type?"audio":"video"," in new tab"]})]}):"audio"===t.type?e.jsxs("div",{className:"bc-mediaMessage audio",children:[e.jsx("audio",{ref:s,src:t.content,controls:!0,preload:"metadata",onError:c,onLoadedData:l,onCanPlay:d,onLoadStart:g}),o&&e.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:"14px",zIndex:1},children:"Loading audio..."})]}):e.jsxs("div",{className:"bc-mediaMessage",children:[e.jsx("video",{ref:s,src:t.content,controls:!0,preload:"metadata",playsInline:!0,onError:c,onLoadedData:l,onCanPlay:d,onLoadStart:g}),o&&e.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:"14px",zIndex:1},children:"Loading video..."})]})},w=l.default.div`
15
+ background-image: ${e=>h(e)};
16
+ color: ${e=>x(e)};
17
+ border-color: ${e=>b(e)};
18
18
  border-width: 1px;
19
19
  border-style: solid;
20
20
  :hover {
@@ -24,25 +24,25 @@
24
24
  -ms-filter: brightness(80%);
25
25
  filter: brightness(80%);
26
26
  }
27
- `;const A=l.default.i`
27
+ `;const y=l.default.i`
28
28
  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%22M8.51194%203.00541C9.18829%202.54594%2010.0435%202.53694%2010.6788%202.95419C10.8231%203.04893%2010.9771%203.1993%2011.389%203.61119C11.8009%204.02307%2011.9513%204.17714%2012.046%204.32141C12.4633%204.95675%2012.4543%205.81192%2011.9948%206.48827C11.8899%206.64264%2011.7276%206.80811%2011.3006%207.23511L10.6819%207.85383C10.4867%208.04909%2010.4867%208.36567%2010.6819%208.56093C10.8772%208.7562%2011.1938%208.7562%2011.389%208.56093L12.0077%207.94221L12.0507%207.89929C12.4203%207.52976%2012.6568%207.2933%2012.822%207.0502C13.4972%206.05623%2013.5321%204.76252%2012.8819%203.77248C12.7233%203.53102%2012.4922%203.30001%2012.1408%202.94871L12.0961%202.90408L12.0515%202.85942C11.7002%202.508%2011.4692%202.27689%2011.2277%202.11832C10.2377%201.46813%208.94398%201.50299%207.95001%202.17822C7.70691%202.34336%207.47044%202.57991%207.1009%202.94955L7.058%202.99247L6.43928%203.61119C6.24401%203.80645%206.24401%204.12303%206.43928%204.31829C6.63454%204.51355%206.95112%204.51355%207.14638%204.31829L7.7651%203.69957C8.1921%203.27257%208.35757%203.11027%208.51194%203.00541ZM4.31796%207.14672C4.51322%206.95146%204.51322%206.63487%204.31796%206.43961C4.12269%206.24435%203.80611%206.24435%203.61085%206.43961L2.99213%207.05833L2.94922%207.10124C2.57957%207.47077%202.34303%207.70724%202.17788%207.95035C1.50265%208.94432%201.4678%2010.238%202.11799%2011.2281C2.27656%2011.4695%202.50766%2011.7005%202.8591%2012.0518L2.90374%2012.0965L2.94837%2012.1411C3.29967%2012.4925%203.53068%2012.7237%203.77214%2012.8822C4.76219%2013.5324%206.05589%2013.4976%207.04986%2012.8223C7.29296%2012.6572%207.52943%2012.4206%207.89896%2012.051L7.89897%2012.051L7.94188%2012.0081L8.5606%2011.3894C8.75586%2011.1941%208.75586%2010.8775%208.5606%2010.6823C8.36533%2010.487%208.04875%2010.487%207.85349%2010.6823L7.23477%2011.301C6.80777%2011.728%206.6423%2011.8903%206.48794%2011.9951C5.81158%2012.4546%204.95642%2012.4636%204.32107%2012.0464C4.17681%2011.9516%204.02274%2011.8012%203.61085%2011.3894C3.19896%2010.9775%203.0486%2010.8234%202.95385%2010.6791C2.53661%2010.0438%202.54561%209.18863%203.00507%208.51227C3.10993%208.35791%203.27224%208.19244%203.69924%207.76544L4.31796%207.14672ZM9.62172%206.08558C9.81698%205.89032%209.81698%205.57373%209.62172%205.37847C9.42646%205.18321%209.10988%205.18321%208.91461%205.37847L5.37908%208.91401C5.18382%209.10927%205.18382%209.42585%205.37908%209.62111C5.57434%209.81637%205.89092%209.81637%206.08619%209.62111L9.62172%206.08558Z%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")`};
29
29
  width: 24px;
30
30
  background-position: center;
31
31
  background-size: contain;
32
32
  background-repeat: no-repeat;
33
- `,y=l.default.a`
33
+ `,k=l.default.a`
34
34
  display: flex;
35
35
  flex-direction: row;
36
36
  align-item: center;
37
37
  text-decoration: auto;
38
38
  gap: 5px;
39
- color: ${e=>`${b(e)}`};
39
+ color: ${e=>`${x(e)}`};
40
40
  font-size: var(--bc-chat-fontSize-sm);
41
- `,M=l.default.a`
41
+ `,A=l.default.a`
42
42
  font-size: var(--bc-chat-fontSize-sm);
43
- background-image: ${e=>x(e)};
44
- color: ${e=>b(e)};
45
- border-color: ${e=>m(e)};
43
+ background-image: ${e=>h(e)};
44
+ color: ${e=>x(e)};
45
+ border-color: ${e=>b(e)};
46
46
  border-width: 1px;
47
47
  border-style: solid;
48
48
  :hover {
@@ -52,7 +52,7 @@
52
52
  -ms-filter: brightness(80%);
53
53
  filter: brightness(80%);
54
54
  }
55
- `,k=l.default.div`
55
+ `,M=l.default.div`
56
56
  display: flex;
57
57
  flex-direction: row;
58
58
  align-items: center;
@@ -66,7 +66,7 @@
66
66
  background-repeat: no-repeat;
67
67
  width: 15px;
68
68
  height: 15px;
69
- `,j={document:({message:n})=>{let t=n.content.split("/"),a=t[t.length-1];return e.jsx(w,{className:"bc-fileMessage",...n,children:e.jsxs(y,{href:n.content,target:"_blank",download:a,rel:"noopener noreferrer",...n,children:[e.jsx(A,{color:(i=n,i.isAgent,"000000")}),e.jsx("span",{children:a})]})});var i},image:({message:n})=>e.jsx("div",{className:"bc-mediaMessage",style:{backgroundImage:x(n),color:b(n),borderColor:m(n),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})=>{return e.jsx(M,{href:"https://www.google.com/maps/?q="+n.content,target:"_blank",rel:"noopener noreferrer",className:"bc-locationMessage",isAgent:n.isAgent,children:e.jsxs(k,{children:[e.jsx(L,{color:(t=n,t.isAgent,"000000")}),e.jsx(I,{color:b(n),children:"Open location"})]})});var t},text:({message:n})=>{const t=i.franc(n.content);return e.jsxs("div",{className:"bc-textMessage",style:{backgroundImage:x(n),color:b(n),borderColor:m(n),borderWidth:"1px",borderStyle:"solid",direction:"arb"===t?"rtl":"ltr"},children:[n.context&&n.context.replyToId?e.jsx(C,{context:n.context,isAgent:n.isAgent,language:t}):null,(n.content&&n.content.indexOf("\n")>-1?n.content.split("\n"):[n.content]).map(((t,a)=>e.jsx(d.default,{children:t},`${n.messageId}-${a}`)))]})},video:v,audio:v,interactive:null,template:({message:t})=>{const a=n.useMemo((()=>{try{return JSON.parse(t.content)}catch(e){return void console.log(e.message)}}),[t]);return e.jsxs("div",{style:{backgroundImage:x(t),color:b(t),borderColor:m(t),borderWidth:"1px",borderStyle:"solid"},children:[e.jsx("b",{children:"Template message:"})," ",a.name," ",a.language?.code?`/ ${a.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 a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===t&&a.firstChild?a.insertBefore(i,a.firstChild):a.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}z(".bc-agentMessage,\n.bc-clientMessage {\n margin: 10px 15px;\n font-size: var(--bc-chat-fontSize-sm); }\n .bc-agentMessage div p,\n .bc-clientMessage div p {\n padding: 0;\n margin: 0; }\n\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.status-icon.read {\n color: var(--bc-chat-success-color); }\n\n.status-icon.failed {\n color: var(--bc-chat-danger-color); }\n .status-icon.failed .resend {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer;\n margin: 0 10px; }\n\n.bc-agentMessage > div:not(.bc-debugCon),\n.bc-clientMessage > div:not(.bc-debugCon) {\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-agentMessage .bc-fileMessage,\n.bc-clientMessage .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-agentMessage .bc-fileMessage img,\n .bc-clientMessage .bc-fileMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 15px;\n height: 16px; }\n\n.bc-agentMessage .bc-locationMessage,\n.bc-clientMessage .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-agentMessage .bc-locationMessage img,\n .bc-clientMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n\n.bc-agentMessage {\n text-align: left;\n display: flex;\n align-items: flex-end;\n flex-wrap: wrap;\n gap: 5px; }\n .bc-agentMessage .bc-fileMessage,\n .bc-agentMessage .bc-locationMessage {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer; }\n .bc-agentMessage .bc-fileMessage img,\n .bc-agentMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n .bc-agentMessage > div:not(.bc-debugCon),\n .bc-agentMessage .bc-fileMessage,\n .bc-agentMessage .bc-locationMessage,\n .bc-agentMessage audio {\n border-bottom-left-radius: 0; }\n\n.bc-agentMessage:first-child {\n flex: 1 0 50%; }\n\n.bc-agentMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%; }\n\n.bc-clientMessage {\n padding-left: 20px;\n text-align: right; }\n .bc-clientMessage > div:not(.bc-debugCon),\n .bc-clientMessage .bc-fileMessage,\n .bc-clientMessage .bc-locationMessage,\n .bc-clientMessage audio {\n color: #fff;\n border-bottom-right-radius: 0; }\n .bc-clientMessage svg path:nth-child(2) {\n fill: #fff; }\n\n.bc-mediaMessage video,\n.bc-mediaMessage img {\n width: 300px;\n margin-bottom: -5px; }\n\n.bc-mediaMessage.audio video {\n height: 40px; }\n\n.bc-response-debug {\n background-color: transparent;\n color: #f5a623;\n padding: 0; }\n .bc-response-debug span {\n text-decoration: underline; }\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");const B=l.default.i`
69
+ `,j={document:({message:n})=>{let t=n.content.split("/"),i=t[t.length-1];return e.jsx(w,{className:"bc-fileMessage",...n,children:e.jsxs(k,{href:n.content,target:"_blank",download:i,rel:"noopener noreferrer",...n,children:[e.jsx(y,{color:(a=n,a.isAgent,"000000")}),e.jsx("span",{children:i})]})});var a},image:({message:n})=>e.jsx("div",{className:"bc-mediaMessage",style:{backgroundImage:h(n),color:x(n),borderColor:b(n),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})=>{return e.jsx(A,{href:"https://www.google.com/maps/?q="+n.content,target:"_blank",rel:"noopener noreferrer",className:"bc-locationMessage",isAgent:n.isAgent,children:e.jsxs(M,{children:[e.jsx(L,{color:(t=n,t.isAgent,"000000")}),e.jsx(I,{color:x(n),children:"Open location"})]})});var t},text:({message:n})=>{const t=a.franc(n.content);return e.jsxs("div",{className:"bc-textMessage",style:{backgroundImage:h(n),color:x(n),borderColor:b(n),borderWidth:"1px",borderStyle:"solid",direction:"arb"===t?"rtl":"ltr"},children:[n.context&&n.context.replyToId?e.jsx(C,{context:n.context,isAgent:n.isAgent,language:t}):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})=>{const i=n.useMemo((()=>{try{return JSON.parse(t.content)}catch(e){return void console.log(e.message)}}),[t]);return e.jsxs("div",{style:{backgroundImage:h(t),color:x(t),borderColor:b(t),borderWidth:"1px",borderStyle:"solid"},children:[e.jsx("b",{children:"Template message:"})," ",i.name," ",i.language?.code?`/ ${i.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],a=document.createElement("style");a.type="text/css","top"===t&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}D(".bc-agentMessage,\n.bc-clientMessage {\n margin: 10px 15px;\n font-size: var(--bc-chat-fontSize-sm);\n}\n.bc-agentMessage div p,\n.bc-clientMessage div p {\n padding: 0;\n margin: 0;\n}\n\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.status-icon.read {\n color: var(--bc-chat-success-color);\n}\n.status-icon.failed {\n color: var(--bc-chat-danger-color);\n}\n.status-icon.failed .resend {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer;\n margin: 0 10px;\n}\n\n.bc-agentMessage > div:not(.bc-debugCon),\n.bc-clientMessage > div:not(.bc-debugCon) {\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-agentMessage .bc-fileMessage,\n.bc-clientMessage .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-agentMessage .bc-fileMessage img,\n.bc-clientMessage .bc-fileMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 15px;\n height: 16px;\n}\n.bc-agentMessage .bc-locationMessage,\n.bc-clientMessage .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-agentMessage .bc-locationMessage img,\n.bc-clientMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px;\n}\n\n.bc-agentMessage {\n text-align: left;\n display: flex;\n align-items: flex-end;\n flex-wrap: wrap;\n gap: 5px;\n}\n.bc-agentMessage .bc-fileMessage,\n.bc-agentMessage .bc-locationMessage {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer;\n}\n.bc-agentMessage .bc-fileMessage img,\n.bc-agentMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px;\n}\n.bc-agentMessage > div:not(.bc-debugCon),\n.bc-agentMessage .bc-fileMessage,\n.bc-agentMessage .bc-locationMessage,\n.bc-agentMessage audio {\n border-bottom-left-radius: 0;\n}\n\n.bc-agentMessage:first-child {\n flex: 1 0 50%;\n}\n\n.bc-agentMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%;\n}\n\n.bc-clientMessage {\n padding-left: 20px;\n text-align: right;\n}\n.bc-clientMessage > div:not(.bc-debugCon),\n.bc-clientMessage .bc-fileMessage,\n.bc-clientMessage .bc-locationMessage,\n.bc-clientMessage audio {\n color: #fff;\n border-bottom-right-radius: 0;\n}\n.bc-clientMessage 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-response-debug {\n background-color: transparent;\n color: #f5a623;\n padding: 0;\n}\n.bc-response-debug span {\n text-decoration: underline;\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}");const B=l.default.i`
70
70
  background-image: url(${e=>e.avatar||p});
71
71
  width: 30px;
72
72
  height: 30px;
@@ -76,7 +76,7 @@
76
76
  border-radius: 50%;
77
77
  background-repeat: no-repeat;
78
78
 
79
- `;function F(e,n){return"note"===e?"bc-note":n?"bc-agentMessage":"bc-clientMessage"}const R=n=>{const{type:t,isAgent:a}=n.message,i=n.message.isAgent&&n.message.agentId&&n.agentsIdsAvatarsMap?.[n.message.agentId]||n.config?.brandLogo,o=j[t]??null;return o?e.jsxs("div",{className:F(t,a),id:n.message.messageId,children:[a&&"note"!==t?e.jsx(B,{avatar:i}):null,e.jsx(o,{message:n.message}),a&&"note"!==t?e.jsx(D,{message:n.message}):null]}):null},N=l.default.div`
79
+ `;function F(e,n){return"note"===e?"bc-note":n?"bc-agentMessage":"bc-clientMessage"}const N=n=>{const{type:t,isAgent:i}=n.message,a=n.message.isAgent&&n.message.agentId&&n.agentsIdsAvatarsMap?.[n.message.agentId]||n.config?.brandLogo,o=j[t]??null;return o?e.jsxs("div",{className:F(t,i),id:n.message.messageId,children:[i&&"note"!==t?e.jsx(B,{avatar:a}):null,e.jsx(o,{message:n.message}),i&&"note"!==t?e.jsx(z,{message:n.message}):null]}):null},R=l.default.div`
80
80
  width: 100%;
81
81
  display: flex;
82
82
  align-items: center;
@@ -89,7 +89,7 @@
89
89
  align-items: center;
90
90
  ${e=>e.centered?"":e.isAgent?"margin-left: 34px;":"margin-right: 8px;"}
91
91
  }
92
- `,Z=({message:n})=>e.jsx("div",{children:e.jsx(N,{isAgent:n.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`
92
+ `,Z=({message:n})=>e.jsx("div",{children:e.jsx(R,{isAgent:n.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
93
  width: 90%;
94
94
  display: flex;
95
95
  align-items: center;
@@ -112,24 +112,24 @@
112
112
  background-size: 100% 100%;
113
113
  background-image: ${e=>`url(${e.config.backgroundImage})`};
114
114
  ${e=>e.config.backgroundColor&&`background-color: ${e.config.backgroundColor};`}
115
- `,P=({sendMessage:t,debug:a,config:i,messages:o,onReachingUp:r,agentsIdsAvatarsMap:s})=>{const c=n.useRef(null),l=n.useRef(0);return n.useEffect((()=>{const e=document.getElementById(h);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}),[o]),e.jsx(K,{ref:c,id:h,config:i,children:o?.map(((n,r)=>"seperator"===n.type?e.jsx(J,{data:n,config:i}):e.jsxs("div",{children:[e.jsx(R,{message:n,index:r,sendMessage:t,messageActionsEnabled:o.length-1===r,debug:a,config:i,agentsIdsAvatarsMap:s}),e.jsx(Z,{message:n})]},n.messageId?n.messageId:"message"+r)))},h)},T="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`
115
+ `,T=({sendMessage:t,debug:i,config:a,messages:o,onReachingUp:r,agentsIdsAvatarsMap:s})=>{const c=n.useRef(null),l=n.useRef(0);return n.useEffect((()=>{const e=document.getElementById(m);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}),[o]),e.jsx(K,{ref:c,id:m,config:a,children:o?.map(((n,r)=>"seperator"===n.type?e.jsx(J,{data:n,config:a}):e.jsxs("div",{children:[e.jsx(N,{message:n,index:r,sendMessage:t,messageActionsEnabled:o.length-1===r,debug:i,config:a,agentsIdsAvatarsMap:s}),e.jsx(Z,{message:n})]},n.messageId?n.messageId:"message"+r)))},m)},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
116
  cursor: pointer;
117
117
  width: 20px;
118
118
  height: 20px;
119
119
  margin: 5px;
120
- `,U=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),W=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),Y=({file:n,isFileSelected:t,cancelFileUpload:a})=>e.jsxs("div",{className:"bc-uploadFileDetails",style:{border:t?"green dashed 1px":""},id:"uploadFileDetails",children:[e.jsx("div",{className:"bc-uploadedFile",children:g.SupportedImageFormats.indexOf(n.extension)>=0?e.jsx("img",{src:n.fileUrl,alt:"",className:"bc-imageFile"}):e.jsx("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPq0lEQVR4nO2caXQUVRbHc2bmw8wXP82MJiyByKiDEHCYccN9QXFFEURxZlRcZkBRXHAXN0TZ3FAIKqABEQggSxKWRBwdBR0cUMCQQEhn6e5s3Z1OSIcl/e6c11WVfvXqvlevqjvCHOqe8zt+qeqU95f/va9aMCPDK6+88sorr7zyyiuvvPLKK6+8Os4rVnrKRbGSrCmx0sy5sZKsPEq7iZ557Zt65rXZ0jsvStnIkq1RnODt1uLek1uKsse0FvX73bH+9z7uqq3k9yfHSjO3xEqzQKMHxEo02rvoCe2be8JBE70StG0y07qpN7RuNBPdmA3RDUlaEvSBSHH20UhRn+LQht7nH+s+HBcF3/T8Tawkc2dHl4ykkHYFIbyMNipjEyJjo1VGgmKNcHGfeKSo79yqLdm/zjiRq720xyRMhrt0YDLE6TCERLroC+GivhtOaCkdpZnfpCsdrS7TEdFlGISK+qyDKRm/yDgRq6M00+8mHW3dkI4IpSiREirl1YwTsTpKshrt0nHw50pHkSYjIaQwh4TW9xmdcaJVrEuIg1GllI5s1+kIJ8iBcGHftnBhzsCME1JISYrp2Ji+dISpDJ3m9TlVrWtP+23GiSXkOExHUQ4dWxrrczbB8oxfZpwwQo7TdIQMIYWn0n/Oblp/6hB3nJFk9RlDAt3CwCHVPMuT1K4YkBtYPtj+W4lYSY/G7k9HH/fpKDSEnArNlPUG/aDJYJ3BH6DRYK1Gw9rTkqzRqF9zuongZ5QzTARWU/7YhZ+yitI/QR3LyjMT1LIUDIAanhUDwLd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oK09xlYNRf1OylQkLmzdtkpQMUcC2o+pZwC1Ut1PjkFfJ9kgm9JJlRRFmfCgcVZGvlZUEn5uAfsp3zUA/ZRFvWECspCSi8oX6Cx90NK70Qjjgf2LsrZUZHf7yRUhllM7/7BVVmzgyuz8ln8tvR0QK8kBb3y63RqllOyk3yapJpnaXZ+FWVJH43FSQ4kyMnfv/jU/P0fa+wz+OjYsv/jfjMr8vv3txXhlVdeeeWVV1555ZVXXnnllVdeeeWVV1555VXG/2f9D+lROV6EKZDWAAAAAElFTkSuQmCC",alt:"",className:"bc-documentFile"})}),e.jsx("div",{className:"bc-uploadFileName",children:e.jsx("span",{children:n.fileName})}),e.jsx("div",{className:"bc-uploadFileCancel",children:e.jsx("span",{onClick:a,children:e.jsx(W,{})})})]}),V=({text:t,setText:a,config:i,send:o})=>{const r=n.useRef(null),s=n.useCallback((()=>{const e=r.current;e.style.height="20px";const n=e.scrollHeight;n!==e.offsetHeight&&(e.style.height=n+"px")}),[]);return n.useEffect((()=>{t||(s(),r.current.focus())}),[s,t]),e.jsx("textarea",{ref:r,value:t,className:"bc-messageInputTextArea",id:"textInput",placeholder:i.inputPlaceholder||H[i.language]?.placeholder,maxLength:1024,onKeyDown:e=>{if("Enter"===e.key&&(e.shiftKey||e.ctrlKey||e.altKey)){e.preventDefault();const n=r.current.selectionStart,i=t.slice(0,n)+"\n"+t.slice(n);return a(i),void s()}"Enter"===e.key&&(e.preventDefault(),o(),s())},onChange:e=>{a(e.target.value),s()}})},O=({config:n,send:t,file:a,isFileSelected:i,text:o,setText:r,cancelFileUpload:s})=>e.jsxs("div",{className:"bc-messageInput",children:[a?e.jsx(Y,{file:a,isFileSelected:i,cancelFileUpload:s}):e.jsx(V,{text:o,setText:r,config:n,send:t}),e.jsx(Q,{onClick:()=>t(),children:o||a?e.jsx(U,{}):null})]});async function q(e,n,t){const a=new r.BlobServiceClient("https://bcuserres.blob.core.windows.net?sp=rc&st=2024-12-31T17:52:49Z&se=2026-01-01T01:52:49Z&spr=https&sv=2022-11-02&sr=c&sig=ZM%2Fdd4vGMglDs%2F9GtJ8y510iYCcXpUO%2Bj5CvVAq8QDg%3D",new r.AnonymousCredential).getContainerClient("anonymous"),i=new Date,s=`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}`,c=a.getBlockBlobClient(`${s}/${o.v4()}`);try{await c.uploadBrowserData(e,{onProgress:t=>{const a=Math.round(t.loadedBytes/e.size*100);n(a)},blockSize:4194304,concurrency:20,blobHTTPHeaders:{blobContentType:e.type}});t(c.url.split("?")[0])}catch(e){t(void 0,"Error uploading file:"+e.message)}}const X=(e,n)=>`\n &:hover {\n background-image: ${e.replaceAll("%23a3a3a3",n.activeColor)};\n }\n background-image: ${n.isActive?e.replaceAll("%23a3a3a3",n.activeColor):e};\n`,$=l.default.i`
120
+ `,U=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),W=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),Y=({file:n,isFileSelected:t,cancelFileUpload:i})=>e.jsxs("div",{className:"bc-uploadFileDetails",style:{border:t?"green dashed 1px":""},id:"uploadFileDetails",children:[e.jsx("div",{className:"bc-uploadedFile",children:g.SupportedImageFormats.indexOf(n.extension)>=0?e.jsx("img",{src:n.fileUrl,alt:"",className:"bc-imageFile"}):e.jsx("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPq0lEQVR4nO2caXQUVRbHc2bmw8wXP82MJiyByKiDEHCYccN9QXFFEURxZlRcZkBRXHAXN0TZ3FAIKqABEQggSxKWRBwdBR0cUMCQQEhn6e5s3Z1OSIcl/e6c11WVfvXqvlevqjvCHOqe8zt+qeqU95f/va9aMCPDK6+88sorr7zyyiuvvPLKK6+8Os4rVnrKRbGSrCmx0sy5sZKsPEq7iZ557Zt65rXZ0jsvStnIkq1RnODt1uLek1uKsse0FvX73bH+9z7uqq3k9yfHSjO3xEqzQKMHxEo02rvoCe2be8JBE70StG0y07qpN7RuNBPdmA3RDUlaEvSBSHH20UhRn+LQht7nH+s+HBcF3/T8Tawkc2dHl4ykkHYFIbyMNipjEyJjo1VGgmKNcHGfeKSo79yqLdm/zjiRq720xyRMhrt0YDLE6TCERLroC+GivhtOaCkdpZnfpCsdrS7TEdFlGISK+qyDKRm/yDgRq6M00+8mHW3dkI4I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VQl2cjAx2s8/tPUSKF/Qt9kiJLiyx9zaFVnQ8eMEbY+gpyu7caXyVp5iOr6Xp0NdBpsKVkSqEhTFfHcuHPziQihbkA0VH/WbYxECUzJ+5S/IrK9ddjL4V2ZD5MvhEN12K0S3jdYZpXMLRLdSRkJ0680Q3XqTzgiIbr0Rot8Y3ADRrynX61wH0a+v1bkGol8PT/Lvq3WGQfQrnS+v1LkCWij/ulzji8sgssXgEo3PKRdDS+lFEElwIYQpmylDIbyJcr7OeRDaaHAuhDacA6ENZ/+s1K89C8oX5kDZB71pOoK09xlYNRf1OylQkLmzdtkpQMUcC2o+pZwC1Ut1PjkFfJ9kgm9JJlRRFmfCgcVZGvlZUEn5uAfsp3zUA/ZRFvWECspCSi8oX6Cx90NK70Qjjgf2LsrZUZHf7yRUhllM7/7BVVmzgyuz8ln8tvR0QK8kBb3y63RqllOyk3yapJpnaXZ+FWVJH43FSQ4kyMnfv/jU/P0fa+wz+OjYsv/jfjMr8vv3txXhlVdeeeWVV1555ZVXXnnllVdeeeWVV1555VXG/2f9D+lROV6EKZDWAAAAAElFTkSuQmCC",alt:"",className:"bc-documentFile"})}),e.jsx("div",{className:"bc-uploadFileName",children:e.jsx("span",{children:n.fileName})}),e.jsx("div",{className:"bc-uploadFileCancel",children:e.jsx("span",{onClick:i,children:e.jsx(W,{})})})]}),V=({text:t,setText:i,config:a,send:o})=>{const r=n.useRef(null),s=n.useCallback((()=>{const e=r.current;e.style.height="20px";const n=e.scrollHeight;n!==e.offsetHeight&&(e.style.height=n+"px")}),[]);return n.useEffect((()=>{t||(s(),r.current.focus())}),[s,t]),e.jsx("textarea",{ref:r,value:t,className:"bc-messageInputTextArea",id:"textInput",placeholder:a.inputPlaceholder||H[a.language]?.placeholder,maxLength:1024,onKeyDown:e=>{if("Enter"===e.key&&(e.shiftKey||e.ctrlKey||e.altKey)){e.preventDefault();const n=r.current.selectionStart,a=t.slice(0,n)+"\n"+t.slice(n);return i(a),void s()}"Enter"===e.key&&(e.preventDefault(),o(),s())},onChange:e=>{i(e.target.value),s()}})},O=({config:n,send:t,file:i,isFileSelected:a,text:o,setText:r,cancelFileUpload:s})=>e.jsxs("div",{className:"bc-messageInput",children:[i?e.jsx(Y,{file:i,isFileSelected:a,cancelFileUpload:s}):e.jsx(V,{text:o,setText:r,config:n,send:t}),e.jsx(Q,{onClick:()=>t(),children:o||i?e.jsx(U,{}):null})]});async function q(e,n,t){const i=new r.BlobServiceClient("https://bcuserres.blob.core.windows.net?sp=rc&st=2024-12-31T17:52:49Z&se=2026-01-01T01:52:49Z&spr=https&sv=2022-11-02&sr=c&sig=ZM%2Fdd4vGMglDs%2F9GtJ8y510iYCcXpUO%2Bj5CvVAq8QDg%3D",new r.AnonymousCredential).getContainerClient("anonymous"),a=new Date,s=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}`,c=i.getBlockBlobClient(`${s}/${o.v4()}`);try{await c.uploadBrowserData(e,{onProgress:t=>{const i=Math.round(t.loadedBytes/e.size*100);n(i)},blockSize:4194304,concurrency:20,blobHTTPHeaders:{blobContentType:e.type}});t(c.url.split("?")[0])}catch(e){t(void 0,"Error uploading file:"+e.message)}}const X=(e,n)=>`\n &:hover {\n background-image: ${e.replaceAll("%23a3a3a3",n.activeColor)};\n }\n background-image: ${n.isActive?e.replaceAll("%23a3a3a3",n.activeColor):e};\n`,$=l.default.i`
121
121
  ${e=>X("url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='50' height='50' viewBox='0 0 48 48'%3E%3Cpath d='M 19.5 3 C 17.585045 3 16 4.5850452 16 6.5 L 16 23.253906 A 1.50015 1.50015 0 0 0 16 23.740234 L 16 32.5 C 16 34.414955 17.585045 36 19.5 36 L 30.5 36 C 32.414955 36 34 34.414955 34 32.5 L 34 23.746094 A 1.50015 1.50015 0 0 0 34 23.259766 L 34 6.5 C 34 4.5850452 32.414955 3 30.5 3 L 19.5 3 z M 19.5 6 L 30.5 6 C 30.795045 6 31 6.2049548 31 6.5 L 31 22 L 19 22 L 19 6.5 C 19 6.2049548 19.204955 6 19.5 6 z M 11.476562 21.978516 A 1.50015 1.50015 0 0 0 10 23.5 L 10 32.5 C 10 37.728774 14.271226 42 19.5 42 L 23.5 42 L 23.5 46 A 1.50015 1.50015 0 1 0 26.5 46 L 26.5 42 L 30.5 42 C 35.728774 42 40 37.728774 40 32.5 L 40 23.5 A 1.50015 1.50015 0 1 0 37 23.5 L 37 32.5 C 37 36.107226 34.107226 39 30.5 39 L 19.5 39 C 15.892774 39 13 36.107226 13 32.5 L 13 23.5 A 1.50015 1.50015 0 0 0 11.476562 21.978516 z M 19 25 L 31 25 L 31 32.5 C 31 32.795045 30.795045 33 30.5 33 L 19.5 33 C 19.204955 33 19 32.795045 19 32.5 L 19 25 z M 25 27 A 2 2 0 0 0 25 31 A 2 2 0 0 0 25 27 z' fill='%23a3a3a3'%3E%3C/path%3E%3C/svg%3E%0A\");",e)}
122
122
  `,_=l.default.div`
123
123
  ${e=>e.isRecording&&`\n &:before {\n transform: scale(${1+e.audioLevel/255});\n opacity: ${.6+e.audioLevel/255*.4};\n }\n `}
124
- `,ee=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"#666",fillRule:"evenodd",clipRule:"evenodd"})}),ne=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),te=({setProgress:t,setFile:a,setError:i,send:o})=>{const[r,s]=n.useState(!1),[c,l]=n.useState(0),d=n.useRef(null),g=n.useRef(null),p=n.useRef(null),u=n.useRef(null),h=n.useRef(null),x=n.useRef(null);n.useEffect((()=>{const e=document.createElement("script");return e.src="https://cdn.bcrumbs.net/bc-assets/scripts/mic-recorder-to-mp3.js",e.async=!0,e.onload=()=>console.log("Voice recording library loaded successfully"),e.onerror=()=>{console.error("Failed to load voice recording library"),i("Failed to load voice recording library. Please refresh the page.")},document.body.appendChild(e),()=>{document.body.contains(e)&&document.body.removeChild(e)}}),[i]);const m=n.useCallback((e=>{try{if(!e.active)return void navigator.mediaDevices.getUserMedia({audio:{sampleRate:48e3,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,googEchoCancellation:!0,googAutoGainControl:!0,googNoiseSuppression:!0,googHighpassFilter:!0,googTypingNoiseDetection:!0,googAudioMirroring:!1}}).then((e=>{g.current=e,m(e)})).catch((e=>{console.error("Failed to get fresh stream:",e)}));p.current=new(window.AudioContext||window.webkitAudioContext),"suspended"===p.current.state&&p.current.resume().then((()=>{}));const n=p.current.createMediaStreamSource(e);u.current=p.current.createAnalyser(),u.current.fftSize=256,u.current.smoothingTimeConstant=.8,u.current.minDecibels=-90,u.current.maxDecibels=-10,n.connect(u.current);const t=u.current.frequencyBinCount;h.current=new Uint8Array(t);const a=()=>{if(!u.current)return void console.log("No analyser available, stopping update loop");u.current.getByteFrequencyData(h.current);let e=0;for(let n=0;n<t;n++)e+=h.current[n]*h.current[n];const n=Math.sqrt(e/t),i=Math.min(255,2*n);l(i),x.current=requestAnimationFrame(a)};a()}catch(e){console.error("Audio level monitoring error:",e)}}),[]),b=n.useCallback((()=>{x.current&&(cancelAnimationFrame(x.current),x.current=null),p.current&&(p.current.close(),p.current=null),l(0)}),[]);n.useEffect((()=>()=>{d.current&&r&&d.current.stop(),g.current&&g.current.getTracks().forEach((e=>e.stop())),b()}),[r,b]);const f=n.useCallback((()=>{if(!d.current){if("function"!=typeof MicRecorder)return void i("Please wait a little until voice library is loaded");d.current=new MicRecorder({bitRate:256,sampleRate:48e3})}i(void 0),r?d.current.stop().getMp3().then((([e,n])=>{if(s(!1),b(),n.size<1e3)return void i("Recording seems too short. Please try again.");q(new File([n],"recording.mp3",{type:"audio/mpeg"}),t,((e,n)=>{e?o({fileUrl:e,fileName:"recording",extension:"mp3"}):n&&i(n)}))})).catch((e=>{s(!1),b(),i(`Recording failed: ${e.message}`)})):navigator.mediaDevices.getUserMedia({audio:{sampleRate:48e3,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,googEchoCancellation:!0,googAutoGainControl:!0,googNoiseSuppression:!0,googHighpassFilter:!0,googTypingNoiseDetection:!0,googAudioMirroring:!1}}).then((e=>{g.current=e,d.current.start().then((()=>{s(!0),setTimeout((()=>{p.current&&"suspended"===p.current.state?p.current.resume().then((()=>{m(e)})):m(e)}),100)})).catch((n=>{i(`Failed to start recording: ${n.message}`),e.getTracks().forEach((e=>e.stop()))}))})).catch((e=>{"NotAllowedError"===e.name?i("Microphone access denied. Please allow microphone access and try again."):"NotFoundError"===e.name?i("No microphone found. Please connect a microphone and try again."):i(`Microphone error: ${e.message}`)}))}),[r,i,t,o,m,b]),C=n.useCallback((()=>{d.current&&r&&d.current.stop(),s(!1),b(),i(void 0)}),[r,b,i]);return e.jsxs(e.Fragment,{children:[r?e.jsx("i",{onClick:C,children:e.jsx(ne,{})}):null,e.jsxs("div",{id:"voiceRecorderIcon",className:"mic-container",children:[r?e.jsx("i",{onClick:f,children:e.jsx(ee,{})}):e.jsx($,{onClick:f,activeColor:"var(--bc-chat-dark-gray-color)"}),e.jsx(_,{className:"circle "+(r?"active":""),isRecording:r,audioLevel:c})]})]})};const ae=l.default.i`
124
+ `,ee=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"#666",fillRule:"evenodd",clipRule:"evenodd"})}),ne=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),te=({setProgress:t,setFile:i,setError:a,send:o})=>{const[r,s]=n.useState(!1),[c,l]=n.useState(0),d=n.useRef(null),g=n.useRef(null),p=n.useRef(null),u=n.useRef(null),m=n.useRef(null),h=n.useRef(null);n.useEffect((()=>{const e=document.createElement("script");return e.src="https://cdn.bcrumbs.net/bc-assets/scripts/mic-recorder-to-mp3.js",e.async=!0,e.onload=()=>console.log("Voice recording library loaded successfully"),e.onerror=()=>{console.error("Failed to load voice recording library"),a("Failed to load voice recording library. Please refresh the page.")},document.body.appendChild(e),()=>{document.body.contains(e)&&document.body.removeChild(e)}}),[a]);const b=n.useCallback((e=>{try{if(!e.active)return void navigator.mediaDevices.getUserMedia({audio:{sampleRate:48e3,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,googEchoCancellation:!0,googAutoGainControl:!0,googNoiseSuppression:!0,googHighpassFilter:!0,googTypingNoiseDetection:!0,googAudioMirroring:!1}}).then((e=>{g.current=e,b(e)})).catch((e=>{console.error("Failed to get fresh stream:",e)}));p.current=new(window.AudioContext||window.webkitAudioContext),"suspended"===p.current.state&&p.current.resume().then((()=>{}));const n=p.current.createMediaStreamSource(e);u.current=p.current.createAnalyser(),u.current.fftSize=256,u.current.smoothingTimeConstant=.8,u.current.minDecibels=-90,u.current.maxDecibels=-10,n.connect(u.current);const t=u.current.frequencyBinCount;m.current=new Uint8Array(t);const i=()=>{if(!u.current)return void console.log("No analyser available, stopping update loop");u.current.getByteFrequencyData(m.current);let e=0;for(let n=0;n<t;n++)e+=m.current[n]*m.current[n];const n=Math.sqrt(e/t),a=Math.min(255,2*n);l(a),h.current=requestAnimationFrame(i)};i()}catch(e){console.error("Audio level monitoring error:",e)}}),[]),x=n.useCallback((()=>{h.current&&(cancelAnimationFrame(h.current),h.current=null),p.current&&(p.current.close(),p.current=null),l(0)}),[]);n.useEffect((()=>()=>{d.current&&r&&d.current.stop(),g.current&&g.current.getTracks().forEach((e=>e.stop())),x()}),[r,x]);const f=n.useCallback((()=>{if(!d.current){if("function"!=typeof MicRecorder)return void a("Please wait a little until voice library is loaded");d.current=new MicRecorder({bitRate:256,sampleRate:48e3})}a(void 0),r?d.current.stop().getMp3().then((([e,n])=>{if(s(!1),x(),n.size<1e3)return void a("Recording seems too short. Please try again.");q(new File([n],"recording.mp3",{type:"audio/mpeg"}),t,((e,n)=>{e?o({fileUrl:e,fileName:"recording",extension:"mp3"}):n&&a(n)}))})).catch((e=>{s(!1),x(),a(`Recording failed: ${e.message}`)})):navigator.mediaDevices.getUserMedia({audio:{sampleRate:48e3,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,googEchoCancellation:!0,googAutoGainControl:!0,googNoiseSuppression:!0,googHighpassFilter:!0,googTypingNoiseDetection:!0,googAudioMirroring:!1}}).then((e=>{g.current=e,d.current.start().then((()=>{s(!0),setTimeout((()=>{p.current&&"suspended"===p.current.state?p.current.resume().then((()=>{b(e)})):b(e)}),100)})).catch((n=>{a(`Failed to start recording: ${n.message}`),e.getTracks().forEach((e=>e.stop()))}))})).catch((e=>{"NotAllowedError"===e.name?a("Microphone access denied. Please allow microphone access and try again."):"NotFoundError"===e.name?a("No microphone found. Please connect a microphone and try again."):a(`Microphone error: ${e.message}`)}))}),[r,a,t,o,b,x]),C=n.useCallback((()=>{d.current&&r&&d.current.stop(),s(!1),x(),a(void 0)}),[r,x,a]);return e.jsxs(e.Fragment,{children:[r?e.jsx("i",{onClick:C,children:e.jsx(ne,{})}):null,e.jsxs("div",{id:"voiceRecorderIcon",className:"mic-container",children:[r?e.jsx("i",{onClick:f,children:e.jsx(ee,{})}):e.jsx($,{onClick:f,activeColor:"var(--bc-chat-dark-gray-color)"}),e.jsx(_,{className:"circle "+(r?"active":""),isRecording:r,audioLevel:c})]})]})};const ie=l.default.i`
125
125
  ${e=>X("url(\"data:image/svg+xml,%3Csvg id='Component_25_5' data-name='Component 25 – 5' xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 15.999 16'%3E%3Cpath id='Path_805' data-name='Path 805' d='M8,16a8,8,0,1,1,8-8,8.009,8.009,0,0,1-8,8M8,1.211A6.789,6.789,0,1,0,14.788,8,6.8,6.8,0,0,0,8,1.211' fill='%23a3a3a3'/%3E%3Cpath id='Path_806' data-name='Path 806' d='M10.908,19.478a4.716,4.716,0,0,1-3.359-1.392.605.605,0,0,1,.856-.856,3.537,3.537,0,0,0,5,0,.605.605,0,1,1,.856.856,4.716,4.716,0,0,1-3.359,1.392' transform='translate(-2.908 -6.728)' fill='%23a3a3a3'/%3E%3Cpath id='Path_807' data-name='Path 807' d='M7.306,10.925A1.635,1.635,0,1,1,8.942,9.289a1.638,1.638,0,0,1-1.635,1.635m0-2.06a.424.424,0,1,0,.424.424.425.425,0,0,0-.424-.424' transform='translate(-2.237 -3.02)' fill='%23a3a3a3'/%3E%3Cpath id='Path_808' data-name='Path 808' d='M16.986,10.925a1.635,1.635,0,1,1,1.635-1.635,1.638,1.638,0,0,1-1.635,1.635m0-2.06a.424.424,0,1,0,.424.424.425.425,0,0,0-.424-.424' transform='translate(-6.056 -3.02)' fill='%23a3a3a3'/%3E%3C/svg%3E%0A\");",e)}
126
- `,ie=l.default.span`
126
+ `,ae=l.default.span`
127
127
  margin: 8px;
128
128
  cursor: pointer;
129
129
  font-size: var(--bc-chat-fontSize-xl);
130
- `,oe=({onClick:n})=>e.jsx("div",{id:"emojiIcon",children:e.jsx(ae,{onClick:n,activeColor:"var(--bc-chat-dark-gray-color)"})}),re=({text:t,setText:a,onClick:i})=>{const o=function(e){const t=n.useRef(null);return n.useEffect((()=>{const n=n=>{t.current&&!t.current.contains(n.target)&&e()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}}),[e]),t}(i),r=n.useCallback((e=>{a(t+e)}),[a,t]),s=u.map(((n,t)=>e.jsx(ie,{className:"emoji",onClick:e=>r(e.target.innerText),children:n},"emoji"+t)));return e.jsx("div",{ref:o,children:e.jsx("div",{className:"bc-emojiPicker",id:"emojiPicker",children:s})})},se=l.default.i`
130
+ `,oe=({onClick:n})=>e.jsx("div",{id:"emojiIcon",children:e.jsx(ie,{onClick:n,activeColor:"var(--bc-chat-dark-gray-color)"})}),re=({text:t,setText:i,onClick:a})=>{const o=function(e){const t=n.useRef(null);return n.useEffect((()=>{const n=n=>{t.current&&!t.current.contains(n.target)&&e()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}}),[e]),t}(a),r=n.useCallback((e=>{i(t+e)}),[i,t]),s=u.map(((n,t)=>e.jsx(ae,{className:"emoji",onClick:e=>r(e.target.innerText),children:n},"emoji"+t)));return e.jsx("div",{ref:o,children:e.jsx("div",{className:"bc-emojiPicker",id:"emojiPicker",children:s})})},se=l.default.i`
131
131
  ${e=>X("url(\"data:image/svg+xml,%3Csvg id='attach' xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 15.317 16'%3E%3Cpath id='Path_690' data-name='Path 690' d='M-431.392,1429.762a4.112,4.112,0,0,1-2.928-1.213,4.145,4.145,0,0,1,0-5.854l8.066-8.065a2.94,2.94,0,0,1,2.094-.867,2.94,2.94,0,0,1,2.094.867,2.941,2.941,0,0,1,.867,2.094,2.94,2.94,0,0,1-.867,2.094l-8.065,8.066a1.826,1.826,0,0,1-2.523,0,1.773,1.773,0,0,1-.522-1.261,1.773,1.773,0,0,1,.523-1.262l8.065-8.065a.606.606,0,0,1,.857,0,.6.6,0,0,1,0,.856l-8.065,8.066a.566.566,0,0,0-.168.4.569.569,0,0,0,.168.4.585.585,0,0,0,.809,0l8.066-8.066a1.738,1.738,0,0,0,.512-1.238,1.739,1.739,0,0,0-.512-1.238,1.792,1.792,0,0,0-2.475,0l-8.066,8.065a2.933,2.933,0,0,0,0,4.141,2.933,2.933,0,0,0,4.141,0l8.075-8.075a.6.6,0,0,1,.857,0,.6.6,0,0,1,0,.856l-8.075,8.075A4.111,4.111,0,0,1-431.392,1429.762Z' transform='translate(435.53 -1413.762)' fill='%23a3a3a3'/%3E%3C/svg%3E%0A\");",e)}
132
- `,ce=({setProgress:t,setFile:a,setError:i})=>{const o=n.useCallback((e=>{a(void 0),i(void 0);const n=Array.from(e.target.files);if(e.target.value="",n.length<1)return;const o=n[0],{name:r,size:s}=o,c=r.substring(r.lastIndexOf(".")+1).toLowerCase();return g.SupportedFormats.indexOf(c)<0?i("File type is not valid."):s>g.MaxFileSize?i("Maximum limit is 20 MBs"):void q(o,t,((e,n)=>{e?a({fileUrl:e,fileName:r,extension:c}):n&&i(n)}))}),[t,a,i]);return e.jsxs("div",{id:"attachIcon",children:[e.jsx("label",{htmlFor:"fileInput",children:e.jsx(se,{activeColor:"var(--bc-chat-dark-gray-color)"})}),e.jsx("input",{type:"file",className:"bc-fileUpload",id:"fileInput",onChange:o})]})},le=l.default.div`
132
+ `,ce=({setProgress:t,setFile:i,setError:a})=>{const o=n.useCallback((e=>{i(void 0),a(void 0);const n=Array.from(e.target.files);if(e.target.value="",n.length<1)return;const o=n[0],{name:r,size:s}=o,c=r.substring(r.lastIndexOf(".")+1).toLowerCase();return g.SupportedFormats.indexOf(c)<0?a("File type is not valid."):s>g.MaxFileSize?a("Maximum limit is 20 MBs"):void q(o,t,((e,n)=>{e?i({fileUrl:e,fileName:r,extension:c}):n&&a(n)}))}),[t,i,a]);return e.jsxs("div",{id:"attachIcon",children:[e.jsx("label",{htmlFor:"fileInput",children:e.jsx(se,{activeColor:"var(--bc-chat-dark-gray-color)"})}),e.jsx("input",{type:"file",className:"bc-fileUpload",id:"fileInput",onChange:o})]})},le=l.default.div`
133
133
  padding: 0px 0px 0px 10px;
134
134
  margin: 0px;
135
135
  width: fit-content;
@@ -144,7 +144,7 @@
144
144
  cursor: pointer;
145
145
  display: block;
146
146
  }
147
- `,de=({setView:t,setFile:a,setProgress:i,setError:o,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:a,setProgress:i,setError:o}),e.jsx(oe,{onClick:()=>d(!0)}),e.jsx(te,{setFile:a,setError:o,setProgress:i,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`
147
+ `,de=({setView:t,setFile:i,setProgress:a,setError:o,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:a,setError:o}),e.jsx(oe,{onClick:()=>d(!0)}),e.jsx(te,{setFile:i,setError:o,setProgress:a,send:c})]}),l?e.jsx(re,{text:r,setText:s,onClick:()=>d(!1)}):null]})};D('.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\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}\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\n.bc-inputActions {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n height: 38px;\n}\n.bc-inputActions .bc-fileUpload {\n display: none;\n}\n.bc-inputActions i {\n display: block;\n margin: 0 5px;\n}\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 rgba(0, 0, 0, 0.1019607843);\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\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}\n.bc-uploadFileDetails .bc-uploadedFile {\n max-width: 32px;\n max-height: 32px;\n pointer-events: none;\n}\n.bc-uploadFileDetails .bc-uploadedFile .bc-imageFile {\n max-width: 100%;\n max-height: 100%;\n pointer-events: none;\n}\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}\n.bc-uploadFileDetails .bc-uploadFileName {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n pointer-events: none;\n}\n.bc-uploadFileDetails .bc-uploadFileName span {\n padding: 10px;\n pointer-events: none;\n}\n.bc-uploadFileDetails .bc-uploadFileCancel {\n cursor: pointer;\n margin-bottom: -6px;\n}\n\n.mic-container {\n position: relative;\n}\n.mic-container i {\n transition: 0.9s;\n z-index: 10;\n position: relative;\n}\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}\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}\n.mic-container .circle.active {\n background-color: #A8E6A3;\n}\n.mic-container .circle.active:before {\n background: #A8E6A3;\n}\n\n@keyframes bounce {\n 0% {\n transform: scale(1);\n }\n 25% {\n transform: scale(1.4);\n }\n 75% {\n transform: scale(1);\n }\n 100% {\n transform: scale(1.3);\n }\n}');const ge=l.default.div`
148
148
  width: calc(100% - 40px);
149
149
  background-color: #d9d9d94d;
150
150
  padding: 10px 20px;
@@ -162,26 +162,26 @@
162
162
  margin-top: 6px;
163
163
  text-align: center;
164
164
  }
165
- `,pe=({config:t,sendMessage:a,setView:i})=>{const[o,r]=n.useState(),[s,c]=n.useState(),[l,d]=n.useState(),[p,u]=n.useState(0),h=n.useCallback((e=>{if(e){const{fileUrl:n,extension:t}=e;a(g.SupportedImageFormats.indexOf(t)>=0?"image":g.SupportedAudioFormats.indexOf(t)>=0?"audio":"document",n)}else if(s){const{fileUrl:e,extension:n}=s;a(g.SupportedImageFormats.indexOf(n)>=0?"image":g.SupportedAudioFormats.indexOf(n)>=0?"audio":"document",e),c(void 0)}else a(T,o),r("")}),[s,o,a]);return e.jsxs(ge,{children:[e.jsx("div",{className:"bc-InputArea",children:e.jsx(O,{config:t,send:h,text:o,setText:r,file:s,isFileSelected:!!s,cancelFileUpload:()=>c(void 0)})}),e.jsx("div",{className:"bc-CommandsArea",children:e.jsx(de,{setView:i,setFile:c,setProgress:u,setError:d,setText:r,text:o,send:h})}),l?e.jsx("div",{className:"bc-uploadFileError",children:l}):null]})},ue="bc-chat-header-banner",he=390,xe=l.default.div`
166
- ${e=>e.bannerWidth>he?"height: 60px;":"height: 90px;"}
165
+ `,pe=({config:t,sendMessage:i,setView:a})=>{const[o,r]=n.useState(),[s,c]=n.useState(),[l,d]=n.useState(),[p,u]=n.useState(0),m=n.useCallback((e=>{if(e){const{fileUrl:n,extension:t}=e;i(g.SupportedImageFormats.indexOf(t)>=0?"image":g.SupportedAudioFormats.indexOf(t)>=0?"audio":"document",n)}else if(s){const{fileUrl:e,extension:n}=s;i(g.SupportedImageFormats.indexOf(n)>=0?"image":g.SupportedAudioFormats.indexOf(n)>=0?"audio":"document",e),c(void 0)}else i(P,o),r("")}),[s,o,i]);return e.jsxs(ge,{children:[e.jsx("div",{className:"bc-InputArea",children:e.jsx(O,{config:t,send:m,text:o,setText:r,file:s,isFileSelected:!!s,cancelFileUpload:()=>c(void 0)})}),e.jsx("div",{className:"bc-CommandsArea",children:e.jsx(de,{setView:a,setFile:c,setProgress:u,setError:d,setText:r,text:o,send:m})}),l?e.jsx("div",{className:"bc-uploadFileError",children:l}):null]})},ue="bc-chat-header-banner",me=390,he=l.default.div`
166
+ ${e=>e.bannerWidth>me?"height: 60px;":"height: 90px;"}
167
167
  display: block;
168
168
  width: 100%;
169
169
  background-color: transparent;
170
170
  z-index: 10;
171
171
  border-top-left-radius: 15px;
172
172
  border-top-right-radius: 15px;
173
- `,me=l.default.div`
173
+ `,be=l.default.div`
174
174
  width: 100%;
175
175
  display: flex;
176
176
  align-items: center;
177
177
  background-image: ${e=>`linear-gradient(103deg, ${e.startColor},${e.endColor})`};
178
- ${e=>e.bannerWidth<=he?'\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzkwIiBoZWlnaHQ9Ijg4LjM1NCIgdmlld0JveD0iMCAwIDM5MCA4OC4zNTQiPgogIDxkZWZzPgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQiIHgyPSIxIiB5Mj0iMSIgZ3JhZGllbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM2NjJkOTEiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZWUyYTdiIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KICA8cGF0aCBpZD0iUGF0aF84NzgiIGRhdGEtbmFtZT0iUGF0aCA4NzgiIGQ9Ik0xMCwwSDM4MGExMCwxMCwwLDAsMSwxMCwxMFY3MHMtNzUuMDYtNy44ODYtMTk5LjYxNywxMS44NjJTMCw3MCwwLDcwVjEwQTEwLDEwLDAsMCwxLDEwLDAiIGZpbGw9InVybCgjbGluZWFyLWdyYWRpZW50KSIvPgo8L3N2Zz4K");\n mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzkwIiBoZWlnaHQ9Ijg4LjM1NCIgdmlld0JveD0iMCAwIDM5MCA4OC4zNTQiPgogIDxkZWZzPgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQiIHgyPSIxIiB5Mj0iMSIgZ3JhZGllbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM2NjJkOTEiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZWUyYTdiIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KICA8cGF0aCBpZD0iUGF0aF84NzgiIGRhdGEtbmFtZT0iUGF0aCA4NzgiIGQ9Ik0xMCwwSDM4MGExMCwxMCwwLDAsMSwxMCwxMFY3MHMtNzUuMDYtNy44ODYtMTk5LjYxNywxMS44NjJTMCw3MCwwLDcwVjEwQTEwLDEwLDAsMCwxLDEwLDAiIGZpbGw9InVybCgjbGluZWFyLWdyYWRpZW50KSIvPgo8L3N2Zz4K");\n mask-repeat: no-repeat;\n mask-size: auto;\n -webkit-mask-size: auto;\n -webkit-mask-repeat: no-repeat;\n height: 90px;\n ':"height: 60px;"}
179
- `,be=l.default.div`
178
+ ${e=>e.bannerWidth<=me?'\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzkwIiBoZWlnaHQ9Ijg4LjM1NCIgdmlld0JveD0iMCAwIDM5MCA4OC4zNTQiPgogIDxkZWZzPgogICAgPGxpbm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GQ9Ik0xMCwwSDM4MGExMCwxMCwwLDAsMSwxMCwxMFY3MHMtNzUuMDYtNy44ODYtMTk5LjYxNywxMS44NjJTMCw3MCwwLDcwVjEwQTEwLDEwLDAsMCwxLDEwLDAiIGZpbGw9InVybCgjbGluZWFyLWdyYWRpZW50KSIvPgo8L3N2Zz4K");\n mask-repeat: no-repeat;\n mask-size: auto;\n -webkit-mask-size: auto;\n -webkit-mask-repeat: no-repeat;\n height: 90px;\n ':"height: 60px;"}
179
+ `,xe=l.default.div`
180
180
  width: 100%;
181
181
  height: 100%;
182
182
  display: flex;
183
183
  `,fe=l.default.div`
184
- ${e=>e.bannerWidth>he?"padding-bottom: 0 !important;":""}
184
+ ${e=>e.bannerWidth>me?"padding-bottom: 0 !important;":""}
185
185
  display: flex;
186
186
  gap: 10px;
187
187
  align-items: center;
@@ -203,7 +203,7 @@
203
203
  font-style: normal;
204
204
  }
205
205
  `,Ce=l.default.div`
206
- ${e=>e.bannerWidth>he?"padding-bottom: 0 !important;":""}
206
+ ${e=>e.bannerWidth>me?"padding-bottom: 0 !important;":""}
207
207
  display: flex;
208
208
  flex-direction: row-reverse;
209
209
  gap: 10px;
@@ -220,7 +220,7 @@
220
220
  }
221
221
  `,ve=l.default.i`
222
222
  background-image: url("data:image/svg+xml;base64,PHN2ZyBpZD0ibWluaW1pemUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxLjgxNyIgdmlld0JveD0iMCAwIDE2IDEuODE3Ij4KICA8ZGVmcz4KICAgIDxjbGlwUGF0aCBpZD0iY2xpcC1wYXRoIj4KICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZV82OCIgZGF0YS1uYW1lPSJSZWN0YW5nbGUgNjgiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxLjgxNyIgZmlsbD0iIzAwMCIvPgogICAgPC9jbGlwUGF0aD4KICA8L2RlZnM+CiAgPGcgaWQ9Ikdyb3VwXzMwMSIgZGF0YS1uYW1lPSJHcm91cCAzMDEiIGNsaXAtcGF0aD0idXJsKCNjbGlwLXBhdGgpIj4KICAgIDxwYXRoIGlkPSJQYXRoXzgwNCIgZGF0YS1uYW1lPSJQYXRoIDgwNCIgZD0iTTE1LjM5NCwyLjIxMUguNjA2QS42MDYuNjA2LDAsMSwxLC42MDYsMUgxNS4zOTRhLjYwNi42MDYsMCwwLDEsMCwxLjIxMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtMC4zOTQpIiBmaWxsPSIjZmZmIi8+CiAgPC9nPgo8L3N2Zz4K");
223
- `,we=({config:t,minimize:a})=>{const[i,o]=n.useState();return n.useEffect((()=>{new ResizeObserver((()=>{const e=document.getElementById(ue)?.offsetWidth;e&&e>50&&e!==i&&o(e)})).observe(document.getElementById(ue))}),[]),e.jsx(xe,{bannerWidth:i,className:"bc-header",children:e.jsx(me,{className:"bc-banner",id:ue,startColor:"#065A60",endColor:"#006466",bannerWidth:i,children:e.jsxs(be,{className:"bc-bannerContents",children:[e.jsxs(fe,{className:"bc-companyInfo",bannerWidth:i,logo:t.brandLogo||p,children:[e.jsx("i",{}),e.jsx("span",{children:t.brandName||"BreadCrumbs"})]}),e.jsx(Ce,{className:"bc-bannerActions",bannerWidth:i,children:a?e.jsx(ve,{className:"bc-flow-minimize",onClick:()=>a()}):null})]})})})},Ae=l.default.div`
223
+ `,we=({config:t,minimize:i})=>{const[a,o]=n.useState();return n.useEffect((()=>{new ResizeObserver((()=>{const e=document.getElementById(ue)?.offsetWidth;e&&e>50&&e!==a&&o(e)})).observe(document.getElementById(ue))}),[]),e.jsx(he,{bannerWidth:a,className:"bc-header",children:e.jsx(be,{className:"bc-banner",id:ue,startColor:"#065A60",endColor:"#006466",bannerWidth:a,children:e.jsxs(xe,{className:"bc-bannerContents",children:[e.jsxs(fe,{className:"bc-companyInfo",bannerWidth:a,logo:t.brandLogo||p,children:[e.jsx("i",{}),e.jsx("span",{children:t.brandName||"BreadCrumbs"})]}),e.jsx(Ce,{className:"bc-bannerActions",bannerWidth:a,children:i?e.jsx(ve,{className:"bc-flow-minimize",onClick:()=>i()}):null})]})})})},ye=l.default.div`
224
224
  width: 100%;
225
225
  text-align: center;
226
226
  i {
@@ -251,7 +251,7 @@
251
251
  border-radius: 0px 0px 10px 10px;
252
252
  opacity: 1;
253
253
  }
254
- `,ye=c.default.forwardRef((({forRate:n},t)=>e.jsxs(Ae,{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-agent-message-border-color: #95D5B2;\n --bc-chat-agent-message-background-start-color: #fff;\n --bc-chat-agent-message-background-end-color: #fff;\n --bc-chat-agent-message-text-color: #000;\n --bc-chat-client-message-border-color: #95D5B2;\n --bc-chat-client-message-background-start-color: #95D5B2;\n --bc-chat-client-message-background-end-color: #95D5B2;\n --bc-chat-client-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`
254
+ `,ke=c.default.forwardRef((({forRate:n},t)=>e.jsxs(ye,{className:""+(n?"bc-ratingPositioning":""),children:[e.jsx("i",{}),e.jsx("span",{children:"Powered by Bread Crumbs"})]})));D('@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-agent-message-border-color: #95D5B2;\n --bc-chat-agent-message-background-start-color: #fff;\n --bc-chat-agent-message-background-end-color: #fff;\n --bc-chat-agent-message-text-color: #000;\n --bc-chat-client-message-border-color: #95D5B2;\n --bc-chat-client-message-background-start-color: #95D5B2;\n --bc-chat-client-message-background-end-color: #95D5B2;\n --bc-chat-client-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 Ae=l.default.div`
255
255
  height: 100%;
256
256
  display: flex;
257
257
  flex-direction: column;
@@ -277,5 +277,5 @@
277
277
  line-height: inherit;
278
278
  font-weight: inherit;
279
279
  }
280
- `;exports.BCChat=({config:t={language:"EN",backgroundColor:"#dedede"},messages:a=[],sendMessage:i,debug:o,minimize:r,onReachingUp:s,agentsIdsAvatarsMap:c})=>{const[l,d]=n.useState("MESSAGE_LIST"),g="interactive"===(a&&a.length>0&&a[a.length-1].type);return e.jsxs(Me,{className:"bc-chat",children:[t.hideHeader?null:e.jsx(we,{config:t,minimize:r}),"MESSAGE_LIST"===l?e.jsx(P,{messages:a,sendMessage:i,debug:o,config:t,onReachingUp:s,agentsIdsAvatarsMap:c},"message-list"):null,g?e.jsx(ye,{forRate:!0}):t.inputDisabled?null:e.jsx(pe,{sendMessage:i,setView:d,config:t},"message-input")]})};
280
+ `;exports.BCChat=({config:t={language:"EN",backgroundColor:"#dedede"},messages:i=[],sendMessage:a,debug:o,minimize:r,onReachingUp:s,agentsIdsAvatarsMap:c})=>{const[l,d]=n.useState("MESSAGE_LIST"),g="interactive"===(i&&i.length>0&&i[i.length-1].type);return e.jsxs(Ae,{className:"bc-chat",children:[t.hideHeader?null:e.jsx(we,{config:t,minimize:r}),"MESSAGE_LIST"===l?e.jsx(T,{messages:i,sendMessage:a,debug:o,config:t,onReachingUp:s,agentsIdsAvatarsMap:c},"message-list"):null,g?e.jsx(ke,{forRate:!0}):t.inputDisabled?null:e.jsx(pe,{sendMessage:a,setView:d,config:t},"message-input")]})};
281
281
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,113 +1,113 @@
1
- {
2
- "name": "@bcrumbs.net/bc-chat",
3
- "version": "1.0.44",
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
- "rollup-plugin-ignore-import": "^1.3.2",
38
- "uuid": "^8.3.2",
39
- "web-vitals": "^2.1.4"
40
- },
41
- "peerDependencies": {
42
- "react": "18.3.1",
43
- "react-dom": "18.3.1"
44
- },
45
- "scripts": {
46
- "start": "react-scripts start",
47
- "build": "react-scripts build",
48
- "test": "react-scripts test",
49
- "eject": "react-scripts eject",
50
- "coverage": "npm test -- --coverage --watchAll",
51
- "build-lib": "rm -rf build && rollup -c",
52
- "lib-watch": "rm -rf build && rollup -c -w",
53
- "format": "prettier --write 'src/**/*.{ts,tsx,js}'"
54
- },
55
- "eslintConfig": {
56
- "extends": [
57
- "react-app",
58
- "react-app/jest"
59
- ]
60
- },
61
- "browserslist": {
62
- "production": [
63
- ">0.2%",
64
- "not dead",
65
- "not op_mini all"
66
- ],
67
- "development": [
68
- "last 1 chrome version",
69
- "last 1 firefox version",
70
- "last 1 safari version"
71
- ]
72
- },
73
- "devDependencies": {
74
- "@babel/preset-react": "^7.25.9",
75
- "@babel/preset-typescript": "^7.26.0",
76
- "@rollup/plugin-babel": "^6.0.4",
77
- "@rollup/plugin-commonjs": "^28.0.1",
78
- "@rollup/plugin-node-resolve": "^15.3.0",
79
- "@svgr/rollup": "8.1.0",
80
- "@svgr/webpack": "8.0.1",
81
- "babel-core": "^6.26.3",
82
- "babel-plugin-external-helpers": "^6.22.0",
83
- "babel-plugin-transform-class-properties": "^6.24.1",
84
- "babel-plugin-transform-object-rest-spread": "^6.26.0",
85
- "babel-preset-env": "^1.7.0",
86
- "babel-preset-react": "^6.24.1",
87
- "babel-preset-stage-0": "^6.24.1",
88
- "browserslist": "^4.16.1",
89
- "chance": "^1.1.7",
90
- "prettier": "2.3.1",
91
- "react": "^18.3.1",
92
- "react-dom": "^18.3.1",
93
- "react-scripts": "5.0.1",
94
- "redux-mock-store": "^1.5.4",
95
- "redux-thunk": "^2.3.0",
96
- "rollup": "^2.79.1",
97
- "rollup-plugin-copy-assets-to": "^1.0.0",
98
- "rollup-plugin-dts": "^6.1.1",
99
- "rollup-plugin-ignore": "^1.0.9",
100
- "rollup-plugin-json": "^4.0.0",
101
- "rollup-plugin-peer-deps-external": "^2.2.4",
102
- "rollup-plugin-postcss": "^4.0.2",
103
- "rollup-plugin-terser": "^7.0.2",
104
- "rollup-plugin-typescript2": "^0.36.0",
105
- "rollup-plugin-url": "^1.4.0",
106
- "sass": "^1.89.2",
107
- "typescript": "^4.9.5"
108
- },
109
- "files": [
110
- "build/**/*"
111
- ],
112
- "types": "build/index.d.ts"
113
- }
1
+ {
2
+ "name": "@bcrumbs.net/bc-chat",
3
+ "version": "1.0.45",
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
+ "rollup-plugin-ignore-import": "^1.3.2",
38
+ "uuid": "^8.3.2",
39
+ "web-vitals": "^2.1.4"
40
+ },
41
+ "peerDependencies": {
42
+ "react": "18.3.1",
43
+ "react-dom": "18.3.1"
44
+ },
45
+ "scripts": {
46
+ "start": "react-scripts start",
47
+ "build": "react-scripts build",
48
+ "test": "react-scripts test",
49
+ "eject": "react-scripts eject",
50
+ "coverage": "npm test -- --coverage --watchAll",
51
+ "build-lib": "rm -rf build && rollup -c",
52
+ "lib-watch": "rm -rf build && rollup -c -w",
53
+ "format": "prettier --write 'src/**/*.{ts,tsx,js}'"
54
+ },
55
+ "eslintConfig": {
56
+ "extends": [
57
+ "react-app",
58
+ "react-app/jest"
59
+ ]
60
+ },
61
+ "browserslist": {
62
+ "production": [
63
+ ">0.2%",
64
+ "not dead",
65
+ "not op_mini all"
66
+ ],
67
+ "development": [
68
+ "last 1 chrome version",
69
+ "last 1 firefox version",
70
+ "last 1 safari version"
71
+ ]
72
+ },
73
+ "devDependencies": {
74
+ "@babel/preset-react": "^7.25.9",
75
+ "@babel/preset-typescript": "^7.26.0",
76
+ "@rollup/plugin-babel": "^6.0.4",
77
+ "@rollup/plugin-commonjs": "^28.0.1",
78
+ "@rollup/plugin-node-resolve": "^15.3.0",
79
+ "@svgr/rollup": "8.1.0",
80
+ "@svgr/webpack": "8.0.1",
81
+ "babel-core": "^6.26.3",
82
+ "babel-plugin-external-helpers": "^6.22.0",
83
+ "babel-plugin-transform-class-properties": "^6.24.1",
84
+ "babel-plugin-transform-object-rest-spread": "^6.26.0",
85
+ "babel-preset-env": "^1.7.0",
86
+ "babel-preset-react": "^6.24.1",
87
+ "babel-preset-stage-0": "^6.24.1",
88
+ "browserslist": "^4.16.1",
89
+ "chance": "^1.1.7",
90
+ "prettier": "2.3.1",
91
+ "react": "^18.3.1",
92
+ "react-dom": "^18.3.1",
93
+ "react-scripts": "5.0.1",
94
+ "redux-mock-store": "^1.5.4",
95
+ "redux-thunk": "^2.3.0",
96
+ "rollup": "^2.79.1",
97
+ "rollup-plugin-copy-assets-to": "^1.0.0",
98
+ "rollup-plugin-dts": "^6.1.1",
99
+ "rollup-plugin-ignore": "^1.0.9",
100
+ "rollup-plugin-json": "^4.0.0",
101
+ "rollup-plugin-peer-deps-external": "^2.2.4",
102
+ "rollup-plugin-postcss": "^4.0.2",
103
+ "rollup-plugin-terser": "^7.0.2",
104
+ "rollup-plugin-typescript2": "^0.36.0",
105
+ "rollup-plugin-url": "^1.4.0",
106
+ "sass": "^1.89.2",
107
+ "typescript": "^4.9.5"
108
+ },
109
+ "files": [
110
+ "build/**/*"
111
+ ],
112
+ "types": "build/index.d.ts"
113
+ }