@convergeapp/chat-widget 1.3.0 → 1.3.2

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.
Files changed (2) hide show
  1. package/dist/widget.js +15 -16
  2. package/package.json +1 -1
package/dist/widget.js CHANGED
@@ -82,7 +82,7 @@ ${this.parser.parse(i)}</blockquote>
82
82
  ${i}</tr>
83
83
  `}tablecell(i){let e=this.parser.parseInline(i.tokens),t=i.header?"th":"td";return(i.align?`<${t} align="${i.align}">`:`<${t}>`)+e+`</${t}>
84
84
  `}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${Pt(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:e,tokens:t}){let n=this.parser.parseInline(t),s=Xh(i);if(s===null)return n;i=s;let r='<a href="'+i+'"';return e&&(r+=' title="'+Pt(e)+'"'),r+=">"+n+"</a>",r}image({href:i,title:e,text:t,tokens:n}){n&&(t=this.parser.parseInline(n,this.parser.textRenderer));let s=Xh(i);if(s===null)return Pt(t);i=s;let r=`<img src="${i}" alt="${t}"`;return e&&(r+=` title="${Pt(e)}"`),r+=">",r}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:Pt(i.text)}},da=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}checkbox({raw:i}){return i}},ht=class xa{options;renderer;textRenderer;constructor(e){this.options=e||mn,this.options.renderer=this.options.renderer||new ar,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new da}static parse(e,t){return new xa(t).parse(e)}static parseInline(e,t){return new xa(t).parseInline(e)}parse(e){let t="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions?.renderers?.[s.type]){let o=s,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){t+=a||"";continue}}let r=s;switch(r.type){case"space":{t+=this.renderer.space(r);break}case"hr":{t+=this.renderer.hr(r);break}case"heading":{t+=this.renderer.heading(r);break}case"code":{t+=this.renderer.code(r);break}case"table":{t+=this.renderer.table(r);break}case"blockquote":{t+=this.renderer.blockquote(r);break}case"list":{t+=this.renderer.list(r);break}case"checkbox":{t+=this.renderer.checkbox(r);break}case"html":{t+=this.renderer.html(r);break}case"def":{t+=this.renderer.def(r);break}case"paragraph":{t+=this.renderer.paragraph(r);break}case"text":{t+=this.renderer.text(r);break}default:{let o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return t}parseInline(e,t=this.renderer){let n="";for(let s=0;s<e.length;s++){let r=e[s];if(this.options.extensions?.renderers?.[r.type]){let a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){n+=a||"";continue}}let o=r;switch(o.type){case"escape":{n+=t.text(o);break}case"html":{n+=t.html(o);break}case"link":{n+=t.link(o);break}case"image":{n+=t.image(o);break}case"checkbox":{n+=t.checkbox(o);break}case"strong":{n+=t.strong(o);break}case"em":{n+=t.em(o);break}case"codespan":{n+=t.codespan(o);break}case"br":{n+=t.br(o);break}case"del":{n+=t.del(o);break}case"text":{n+=t.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}},Ki=class{options;block;constructor(i){this.options=i||mn}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}emStrongMask(i){return i}provideLexer(){return this.block?ct.lex:ct.lexInline}provideParser(){return this.block?ht.parse:ht.parseInline}},Zp=class{defaults=ia();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ht;Renderer=ar;TextRenderer=da;Lexer=ct;Tokenizer=or;Hooks=Ki;constructor(...i){this.use(...i)}walkTokens(i,e){let t=[];for(let n of i)switch(t=t.concat(e.call(this,n)),n.type){case"table":{let s=n;for(let r of s.header)t=t.concat(this.walkTokens(r.tokens,e));for(let r of s.rows)for(let o of r)t=t.concat(this.walkTokens(o.tokens,e));break}case"list":{let s=n;t=t.concat(this.walkTokens(s.items,e));break}default:{let s=n;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(r=>{let o=s[r].flat(1/0);t=t.concat(this.walkTokens(o,e))}):s.tokens&&(t=t.concat(this.walkTokens(s.tokens,e)))}}return t}use(...i){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(t=>{let n={...t};if(n.async=this.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let r=e.renderers[s.name];r?e.renderers[s.name]=function(...o){let a=s.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[s.level];r?r.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),n.extensions=e),t.renderer){let s=this.defaults.renderer||new ar(this.defaults);for(let r in t.renderer){if(!(r in s))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let o=r,a=t.renderer[o],l=s[o];s[o]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h||""}}n.renderer=s}if(t.tokenizer){let s=this.defaults.tokenizer||new or(this.defaults);for(let r in t.tokenizer){if(!(r in s))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let o=r,a=t.tokenizer[o],l=s[o];s[o]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h}}n.tokenizer=s}if(t.hooks){let s=this.defaults.hooks||new Ki;for(let r in t.hooks){if(!(r in s))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let o=r,a=t.hooks[o],l=s[o];Ki.passThroughHooks.has(r)?s[o]=c=>{if(this.defaults.async&&Ki.passThroughHooksRespectAsync.has(r))return(async()=>{let u=await a.call(s,c);return l.call(s,u)})();let h=a.call(s,c);return l.call(s,h)}:s[o]=(...c)=>{if(this.defaults.async)return(async()=>{let u=await a.apply(s,c);return u===!1&&(u=await l.apply(s,c)),u})();let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h}}n.hooks=s}if(t.walkTokens){let s=this.defaults.walkTokens,r=t.walkTokens;n.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...n}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,e){return ct.lex(i,e??this.defaults)}parser(i,e){return ht.parse(i,e??this.defaults)}parseMarkdown(i){return(e,t)=>{let n={...t},s={...this.defaults,...n},r=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&n.async===!1)return r(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 e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=i),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(e):e,a=await(s.hooks?await s.hooks.provideLexer():i?ct.lex:ct.lexInline)(o,s),l=s.hooks?await s.hooks.processAllTokens(a):a;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let c=await(s.hooks?await s.hooks.provideParser():i?ht.parse:ht.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(c):c})().catch(r);try{s.hooks&&(e=s.hooks.preprocess(e));let o=(s.hooks?s.hooks.provideLexer():i?ct.lex:ct.lexInline)(e,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let a=(s.hooks?s.hooks.provideParser():i?ht.parse:ht.parseInline)(o,s);return s.hooks&&(a=s.hooks.postprocess(a)),a}catch(o){return r(o)}}}onError(i,e){return t=>{if(t.message+=`
85
- Please report this to https://github.com/markedjs/marked.`,i){let n="<p>An error occurred:</p><pre>"+Pt(t.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(t);throw t}}},_n=new Zp;function le(i,e){return _n.parse(i,e)}le.options=le.setOptions=function(i){return _n.setOptions(i),le.defaults=_n.defaults,Ph(le.defaults),le},le.getDefaults=ia,le.defaults=mn,le.use=function(...i){return _n.use(...i),le.defaults=_n.defaults,Ph(le.defaults),le},le.walkTokens=function(i,e){return _n.walkTokens(i,e)},le.parseInline=_n.parseInline,le.Parser=ht,le.parser=ht.parse,le.Renderer=ar,le.TextRenderer=da,le.Lexer=ct,le.lexer=ct.lex,le.Tokenizer=or,le.Hooks=Ki,le.parse=le,le.options,le.setOptions,le.use,le.walkTokens,le.parseInline,ht.parse,ct.lex,le.setOptions({breaks:!0,gfm:!0});function Xp({items:i,isLoading:e}){const[t,n]=ee(""),[s,r]=ee(null),o=i.filter(c=>{const h=t.toLowerCase();return c.question.toLowerCase().includes(h)||c.answer.toLowerCase().includes(h)}),a=c=>{r(s===c?null:c)},l=c=>({__html:le(c)});return e?m("div",{class:"faq-loading",children:[m(up,{}),m("p",{class:"faq-loading-text",children:"Loading FAQ..."})]}):i.length===0?m("div",{class:"faq-empty",children:[m("svg",{class:"icon-lg icon-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[m("circle",{cx:"12",cy:"12",r:"10"}),m("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3","stroke-linecap":"round"}),m("line",{x1:"12",y1:"17",x2:"12.01",y2:"17","stroke-linecap":"round"})]}),m("p",{class:"faq-empty-text",children:"No FAQ items available"})]}):m("div",{class:"faq-container",children:[m("div",{class:"faq-search-container",children:[m("svg",{class:"faq-search-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[m("circle",{cx:"11",cy:"11",r:"8"}),m("path",{d:"m21 21-4.35-4.35"})]}),m("input",{type:"text",value:t,onInput:c=>n(c.target.value),placeholder:"Search questions...",class:"faq-search-input"}),t&&m("button",{type:"button",onClick:()=>n(""),class:"faq-search-clear",children:m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})})]}),o.length===0?m("div",{class:"faq-no-results",children:m("p",{children:['No results found for "',t,'"']})}):m("div",{class:"faq-list",children:o.map(c=>{const h=s===c.id;return m("div",{class:"faq-item",children:[m("button",{type:"button",onClick:()=>a(c.id),class:"faq-question-button",children:[m("span",{class:"faq-question-text",children:c.question}),m("svg",{class:`faq-chevron ${h?"expanded":""}`,fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24",children:m("path",{d:"m9 18 6-6-6-6","stroke-linecap":"round","stroke-linejoin":"round"})})]}),m("div",{class:`faq-answer ${h?"expanded":""}`,children:m("div",{class:"faq-answer-inner",children:m("div",{class:"faq-answer-content markdown-content",dangerouslySetInnerHTML:l(c.answer)})})})]},c.id)})})]})}function Hp(){const{settings:i,updateProfile:e}=ls(),[t,n]=ee("name"),[s,r]=ee(""),[o,a]=ee(""),[l,c]=ee(""),[h,u]=ee(""),d=Ie(null),f=["name"];i?.requireEmail!=="disabled"&&f.push("email"),i?.requirePhone!=="disabled"&&f.push("phone"),f.push("complete");const g=f.indexOf(t),y=f.length-1;Et(function(){d.current?.focus()},[t]);const _=()=>{if(u(""),t==="name"){if(!s.trim()){u("Please enter your name");return}}else if(t==="email"){if(i?.requireEmail==="required"&&!o.trim()){u("Email is required");return}if(o.trim()&&!o.includes("@")){u("Please enter a valid email");return}}else if(t==="phone"&&i?.requirePhone==="required"&&!l.trim()){u("Phone number is required");return}const v=f[g+1];v==="complete"?e(s,o.trim()||void 0,l.trim()||void 0):n(v)},x=()=>t==="name"?"Enter your name":t==="email"?i?.requireEmail==="required"?"Enter your email":"Enter your email (optional)":t==="phone"?i?.requirePhone==="required"?"Enter your phone number":"Enter your phone number (optional)":"",w=g===y-1;return m(it,{children:[h&&m("div",{class:"onboarding-error-banner",children:h}),m("div",{class:"chat-input-container",children:[m("div",{class:"chat-input-form",children:[m("input",{ref:d,type:"text",value:t==="name"?s:t==="email"?o:l,onInput:v=>{const b=v.target.value;t==="name"?r(b):t==="email"?a(b):t==="phone"&&c(b),u("")},onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),_())},placeholder:x(),class:"message-input"}),m("button",{type:"button",onClick:_,class:"onboarding-next-button",children:[m("span",{class:"onboarding-button-text",children:w?"Start Chat":"Next"}),m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})})]})]}),m("div",{class:"onboarding-progress-pills",children:f.slice(0,-1).map((v,b)=>m("div",{class:`onboarding-pill ${b<g?"onboarding-pill-completed":""}`},b))})]})]})}function Jp(){const{inputMessage:i,isSending:e,showAttachmentMenu:t,messages:n,cannedResponses:s,setInputMessage:r,sendTypingIndicator:o,sendMessage:a,toggleAttachmentMenu:l,handleGalleryUpload:c,handleFileUpload:h,handleLocationShare:u}=ls(),d=Ie(null),[f,g]=ee(!1),_=!n.some(v=>!v.isSupport)&&!f&&s.length>0;Et(function(){const b=setTimeout(()=>d.current?.focus(),100);return()=>clearTimeout(b)},[]);const x=v=>{v.preventDefault(),a(),setTimeout(()=>d.current?.focus(),50)},w=v=>{g(!0),a(v)};return m(it,{children:[_&&m("div",{class:"canned-responses-bar",children:s.map(v=>m("button",{type:"button",onClick:()=>w(v.text),class:"canned-response-button",disabled:e,children:v.text},v.id))}),t&&m("div",{class:"attachment-menu",children:[m("button",{type:"button",onClick:c,disabled:e,class:"attachment-button",children:[m("svg",{class:"icon-md icon-blue",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),m("span",{class:"attachment-label",children:"Photo/Video"})]}),m("button",{type:"button",onClick:h,disabled:e,class:"attachment-button",children:[m("svg",{class:"icon-md icon-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),m("span",{class:"attachment-label",children:"File"})]}),m("button",{type:"button",onClick:u,disabled:e,class:"attachment-button",children:[m("svg",{class:"icon-md icon-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),m("span",{class:"attachment-label",children:"Location"})]})]}),m("div",{class:"chat-input-container",children:m("form",{onSubmit:x,class:"chat-input-form",children:[m("button",{type:"button",onClick:l,disabled:e,class:"input-icon-button",children:m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})})}),m("input",{ref:d,type:"text",value:i,onInput:v=>{r(v.target.value),o()},placeholder:"Type a message...",disabled:e,class:"message-input"}),m("button",{type:"submit",disabled:e||!i.trim(),class:"send-button",children:m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 10l7-7m0 0l7 7m-7-7v18"})})})]})})]})}function Qp(){const{settings:i,company:e,isOpen:t,currentPage:n,availablePlatforms:s,hasCompletedProfile:r,messages:o,unreadCount:a,welcomeMessage:l,platformError:c,canRetryPlatforms:h,isUsingCachedPlatforms:u,isAgentTyping:d,showPopup:f,faqItems:g,onlineEmployees:y,isMuted:_,messagePopup:x,toggleChat:w,selectPlatform:v,navigateTo:b,toggleMute:C,retryFetchPlatforms:k,dismissMessagePopup:R}=ls(),S=l?[l,...o]:o,T=i?.brandColor||"#2563eb",V=Ie(null),O=n==="chat";return m("div",{class:"widget-container",ref:V,style:{"--brand-color":T},children:[!t&&m(it,{children:[x&&m("div",{class:"message-popup-bubble",onClick:()=>{R(),w()},children:[m("button",{type:"button",class:"message-popup-close",onClick:M=>{M.stopPropagation(),R()},children:m("svg",{class:"icon-xs",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})}),m("div",{class:"message-popup-content",children:x.type==="text"?x.content:`[${x.type}]`})]}),!x&&f&&i?.popupMessage&&m("div",{class:"popup-bubble",children:i.popupMessage}),m("button",{type:"button",onClick:w,class:"chat-toggle-button",children:[m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:m("path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"})}),a>0&&m("span",{class:"widget-unread-badge",children:a>99?"99+":a})]})]}),t&&m("div",{class:"chat-window",children:[m("div",{class:"chat-header",children:[O&&m("button",{type:"button",onClick:()=>b("home"),class:"icon-button",children:m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})})}),m("div",{class:`chat-title-container ${n==="chat"&&y.length>0?"chat-centered":""}`,children:[n==="home"&&e?.icon&&m("img",{src:e.icon,alt:e.name||"Company",class:"header-logo"}),n==="chat"&&y.length>0&&m("div",{class:"online-employees-container",children:[m("div",{class:"online-employees-avatars",children:y.slice(0,5).map(M=>m("div",{class:"employee-avatar-wrapper",title:`${M.firstName} ${M.lastName}`,children:[M.avatar?m("img",{src:M.avatar,alt:`${M.firstName} ${M.lastName}`,class:"employee-avatar"}):m("div",{class:"employee-avatar employee-avatar-fallback",children:[M.firstName.charAt(0),M.lastName.charAt(0)]}),m("span",{class:"employee-status-dot"})]},M.id))}),m("span",{class:"online-count",children:[y.length," online"]})]}),n==="faq"&&m("h2",{class:"chat-title",children:"FAQ"})]}),m("button",{type:"button",onClick:C,class:"icon-button",title:_?"Unmute notifications":"Mute notifications",children:_?m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"}),m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2"})]}):m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"})})}),m("button",{type:"button",onClick:w,class:"icon-button",children:m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})})]}),n==="home"&&m("div",{class:"main-menu-content page-slide-right",children:[m("div",{class:"main-menu-header-bg",style:{backgroundColor:T}}),m("div",{class:"content-section content-fade-in",children:[m("div",{class:"company-section",children:[m("h2",{class:"company-name",children:e?.name||"Contact Us"}),m("p",{class:"company-description",children:e?.description||"We're here to help. How can we assist you today?"})]}),s.length===0?c?m("div",{class:"error-message",children:[m("svg",{class:"icon-md",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),m("p",{children:c}),m("button",{type:"button",onClick:k,disabled:!h,class:"button-primary",style:{marginTop:"0.5rem"},children:h?"Retry":"Please wait..."})]}):m("div",{class:"loading-container",children:m("div",{class:"loading-content",children:[m("div",{class:"spinner"}),m("p",{class:"loading-text",children:"Loading platforms..."}),m("button",{type:"button",onClick:k,disabled:!h,class:"button-secondary",style:{marginTop:"0.75rem"},children:h?"Retry":"Please wait..."})]})}):m(it,{children:[u&&m("div",{class:"platform-warning",children:[m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),m("span",{children:c})]}),m("div",{class:"platform-list",children:s.map((M,A)=>{const P=u&&M.type==="converge",j=M.type==="converge",D=s[A+1],Y=j&&D;return m(it,{children:[m("button",{type:"button",onClick:()=>!P&&v(M),class:`platform-button ${P?"platform-button-disabled":""}`,disabled:P,children:[m("div",{class:"platform-icon-container",children:m(lp,{platform:M.type,className:"icon-md"})}),m("div",{class:"platform-info",children:[m("div",{class:"platform-name",children:cp(M.type)}),m("div",{class:"platform-description",children:P?"Temporarily unavailable":M.type==="converge"?"Chat directly on this website":"Opens in new tab"})]}),m("svg",{class:"icon-sm icon-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})})]},M.type),Y&&m("div",{class:"platform-separator",children:m("span",{class:"platform-separator-text",children:"or"})},`separator-${M.type}`)]})})})]})]}),i?.directCallPhone&&m("a",{href:`tel:${i.directCallPhone}`,class:"call-support-banner",children:[m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"})}),m("div",{class:"call-support-info",children:[m("span",{class:"call-support-label",children:"Call Support"}),m("span",{class:"call-support-number",children:i.directCallPhone})]}),m("svg",{class:"icon-sm icon-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})})]})]}),n==="faq"&&m("div",{class:"main-menu-content page-slide-left",children:m("div",{class:"content-section content-fade-in",children:m(Xp,{items:g,isLoading:!1})})}),n==="chat"&&m("div",{class:"chat-view-container page-slide-left",children:[m(z1,{messages:S,isAgentTyping:d}),r?m(Jp,{}):m(Hp,{})]}),m(hp,{})]})]})}const $p=`* {
85
+ Please report this to https://github.com/markedjs/marked.`,i){let n="<p>An error occurred:</p><pre>"+Pt(t.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(t);throw t}}},_n=new Zp;function le(i,e){return _n.parse(i,e)}le.options=le.setOptions=function(i){return _n.setOptions(i),le.defaults=_n.defaults,Ph(le.defaults),le},le.getDefaults=ia,le.defaults=mn,le.use=function(...i){return _n.use(...i),le.defaults=_n.defaults,Ph(le.defaults),le},le.walkTokens=function(i,e){return _n.walkTokens(i,e)},le.parseInline=_n.parseInline,le.Parser=ht,le.parser=ht.parse,le.Renderer=ar,le.TextRenderer=da,le.Lexer=ct,le.lexer=ct.lex,le.Tokenizer=or,le.Hooks=Ki,le.parse=le,le.options,le.setOptions,le.use,le.walkTokens,le.parseInline,ht.parse,ct.lex,le.setOptions({breaks:!0,gfm:!0});function Xp({items:i,isLoading:e}){const[t,n]=ee(""),[s,r]=ee(null),o=i.filter(c=>{const h=t.toLowerCase();return c.question.toLowerCase().includes(h)||c.answer.toLowerCase().includes(h)}),a=c=>{r(s===c?null:c)},l=c=>({__html:le(c)});return e?m("div",{class:"faq-loading",children:[m(up,{}),m("p",{class:"faq-loading-text",children:"Loading FAQ..."})]}):i.length===0?m("div",{class:"faq-empty",children:[m("svg",{class:"icon-lg icon-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[m("circle",{cx:"12",cy:"12",r:"10"}),m("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3","stroke-linecap":"round"}),m("line",{x1:"12",y1:"17",x2:"12.01",y2:"17","stroke-linecap":"round"})]}),m("p",{class:"faq-empty-text",children:"No FAQ items available"})]}):m("div",{class:"faq-container",children:[m("div",{class:"faq-search-container",children:[m("svg",{class:"faq-search-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[m("circle",{cx:"11",cy:"11",r:"8"}),m("path",{d:"m21 21-4.35-4.35"})]}),m("input",{type:"text",value:t,onInput:c=>n(c.target.value),placeholder:"Search questions...",class:"faq-search-input"}),t&&m("button",{type:"button",onClick:()=>n(""),class:"faq-search-clear",children:m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})})]}),o.length===0?m("div",{class:"faq-no-results",children:m("p",{children:['No results found for "',t,'"']})}):m("div",{class:"faq-list",children:o.map(c=>{const h=s===c.id;return m("div",{class:"faq-item",children:[m("button",{type:"button",onClick:()=>a(c.id),class:"faq-question-button",children:[m("span",{class:"faq-question-text",children:c.question}),m("svg",{class:`faq-chevron ${h?"expanded":""}`,fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24",children:m("path",{d:"m9 18 6-6-6-6","stroke-linecap":"round","stroke-linejoin":"round"})})]}),m("div",{class:`faq-answer ${h?"expanded":""}`,children:m("div",{class:"faq-answer-inner",children:m("div",{class:"faq-answer-content markdown-content",dangerouslySetInnerHTML:l(c.answer)})})})]},c.id)})})]})}function Hp(){const{settings:i,updateProfile:e}=ls(),[t,n]=ee("name"),[s,r]=ee(""),[o,a]=ee(""),[l,c]=ee(""),[h,u]=ee(""),d=Ie(null),f=["name"];i?.requireEmail!=="disabled"&&f.push("email"),i?.requirePhone!=="disabled"&&f.push("phone"),f.push("complete");const g=f.indexOf(t),y=f.length-1;Et(function(){d.current?.focus()},[t]);const _=()=>{if(u(""),t==="name"){if(!s.trim()){u("Please enter your name");return}}else if(t==="email"){if(i?.requireEmail==="required"&&!o.trim()){u("Email is required");return}if(o.trim()&&!o.includes("@")){u("Please enter a valid email");return}}else if(t==="phone"&&i?.requirePhone==="required"&&!l.trim()){u("Phone number is required");return}const v=f[g+1];v==="complete"?e(s,o.trim()||void 0,l.trim()||void 0):n(v)},x=()=>t==="name"?"Enter your name":t==="email"?i?.requireEmail==="required"?"Enter your email":"Enter your email (optional)":t==="phone"?i?.requirePhone==="required"?"Enter your phone number":"Enter your phone number (optional)":"",w=g===y-1;return m(it,{children:[h&&m("div",{class:"onboarding-error-banner",children:h}),m("div",{class:"chat-input-container",children:[m("div",{class:"chat-input-form",children:[m("input",{ref:d,type:"text",value:t==="name"?s:t==="email"?o:l,onInput:v=>{const b=v.target.value;t==="name"?r(b):t==="email"?a(b):t==="phone"&&c(b),u("")},onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),_())},placeholder:x(),class:"message-input"}),m("button",{type:"button",onClick:_,class:"onboarding-next-button",children:[m("span",{class:"onboarding-button-text",children:w?"Start Chat":"Next"}),m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})})]})]}),m("div",{class:"onboarding-progress-pills",children:f.slice(0,-1).map((v,b)=>m("div",{class:`onboarding-pill ${b<g?"onboarding-pill-completed":""}`},b))})]})]})}function Jp(){const{inputMessage:i,isSending:e,showAttachmentMenu:t,messages:n,cannedResponses:s,setInputMessage:r,sendTypingIndicator:o,sendMessage:a,toggleAttachmentMenu:l,handleGalleryUpload:c,handleFileUpload:h,handleLocationShare:u}=ls(),d=Ie(null),[f,g]=ee(!1),_=!n.some(v=>!v.isSupport)&&!f&&s.length>0;Et(function(){const b=setTimeout(()=>d.current?.focus(),100);return()=>clearTimeout(b)},[]);const x=v=>{v.preventDefault(),a(),setTimeout(()=>d.current?.focus(),50)},w=v=>{g(!0),a(v)};return m(it,{children:[_&&m("div",{class:"canned-responses-bar",children:s.map(v=>m("button",{type:"button",onClick:()=>w(v.text),class:"canned-response-button",disabled:e,children:v.text},v.id))}),t&&m("div",{class:"attachment-menu",children:[m("button",{type:"button",onClick:c,disabled:e,class:"attachment-button",children:[m("svg",{class:"icon-md icon-blue",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),m("span",{class:"attachment-label",children:"Photo/Video"})]}),m("button",{type:"button",onClick:h,disabled:e,class:"attachment-button",children:[m("svg",{class:"icon-md icon-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),m("span",{class:"attachment-label",children:"File"})]}),m("button",{type:"button",onClick:u,disabled:e,class:"attachment-button",children:[m("svg",{class:"icon-md icon-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),m("span",{class:"attachment-label",children:"Location"})]})]}),m("div",{class:"chat-input-container",children:m("form",{onSubmit:x,class:"chat-input-form",children:[m("button",{type:"button",onClick:l,disabled:e,class:"input-icon-button",children:m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})})}),m("input",{ref:d,type:"text",value:i,onInput:v=>{r(v.target.value),o()},placeholder:"Type a message...",disabled:e,class:"message-input"}),m("button",{type:"submit",disabled:e||!i.trim(),class:"send-button",children:m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 10l7-7m0 0l7 7m-7-7v18"})})})]})})]})}function Qp(){const{settings:i,company:e,isOpen:t,currentPage:n,availablePlatforms:s,hasCompletedProfile:r,messages:o,unreadCount:a,welcomeMessage:l,platformError:c,canRetryPlatforms:h,isUsingCachedPlatforms:u,isAgentTyping:d,showPopup:f,faqItems:g,onlineEmployees:y,isMuted:_,messagePopup:x,toggleChat:w,selectPlatform:v,navigateTo:b,toggleMute:C,retryFetchPlatforms:k,dismissMessagePopup:R}=ls(),S=l?[l,...o]:o,T=i?.brandColor||"#2563eb",V=Ie(null),O=n==="chat";return m("div",{class:"widget-container",ref:V,style:{"--brand-color":T},children:[!t&&m(it,{children:[x&&m("div",{class:"message-popup-bubble",onClick:()=>{R(),w()},children:[m("button",{type:"button",class:"message-popup-close",onClick:M=>{M.stopPropagation(),R()},"aria-label":"Dismiss message",children:m("svg",{class:"icon-xs",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})}),m("div",{class:"message-popup-content",children:x.type==="text"?x.content:`[${x.type}]`})]}),!x&&f&&i?.popupMessage&&m("div",{class:"popup-bubble",children:i.popupMessage}),m("button",{type:"button",onClick:w,class:"chat-toggle-button","aria-label":"Open chat",children:[m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:m("path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"})}),a>0&&m("span",{class:"widget-unread-badge","aria-label":`${a} unread messages`,children:a>99?"99+":a})]})]}),t&&m("div",{class:"chat-window",children:[m("div",{class:"chat-header",children:[O&&m("button",{type:"button",onClick:()=>b("home"),class:"icon-button","aria-label":"Back to home",children:m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})})}),m("div",{class:`chat-title-container ${n==="chat"&&y.length>0?"chat-centered":""}`,children:[n==="home"&&e?.icon&&m("img",{src:e.icon,alt:e.name||"Company",class:"header-logo"}),n==="chat"&&y.length>0&&m("div",{class:"online-employees-container",children:[m("div",{class:"online-employees-avatars",children:y.slice(0,5).map(M=>m("div",{class:"employee-avatar-wrapper",title:`${M.firstName} ${M.lastName}`,children:[M.avatar?m("img",{src:M.avatar,alt:`${M.firstName} ${M.lastName}`,class:"employee-avatar"}):m("div",{class:"employee-avatar employee-avatar-fallback",children:[M.firstName.charAt(0),M.lastName.charAt(0)]}),m("span",{class:"employee-status-dot"})]},M.id))}),m("span",{class:"online-count",children:[y.length," online"]})]}),n==="faq"&&m("h2",{class:"chat-title",children:"FAQ"})]}),m("button",{type:"button",onClick:C,class:"icon-button",title:_?"Unmute notifications":"Mute notifications",children:_?m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"}),m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2"})]}):m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"})})}),m("button",{type:"button",onClick:w,class:"icon-button","aria-label":"Close chat",children:m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})})]}),n==="home"&&m("div",{class:"main-menu-content page-slide-right",children:[m("div",{class:"main-menu-header-bg",style:{backgroundColor:T}}),m("div",{class:"content-section content-fade-in",children:[m("div",{class:"company-section",children:[m("h2",{class:"company-name",children:e?.name||"Contact Us"}),m("p",{class:"company-description",children:e?.description||"We're here to help. How can we assist you today?"})]}),s.length===0?c?m("div",{class:"error-message",children:[m("svg",{class:"icon-md",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),m("p",{children:c}),m("button",{type:"button",onClick:k,disabled:!h,class:"button-primary",style:{marginTop:"0.5rem"},children:h?"Retry":"Please wait..."})]}):m("div",{class:"loading-container",children:m("div",{class:"loading-content",children:[m("div",{class:"spinner"}),m("p",{class:"loading-text",children:"Loading platforms..."}),m("button",{type:"button",onClick:k,disabled:!h,class:"button-secondary",style:{marginTop:"0.75rem"},children:h?"Retry":"Please wait..."})]})}):m(it,{children:[u&&m("div",{class:"platform-warning",children:[m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),m("span",{children:c})]}),m("div",{class:"platform-list",children:s.map((M,A)=>{const P=u&&M.type==="converge",j=M.type==="converge",D=s[A+1],Y=j&&D;return m(it,{children:[m("button",{type:"button",onClick:()=>!P&&v(M),class:`platform-button ${P?"platform-button-disabled":""}`,disabled:P,children:[m("div",{class:"platform-icon-container",children:m(lp,{platform:M.type,className:"icon-md"})}),m("div",{class:"platform-info",children:[m("div",{class:"platform-name",children:cp(M.type)}),m("div",{class:"platform-description",children:P?"Temporarily unavailable":M.type==="converge"?"Chat directly on this website":"Opens in new tab"})]}),m("svg",{class:"icon-sm icon-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})})]},M.type),Y&&m("div",{class:"platform-separator",children:m("span",{class:"platform-separator-text",children:"or"})},`separator-${M.type}`)]})})})]})]}),i?.directCallPhone&&m("a",{href:`tel:${i.directCallPhone}`,class:"call-support-banner",children:[m("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"})}),m("div",{class:"call-support-info",children:[m("span",{class:"call-support-label",children:"Call Support"}),m("span",{class:"call-support-number",children:i.directCallPhone})]}),m("svg",{class:"icon-sm icon-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})})]})]}),n==="faq"&&m("div",{class:"main-menu-content page-slide-left",children:m("div",{class:"content-section content-fade-in",children:m(Xp,{items:g,isLoading:!1})})}),n==="chat"&&m("div",{class:"chat-view-container page-slide-left",children:[m(z1,{messages:S,isAgentTyping:d}),r?m(Jp,{}):m(Hp,{})]}),m(hp,{})]})]})}const $p=`* {
86
86
  box-sizing: border-box;
87
87
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
88
88
  -webkit-font-smoothing: antialiased;
@@ -1566,24 +1566,23 @@ Please report this to https://github.com/markedjs/marked.`,i){let n="<p>An error
1566
1566
  .faq-list {
1567
1567
  display: flex;
1568
1568
  flex-direction: column;
1569
- gap: 0.75rem;
1570
1569
  overflow-y: auto;
1571
1570
  flex: 1;
1572
1571
  min-height: 0;
1573
1572
  padding-bottom: 0.5rem;
1573
+ border: 1px solid #e4e4e7;
1574
+ border-radius: 0.75rem;
1574
1575
  }
1575
1576
 
1576
1577
  .faq-item {
1577
1578
  background: white;
1578
- border-radius: 0.5rem;
1579
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
1580
1579
  overflow: hidden;
1581
- transition: box-shadow 0.3s ease;
1582
1580
  flex-shrink: 0;
1581
+ border-bottom: 1px solid #e4e4e7;
1583
1582
  }
1584
1583
 
1585
- .faq-item:hover {
1586
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
1584
+ .faq-item:last-child {
1585
+ border-bottom: none;
1587
1586
  }
1588
1587
 
1589
1588
  .faq-question-button {
@@ -1592,17 +1591,17 @@ Please report this to https://github.com/markedjs/marked.`,i){let n="<p>An error
1592
1591
  align-items: center;
1593
1592
  justify-content: space-between;
1594
1593
  gap: 0.75rem;
1595
- padding: 1rem 1.25rem;
1594
+ padding: 0.875rem 1rem;
1596
1595
  background: none;
1597
1596
  border: none;
1598
1597
  cursor: pointer;
1599
1598
  text-align: left;
1600
- transition: color 0.3s ease;
1599
+ transition: background-color 0.15s ease;
1601
1600
  color: #18181b;
1602
1601
  }
1603
1602
 
1604
1603
  .faq-question-button:hover {
1605
- color: var(--brand-color, #2563eb);
1604
+ background-color: #fafafa;
1606
1605
  }
1607
1606
 
1608
1607
  .faq-question-button:focus {
@@ -1611,15 +1610,15 @@ Please report this to https://github.com/markedjs/marked.`,i){let n="<p>An error
1611
1610
 
1612
1611
  .faq-question-text {
1613
1612
  flex: 1;
1614
- font-size: 0.9375rem;
1615
- font-weight: 600;
1613
+ font-size: 0.875rem;
1614
+ font-weight: 500;
1616
1615
  line-height: 1.4;
1617
1616
  }
1618
1617
 
1619
1618
  .faq-chevron {
1620
- width: 1.25rem;
1621
- height: 1.25rem;
1622
- color: var(--brand-color, #2563eb);
1619
+ width: 1.125rem;
1620
+ height: 1.125rem;
1621
+ color: #a1a1aa;
1623
1622
  flex-shrink: 0;
1624
1623
  transition: transform 0.3s ease;
1625
1624
  }
@@ -1643,7 +1642,7 @@ Please report this to https://github.com/markedjs/marked.`,i){let n="<p>An error
1643
1642
  }
1644
1643
 
1645
1644
  .faq-answer-content {
1646
- padding: 0 1.25rem 1rem 1.25rem;
1645
+ padding: 0.875rem;
1647
1646
  font-size: 0.875rem;
1648
1647
  color: #52525b;
1649
1648
  line-height: 1.6;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.0",
2
+ "version": "1.3.2",
3
3
  "name": "@convergeapp/chat-widget",
4
4
  "author": "Converge",
5
5
  "description": "Embeddable chat widget for Converge customer support platform",