@developer.notchatbot/webchat 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7426,7 +7426,8 @@ const Hg = ({ message: e, avatar: t, textColor: n, bubbleUserColor: r }) => e.se
|
|
|
7426
7426
|
{
|
|
7427
7427
|
className: "nbc-break-words",
|
|
7428
7428
|
style: { overflowWrap: "anywhere", wordBreak: "break-word" },
|
|
7429
|
-
dangerouslySetInnerHTML: { __html: fe(e.text, { renderer: si }) }
|
|
7429
|
+
dangerouslySetInnerHTML: { __html: fe(e.text, { renderer: si }) },
|
|
7430
|
+
id: "notchatbot-message-text"
|
|
7430
7431
|
}
|
|
7431
7432
|
),
|
|
7432
7433
|
/* @__PURE__ */ F.jsx("div", { className: "nbc-text-xs nbc-mt-1 nbc-opacity-70 nbc-text-right", children: Ou(String(e.timestamp)).split(" ")[1].substring(0, 5) })
|
|
@@ -7454,7 +7455,8 @@ const Hg = ({ message: e, avatar: t, textColor: n, bubbleUserColor: r }) => e.se
|
|
|
7454
7455
|
{
|
|
7455
7456
|
className: "nbc-break-words",
|
|
7456
7457
|
style: { overflowWrap: "anywhere", wordBreak: "break-word" },
|
|
7457
|
-
dangerouslySetInnerHTML: { __html: fe(e.text, { renderer: si }) }
|
|
7458
|
+
dangerouslySetInnerHTML: { __html: fe(e.text, { renderer: si }) },
|
|
7459
|
+
id: "notchatbot-message-text"
|
|
7458
7460
|
}
|
|
7459
7461
|
) })
|
|
7460
7462
|
] }) }), Fg = ({ avatar: e }) => /* @__PURE__ */ F.jsx("div", { className: "nbc-flex nbc-justify-start nbc-mb-4", children: /* @__PURE__ */ F.jsxs("div", { className: "nbc-flex nbc-items-start nbc-space-x-3", children: [
|
|
@@ -92,7 +92,7 @@ ${e}</tr>
|
|
|
92
92
|
`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
93
93
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${At(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),o=qf(e);if(o===null)return r;e=o;let i='<a href="'+e+'"';return t&&(i+=' title="'+At(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const o=qf(e);if(o===null)return At(n);e=o;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${At(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:At(e.text)}},il=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Ft=class yl{constructor(t){ve(this,"options");ve(this,"renderer");ve(this,"textRenderer");this.options=t||Rn,this.options.renderer=this.options.renderer||new ki,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new il}static parse(t,n){return new yl(n).parse(t)}static parseInline(t,n){return new yl(n).parseInline(t)}parse(t,n=!0){var o,i;let r="";for(let a=0;a<t.length;a++){const l=t[a];if((i=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&i[l.type]){const m=l,b=this.options.extensions.renderers[m.type].call({parser:this},m);if(b!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(m.type)){r+=b||"";continue}}const d=l;switch(d.type){case"space":{r+=this.renderer.space(d);continue}case"hr":{r+=this.renderer.hr(d);continue}case"heading":{r+=this.renderer.heading(d);continue}case"code":{r+=this.renderer.code(d);continue}case"table":{r+=this.renderer.table(d);continue}case"blockquote":{r+=this.renderer.blockquote(d);continue}case"list":{r+=this.renderer.list(d);continue}case"html":{r+=this.renderer.html(d);continue}case"paragraph":{r+=this.renderer.paragraph(d);continue}case"text":{let m=d,b=this.renderer.text(m);for(;a+1<t.length&&t[a+1].type==="text";)m=t[++a],b+=`
|
|
94
94
|
`+this.renderer.text(m);n?r+=this.renderer.paragraph({type:"paragraph",raw:b,text:b,tokens:[{type:"text",raw:b,text:b,escaped:!0}]}):r+=b;continue}default:{const m='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return r}parseInline(t,n=this.renderer){var o,i;let r="";for(let a=0;a<t.length;a++){const l=t[a];if((i=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&i[l.type]){const m=this.options.extensions.renderers[l.type].call({parser:this},l);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=m||"";continue}}const d=l;switch(d.type){case"escape":{r+=n.text(d);break}case"html":{r+=n.html(d);break}case"link":{r+=n.link(d);break}case"image":{r+=n.image(d);break}case"strong":{r+=n.strong(d);break}case"em":{r+=n.em(d);break}case"codespan":{r+=n.codespan(d);break}case"br":{r+=n.br(d);break}case"del":{r+=n.del(d);break}case"text":{r+=n.text(d);break}default:{const m='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return r}},Ei=(dl=class{constructor(e){ve(this,"options");ve(this,"block");this.options=e||Rn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Ht.lex:Ht.lexInline}provideParser(){return this.block?Ft.parse:Ft.parseInline}},ve(dl,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),dl),Dg=class{constructor(...e){ve(this,"defaults",Js());ve(this,"options",this.setOptions);ve(this,"parse",this.parseMarkdown(!0));ve(this,"parseInline",this.parseMarkdown(!1));ve(this,"Parser",Ft);ve(this,"Renderer",ki);ve(this,"TextRenderer",il);ve(this,"Lexer",Ht);ve(this,"Tokenizer",Ci);ve(this,"Hooks",Ei);this.use(...e)}walkTokens(e,t){var r,o;let n=[];for(const i of e)switch(n=n.concat(t.call(this,i)),i.type){case"table":{const a=i;for(const l of a.header)n=n.concat(this.walkTokens(l.tokens,t));for(const l of a.rows)for(const d of l)n=n.concat(this.walkTokens(d.tokens,t));break}case"list":{const a=i;n=n.concat(this.walkTokens(a.items,t));break}default:{const a=i;(o=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&o[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{const d=a[l].flat(1/0);n=n.concat(this.walkTokens(d,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r=ae({},n);if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const i=t.renderers[o.name];i?t.renderers[o.name]=function(...a){let l=o.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=t[o.level];i?i.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),r.extensions=t),n.renderer){const o=this.defaults.renderer||new ki(this.defaults);for(const i in n.renderer){if(!(i in o))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=i,l=n.renderer[a],d=o[a];o[a]=(...m)=>{let b=l.apply(o,m);return b===!1&&(b=d.apply(o,m)),b||""}}r.renderer=o}if(n.tokenizer){const o=this.defaults.tokenizer||new Ci(this.defaults);for(const i in n.tokenizer){if(!(i in o))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=i,l=n.tokenizer[a],d=o[a];o[a]=(...m)=>{let b=l.apply(o,m);return b===!1&&(b=d.apply(o,m)),b}}r.tokenizer=o}if(n.hooks){const o=this.defaults.hooks||new Ei;for(const i in n.hooks){if(!(i in o))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=i,l=n.hooks[a],d=o[a];Ei.passThroughHooks.has(i)?o[a]=m=>{if(this.defaults.async)return Promise.resolve(l.call(o,m)).then(R=>d.call(o,R));const b=l.call(o,m);return d.call(o,b)}:o[a]=(...m)=>{let b=l.apply(o,m);return b===!1&&(b=d.apply(o,m)),b}}r.hooks=o}if(n.walkTokens){const o=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),o&&(l=l.concat(o.call(this,a))),l}}this.defaults=ae(ae({},this.defaults),r)}),this}setOptions(e){return this.defaults=ae(ae({},this.defaults),e),this}lexer(e,t){return Ht.lex(e,t!=null?t:this.defaults)}parser(e,t){return Ft.parse(e,t!=null?t:this.defaults)}parseMarkdown(e){return(n,r)=>{const o=ae({},r),i=ae(ae({},this.defaults),o),a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&o.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n=="undefined"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);const l=i.hooks?i.hooks.provideLexer():e?Ht.lex:Ht.lexInline,d=i.hooks?i.hooks.provideParser():e?Ft.parse:Ft.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(m=>l(m,i)).then(m=>i.hooks?i.hooks.processAllTokens(m):m).then(m=>i.walkTokens?Promise.all(this.walkTokens(m,i.walkTokens)).then(()=>m):m).then(m=>d(m,i)).then(m=>i.hooks?i.hooks.postprocess(m):m).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));let m=l(n,i);i.hooks&&(m=i.hooks.processAllTokens(m)),i.walkTokens&&this.walkTokens(m,i.walkTokens);let b=d(m,i);return i.hooks&&(b=i.hooks.postprocess(b)),b}catch(m){return a(m)}}}onError(e,t){return n=>{if(n.message+=`
|
|
95
|
-
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+At(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},On=new Dg;function fe(e,t){return On.parse(e,t)}fe.options=fe.setOptions=function(e){return On.setOptions(e),fe.defaults=On.defaults,zf(fe.defaults),fe},fe.getDefaults=Js,fe.defaults=Rn,fe.use=function(...e){return On.use(...e),fe.defaults=On.defaults,zf(fe.defaults),fe},fe.walkTokens=function(e,t){return On.walkTokens(e,t)},fe.parseInline=On.parseInline,fe.Parser=Ft,fe.parser=Ft.parse,fe.Renderer=ki,fe.TextRenderer=il,fe.Lexer=Ht,fe.lexer=Ht.lex,fe.Tokenizer=Ci,fe.Hooks=Ei,fe.parse=fe,fe.options,fe.setOptions,fe.use,fe.walkTokens,fe.parseInline,Ft.parse,Ht.lex;const Ug=e=>{if(e instanceof Date)return e;const t=e.endsWith("Z")?e:`${e}Z`;return new Date(t)};function nd(e){if(!e)return"";const t=Ug(e),n=t.getDate().toString().padStart(2,"0"),r=(t.getMonth()+1).toString().padStart(2,"0"),o=t.getFullYear(),i=t.getHours().toString().padStart(2,"0"),a=t.getMinutes().toString().padStart(2,"0");return`${n}/${r}/${o} ${i}:${a}`}const Ri=new fe.Renderer;Ri.link=({href:e,title:t,text:n})=>`<a href="${e}" title="${t||""}" target="_blank" class="nbc-text-blue-500 nbc-hover:underline">${n}</a>`,Ri.heading=({depth:e,text:t})=>`<h${e} class="nbc-text-[${1.5-e*.2}rem] nbc-font-bold nbc-mb-2">${t}</h${e}>`;const Bg=({message:e,avatar:t,textColor:n,bubbleUserColor:r})=>e.sender==="user"?F.jsx("div",{className:"nbc-w-full nbc-flex nbc-justify-end nbc-mb-4",children:F.jsxs("div",{className:"nbc-max-w-[90%] nbc-px-4 nbc-py-3 nbc-rounded-2xl nbc-text-sm nbc-leading-relaxed nbc-bg-gray-100 nbc-text-gray-900 nbc-rounded-br-md",style:{color:n,backgroundColor:r},children:[F.jsx("div",{className:"nbc-break-words",style:{overflowWrap:"anywhere",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:fe(e.text,{renderer:Ri})}}),F.jsx("div",{className:"nbc-text-xs nbc-mt-1 nbc-opacity-70 nbc-text-right",children:nd(String(e.timestamp)).split(" ")[1].substring(0,5)})]})}):F.jsx("div",{className:"nbc-flex nbc-justify-start nbc-mb-4",children:F.jsxs("div",{className:"nbc-w-full nbc-flex nbc-items-start nbc-space-x-3",children:[F.jsxs("div",{className:"nbc-flex nbc-flex-col nbc-items-center nbc-py-3 nbc-text-black",children:[t?F.jsx("img",{src:t,alt:"AI Assistant",className:"nbc-w-7 nbc-h-7 nbc-rounded-full nbc-object-cover nbc-flex-shrink-0"}):F.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"nbc-w-8 nbc-h-8 nbc-bg-white nbc-rounded-full nbc-p-1",children:[F.jsx("path",{d:"M12 6V2H8"}),F.jsx("path",{d:"m8 18-4 4V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2Z"}),F.jsx("path",{d:"M2 12h2"}),F.jsx("path",{d:"M9 11v2"}),F.jsx("path",{d:"M15 11v2"}),F.jsx("path",{d:"M20 12h2"})]}),F.jsx("div",{className:"nbc-text-xs nbc-text-gray-500 nbc-opacity-70 nbc-whitespace-nowrap",style:{color:n},children:nd(String(e.timestamp)).split(" ")[1].substring(0,5)})]}),F.jsx("div",{className:"nbc-max-w-[90%] nbc-py-3 nbc-rounded-2xl nbc-text-sm nbc-leading-relaxed nbc-text-gray-800 nbc-rounded-bl-md",style:{color:n},children:F.jsx("div",{className:"nbc-break-words",style:{overflowWrap:"anywhere",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:fe(e.text,{renderer:Ri})}})})]})}),_g=({avatar:e})=>F.jsx("div",{className:"nbc-flex nbc-justify-start nbc-mb-4",children:F.jsxs("div",{className:"nbc-flex nbc-items-start nbc-space-x-3",children:[F.jsxs("div",{className:"nbc-flex nbc-flex-col nbc-items-center nbc-py-3 nbc-text-black",children:[e?F.jsx("img",{src:e,alt:"AI Assistant",className:"nbc-w-7 nbc-h-7 nbc-rounded-full nbc-object-cover nbc-flex-shrink-0"}):F.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"nbc-w-8 nbc-h-8 nbc-bg-white nbc-rounded-full nbc-p-1",children:[F.jsx("path",{d:"M12 6V2H8"}),F.jsx("path",{d:"m8 18-4 4V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2Z"}),F.jsx("path",{d:"M2 12h2"}),F.jsx("path",{d:"M9 11v2"}),F.jsx("path",{d:"M15 11v2"}),F.jsx("path",{d:"M20 12h2"})]}),F.jsx("div",{className:"nbc-text-xs nbc-text-gray-500 nbc-opacity-70 nbc-whitespace-nowrap",children:" "})]}),F.jsx("div",{className:"nbc-bg-white nbc-px-4 nbc-py-3 nbc-rounded-2xl nbc-rounded-bl-md nbc-shadow-sm",children:F.jsxs("div",{className:"nbc-flex nbc-space-x-1",children:[F.jsx("div",{className:"nbc-w-2 nbc-h-2 nbc-bg-gray-400 nbc-rounded-full nbc-animate-bounce",style:{animationDelay:"0ms"}}),F.jsx("div",{className:"nbc-w-2 nbc-h-2 nbc-bg-gray-400 nbc-rounded-full nbc-animate-bounce",style:{animationDelay:"150ms"}}),F.jsx("div",{className:"nbc-w-2 nbc-h-2 nbc-bg-gray-400 nbc-rounded-full nbc-animate-bounce",style:{animationDelay:"300ms"}})]})})]})}),rd=({messages:e,isTyping:t,avatar:n,textColor:r,bubbleUserColor:o,chatbotActivated:i=!0})=>{const a=Z.useRef(null),l=Z.useRef(null),d=()=>{l.current&&requestAnimationFrame(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)})};return Z.useEffect(()=>{const m=setTimeout(()=>{d()},50);return()=>clearTimeout(m)},[e,t]),F.jsxs("div",{ref:l,className:"nbc-flex-1 nbc-overflow-y-auto nbc-px-2 nbc-pt-4",style:{scrollbarWidth:"thin",scrollbarColor:"#d1d5db #f9fafb",scrollBehavior:"smooth",overscrollBehavior:"contain",position:"relative"},children:[F.jsx("style",{children:`
|
|
95
|
+
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+At(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},On=new Dg;function fe(e,t){return On.parse(e,t)}fe.options=fe.setOptions=function(e){return On.setOptions(e),fe.defaults=On.defaults,zf(fe.defaults),fe},fe.getDefaults=Js,fe.defaults=Rn,fe.use=function(...e){return On.use(...e),fe.defaults=On.defaults,zf(fe.defaults),fe},fe.walkTokens=function(e,t){return On.walkTokens(e,t)},fe.parseInline=On.parseInline,fe.Parser=Ft,fe.parser=Ft.parse,fe.Renderer=ki,fe.TextRenderer=il,fe.Lexer=Ht,fe.lexer=Ht.lex,fe.Tokenizer=Ci,fe.Hooks=Ei,fe.parse=fe,fe.options,fe.setOptions,fe.use,fe.walkTokens,fe.parseInline,Ft.parse,Ht.lex;const Ug=e=>{if(e instanceof Date)return e;const t=e.endsWith("Z")?e:`${e}Z`;return new Date(t)};function nd(e){if(!e)return"";const t=Ug(e),n=t.getDate().toString().padStart(2,"0"),r=(t.getMonth()+1).toString().padStart(2,"0"),o=t.getFullYear(),i=t.getHours().toString().padStart(2,"0"),a=t.getMinutes().toString().padStart(2,"0");return`${n}/${r}/${o} ${i}:${a}`}const Ri=new fe.Renderer;Ri.link=({href:e,title:t,text:n})=>`<a href="${e}" title="${t||""}" target="_blank" class="nbc-text-blue-500 nbc-hover:underline">${n}</a>`,Ri.heading=({depth:e,text:t})=>`<h${e} class="nbc-text-[${1.5-e*.2}rem] nbc-font-bold nbc-mb-2">${t}</h${e}>`;const Bg=({message:e,avatar:t,textColor:n,bubbleUserColor:r})=>e.sender==="user"?F.jsx("div",{className:"nbc-w-full nbc-flex nbc-justify-end nbc-mb-4",children:F.jsxs("div",{className:"nbc-max-w-[90%] nbc-px-4 nbc-py-3 nbc-rounded-2xl nbc-text-sm nbc-leading-relaxed nbc-bg-gray-100 nbc-text-gray-900 nbc-rounded-br-md",style:{color:n,backgroundColor:r},children:[F.jsx("div",{className:"nbc-break-words",style:{overflowWrap:"anywhere",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:fe(e.text,{renderer:Ri})},id:"notchatbot-message-text"}),F.jsx("div",{className:"nbc-text-xs nbc-mt-1 nbc-opacity-70 nbc-text-right",children:nd(String(e.timestamp)).split(" ")[1].substring(0,5)})]})}):F.jsx("div",{className:"nbc-flex nbc-justify-start nbc-mb-4",children:F.jsxs("div",{className:"nbc-w-full nbc-flex nbc-items-start nbc-space-x-3",children:[F.jsxs("div",{className:"nbc-flex nbc-flex-col nbc-items-center nbc-py-3 nbc-text-black",children:[t?F.jsx("img",{src:t,alt:"AI Assistant",className:"nbc-w-7 nbc-h-7 nbc-rounded-full nbc-object-cover nbc-flex-shrink-0"}):F.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"nbc-w-8 nbc-h-8 nbc-bg-white nbc-rounded-full nbc-p-1",children:[F.jsx("path",{d:"M12 6V2H8"}),F.jsx("path",{d:"m8 18-4 4V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2Z"}),F.jsx("path",{d:"M2 12h2"}),F.jsx("path",{d:"M9 11v2"}),F.jsx("path",{d:"M15 11v2"}),F.jsx("path",{d:"M20 12h2"})]}),F.jsx("div",{className:"nbc-text-xs nbc-text-gray-500 nbc-opacity-70 nbc-whitespace-nowrap",style:{color:n},children:nd(String(e.timestamp)).split(" ")[1].substring(0,5)})]}),F.jsx("div",{className:"nbc-max-w-[90%] nbc-py-3 nbc-rounded-2xl nbc-text-sm nbc-leading-relaxed nbc-text-gray-800 nbc-rounded-bl-md",style:{color:n},children:F.jsx("div",{className:"nbc-break-words",style:{overflowWrap:"anywhere",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:fe(e.text,{renderer:Ri})},id:"notchatbot-message-text"})})]})}),_g=({avatar:e})=>F.jsx("div",{className:"nbc-flex nbc-justify-start nbc-mb-4",children:F.jsxs("div",{className:"nbc-flex nbc-items-start nbc-space-x-3",children:[F.jsxs("div",{className:"nbc-flex nbc-flex-col nbc-items-center nbc-py-3 nbc-text-black",children:[e?F.jsx("img",{src:e,alt:"AI Assistant",className:"nbc-w-7 nbc-h-7 nbc-rounded-full nbc-object-cover nbc-flex-shrink-0"}):F.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"nbc-w-8 nbc-h-8 nbc-bg-white nbc-rounded-full nbc-p-1",children:[F.jsx("path",{d:"M12 6V2H8"}),F.jsx("path",{d:"m8 18-4 4V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2Z"}),F.jsx("path",{d:"M2 12h2"}),F.jsx("path",{d:"M9 11v2"}),F.jsx("path",{d:"M15 11v2"}),F.jsx("path",{d:"M20 12h2"})]}),F.jsx("div",{className:"nbc-text-xs nbc-text-gray-500 nbc-opacity-70 nbc-whitespace-nowrap",children:" "})]}),F.jsx("div",{className:"nbc-bg-white nbc-px-4 nbc-py-3 nbc-rounded-2xl nbc-rounded-bl-md nbc-shadow-sm",children:F.jsxs("div",{className:"nbc-flex nbc-space-x-1",children:[F.jsx("div",{className:"nbc-w-2 nbc-h-2 nbc-bg-gray-400 nbc-rounded-full nbc-animate-bounce",style:{animationDelay:"0ms"}}),F.jsx("div",{className:"nbc-w-2 nbc-h-2 nbc-bg-gray-400 nbc-rounded-full nbc-animate-bounce",style:{animationDelay:"150ms"}}),F.jsx("div",{className:"nbc-w-2 nbc-h-2 nbc-bg-gray-400 nbc-rounded-full nbc-animate-bounce",style:{animationDelay:"300ms"}})]})})]})}),rd=({messages:e,isTyping:t,avatar:n,textColor:r,bubbleUserColor:o,chatbotActivated:i=!0})=>{const a=Z.useRef(null),l=Z.useRef(null),d=()=>{l.current&&requestAnimationFrame(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)})};return Z.useEffect(()=>{const m=setTimeout(()=>{d()},50);return()=>clearTimeout(m)},[e,t]),F.jsxs("div",{ref:l,className:"nbc-flex-1 nbc-overflow-y-auto nbc-px-2 nbc-pt-4",style:{scrollbarWidth:"thin",scrollbarColor:"#d1d5db #f9fafb",scrollBehavior:"smooth",overscrollBehavior:"contain",position:"relative"},children:[F.jsx("style",{children:`
|
|
96
96
|
.nbc-flex-1::-webkit-scrollbar {
|
|
97
97
|
width: 6px;
|
|
98
98
|
}
|
package/package.json
CHANGED