@bcrumbs.net/inbox 0.0.37 → 0.0.38
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/index.cjs.js +6 -6
- package/index.esm.js +6 -6
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -43008,7 +43008,7 @@ i {
|
|
|
43008
43008
|
align-items: center;
|
|
43009
43009
|
gap: 6px;
|
|
43010
43010
|
${e=>e.isMyMessage?"flex-direction: row;":"flex-direction: row-reverse;"}
|
|
43011
|
-
`,
|
|
43011
|
+
`,U$2=newStyled.div`
|
|
43012
43012
|
width: 32px;
|
|
43013
43013
|
height: 32px;
|
|
43014
43014
|
border-radius: 6px;
|
|
@@ -43017,7 +43017,7 @@ i {
|
|
|
43017
43017
|
align-items: center;
|
|
43018
43018
|
justify-content: center;
|
|
43019
43019
|
padding: 8px;
|
|
43020
|
-
`,
|
|
43020
|
+
`,V$2=newStyled.div`
|
|
43021
43021
|
display: flex;
|
|
43022
43022
|
flex-direction: column;
|
|
43023
43023
|
gap: 4px;
|
|
@@ -43066,7 +43066,7 @@ i {
|
|
|
43066
43066
|
max-width: 60%;
|
|
43067
43067
|
`,$$2=newStyled.span`
|
|
43068
43068
|
direction: ${e=>"arb"===e.language?"rtl":"ltr"};
|
|
43069
|
-
`,_$7={document:({message:t,config:i,onReply:o})=>{const a=i.isAgent===t.isAgent,[c,d]=React.useState(""),g=React.useMemo((()=>{try{const e=(t.content||"").split("/");return decodeURIComponent(e[e.length-1]||"file")}catch{return "file"}}),[t.content]);React.useEffect((()=>{let e=false;const n=t.content;if(n)return fetch(n,{method:"HEAD"}).then((n=>{const t=n.headers.get("content-length");if(!t)return;const i=Number(t);var o;Number.isFinite(i)&&(e||d((o=i)<1024?`${o} B`:o<1048576?`${(o/1024).toFixed(1)}KB`:o<1073741824?`${(o/1048576).toFixed(1)}MB`:`${(o/1073741824).toFixed(1)}GB`));})).catch((()=>{})),()=>{e=true;}}),[t.content]);const p=c?`${c} - ${j$2[i.language]?.download}`:j$2[i.language]?.download;return ReactJSXRuntime.jsx(z$2,{isMyMessage:a,createdAt:t.createdAt,message:t,config:i,onReply:o,children:ReactJSXRuntime.jsx(G$2,{href:t.content,target:"_blank",download:g,rel:"noopener noreferrer",isMyMessage:a,children:ReactJSXRuntime.jsxs(J$2,{isMyMessage:a,children:[ReactJSXRuntime.jsx(V$2,{children:ReactJSXRuntime.jsx(H$2,{})}),ReactJSXRuntime.jsxs(U$2,{children:[ReactJSXRuntime.jsx(K$2,{children:g}),ReactJSXRuntime.jsx(Q$2,{children:p})]})]})})})},image:({message:n,config:t,onReply:i})=>{const o=t.isAgent===n.isAgent;return ReactJSXRuntime.jsx(z$2,{className:"bc-mediaMessage",isMyMessage:o,createdAt:n.createdAt,message:n,config:t,onReply:i,isMedia:true,children:ReactJSXRuntime.jsx("a",{href:n.content,target:"_blank",rel:"noreferrer",children:ReactJSXRuntime.jsx("img",{src:n.content,alt:"message content",style:{width:"100%",height:"auto",borderRadius:"8px"}})})})},location:({message:t,config:i,onReply:o})=>{const a=i.isAgent===t.isAgent;return ReactJSXRuntime.jsx(z$2,{isMyMessage:a,createdAt:t.createdAt,message:t,config:i,onReply:o,children:ReactJSXRuntime.jsx(W$2,{href:"https://www.google.com/maps/?q="+t.content,target:"_blank",rel:"noopener noreferrer",children:ReactJSXRuntime.jsxs(Y$2,{children:[ReactJSXRuntime.jsx(q$2,{color:"000000"}),ReactJSXRuntime.jsx(O$2,{children:"Open location"})]})})})},text:N$2,video:P$1,audio:P$1,interactive:null,template:({message:t,config:i,onReply:o})=>{const a=React.useMemo((()=>{try{return JSON.parse(t.content)}catch(e){return void console.log(e.message)}}),[t]),r=i.isAgent===t.isAgent;return ReactJSXRuntime.jsxs(z$2,{isMyMessage:r,createdAt:t.createdAt,message:t,config:i,onReply:o,children:[ReactJSXRuntime.jsx("b",{children:"Template message:"})," ",a.name," ",a.language?.code?`/ ${a.language.code}`:null]})},note:({message:t})=>{const i=franc(t.content);return ReactJSXRuntime.jsxs(X$2,{children:[ReactJSXRuntime.jsx($$2,{language:i,children:t.content})," ",ReactJSXRuntime.jsx(w$2,{createdAt:t.createdAt})]})},button:N$2};function ee$2(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));}}ee$2('/* Shared styles between agent and client messages */\n.bc-otherMessage,\n.bc-myMessage {\n margin: 24px;\n font-size: var(--bc-chat-body-4-size);\n line-height: var(--bc-chat-body-4-lineheight);\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 12px;\n}\n.bc-otherMessage div p,\n.bc-myMessage div p {\n padding: 0;\n margin: 0;\n}\n\n/* Styles for agent messages */\n.bc-otherMessage {\n justify-content: flex-start;\n}\n.bc-otherMessage:first-child {\n flex: 1 0 50%;\n}\n.bc-otherMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%;\n}\n\n/* Styles for other messages */\n.bc-note {\n text-align: center;\n gap: 5px;\n}\n\n.bc-myMessage {\n justify-content: flex-end;\n}\n.bc-myMessage > div:not(.bc-debugCon),\n.bc-myMessage .bc-locationMessage,\n.bc-myMessage audio {\n color: #fff;\n}\n.bc-myMessage svg path:nth-child(2) {\n fill: #fff;\n}\n\n.bc-mediaMessage {\n position: relative;\n max-width: 300px !important;\n}\n.bc-mediaMessage audio,\n.bc-mediaMessage video,\n.bc-mediaMessage img {\n max-width: 100%;\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 width: 320px;\n height: 64px !important;\n}\n\n/* Custom audio player */\n.bc-audioPlayer {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 300px;\n position: relative;\n height: 50px;\n justify-self: flex-start;\n}\n\n.bc-audioPlayer audio {\n display: none !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.bc-audioPlayer__button {\n flex: 0 0 auto;\n width: 40px;\n height: 40px;\n border: none;\n border-radius: 50%;\n background: #ffffff;\n position: relative;\n cursor: pointer;\n}\n\n.bc-otherMessage .bc-audioPlayer__button {\n background: #16616C;\n}\n\n.bc-audioPlayer__button.play::before {\n content: "";\n position: absolute;\n left: 12px;\n top: 12px;\n width: 16px;\n height: 16px;\n background-repeat: no-repeat;\n background-position: center;\n background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.23541%202.19233C5.2355%201.62986%204%202.35243%204%203.49968V12.5C4%2013.6472%205.23546%2014.3698%206.23537%2013.8073L14.2356%209.30735C15.2551%208.73391%2015.2551%207.26609%2014.2357%206.69262L6.23541%202.19233Z%22%20fill%3D%22%2316616C%22%2F%3E%3C%2Fsvg%3E");\n}\n\n.bc-otherMessage .bc-audioPlayer__button.play::before {\n background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.23541%202.19233C5.2355%201.62986%204%202.35243%204%203.49968V12.5C4%2013.6472%205.23546%2014.3698%206.23537%2013.8073L14.2356%209.30735C15.2551%208.73391%2015.2551%207.26609%2014.2357%206.69262L6.23541%202.19233Z%22%20fill%3D%22%23ffffff%22%2F%3E%3C%2Fsvg%3E");\n}\n\n.bc-audioPlayer__button.pause::before,\n.bc-audioPlayer__button.pause::after {\n content: "";\n position: absolute;\n top: 14px;\n width: 3px;\n height: 12px;\n background: #16616C;\n}\n\n.bc-otherMessage .bc-audioPlayer__button.pause::before,\n.bc-otherMessage .bc-audioPlayer__button.pause::after {\n background: #ffffff;\n}\n\n.bc-audioPlayer__button.pause::before {\n left: 16px;\n}\n\n.bc-audioPlayer__button.pause::after {\n right: 16px;\n}\n\n.bc-audioPlayer__wave {\n position: relative;\n flex: 1 1 auto;\n height: 22px;\n cursor: pointer;\n}\n\n.bc-audioPlayer__wave--future,\n.bc-audioPlayer__wave--past {\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n height: 22px;\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 2px;\n column-gap: 1px;\n align-items: end;\n width: 100%;\n pointer-events: none;\n}\n\n.bc-audioPlayer__wave--future span {\n display: block;\n width: 2px;\n background: rgba(255, 255, 255, 0.6);\n border-radius: 2px;\n}\n\n.bc-otherMessage .bc-audioPlayer__wave--future span {\n background: #16616C;\n opacity: 0.6;\n}\n\n.bc-audioPlayer__wave--past {\n overflow: hidden;\n white-space: nowrap;\n}\n\n.bc-audioPlayer__wave--past span {\n display: inline-block;\n width: 2px;\n margin-right: 3px;\n background: #ffffff;\n border-radius: 2px;\n}\n\n.bc-otherMessage .bc-audioPlayer__wave--past span {\n background: #16616C;\n}\n\n.bc-otherMessage:hover .bc-replyButton, .bc-otherMessage:active .bc-replyButton, .bc-myMessage:hover .bc-replyButton, .bc-myMessage:active .bc-replyButton {\n display: block;\n}\n\n.bc-audioPlayer__time {\n color: #ffffff;\n font-weight: 400;\n opacity: 0.95;\n position: absolute;\n top: 46px;\n left: 80px;\n font-size: 10px;\n}\n\n.bc-otherMessage .bc-audioPlayer__time {\n color: #16616C;\n}\n\n.bc-selectionContainer {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap;\n}\n\n.bc-selectionContainer:first-child {\n flex: 1 0 50%;\n}\n\n.status-icon {\n color: var(--bc-chat-my-message-text-color) !important;\n opacity: 0.7;\n}\n.status-icon.read {\n color: #33C1FF !important;\n}\n.status-icon.failed {\n color: var(--bc-chat-danger-color) !important;\n}\n.status-icon.failed .resend {\n color: var(--bc-chat-dark-gray-color) !important;\n cursor: pointer;\n margin: 0 10px;\n}');const ne$2=newStyled.i`
|
|
43069
|
+
`,_$7={document:({message:t,config:i,onReply:o})=>{const a=i.isAgent===t.isAgent,[c,d]=React.useState(""),g=React.useMemo((()=>{try{const e=(t.content||"").split("/");return decodeURIComponent(e[e.length-1]||"file")}catch{return "file"}}),[t.content]);React.useEffect((()=>{let e=false;const n=t.content;if(n){try{new URL(n);}catch{return}return fetch(n,{method:"HEAD"}).then((n=>{if(!n.ok)return;const t=n.headers.get("content-length");if(!t)return;const i=Number(t);var o;!Number.isFinite(i)||i<0||(e||d((o=i)<1024?`${o} B`:o<1048576?`${(o/1024).toFixed(1)}KB`:o<1073741824?`${(o/1048576).toFixed(1)}MB`:`${(o/1073741824).toFixed(1)}GB`));})).catch((e=>{console.debug("Failed to fetch file size:",e);})),()=>{e=true;}}}),[t.content]);const p=c?`${c} - ${j$2[i.language]?.download}`:j$2[i.language]?.download;return ReactJSXRuntime.jsx(z$2,{isMyMessage:a,createdAt:t.createdAt,message:t,config:i,onReply:o,children:ReactJSXRuntime.jsx(G$2,{href:t.content,target:"_blank",download:g,rel:"noopener noreferrer",isMyMessage:a,children:ReactJSXRuntime.jsxs(J$2,{isMyMessage:a,children:[ReactJSXRuntime.jsx(U$2,{children:ReactJSXRuntime.jsx(H$2,{})}),ReactJSXRuntime.jsxs(V$2,{children:[ReactJSXRuntime.jsx(K$2,{children:g}),ReactJSXRuntime.jsx(Q$2,{children:p})]})]})})})},image:({message:n,config:t,onReply:i})=>{const o=t.isAgent===n.isAgent;return ReactJSXRuntime.jsx(z$2,{className:"bc-mediaMessage",isMyMessage:o,createdAt:n.createdAt,message:n,config:t,onReply:i,isMedia:true,children:ReactJSXRuntime.jsx("a",{href:n.content,target:"_blank",rel:"noreferrer",children:ReactJSXRuntime.jsx("img",{src:n.content,alt:"message content",style:{width:"100%",height:"auto",borderRadius:"8px"}})})})},location:({message:t,config:i,onReply:o})=>{const a=i.isAgent===t.isAgent;return ReactJSXRuntime.jsx(z$2,{isMyMessage:a,createdAt:t.createdAt,message:t,config:i,onReply:o,children:ReactJSXRuntime.jsx(W$2,{href:"https://www.google.com/maps/?q="+t.content,target:"_blank",rel:"noopener noreferrer",children:ReactJSXRuntime.jsxs(Y$2,{children:[ReactJSXRuntime.jsx(q$2,{color:"000000"}),ReactJSXRuntime.jsx(O$2,{children:"Open location"})]})})})},text:N$2,video:P$1,audio:P$1,interactive:null,template:({message:t,config:i,onReply:o})=>{const a=React.useMemo((()=>{try{return JSON.parse(t.content)}catch(e){return void console.log(e.message)}}),[t]),r=i.isAgent===t.isAgent;return ReactJSXRuntime.jsxs(z$2,{isMyMessage:r,createdAt:t.createdAt,message:t,config:i,onReply:o,children:[ReactJSXRuntime.jsx("b",{children:"Template message:"})," ",a.name," ",a.language?.code?`/ ${a.language.code}`:null]})},note:({message:t})=>{const i=franc(t.content);return ReactJSXRuntime.jsxs(X$2,{children:[ReactJSXRuntime.jsx($$2,{language:i,children:t.content})," ",ReactJSXRuntime.jsx(w$2,{createdAt:t.createdAt})]})},button:N$2};function ee$2(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));}}ee$2('/* Shared styles between agent and client messages */\n.bc-otherMessage,\n.bc-myMessage {\n margin: 24px;\n font-size: var(--bc-chat-body-4-size);\n line-height: var(--bc-chat-body-4-lineheight);\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 12px;\n}\n.bc-otherMessage div p,\n.bc-myMessage div p {\n padding: 0;\n margin: 0;\n}\n\n/* Styles for agent messages */\n.bc-otherMessage {\n justify-content: flex-start;\n}\n.bc-otherMessage:first-child {\n flex: 1 0 50%;\n}\n.bc-otherMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%;\n}\n\n/* Styles for other messages */\n.bc-note {\n text-align: center;\n gap: 5px;\n}\n\n.bc-myMessage {\n justify-content: flex-end;\n}\n.bc-myMessage > div:not(.bc-debugCon),\n.bc-myMessage .bc-locationMessage,\n.bc-myMessage audio {\n color: #fff;\n}\n.bc-myMessage svg path:nth-child(2) {\n fill: #fff;\n}\n\n.bc-mediaMessage {\n position: relative;\n max-width: 300px !important;\n}\n.bc-mediaMessage audio,\n.bc-mediaMessage video,\n.bc-mediaMessage img {\n max-width: 100%;\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 width: 320px;\n height: 64px !important;\n}\n\n/* Custom audio player */\n.bc-audioPlayer {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 300px;\n position: relative;\n height: 50px;\n justify-self: flex-start;\n}\n\n.bc-audioPlayer audio {\n display: none !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.bc-audioPlayer__button {\n flex: 0 0 auto;\n width: 40px;\n height: 40px;\n border: none;\n border-radius: 50%;\n background: #ffffff;\n position: relative;\n cursor: pointer;\n}\n\n.bc-otherMessage .bc-audioPlayer__button {\n background: #16616C;\n}\n\n.bc-audioPlayer__button.play::before {\n content: "";\n position: absolute;\n left: 12px;\n top: 12px;\n width: 16px;\n height: 16px;\n background-repeat: no-repeat;\n background-position: center;\n background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.23541%202.19233C5.2355%201.62986%204%202.35243%204%203.49968V12.5C4%2013.6472%205.23546%2014.3698%206.23537%2013.8073L14.2356%209.30735C15.2551%208.73391%2015.2551%207.26609%2014.2357%206.69262L6.23541%202.19233Z%22%20fill%3D%22%2316616C%22%2F%3E%3C%2Fsvg%3E");\n}\n\n.bc-otherMessage .bc-audioPlayer__button.play::before {\n background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.23541%202.19233C5.2355%201.62986%204%202.35243%204%203.49968V12.5C4%2013.6472%205.23546%2014.3698%206.23537%2013.8073L14.2356%209.30735C15.2551%208.73391%2015.2551%207.26609%2014.2357%206.69262L6.23541%202.19233Z%22%20fill%3D%22%23ffffff%22%2F%3E%3C%2Fsvg%3E");\n}\n\n.bc-audioPlayer__button.pause::before,\n.bc-audioPlayer__button.pause::after {\n content: "";\n position: absolute;\n top: 14px;\n width: 3px;\n height: 12px;\n background: #16616C;\n}\n\n.bc-otherMessage .bc-audioPlayer__button.pause::before,\n.bc-otherMessage .bc-audioPlayer__button.pause::after {\n background: #ffffff;\n}\n\n.bc-audioPlayer__button.pause::before {\n left: 16px;\n}\n\n.bc-audioPlayer__button.pause::after {\n right: 16px;\n}\n\n.bc-audioPlayer__wave {\n position: relative;\n flex: 1 1 auto;\n height: 22px;\n cursor: pointer;\n}\n\n.bc-audioPlayer__wave--future,\n.bc-audioPlayer__wave--past {\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n height: 22px;\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 2px;\n column-gap: 1px;\n align-items: end;\n width: 100%;\n pointer-events: none;\n}\n\n.bc-audioPlayer__wave--future span {\n display: block;\n width: 2px;\n background: rgba(255, 255, 255, 0.6);\n border-radius: 2px;\n}\n\n.bc-otherMessage .bc-audioPlayer__wave--future span {\n background: #16616C;\n opacity: 0.6;\n}\n\n.bc-audioPlayer__wave--past {\n overflow: hidden;\n white-space: nowrap;\n}\n\n.bc-audioPlayer__wave--past span {\n display: inline-block;\n width: 2px;\n margin-right: 3px;\n background: #ffffff;\n border-radius: 2px;\n}\n\n.bc-otherMessage .bc-audioPlayer__wave--past span {\n background: #16616C;\n}\n\n.bc-otherMessage:hover .bc-replyButton, .bc-otherMessage:active .bc-replyButton, .bc-myMessage:hover .bc-replyButton, .bc-myMessage:active .bc-replyButton {\n display: block;\n}\n\n.bc-audioPlayer__time {\n color: #ffffff;\n font-weight: 400;\n opacity: 0.95;\n position: absolute;\n top: 46px;\n left: 80px;\n font-size: 10px;\n}\n\n.bc-otherMessage .bc-audioPlayer__time {\n color: #16616C;\n}\n\n.bc-selectionContainer {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap;\n}\n\n.bc-selectionContainer:first-child {\n flex: 1 0 50%;\n}\n\n.status-icon {\n color: var(--bc-chat-my-message-text-color) !important;\n opacity: 0.7;\n}\n.status-icon.read {\n color: #33C1FF !important;\n}\n.status-icon.failed {\n color: var(--bc-chat-danger-color) !important;\n}\n.status-icon.failed .resend {\n color: var(--bc-chat-dark-gray-color) !important;\n cursor: pointer;\n margin: 0 10px;\n}');const ne$2=newStyled.i`
|
|
43070
43070
|
background-image: url(${e=>e.avatar||f$1});
|
|
43071
43071
|
width: 30px;
|
|
43072
43072
|
height: 30px;
|
|
@@ -43231,7 +43231,7 @@ i {
|
|
|
43231
43231
|
margin-top: 6px;
|
|
43232
43232
|
text-align: center;
|
|
43233
43233
|
}
|
|
43234
|
-
`,
|
|
43234
|
+
`,Ue$1=newStyled.div`
|
|
43235
43235
|
width: 100%;
|
|
43236
43236
|
padding: 8px 12px;
|
|
43237
43237
|
display: flex;
|
|
@@ -43241,7 +43241,7 @@ i {
|
|
|
43241
43241
|
gap: 4px;
|
|
43242
43242
|
flex: 1 0 0;
|
|
43243
43243
|
border-bottom: 1px solid var(--bc-border-neutral-secondary, #E5E7EB);
|
|
43244
|
-
`,
|
|
43244
|
+
`,Ve$2=newStyled.div`
|
|
43245
43245
|
display: flex;
|
|
43246
43246
|
align-items: center;
|
|
43247
43247
|
justify-content: space-between;
|
|
@@ -43282,7 +43282,7 @@ i {
|
|
|
43282
43282
|
color: #111827;
|
|
43283
43283
|
outline: none;
|
|
43284
43284
|
}
|
|
43285
|
-
`,Ye$2=()=>ReactJSXRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ReactJSXRuntime.jsx("path",{d:"M8 6.58579L11.2929 3.29289C11.6834 2.90237 12.3166 2.90237 12.7071 3.29289C13.0976 3.68342 13.0976 4.31658 12.7071 4.70711L9.41421 8L12.7071 11.2929C13.0976 11.6834 13.0976 12.3166 12.7071 12.7071C12.3166 13.0976 11.6834 13.0976 11.2929 12.7071L8 9.41421L4.70711 12.7071C4.31658 13.0976 3.68342 13.0976 3.29289 12.7071C2.90237 12.3166 2.90237 11.6834 3.29289 11.2929L6.58579 8L3.29289 4.70711C2.90237 4.31658 2.90237 3.68342 3.29289 3.29289C3.68342 2.90237 4.31658 2.90237 4.70711 3.29289L8 6.58579Z",fill:"currentColor"})}),Oe$2=({config:t,sendMessage:i,setView:a,actionChips:l,noteMode:c,onNoteSend:d,onCloseNoteMode:g,notePlaceholder:p,replyMessageTitle:h,replyMessageContent:u,onCancelReplyMessage:m})=>{const b="AR"===t?.language,[f,x]=React.useState(),[y,v]=React.useState(),[w,M]=React.useState(),[A,L]=React.useState(0),k=React.useMemo((()=>Boolean(h||u)),[h,u]),I=React.useMemo((()=>h||("AR"===t?.language?"الرد على رسالة":"TR"===t?.language?"Bir mesaja yanıt veriliyor":"Replying to message")),[t?.language,h]),E=React.useMemo((()=>"AR"===t?.language?"إلغاء":"TR"===t?.language?"İptal":"Cancel"),[t?.language]),R=React.useCallback((e=>{if(c){const e=(f||"").trim();return d&&d(e),void x("")}const n=e=>{const{fileUrl:n,extension:t}=e;i(C$2.SupportedImageFormats.indexOf(t)>=0?"image":C$2.SupportedAudioFormats.indexOf(t)>=0?"audio":"document",n);};e?e.blob&&e.fileUrl.startsWith("blob:")?ue$1(e.blob,L,((t,i)=>{if(t){try{URL.revokeObjectURL(e.fileUrl);}catch{}n({...e,fileUrl:t,blob:void 0});}else i&&M(i);})):n(e):y?y.blob&&y.fileUrl.startsWith("blob:")?ue$1(y.blob,L,((e,t)=>{if(e){try{URL.revokeObjectURL(y.fileUrl);}catch{}n({...y,fileUrl:e,blob:void 0}),v(void 0);}else t&&M(t);})):(n(y),v(void 0)):(i(he$2,f),x(""));}),[y,f,i,c,d]);return ReactJSXRuntime.jsxs(Je$1,{isRTL:b,children:[k?ReactJSXRuntime.jsxs(
|
|
43285
|
+
`,Ye$2=()=>ReactJSXRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ReactJSXRuntime.jsx("path",{d:"M8 6.58579L11.2929 3.29289C11.6834 2.90237 12.3166 2.90237 12.7071 3.29289C13.0976 3.68342 13.0976 4.31658 12.7071 4.70711L9.41421 8L12.7071 11.2929C13.0976 11.6834 13.0976 12.3166 12.7071 12.7071C12.3166 13.0976 11.6834 13.0976 11.2929 12.7071L8 9.41421L4.70711 12.7071C4.31658 13.0976 3.68342 13.0976 3.29289 12.7071C2.90237 12.3166 2.90237 11.6834 3.29289 11.2929L6.58579 8L3.29289 4.70711C2.90237 4.31658 2.90237 3.68342 3.29289 3.29289C3.68342 2.90237 4.31658 2.90237 4.70711 3.29289L8 6.58579Z",fill:"currentColor"})}),Oe$2=({config:t,sendMessage:i,setView:a,actionChips:l,noteMode:c,onNoteSend:d,onCloseNoteMode:g,notePlaceholder:p,replyMessageTitle:h,replyMessageContent:u,onCancelReplyMessage:m})=>{const b="AR"===t?.language,[f,x]=React.useState(),[y,v]=React.useState(),[w,M]=React.useState(),[A,L]=React.useState(0),k=React.useMemo((()=>Boolean(h||u)),[h,u]),I=React.useMemo((()=>h||("AR"===t?.language?"الرد على رسالة":"TR"===t?.language?"Bir mesaja yanıt veriliyor":"Replying to message")),[t?.language,h]),E=React.useMemo((()=>"AR"===t?.language?"إلغاء":"TR"===t?.language?"İptal":"Cancel"),[t?.language]),R=React.useCallback((e=>{if(c){const e=(f||"").trim();return d&&d(e),void x("")}const n=e=>{const{fileUrl:n,extension:t}=e;i(C$2.SupportedImageFormats.indexOf(t)>=0?"image":C$2.SupportedAudioFormats.indexOf(t)>=0?"audio":"document",n);};e?e.blob&&e.fileUrl.startsWith("blob:")?ue$1(e.blob,L,((t,i)=>{if(t){try{URL.revokeObjectURL(e.fileUrl);}catch{}n({...e,fileUrl:t,blob:void 0});}else i&&M(i);})):n(e):y?y.blob&&y.fileUrl.startsWith("blob:")?ue$1(y.blob,L,((e,t)=>{if(e){try{URL.revokeObjectURL(y.fileUrl);}catch{}n({...y,fileUrl:e,blob:void 0}),v(void 0);}else t&&M(t);})):(n(y),v(void 0)):(i(he$2,f),x(""));}),[y,f,i,c,d]);return ReactJSXRuntime.jsxs(Je$1,{isRTL:b,children:[k?ReactJSXRuntime.jsxs(Ue$1,{isRTL:b,children:[ReactJSXRuntime.jsxs(Ve$2,{isRTL:b,children:[I?ReactJSXRuntime.jsx(Ke$1,{children:I}):null,m?ReactJSXRuntime.jsx(We$1,{type:"button",onClick:m,"aria-label":E,title:E,children:ReactJSXRuntime.jsx(Ye$2,{})}):null]}),u?ReactJSXRuntime.jsx(Qe$1,{children:u}):null]}):null,ReactJSXRuntime.jsx("div",{className:"bc-InputArea",children:ReactJSXRuntime.jsx(we$2,{config:t,send:R,text:f,setText:x,file:c?void 0:y,isFileSelected:!!y,cancelFileUpload:()=>v(void 0),noteMode:c,onCloseNoteMode:()=>{x(""),g?.();},notePlaceholder:p})}),ReactJSXRuntime.jsxs("div",{className:"bc-BottomBar "+(b?"bc-RTL":""),children:[void 0!==l?l:null,ReactJSXRuntime.jsx("div",{className:"bc-CommandsArea "+(b?"bc-RTL":""),children:c?null:ReactJSXRuntime.jsx(Ge$1,{setView:a,setFile:v,setProgress:L,setError:M,setText:x,text:f,send:R,config:t})})]}),w?ReactJSXRuntime.jsx("div",{className:"bc-uploadFileError",children:w}):null]})},qe$2="bc-chat-header-banner",Xe$1=390,$e$1=newStyled.div`
|
|
43286
43286
|
${e=>e.bannerWidth>Xe$1?"height: 60px;":"height: 90px;"}
|
|
43287
43287
|
display: block;
|
|
43288
43288
|
width: 100%;
|
package/index.esm.js
CHANGED
|
@@ -42990,7 +42990,7 @@ i {
|
|
|
42990
42990
|
align-items: center;
|
|
42991
42991
|
gap: 6px;
|
|
42992
42992
|
${e=>e.isMyMessage?"flex-direction: row;":"flex-direction: row-reverse;"}
|
|
42993
|
-
`,
|
|
42993
|
+
`,U$2=newStyled.div`
|
|
42994
42994
|
width: 32px;
|
|
42995
42995
|
height: 32px;
|
|
42996
42996
|
border-radius: 6px;
|
|
@@ -42999,7 +42999,7 @@ i {
|
|
|
42999
42999
|
align-items: center;
|
|
43000
43000
|
justify-content: center;
|
|
43001
43001
|
padding: 8px;
|
|
43002
|
-
`,
|
|
43002
|
+
`,V$2=newStyled.div`
|
|
43003
43003
|
display: flex;
|
|
43004
43004
|
flex-direction: column;
|
|
43005
43005
|
gap: 4px;
|
|
@@ -43048,7 +43048,7 @@ i {
|
|
|
43048
43048
|
max-width: 60%;
|
|
43049
43049
|
`,$$2=newStyled.span`
|
|
43050
43050
|
direction: ${e=>"arb"===e.language?"rtl":"ltr"};
|
|
43051
|
-
`,_$7={document:({message:t,config:i,onReply:o})=>{const a=i.isAgent===t.isAgent,[c,d]=useState(""),g=useMemo((()=>{try{const e=(t.content||"").split("/");return decodeURIComponent(e[e.length-1]||"file")}catch{return "file"}}),[t.content]);useEffect((()=>{let e=false;const n=t.content;if(n)return fetch(n,{method:"HEAD"}).then((n=>{const t=n.headers.get("content-length");if(!t)return;const i=Number(t);var o;Number.isFinite(i)&&(e||d((o=i)<1024?`${o} B`:o<1048576?`${(o/1024).toFixed(1)}KB`:o<1073741824?`${(o/1048576).toFixed(1)}MB`:`${(o/1073741824).toFixed(1)}GB`));})).catch((()=>{})),()=>{e=true;}}),[t.content]);const p=c?`${c} - ${j$2[i.language]?.download}`:j$2[i.language]?.download;return jsx$2(z$2,{isMyMessage:a,createdAt:t.createdAt,message:t,config:i,onReply:o,children:jsx$2(G$2,{href:t.content,target:"_blank",download:g,rel:"noopener noreferrer",isMyMessage:a,children:jsxs$1(J$2,{isMyMessage:a,children:[jsx$2(V$2,{children:jsx$2(H$2,{})}),jsxs$1(U$2,{children:[jsx$2(K$2,{children:g}),jsx$2(Q$2,{children:p})]})]})})})},image:({message:n,config:t,onReply:i})=>{const o=t.isAgent===n.isAgent;return jsx$2(z$2,{className:"bc-mediaMessage",isMyMessage:o,createdAt:n.createdAt,message:n,config:t,onReply:i,isMedia:true,children:jsx$2("a",{href:n.content,target:"_blank",rel:"noreferrer",children:jsx$2("img",{src:n.content,alt:"message content",style:{width:"100%",height:"auto",borderRadius:"8px"}})})})},location:({message:t,config:i,onReply:o})=>{const a=i.isAgent===t.isAgent;return jsx$2(z$2,{isMyMessage:a,createdAt:t.createdAt,message:t,config:i,onReply:o,children:jsx$2(W$2,{href:"https://www.google.com/maps/?q="+t.content,target:"_blank",rel:"noopener noreferrer",children:jsxs$1(Y$2,{children:[jsx$2(q$2,{color:"000000"}),jsx$2(O$2,{children:"Open location"})]})})})},text:N$2,video:P$1,audio:P$1,interactive:null,template:({message:t,config:i,onReply:o})=>{const a=useMemo((()=>{try{return JSON.parse(t.content)}catch(e){return void console.log(e.message)}}),[t]),r=i.isAgent===t.isAgent;return jsxs$1(z$2,{isMyMessage:r,createdAt:t.createdAt,message:t,config:i,onReply:o,children:[jsx$2("b",{children:"Template message:"})," ",a.name," ",a.language?.code?`/ ${a.language.code}`:null]})},note:({message:t})=>{const i=franc(t.content);return jsxs$1(X$2,{children:[jsx$2($$2,{language:i,children:t.content})," ",jsx$2(w$2,{createdAt:t.createdAt})]})},button:N$2};function ee$2(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));}}ee$2('/* Shared styles between agent and client messages */\n.bc-otherMessage,\n.bc-myMessage {\n margin: 24px;\n font-size: var(--bc-chat-body-4-size);\n line-height: var(--bc-chat-body-4-lineheight);\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 12px;\n}\n.bc-otherMessage div p,\n.bc-myMessage div p {\n padding: 0;\n margin: 0;\n}\n\n/* Styles for agent messages */\n.bc-otherMessage {\n justify-content: flex-start;\n}\n.bc-otherMessage:first-child {\n flex: 1 0 50%;\n}\n.bc-otherMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%;\n}\n\n/* Styles for other messages */\n.bc-note {\n text-align: center;\n gap: 5px;\n}\n\n.bc-myMessage {\n justify-content: flex-end;\n}\n.bc-myMessage > div:not(.bc-debugCon),\n.bc-myMessage .bc-locationMessage,\n.bc-myMessage audio {\n color: #fff;\n}\n.bc-myMessage svg path:nth-child(2) {\n fill: #fff;\n}\n\n.bc-mediaMessage {\n position: relative;\n max-width: 300px !important;\n}\n.bc-mediaMessage audio,\n.bc-mediaMessage video,\n.bc-mediaMessage img {\n max-width: 100%;\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 width: 320px;\n height: 64px !important;\n}\n\n/* Custom audio player */\n.bc-audioPlayer {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 300px;\n position: relative;\n height: 50px;\n justify-self: flex-start;\n}\n\n.bc-audioPlayer audio {\n display: none !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.bc-audioPlayer__button {\n flex: 0 0 auto;\n width: 40px;\n height: 40px;\n border: none;\n border-radius: 50%;\n background: #ffffff;\n position: relative;\n cursor: pointer;\n}\n\n.bc-otherMessage .bc-audioPlayer__button {\n background: #16616C;\n}\n\n.bc-audioPlayer__button.play::before {\n content: "";\n position: absolute;\n left: 12px;\n top: 12px;\n width: 16px;\n height: 16px;\n background-repeat: no-repeat;\n background-position: center;\n background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.23541%202.19233C5.2355%201.62986%204%202.35243%204%203.49968V12.5C4%2013.6472%205.23546%2014.3698%206.23537%2013.8073L14.2356%209.30735C15.2551%208.73391%2015.2551%207.26609%2014.2357%206.69262L6.23541%202.19233Z%22%20fill%3D%22%2316616C%22%2F%3E%3C%2Fsvg%3E");\n}\n\n.bc-otherMessage .bc-audioPlayer__button.play::before {\n background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.23541%202.19233C5.2355%201.62986%204%202.35243%204%203.49968V12.5C4%2013.6472%205.23546%2014.3698%206.23537%2013.8073L14.2356%209.30735C15.2551%208.73391%2015.2551%207.26609%2014.2357%206.69262L6.23541%202.19233Z%22%20fill%3D%22%23ffffff%22%2F%3E%3C%2Fsvg%3E");\n}\n\n.bc-audioPlayer__button.pause::before,\n.bc-audioPlayer__button.pause::after {\n content: "";\n position: absolute;\n top: 14px;\n width: 3px;\n height: 12px;\n background: #16616C;\n}\n\n.bc-otherMessage .bc-audioPlayer__button.pause::before,\n.bc-otherMessage .bc-audioPlayer__button.pause::after {\n background: #ffffff;\n}\n\n.bc-audioPlayer__button.pause::before {\n left: 16px;\n}\n\n.bc-audioPlayer__button.pause::after {\n right: 16px;\n}\n\n.bc-audioPlayer__wave {\n position: relative;\n flex: 1 1 auto;\n height: 22px;\n cursor: pointer;\n}\n\n.bc-audioPlayer__wave--future,\n.bc-audioPlayer__wave--past {\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n height: 22px;\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 2px;\n column-gap: 1px;\n align-items: end;\n width: 100%;\n pointer-events: none;\n}\n\n.bc-audioPlayer__wave--future span {\n display: block;\n width: 2px;\n background: rgba(255, 255, 255, 0.6);\n border-radius: 2px;\n}\n\n.bc-otherMessage .bc-audioPlayer__wave--future span {\n background: #16616C;\n opacity: 0.6;\n}\n\n.bc-audioPlayer__wave--past {\n overflow: hidden;\n white-space: nowrap;\n}\n\n.bc-audioPlayer__wave--past span {\n display: inline-block;\n width: 2px;\n margin-right: 3px;\n background: #ffffff;\n border-radius: 2px;\n}\n\n.bc-otherMessage .bc-audioPlayer__wave--past span {\n background: #16616C;\n}\n\n.bc-otherMessage:hover .bc-replyButton, .bc-otherMessage:active .bc-replyButton, .bc-myMessage:hover .bc-replyButton, .bc-myMessage:active .bc-replyButton {\n display: block;\n}\n\n.bc-audioPlayer__time {\n color: #ffffff;\n font-weight: 400;\n opacity: 0.95;\n position: absolute;\n top: 46px;\n left: 80px;\n font-size: 10px;\n}\n\n.bc-otherMessage .bc-audioPlayer__time {\n color: #16616C;\n}\n\n.bc-selectionContainer {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap;\n}\n\n.bc-selectionContainer:first-child {\n flex: 1 0 50%;\n}\n\n.status-icon {\n color: var(--bc-chat-my-message-text-color) !important;\n opacity: 0.7;\n}\n.status-icon.read {\n color: #33C1FF !important;\n}\n.status-icon.failed {\n color: var(--bc-chat-danger-color) !important;\n}\n.status-icon.failed .resend {\n color: var(--bc-chat-dark-gray-color) !important;\n cursor: pointer;\n margin: 0 10px;\n}');const ne$2=newStyled.i`
|
|
43051
|
+
`,_$7={document:({message:t,config:i,onReply:o})=>{const a=i.isAgent===t.isAgent,[c,d]=useState(""),g=useMemo((()=>{try{const e=(t.content||"").split("/");return decodeURIComponent(e[e.length-1]||"file")}catch{return "file"}}),[t.content]);useEffect((()=>{let e=false;const n=t.content;if(n){try{new URL(n);}catch{return}return fetch(n,{method:"HEAD"}).then((n=>{if(!n.ok)return;const t=n.headers.get("content-length");if(!t)return;const i=Number(t);var o;!Number.isFinite(i)||i<0||(e||d((o=i)<1024?`${o} B`:o<1048576?`${(o/1024).toFixed(1)}KB`:o<1073741824?`${(o/1048576).toFixed(1)}MB`:`${(o/1073741824).toFixed(1)}GB`));})).catch((e=>{console.debug("Failed to fetch file size:",e);})),()=>{e=true;}}}),[t.content]);const p=c?`${c} - ${j$2[i.language]?.download}`:j$2[i.language]?.download;return jsx$2(z$2,{isMyMessage:a,createdAt:t.createdAt,message:t,config:i,onReply:o,children:jsx$2(G$2,{href:t.content,target:"_blank",download:g,rel:"noopener noreferrer",isMyMessage:a,children:jsxs$1(J$2,{isMyMessage:a,children:[jsx$2(U$2,{children:jsx$2(H$2,{})}),jsxs$1(V$2,{children:[jsx$2(K$2,{children:g}),jsx$2(Q$2,{children:p})]})]})})})},image:({message:n,config:t,onReply:i})=>{const o=t.isAgent===n.isAgent;return jsx$2(z$2,{className:"bc-mediaMessage",isMyMessage:o,createdAt:n.createdAt,message:n,config:t,onReply:i,isMedia:true,children:jsx$2("a",{href:n.content,target:"_blank",rel:"noreferrer",children:jsx$2("img",{src:n.content,alt:"message content",style:{width:"100%",height:"auto",borderRadius:"8px"}})})})},location:({message:t,config:i,onReply:o})=>{const a=i.isAgent===t.isAgent;return jsx$2(z$2,{isMyMessage:a,createdAt:t.createdAt,message:t,config:i,onReply:o,children:jsx$2(W$2,{href:"https://www.google.com/maps/?q="+t.content,target:"_blank",rel:"noopener noreferrer",children:jsxs$1(Y$2,{children:[jsx$2(q$2,{color:"000000"}),jsx$2(O$2,{children:"Open location"})]})})})},text:N$2,video:P$1,audio:P$1,interactive:null,template:({message:t,config:i,onReply:o})=>{const a=useMemo((()=>{try{return JSON.parse(t.content)}catch(e){return void console.log(e.message)}}),[t]),r=i.isAgent===t.isAgent;return jsxs$1(z$2,{isMyMessage:r,createdAt:t.createdAt,message:t,config:i,onReply:o,children:[jsx$2("b",{children:"Template message:"})," ",a.name," ",a.language?.code?`/ ${a.language.code}`:null]})},note:({message:t})=>{const i=franc(t.content);return jsxs$1(X$2,{children:[jsx$2($$2,{language:i,children:t.content})," ",jsx$2(w$2,{createdAt:t.createdAt})]})},button:N$2};function ee$2(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));}}ee$2('/* Shared styles between agent and client messages */\n.bc-otherMessage,\n.bc-myMessage {\n margin: 24px;\n font-size: var(--bc-chat-body-4-size);\n line-height: var(--bc-chat-body-4-lineheight);\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 12px;\n}\n.bc-otherMessage div p,\n.bc-myMessage div p {\n padding: 0;\n margin: 0;\n}\n\n/* Styles for agent messages */\n.bc-otherMessage {\n justify-content: flex-start;\n}\n.bc-otherMessage:first-child {\n flex: 1 0 50%;\n}\n.bc-otherMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%;\n}\n\n/* Styles for other messages */\n.bc-note {\n text-align: center;\n gap: 5px;\n}\n\n.bc-myMessage {\n justify-content: flex-end;\n}\n.bc-myMessage > div:not(.bc-debugCon),\n.bc-myMessage .bc-locationMessage,\n.bc-myMessage audio {\n color: #fff;\n}\n.bc-myMessage svg path:nth-child(2) {\n fill: #fff;\n}\n\n.bc-mediaMessage {\n position: relative;\n max-width: 300px !important;\n}\n.bc-mediaMessage audio,\n.bc-mediaMessage video,\n.bc-mediaMessage img {\n max-width: 100%;\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 width: 320px;\n height: 64px !important;\n}\n\n/* Custom audio player */\n.bc-audioPlayer {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 300px;\n position: relative;\n height: 50px;\n justify-self: flex-start;\n}\n\n.bc-audioPlayer audio {\n display: none !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.bc-audioPlayer__button {\n flex: 0 0 auto;\n width: 40px;\n height: 40px;\n border: none;\n border-radius: 50%;\n background: #ffffff;\n position: relative;\n cursor: pointer;\n}\n\n.bc-otherMessage .bc-audioPlayer__button {\n background: #16616C;\n}\n\n.bc-audioPlayer__button.play::before {\n content: "";\n position: absolute;\n left: 12px;\n top: 12px;\n width: 16px;\n height: 16px;\n background-repeat: no-repeat;\n background-position: center;\n background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.23541%202.19233C5.2355%201.62986%204%202.35243%204%203.49968V12.5C4%2013.6472%205.23546%2014.3698%206.23537%2013.8073L14.2356%209.30735C15.2551%208.73391%2015.2551%207.26609%2014.2357%206.69262L6.23541%202.19233Z%22%20fill%3D%22%2316616C%22%2F%3E%3C%2Fsvg%3E");\n}\n\n.bc-otherMessage .bc-audioPlayer__button.play::before {\n background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.23541%202.19233C5.2355%201.62986%204%202.35243%204%203.49968V12.5C4%2013.6472%205.23546%2014.3698%206.23537%2013.8073L14.2356%209.30735C15.2551%208.73391%2015.2551%207.26609%2014.2357%206.69262L6.23541%202.19233Z%22%20fill%3D%22%23ffffff%22%2F%3E%3C%2Fsvg%3E");\n}\n\n.bc-audioPlayer__button.pause::before,\n.bc-audioPlayer__button.pause::after {\n content: "";\n position: absolute;\n top: 14px;\n width: 3px;\n height: 12px;\n background: #16616C;\n}\n\n.bc-otherMessage .bc-audioPlayer__button.pause::before,\n.bc-otherMessage .bc-audioPlayer__button.pause::after {\n background: #ffffff;\n}\n\n.bc-audioPlayer__button.pause::before {\n left: 16px;\n}\n\n.bc-audioPlayer__button.pause::after {\n right: 16px;\n}\n\n.bc-audioPlayer__wave {\n position: relative;\n flex: 1 1 auto;\n height: 22px;\n cursor: pointer;\n}\n\n.bc-audioPlayer__wave--future,\n.bc-audioPlayer__wave--past {\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n height: 22px;\n display: grid;\n grid-auto-flow: column;\n grid-auto-columns: 2px;\n column-gap: 1px;\n align-items: end;\n width: 100%;\n pointer-events: none;\n}\n\n.bc-audioPlayer__wave--future span {\n display: block;\n width: 2px;\n background: rgba(255, 255, 255, 0.6);\n border-radius: 2px;\n}\n\n.bc-otherMessage .bc-audioPlayer__wave--future span {\n background: #16616C;\n opacity: 0.6;\n}\n\n.bc-audioPlayer__wave--past {\n overflow: hidden;\n white-space: nowrap;\n}\n\n.bc-audioPlayer__wave--past span {\n display: inline-block;\n width: 2px;\n margin-right: 3px;\n background: #ffffff;\n border-radius: 2px;\n}\n\n.bc-otherMessage .bc-audioPlayer__wave--past span {\n background: #16616C;\n}\n\n.bc-otherMessage:hover .bc-replyButton, .bc-otherMessage:active .bc-replyButton, .bc-myMessage:hover .bc-replyButton, .bc-myMessage:active .bc-replyButton {\n display: block;\n}\n\n.bc-audioPlayer__time {\n color: #ffffff;\n font-weight: 400;\n opacity: 0.95;\n position: absolute;\n top: 46px;\n left: 80px;\n font-size: 10px;\n}\n\n.bc-otherMessage .bc-audioPlayer__time {\n color: #16616C;\n}\n\n.bc-selectionContainer {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap;\n}\n\n.bc-selectionContainer:first-child {\n flex: 1 0 50%;\n}\n\n.status-icon {\n color: var(--bc-chat-my-message-text-color) !important;\n opacity: 0.7;\n}\n.status-icon.read {\n color: #33C1FF !important;\n}\n.status-icon.failed {\n color: var(--bc-chat-danger-color) !important;\n}\n.status-icon.failed .resend {\n color: var(--bc-chat-dark-gray-color) !important;\n cursor: pointer;\n margin: 0 10px;\n}');const ne$2=newStyled.i`
|
|
43052
43052
|
background-image: url(${e=>e.avatar||f$1});
|
|
43053
43053
|
width: 30px;
|
|
43054
43054
|
height: 30px;
|
|
@@ -43213,7 +43213,7 @@ i {
|
|
|
43213
43213
|
margin-top: 6px;
|
|
43214
43214
|
text-align: center;
|
|
43215
43215
|
}
|
|
43216
|
-
`,
|
|
43216
|
+
`,Ue$1=newStyled.div`
|
|
43217
43217
|
width: 100%;
|
|
43218
43218
|
padding: 8px 12px;
|
|
43219
43219
|
display: flex;
|
|
@@ -43223,7 +43223,7 @@ i {
|
|
|
43223
43223
|
gap: 4px;
|
|
43224
43224
|
flex: 1 0 0;
|
|
43225
43225
|
border-bottom: 1px solid var(--bc-border-neutral-secondary, #E5E7EB);
|
|
43226
|
-
`,
|
|
43226
|
+
`,Ve$2=newStyled.div`
|
|
43227
43227
|
display: flex;
|
|
43228
43228
|
align-items: center;
|
|
43229
43229
|
justify-content: space-between;
|
|
@@ -43264,7 +43264,7 @@ i {
|
|
|
43264
43264
|
color: #111827;
|
|
43265
43265
|
outline: none;
|
|
43266
43266
|
}
|
|
43267
|
-
`,Ye$2=()=>jsx$2("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx$2("path",{d:"M8 6.58579L11.2929 3.29289C11.6834 2.90237 12.3166 2.90237 12.7071 3.29289C13.0976 3.68342 13.0976 4.31658 12.7071 4.70711L9.41421 8L12.7071 11.2929C13.0976 11.6834 13.0976 12.3166 12.7071 12.7071C12.3166 13.0976 11.6834 13.0976 11.2929 12.7071L8 9.41421L4.70711 12.7071C4.31658 13.0976 3.68342 13.0976 3.29289 12.7071C2.90237 12.3166 2.90237 11.6834 3.29289 11.2929L6.58579 8L3.29289 4.70711C2.90237 4.31658 2.90237 3.68342 3.29289 3.29289C3.68342 2.90237 4.31658 2.90237 4.70711 3.29289L8 6.58579Z",fill:"currentColor"})}),Oe$2=({config:t,sendMessage:i,setView:a,actionChips:l,noteMode:c,onNoteSend:d,onCloseNoteMode:g,notePlaceholder:p,replyMessageTitle:h,replyMessageContent:u,onCancelReplyMessage:m})=>{const b="AR"===t?.language,[f,x]=useState(),[y,v]=useState(),[w,M]=useState(),[A,L]=useState(0),k=useMemo((()=>Boolean(h||u)),[h,u]),I=useMemo((()=>h||("AR"===t?.language?"الرد على رسالة":"TR"===t?.language?"Bir mesaja yanıt veriliyor":"Replying to message")),[t?.language,h]),E=useMemo((()=>"AR"===t?.language?"إلغاء":"TR"===t?.language?"İptal":"Cancel"),[t?.language]),R=useCallback((e=>{if(c){const e=(f||"").trim();return d&&d(e),void x("")}const n=e=>{const{fileUrl:n,extension:t}=e;i(C$2.SupportedImageFormats.indexOf(t)>=0?"image":C$2.SupportedAudioFormats.indexOf(t)>=0?"audio":"document",n);};e?e.blob&&e.fileUrl.startsWith("blob:")?ue$1(e.blob,L,((t,i)=>{if(t){try{URL.revokeObjectURL(e.fileUrl);}catch{}n({...e,fileUrl:t,blob:void 0});}else i&&M(i);})):n(e):y?y.blob&&y.fileUrl.startsWith("blob:")?ue$1(y.blob,L,((e,t)=>{if(e){try{URL.revokeObjectURL(y.fileUrl);}catch{}n({...y,fileUrl:e,blob:void 0}),v(void 0);}else t&&M(t);})):(n(y),v(void 0)):(i(he$2,f),x(""));}),[y,f,i,c,d]);return jsxs$1(Je$1,{isRTL:b,children:[k?jsxs$1(
|
|
43267
|
+
`,Ye$2=()=>jsx$2("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx$2("path",{d:"M8 6.58579L11.2929 3.29289C11.6834 2.90237 12.3166 2.90237 12.7071 3.29289C13.0976 3.68342 13.0976 4.31658 12.7071 4.70711L9.41421 8L12.7071 11.2929C13.0976 11.6834 13.0976 12.3166 12.7071 12.7071C12.3166 13.0976 11.6834 13.0976 11.2929 12.7071L8 9.41421L4.70711 12.7071C4.31658 13.0976 3.68342 13.0976 3.29289 12.7071C2.90237 12.3166 2.90237 11.6834 3.29289 11.2929L6.58579 8L3.29289 4.70711C2.90237 4.31658 2.90237 3.68342 3.29289 3.29289C3.68342 2.90237 4.31658 2.90237 4.70711 3.29289L8 6.58579Z",fill:"currentColor"})}),Oe$2=({config:t,sendMessage:i,setView:a,actionChips:l,noteMode:c,onNoteSend:d,onCloseNoteMode:g,notePlaceholder:p,replyMessageTitle:h,replyMessageContent:u,onCancelReplyMessage:m})=>{const b="AR"===t?.language,[f,x]=useState(),[y,v]=useState(),[w,M]=useState(),[A,L]=useState(0),k=useMemo((()=>Boolean(h||u)),[h,u]),I=useMemo((()=>h||("AR"===t?.language?"الرد على رسالة":"TR"===t?.language?"Bir mesaja yanıt veriliyor":"Replying to message")),[t?.language,h]),E=useMemo((()=>"AR"===t?.language?"إلغاء":"TR"===t?.language?"İptal":"Cancel"),[t?.language]),R=useCallback((e=>{if(c){const e=(f||"").trim();return d&&d(e),void x("")}const n=e=>{const{fileUrl:n,extension:t}=e;i(C$2.SupportedImageFormats.indexOf(t)>=0?"image":C$2.SupportedAudioFormats.indexOf(t)>=0?"audio":"document",n);};e?e.blob&&e.fileUrl.startsWith("blob:")?ue$1(e.blob,L,((t,i)=>{if(t){try{URL.revokeObjectURL(e.fileUrl);}catch{}n({...e,fileUrl:t,blob:void 0});}else i&&M(i);})):n(e):y?y.blob&&y.fileUrl.startsWith("blob:")?ue$1(y.blob,L,((e,t)=>{if(e){try{URL.revokeObjectURL(y.fileUrl);}catch{}n({...y,fileUrl:e,blob:void 0}),v(void 0);}else t&&M(t);})):(n(y),v(void 0)):(i(he$2,f),x(""));}),[y,f,i,c,d]);return jsxs$1(Je$1,{isRTL:b,children:[k?jsxs$1(Ue$1,{isRTL:b,children:[jsxs$1(Ve$2,{isRTL:b,children:[I?jsx$2(Ke$1,{children:I}):null,m?jsx$2(We$1,{type:"button",onClick:m,"aria-label":E,title:E,children:jsx$2(Ye$2,{})}):null]}),u?jsx$2(Qe$1,{children:u}):null]}):null,jsx$2("div",{className:"bc-InputArea",children:jsx$2(we$2,{config:t,send:R,text:f,setText:x,file:c?void 0:y,isFileSelected:!!y,cancelFileUpload:()=>v(void 0),noteMode:c,onCloseNoteMode:()=>{x(""),g?.();},notePlaceholder:p})}),jsxs$1("div",{className:"bc-BottomBar "+(b?"bc-RTL":""),children:[void 0!==l?l:null,jsx$2("div",{className:"bc-CommandsArea "+(b?"bc-RTL":""),children:c?null:jsx$2(Ge$1,{setView:a,setFile:v,setProgress:L,setError:M,setText:x,text:f,send:R,config:t})})]}),w?jsx$2("div",{className:"bc-uploadFileError",children:w}):null]})},qe$2="bc-chat-header-banner",Xe$1=390,$e$1=newStyled.div`
|
|
43268
43268
|
${e=>e.bannerWidth>Xe$1?"height: 60px;":"height: 90px;"}
|
|
43269
43269
|
display: block;
|
|
43270
43270
|
width: 100%;
|