@eshal-bot/chat-widget 0.2.11 → 0.2.12

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.
@@ -17,4 +17,4 @@ var Fe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
17
17
  *
18
18
  * This source code is licensed under the ISC license.
19
19
  * See the LICENSE file in the root directory of this source tree.
20
- */let rt=null;function at(e){n(()=>{if(!Ze||!e)return;const t=e.split(",")[0]?.trim();if(!t||ot.has(t))return;if((e=>{const t=e.trim().toLowerCase();return!t||!!et.has(t)||tt.some(e=>t.includes(e))})(t))return void ot.add(t);let o=!0;return(async()=>{try{rt||(rt=import("./chat-widget-webfontloader-BK8fca15.esm.js").then(function(e){return e.w}));const e=await rt,r=e&&"default"in e?e.default:e,a=(e=>e.trim().replace(/\s+/g,"+"))(t);r.load({google:{families:[`${a}:300,400,500,600,700`]},fontactive:e=>{o&&ot.add(e)},fontinactive:e=>{o&&ot.add(e),console.warn(`Warning: failed to load Google Font: ${e}`)}})}catch(e){console.error("Warning: WebFont loader error:",e)}})(),()=>{o=!1}},[e])}function nt(e){return"string"==typeof e&&/^https?:\/\//i.test(e)?e:void 0}const it="__eshalChatWidgetCitationContext",st="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:void 0,lt=st?st[it]||(st[it]=l(null)):l(null);function ct(){return import("./chat-widget-MarkdownRenderer-DJIte38L.esm.js")}const dt=d(ct);class ut extends e.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error("[widget] markdown chunk failed to load, showing plain text:",e)}render(){return this.state.failed?this.props.fallback:this.props.children}}const gt=/(```|`[^`]+`|(^|\n)\s{0,3}#{1,6}\s|(^|\n)\s*[-*+]\s|(^|\n)\s*\d+\.\s|(^|\n)\s*>\s|\[[^\]]*\]\([^)]*\)|\*\*|__|~~|(^|\n)\s*\||\[\d+\])/;const ht=({content:e,isDark:t,textColor:o,fontFamily:r,fontSize:a})=>g("p",{className:"leading-relaxed [&:first-child]:!mt-0 whitespace-pre-wrap break-words",style:{color:o||(t?"#f3f4f6":"#1A1A1A"),fontFamily:r||"Inter",fontSize:a||"14px",margin:0,lineHeight:"1.6",padding:0,overflowWrap:"break-word"},children:e}),pt=({content:e,isStreaming:t,isDark:a=!1,isRtl:i=!1,textColor:s,fontFamily:l,fontSize:d,onButtonClick:u,provideCitations:p=!0})=>{const[m,b]=o(""),[f,w]=o(!1),v=r(e),y=r(0),k=r(null),x=r(0);n(()=>{if(e!==v.current){if(v.current=e,y.current>=e.length)return b(e),void w(!1);e.length<m.length&&(y.current=0,b(""))}if(!t)return b(e),w(!1),void(k.current&&cancelAnimationFrame(k.current));w(!0);const o=t=>{if(t-x.current<16)k.current=requestAnimationFrame(o);else if(x.current=t,y.current<e.length){const t=Math.max(2,Math.floor(4*Math.random())),r=Math.min(y.current+t,e.length);b(e.slice(0,r)),y.current=r,k.current=requestAnimationFrame(o)}else w(!1)};return k.current=requestAnimationFrame(o),()=>{k.current&&cancelAnimationFrame(k.current)}},[e,t]);const C="string"==typeof(S=m)&&0!==S.length&&gt.test(S);var S;return h("div",{className:"relative",dir:"auto",style:{textAlign:i?"right":"left",color:s||(a?"#f3f4f6":"#1A1A1A"),fontFamily:l||"Inter",fontSize:d||"14px",margin:0,padding:0},children:[C?g(ut,{fallback:g(ht,{content:m,isDark:a,textColor:s,fontFamily:l,fontSize:d}),children:g(c,{fallback:g(ht,{content:m,isDark:a,textColor:s,fontFamily:l,fontSize:d}),children:g(dt,{content:m,isStreaming:t,isDark:a,isRtl:i,textColor:s,fontFamily:l,fontSize:d,onButtonClick:u,provideCitations:p})})}):g(ht,{content:m,isDark:a,textColor:s,fontFamily:l,fontSize:d}),f&&g("span",{className:"inline-block w-1.5 h-4 bg-blue-500 ms-0.5 animate-pulse align-text-bottom",style:{animationDuration:"0.8s"}})]})},mt=({isDark:e,t:t})=>h("div",{className:"flex gap-1.5",role:"status","aria-label":t("agentIsTyping"),children:[g("div",{className:`w-2 h-2 rounded-full ${e?"bg-gray-500":"bg-gray-400"} animate-bounce`,style:{animationDelay:"0ms"},"aria-hidden":"true"}),g("div",{className:`w-2 h-2 rounded-full ${e?"bg-gray-500":"bg-gray-400"} animate-bounce`,style:{animationDelay:"150ms"},"aria-hidden":"true"}),g("div",{className:`w-2 h-2 rounded-full ${e?"bg-gray-500":"bg-gray-400"} animate-bounce`,style:{animationDelay:"300ms"},"aria-hidden":"true"})]}),bt=({question:e,options:t,onDecision:o,disabled:r,isDark:a=!1})=>h("div",{className:"mt-3 p-3 rounded-lg border "+(a?"bg-blue-900/30 border-blue-700/50":"bg-blue-50 border-blue-200"),children:[g("p",{className:"text-sm font-medium mb-2 "+(a?"text-gray-100":"text-gray-900"),children:e}),g("div",{className:"space-y-2",children:t.map(e=>g("button",{onClick:()=>o(e.id,e.label),disabled:r,className:"w-full text-left px-3 py-2 text-sm rounded transition-all "+(a?"bg-gray-800 border border-gray-700 hover:bg-blue-900/50 hover:border-blue-600 disabled:opacity-50 disabled:cursor-not-allowed":"bg-white border border-gray-300 hover:bg-blue-50 hover:border-blue-400 disabled:opacity-50 disabled:cursor-not-allowed"),children:e.label},e.id))})]});function ft({content:e,isDark:t}){const[r,n]=o(!1),i=a(()=>{e&&(navigator.clipboard?.writeText(e).catch(()=>{}),n(!0),setTimeout(()=>n(!1),1500))},[e]);return g("button",{type:"button",onClick:i,className:"p-0.5 rounded transition-colors "+(t?"text-gray-500 hover:text-gray-300":"text-gray-400 hover:text-gray-600"),style:{border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",cursor:"pointer"},"aria-label":r?"Copied":"Copy message",title:r?"Copied":"Copy message",children:r?g(je,{className:"w-3 h-3 text-green-500"}):g(De,{className:"w-3 h-3"})})}const wt=({message:t,formatTime:n,isDark:i,primaryColor:s,agentMessageBubbleColor:l,resolvedAgentBubbleColor:c,textColor:d,assistantTextColor:u,fontFamily:m,agentMessageBubbleFontFamily:b,agentMessageBubbleFontSize:f,fontSize:w,isRtl:v,onDecision:y,companyLogo:k,conciergeName:x,companyName:C,apiBaseUrl:S,getAuthToken:M,onPromptSuggestionClick:P,allowFeedback:z=!0,provideCitations:T=!0,onFeedback:F,headerTextColor:L,t:N})=>{const A="string"==typeof t.content?t.content:"",I=t.isProcessing&&(!A||0===A.length),j=J(A,v),[E,B]=o(()=>t?.feedback??null),[R,D]=o(!1),[V,$]=o(null),[O,U]=o(""),H=r(null),q=a(e=>{if(F&&A){if(E===e)return B(null),D(!1),$(null),U(""),void F(A,null);if("like"===e)return B("like"),D(!1),$(null),U(""),void F(A,"like");B(null),$("dislike"),D(!0),U(""),setTimeout(()=>H.current?.focus(),100)}},[E,F,A]),W=a(()=>{F&&A&&V&&(B(V),F(A,V,O.trim()||void 0),D(!1),U(""),$(null))},[F,A,V,O]),_=a(()=>{D(!1),U(""),$(null)},[]),Y=!0===t?.isError,Q=Y?i?"rgba(239,68,68,0.15)":"#fee2e2":null!=c?c:null!=l?l:i?"#1f2937":"#FFFFFF",K=null!=l&&"#ffffff"!==l&&"#FFFFFF"!==l&&"#1f2937"!==l,G=Y?i?"#fca5a5":"#991b1b":null!=u?u:null!=d?d:i?"#f3f4f6":"#1A1A1A",X=null!=b?b:null!=m?m:"Inter",Z=null!=f?f:null!=w?w:"14px";at(X);const{onSourceActivate:ee,downloadingKey:te}=function({apiBaseUrl:t,getAuthToken:o}){const[r,a]=e.useState(null);return{onSourceActivate:e.useCallback(async e=>{if(!e)return;const r=e.url||e.source_id||e.sourceid||e.source_name||"",n=String(e.source_id||e.sourceid||"").startsWith("attachment:"),i="string"==typeof e.url&&e.url.includes("/api/v1/sharepoint/file/"),s="file"===e.source_type||i||n||!(!e.source_id&&!e.sourceid)&&!e.url;if(!s){const t=nt(e.url);if(t)try{window.open(t,"_blank","noopener,noreferrer")}catch{}return}if(t||n){a(r),console.debug("[widget] citation download starting:",{source_id:e.source_id||e.sourceid,source_name:e.source_name,source_type:e.source_type,isAttachment:n,isSharePointProxy:i,isFileLike:s});try{let r;if(n){if(!e.url)throw new Error("attachment has no URL");const t={};if("function"==typeof o){const e=await o();e&&(t.Authorization=`Bearer ${e}`)}r=await fetch(e.url,{method:"GET",headers:t,credentials:"include"})}else if(i){const a=e.url.startsWith("http")?e.url:`${t.replace(/\/$/,"")}${e.url}`,n={};if("function"==typeof o){const e=await o();e&&(n.Authorization=`Bearer ${e}`)}r=await fetch(a,{method:"GET",headers:n,credentials:"include"})}else{const a=`${t.replace(/\/$/,"")}/api/v1/support/file-download`,n={"Content-Type":"application/json"};if("function"==typeof o){const e=await o();e&&(n.Authorization=`Bearer ${e}`)}r=await fetch(a,{method:"POST",headers:n,credentials:"include",body:JSON.stringify({source_id:e.source_id||e.sourceid,file_name:e.url||"",source_name:e.source_name||""})})}if(!r.ok){const e=await r.json().catch(()=>({}));throw new Error(e.details||e.error||r.statusText)}const a=await r.blob(),s=r.headers.get("content-disposition");let l=e.source_name||"download";if(!n){const e=s&&/filename\*?=(?:UTF-8'')?["']?([^"'\s;]+)["']?/i.exec(s);if(e)try{l=decodeURIComponent(e[1].replace(/\\"/g,'"'))}catch{}}const c=document.createElement("a"),d=URL.createObjectURL(a);c.href=d,c.download=l,document.body.appendChild(c),c.click(),c.remove(),URL.revokeObjectURL(d)}catch(e){console.error("[widget] source download failed:",e)}finally{a(null)}}else console.warn("[widget] citation download skipped: apiBaseUrl missing and source is not an attachment (no fallback URL to fetch). Source:",e)},[t,o]),downloadingKey:r}}({apiBaseUrl:S,getAuthToken:M}),oe=e.useMemo(()=>({sources:t.sources||[],sourcesPreliminary:!!t.sourcesPreliminary,onSourceActivate:ee,downloadingKey:te,textColor:G}),[t.sources,t.sourcesPreliminary,ee,te,G]);return g(lt.Provider,{value:oe,children:h("div",{className:"flex gap-3 flex-row animate-in min-w-0",children:[g("div",{className:"flex-shrink-0 mt-1",children:g("div",{className:"w-8 h-8 rounded-full overflow-hidden flex items-center justify-center",style:{backgroundColor:s||"#2563eb"},children:g("div",k?{className:"w-full h-full bg-white/10 flex items-center justify-center",children:g("img",{src:k,alt:x||C||"Assistant avatar",className:"object-contain rounded-full",style:{width:"100%",height:"100%"}})}:{className:"w-full h-full flex items-center justify-center",style:{fontSize:"18px",fontFamily:m||"Inter",color:L||"#FFFFFF"},children:(x||"A").charAt(0).toUpperCase()})})}),h("div",{className:"flex flex-col items-start min-w-0 max-w-[75%]",children:[g("div",{className:"rounded-2xl px-4 py-2.5 shadow-sm border rounded-tl-sm rtl:rounded-tl-2xl rtl:rounded-tr-sm min-w-0 max-w-full overflow-hidden "+(K?"border-transparent":i?"border-gray-700":"border-gray-200"),style:{backgroundColor:Q,color:G,fontFamily:X,fontSize:Z,direction:j?"rtl":"ltr",textAlign:j?"right":"left",...K?{borderColor:`${Q}33`}:{}},children:I?g(mt,{isDark:i,t:N}):g(p,{children:t.requiresDecision&&t.decisionData&&y?h("div",{children:[A&&g("div",{className:"mb-3",children:g(pt,{content:A,isStreaming:t.isProcessing,isDark:i,isRtl:j,textColor:G,fontFamily:X,fontSize:Z,onButtonClick:P,provideCitations:T})}),g(bt,{question:t.decisionData.question,options:t.decisionData.options,onDecision:(e,o)=>y(t.decisionData.decisionId,e,o),disabled:!!t.decisionResponse,isDark:i}),t.decisionResponse&&h("div",{className:"mt-2 text-xs "+(i?"text-gray-400":"text-gray-500"),children:["Selected: ",t.decisionResponse.selectedOption]})]}):A?g(p,{children:g(pt,{content:A,isStreaming:t.isProcessing,isDark:i,isRtl:j,textColor:G,fontFamily:X,fontSize:Z,onButtonClick:P,provideCitations:T})}):null})}),h("div",{className:"flex items-center gap-1.5 mt-1.5 px-1",children:[g("p",{className:"text-xs leading-none "+(i?"text-gray-400":"text-gray-500"),dir:"auto",children:n(t.timestamp)}),!I&&!t.isProcessing&&A&&g(ft,{content:A,isDark:i}),!1!==z&&F&&!I&&!t.isProcessing&&A&&"welcome"!==t.type&&!t.isWelcome&&h("div",{className:"flex items-center gap-0.5 ms-0.5",children:[g("button",{type:"button",onClick:()=>q("like"),className:"p-0.5 rounded transition-colors "+("like"===E||"like"===V?"text-green-500":i?"text-gray-500 hover:text-gray-300":"text-gray-400 hover:text-gray-600"),style:{border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",cursor:"pointer"},"aria-label":"Like",children:g(Je,{className:"w-3 h-3"})}),g("button",{type:"button",onClick:()=>q("dislike"),className:"p-0.5 rounded transition-colors "+("dislike"===E||"dislike"===V?"text-red-500":i?"text-gray-500 hover:text-gray-300":"text-gray-400 hover:text-gray-600"),style:{border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",cursor:"pointer"},"aria-label":"Dislike",children:g(Ge,{className:"w-3 h-3"})})]})]}),R&&"dislike"===V&&h("div",{className:"mt-2 w-full rounded-xl border p-3 shadow "+(i?"bg-gray-800 border-gray-700":"bg-white border-gray-200"),style:{direction:v?"rtl":"ltr"},children:[g("textarea",{ref:H,value:O,onChange:e=>U(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key?(e.preventDefault(),W()):"Escape"===e.key&&(e.preventDefault(),_())},placeholder:N("feedbackPlaceholder"),"aria-label":N("feedbackPlaceholder"),rows:2,className:"w-full resize-none rounded-lg border px-2 py-1.5 text-xs focus:outline-none focus:ring-1 "+(i?"bg-gray-900 border-gray-700 text-gray-100 placeholder-gray-500 focus:ring-gray-600":"bg-white border-gray-200 text-gray-900 placeholder-gray-400 focus:ring-gray-300"),style:{fontFamily:X,textAlign:v?"right":"left"}}),h("div",{className:"flex items-center justify-end gap-1.5 mt-1.5",children:[g("button",{type:"button",onClick:_,className:"text-xs px-2 py-1 rounded transition-colors "+(i?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"),style:{border:"none",background:"transparent",cursor:"pointer"},children:N("cancel")}),g("button",{type:"button",onClick:W,className:"text-xs px-2.5 py-1 rounded text-white transition-opacity hover:opacity-90",style:{backgroundColor:s||"#2563eb",border:"none",cursor:"pointer"},children:N("submit")})]})]})]})]})})},vt=({message:e,formatTime:t,userMessageBoxColor:o,primaryColor:r,resolvedUserMessageColor:a,textColor:n,userTextColor:i,fontFamily:s,userMessageBubbleFontFamily:l,userMessageBubbleFontSize:c,fontSize:d,isDark:u,isRtl:p,t:m,onRetryMessage:b})=>{const f=null!=a?a:null!=o?o:null!=r?r:"#2563eb",w=null!=i?i:null!=n?n:"#FFFFFF",v=null!=l?l:null!=s?s:"Inter",y=null!=c?c:null!=d?d:"14px",k=J("string"==typeof e?.content?e.content:"",p);at(v);const x=Array.isArray(e.attachments)?e.attachments:[];return g("div",{className:"flex gap-3 flex-row-reverse animate-in",children:h("div",{className:"flex flex-col items-end max-w-[75%]",children:[x.length>0&&g("div",{className:"mb-1.5 flex flex-wrap justify-end gap-1.5",children:x.map((e,t)=>String(e.mimeType||"").startsWith("image/")&&e.url?g("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"block rounded-md overflow-hidden",style:{maxWidth:160},title:e.filename,children:g("img",{src:e.url,alt:e.filename||"attachment",style:{maxWidth:160,maxHeight:160,display:"block"}})},e.storageKey||t):h("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs",style:{backgroundColor:u?"#1f2937":"#f3f4f6",color:u?"#e5e7eb":"#374151",border:"1px solid "+(u?"#374151":"#e5e7eb"),maxWidth:200},title:e.filename,children:[g($e,{size:12}),g("span",{className:"truncate",style:{maxWidth:140,direction:"ltr"},children:e.filename})]},e.storageKey||t))}),e.content&&""!==e.content.trim()&&g("div",{className:"rounded-2xl px-4 py-2.5 shadow-lg "+(k?"rounded-tl-sm":"rounded-tr-sm"),dir:"auto",style:{background:`linear-gradient(135deg, ${f} 0%, ${f}dd 100%)`,fontFamily:v,direction:k?"rtl":"ltr",textAlign:k?"right":"left"},children:g("p",{className:"whitespace-pre-wrap break-words",dir:"auto",style:{color:w,fontFamily:v,fontSize:y,lineHeight:"1.5",textAlign:k?"right":"left",overflowWrap:"break-word",margin:0,padding:0},children:e.content})}),h("div",{className:"flex items-center gap-1.5 mt-1.5 px-1",children:[g("p",{className:"text-xs leading-none "+(u?"text-gray-400":"text-gray-500"),dir:"auto",children:t(e.timestamp)}),e.content&&""!==e.content.trim()&&g(ft,{content:e.content,isDark:u})]}),"failed"===e.status&&h("div",{className:"flex items-center gap-1.5 mt-1 px-1","data-testid":"message-failed-state",children:[g("span",{className:"text-xs leading-none",style:{color:"#dc2626"},dir:"auto",children:m("messageNotDelivered")}),"function"==typeof b&&g("button",{type:"button",onClick:()=>b(e),className:"text-xs leading-none font-medium underline",style:{color:"#dc2626"},dir:"auto",children:m("retrySend")})]})]})})},yt=({message:e,isDark:o,primaryColor:r,agentMessageBubbleColor:a,userMessageBoxColor:n,resolvedUserMessageColor:i,resolvedAgentBubbleColor:s,textColor:l,assistantTextColor:c,userTextColor:d,fontFamily:u,agentMessageBubbleFontFamily:h,agentMessageBubbleFontSize:p,userMessageBubbleFontFamily:m,userMessageBubbleFontSize:b,fontSize:f,formatTime:w,isRtl:v,onDecision:y,companyLogo:k,conciergeName:x,companyName:C,apiBaseUrl:S,getAuthToken:M,onPromptSuggestionClick:P,allowFeedback:z,provideCitations:T,onFeedback:F,headerTextColor:L,onRetryMessage:N,defaultLanguage:A="en"})=>{const I=t(()=>X(A),[A]);return e?"user"===e.role?g(vt,{message:e,formatTime:w,userMessageBoxColor:n,primaryColor:r,resolvedUserMessageColor:i,textColor:l,userTextColor:d,fontFamily:u,userMessageBubbleFontFamily:m,userMessageBubbleFontSize:b,fontSize:f,isDark:o,isRtl:v,t:I,onRetryMessage:N}):g(wt,{message:e,formatTime:w,isDark:o,primaryColor:r,agentMessageBubbleColor:a,resolvedAgentBubbleColor:s,textColor:l,assistantTextColor:c,fontFamily:u,agentMessageBubbleFontFamily:h,agentMessageBubbleFontSize:p,fontSize:f,isRtl:v,onDecision:y,companyLogo:k,conciergeName:x,companyName:C,apiBaseUrl:S,getAuthToken:M,onPromptSuggestionClick:P,allowFeedback:z,provideCitations:T,onFeedback:F,headerTextColor:L,t:I}):null};var kt=e.memo(yt);const xt=(e,t,o)=>Number.isNaN(e)?t:Math.min(Math.max(e,t),o),Ct=e=>{if(!e)return null;const t=(e=>e?.trim().toLowerCase()??"")(e),o=(e=>{const t=e.match(/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i);if(!t)return null;let o=t[1];3===o.length&&(o=o.split("").map(e=>`${e}${e}`).join(""));const r=parseInt(o.slice(0,2),16),a=parseInt(o.slice(2,4),16),n=parseInt(o.slice(4,6),16);return[r,a,n].some(e=>Number.isNaN(e))?null:{r:r,g:a,b:n}})(t);if(o)return o;const r=(e=>{const t=e.match(/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(\d*\.?\d+))?\s*\)$/i);return t?{r:xt(Number.parseInt(t[1],10),0,255),g:xt(Number.parseInt(t[2],10),0,255),b:xt(Number.parseInt(t[3],10),0,255)}:null})(t);return r||null},St=({r:e,g:t,b:o})=>{const r=e=>{const t=xt(Math.round(e),0,255).toString(16);return 1===t.length?`0${t}`:t};return`#${r(e)}${r(t)}${r(o)}`},Mt=(e,t,o)=>{const r=xt(o,0,1);return{r:Math.round(e.r+(t.r-e.r)*r),g:Math.round(e.g+(t.g-e.g)*r),b:Math.round(e.b+(t.b-e.b)*r)}},Pt=(e,t)=>{const o=xt(t,0,1);return`rgba(${xt(Math.round(e.r),0,255)}, ${xt(Math.round(e.g),0,255)}, ${xt(Math.round(e.b),0,255)}, ${o})`},zt={background:"#f8fafc",hoverBackground:"#f1f5f9",border:"#e2e8f0",hoverBorder:"#cbd5f5",shadow:"0 4px 12px rgba(15, 23, 42, 0.08)",hoverShadow:"0 6px 20px rgba(15, 23, 42, 0.14)"},Tt={background:"#1f2937",hoverBackground:"#27364a",border:"#334155",hoverBorder:"#3b4c63",shadow:"0 4px 12px rgba(15, 23, 42, 0.45)",hoverShadow:"0 6px 20px rgba(15, 23, 42, 0.55)"},Ft=(e,t)=>{const o=Ct(e);if(!o)return(e=>e?Tt:zt)(t);const r=(({r:e,g:t,b:o})=>{const r=[e,t,o].map(e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return.2126*r[0]+.7152*r[1]+.0722*r[2]})(o),a=Ct("#0f172a")??{r:15,g:23,b:42},n=Ct(t?"#f8fafc":"#f9fafb")??{r:249,g:250,b:251},i=Ct(t?"#334155":"#e2e8f0")??{r:226,g:232,b:240};let s,l;if(r>=.6){const e=t?.5:.7,r=Math.min(1,e+.15);s=Mt(o,a,e),l=Mt(o,a,r)}else if(r<=.35){const e=t?.9:.8,r=Math.min(1,e+(t?.05:.12));s=Mt(o,n,e),l=Mt(o,n,r)}else{const e=t?.45:.6,r=Math.min(1,e+.1);s=Mt(o,i,e),l=Mt(o,i,r)}const c=Mt(o,s,.65),d=Mt(o,l,.7),u=`0 4px 12px ${Pt(o,t?.28:.12)}`,g=`0 6px 20px ${Pt(o,t?.35:.18)}`;return{background:St(s),hoverBackground:St(l),border:St(c),hoverBorder:St(d),shadow:u,hoverShadow:g}},Lt=({questions:e,isDark:t,palette:i,resolvedTextColor:s,fontFamily:l,fontSize:c,isRtl:d,onQuestionClick:u,applyHoverState:p,headingLabel:m})=>{const b=r(null),[f,w]=o(!1),[v,y]=o(!1),k=a(()=>{const e=b.current;if(!e)return;const{scrollLeft:t,scrollWidth:o,clientWidth:r}=e;w(Math.abs(t)>1),y(Math.abs(t)+r<o-1)},[]);n(()=>{k();const e=b.current;if(!e)return;const t=new ResizeObserver(k);return t.observe(e),()=>t.disconnect()},[k,e]);const x=a(e=>{const t=b.current;if(!t)return;const o="left"===e?-150:150;t.scrollBy({left:d?-o:o,behavior:"smooth"})},[d]),C=t?"rgba(31,41,55,0.85)":"rgba(255,255,255,0.85)",S=t?"#e5e7eb":"#374151",M=t?"#4b5563":"#d1d5db";return h("div",{className:"px-4 py-4 border-t "+(t?"border-gray-700/50":"border-gray-200/60"),children:[h("div",{className:"text-xs mb-3 font-semibold tracking-wide uppercase "+(t?"text-gray-400":"text-gray-500"),children:[m||"Quick questions",":"]}),h("div",{className:"flex items-center gap-1.5",children:[g("button",{onClick:()=>x("left"),disabled:!f,"aria-label":"Scroll left",className:"flex-shrink-0 flex items-center justify-center w-7 h-7 rounded-full shadow-sm transition-all duration-200 hover:shadow-md active:scale-95",style:{backgroundColor:C,border:`1px solid ${M}`,color:S,backdropFilter:"blur(4px)",opacity:f?1:.35,cursor:f?"pointer":"default"},children:g(Ee,{size:16})}),g("div",{ref:b,onScroll:k,className:"flex-1 flex gap-3 overflow-x-auto pb-2",style:{scrollBehavior:"smooth",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map((e,t)=>{const o=J(e,d);return h("button",{onClick:()=>u?.(e),className:"group relative text-sm px-5 py-2.5 rounded-full font-medium transition-all duration-300 hover:scale-105 active:scale-95 whitespace-nowrap flex-shrink-0 overflow-hidden backdrop-blur-sm "+(o?"text-right":"text-left"),style:{direction:o?"rtl":"ltr",backgroundColor:i.background,border:`1.5px solid ${i.border}`,boxShadow:i.shadow},onMouseEnter:e=>{p(e.currentTarget,!0),e.currentTarget.style.transform="translateY(-2px)"},onMouseLeave:e=>{p(e.currentTarget,!1),e.currentTarget.style.transform="translateY(0)"},children:[g("div",{className:"absolute inset-0 bg-gradient-to-br from-white/0 via-white/5 to-white/10 opacity-0 group-hover:opacity-100 transition-opacity duration-300 rounded-xl"}),g("span",{className:"relative z-10",style:{direction:o?"rtl":"ltr",color:s,fontFamily:l,fontSize:c,textAlign:o?"right":"left"},children:e})]},t)})}),g("button",{onClick:()=>x("right"),disabled:!v,"aria-label":"Scroll right",className:"flex-shrink-0 flex items-center justify-center w-7 h-7 rounded-full shadow-sm transition-all duration-200 hover:shadow-md active:scale-95",style:{backgroundColor:C,border:`1px solid ${M}`,color:S,backdropFilter:"blur(4px)",opacity:v?1:.35,cursor:v?"pointer":"default"},children:g(Be,{size:16})})]})]})},Nt=({questions:e=[],isDark:o=!1,primaryColor:r="#2563eb",onQuestionClick:a,isTyping:n=!1,layout:i="vertical",fontFamily:s="Inter",fontSize:l="14px",textColor:c,isRtl:d=!1,questionTextColor:u,questionBoxColor:p,headingLabel:m})=>{if(!e.length||n)return null;const b=u??c??(o?"#f3f4f6":"#111827"),f=t(()=>Ft(b,o),[b,o]);return"horizontal"===i?g(Lt,{questions:e,isDark:o,palette:f,resolvedTextColor:b,fontFamily:s,fontSize:l,isRtl:d,onQuestionClick:a,applyHoverState:(e,t)=>{e.style.backgroundColor=t?f.hoverBackground:f.background,e.style.borderColor=t?f.hoverBorder:f.border,e.style.boxShadow=t?f.hoverShadow:f.shadow},headingLabel:m}):h("div",{style:{paddingInlineStart:"50px"},children:[m?g("div",{className:"mb-2",style:{color:o?"#9ca3af":"#6b7280",fontFamily:s,fontSize:`calc(${l} - 1px)`},children:m}):null,g("div",{className:"flex flex-wrap gap-2",children:e.map((e,t)=>{const n=J(e,d);return g("button",{onClick:()=>a?.(e),className:"transition-all duration-200 active:scale-[0.97]",style:{direction:n?"rtl":"ltr",fontFamily:s,fontSize:l,color:r,backgroundColor:o?"transparent":"#ffffff",border:`1.5px solid ${r}`,borderRadius:"9999px",padding:"5px 14px",fontWeight:500,lineHeight:"1.4",whiteSpace:"normal",textAlign:n?"right":"left"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=`${r}14`},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=o?"transparent":"#ffffff"},children:e},t)})})]})},At=({active:e=!1,processing:t=!1,deviceId:o,barWidth:a=3,barGap:i=1,barRadius:s=1.5,barColor:l,fadeEdges:c=!0,fadeWidth:d=24,barHeight:u=4,height:p=64,sensitivity:m=1,smoothingTimeConstant:b=.8,fftSize:f=256,historySize:w=60,updateRate:v=30,mode:y="static",onError:k,onStreamReady:x,onStreamEnd:C,className:S,...M})=>{const P=r(null),z=r(null),T=r([]),F=r(null),L=r(null),N=r(null),A=r(0),I=r(0),j=r(null),E=r([]),B=r(0),R=r([]),D=r(!0),V=r(null),$=r(0),O="number"==typeof p?`${p}px`:p;return n(()=>{const e=P.current,t=z.current;if(!e||!t)return;const o=new ResizeObserver(()=>{const o=t.getBoundingClientRect(),r=window.devicePixelRatio||1;e.width=o.width*r,e.height=o.height*r,e.style.width=`${o.width}px`,e.style.height=`${o.height}px`;const a=e.getContext("2d");a&&a.scale(r,r),V.current=null,$.current=o.width,D.current=!0});return o.observe(t),()=>o.disconnect()},[]),n(()=>{if(t&&!e){let e=0;B.current=0;const t=()=>{e+=.03,B.current=Math.min(1,B.current+.02);const o=[],r=Math.floor((z.current?.getBoundingClientRect().width||200)/(a+i));if("static"===y){const t=Math.floor(r/2);for(let a=0;a<r;a++){const r=(a-t)/t,n=1-.4*Math.abs(r),i=(.2+(.25*Math.sin(1.5*e+3*r)+.2*Math.sin(.8*e-2*r)+.15*Math.cos(2*e+r)))*n;let s=i;if(E.current.length>0&&B.current<1){const e=Math.min(a,E.current.length-1);s=(E.current[e]||0)*(1-B.current)+i*B.current}o.push(Math.max(.05,Math.min(1,s)))}}else for(let t=0;t<r;t++){const a=(t-r/2)/(r/2),n=1-.4*Math.abs(a),i=(.2+(.25*Math.sin(1.5*e+.15*t)+.2*Math.sin(.8*e-.1*t)+.15*Math.cos(2*e+.05*t)))*n;let s=i;if(E.current.length>0&&B.current<1){const e=Math.floor(t/r*E.current.length);s=(E.current[e]||0)*(1-B.current)+i*B.current}o.push(Math.max(.05,Math.min(1,s)))}"static"===y?R.current=o:T.current=o,D.current=!0,j.current=requestAnimationFrame(t)};return t(),()=>{j.current&&cancelAnimationFrame(j.current)}}if(!e&&!t){if("static"===y?R.current.length>0:T.current.length>0){let e=0;const t=()=>{e+=.03,e<1?("static"===y?R.current=R.current.map(t=>t*(1-e)):T.current=T.current.map(t=>t*(1-e)),D.current=!0,requestAnimationFrame(t)):"static"===y?R.current=[]:T.current=[]};t()}}},[t,e,a,i,y]),n(()=>{if(!e)return N.current&&(N.current.getTracks().forEach(e=>e.stop()),N.current=null,C?.()),L.current&&"closed"!==L.current.state&&(L.current.close(),L.current=null),void(A.current&&(cancelAnimationFrame(A.current),A.current=0));return(async()=>{try{const e=await navigator.mediaDevices.getUserMedia({audio:o?{deviceId:{exact:o},echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});N.current=e,x?.(e);const t=new(window.AudioContext||window.webkitAudioContext),r=t.createAnalyser();r.fftSize=f,r.smoothingTimeConstant=b;t.createMediaStreamSource(e).connect(r),L.current=t,F.current=r,T.current=[]}catch(e){k?.(e)}})(),()=>{N.current&&(N.current.getTracks().forEach(e=>e.stop()),N.current=null,C?.()),L.current&&"closed"!==L.current.state&&(L.current.close(),L.current=null),A.current&&(cancelAnimationFrame(A.current),A.current=0)}},[e,o,f,b,k,x,C]),n(()=>{const o=P.current;if(!o)return;const r=o.getContext("2d");if(!r)return;let n;const g=h=>{const p=o.getBoundingClientRect();if(e&&h-I.current>v&&(I.current=h,F.current)){const e=new Uint8Array(F.current.frequencyBinCount);if(F.current.getByteFrequencyData(e),"static"===y){const t=Math.floor(.05*e.length),o=Math.floor(.4*e.length),r=e.slice(t,o),n=Math.floor(p.width/(a+i)),s=Math.floor(n/2),l=[];for(let e=s-1;e>=0;e--){const t=Math.floor(e/s*r.length),o=Math.min(1,r[t]/255*m);l.push(Math.max(.05,o))}for(let e=0;e<s;e++){const t=Math.floor(e/s*r.length),o=Math.min(1,r[t]/255*m);l.push(Math.max(.05,o))}R.current=l,E.current=l}else{let t=0;const o=Math.floor(.05*e.length),r=Math.floor(.4*e.length),a=e.slice(o,r);for(let e=0;e<a.length;e++)t+=a[e];const n=t/a.length/255*m;T.current.push(Math.min(1,Math.max(.05,n))),E.current=[...T.current],T.current.length>w&&T.current.shift()}D.current=!0}if(!D.current&&!e)return void(n=requestAnimationFrame(g));D.current=e,r.clearRect(0,0,p.width,p.height);const b=l||getComputedStyle(o).color||"#000",f=a+i,k=Math.floor(p.width/f),x=p.height/2;if("static"===y){const o=t||e||R.current.length>0?R.current:[];for(let e=0;e<k&&e<o.length;e++){const t=o[e]||.1,n=e*f,i=Math.max(u,t*p.height*.8),l=x-i/2;r.fillStyle=b,r.globalAlpha=.4+.6*t,s>0?(r.beginPath(),r.roundRect(n,l,a,i,s),r.fill()):r.fillRect(n,l,a,i)}}else for(let e=0;e<k&&e<T.current.length;e++){const t=T.current.length-1-e,o=T.current[t]||.1,n=p.width-(e+1)*f,i=Math.max(u,o*p.height*.8),l=x-i/2;r.fillStyle=b,r.globalAlpha=.4+.6*o,s>0?(r.beginPath(),r.roundRect(n,l,a,i,s),r.fill()):r.fillRect(n,l,a,i)}if(c&&d>0&&p.width>0){if(!V.current||$.current!==p.width){const e=r.createLinearGradient(0,0,p.width,0),t=Math.min(.3,d/p.width);e.addColorStop(0,"rgba(255,255,255,1)"),e.addColorStop(t,"rgba(255,255,255,0)"),e.addColorStop(1-t,"rgba(255,255,255,0)"),e.addColorStop(1,"rgba(255,255,255,1)"),V.current=e,$.current=p.width}r.globalCompositeOperation="destination-out",r.fillStyle=V.current,r.fillRect(0,0,p.width,p.height),r.globalCompositeOperation="source-over"}r.globalAlpha=1,n=requestAnimationFrame(g)};return n=requestAnimationFrame(g),()=>{n&&cancelAnimationFrame(n)}},[e,t,m,v,w,a,u,i,s,l,c,d,y]),h("div",{className:ne("relative h-full w-full",S),ref:z,style:{height:O},"aria-label":e?"Live audio waveform":t?"Processing audio":"Audio waveform idle",role:"img",...M,children:[!e&&!t&&g("div",{className:"border-muted-foreground/20 absolute top-1/2 right-0 left-0 -translate-y-1/2 border-t-2 border-dotted"}),g("canvas",{className:"block h-full w-full",ref:P,"aria-hidden":"true"})]})},It=({messages:e=[],isDark:o,primaryColor:i,isLoading:s,agentMessageBubbleColor:l,userMessageBoxColor:c,textColor:d,assistantTextColor:u,userTextColor:m,fontFamily:b,agentMessageBubbleFontFamily:f,agentMessageBubbleFontSize:w,userMessageBubbleFontFamily:v,userMessageBubbleFontSize:y,fontSize:k,formatTime:x,isRtl:C=!1,defaultLanguage:S="en",quickQuestions:M=[],shouldShowQuickQuestions:z=!1,onQuickQuestion:T,quickQuestionsLayout:F="vertical",onDecision:L,disclaimerEnabled:N=!1,disclaimerText:A,disclaimerPosition:I="top",disclaimerLinkUrl:j,disclaimerLinkLabel:E,resolvedAgentBubbleColor:B,resolvedUserMessageColor:R,resolvedTextColor:D,isVoiceSessionActive:V=!1,voiceStatus:$="idle",messagesContainerRef:O,companyLogo:U,chatbotAvatarEnabled:H,chatbotAvatar:q,conciergeName:W,companyName:_,apiBaseUrl:Y,getAuthToken:Q,onPromptSuggestionClick:K,conversationResetKey:G,allowFeedback:X,provideCitations:Z,onFeedback:ee,headerTextColor:te,onRetryMessage:oe,beforePromptsSlot:re=null,promptsSlot:ne=null,quickQuestionsHeadingLabel:ie})=>{const se=r(null),le=r(!0),ce=r(!1),de=t(()=>e.map(e=>`${e.id}:${e.content?.length??0}:${e.isProcessing?1:0}`).join("|"),[e]),ue=a(()=>{const e=O?.current;if(!e)return;const t=e.scrollHeight-e.scrollTop-e.clientHeight;le.current=t<160},[O]);n(()=>{const e=O?.current;if(e)return e.addEventListener("scroll",ue,{passive:!0}),ue(),()=>{e.removeEventListener("scroll",ue)}},[ue,O]),n(()=>{G&&(le.current=!0,ce.current=!1)},[G]),n(()=>{if(ce.current||0===e.length||"undefined"==typeof window)return;ce.current=!0;let t,o=!1;const r=window.requestAnimationFrame(()=>{o||(t=window.requestAnimationFrame(()=>{o||(se.current?.scrollIntoView({behavior:"instant",block:"end"}),le.current=!0)}))});return()=>{o=!0,window.cancelAnimationFrame(r),window.cancelAnimationFrame(t)}},[0===e.length]),n(()=>{if(!le.current)return;if("undefined"==typeof window)return;let e=!1;const t=window.requestAnimationFrame(()=>{e||se.current?.scrollIntoView({behavior:"smooth",block:"end"})});return()=>{e=!0,window.cancelAnimationFrame(t)}},[de,s]),n(()=>{if(!V||"connected"!==$)return;if("undefined"==typeof window)return;let e=!1;const t=window.requestAnimationFrame(()=>{e||se.current?.scrollIntoView({behavior:"smooth",block:"end"})});return()=>{e=!0,window.cancelAnimationFrame(t)}},[V,$]);const ge=t(()=>ae(j),[j]),he=t(()=>J(A,C),[A,C]);return h(p,{children:[N&&A&&"top"===I&&g("div",{className:"flex justify-center",children:g("div",{className:"rounded-lg px-2 py-1 ",style:{color:o?"#d1d5db":"#6b7280",fontFamily:null!=b?b:"Inter",fontSize:null!=k?`calc(${k} - 2px)`:"12px",direction:he?"rtl":"ltr",textAlign:"center",borderColor:o?"#374151":"#e5e7eb"},children:h("p",{className:"leading-relaxed whitespace-pre-wrap break-words inline",dir:he?"rtl":"ltr",style:{color:o?"#d1d5db":"#6b7280",fontFamily:null!=b?b:"Inter",fontSize:null!=k?`calc(${k} - 2px)`:"12px"},children:[A,ge&&E&&g("a",{href:ge,target:"_blank",rel:"noopener noreferrer",title:ge,style:{color:o?"#93c5fd":"#2563eb",marginInlineStart:"4px",verticalAlign:"middle",display:"inline-flex",alignItems:"center"},children:E})]})})}),e.map(e=>g(kt,{message:e,isDark:o,primaryColor:i,agentMessageBubbleColor:l,userMessageBoxColor:c,resolvedUserMessageColor:R,resolvedAgentBubbleColor:B,textColor:d,assistantTextColor:u,userTextColor:m,fontFamily:b,agentMessageBubbleFontFamily:f,agentMessageBubbleFontSize:w,userMessageBubbleFontFamily:v,userMessageBubbleFontSize:y,fontSize:k,formatTime:x,isRtl:J(e.content,C),onDecision:L,onPromptSuggestionClick:K,companyLogo:H&&q?q:U,conciergeName:W,companyName:_,apiBaseUrl:Y,getAuthToken:Q,allowFeedback:X,provideCitations:Z,onFeedback:ee,headerTextColor:te,onRetryMessage:oe,defaultLanguage:S},e.id)),(()=>{const t=e[e.length-1],r=s&&"user"===t?.role,a=e.some(e=>"assistant"===e.role&&(e.isProcessing||!e.content));return r&&!a?g(kt,{message:P(),isDark:o,primaryColor:i,agentMessageBubbleColor:l,resolvedAgentBubbleColor:B,userMessageBoxColor:c,textColor:d,assistantTextColor:u,userTextColor:m,fontFamily:b,agentMessageBubbleFontFamily:f,agentMessageBubbleFontSize:w,userMessageBubbleFontFamily:v,userMessageBubbleFontSize:y,fontSize:k,formatTime:x,isRtl:C,onDecision:L,companyLogo:H&&q?q:U,conciergeName:W,companyName:_,apiBaseUrl:Y,getAuthToken:Q,headerTextColor:te,defaultLanguage:S},"skeleton-waiting"):null})(),re,ne?g("div",{className:"pt-1",children:ne}):z&&M.length>0&&g("div",{className:"pt-1",children:g(Nt,{questions:M,isDark:o,primaryColor:i,onQuestionClick:T,isTyping:s,layout:F,fontFamily:b,fontSize:k,textColor:d,isRtl:C,questionTextColor:u,questionBoxColor:l,headingLabel:ie})}),V&&"connected"===$&&!s&&g("div",{className:"flex gap-3 flex-row-reverse animate-in",children:g("div",{className:"flex flex-col items-end max-w-[75%] w-full",children:h("div",{className:"rounded-2xl px-4 py-2.5 shadow-lg rounded-tr-sm w-full",style:{background:`linear-gradient(135deg, ${R||i||"#2563eb"} 0%, ${R||i||"#2563eb"}dd 100%)`,width:"100px"},children:[g("span",{className:"sr-only",children:"Listening for voice input"}),g(At,{active:!0,barWidth:2,barHeight:4,barGap:2,barColor:m||D||"#FFFFFF",height:20,fadeEdges:!0,className:"min-w-[60px]","aria-hidden":"true"})]})})}),g("div",{ref:se,className:"h-px"})]})};function jt(e,t){return String(e||"").replace(/\/+$/,"")+(t.startsWith("/")?t:`/${t}`)}function Et({apiEndpoint:e,conversationId:t,size:o,authHeader:r}){fetch(jt(e,"/api/v1/chat-attachments/release"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversationId:t,size:o})}).catch(()=>{})}function Bt({orgId:e,conversationId:n,config:i,apiEndpoint:s,authHeader:l,onError:c}){const[d,u]=o([]),g=r(new Map),h=r(0),p=r(d);p.current=d;const m=r({conversationId:n,bytes:0});m.current.conversationId!==n&&(m.current={conversationId:n,bytes:0});const b=a(()=>(h.current+=1,`att-${Date.now()}-${h.current}`),[]),f=a((e,t)=>{u(o=>o.map(o=>o.id===e?{...o,...t}:o))},[]),w=a((e,t,o)=>{const r={status:"error",error:{code:t,message:o}};u(t=>{const o=t.map(t=>t.id===e?{...t,...r}:t),a=o.find(t=>t.id===e);return a&&c&&c(a),o})},[c]),v=a((e,t)=>{if(!i?.fileUploadEnabled)return{ok:!1,code:"feature_disabled",message:"File uploads are not enabled for this organization."};if(t>=i.fileUploadMaxFiles)return{ok:!1,code:"too_many_files",message:`Max ${i.fileUploadMaxFiles} files per message.`};const o=1024*i.fileUploadMaxSizeMB*1024;if(m.current.bytes+e.size>o){return{ok:!1,code:"size_exceeded",message:`This conversation has already used ${(m.current.bytes/1048576).toFixed(1)} MB of its ${i.fileUploadMaxSizeMB} MB upload limit - this file won't fit.`}}const r=(e.type||"").toLowerCase(),a=new Set((i.fileUploadAllowedMimes||[]).map(e=>String(e).toLowerCase()));return a.size>0&&!a.has(r)?{ok:!1,code:"mime_not_allowed",message:`File type "${e.type||"unknown"}" is not allowed.`}:{ok:!0}},[i]),y=a(async(e,t)=>{let o;try{o=await fetch(jt(s,"/api/v1/chat-attachments/presign"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...l?{Authorization:l}:{}},body:JSON.stringify({filename:t.name,mimeType:t.type,size:t.size,conversationId:n})})}catch(o){return m.current.bytes=Math.max(0,m.current.bytes-t.size),void w(e,"network","Network error while requesting upload.")}if(!o.ok){let r="Upload rejected by the server.",a="unknown";try{const e=await o.json();e?.error&&(r=e.error),e?.code&&(a=function(e){switch(e){case"feature_disabled":case"size_exceeded":case"mime_not_allowed":case"storage_unavailable":return e;default:return"unknown"}}(e.code))}catch{}return m.current.bytes=Math.max(0,m.current.bytes-t.size),void w(e,a,r)}let r=0;const a=()=>{r>0&&(Et({apiEndpoint:s,conversationId:n,size:r,authHeader:l}),r=0,f(e,{reservedBytes:0}))},i=()=>{m.current.bytes=Math.max(0,m.current.bytes-t.size)};let c;try{c=await o.json()}catch{return Et({apiEndpoint:s,conversationId:n,size:t.size,authHeader:l}),i(),f(e,{reservedBytes:0}),void w(e,"unknown","Malformed presign response.")}let d,u;("boolean"==typeof c.reserved?c.reserved:!c.useMultipart)&&(r=t.size,f(e,{reservedBytes:t.size}));try{if(c.useMultipart){const o=await function({url:e,file:t,conversationId:o,authHeader:r,onProgress:a,registerXhr:n}){return new Promise((r,i)=>{const s=new XMLHttpRequest;n(s),s.open("POST",e,!0),s.withCredentials=!0;const l=new FormData;l.append("conversationId",o),l.append("file",t,t.name),s.upload.onprogress=e=>{e.lengthComputable&&a(Math.round(e.loaded/e.total*100))},s.onload=()=>{if(s.status>=200&&s.status<300)try{const e=JSON.parse(s.responseText);r({url:"string"==typeof e?.url?e.url:void 0,storageKey:"string"==typeof e?.storageKey?e.storageKey:void 0})}catch{r({})}else i(new Error(`upload_status_${s.status}`))},s.onerror=()=>i(new Error("network")),s.onabort=()=>i({aborted:!0}),s.send(l)})}({url:jt(s,"/api/v1/chat-attachments/multipart"),file:t,conversationId:n,authHeader:l,onProgress:t=>f(e,{progress:t}),registerXhr:t=>g.current.set(e,t)});d=o.url,u=o.storageKey,r=t.size,f(e,{reservedBytes:t.size})}else{if(!c.uploadUrl)throw new Error("presign_missing_target");{await function({url:e,file:t,onProgress:o,registerXhr:r}){return new Promise((a,n)=>{const i=new XMLHttpRequest;r(i),i.open("PUT",e,!0),i.setRequestHeader("x-ms-blob-type","BlockBlob"),t.type&&i.setRequestHeader("Content-Type",t.type),i.upload.onprogress=e=>{e.lengthComputable&&o(Math.round(e.loaded/e.total*100))},i.onload=()=>{i.status>=200&&i.status<300?a():n(new Error(`upload_status_${i.status}`))},i.onerror=()=>n(new Error("network")),i.onabort=()=>n({aborted:!0}),i.send(t)})}({url:c.uploadUrl,file:t,onProgress:t=>f(e,{progress:t}),registerXhr:t=>g.current.set(e,t)});const o=await async function({apiEndpoint:e,storageKey:t,filename:o,mimeType:r,authHeader:a}){let n;try{n=await fetch(jt(e,"/api/v1/chat-attachments/confirm"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...a?{Authorization:a}:{}},body:JSON.stringify({storageKey:t,filename:o,mimeType:r})})}catch{return{ok:!1,code:"network",message:"Network error while verifying upload."}}if(n.ok)return{ok:!0};let i="Upload rejected - file content did not match its declared type.",s="content_mismatch";try{const e=await n.json();e?.error&&(i=e.error),"password_protected"===e?.code&&(s="password_protected")}catch{}return{ok:!1,code:s,message:i}}({apiEndpoint:s,storageKey:c.storageKey,filename:t.name,mimeType:t.type,authHeader:l});if(!o.ok)return g.current.delete(e),a(),i(),void w(e,o.code,o.message)}}}catch(t){if(g.current.delete(e),t&&t.aborted)return;return a(),i(),void w(e,"network","Upload failed. Please retry.")}g.current.delete(e),f(e,{status:"ready",progress:100,storageKey:u||c.storageKey,...d?{url:d}:{}})},[s,l,n,w,f]),k=a(async e=>{const t=Array.from(e);for(const e of t){const t=p.current.filter(e=>"error"!==e.status).length,o=v(e,t),r=b();if(!o.ok){const t={id:r,filename:e.name,size:e.size,mimeType:e.type,status:"error",error:{code:o.code,message:o.message}};u(e=>(c&&c(t),[...e,t]));continue}const a={id:r,filename:e.name,size:e.size,mimeType:e.type,status:"uploading",progress:0,reservedBytes:0};u(e=>[...e,a]),m.current.bytes+=e.size,y(r,e)}},[v,y,b,c]),x=a(e=>{const t=g.current.get(e);t&&(t.abort(),g.current.delete(e));const o=p.current.find(t=>t.id===e);o&&o.reservedBytes>0&&(Et({apiEndpoint:s,conversationId:n,size:o.reservedBytes,authHeader:l}),m.current.bytes=Math.max(0,m.current.bytes-o.reservedBytes)),u(t=>t.filter(t=>t.id!==e))},[s,l,n]),C=a(()=>{for(const e of g.current.values())e.abort();g.current.clear(),u([])},[]),S=t(()=>d.some(e=>"validating"===e.status||"uploading"===e.status),[d]),M=a(()=>d.filter(e=>"ready"===e.status&&"string"==typeof e.storageKey).map(e=>({filename:e.filename,mimeType:e.mimeType,size:e.size,storageKey:e.storageKey,url:e.url})),[d]);return{attachments:d,addFiles:k,removeAttachment:x,clearAll:C,isBusy:S,toSendPayload:M}}function Rt(e){if(!e||e<1024)return`${e||0} B`;const t=["KB","MB","GB"];let o=e/1024,r=0;for(;o>=1024&&r<t.length-1;)o/=1024,r+=1;return`${o.toFixed(o>=10?0:1)} ${t[r]}`}function Dt({attachment:e,onRemove:t,isDark:o}){const r="error"===e.status,a="uploading"===e.status,n="ready"===e.status,i=r?o?"rgba(239,68,68,0.15)":"#fee2e2":o?"#1f2937":"#f3f4f6",s=r?o?"#b91c1c":"#fca5a5":o?"#374151":"#e5e7eb",l=r?o?"#fca5a5":"#b91c1c":o?"#e5e7eb":"#374151",c=r?`${e.filename} - ${e.error?.message||"error"}`:a?`${e.filename} - uploading`:`${e.filename} - ready`;return h("div",{className:"inline-flex items-center gap-2 rounded-full pl-2 pr-1 py-1 text-xs",style:{backgroundColor:i,border:`1px solid ${s}`,color:l,maxWidth:240},title:r?e.error?.message:e.filename,"aria-label":c,children:[r?g(Re,{size:12,"aria-hidden":"true"}):a?g(Oe,{size:12,className:"animate-spin","aria-hidden":"true"}):g($e,{size:12,"aria-hidden":"true"}),g("span",{className:"truncate",style:{maxWidth:140,direction:"ltr"},children:e.filename}),n&&g("span",{className:"opacity-70 text-chip",children:Rt(e.size)}),a&&"number"==typeof e.progress&&h("span",{className:"opacity-70 text-chip",children:[e.progress,"%"]}),g("button",{type:"button",onClick:()=>t(e.id),className:"w-4 h-4 rounded-full inline-flex items-center justify-center",style:{backgroundColor:"transparent",border:"none",color:l,cursor:"pointer"},"aria-label":"Remove attachment",children:g(Xe,{size:12})})]})}const Vt=({suggestions:e,onSuggestionClick:t,promptPrimary:o,promptTextColor:r,promptFontFamily:a,promptFontSize:n,isRtl:i,t:s,questionDisplay:l=!0})=>g("div",{className:"mb-2 px-5",children:g("div",{className:"flex flex-col gap-2",role:"group","aria-label":s("suggestedQuestions"),children:e.map((e,s)=>{const c=((e,t=!0)=>{if(!e||"string"==typeof e)return e||"";const o="string"==typeof e.text?e.text:"";if(!t)return o;const r="string"==typeof e.submitText?e.submitText.trim():"";return r&&r!==o?r:o})(e,l),d=J(c,i);return g("button",{type:"button",onClick:()=>t(e.submitText||e.text||e,e,s),dir:d?"rtl":"ltr",className:"block w-full rounded-2xl px-4 py-2 border-0 transition-transform duration-150 active:scale-[0.99] "+(d?"text-right":"text-left"),style:{direction:d?"rtl":"ltr",textAlign:d?"right":"left",background:`linear-gradient(135deg, ${o} 0%, ${o}dd 100%)`,color:r,fontFamily:a,fontSize:n},children:c},`${e.text||e}-${s}`)})})}),$t=({onStopGeneration:e,inputValue:i,setInputValue:s,onSend:l,isDark:c,primaryColor:d,isOpen:u,isMinimized:b,isLoading:f,isConversationLoading:w=!1,placeholder:v,textColor:y,fontFamily:k,fontSize:x,isRtl:C=!1,csatVisible:S=!1,enableVoiceInteraction:M=!1,isVoiceSessionActive:P=!1,voiceStatus:z="idle",voiceError:T=null,onVoiceToggle:F,onBidiSubmit:L,disclaimerEnabled:N=!1,disclaimerText:A,disclaimerPosition:I="top",disclaimerLinkUrl:j,disclaimerLinkLabel:E,showPoweredBy:B=!0,onboardingQuestions:R=[],onboardingActive:D=!1,onboardingCompleted:V=!1,userMessageBubbleFontFamily:$,onboardingEnabled:O=!1,userMessageBubbleFontSize:U,userMessageBoxColor:W,resolvedUserMessageColor:_,userTextColor:Q,promptSuggestions:K,onPromptSuggestionClick:G,autoPromptQuestionDisplay:Z=!0,tagSelectorNode:ee=null,showResolveButton:te=!1,onResolve:oe,defaultLanguage:re="en",chatFeatures:ie,apiEndpoint:se,organizationId:le,conversationId:ce})=>{const de=t(()=>X(re),[re]),ue=t(()=>function(e){const t=Y(e),o=q[t]||H;return{beforeBrand:o.poweredByBefore??o.poweredBy??H.poweredByBefore,afterBrand:o.poweredByAfter??""}}(re),[re]),ge=t(()=>J(i,C),[i,C]),[he,pe]=o(!1),[me,be]=o(!1),fe=t(()=>({fileUploadEnabled:ie?.fileUploadEnabled??!1,fileUploadMaxSizeMB:ie?.fileUploadMaxSizeMB??10,fileUploadMaxFiles:ie?.fileUploadMaxFiles??3,fileUploadAllowedMimes:ie?.fileUploadAllowedMimes??[]}),[ie]),{attachments:we,addFiles:ve,removeAttachment:ye,clearAll:ke,isBusy:xe,toSendPayload:Ce}=Bt({orgId:le,conversationId:ce,config:fe,apiEndpoint:se,authHeader:void 0}),Se=r(null),Me=!!fe.fileUploadEnabled&&!!se,Pe=we.length>=fe.fileUploadMaxFiles,ze=`Max ${fe.fileUploadMaxFiles} files per message.`,Te=t(()=>fe.fileUploadAllowedMimes.length>0?fe.fileUploadAllowedMimes.join(","):void 0,[fe.fileUploadAllowedMimes]),[Fe,Le]=o({top:0,left:0,placement:"top",arrowOffset:0}),[Ne,Ae]=o(!1),je=r(null),Ee=r(null),Be=r(null),Re=r(null);at(k),at($),n(()=>{u&&!b&&Ee.current?.focus()},[u,b]),n(()=>{const e=Ee.current;if(e){e.style.height="auto";const t=e.scrollHeight,o=i.trim().length>0?20:48,r=Math.max(o,Math.min(t,120));e.style.height=`${r}px`}},[i]);const De=a(()=>{const e=Ce();e.length>0?(l(void 0,e),ke()):l()},[Ce,ke,l]),Ve=we.some(e=>"ready"===e.status),$e=!i.trim()&&!Ve||f||w||xe,Ue=c?"#374151":"#e5e7eb",He=R&&R.length>0,We=S||w||O&&(He&&!V)||"connecting"===z,Qe=S?de("pleaseSubmitRatingFirst"):He?D?de("completeOnboardingToEnableVoice"):V?"":de("sendMessageToCompleteOnboarding"):"",Ke=()=>{if(!Be.current)return;const e=Be.current.getBoundingClientRect(),t=220,o=e.top,r=window.innerHeight-e.bottom;let a="top",n=0,i=0;o>=73?(a="top",n=e.top-60-5-8,i=e.right-t,i<10&&(i=10),i+t>window.innerWidth-10&&(i=window.innerWidth-t-10)):r>=68?(a="bottom",n=e.bottom+8,i=e.right-t,i<10&&(i=10),i+t>window.innerWidth-10&&(i=window.innerWidth-t-10)):(a="top",n=Math.max(10,e.top-60-5-8),i=e.right-t,i<10&&(i=10),i+t>window.innerWidth-10&&(i=window.innerWidth-t-10));return{top:n,left:i,placement:a,arrowOffset:e.left+e.width/2-i}};n(()=>{if(me&&Qe){const e=()=>{const e=Ke();Le(e)};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}}},[me,Qe]),n(()=>()=>{je.current&&clearTimeout(je.current)},[]);const Ge=null!=_?_:null!=W?W:null!=d?d:"#2563eb",Je=null!=Q?Q:null!=y?y:"#FFFFFF",Xe=null!=$?$:null!=k?k:"Inter",Ze=null!=U?U:null!=x?x:null,et=Ze?`calc(${Ze} - 2px)`:"12px",tt=ae(j);return h("div",{className:"py-4 flex-shrink-0 relative "+(c?"bg-gray-900":"bg-white"),style:{overflow:"visible"},children:[ee||K.length>0&&G&&g(Vt,{suggestions:K,onSuggestionClick:G,questionDisplay:Z,promptPrimary:Ge,promptTextColor:Je,promptFontFamily:Xe,promptFontSize:et,isRtl:C,t:de}),g("div",{className:"my-4",style:{height:"1px",backgroundColor:Ue}}),Me&&we.length>0&&g("div",{className:"px-5 mb-2 flex flex-wrap gap-1.5",children:we.map(e=>g(Dt,{attachment:e,onRemove:ye,isDark:c},e.id))}),h("div",{className:"flex items-center px-5 gap-1.5",children:[Me&&g("input",{ref:Se,type:"file",multiple:!0,accept:Te,"aria-label":de("uploadFile"),className:"hidden",style:{display:"none"},onChange:e=>{const t=e.target.files;t&&t.length&&!Pe&&ve(t),e.currentTarget.value=""}}),h("div",{className:`flex-1 flex items-center gap-1 px-1 min-h-[48px] ${c?"bg-gray-800":"bg-gray-50"} rounded-2xl transition-all duration-200`,style:{borderStyle:"solid",borderColor:i&&i.trim().length>0?d||"#2563eb":Ue,borderWidth:i&&i.trim().length>0?"2px":"1px"},children:[Me&&h("div",{className:"relative group shrink-0",children:[g("button",{type:"button",onClick:()=>Se.current&&Se.current.click(),disabled:S||w||f||Pe,"aria-label":Pe?ze:"Attach file",title:Pe?ze:"Attach file",className:`h-8 w-8 rounded-lg flex items-center justify-center transition-colors duration-200 ${c?"text-gray-300 hover:bg-gray-700":"text-gray-500 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,style:{border:"none"},children:g(qe,{className:"w-4 h-4"})}),Pe&&g("div",{role:"tooltip",className:"pointer-events-none absolute bottom-full left-1/2 -translate-x-1/2 mb-2 opacity-0 group-hover:opacity-100 transition-opacity px-3 py-1.5 text-xs rounded-lg whitespace-nowrap shadow-lg "+(c?"bg-gray-700 text-gray-100":"bg-gray-800 text-white"),children:ze})]}),g("div",{className:"relative flex-1 flex items-center min-w-0",children:g("textarea",{id:"chat-widget-input",ref:Ee,"aria-label":v||de("typeYourMessage"),value:i,onChange:e=>{s(e.target.value)},onFocus:()=>pe(!0),onBlur:()=>pe(!1),onKeyDown:e=>{if("Enter"===e.key&&!e.shiftKey){if(e.preventDefault(),P&&L)return void L();if($e)return;De()}},placeholder:w?de("agentIsLoading"):v||de("typeYourMessage"),rows:1,disabled:S||w||f||P&&"connected"!==z,dir:ge?"rtl":"ltr",className:`w-full px-3 bg-transparent rounded-xl leading-normal ${c?"text-gray-100":"text-gray-900"} placeholder-gray-400 resize-none outline-none scrollbar-hide break-words`,style:{height:"auto",maxHeight:"120px",minHeight:"48px",paddingTop:i.trim().length>0?"12px":"0px",paddingBottom:i.trim().length>0?"12px":"0px",lineHeight:i.trim().length>0?"1.4":"48px",fontFamily:$||k||"Inter",fontSize:x||"14px",color:c?"#F3F4F6":"#1F2937",textAlign:ge?"right":"left",direction:ge?"rtl":"ltr",wordSpacing:"0",letterSpacing:"0"}})}),M&&h("div",{className:"relative shrink-0",onMouseEnter:()=>{if(We&&Qe){je.current&&(clearTimeout(je.current),je.current=null);const e=Ke();Le(e),be(!0)}},onMouseLeave:()=>{je.current&&(clearTimeout(je.current),je.current=null),be(!1)},children:[g("button",{style:{border:"none"},ref:Be,type:"button",onClick:F,"aria-label":de(P?"stopVoiceInput":"startVoiceInput"),className:`h-8 w-8 rounded-lg flex items-center justify-center transition-colors duration-200 ${P?"bg-red-500 text-white hover:bg-red-600":c?"text-gray-300 hover:bg-gray-700":"text-gray-500 hover:bg-gray-200"} ${We?"opacity-60 cursor-not-allowed":""}`,disabled:We,children:"connecting"===z?g(Oe,{className:"w-4 h-4 animate-spin"}):g(Ie,{className:"w-4 h-4"})}),me&&Qe&&"undefined"!=typeof document&&m(h("div",{ref:Re,className:"px-3 py-1.5 text-xs shadow-md pointer-events-none",style:{position:"fixed",top:`${Fe.top}px`,left:`${Fe.left}px`,maxWidth:"220px",whiteSpace:"normal",wordWrap:"break-word",minWidth:"180px",zIndex:999999,backgroundColor:c?"#1f2937":"#ffffff",color:c?"#f3f4f6":"#111827",border:c?"1px solid #374151":"1px solid #e5e7eb",borderRadius:"top"===Fe.placement?"6px 6px 6px 6px":"6px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",overflow:"visible"},children:[g("div",{className:"text-left leading-relaxed",children:Qe}),"top"===Fe.placement&&h(p,{children:[g("div",{style:{position:"absolute",top:"100%",left:`${Fe.arrowOffset}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:c?"6px solid #374151":"6px solid #e5e7eb",pointerEvents:"none"}}),g("div",{style:{position:"absolute",top:"100%",left:`${Fe.arrowOffset}px`,transform:"translateX(-50%)",marginTop:"-1px",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:c?"5px solid #1f2937":"5px solid #ffffff",pointerEvents:"none"}})]}),"bottom"===Fe.placement&&h(p,{children:[g("div",{className:"absolute bottom-full",style:{left:`${Fe.arrowOffset}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderBottom:c?"5px solid #374151":"5px solid #e5e7eb"}}),g("div",{className:"absolute bottom-full -mb-px",style:{left:`${Fe.arrowOffset}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:c?"4px solid #1f2937":"4px solid #ffffff"}})]})]}),document.body)]})]}),g("button",f&&!P&&"function"==typeof e?{onClick:e,className:"h-10 w-10 flex-shrink-0 rounded-xl transition-all duration-200 flex items-center justify-center shadow-md scale-100",style:{backgroundColor:d,color:"white",border:"none"},"aria-label":de("stopGenerating"),children:g(Ye,{className:"w-3.5 h-3.5",fill:"currentColor"})}:{onClick:P&&L?L:De,disabled:S||$e||P&&"connected"!==z,className:"h-10 w-10 flex-shrink-0 rounded-xl transition-all duration-200 flex items-center justify-center shadow-md disabled:opacity-40 disabled:cursor-not-allowed disabled:shadow-none "+(i.trim()?"scale-100":"scale-95"),style:{backgroundColor:i.trim()?d:c?"#374151":"#e5e7eb",color:i.trim()?"white":"#9ca3af",border:"none"},"aria-label":de("sendMessage"),children:g(_e,{className:"w-4 h-4 transition-transform",style:C?{transform:"rotate(-90deg)"}:void 0})})]}),P&&h("p",{"aria-live":"polite",className:`text-xs mt-2 px-5 ${"connected"===z?"text-status-success":"text-gray-500"} flex items-center gap-1`,children:[g("span",{className:"w-1.5 h-1.5 rounded-full bg-current inline-flex"}),de("connected"===z?"voiceSessionLive":"connectingVoice")]}),T&&g("p",{role:"alert",className:"text-xs mt-1 px-5 text-status-error",children:de(T)===T?de("voiceUnavailable"):de(T)}),N&&A&&"footer"===I&&h("p",{className:"text-xs mt-2 px-5 text-center",style:{color:c?"#d1d5db":"#6b7280",fontFamily:k||"Inter",fontSize:x?`calc(${x} - 2px)`:"12px",direction:C?"rtl":"ltr"},dir:C?"rtl":"ltr",children:[A,tt&&E&&g("a",{href:tt,target:"_blank",rel:"noopener noreferrer",title:tt,style:{color:c?"#93c5fd":"#2563eb",marginInlineStart:"4px",verticalAlign:"middle",display:"inline-flex",alignItems:"center"},children:E})]}),B&&g("div",{className:"mt-1.5 flex justify-center",children:g("a",{href:"https://eshal.ai",target:"_blank",rel:"noopener noreferrer",className:"no-underline",children:h("span",{dir:"ltr",className:"inline-flex items-center gap-1.5 py-1.5 px-3",children:[ue.beforeBrand&&g("span",{className:ne("font-sans text-[10px] font-medium",c?"text-gray-400":"text-gray-500"),children:ue.beforeBrand}),Ne?g("span",{className:ne("font-sans text-[10px] font-semibold",c?"text-gray-300":"text-gray-600"),children:"ESHAL"}):g("img",{src:c?"data:image/svg+xml,%3csvg width='219' height='54' xmlns='http://www.w3.org/2000/svg' version='1.0'%3e%3cg class='layer'%3e%3ctitle%3eEshal Logo%3c/title%3e%3cg clip-path='url(%23a)' transform='translate(-.708 -1.076)'%3e%3cg clip-path='url(%23b)'%3e%3cpath d='M21.79 54.75h4.5l3.93-.56 4.49-1.4 3.38-1.97 2.81-2.25 2.24-2.81 2.25-3.93 1.13-3.09v-.85l-3.65-1.12h-.57l-1.96 4.5-1.97 3.09-2.81 2.53-3.93 1.96-3.38.85-2.81.28h-2.81l-4.21-.57-3.94-1.4-2.81-1.97-2.25-2.24-1.96-3.38-1.41-4.21-.56-3.37-.28-3.1v-3.65l.56-5.06 1.12-4.21 1.97-3.94 2.53-2.81 2.25-1.68 2.81-1.41 3.37-.84 2.25-.28H26l4.78.84 4.5 2.25 2.53 2.53 1.4 2.53.56 2.53-.28 3.65-1.12 2.25-1.41 1.69-1.4.55-1.13-4.21-1.68-2.81-1.97-1.97-3.09-1.4-1.12-.28h-5.34l-3.09 1.12-2.25 1.69-1.41 1.97-.84 3.09.28 3.08 1.4 2.82 1.97 1.96 2.81 1.41 2.25.56 4.78.28 3.09-.28.84-.28-1.12 3.09-1.69 1.97-2.25.84h-3.65l-2.81-1.12-1.68-1.41-3.38 2.25.56 1.13 1.13 1.4 2.81 1.69 2.81.84h4.78l2.81-.84 2.53-1.69 1.96-2.25L35 34.8l.84-4.5 3.65-2.24 2.53-2.53 1.69-3.09.56-2.25.28-2.81-.56-3.93-1.12-2.82-2.25-3.09-3.09-2.81-4.22-2.25-4.5-1.12-2.52-.28h-4.5l-3.93.56-4.5 1.41-3.38 1.96-3.37 3.1-2.52 3.65-1.97 4.49-1.13 4.78-.28 2.25v9.27l.84 5.06 1.69 4.78 1.69 3.09 2.25 2.81 2.8 2.53 2.82 1.69 5.06 1.68zm1.12-27.54-2.53-.84-1.4-1.12-.84-1.69.28-2.53 1.12-1.4 2.25-1.13H26l2.81 1.41 1.41 1.97.84 2.8v2.25l-1.12.28zm0 0' fill='white'/%3e%3c/g%3e%3c/g%3e%3cpath d='M82.381 38.435v6.48h-27.06V9.965h26.41v6.5h-18.36v7.57h16.22v6.3h-16.22v8.1zm16.432 7.07c-2.77 0-5.44-.37-8.02-1.11-2.57-.75-4.65-1.72-6.22-2.92l2.75-6.09c1.5 1.09 3.28 1.98 5.34 2.64 2.07.67 4.13 1 6.19 1q3.45 0 5.1-1.02t1.65-2.73c0-.83-.33-1.52-.98-2.06-.65-.55-1.48-1-2.5-1.33-1.01-.33-2.39-.7-4.11-1.1-2.67-.63-4.85-1.26-6.55-1.89s-3.15-1.64-4.37-3.04c-1.21-1.41-1.82-3.27-1.82-5.6 0-2.03.55-3.86 1.64-5.51 1.11-1.66 2.76-2.96 4.97-3.92 2.22-.97 4.93-1.46 8.13-1.46 2.22 0 4.4.27 6.53.8s4 1.3 5.59 2.3l-2.5 6.14c-3.23-1.82-6.45-2.74-9.67-2.74-2.27 0-3.95.37-5.03 1.1-1.07.73-1.61 1.69-1.61 2.89q0 1.8 1.86 2.67c1.25.59 3.16 1.16 5.72 1.72 2.66.63 4.85 1.27 6.55 1.9 1.69.63 3.14 1.63 4.36 2.99 1.21 1.37 1.82 3.21 1.82 5.55 0 2-.56 3.82-1.67 5.46q-1.68 2.475-5.01 3.93c-2.23.95-4.95 1.43-8.14 1.43m50.913-35.54v34.95h-8.08v-14.33h-15.88v14.33h-8.09V9.965h8.09v13.78h15.88V9.965zm29.811 27.47h-16.22l-3.1 7.48h-8.29l15.58-34.95h7.98l15.62 34.95h-8.48zm-2.55-6.15-5.55-13.37-5.53 13.37zm16.274-21.32h8.09v28.36h17.52v6.59h-25.61zm0 0' fill='white'/%3e%3c/g%3e%3c/svg%3e":"data:image/svg+xml,%3csvg width='219' height='54' xmlns='http://www.w3.org/2000/svg' version='1.0'%3e%3cg class='layer'%3e%3ctitle%3eEshal Logo%3c/title%3e%3cg clip-path='url(%23a)' transform='translate(-.708 -1.076)'%3e%3cg clip-path='url(%23b)'%3e%3cpath d='M21.79 54.75h4.5l3.93-.56 4.49-1.4 3.38-1.97 2.81-2.25 2.24-2.81 2.25-3.93 1.13-3.09v-.85l-3.65-1.12h-.57l-1.96 4.5-1.97 3.09-2.81 2.53-3.93 1.96-3.38.85-2.81.28h-2.81l-4.21-.57-3.94-1.4-2.81-1.97-2.25-2.24-1.96-3.38-1.41-4.21-.56-3.37-.28-3.1v-3.65l.56-5.06 1.12-4.21 1.97-3.94 2.53-2.81 2.25-1.68 2.81-1.41 3.37-.84 2.25-.28H26l4.78.84 4.5 2.25 2.53 2.53 1.4 2.53.56 2.53-.28 3.65-1.12 2.25-1.41 1.69-1.4.55-1.13-4.21-1.68-2.81-1.97-1.97-3.09-1.4-1.12-.28h-5.34l-3.09 1.12-2.25 1.69-1.41 1.97-.84 3.09.28 3.08 1.4 2.82 1.97 1.96 2.81 1.41 2.25.56 4.78.28 3.09-.28.84-.28-1.12 3.09-1.69 1.97-2.25.84h-3.65l-2.81-1.12-1.68-1.41-3.38 2.25.56 1.13 1.13 1.4 2.81 1.69 2.81.84h4.78l2.81-.84 2.53-1.69 1.96-2.25L35 34.8l.84-4.5 3.65-2.24 2.53-2.53 1.69-3.09.56-2.25.28-2.81-.56-3.93-1.12-2.82-2.25-3.09-3.09-2.81-4.22-2.25-4.5-1.12-2.52-.28h-4.5l-3.93.56-4.5 1.41-3.38 1.96-3.37 3.1-2.52 3.65-1.97 4.49-1.13 4.78-.28 2.25v9.27l.84 5.06 1.69 4.78 1.69 3.09 2.25 2.81 2.8 2.53 2.82 1.69 5.06 1.68zm1.12-27.54-2.53-.84-1.4-1.12-.84-1.69.28-2.53 1.12-1.4 2.25-1.13H26l2.81 1.41 1.41 1.97.84 2.8v2.25l-1.12.28zm0 0' fill='black'/%3e%3c/g%3e%3c/g%3e%3cpath d='M82.381 38.435v6.48h-27.06V9.965h26.41v6.5h-18.36v7.57h16.22v6.3h-16.22v8.1zm16.432 7.07c-2.77 0-5.44-.37-8.02-1.11-2.57-.75-4.65-1.72-6.22-2.92l2.75-6.09c1.5 1.09 3.28 1.98 5.34 2.64 2.07.67 4.13 1 6.19 1q3.45 0 5.1-1.02t1.65-2.73c0-.83-.33-1.52-.98-2.06-.65-.55-1.48-1-2.5-1.33-1.01-.33-2.39-.7-4.11-1.1-2.67-.63-4.85-1.26-6.55-1.89s-3.15-1.64-4.37-3.04c-1.21-1.41-1.82-3.27-1.82-5.6 0-2.03.55-3.86 1.64-5.51 1.11-1.66 2.76-2.96 4.97-3.92 2.22-.97 4.93-1.46 8.13-1.46 2.22 0 4.4.27 6.53.8s4 1.3 5.59 2.3l-2.5 6.14c-3.23-1.82-6.45-2.74-9.67-2.74-2.27 0-3.95.37-5.03 1.1-1.07.73-1.61 1.69-1.61 2.89q0 1.8 1.86 2.67c1.25.59 3.16 1.16 5.72 1.72 2.66.63 4.85 1.27 6.55 1.9 1.69.63 3.14 1.63 4.36 2.99 1.21 1.37 1.82 3.21 1.82 5.55 0 2-.56 3.82-1.67 5.46q-1.68 2.475-5.01 3.93c-2.23.95-4.95 1.43-8.14 1.43m50.913-35.54v34.95h-8.08v-14.33h-15.88v14.33h-8.09V9.965h8.09v13.78h15.88V9.965zm29.811 27.47h-16.22l-3.1 7.48h-8.29l15.58-34.95h7.98l15.62 34.95h-8.48zm-2.55-6.15-5.55-13.37-5.53 13.37zm16.274-21.32h8.09v28.36h17.52v6.59h-25.61zm0 0' fill='black'/%3e%3c/g%3e%3c/svg%3e",alt:"ESHAL",className:ne("h-3",c?"opacity-60":"opacity-50"),onError:()=>Ae(!0)}),ue.afterBrand&&g("span",{className:ne("font-sans text-[10px] font-medium",c?"text-gray-400":"text-gray-500"),children:ue.afterBrand})]})})})]})},Ot=["sun","mon","tue","wed","thu","fri","sat"];function Ut(e){if(!e||"string"!=typeof e)return null;const t=e.match(/^(\d{1,2}):(\d{2})/);if(!t)return null;const o=parseInt(t[1],10),r=parseInt(t[2],10);return Number.isNaN(o)||Number.isNaN(r)?null:60*o+r}function Ht(e,t=new Date,o={}){if(!e||!e.showStatus)return null;const r=o.online||"Online now",a=o.officeOpen||"Online now",n=o.offlineFallback||"Offline";if("officeHours"!==e.statusMode)return{online:!0,label:r};const i=e.officeHours||{},{dayKey:s,minutes:l}=function(e,t){try{const o=new Intl.DateTimeFormat("en-US",{timeZone:e||void 0,weekday:"short",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),r=(o.find(e=>"weekday"===e.type)||{}).value||"";let a=parseInt((o.find(e=>"hour"===e.type)||{}).value||"0",10);const n=parseInt((o.find(e=>"minute"===e.type)||{}).value||"0",10);return 24===a&&(a=0),{dayKey:r.slice(0,3).toLowerCase(),minutes:60*a+n}}catch{return{dayKey:Ot[t.getDay()],minutes:60*t.getHours()+t.getMinutes()}}}(i.timezone,t),c=Array.isArray(i.days)?i.days.map(e=>String(e).slice(0,3).toLowerCase()):[],d=Ut(i.open),u=Ut(i.close);if(c.includes(s)&&(null!=d&&null!=u&&(d<=u?l>=d&&l<u:l>=d||l<u))){return{online:!0,label:(i.onlineMessage||"").trim()||a}}return{online:!1,label:(i.offlineMessage||"").trim()||n}}const qt=({conciergeName:e,companyName:a,companyLogo:i,primaryColor:s,isDark:l,isMinimized:c=!1,textColor:d,fontFamily:u,fontSize:p,onToggleTheme:m,onMinimize:b,onClose:f,headerTextBold:w=!1,headerTextItalic:v=!1,headerTextColor:y,headerFontFamily:k,headerFontSize:x,subtitle:C=null,showStatus:S=!1,statusMode:M="always",officeHours:P=null,onRefreshChat:z,onCopyChat:T,defaultLanguage:F="en"})=>{const L=s,N=y||"#FFFFFF",A=k||u||"Inter",I=x||p;at(A);const j=t(()=>X(F),[F]),E=Q(F),B=t(()=>J(C,E),[C,E]),R=t(()=>Ht({showStatus:S,statusMode:M,officeHours:P}),[S,M,P]),[D,V]=o(!1),$=r(null),O=r(null);n(()=>{if(!D)return;const e=e=>{$.current&&!e.composedPath().includes($.current)&&V(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[D]);const U=r(!1);n(()=>{if(D){U.current=!0;const e=$.current?.querySelector('[role="menuitem"]');e?.focus()}else U.current&&(U.current=!1,O.current?.focus())},[D]);const H=N;return h("div",{className:`text-white ${c?"px-4 py-2.5":"px-3 py-4"} flex items-center justify-between relative overflow-visible rounded-t-2xl z-[60]`,style:{background:L,fontFamily:A},children:[h("div",{className:"flex items-center gap-3 flex-1 min-w-0 pl-1",children:[h("div",{className:"relative w-11 h-11 flex-shrink-0",children:[g("div",{className:"w-full h-full rounded-full overflow-hidden flex items-center justify-center bg-white/20",children:i?g("img",{src:i,alt:"Logo",style:{display:"block",width:"100%",height:"100%",objectFit:"contain"},loading:"lazy"}):g("span",{className:"text-lg font-semibold leading-none",style:{color:H},children:(e||a||"")?.charAt(0)?.toUpperCase()})}),R?g("span",{title:R.label,className:ne("absolute bottom-0 h-3 w-3 rounded-full ring-2 ring-white",E?"left-0":"right-0"),style:{backgroundColor:R.online?"#22c55e":"#9ca3af",boxShadow:R.online?"0 0 0 3px rgba(34,197,94,0.25)":"none"},"aria-hidden":"true"}):null]}),h("div",{className:"flex flex-col justify-center min-w-0",style:{fontFamily:A},children:[g("h3",{title:e,className:ne("font-semibold leading-snug truncate",w&&"font-bold",v&&"italic"),style:{fontSize:I?`calc(${I} + 2px)`:"15px",color:H},children:e}),C?g("p",{title:C,className:"leading-snug truncate opacity-75",dir:B?"rtl":"ltr",style:{fontSize:"12px",color:H,textAlign:B?"right":"left"},children:C}):null]})]}),h("div",{className:"flex items-center gap-0 relative z-10 text-white flex-shrink-0 ml-1",children:[h("div",{className:"relative",ref:$,children:[g("button",{type:"button",ref:O,"aria-label":j("menu"),"aria-expanded":D,"aria-haspopup":"true",onClick:()=>V(e=>!e),onKeyDown:e=>{"Escape"===e.key&&D&&(e.preventDefault(),V(!1))},className:"inline-flex h-7 w-7 items-center justify-center cursor-pointer transition-opacity duration-200 hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40 rounded-full border-0 bg-transparent p-0",style:{color:H},children:g(Ve,{className:"w-4 h-4",strokeWidth:1.6})}),D&&h("div",{role:"menu","aria-label":j("menu"),dir:E?"rtl":"ltr",onKeyDown:e=>{if("Escape"===e.key)return e.preventDefault(),void V(!1);if("Tab"===e.key){const t=$.current?Array.from($.current.querySelectorAll('[role="menuitem"]')):[];if(0===t.length)return;const o=t[0],r=t[t.length-1],a=document.activeElement;e.shiftKey&&a===o?(e.preventDefault(),r.focus()):e.shiftKey||a!==r||(e.preventDefault(),o.focus())}},className:`absolute top-full mt-1 w-44 rounded-xl border shadow-lg py-1 z-[9999] animate-in fade-in slide-in-from-top-1 duration-150 ${E?"left-0":"right-0"} ${l?"bg-gray-800 border-gray-700":"bg-white border-gray-200"}`,style:{fontFamily:A},children:[h("button",{role:"menuitem",onClick:()=>{V(!1),z?.()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm leading-5 transition-colors cursor-pointer "+(l?"text-gray-200 hover:bg-gray-700":"text-gray-700 hover:bg-gray-50"),style:{fontFamily:A,fontSize:"14px",border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",textAlign:E?"right":"left"},children:[g(We,{className:"w-3.5 h-3.5 flex-shrink-0"}),j("refreshChat")]}),h("button",{role:"menuitem",onClick:()=>{V(!1),T?.()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm leading-5 transition-colors cursor-pointer "+(l?"text-gray-200 hover:bg-gray-700":"text-gray-700 hover:bg-gray-50"),style:{fontFamily:A,fontSize:"14px",border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",textAlign:E?"right":"left"},children:[g(De,{className:"w-3.5 h-3.5 flex-shrink-0"}),j("copyChat")]}),h("button",{role:"menuitem",onClick:()=>{V(!1),m?.()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm leading-5 transition-colors cursor-pointer "+(l?"text-gray-200 hover:bg-gray-700":"text-gray-700 hover:bg-gray-50"),style:{fontFamily:A,fontSize:"14px",border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",textAlign:E?"right":"left"},children:[g(l?Ke:He,{className:"w-3.5 h-3.5 flex-shrink-0"}),j(l?"lightMode":"nightMode")]})]})]}),g("button",{type:"button","aria-label":j("close"),onClick:f,className:"inline-flex h-7 w-7 items-center justify-center cursor-pointer transition-opacity duration-200 hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40 rounded-full border-0 bg-transparent p-0",style:{color:H},children:g(Xe,{className:"w-3.5 h-3.5",strokeWidth:1.6})})]})]})},Wt=({questions:e=[],collapsiblePrompt:a,onSubmit:n,primaryColor:i="#2563eb",isRtl:s=!1,isDark:l=!1,defaultLanguage:c="en"})=>{const d=t(()=>X(c),[c]),[u,p]=o({}),[m,b]=o({}),[f,w]=o(!1),v=r({}),y=[...e].sort((e,t)=>se(e.fieldType)-se(t.fieldType));return g("div",{className:"flex flex-col items-center justify-center p-5 h-full min-h-0 z-50 relative ",style:l?{backgroundColor:"#10141C"}:void 0,children:h("div",{className:"w-full max-w-sm rounded-3xl shadow-xl border p-8 transition-colors duration-300 bg-white border-gray-100",style:l?{backgroundColor:"#1E232B",border:"1px solid #2A303C",borderRadius:"14px"}:void 0,children:[a&&g("div",{className:"mb-5 text-left",children:g("h3",{className:"transition-colors duration-300 text-h4 font-semibold "+(l?"text-white":"text-[#4A5568]"),children:a})}),h("form",{onSubmit:async e=>{e.preventDefault();const t=(()=>{const e={};return y.forEach(t=>{const o=t.fieldType||"question",r=(u[o]??"").trim(),a=t.collectionPrompt||t.askToType||t.question||t.label||o,n=!0===t.required||"true"===t.required;r?("fullName"!==o&&"name"!==o||r.length<2&&(e[o]=d("nameInvalid")),"email"!==o||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)||(e[o]=d("emailInvalid")),"phone"!==o&&"mobileno"!==o||/^[+]?[\d\s-]{8,15}$/.test(r)||(e[o]=d("phoneInvalid"))):n&&(e[o]="email"===o?d("emailRequired"):"fullName"===o||"name"===o?d("nameRequired"):"phone"===o||"mobileno"===o?d("phoneRequired"):`${a} ${d("fieldRequiredSuffix")}`)}),b(e),e})();if(Object.keys(t).length>0){const e=y.map((e,t)=>e.fieldType||`question_${t}`).find(e=>t[e]);return void v.current[e]?.focus()}w(!0);try{await n(u)}finally{w(!1)}},className:"space-y-4",noValidate:!0,children:[y.map((e,t)=>{const o=e.fieldType||`question_${t}`,r=e.collectionPrompt||e.askToType||e.question||e.label;if(!r?.trim())return null;let a="text";"email"===o&&(a="email"),"phone"!==o&&"mobileno"!==o||(a="tel");const n=(o||"").toLowerCase(),i="fullname"===n||"name"===n||"username"===n,c="phone"===n||"mobileno"===n,f="email"===n?d("onboardingEmailPlaceholder"):i?d("onboardingNamePlaceholder"):c?d("onboardingPhonePlaceholder"):r,w=m[o],y="w-full h-12 rounded-lg text-sm px-4 outline-none border transition-colors focus:ring-0 "+(l?"text-white placeholder:text-[#A2A9B2] focus:border-[#5A6069]":"bg-white text-gray-900 placeholder:text-[#8C8C8C] focus:border-[#B0B0B0]"),k=w?"!border-status-error focus:!border-status-error":"",x=`onboarding-field-${o}`,C=`${x}-error`;return h("div",{className:"space-y-1",children:[g("label",{htmlFor:x,className:"sr-only",children:r}),g("input",{id:x,ref:e=>{v.current[o]=e},placeholder:f,type:a,value:u[o]??"",onChange:e=>((e,t)=>{p(o=>({...o,[e]:t})),m[e]&&b(t=>{const o={...t};return delete o[e],o})})(o,e.target.value),className:`${y} ${k}`,"aria-invalid":w?"true":"false","aria-describedby":w?C:void 0,style:{direction:s?"rtl":"ltr",...l?{backgroundColor:"#272C35",borderWidth:"1px",borderStyle:"solid",borderColor:w?void 0:"#3F444C"}:{borderWidth:"1px",borderStyle:"solid",borderColor:w?void 0:"#E0E0E0"}}}),w&&g("p",{id:C,role:"alert",className:"text-xs text-status-error px-1",children:m[o]})]},o)}),g("button",{type:"submit",disabled:f,"aria-busy":f,"aria-label":f?d("submitting"):void 0,className:"w-full h-12 text-sm border-none font-semibold shadow-xl hover:shadow-xl hover:scale-[1.02] active:scale-[0.98] transition-all rounded-xl mt-4 text-white",style:{backgroundColor:i},children:f?g(Oe,{className:"w-5 h-5 animate-spin","aria-hidden":"true"}):d("startChat")})]})]})})},_t=({categories:e=[],selectedCategoryId:t=null,onSelect:i,isDark:s=!1,primaryColor:l="#2563eb",fontFamily:c="Inter",isRtl:d=!1})=>{const u=r(null),[p,m]=o(!1),[b,f]=o(!1),w=a(()=>{const e=u.current;if(!e)return;const{scrollLeft:t,scrollWidth:o,clientWidth:r}=e;m(Math.abs(t)>1),f(Math.abs(t)+r<o-1)},[]);n(()=>{w();const e=u.current;if(!e)return;const t=new ResizeObserver(w);return t.observe(e),()=>t.disconnect()},[w,e]);const v=a(e=>{const t=u.current;if(!t)return;const o="left"===e?-150:150;t.scrollBy({left:d?-o:o,behavior:"smooth"})},[d]);if(!Array.isArray(e)||0===e.length)return null;const y=s?"rgba(31,41,55,0.85)":"rgba(255,255,255,0.95)",k=s?"#e5e7eb":"#374151",x=s?"#4b5563":"#d1d5db";return h("div",{className:"flex-shrink-0 px-2 py-2 border-b flex items-center gap-1",style:{backgroundColor:s?"#111827":"#ffffff",borderColor:s?"#374151":"#e5e7eb",fontFamily:c,direction:d?"rtl":"ltr"},role:"region","aria-label":"Filter by category",children:[g("button",{type:"button",onClick:()=>v("left"),disabled:!p,"aria-label":"Scroll categories left",className:"flex-shrink-0 flex items-center justify-center w-6 h-6 rounded-full transition-all duration-200",style:{backgroundColor:y,border:`1px solid ${x}`,color:k,opacity:p?1:.3,cursor:p?"pointer":"default"},children:g(Ee,{size:14})}),g("div",{ref:u,onScroll:w,className:"flex-1 flex gap-2 overflow-x-auto",style:{scrollBehavior:"smooth",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map(e=>{const o=t===e.id;return g("button",{type:"button",onClick:()=>i?.(o?null:e.id),"aria-pressed":o,className:"flex-shrink-0 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium transition-all duration-150 whitespace-nowrap",style:{backgroundColor:s?"#1f2937":"#ffffff",border:o?`1.5px solid ${l}`:"1px solid "+(s?"#374151":"#e5e7eb"),color:o?l:s?"#e5e7eb":"#374151",fontFamily:c},children:g("span",{children:e.label})},e.id)})}),g("button",{type:"button",onClick:()=>v("right"),disabled:!b,"aria-label":"Scroll categories right",className:"flex-shrink-0 flex items-center justify-center w-6 h-6 rounded-full transition-all duration-200",style:{backgroundColor:y,border:`1px solid ${x}`,color:k,opacity:b?1:.3,cursor:b?"pointer":"default"},children:g(Be,{size:14})})]})},Yt=({categories:e=[],selectedCategoryId:t=null,onSelect:o,isDark:r=!1,primaryColor:a="#2563eb",fontFamily:n="Inter",fontSize:i="14px",isRtl:s=!1,label:l="Choose a topic to get started:"})=>{if(!Array.isArray(e)||0===e.length)return null;return h("div",{className:"pl-[50px] pt-1",style:{direction:s?"rtl":"ltr",paddingLeft:s?0:50,paddingRight:s?50:void 0},role:"region","aria-label":"Category filter",children:[g("div",{className:"mb-2",style:{color:r?"#9ca3af":"#6b7280",fontFamily:n,fontSize:`calc(${i} - 1px)`},children:l}),g("div",{className:"flex flex-wrap gap-2",children:e.map(e=>{const s=t===e.id;return g("button",{type:"button",onClick:()=>o?.(s?null:e.id),"aria-pressed":s,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full transition-all duration-150 hover:scale-[1.02] active:scale-[0.98]",style:{backgroundColor:r?"#1f2937":"#ffffff",border:s?`1.5px solid ${a}`:"1px solid "+(r?"#374151":"#e5e7eb"),color:s?a:r?"#e5e7eb":"#374151",fontFamily:n,fontSize:`calc(${i} - 1px)`,fontWeight:500},children:e.label},e.id)})})]})};const Qt=[{value:"😡",label:"😡",bg:"bg-red-200"},{value:"😕",label:"😕",bg:"bg-orange-200"},{value:"😐",label:"😐",bg:"bg-yellow-200"},{value:"😊",label:"😊",bg:"bg-green-200"},{value:"😍",label:"😍",bg:"bg-pink-200"}],Kt=[{value:"positive",label:"👍"},{value:"negative",label:"👎"}],Gt=[{value:"1",label:"1"},{value:"2",label:"2"},{value:"3",label:"3"},{value:"4",label:"4"},{value:"5",label:"5"}],Jt=[{value:"1",label:"⭐"},{value:"2",label:"⭐"},{value:"3",label:"⭐"},{value:"4",label:"⭐"},{value:"5",label:"⭐"}],Xt=({format:e="EMOJI",prompt:r="How was your experience?",onRating:a,disabled:n=!1,isDark:i=!1,primaryColor:s="#2563eb",defaultLanguage:l="en"})=>{const c=t(()=>X(l),[l]),[d,u]=o(null),[p,m]=o(null),[b,f]=o(!1),w=async t=>{if(!n&&!b){u(t),f(!0);try{a&&a(t,e)}finally{f(!1)}}},v=(()=>{switch(e){case"THUMBS":return Kt;case"NUMERIC":return Gt;case"STARS":return Jt;default:return Qt}})();return h("div",{className:ne("transition-all duration-200 rounded-xl px-4",i?"bg-slate-800/50":"bg-slate-50/50"),children:[g("p",{className:ne("text-sm font-semibold text-center mb-3",i?"text-gray-300":"text-gray-500/80"),children:r}),h("div",{className:"flex justify-center items-center",children:["EMOJI"===e&&g("div",{className:"flex gap-2 justify-center items-center",children:v.map(e=>g("button",{onClick:()=>w(e.value),disabled:n||b,className:ne("flex items-center justify-center text-2xl transition-transform","bg-transparent border-0 p-0 cursor-pointer","hover:scale-110 active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed","focus:outline-none focus:ring-0",d===e.value?"":"opacity-80"),children:g("span",{role:"img","aria-label":`${c("rate")} ${e.value}`,children:e.label})},e.value))}),"THUMBS"===e&&g("div",{className:"flex gap-6 justify-center items-center",role:"group","aria-label":c("rateExperience"),children:v.map(e=>g("button",{"aria-label":1===e.value?c("thumbsUp"):c("thumbsDown"),onClick:()=>w(e.value),disabled:n||b,className:ne("w-10 h-10 rounded-xl border flex items-center justify-center shadow-md text-2xl transition-all","hover:scale-105 active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed","drop-shadow-md",i?"bg-gray-700 border-gray-600 hover:bg-gray-600":"bg-white border-gray-100 hover:bg-gray-50",d===e.value&&"ring-2 ring-primary/40 scale-110"),style:{borderColor:d===e.value?s:void 0},children:g("span",{className:"drop-shadow-md","aria-hidden":"true",children:e.label})},e.value))}),"NUMERIC"===e&&g("div",{className:"flex gap-2 justify-center items-center",role:"group","aria-label":c("rateExperience"),children:v.map(e=>g("button",{"aria-label":`${c("rate")} ${e.value}`,onClick:()=>w(e.value),disabled:n||b,className:ne("w-10 h-10 rounded-lg flex items-center justify-center text-sm font-semibold transition-all","hover:scale-105 active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed",d===e.value?"ring-2 ring-primary/40 scale-110 shadow-md text-white":i?"bg-gray-700 border border-gray-600 text-gray-300 hover:bg-gray-600":"bg-white border border-gray-200 text-gray-700 hover:bg-gray-50"),style:{backgroundColor:d===e.value?s:void 0,borderColor:d===e.value?s:void 0},children:e.label},e.value))}),"STARS"===e&&g("div",{className:"flex gap-2 justify-center items-center",onMouseLeave:()=>m(null),children:v.map(e=>{const t=p===e.value;return g("button",{onClick:()=>w(e.value),onMouseEnter:()=>m(e.value),disabled:n||b,className:ne("flex items-center justify-center text-2xl","bg-transparent border-0 p-0 cursor-pointer focus:outline-none","disabled:opacity-50 disabled:cursor-not-allowed"),style:{transform:t?"scale(1.25)":"scale(1)",filter:t?"brightness(1.1) drop-shadow(0 2px 4px rgba(0,0,0,0.15))":"none",opacity:t?1:.6,transition:"all 0.2s ease"},"aria-label":`${c("rate")} ${e.value}`,children:g("span",{"aria-hidden":"true",children:e.label})},e.value)})})]}),b&&g("p",{"aria-live":"polite",className:ne("text-xs mt-3 text-center",i?"text-slate-400":"text-slate-500"),children:c("submittingFeedback")})]})};async function Zt({apiBaseUrl:e,conversationId:t,chip:o,submitText:r,position:a,source:n="widget",getAuthToken:i,enabled:s=!0}={}){try{if(!1===s)return!1;if(!e||"string"!=typeof e)return!1;if(!t||"string"!=typeof t)return!1;const l=function({chip:e,submitText:t,position:o,conversationId:r,source:a="widget"}={}){const n=e&&"object"==typeof e,i=n&&"string"==typeof e.text?e.text:"",s="string"==typeof t&&t?t:n&&"string"==typeof e.submitText?e.submitText:"string"==typeof e?e:"",l=i||s;if(!l)return null;const c={conversationId:r,chipText:l,submitText:s||void 0,position:Number.isInteger(o)?o:void 0,source:a},d=n?e?.promptId:void 0;return"string"==typeof d&&d&&(c.promptId=d),c}({chip:o,submitText:r,position:a,conversationId:t,source:n});if(!l)return!1;const c=`${e.replace(/\/$/,"")}/api/v1/support/chip-click`,d=JSON.stringify(l);let u;if("function"==typeof i)try{u=await i()}catch{u=void 0}if(!u&&"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon&&"undefined"!=typeof Blob)try{if(navigator.sendBeacon(c,new Blob([d],{type:"application/json"})))return!0}catch{}if("function"!=typeof fetch)return!1;const g={"Content-Type":"application/json"};return u&&(g.Authorization=`Bearer ${u}`),await fetch(c,{method:"POST",headers:g,credentials:"include",keepalive:!0,body:d}),!0}catch{return!1}}const eo="#ffffff",to="#f5f5f5",oo="#000000",ro="#1f2937",ao="#f3f4f6",no="#2563eb",io="eshal:widget:size",so=(e,t)=>!e||(e=>e?.trim().toLowerCase())(e)===t,lo=e=>(e instanceof Date?e:new Date(e)).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}).replace(/am|pm/i,e=>e.toUpperCase()),co=e=>{const t=(e||"EMOJI").toString().trim().toUpperCase();return"THUMBS"===t||"THUMB"===t?"THUMBS":"STARS"===t||"STAR"===t?"STARS":"NUMERIC"===t||"NUMBER"===t?"NUMERIC":"EMOJI"},uo=({isOpen:e,isMinimized:i,isDark:s,onStopGeneration:l,primaryColor:c,textColor:d,conciergeName:u,companyName:m,companyLogo:b,chatbotAvatarEnabled:f,chatbotAvatar:w,messages:v,isLoading:y,isConversationLoading:k=!1,inputValue:x,setInputValue:C,onSend:S,onDirectSend:M,onToggleTheme:P,onMinimize:z,onClose:T,quickQuestions:F=[],quickQuestionsEnabled:L,onQuickQuestion:N,quickQuestionsLayout:A="vertical",agentMessageBubbleColor:I,userMessageBoxColor:j,assistantTextColor:E,userTextColor:B,fontFamily:R="Inter",agentMessageBubbleFontFamily:D,agentMessageBubbleFontSize:V,userMessageBubbleFontFamily:$,userMessageBubbleFontSize:O,fontSize:U="14px",defaultLanguage:H="en",onDecision:q,headerTextBold:W=!1,headerTextItalic:_=!1,headerTextColor:Y,headerFontFamily:K,headerFontSize:G,subtitle:J=null,showStatus:Z=!1,statusMode:ee="always",officeHours:te=null,enableVoiceInteraction:oe=!1,isVoiceSessionActive:re=!1,voiceStatus:ae="idle",voiceError:ie=null,voiceConclusionForCsat:se=!1,onVoiceToggle:ce,onBidiSubmit:de,disclaimerEnabled:ue=!1,disclaimerText:ge,disclaimerPosition:he="top",disclaimerLinkUrl:me,disclaimerLinkLabel:be,showPoweredBy:fe=!0,apiBaseUrl:we,apiKey:ve,getAuthToken:ye,conversationId:ke,conciergeId:xe,onboardingQuestions:Ce=[],onboardingActive:Se=!1,onboardingCompleted:Me=!1,onOnboardingFormSubmit:Pe,collectionPrompt:ze,csatEnabled:Te=!1,csatFormat:Fe="EMOJI",csatPrompt:Le="How was your experience?",onPromptSuggestionClick:Ne,onboardingEnabled:Ae=!1,onResetConversation:Ie,sessionExpiringSoon:je=!1,autoPromptEnabled:Ee=!0,autoPromptQuestionDisplay:Be=!0,autoPromptClickTelemetry:Re=!0,allowFeedback:De=!0,provideCitations:Ve=!0,onFeedback:$e,onRetryMessage:Oe,onRefreshChat:Ue,onCopyChat:He,filterCategories:qe=[],showFilterStep:We=!1,widgetFilter:_e=null,onWidgetFilterChange:Ye,onSynthesizeAssistantMessage:Ke,launcherPosition:Ge="bottom-right",chatFeatures:Je,organizationId:Xe})=>{at(R);const Ze=r(null),et=r(null),tt=t(()=>X(H),[H]);n(()=>{et.current?.focus()},[]);const ot=a((e,t,o)=>{Zt({apiBaseUrl:we,conversationId:ke,chip:t,submitText:null==e?void 0:String(e),position:o,source:"widget",getAuthToken:ye,enabled:Re})},[we,ye,ke,Re]),rt=a((e,t,o)=>{t&&"object"==typeof t&&ot(e,t,o),Ne?Ne(e):M?.(e)},[Ne,M,ot]),nt=Ge.includes("right"),it=Ge.includes("bottom"),[st,lt]=o(()=>{if("undefined"==typeof window)return null;try{const e=window.localStorage.getItem(io);if(!e)return null;const t=JSON.parse(e);if("number"==typeof t?.width&&"number"==typeof t?.height&&t.width>=320&&t.height>=400)return t}catch{}return null}),ct=r(null),dt=r({x:0,y:0}),ut=r({width:380,height:650});n(()=>{const e=e=>{const t=ct.current;if(!t)return;const o=e.clientX-dt.current.x,r=e.clientY-dt.current.y,a={...ut.current},n=.92*window.innerWidth,i=.85*window.innerHeight;if("corner"===t||"horizontal"===t){const e=nt?ut.current.width-o:ut.current.width+o;a.width=Math.min(Math.max(320,e),n)}if("corner"===t||"vertical"===t){const e=it?ut.current.height-r:ut.current.height+r;a.height=Math.min(Math.max(400,e),i)}lt(a)},t=()=>{ct.current&&(ct.current=null,document.body.style.cursor="",document.body.style.userSelect="")};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[nt,it]),n(()=>{if(st)try{window.localStorage.setItem(io,JSON.stringify(st))}catch{}},[st]);const gt=(e,t)=>{t.preventDefault(),t.stopPropagation(),ct.current=e,dt.current={x:t.clientX,y:t.clientY},ut.current=st??{width:380,height:650};const o={corner:nt===it?"nwse-resize":"nesw-resize",horizontal:"ew-resize",vertical:"ns-resize"};document.body.style.cursor=o[e],document.body.style.userSelect="none"},[ht,pt]=o(!1),[mt,bt]=o(()=>{try{return pe(Xe)?.csatSubmitted??!1}catch{return!1}}),[ft,wt]=o(!1),[vt,yt]=o(!1),[kt,xt]=o(0),[Ct,St]=o(""),[Mt,Pt]=o(!1);n(()=>{try{const e=pe(Xe)?.csatSubmitted??!1;bt(e),e&&pt(!1)}catch{}},[ke]),function(e,t=[],o={}){const{enabled:a=!0,threshold:i=30,behavior:s="smooth",delay:l=0}=o,c=r(!0);r(0),n(()=>{if(!a||!e.current)return;const t=e.current,o=()=>{const e=t.scrollHeight-t.scrollTop-t.clientHeight;c.current=e<i},r=()=>{o()};t.addEventListener("scroll",r,{passive:!0}),o();const n=setTimeout(()=>{c.current&&t&&t.scrollTo({top:t.scrollHeight,behavior:s})},l);return()=>{t.removeEventListener("scroll",r),clearTimeout(n)}},[e,a,i,s,l,...t])}(Ze,[v,y],{enabled:!0,threshold:30,behavior:"smooth",delay:0});const zt=Q(H),Tt=t(()=>s?so(I,eo)?ro:I||ro:I||eo,[I,s]),Ft=t(()=>s?so(d,oo)?ao:d||ao:d||oo,[s,d]),Lt=t(()=>s?so(j,to)?c||no:j||c||no:j||to,[s,c,j]),Nt=tt(vt?"conversationResolved":"typeYourMessage"),At=v?.some?.(e=>"user"===e.role),jt=t(()=>(v||[]).filter(e=>"user"===e.role).length,[v]),[Et,Bt]=o(0),Rt=_e?.category?(qe||[]).find(e=>e.id===_e.category):null,Dt=a(e=>{if(!Ye)return;const t=_e?.category||null;if(e){if(Ye({category:e,tags:[]}),Bt(jt),!At&&e!==t&&Ke){const t=(qe||[]).find(t=>t.id===e),o=t?.label||e,r=tt("categoryTopicsHeading").replace("{category}",o);Ke(r,{replaceMarker:"category-intro"})}}else Ye(null)},[Ye,_e,jt,qe,At,Ke,tt]);a(e=>{const t=_e?.category||Rt?.id;t&&Ye&&Ye({category:t,tags:[e]}),M&&M(e)},[_e,Rt,Ye,M]);const Vt=Array.isArray(qe)&&qe.length>0,Ot=Vt&&!At&&!_e?.category,Ut=!At&&F.length>0&&L&&!_e?.category,Ht=Ce&&Ce.length>0,Qt=Boolean(Te),Kt=Ae&&Ht&&!Me,Gt=a(async()=>{if(Qt&&!Mt&&!vt&&0!==kt){Pt(!0);try{const e={"Content-Type":"application/json"};if("function"==typeof ye){const t=await ye();t&&(e.Authorization=`Bearer ${t}`)}const t=co(Fe),o=await fetch(`${we.replace(/\/$/,"")}/api/v1/support/csat`,{method:"POST",headers:e,credentials:"include",body:JSON.stringify({conversationId:ke,rating:String(kt),ratingFormat:t,conciergeId:xe,feedback:Ct||void 0})});o.ok?(wt(!1),xt(0),St(""),Ye&&Ye(null),Ue?Ue():Ie&&Ie()):console.error("Failed to submit resolve feedback:",await o.text())}catch(e){console.error("Error submitting resolve feedback:",e)}finally{Pt(!1)}}},[Qt,Mt,vt,kt,Ct,ke,ye,xe,we,Fe,Ie,Ue,Ye]),Jt=a(()=>{if(!Qt||!ke||!At)return Ye&&Ye(null),Ue?Ue():Ie&&Ie(),void T?.();ft?(wt(!1),T?.()):vt?T?.():wt(!0)},[Qt,ke,At,ft,vt,T,Ye,Ue,Ie]);n(()=>{Qt||(ft&&wt(!1),vt&&yt(!1),0!==kt&&xt(0),Ct&&St(""))},[Qt,ft,vt,kt,Ct]);const uo=t(()=>{if(!v||!Array.isArray(v))return[];for(let e=v.length-1;e>=0;e-=1)if("assistant"===v[e]?.role){const t=v[e].prompts;return Array.isArray(t)?t:[]}return[]},[v]),go=r([]);n(()=>{uo.length>0?go.current=uo:v&&0!==v.length&&v.some(e=>"user"===e.role)||(go.current=[])},[uo,v]);const ho=r(jt);n(()=>{jt!==ho.current&&(ho.current=jt,go.current=[])},[jt]);const po=uo.length>0?uo:go.current;n(()=>{if(!Te)return;if(!ht)return;if(mt)return;const e=Ze.current;if(!e)return;const t=window.requestAnimationFrame(()=>{e.scrollTo({top:e.scrollHeight,behavior:"smooth"})});return()=>{window.cancelAnimationFrame(t)}},[ht,Te,mt]);const mo=()=>{const e=co(Fe);if("STARS"===e)return g("div",{className:"flex justify-center gap-2 mb-5",role:"group","aria-label":tt("rateExperience"),children:[1,2,3,4,5].map(e=>g("button",{"aria-label":`${tt("rate")} ${e}`,onClick:()=>xt(e),className:"transition-all duration-150 hover:scale-110 active:scale-95 bg-transparent border-0 p-0 cursor-pointer",disabled:Mt,children:g(Qe,{className:ne("w-8 h-8 transition-colors",e<=kt?"text-yellow-400 drop-shadow-sm":s?"text-gray-600":"text-gray-300"),fill:e<=kt?"#FBBF24":"none"})},e))});if("THUMBS"===e)return g("div",{className:"flex gap-4 justify-center mb-5",role:"group","aria-label":tt("rateExperience"),children:[{value:"positive",emoji:"👍"},{value:"negative",emoji:"👎"}].map(e=>g("button",{"aria-label":"positive"===e.value?tt("thumbsUp"):tt("thumbsDown"),onClick:()=>xt(e.value),disabled:Mt,className:ne("w-12 h-12 rounded-xl border flex items-center justify-center text-2xl transition-all hover:scale-105 active:scale-95",kt===e.value?"ring-2 ring-blue-300 scale-110 shadow-lg":"",s?"bg-gray-700 border-gray-600 hover:bg-gray-600":"bg-white border-gray-200 hover:bg-gray-50"),children:g("span",{className:"drop-shadow-md",children:e.emoji})},e.value))});return g("div",{className:"flex gap-2 justify-center items-center mb-5",role:"group","aria-label":tt("rateExperience"),children:[{value:1,emoji:"😡"},{value:2,emoji:"😕"},{value:3,emoji:"😐"},{value:4,emoji:"😊"},{value:5,emoji:"😍"}].map(e=>g("button",{"aria-label":`${tt("rate")} ${e.value}`,onClick:()=>xt(e.value),disabled:Mt,className:ne("rounded-full w-10 h-10 flex items-center justify-center text-xl transition-all hover:scale-110 active:scale-95 bg-transparent border-0 p-0 cursor-pointer",kt===e.value?"ring-2 ring-blue-100 scale-125 bg-gradient-to-b from-yellow-200 to-yellow-400 shadow-md":"grayscale-[0.3] opacity-80 hover:grayscale-0"),children:g("span",{role:"img","aria-label":`${tt("rate")} ${e.value}`,className:"drop-shadow-sm filter",children:e.emoji})},e.value))})};if(!e)return null;const bo=!i&&st?{width:st.width,height:st.height,maxWidth:"92vw",maxHeight:"85vh"}:void 0;return h("div",{dir:zt?"rtl":"ltr",className:"relative flex-shrink-0 z-50 "+(i?"w-80 h-auto":""),style:bo,children:[!i&&h(p,{children:[g("div",{onMouseDown:e=>gt("horizontal",e),className:"absolute top-0 h-full w-1.5 cursor-ew-resize hover:bg-blue-500/20 transition-colors z-[70] "+(nt?"left-0":"right-0"),"aria-hidden":!0}),g("div",{onMouseDown:e=>gt("vertical",e),className:"absolute left-0 w-full h-1.5 cursor-ns-resize hover:bg-blue-500/20 transition-colors z-[70] "+(it?"top-0":"bottom-0"),"aria-hidden":!0})]}),h("div",{id:"chat-window-panel",ref:et,role:"dialog","aria-modal":"true","aria-label":tt("openChat"),tabIndex:-1,className:`relative focus:outline-none ${st||i?"":"w-[380px]"} ${st||i?"":"h-[650px]"} ${i?"w-80 h-auto":""} ${st&&!i?"w-full h-full":""} max-w-[92vw] border rounded-2xl shadow-2xl bg-white border-gray-200 flex flex-col ${i?"":"max-h-[85vh]"} overflow-hidden ${s?"bg-gray-900 border-gray-700":""}`,children:[!i&&g("div",{onMouseDown:e=>gt("corner",e),"aria-hidden":"true",className:`absolute w-4 h-4 ${nt===it?"cursor-nwse-resize":"cursor-nesw-resize"} text-gray-400 hover:text-blue-500 transition-colors z-[71] flex p-0.5 ${it?"top-0 items-start":"bottom-0 items-end"} ${nt?"left-0 justify-start":"right-0 justify-end"}`,children:g("svg",{viewBox:"0 0 12 12",className:"w-3 h-3 "+(it&&nt?"rotate-180":it?"-rotate-90":nt?"rotate-90":""),"aria-hidden":!0,children:g("path",{d:"M11 1 L1 11 M11 5 L5 11 M11 9 L9 11",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"})})}),g(qt,{conciergeName:u,companyName:m,companyLogo:b,primaryColor:c,isDark:s,isMinimized:i,textColor:Ft,fontFamily:R,fontSize:U,onToggleTheme:P,onMinimize:z,onClose:Jt,headerTextBold:W,headerTextItalic:_,headerTextColor:Y,headerFontFamily:K,headerFontSize:G,subtitle:J,showStatus:Z,statusMode:ee,officeHours:te,onRefreshChat:Ue,onCopyChat:He,defaultLanguage:H}),!i&&Vt&&!Ot&&!(ft&&!vt)&&!(Se&&!Me)&&g(_t,{categories:qe,selectedCategoryId:_e?.category||null,onSelect:Dt,isDark:s,primaryColor:c,fontFamily:R,isRtl:zt}),!i&&h(p,{children:[g("div",{ref:Ze,role:"log","aria-live":"polite",className:`chat-messages flex-1 overflow-y-auto px-3 py-4 space-y-4 ${s?"bg-gray-900":"bg-gradient-to-b from-gray-50/50 to-white"} break-words`,children:ft&&!vt?g("div",{className:"animate-in slide-in-from-top-4 fade-in duration-300 mt-4 mx-2",children:h("div",{className:ne("w-full rounded-3xl p-6 shadow-lg",s?"bg-gray-800 shadow-black/20":"bg-white shadow-gray-200/80"),children:[g("p",{className:ne("text-sm font-medium text-center mb-5 [font-family:inherit]",s?"text-gray-300":"text-gray-500"),children:Le||tt("feedbackPrompt")}),mo(),g("textarea",{"aria-label":tt("feedbackPlaceholder"),value:Ct,onChange:e=>{e.target.value.length<=1e3&&St(e.target.value)},maxLength:1e3,placeholder:tt("feedbackPlaceholder"),rows:4,disabled:Mt,className:ne("w-full rounded-xl border px-4 py-3 text-sm [font-family:inherit] resize-none outline-none transition-colors mb-5",s?"bg-gray-700 border-gray-600 text-gray-100 placeholder-gray-400":"bg-gray-50 border-gray-200 text-gray-900 placeholder-gray-400")}),h("div",{className:"relative group",children:[g("button",{onClick:Gt,disabled:0===kt||Mt,"aria-describedby":0===kt?"resolve-rating-hint":void 0,className:ne("w-full py-3.5 rounded-xl text-sm font-semibold [font-family:inherit] transition-all duration-200 border-none outline-none focus:outline-none active:outline-none focus:ring-0 active:ring-0","disabled:opacity-50 disabled:cursor-not-allowed",s?"bg-gray-700 text-gray-100 hover:bg-gray-600":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:tt(Mt?"submitting":"submitFeedback")}),0===kt&&!Mt&&g("div",{id:"resolve-rating-hint",role:"tooltip",className:"absolute -top-8 left-1/2 -translate-x-1/2 whitespace-nowrap px-2 py-1 rounded-md text-xs bg-gray-800 text-white opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none",children:tt("selectRatingFirst")})]})]})}):Se&&!Me&&Pe?g(Wt,{questions:Ce,onPromptSuggestionClick:rt,collapsiblePrompt:ze,onSubmit:Pe,primaryColor:c,isRtl:zt,isDark:s,defaultLanguage:H}):h(p,{children:[je&&g("div",{role:"status",className:"mx-3 mt-1 mb-2 rounded-lg px-3 py-2 text-xs font-medium "+(s?"bg-amber-900/40 text-amber-200 border border-amber-700/50":"bg-amber-50 text-amber-800 border border-amber-200"),children:tt("sessionExpiringSoon")}),g(It,{messages:v,isDark:s,primaryColor:c,isLoading:y,agentMessageBubbleColor:I,userMessageBoxColor:j,textColor:d,assistantTextColor:E,userTextColor:B,fontFamily:R,agentMessageBubbleFontFamily:D,agentMessageBubbleFontSize:V,userMessageBubbleFontFamily:$,userMessageBubbleFontSize:O,fontSize:U,formatTime:lo,isRtl:zt,defaultLanguage:H,quickQuestions:F,shouldShowQuickQuestions:Ut,onQuickQuestion:N??M,quickQuestionsLayout:A,onDecision:q,disclaimerEnabled:ue,disclaimerText:ge,disclaimerPosition:he,disclaimerLinkUrl:me,disclaimerLinkLabel:be,resolvedAgentBubbleColor:Tt,resolvedUserMessageColor:Lt,resolvedTextColor:Ft,isVoiceSessionActive:re,voiceStatus:ae,messagesContainerRef:Ze,companyLogo:b,chatbotAvatarEnabled:f,chatbotAvatar:w,conciergeName:u,companyName:m,apiBaseUrl:we,getAuthToken:ye,onPromptSuggestionClick:rt,conversationResetKey:ke,allowFeedback:De,provideCitations:Ve,onFeedback:$e,onRetryMessage:Oe,headerTextColor:Y,beforePromptsSlot:Ot?g(Yt,{categories:qe,selectedCategoryId:_e?.category||null,onSelect:Dt,isDark:s,primaryColor:c,fontFamily:R,fontSize:U,isRtl:zt,label:tt("chooseTopicLabel")}):null,quickQuestionsHeadingLabel:Vt?tt("quickQuestionsHeadingLabel"):void 0}),ht&&Te&&!mt&&g("div",{className:"",children:g(Xt,{format:co(Fe),prompt:Le||tt("howWasYourExperience"),onRating:async(e,t)=>{bt(!0),pt(!1),(e=>{try{const t=pe(e);if(!t)return;t.csatSubmitted=!0,localStorage.setItem(`${le}_${e}`,JSON.stringify(t))}catch{}})(void 0);try{const o={"Content-Type":"application/json"};if("function"==typeof ye){const e=await ye();e&&(o.Authorization=`Bearer ${e}`)}const r=await fetch(`${we.replace(/\/$/,"")}/api/v1/support/csat`,{method:"POST",headers:o,credentials:"include",body:JSON.stringify({conversationId:ke,rating:e,ratingFormat:t,conciergeId:xe})});r.ok||console.error("CSAT submission failed:",await r.text())}catch(e){console.error("CSAT submission error:",e)}},disabled:!1,isDark:s,primaryColor:c,defaultLanguage:H})})]})}),!(Se&&!Me)&&g($t,{onStopGeneration:l,inputValue:x,setInputValue:C,onSend:S,isDark:s,primaryColor:c,isOpen:e,isMinimized:i,isLoading:y,isConversationLoading:k,placeholder:Nt,textColor:Ft,fontFamily:R,userMessageBubbleFontFamily:$,userMessageBubbleFontSize:O,fontSize:U,isRtl:zt,csatVisible:ht&&Te&&!mt||Qt&&(ft||vt),enableVoiceInteraction:oe,isVoiceSessionActive:re,voiceStatus:ae,voiceError:ie,onVoiceToggle:ce,onBidiSubmit:de,disclaimerEnabled:ue,disclaimerText:ge,disclaimerPosition:he,disclaimerLinkUrl:me,disclaimerLinkLabel:be,showPoweredBy:fe,defaultLanguage:H,onboardingQuestions:Ce,onboardingActive:Se,onboardingCompleted:Me,onboardingEnabled:Ae,userMessageBoxColor:j,resolvedUserMessageColor:Lt,userTextColor:B,promptSuggestions:ft||vt||!1===Ee||y?[]:po,onPromptSuggestionClick:rt,autoPromptQuestionDisplay:Be,tagSelectorNode:null,showResolveButton:Qt&&At&&!vt&&!ft&&!ht&&!Kt,onResolve:()=>{Qt&&wt(!0)},chatFeatures:Je,apiEndpoint:we,organizationId:Xe,conversationId:ke})]})]})]})},go=new Map;const ho=i(({isDark:e,primaryColor:o,onToggle:r,textColor:a,headerTextColor:n,defaultLanguage:i="en",isOpen:s=!1,className:l},c)=>{const d=t(()=>X(i),[i]),u=n||"#FFFFFF";return h("button",{ref:c,onClick:r,className:`group relative w-16 h-16 rounded-full shadow-2xl transition-all duration-300 flex items-center justify-center text-white overflow-hidden hover:scale-110 ${l||""}`,style:{background:`linear-gradient(135deg, ${o} 0%, ${o}dd 100%)`,boxShadow:`0 10px 30px ${o}40`,border:"none"},"aria-label":d(s?"closeChat":"openChat"),"aria-expanded":s,"aria-controls":"chat-window-panel",children:[g("div",{className:"absolute inset-0 rounded-full bg-white/20 scale-0 group-hover:scale-100 transition-transform duration-500"}),g("div",{className:"relative z-10 transition-transform duration-300",children:g(Ue,{className:"w-7 h-7",style:{color:u}})})]})});ho.displayName="ToggleButton";const po="0.2.11",mo=({getAuthToken:i,apiBaseUrl:s,darkMode:l,primaryColor:c,position:d,companyName:u,conciergeName:p,companyLogo:m,welcomeMessage:b,quickQuestions:f,quickQuestionsEnabled:w,quickQuestionsLayout:v="vertical",textColor:y,agentMessageBubbleColor:k,userMessageBoxColor:x,assistantTextColor:C,userTextColor:S,fontFamily:M,fontSize:P,defaultLanguage:z,apiKey:T,agentMessageBubbleFontFamily:F,agentMessageBubbleFontSize:L,userMessageBubbleFontFamily:N,userMessageBubbleFontSize:A,autoOpen:I=!1,openDelay:j=0,locale:E,className:B="",headerTextBold:R,headerTextItalic:D,enableVoiceInteraction:V,disclaimerEnabled:$,disclaimerText:O,disclaimerPosition:U,disclaimerLinkUrl:H,disclaimerLinkLabel:q,showPoweredBy:W,onboardingQuestions:_,collectionPrompt:Y,allowedDomains:Q,onboardingEnabled:K,wsBaseUrl:G})=>{const[J,X]=o(null),[Z,ee]=o(!0),[te,oe]=o(null),[re,ne]=o(!1),ie=e.useRef(!1);n(()=>{if(ie.current)return;(async()=>{if(!s)return oe("apiBaseUrl is required"),void ee(!1);try{ee(!0);const e=await(async(e,t)=>{if(!e)throw new Error("apiBaseUrl is required");try{const o=e.replace(/\/$/,""),r=po?`${o}/api/v1/deploy-agent?wv=${encodeURIComponent(po)}`:`${o}/api/v1/deploy-agent`,a={"Content-Type":"application/json"};if("function"==typeof t){const e=await t();e&&(a.Authorization=`Bearer ${e}`)}const n=await fetch(r,{method:"GET",headers:a,credentials:"include"});if(404===n.status)return null;if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(e){throw console.error("Failed to fetch agent configuration:",e),e}})(s,i);if(null===e)return ie.current=!0,ne(!0),X(null),void oe(null);X(e),oe(null)}catch(e){console.error("Failed to load agent configuration:",e),oe(e.message||"Failed to load configuration")}finally{ee(!1)}})()},[s,i]);const se=t(()=>{if(!J)return null;const e=J.config??{},t=e.identity??{},o=e.branding??{},r=e.typography??{},a=e.messages??{},n=e.voice??{},i=e.onboarding??{},s=e.disclaimer??{},g=e.csat??{},h=e.inactivity??{},v=e.behavior??{},T=e.security??{},I=e.layout??{},j=z??a.defaultLocale??"en",E=a.bundles?.[j]??{},B=a.bundles?.en??{},G={welcome:E.welcome||B.welcome,fallback:E.fallback||B.fallback,quickQuestions:Array.isArray(E.quickQuestions)&&E.quickQuestions.length>0?E.quickQuestions:B.quickQuestions},X=Q??T.allowedDomains??(T.domains??[]).map(e=>"string"==typeof e?e:e.domain).filter(Boolean)??[];return{darkMode:l??!1,primaryColor:c??o.brandColor??"#2563eb",companyName:u??t.companyName??"Support Team",conciergeName:p??t.conciergeName,companyLogo:m??o.avatar??null,chatbotAvatarEnabled:o.chatbotAvatarEnabled??!1,chatbotAvatar:o.chatbotAvatar??null,welcomeMessage:b??G.welcome??"Hi! How can we help?",fallbackMessage:G.fallback,quickQuestions:f??G.quickQuestions??[],quickQuestionsEnabled:w??a.quickQuestionsEnabled,textColor:y??"#000000",agentMessageBubbleColor:k??r.agentMessageBubbleColor,userMessageBoxColor:x??r.userMessageBoxColor,assistantTextColor:C??r.assistantTextColor??"#000000",userTextColor:S??r.userTextColor??"#000000",fontFamily:M??r.agentMessageBubbleFontFamily??"Inter",fontSize:P??r.agentMessageBubbleFontSize??"14px",defaultLanguage:j,headerTextBold:R??r.headerTextBold??!1,headerTextItalic:D??r.headerTextItalic??!1,headerTextColor:r.headerTextColor??"#FFFFFF",headerFontFamily:r.headerFontFamily,headerFontSize:r.headerFontSize,subtitle:t.subtitle??null,showStatus:t.showStatus??!1,statusMode:t.statusMode??"always",officeHours:t.officeHours??null,enableVoiceInteraction:V??n.enableVoiceInteraction??!1,disclaimerEnabled:$??s.enabled??!1,disclaimerText:O??s.text,disclaimerPosition:U??(Z=s.position,Z?Z.toLowerCase():"top"),disclaimerLinkUrl:ae(H??s.linkUrl),disclaimerLinkLabel:q??s.linkLabel,showPoweredBy:W??o.showPoweredBy??!0,onboardingQuestions:_??i.questions??[],collectionPrompt:Y??i.collapsiblePrompt??"Before we begin, I need to verify your details.",allowedDomains:X,launcherPosition:d??(e=>e?e.toLowerCase().replace(/_/g,"-"):"bottom-right")(I.launcherPosition),onboardingEnabled:K??i.enabled??!1,inactivityTimeoutValue:h.timeoutValue??null,inactivityTimeoutUnit:h.timeoutUnit??null,agentMessageBubbleFontFamily:F??r.agentMessageBubbleFontFamily??M??"Inter",agentMessageBubbleFontSize:L??r.agentMessageBubbleFontSize??P??"14px",userMessageBubbleFontFamily:N??r.userMessageBubbleFontFamily??M??"Inter",userMessageBubbleFontSize:A??r.userMessageBubbleFontSize??P??"14px",csatEnabled:g.enabled??!1,csatFormat:g.format??"EMOJI",csatPrompt:g.prompt??"How was your experience?",autoPromptEnabled:v.autoPromptEnabled??!0,autoPromptQuestionDisplay:v.autoPromptQuestionDisplay??!0,autoPromptClickTelemetry:v.autoPromptClickTelemetry??!0,allowFeedback:v.allowFeedback??!0,provideCitations:v.provideCitations??!0,organizationId:J.organizationId??null,chatFeatures:e.chatFeatures??null};var Z},[J,l,c,d,u,p,m,b,f,w,y,k,x,C,S,M,P,z,R,D,V,$,O,U,q,H,W,_,K,Y,Q,F,L,N,A]),le=t(()=>!se||((e=[])=>{if("undefined"==typeof window)return!1;const t=window.location.hostname.toLowerCase(),o=window.location.host.toLowerCase();return!(!e||0===e.length)&&e.some(e=>{const r=e.toLowerCase().trim();return r.includes(":")?o===r:t===r||t.endsWith("."+r)})})(se.allowedDomains),[se]),ce=t(()=>({welcomeMessage:"Hi! How can we help?",quickQuestions:[],apiBaseUrl:s||"",apiKey:T||"",getAuthToken:i,autoOpen:!1,openDelay:0,darkMode:!1,enableVoiceInteraction:!1,onboardingQuestions:[],onboardingEnabled:!1,collectionPrompt:void 0}),[s,T,i]),{isOpen:de,isMinimized:ue,isDark:ge,messages:he,inputValue:pe,isLoading:me,widgetRef:be,setInputValue:fe,handleSend:we,stopGeneration:ve,handleQuickQuestion:ye,sendMessage:ke,retryMessage:xe,toggleChat:Ce,toggleTheme:Se,toggleMinimize:Me,closeChat:ze,handleDecision:Te,isVoiceSessionActive:Fe,voiceStatus:Le,voiceError:Ne,voiceConclusionForCsat:Ae,handleVoiceToggle:Ie,sendBidiTextMessage:je,onboardingActive:Ee,onboardingCompleted:Be,handleOnboardingFormSubmit:Re,conversationId:De,resetConversation:Ve,sessionExpiringSoon:$e,updateMessageFeedback:Oe,widgetFilter:Ue,setWidgetFilter:He,addAssistantMessage:qe}=Pe(se?{welcomeMessage:se.welcomeMessage,fallbackMessage:se.fallbackMessage,quickQuestions:se.quickQuestions,apiBaseUrl:s,wsBaseUrl:G??J?.wsBaseUrl,apiKey:T,locale:se.defaultLanguage||E,organizationId:se.organizationId,getAuthToken:i,autoOpen:I,openDelay:j,darkMode:se.darkMode,enableVoiceInteraction:se.enableVoiceInteraction,onboardingQuestions:se.onboardingQuestions,onboardingEnabled:se.onboardingEnabled,collectionPrompt:se.collectionPrompt,provideCitations:se.provideCitations,inactivityTimeoutValue:se.inactivityTimeoutValue,inactivityTimeoutUnit:se.inactivityTimeoutUnit,messageLimits:J?.messageLimits}:ce),We=r(null),_e=r(de);n(()=>{_e.current&&!de&&We.current?.focus(),_e.current=de},[de]);const Ye=a((e,t,o)=>{if(Oe(e,t),!De||!s)return;const r=s.replace(/\/$/,"");(async()=>{try{const a={"Content-Type":"application/json"};if("function"==typeof i){const e=await i();e&&(a.Authorization=`Bearer ${e}`)}await fetch(`${r}/api/v1/support/feedback`,{method:"POST",headers:a,credentials:"include",body:JSON.stringify({messageContent:e,conversationId:De,feedback:t,feedbackText:o})})}catch(e){console.error("Feedback submission error:",e)}})()},[De,s,i,Oe]),Qe=a(()=>{Ve&&Ve()},[Ve]),{categories:Ke,hasFilters:Ge}=function(e,r){const a=!!e,[i,s]=o({categories:[],loading:a,error:null});n(()=>{if(!e)return void s({categories:[],loading:!1,error:null});const t=r?`${e}|__session__`:`${e}|__proxy__`,o=go.get(t);if(o)return void s({categories:o,loading:!1,error:null});let a=!1;s(e=>({...e,loading:!0,error:null}));const n=`${e.replace(/\/$/,"")}/api/v1/widget/filters`;return(async()=>{try{const e={Accept:"application/json"};if("function"==typeof r){const t=await r();t&&(e.Authorization=`Bearer ${t}`)}const o=await fetch(n,{method:"GET",headers:e});if(!o.ok)throw new Error(`filter catalog HTTP ${o.status}`);const i=await o.json(),l=Array.isArray(i?.categories)?i.categories:[];if(a)return;go.set(t,l),s({categories:l,loading:!1,error:null})}catch(e){if(a)return;console.warn("[useFilterCatalog] catalog fetch failed:",e),s({categories:[],loading:!1,error:e})}})(),()=>{a=!0}},[e,r]);const l=t(()=>Array.isArray(i.categories)&&i.categories.length>0,[i.categories]);return{...i,hasFilters:l}}(s,i),Je=a(()=>{const e=he.filter(e=>e.content&&""!==e.content.trim()).map(e=>`${"user"===e.role?"You":se?.conciergeName||"Assistant"}: ${e.content}`).join("\n\n");e&&navigator.clipboard.writeText(e).catch(()=>{})},[he,se?.conciergeName]);if(n(()=>{be.current&&se&&(be.current.style.setProperty("--cw-primary",se.primaryColor),se.fontFamily&&be.current.style.setProperty("--cw-font-family",se.fontFamily),se.textColor&&be.current.style.setProperty("--cw-text-color",se.textColor))},[se,be]),Z)return null;if(re)return null;if(te||!se)return console.error("ChatWidget configuration error:",te),null;if(!le)return null;const Xe={"bottom-right":"bottom-5 right-5","bottom-left":"bottom-5 left-5","top-right":"top-5 right-5","top-left":"top-5 left-5"};return g("div",{id:"chat-widget-root",children:h("div",{ref:be,className:`chat-widget-root fixed flex flex-col ${se.launcherPosition?.includes("left")?"items-start":"items-end"} z-[999999] ${ge?"dark":""} ${B} ${Xe[se.launcherPosition]||Xe["bottom-right"]}`,children:[g(uo,{isOpen:de,isMinimized:ue,isDark:ge,launcherPosition:se.launcherPosition,primaryColor:se.primaryColor,textColor:se.textColor,companyName:se.companyName,conciergeName:se.conciergeName,companyLogo:se.companyLogo,chatbotAvatarEnabled:se.chatbotAvatarEnabled,chatbotAvatar:se.chatbotAvatar,messages:he,isLoading:me,inputValue:pe,setInputValue:fe,onSend:we,onStopGeneration:ve,onDirectSend:ke,onToggleTheme:Se,onMinimize:Me,onClose:ze,quickQuestions:se.quickQuestions,quickQuestionsEnabled:se.quickQuestionsEnabled,onQuickQuestion:ye,quickQuestionsLayout:v,agentMessageBubbleColor:se.agentMessageBubbleColor,userMessageBoxColor:se.userMessageBoxColor,assistantTextColor:se.assistantTextColor,userTextColor:se.userTextColor,fontFamily:se.fontFamily,agentMessageBubbleFontFamily:se.agentMessageBubbleFontFamily,agentMessageBubbleFontSize:se.agentMessageBubbleFontSize,userMessageBubbleFontFamily:se.userMessageBubbleFontFamily,userMessageBubbleFontSize:se.userMessageBubbleFontSize,fontSize:se.fontSize,defaultLanguage:se.defaultLanguage||E,onDecision:Te,headerTextBold:se.headerTextBold,headerTextItalic:se.headerTextItalic,headerTextColor:se.headerTextColor,headerFontFamily:se.headerFontFamily,headerFontSize:se.headerFontSize,subtitle:se.subtitle,showStatus:se.showStatus,statusMode:se.statusMode,officeHours:se.officeHours,enableVoiceInteraction:se.enableVoiceInteraction,isVoiceSessionActive:Fe,voiceStatus:Le,voiceError:Ne,voiceConclusionForCsat:Ae,onVoiceToggle:Ie,onBidiSubmit:()=>je(pe),disclaimerEnabled:se.disclaimerEnabled,disclaimerText:se.disclaimerText,disclaimerPosition:se.disclaimerPosition,disclaimerLinkUrl:se.disclaimerLinkUrl,disclaimerLinkLabel:se.disclaimerLinkLabel,showPoweredBy:se.showPoweredBy,apiBaseUrl:s,apiKey:T,getAuthToken:i,conversationId:De,conciergeId:J?.conciergeId??J?.id,onboardingQuestions:se.onboardingQuestions,onboardingActive:Ee,onboardingCompleted:Be,onOnboardingFormSubmit:Re,collectionPrompt:se.collectionPrompt,csatEnabled:se.csatEnabled,csatFormat:se.csatFormat,csatPrompt:se.csatPrompt,onboardingEnabled:se.onboardingEnabled,onResetConversation:Ve,sessionExpiringSoon:$e,autoPromptEnabled:se.autoPromptEnabled,autoPromptQuestionDisplay:se.autoPromptQuestionDisplay,autoPromptClickTelemetry:se.autoPromptClickTelemetry,allowFeedback:se.allowFeedback,provideCitations:se.provideCitations,onFeedback:Ye,onRetryMessage:xe,onRefreshChat:Qe,onCopyChat:Je,filterCategories:Ke,showFilterStep:Ge,widgetFilter:Ue,onWidgetFilterChange:He,onSynthesizeAssistantMessage:qe,chatFeatures:se.chatFeatures,organizationId:se.organizationId}),g(ho,{ref:We,isDark:ge,primaryColor:se.primaryColor,onToggle:Ce,textColor:se.textColor,headerTextColor:se.headerTextColor,defaultLanguage:se.defaultLanguage||E,isOpen:de,className:de?"hidden":void 0})]})})};function bo(t){const o=r(null),a=r(null);return n(()=>{const e=o.current;if(!e||e.shadowRoot)return;const t=e.attachShadow({mode:"open"}),r=document.createElement("style");r.textContent=":host { all: initial; display: block; }",t.appendChild(r);const n=document.createElement("style");n.textContent='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.chat-widget-root{--cw-primary:#1d4ed8;--cw-primary-hover:#1e40af;--cw-status-success:160 84% 39%;--cw-status-success-bg:152 81% 96%;--cw-status-warning:35 100% 50%;--cw-status-warning-bg:34 100% 95%;--cw-status-error:350 89% 60%;--cw-status-error-bg:356 100% 97%;--cw-status-info:199 89% 48%;--cw-status-info-bg:204 100% 97%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.chat-widget-root.dark{--cw-status-success:158 64% 52%;--cw-status-success-bg:152 36% 14%;--cw-status-warning:38 92% 60%;--cw-status-warning-bg:36 33% 14%;--cw-status-error:350 89% 65%;--cw-status-error-bg:356 33% 16%;--cw-status-info:199 89% 58%;--cw-status-info-bg:204 33% 14%}.\\!container{width:100%!important}.container{width:100%}@media (min-width:640px){.\\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width:768px){.\\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width:1024px){.\\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width:1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width:1536px){.\\!container{max-width:1536px!important}.container{max-width:1536px}}#chat-widget-root .chat-widget-root *{box-sizing:border-box;margin:0;padding:0}#chat-widget-root .chat-messages::-webkit-scrollbar{width:6px}#chat-widget-root .chat-messages::-webkit-scrollbar-track{background:transparent}#chat-widget-root .chat-messages::-webkit-scrollbar-thumb{background:rgba(156,163,175,.5);border-radius:10px}#chat-widget-root .chat-messages::-webkit-scrollbar-thumb:hover{background:rgba(156,163,175,.7)}#chat-widget-root .dark .chat-messages::-webkit-scrollbar-thumb{background:rgba(75,85,99,.5)}#chat-widget-root .dark .chat-messages::-webkit-scrollbar-thumb:hover{background:rgba(75,85,99,.7)}#chat-widget-root .sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}#chat-widget-root .pointer-events-none{pointer-events:none}#chat-widget-root .visible{visibility:visible}#chat-widget-root .collapse{visibility:collapse}#chat-widget-root .static{position:static}#chat-widget-root .fixed{position:fixed}#chat-widget-root .absolute{position:absolute}#chat-widget-root .relative{position:relative}#chat-widget-root .sticky{position:sticky}#chat-widget-root .inset-0{inset:0}#chat-widget-root .-top-8{top:-2rem}#chat-widget-root .bottom-0{bottom:0}#chat-widget-root .bottom-5{bottom:1.25rem}#chat-widget-root .bottom-full{bottom:100%}#chat-widget-root .left-0{left:0}#chat-widget-root .left-1\\/2{left:50%}#chat-widget-root .left-5{left:1.25rem}#chat-widget-root .right-0{right:0}#chat-widget-root .right-5{right:1.25rem}#chat-widget-root .top-0{top:0}#chat-widget-root .top-1\\/2{top:50%}#chat-widget-root .top-5{top:1.25rem}#chat-widget-root .top-full{top:100%}#chat-widget-root .isolate{isolation:isolate}#chat-widget-root .z-10{z-index:10}#chat-widget-root .z-50{z-index:50}#chat-widget-root .z-\\[60\\]{z-index:60}#chat-widget-root .z-\\[70\\]{z-index:70}#chat-widget-root .z-\\[71\\]{z-index:71}#chat-widget-root .z-\\[999999\\]{z-index:999999}#chat-widget-root .z-\\[9999\\]{z-index:9999}#chat-widget-root .m-0{margin:0}#chat-widget-root .mx-2{margin-left:.5rem;margin-right:.5rem}#chat-widget-root .mx-3{margin-left:.75rem;margin-right:.75rem}#chat-widget-root .my-3{margin-bottom:.75rem;margin-top:.75rem}#chat-widget-root .my-4{margin-bottom:1rem;margin-top:1rem}#chat-widget-root .-mb-px{margin-bottom:-1px}#chat-widget-root .mb-1{margin-bottom:.25rem}#chat-widget-root .mb-1\\.5{margin-bottom:.375rem}#chat-widget-root .mb-2{margin-bottom:.5rem}#chat-widget-root .mb-3{margin-bottom:.75rem}#chat-widget-root .mb-4{margin-bottom:1rem}#chat-widget-root .mb-5{margin-bottom:1.25rem}#chat-widget-root .ml-1{margin-left:.25rem}#chat-widget-root .ms-0\\.5{margin-inline-start:.125rem}#chat-widget-root .mt-0\\.5{margin-top:.125rem}#chat-widget-root .mt-1{margin-top:.25rem}#chat-widget-root .mt-1\\.5{margin-top:.375rem}#chat-widget-root .mt-2{margin-top:.5rem}#chat-widget-root .mt-3{margin-top:.75rem}#chat-widget-root .mt-4{margin-top:1rem}#chat-widget-root .block{display:block}#chat-widget-root .inline-block{display:inline-block}#chat-widget-root .inline{display:inline}#chat-widget-root .flex{display:flex}#chat-widget-root .inline-flex{display:inline-flex}#chat-widget-root .table{display:table}#chat-widget-root .grid{display:grid}#chat-widget-root .hidden{display:none}#chat-widget-root .h-1\\.5{height:.375rem}#chat-widget-root .h-10{height:2.5rem}#chat-widget-root .h-11{height:2.75rem}#chat-widget-root .h-12{height:3rem}#chat-widget-root .h-16{height:4rem}#chat-widget-root .h-2{height:.5rem}#chat-widget-root .h-3{height:.75rem}#chat-widget-root .h-3\\.5{height:.875rem}#chat-widget-root .h-4{height:1rem}#chat-widget-root .h-5{height:1.25rem}#chat-widget-root .h-6{height:1.5rem}#chat-widget-root .h-7{height:1.75rem}#chat-widget-root .h-8{height:2rem}#chat-widget-root .h-\\[650px\\]{height:650px}#chat-widget-root .h-auto{height:auto}#chat-widget-root .h-full{height:100%}#chat-widget-root .h-px{height:1px}#chat-widget-root .max-h-\\[85vh\\]{max-height:85vh}#chat-widget-root .min-h-0{min-height:0}#chat-widget-root .min-h-\\[48px\\]{min-height:48px}#chat-widget-root .w-1\\.5{width:.375rem}#chat-widget-root .w-10{width:2.5rem}#chat-widget-root .w-11{width:2.75rem}#chat-widget-root .w-12{width:3rem}#chat-widget-root .w-16{width:4rem}#chat-widget-root .w-2{width:.5rem}#chat-widget-root .w-3{width:.75rem}#chat-widget-root .w-3\\.5{width:.875rem}#chat-widget-root .w-4{width:1rem}#chat-widget-root .w-44{width:11rem}#chat-widget-root .w-5{width:1.25rem}#chat-widget-root .w-6{width:1.5rem}#chat-widget-root .w-7{width:1.75rem}#chat-widget-root .w-8{width:2rem}#chat-widget-root .w-80{width:20rem}#chat-widget-root .w-96{width:24rem}#chat-widget-root .w-\\[380px\\]{width:380px}#chat-widget-root .w-full{width:100%}#chat-widget-root .min-w-0{min-width:0}#chat-widget-root .min-w-\\[60px\\]{min-width:60px}#chat-widget-root .min-w-full{min-width:100%}#chat-widget-root .max-w-\\[75\\%\\]{max-width:75%}#chat-widget-root .max-w-\\[92vw\\]{max-width:92vw}#chat-widget-root .max-w-full{max-width:100%}#chat-widget-root .max-w-none{max-width:none}#chat-widget-root .max-w-sm{max-width:24rem}#chat-widget-root .max-w-xs{max-width:20rem}#chat-widget-root .flex-1{flex:1 1 0%}#chat-widget-root .flex-shrink-0,#chat-widget-root .shrink-0{flex-shrink:0}#chat-widget-root .grow{flex-grow:1}#chat-widget-root .border-collapse{border-collapse:collapse}#chat-widget-root .-translate-x-1\\/2{--tw-translate-x:-50%}#chat-widget-root .-translate-x-1\\/2,#chat-widget-root .-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .-translate-y-1\\/2{--tw-translate-y:-50%}#chat-widget-root .-rotate-90{--tw-rotate:-90deg}#chat-widget-root .-rotate-90,#chat-widget-root .rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .rotate-180{--tw-rotate:180deg}#chat-widget-root .rotate-90{--tw-rotate:90deg}#chat-widget-root .rotate-90,#chat-widget-root .scale-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .scale-0{--tw-scale-x:0;--tw-scale-y:0}#chat-widget-root .scale-100{--tw-scale-x:1;--tw-scale-y:1}#chat-widget-root .scale-100,#chat-widget-root .scale-110{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .scale-110{--tw-scale-x:1.1;--tw-scale-y:1.1}#chat-widget-root .scale-125{--tw-scale-x:1.25;--tw-scale-y:1.25}#chat-widget-root .scale-125,#chat-widget-root .scale-95{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .scale-95{--tw-scale-x:.95;--tw-scale-y:.95}#chat-widget-root .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}#chat-widget-root .animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}#chat-widget-root .animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}#chat-widget-root .animate-spin{animation:spin 1s linear infinite}#chat-widget-root .cursor-ew-resize{cursor:ew-resize}#chat-widget-root .cursor-nesw-resize{cursor:nesw-resize}#chat-widget-root .cursor-not-allowed{cursor:not-allowed}#chat-widget-root .cursor-ns-resize{cursor:ns-resize}#chat-widget-root .cursor-nwse-resize{cursor:nwse-resize}#chat-widget-root .cursor-pointer{cursor:pointer}#chat-widget-root .resize-none{resize:none}#chat-widget-root .resize{resize:both}#chat-widget-root .list-decimal{list-style-type:decimal}#chat-widget-root .list-disc{list-style-type:disc}#chat-widget-root .list-none{list-style-type:none}#chat-widget-root .flex-row{flex-direction:row}#chat-widget-root .flex-row-reverse{flex-direction:row-reverse}#chat-widget-root .flex-col{flex-direction:column}#chat-widget-root .flex-wrap{flex-wrap:wrap}#chat-widget-root .items-start{align-items:flex-start}#chat-widget-root .items-end{align-items:flex-end}#chat-widget-root .items-center{align-items:center}#chat-widget-root .justify-start{justify-content:flex-start}#chat-widget-root .justify-end{justify-content:flex-end}#chat-widget-root .justify-center{justify-content:center}#chat-widget-root .justify-between{justify-content:space-between}#chat-widget-root .gap-0{gap:0}#chat-widget-root .gap-0\\.5{gap:.125rem}#chat-widget-root .gap-1{gap:.25rem}#chat-widget-root .gap-1\\.5{gap:.375rem}#chat-widget-root .gap-2{gap:.5rem}#chat-widget-root .gap-2\\.5{gap:.625rem}#chat-widget-root .gap-3{gap:.75rem}#chat-widget-root .gap-4{gap:1rem}#chat-widget-root .gap-6{gap:1.5rem}#chat-widget-root :is(.space-y-1>:not([hidden])~:not([hidden])){--tw-space-y-reverse:0;margin-bottom:calc(.25rem*var(--tw-space-y-reverse));margin-top:calc(.25rem*(1 - var(--tw-space-y-reverse)))}#chat-widget-root :is(.space-y-2>:not([hidden])~:not([hidden])){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}#chat-widget-root :is(.space-y-4>:not([hidden])~:not([hidden])){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}#chat-widget-root .overflow-hidden{overflow:hidden}#chat-widget-root .overflow-visible{overflow:visible}#chat-widget-root .overflow-x-auto{overflow-x:auto}#chat-widget-root .overflow-y-auto{overflow-y:auto}#chat-widget-root .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#chat-widget-root .whitespace-nowrap{white-space:nowrap}#chat-widget-root .whitespace-pre-wrap{white-space:pre-wrap}#chat-widget-root .break-words{overflow-wrap:break-word}#chat-widget-root .break-all{word-break:break-all}#chat-widget-root .rounded{border-radius:.25rem}#chat-widget-root .rounded-2xl{border-radius:1rem}#chat-widget-root .rounded-3xl{border-radius:1.5rem}#chat-widget-root .rounded-full{border-radius:9999px}#chat-widget-root .rounded-lg{border-radius:.5rem}#chat-widget-root .rounded-md{border-radius:.375rem}#chat-widget-root .rounded-xl{border-radius:.75rem}#chat-widget-root .rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}#chat-widget-root .rounded-tl-sm{border-top-left-radius:.125rem}#chat-widget-root .rounded-tr-sm{border-top-right-radius:.125rem}#chat-widget-root .border{border-width:1px}#chat-widget-root .border-0{border-width:0}#chat-widget-root .border-b{border-bottom-width:1px}#chat-widget-root .border-l-4{border-left-width:4px}#chat-widget-root .border-t{border-top-width:1px}#chat-widget-root .border-t-2{border-top-width:2px}#chat-widget-root .border-dotted{border-style:dotted}#chat-widget-root .border-none{border-style:none}#chat-widget-root .\\!border-status-error{border-color:hsl(var(--cw-status-error))!important}#chat-widget-root .border-amber-200{--tw-border-opacity:1;border-color:rgb(253 230 138/var(--tw-border-opacity,1))}#chat-widget-root .border-amber-700\\/50{border-color:rgba(180,83,9,.5)}#chat-widget-root .border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}#chat-widget-root .border-blue-700\\/50{border-color:rgba(29,78,216,.5)}#chat-widget-root .border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity,1))}#chat-widget-root .border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}#chat-widget-root .border-gray-200\\/60{border-color:rgba(229,231,235,.6)}#chat-widget-root .border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}#chat-widget-root .border-gray-600{--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity,1))}#chat-widget-root .border-gray-700{--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity,1))}#chat-widget-root .border-gray-700\\/50{border-color:rgba(55,65,81,.5)}#chat-widget-root .border-transparent{border-color:transparent}#chat-widget-root .bg-amber-50{--tw-bg-opacity:1;background-color:rgb(255 251 235/var(--tw-bg-opacity,1))}#chat-widget-root .bg-amber-900\\/40{background-color:rgba(120,53,15,.4)}#chat-widget-root .bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}#chat-widget-root .bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}#chat-widget-root .bg-blue-900\\/30{background-color:rgba(30,58,138,.3)}#chat-widget-root .bg-current{background-color:currentColor}#chat-widget-root .bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}#chat-widget-root .bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}#chat-widget-root .bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}#chat-widget-root .bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}#chat-widget-root .bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}#chat-widget-root .bg-gray-700\\/50{background-color:rgba(55,65,81,.5)}#chat-widget-root .bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}#chat-widget-root .bg-gray-800\\/50{background-color:rgba(31,41,55,.5)}#chat-widget-root .bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}#chat-widget-root .bg-green-200{--tw-bg-opacity:1;background-color:rgb(187 247 208/var(--tw-bg-opacity,1))}#chat-widget-root .bg-orange-200{--tw-bg-opacity:1;background-color:rgb(254 215 170/var(--tw-bg-opacity,1))}#chat-widget-root .bg-pink-200{--tw-bg-opacity:1;background-color:rgb(251 207 232/var(--tw-bg-opacity,1))}#chat-widget-root .bg-red-200{--tw-bg-opacity:1;background-color:rgb(254 202 202/var(--tw-bg-opacity,1))}#chat-widget-root .bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}#chat-widget-root .bg-slate-50\\/50{background-color:rgba(248,250,252,.5)}#chat-widget-root .bg-slate-800\\/50{background-color:rgba(30,41,59,.5)}#chat-widget-root .bg-transparent{background-color:transparent}#chat-widget-root .bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}#chat-widget-root .bg-white\\/10{background-color:hsla(0,0%,100%,.1)}#chat-widget-root .bg-white\\/20{background-color:hsla(0,0%,100%,.2)}#chat-widget-root .bg-yellow-200{--tw-bg-opacity:1;background-color:rgb(254 240 138/var(--tw-bg-opacity,1))}#chat-widget-root .bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}#chat-widget-root .bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}#chat-widget-root .from-gray-50\\/50{--tw-gradient-from:rgba(249,250,251,.5) var(--tw-gradient-from-position);--tw-gradient-to:rgba(249,250,251,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}#chat-widget-root .from-white\\/0{--tw-gradient-from:hsla(0,0%,100%,0) var(--tw-gradient-from-position);--tw-gradient-to:hsla(0,0%,100%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}#chat-widget-root .from-white\\/10{--tw-gradient-from:hsla(0,0%,100%,.1) var(--tw-gradient-from-position);--tw-gradient-to:hsla(0,0%,100%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}#chat-widget-root .from-yellow-200{--tw-gradient-from:#fef08a var(--tw-gradient-from-position);--tw-gradient-to:hsla(53,98%,77%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}#chat-widget-root .via-white\\/5{--tw-gradient-to:hsla(0,0%,100%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),hsla(0,0%,100%,.05) var(--tw-gradient-via-position),var(--tw-gradient-to)}#chat-widget-root .to-white{--tw-gradient-to:#fff var(--tw-gradient-to-position)}#chat-widget-root .to-white\\/10{--tw-gradient-to:hsla(0,0%,100%,.1) var(--tw-gradient-to-position)}#chat-widget-root .to-yellow-400{--tw-gradient-to:#facc15 var(--tw-gradient-to-position)}#chat-widget-root .object-contain{-o-object-fit:contain;object-fit:contain}#chat-widget-root .p-0{padding:0}#chat-widget-root .p-0\\.5{padding:.125rem}#chat-widget-root .p-3{padding:.75rem}#chat-widget-root .p-5{padding:1.25rem}#chat-widget-root .p-6{padding:1.5rem}#chat-widget-root .p-8{padding:2rem}#chat-widget-root .px-1{padding-left:.25rem;padding-right:.25rem}#chat-widget-root .px-2{padding-left:.5rem;padding-right:.5rem}#chat-widget-root .px-2\\.5{padding-left:.625rem;padding-right:.625rem}#chat-widget-root .px-3{padding-left:.75rem;padding-right:.75rem}#chat-widget-root .px-4{padding-left:1rem;padding-right:1rem}#chat-widget-root .px-5{padding-left:1.25rem;padding-right:1.25rem}#chat-widget-root .py-1{padding-bottom:.25rem;padding-top:.25rem}#chat-widget-root .py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}#chat-widget-root .py-12{padding-bottom:3rem;padding-top:3rem}#chat-widget-root .py-2{padding-bottom:.5rem;padding-top:.5rem}#chat-widget-root .py-2\\.5{padding-bottom:.625rem;padding-top:.625rem}#chat-widget-root .py-3{padding-bottom:.75rem;padding-top:.75rem}#chat-widget-root .py-3\\.5{padding-bottom:.875rem;padding-top:.875rem}#chat-widget-root .py-4{padding-bottom:1rem;padding-top:1rem}#chat-widget-root .pb-1{padding-bottom:.25rem}#chat-widget-root .pb-2{padding-bottom:.5rem}#chat-widget-root .pl-1{padding-left:.25rem}#chat-widget-root .pl-2{padding-left:.5rem}#chat-widget-root .pl-4{padding-left:1rem}#chat-widget-root .pl-\\[50px\\]{padding-left:50px}#chat-widget-root .pr-1{padding-right:.25rem}#chat-widget-root .pt-1{padding-top:.25rem}#chat-widget-root .text-left{text-align:left}#chat-widget-root .text-center{text-align:center}#chat-widget-root .text-right{text-align:right}#chat-widget-root .align-text-bottom{vertical-align:text-bottom}#chat-widget-root .font-sans{font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}#chat-widget-root .text-2xl{font-size:1.5rem;line-height:2rem}#chat-widget-root .text-\\[10px\\]{font-size:10px}#chat-widget-root .text-base{font-size:1rem;line-height:1.5rem}#chat-widget-root .text-chip{font-size:11px;letter-spacing:0;line-height:1.4}#chat-widget-root .text-h4{font-size:18px;letter-spacing:0;line-height:1.3}#chat-widget-root .text-lg{font-size:1.125rem;line-height:1.75rem}#chat-widget-root .text-sm{font-size:.875rem;line-height:1.25rem}#chat-widget-root .text-xl{font-size:1.25rem;line-height:1.75rem}#chat-widget-root .text-xs{font-size:.75rem;line-height:1rem}#chat-widget-root .font-bold{font-weight:700}#chat-widget-root .font-medium{font-weight:500}#chat-widget-root .font-semibold{font-weight:600}#chat-widget-root .uppercase{text-transform:uppercase}#chat-widget-root .lowercase{text-transform:lowercase}#chat-widget-root .italic{font-style:italic}#chat-widget-root .tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}#chat-widget-root .leading-5{line-height:1.25rem}#chat-widget-root .leading-none{line-height:1}#chat-widget-root .leading-normal{line-height:1.5}#chat-widget-root .leading-relaxed{line-height:1.625}#chat-widget-root .leading-snug{line-height:1.375}#chat-widget-root .tracking-wide{letter-spacing:.025em}#chat-widget-root .text-\\[\\#4A5568\\]{--tw-text-opacity:1;color:rgb(74 85 104/var(--tw-text-opacity,1))}#chat-widget-root .text-amber-200{--tw-text-opacity:1;color:rgb(253 230 138/var(--tw-text-opacity,1))}#chat-widget-root .text-amber-800{--tw-text-opacity:1;color:rgb(146 64 14/var(--tw-text-opacity,1))}#chat-widget-root .text-current{color:currentColor}#chat-widget-root .text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-200{--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-500\\/80{color:hsla(220,9%,46%,.8)}#chat-widget-root .text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}#chat-widget-root .text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}#chat-widget-root .text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}#chat-widget-root .text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}#chat-widget-root .text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity,1))}#chat-widget-root .text-status-error{color:hsl(var(--cw-status-error))}#chat-widget-root .text-status-success{color:hsl(var(--cw-status-success))}#chat-widget-root .text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}#chat-widget-root .text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}#chat-widget-root .underline{text-decoration-line:underline}#chat-widget-root .no-underline{text-decoration-line:none}#chat-widget-root .placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(156 163 175/var(--tw-placeholder-opacity,1))}#chat-widget-root .placeholder-gray-400::placeholder{--tw-placeholder-opacity:1;color:rgb(156 163 175/var(--tw-placeholder-opacity,1))}#chat-widget-root .placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(107 114 128/var(--tw-placeholder-opacity,1))}#chat-widget-root .placeholder-gray-500::placeholder{--tw-placeholder-opacity:1;color:rgb(107 114 128/var(--tw-placeholder-opacity,1))}#chat-widget-root .opacity-0{opacity:0}#chat-widget-root .opacity-50{opacity:.5}#chat-widget-root .opacity-60{opacity:.6}#chat-widget-root .opacity-70{opacity:.7}#chat-widget-root .opacity-75{opacity:.75}#chat-widget-root .opacity-80{opacity:.8}#chat-widget-root .shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}#chat-widget-root .shadow,#chat-widget-root .shadow-2xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#chat-widget-root .shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)}#chat-widget-root .shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}#chat-widget-root .shadow-lg,#chat-widget-root .shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#chat-widget-root .shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}#chat-widget-root .shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}#chat-widget-root .shadow-sm,#chat-widget-root .shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#chat-widget-root .shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}#chat-widget-root .shadow-black\\/20{--tw-shadow-color:rgba(0,0,0,.2);--tw-shadow:var(--tw-shadow-colored)}#chat-widget-root .shadow-gray-200\\/80{--tw-shadow-color:rgba(229,231,235,.8);--tw-shadow:var(--tw-shadow-colored)}#chat-widget-root .outline-none{outline:2px solid transparent;outline-offset:2px}#chat-widget-root .outline{outline-style:solid}#chat-widget-root .ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)}#chat-widget-root .ring,#chat-widget-root .ring-2{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}#chat-widget-root .ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}#chat-widget-root .ring-blue-100{--tw-ring-opacity:1;--tw-ring-color:rgb(219 234 254/var(--tw-ring-opacity,1))}#chat-widget-root .ring-blue-300{--tw-ring-opacity:1;--tw-ring-color:rgb(147 197 253/var(--tw-ring-opacity,1))}#chat-widget-root .ring-white{--tw-ring-opacity:1;--tw-ring-color:rgb(255 255 255/var(--tw-ring-opacity,1))}#chat-widget-root .blur{--tw-blur:blur(8px)}#chat-widget-root .blur,#chat-widget-root .drop-shadow{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#chat-widget-root .drop-shadow{--tw-drop-shadow:drop-shadow(0 1px 2px rgba(0,0,0,.1)) drop-shadow(0 1px 1px rgba(0,0,0,.06))}#chat-widget-root .drop-shadow-md{--tw-drop-shadow:drop-shadow(0 4px 3px rgba(0,0,0,.07)) drop-shadow(0 2px 2px rgba(0,0,0,.06))}#chat-widget-root .drop-shadow-md,#chat-widget-root .drop-shadow-sm{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#chat-widget-root .drop-shadow-sm{--tw-drop-shadow:drop-shadow(0 1px 1px rgba(0,0,0,.05))}#chat-widget-root .grayscale-\\[0\\.3\\]{--tw-grayscale:grayscale(0.3)}#chat-widget-root .filter,#chat-widget-root .grayscale-\\[0\\.3\\]{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#chat-widget-root .backdrop-blur-sm{--tw-backdrop-blur:blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}#chat-widget-root .transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}#chat-widget-root .transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}#chat-widget-root .transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}#chat-widget-root .transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}#chat-widget-root .transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}#chat-widget-root .duration-150{transition-duration:.15s}#chat-widget-root .duration-200{transition-duration:.2s}#chat-widget-root .duration-300{transition-duration:.3s}#chat-widget-root .duration-500{transition-duration:.5s}#chat-widget-root :is(#chat-widget-root .animate-in){animation:slideIn .3s ease-out}#chat-widget-root :is(#chat-widget-root .transition-all){transition-duration:.3s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}#chat-widget-root .\\[font-family\\:inherit\\]{font-family:inherit}#chat-widget-root .placeholder\\:text-\\[\\#8C8C8C\\]::-moz-placeholder{--tw-text-opacity:1;color:rgb(140 140 140/var(--tw-text-opacity,1))}#chat-widget-root .placeholder\\:text-\\[\\#8C8C8C\\]::placeholder{--tw-text-opacity:1;color:rgb(140 140 140/var(--tw-text-opacity,1))}#chat-widget-root .placeholder\\:text-\\[\\#A2A9B2\\]::-moz-placeholder{--tw-text-opacity:1;color:rgb(162 169 178/var(--tw-text-opacity,1))}#chat-widget-root .placeholder\\:text-\\[\\#A2A9B2\\]::placeholder{--tw-text-opacity:1;color:rgb(162 169 178/var(--tw-text-opacity,1))}#chat-widget-root .hover\\:scale-105:hover{--tw-scale-x:1.05;--tw-scale-y:1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .hover\\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .hover\\:scale-\\[1\\.02\\]:hover{--tw-scale-x:1.02;--tw-scale-y:1.02;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .hover\\:border-blue-400:hover{--tw-border-opacity:1;border-color:rgb(96 165 250/var(--tw-border-opacity,1))}#chat-widget-root .hover\\:border-blue-600:hover{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}#chat-widget-root .hover\\:bg-blue-50:hover{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}#chat-widget-root .hover\\:bg-blue-500\\/20:hover{background-color:rgba(59,130,246,.2)}#chat-widget-root .hover\\:bg-blue-900\\/50:hover{background-color:rgba(30,58,138,.5)}#chat-widget-root .hover\\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}#chat-widget-root .hover\\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}#chat-widget-root .hover\\:bg-gray-600:hover{--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}#chat-widget-root .hover\\:bg-gray-700:hover{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}#chat-widget-root .hover\\:bg-red-600:hover{--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity,1))}#chat-widget-root .hover\\:bg-transparent:hover{background-color:transparent}#chat-widget-root .hover\\:text-blue-500:hover{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}#chat-widget-root .hover\\:text-gray-200:hover{--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}#chat-widget-root .hover\\:text-gray-300:hover{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}#chat-widget-root .hover\\:text-gray-600:hover{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}#chat-widget-root .hover\\:text-gray-700:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}#chat-widget-root .hover\\:underline:hover{text-decoration-line:underline}#chat-widget-root .hover\\:opacity-80:hover{opacity:.8}#chat-widget-root .hover\\:opacity-90:hover{opacity:.9}#chat-widget-root .hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#chat-widget-root .hover\\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#chat-widget-root .hover\\:grayscale-0:hover{--tw-grayscale:grayscale(0);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#chat-widget-root .focus\\:\\!border-status-error:focus{border-color:hsl(var(--cw-status-error))!important}#chat-widget-root .focus\\:border-\\[\\#5A6069\\]:focus{--tw-border-opacity:1;border-color:rgb(90 96 105/var(--tw-border-opacity,1))}#chat-widget-root .focus\\:border-\\[\\#B0B0B0\\]:focus{--tw-border-opacity:1;border-color:rgb(176 176 176/var(--tw-border-opacity,1))}#chat-widget-root .focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}#chat-widget-root .focus\\:ring-0:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}#chat-widget-root .focus\\:ring-1:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}#chat-widget-root .focus\\:ring-gray-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(209 213 219/var(--tw-ring-opacity,1))}#chat-widget-root .focus\\:ring-gray-600:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(75 85 99/var(--tw-ring-opacity,1))}#chat-widget-root .focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}#chat-widget-root .focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}#chat-widget-root .focus-visible\\:ring-white\\/40:focus-visible{--tw-ring-color:hsla(0,0%,100%,.4)}#chat-widget-root .active\\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .active\\:scale-\\[0\\.97\\]:active{--tw-scale-x:0.97;--tw-scale-y:0.97;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .active\\:scale-\\[0\\.98\\]:active{--tw-scale-x:0.98;--tw-scale-y:0.98;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .active\\:scale-\\[0\\.99\\]:active{--tw-scale-x:0.99;--tw-scale-y:0.99;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .active\\:outline-none:active{outline:2px solid transparent;outline-offset:2px}#chat-widget-root .active\\:ring-0:active{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}#chat-widget-root .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}#chat-widget-root .disabled\\:opacity-40:disabled{opacity:.4}#chat-widget-root .disabled\\:opacity-50:disabled{opacity:.5}#chat-widget-root .disabled\\:shadow-none:disabled{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#chat-widget-root :is(.group:hover .group-hover\\:scale-100){--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root :is(.group:hover .group-hover\\:opacity-100){opacity:1}#chat-widget-root .dark\\:text-gray-300:is(.dark *){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}#chat-widget-root .dark\\:text-gray-400:is(.dark *){--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}#chat-widget-root .rtl\\:rounded-tl-2xl:where([dir=rtl],[dir=rtl] *){border-top-left-radius:1rem}#chat-widget-root .rtl\\:rounded-tr-sm:where([dir=rtl],[dir=rtl] *){border-top-right-radius:.125rem}#chat-widget-root .\\[\\&\\:first-child\\]\\:\\!mt-0:first-child{margin-top:0!important}#chat-widget-root :is(.\\[\\&\\>\\*\\:first-child\\]\\:\\!mt-0>:first-child){margin-top:0!important}#chat-widget-root :is(.\\[\\&\\>\\*\\:last-child\\]\\:\\!mb-0>:last-child){margin-bottom:0!important}\n.chat-widget-root{position:fixed;z-index:999999}.chat-widget-container{color:var(--cw-text-color,inherit);font-family:var(\n --cw-font-family,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif\n )}#chat-widget-root .chat-messages p{overflow-wrap:anywhere;word-break:break-word}textarea#chat-widget-input::-moz-placeholder{border:none;line-height:48px;outline:none}textarea#chat-widget-input::placeholder{border:none;line-height:48px;outline:none}textarea#chat-widget-input{border:none;line-height:48px;outline:none}@keyframes slideIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes bounce{0%,to{transform:translateY(0)}50%{transform:translateY(-5px)}}#chat-widget-root .scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}#chat-widget-root .scrollbar-hide::-webkit-scrollbar{display:none}#chat-widget-root .slim-scrollbar-x{scrollbar-width:thin}#chat-widget-root .slim-scrollbar-x::-webkit-scrollbar{height:3px!important}#chat-widget-root .slim-scrollbar-x::-webkit-scrollbar-track{background:transparent!important}#chat-widget-root .slim-scrollbar-x::-webkit-scrollbar-thumb{background:#d1d5db!important;border-radius:2px!important}#chat-widget-root .slim-scrollbar-x::-webkit-scrollbar-thumb:hover{background:#9ca3af!important}@media print{.chat-widget-root{display:none!important}}',t.appendChild(n);const i=document.createElement("div");i.id="chat-widget-mount",t.appendChild(i),a.current=u(i)},[]),n(()=>{a.current?.render(e.createElement(mo,t))}),n(()=>()=>{const e=a.current;a.current=null,queueMicrotask(()=>e?.unmount())},[]),g("div",{ref:o,id:"chat-widget-host"})}export{$e as F,Oe as L,bo as S,lt as W,Ae as c,nt as s};
20
+ */let rt=null;function at(e){n(()=>{if(!Ze||!e)return;const t=e.split(",")[0]?.trim();if(!t||ot.has(t))return;if((e=>{const t=e.trim().toLowerCase();return!t||!!et.has(t)||tt.some(e=>t.includes(e))})(t))return void ot.add(t);let o=!0;return(async()=>{try{rt||(rt=import("./chat-widget-webfontloader-BK8fca15.esm.js").then(function(e){return e.w}));const e=await rt,r=e&&"default"in e?e.default:e,a=(e=>e.trim().replace(/\s+/g,"+"))(t);r.load({google:{families:[`${a}:300,400,500,600,700`]},fontactive:e=>{o&&ot.add(e)},fontinactive:e=>{o&&ot.add(e),console.warn(`Warning: failed to load Google Font: ${e}`)}})}catch(e){console.error("Warning: WebFont loader error:",e)}})(),()=>{o=!1}},[e])}function nt(e){return"string"==typeof e&&/^https?:\/\//i.test(e)?e:void 0}const it="__eshalChatWidgetCitationContext",st="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:void 0,lt=st?st[it]||(st[it]=l(null)):l(null);function ct(){return import("./chat-widget-MarkdownRenderer-CBSXpNd6.esm.js")}const dt=d(ct);class ut extends e.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error("[widget] markdown chunk failed to load, showing plain text:",e)}render(){return this.state.failed?this.props.fallback:this.props.children}}const gt=/(```|`[^`]+`|(^|\n)\s{0,3}#{1,6}\s|(^|\n)\s*[-*+]\s|(^|\n)\s*\d+\.\s|(^|\n)\s*>\s|\[[^\]]*\]\([^)]*\)|\*\*|__|~~|(^|\n)\s*\||\[\d+\])/;const ht=({content:e,isDark:t,textColor:o,fontFamily:r,fontSize:a})=>g("p",{className:"leading-relaxed [&:first-child]:!mt-0 whitespace-pre-wrap break-words",style:{color:o||(t?"#f3f4f6":"#1A1A1A"),fontFamily:r||"Inter",fontSize:a||"14px",margin:0,lineHeight:"1.6",padding:0,overflowWrap:"break-word"},children:e}),pt=({content:e,isStreaming:t,isDark:a=!1,isRtl:i=!1,textColor:s,fontFamily:l,fontSize:d,onButtonClick:u,provideCitations:p=!0})=>{const[m,b]=o(""),[f,w]=o(!1),v=r(e),y=r(0),k=r(null),x=r(0);n(()=>{if(e!==v.current){if(v.current=e,y.current>=e.length)return b(e),void w(!1);e.length<m.length&&(y.current=0,b(""))}if(!t)return b(e),w(!1),void(k.current&&cancelAnimationFrame(k.current));w(!0);const o=t=>{if(t-x.current<16)k.current=requestAnimationFrame(o);else if(x.current=t,y.current<e.length){const t=Math.max(2,Math.floor(4*Math.random())),r=Math.min(y.current+t,e.length);b(e.slice(0,r)),y.current=r,k.current=requestAnimationFrame(o)}else w(!1)};return k.current=requestAnimationFrame(o),()=>{k.current&&cancelAnimationFrame(k.current)}},[e,t]);const C="string"==typeof(S=m)&&0!==S.length&&gt.test(S);var S;return h("div",{className:"relative",dir:"auto",style:{textAlign:i?"right":"left",color:s||(a?"#f3f4f6":"#1A1A1A"),fontFamily:l||"Inter",fontSize:d||"14px",margin:0,padding:0},children:[C?g(ut,{fallback:g(ht,{content:m,isDark:a,textColor:s,fontFamily:l,fontSize:d}),children:g(c,{fallback:g(ht,{content:m,isDark:a,textColor:s,fontFamily:l,fontSize:d}),children:g(dt,{content:m,isStreaming:t,isDark:a,isRtl:i,textColor:s,fontFamily:l,fontSize:d,onButtonClick:u,provideCitations:p})})}):g(ht,{content:m,isDark:a,textColor:s,fontFamily:l,fontSize:d}),f&&g("span",{className:"inline-block w-1.5 h-4 bg-blue-500 ms-0.5 animate-pulse align-text-bottom",style:{animationDuration:"0.8s"}})]})},mt=({isDark:e,t:t})=>h("div",{className:"flex gap-1.5",role:"status","aria-label":t("agentIsTyping"),children:[g("div",{className:`w-2 h-2 rounded-full ${e?"bg-gray-500":"bg-gray-400"} animate-bounce`,style:{animationDelay:"0ms"},"aria-hidden":"true"}),g("div",{className:`w-2 h-2 rounded-full ${e?"bg-gray-500":"bg-gray-400"} animate-bounce`,style:{animationDelay:"150ms"},"aria-hidden":"true"}),g("div",{className:`w-2 h-2 rounded-full ${e?"bg-gray-500":"bg-gray-400"} animate-bounce`,style:{animationDelay:"300ms"},"aria-hidden":"true"})]}),bt=({question:e,options:t,onDecision:o,disabled:r,isDark:a=!1})=>h("div",{className:"mt-3 p-3 rounded-lg border "+(a?"bg-blue-900/30 border-blue-700/50":"bg-blue-50 border-blue-200"),children:[g("p",{className:"text-sm font-medium mb-2 "+(a?"text-gray-100":"text-gray-900"),children:e}),g("div",{className:"space-y-2",children:t.map(e=>g("button",{onClick:()=>o(e.id,e.label),disabled:r,className:"w-full text-left px-3 py-2 text-sm rounded transition-all "+(a?"bg-gray-800 border border-gray-700 hover:bg-blue-900/50 hover:border-blue-600 disabled:opacity-50 disabled:cursor-not-allowed":"bg-white border border-gray-300 hover:bg-blue-50 hover:border-blue-400 disabled:opacity-50 disabled:cursor-not-allowed"),children:e.label},e.id))})]});function ft({content:e,isDark:t}){const[r,n]=o(!1),i=a(()=>{e&&(navigator.clipboard?.writeText(e).catch(()=>{}),n(!0),setTimeout(()=>n(!1),1500))},[e]);return g("button",{type:"button",onClick:i,className:"p-0.5 rounded transition-colors "+(t?"text-gray-500 hover:text-gray-300":"text-gray-400 hover:text-gray-600"),style:{border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",cursor:"pointer"},"aria-label":r?"Copied":"Copy message",title:r?"Copied":"Copy message",children:r?g(je,{className:"w-3 h-3 text-green-500"}):g(De,{className:"w-3 h-3"})})}const wt=({message:t,formatTime:n,isDark:i,primaryColor:s,agentMessageBubbleColor:l,resolvedAgentBubbleColor:c,textColor:d,assistantTextColor:u,fontFamily:m,agentMessageBubbleFontFamily:b,agentMessageBubbleFontSize:f,fontSize:w,isRtl:v,onDecision:y,companyLogo:k,conciergeName:x,companyName:C,apiBaseUrl:S,getAuthToken:M,onPromptSuggestionClick:P,allowFeedback:z=!0,provideCitations:T=!0,onFeedback:F,headerTextColor:L,t:N})=>{const A="string"==typeof t.content?t.content:"",I=t.isProcessing&&(!A||0===A.length),j=J(A,v),[E,B]=o(()=>t?.feedback??null),[R,D]=o(!1),[V,$]=o(null),[O,U]=o(""),H=r(null),q=a(e=>{if(F&&A){if(E===e)return B(null),D(!1),$(null),U(""),void F(A,null);if("like"===e)return B("like"),D(!1),$(null),U(""),void F(A,"like");B(null),$("dislike"),D(!0),U(""),setTimeout(()=>H.current?.focus(),100)}},[E,F,A]),W=a(()=>{F&&A&&V&&(B(V),F(A,V,O.trim()||void 0),D(!1),U(""),$(null))},[F,A,V,O]),_=a(()=>{D(!1),U(""),$(null)},[]),Y=!0===t?.isError,Q=Y?i?"rgba(239,68,68,0.15)":"#fee2e2":null!=c?c:null!=l?l:i?"#1f2937":"#FFFFFF",K=null!=l&&"#ffffff"!==l&&"#FFFFFF"!==l&&"#1f2937"!==l,G=Y?i?"#fca5a5":"#991b1b":null!=u?u:null!=d?d:i?"#f3f4f6":"#1A1A1A",X=null!=b?b:null!=m?m:"Inter",Z=null!=f?f:null!=w?w:"14px";at(X);const{onSourceActivate:ee,downloadingKey:te}=function({apiBaseUrl:t,getAuthToken:o}){const[r,a]=e.useState(null);return{onSourceActivate:e.useCallback(async e=>{if(!e)return;const r=e.url||e.source_id||e.sourceid||e.source_name||"",n=String(e.source_id||e.sourceid||"").startsWith("attachment:"),i="string"==typeof e.url&&e.url.includes("/api/v1/sharepoint/file/"),s="file"===e.source_type||i||n||!(!e.source_id&&!e.sourceid)&&!e.url;if(!s){const t=nt(e.url);if(t)try{window.open(t,"_blank","noopener,noreferrer")}catch{}return}if(t||n){a(r),console.debug("[widget] citation download starting:",{source_id:e.source_id||e.sourceid,source_name:e.source_name,source_type:e.source_type,isAttachment:n,isSharePointProxy:i,isFileLike:s});try{let r;if(n){if(!e.url)throw new Error("attachment has no URL");const t={};if("function"==typeof o){const e=await o();e&&(t.Authorization=`Bearer ${e}`)}r=await fetch(e.url,{method:"GET",headers:t,credentials:"include"})}else if(i){const a=e.url.startsWith("http")?e.url:`${t.replace(/\/$/,"")}${e.url}`,n={};if("function"==typeof o){const e=await o();e&&(n.Authorization=`Bearer ${e}`)}r=await fetch(a,{method:"GET",headers:n,credentials:"include"})}else{const a=`${t.replace(/\/$/,"")}/api/v1/support/file-download`,n={"Content-Type":"application/json"};if("function"==typeof o){const e=await o();e&&(n.Authorization=`Bearer ${e}`)}r=await fetch(a,{method:"POST",headers:n,credentials:"include",body:JSON.stringify({source_id:e.source_id||e.sourceid,file_name:e.url||"",source_name:e.source_name||""})})}if(!r.ok){const e=await r.json().catch(()=>({}));throw new Error(e.details||e.error||r.statusText)}const a=await r.blob(),s=r.headers.get("content-disposition");let l=e.source_name||"download";if(!n){const e=s&&/filename\*?=(?:UTF-8'')?["']?([^"'\s;]+)["']?/i.exec(s);if(e)try{l=decodeURIComponent(e[1].replace(/\\"/g,'"'))}catch{}}const c=document.createElement("a"),d=URL.createObjectURL(a);c.href=d,c.download=l,document.body.appendChild(c),c.click(),c.remove(),URL.revokeObjectURL(d)}catch(e){console.error("[widget] source download failed:",e)}finally{a(null)}}else console.warn("[widget] citation download skipped: apiBaseUrl missing and source is not an attachment (no fallback URL to fetch). Source:",e)},[t,o]),downloadingKey:r}}({apiBaseUrl:S,getAuthToken:M}),oe=e.useMemo(()=>({sources:t.sources||[],sourcesPreliminary:!!t.sourcesPreliminary,onSourceActivate:ee,downloadingKey:te,textColor:G}),[t.sources,t.sourcesPreliminary,ee,te,G]);return g(lt.Provider,{value:oe,children:h("div",{className:"flex gap-3 flex-row animate-in min-w-0",children:[g("div",{className:"flex-shrink-0 mt-1",children:g("div",{className:"w-8 h-8 rounded-full overflow-hidden flex items-center justify-center",style:{backgroundColor:s||"#2563eb"},children:g("div",k?{className:"w-full h-full bg-white/10 flex items-center justify-center",children:g("img",{src:k,alt:x||C||"Assistant avatar",className:"object-contain rounded-full",style:{width:"100%",height:"100%"}})}:{className:"w-full h-full flex items-center justify-center",style:{fontSize:"18px",fontFamily:m||"Inter",color:L||"#FFFFFF"},children:(x||"A").charAt(0).toUpperCase()})})}),h("div",{className:"flex flex-col items-start min-w-0 max-w-[75%]",children:[g("div",{className:"rounded-2xl px-4 py-2.5 shadow-sm border rounded-tl-sm rtl:rounded-tl-2xl rtl:rounded-tr-sm min-w-0 max-w-full overflow-hidden "+(K?"border-transparent":i?"border-gray-700":"border-gray-200"),style:{backgroundColor:Q,color:G,fontFamily:X,fontSize:Z,direction:j?"rtl":"ltr",textAlign:j?"right":"left",...K?{borderColor:`${Q}33`}:{}},children:I?g(mt,{isDark:i,t:N}):g(p,{children:t.requiresDecision&&t.decisionData&&y?h("div",{children:[A&&g("div",{className:"mb-3",children:g(pt,{content:A,isStreaming:t.isProcessing,isDark:i,isRtl:j,textColor:G,fontFamily:X,fontSize:Z,onButtonClick:P,provideCitations:T})}),g(bt,{question:t.decisionData.question,options:t.decisionData.options,onDecision:(e,o)=>y(t.decisionData.decisionId,e,o),disabled:!!t.decisionResponse,isDark:i}),t.decisionResponse&&h("div",{className:"mt-2 text-xs "+(i?"text-gray-400":"text-gray-500"),children:["Selected: ",t.decisionResponse.selectedOption]})]}):A?g(p,{children:g(pt,{content:A,isStreaming:t.isProcessing,isDark:i,isRtl:j,textColor:G,fontFamily:X,fontSize:Z,onButtonClick:P,provideCitations:T})}):null})}),h("div",{className:"flex items-center gap-1.5 mt-1.5 px-1",children:[g("p",{className:"text-xs leading-none "+(i?"text-gray-400":"text-gray-500"),dir:"auto",children:n(t.timestamp)}),!I&&!t.isProcessing&&A&&g(ft,{content:A,isDark:i}),!1!==z&&F&&!I&&!t.isProcessing&&A&&"welcome"!==t.type&&!t.isWelcome&&h("div",{className:"flex items-center gap-0.5 ms-0.5",children:[g("button",{type:"button",onClick:()=>q("like"),className:"p-0.5 rounded transition-colors "+("like"===E||"like"===V?"text-green-500":i?"text-gray-500 hover:text-gray-300":"text-gray-400 hover:text-gray-600"),style:{border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",cursor:"pointer"},"aria-label":"Like",children:g(Je,{className:"w-3 h-3"})}),g("button",{type:"button",onClick:()=>q("dislike"),className:"p-0.5 rounded transition-colors "+("dislike"===E||"dislike"===V?"text-red-500":i?"text-gray-500 hover:text-gray-300":"text-gray-400 hover:text-gray-600"),style:{border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",cursor:"pointer"},"aria-label":"Dislike",children:g(Ge,{className:"w-3 h-3"})})]})]}),R&&"dislike"===V&&h("div",{className:"mt-2 w-full rounded-xl border p-3 shadow "+(i?"bg-gray-800 border-gray-700":"bg-white border-gray-200"),style:{direction:v?"rtl":"ltr"},children:[g("textarea",{ref:H,value:O,onChange:e=>U(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key?(e.preventDefault(),W()):"Escape"===e.key&&(e.preventDefault(),_())},placeholder:N("feedbackPlaceholder"),"aria-label":N("feedbackPlaceholder"),rows:2,className:"w-full resize-none rounded-lg border px-2 py-1.5 text-xs focus:outline-none focus:ring-1 "+(i?"bg-gray-900 border-gray-700 text-gray-100 placeholder-gray-500 focus:ring-gray-600":"bg-white border-gray-200 text-gray-900 placeholder-gray-400 focus:ring-gray-300"),style:{fontFamily:X,textAlign:v?"right":"left"}}),h("div",{className:"flex items-center justify-end gap-1.5 mt-1.5",children:[g("button",{type:"button",onClick:_,className:"text-xs px-2 py-1 rounded transition-colors "+(i?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"),style:{border:"none",background:"transparent",cursor:"pointer"},children:N("cancel")}),g("button",{type:"button",onClick:W,className:"text-xs px-2.5 py-1 rounded text-white transition-opacity hover:opacity-90",style:{backgroundColor:s||"#2563eb",border:"none",cursor:"pointer"},children:N("submit")})]})]})]})]})})},vt=({message:e,formatTime:t,userMessageBoxColor:o,primaryColor:r,resolvedUserMessageColor:a,textColor:n,userTextColor:i,fontFamily:s,userMessageBubbleFontFamily:l,userMessageBubbleFontSize:c,fontSize:d,isDark:u,isRtl:p,t:m,onRetryMessage:b})=>{const f=null!=a?a:null!=o?o:null!=r?r:"#2563eb",w=null!=i?i:null!=n?n:"#FFFFFF",v=null!=l?l:null!=s?s:"Inter",y=null!=c?c:null!=d?d:"14px",k=J("string"==typeof e?.content?e.content:"",p);at(v);const x=Array.isArray(e.attachments)?e.attachments:[];return g("div",{className:"flex gap-3 flex-row-reverse animate-in",children:h("div",{className:"flex flex-col items-end max-w-[75%]",children:[x.length>0&&g("div",{className:"mb-1.5 flex flex-wrap justify-end gap-1.5",children:x.map((e,t)=>String(e.mimeType||"").startsWith("image/")&&e.url?g("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"block rounded-md overflow-hidden",style:{maxWidth:160},title:e.filename,children:g("img",{src:e.url,alt:e.filename||"attachment",style:{maxWidth:160,maxHeight:160,display:"block"}})},e.storageKey||t):h("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs",style:{backgroundColor:u?"#1f2937":"#f3f4f6",color:u?"#e5e7eb":"#374151",border:"1px solid "+(u?"#374151":"#e5e7eb"),maxWidth:200},title:e.filename,children:[g($e,{size:12}),g("span",{className:"truncate",style:{maxWidth:140,direction:"ltr"},children:e.filename})]},e.storageKey||t))}),e.content&&""!==e.content.trim()&&g("div",{className:"rounded-2xl px-4 py-2.5 shadow-lg "+(k?"rounded-tl-sm":"rounded-tr-sm"),dir:"auto",style:{background:`linear-gradient(135deg, ${f} 0%, ${f}dd 100%)`,fontFamily:v,direction:k?"rtl":"ltr",textAlign:k?"right":"left"},children:g("p",{className:"whitespace-pre-wrap break-words",dir:"auto",style:{color:w,fontFamily:v,fontSize:y,lineHeight:"1.5",textAlign:k?"right":"left",overflowWrap:"break-word",margin:0,padding:0},children:e.content})}),h("div",{className:"flex items-center gap-1.5 mt-1.5 px-1",children:[g("p",{className:"text-xs leading-none "+(u?"text-gray-400":"text-gray-500"),dir:"auto",children:t(e.timestamp)}),e.content&&""!==e.content.trim()&&g(ft,{content:e.content,isDark:u})]}),"failed"===e.status&&h("div",{className:"flex items-center gap-1.5 mt-1 px-1","data-testid":"message-failed-state",children:[g("span",{className:"text-xs leading-none",style:{color:"#dc2626"},dir:"auto",children:m("messageNotDelivered")}),"function"==typeof b&&g("button",{type:"button",onClick:()=>b(e),className:"text-xs leading-none font-medium underline",style:{color:"#dc2626"},dir:"auto",children:m("retrySend")})]})]})})},yt=({message:e,isDark:o,primaryColor:r,agentMessageBubbleColor:a,userMessageBoxColor:n,resolvedUserMessageColor:i,resolvedAgentBubbleColor:s,textColor:l,assistantTextColor:c,userTextColor:d,fontFamily:u,agentMessageBubbleFontFamily:h,agentMessageBubbleFontSize:p,userMessageBubbleFontFamily:m,userMessageBubbleFontSize:b,fontSize:f,formatTime:w,isRtl:v,onDecision:y,companyLogo:k,conciergeName:x,companyName:C,apiBaseUrl:S,getAuthToken:M,onPromptSuggestionClick:P,allowFeedback:z,provideCitations:T,onFeedback:F,headerTextColor:L,onRetryMessage:N,defaultLanguage:A="en"})=>{const I=t(()=>X(A),[A]);return e?"user"===e.role?g(vt,{message:e,formatTime:w,userMessageBoxColor:n,primaryColor:r,resolvedUserMessageColor:i,textColor:l,userTextColor:d,fontFamily:u,userMessageBubbleFontFamily:m,userMessageBubbleFontSize:b,fontSize:f,isDark:o,isRtl:v,t:I,onRetryMessage:N}):g(wt,{message:e,formatTime:w,isDark:o,primaryColor:r,agentMessageBubbleColor:a,resolvedAgentBubbleColor:s,textColor:l,assistantTextColor:c,fontFamily:u,agentMessageBubbleFontFamily:h,agentMessageBubbleFontSize:p,fontSize:f,isRtl:v,onDecision:y,companyLogo:k,conciergeName:x,companyName:C,apiBaseUrl:S,getAuthToken:M,onPromptSuggestionClick:P,allowFeedback:z,provideCitations:T,onFeedback:F,headerTextColor:L,t:I}):null};var kt=e.memo(yt);const xt=(e,t,o)=>Number.isNaN(e)?t:Math.min(Math.max(e,t),o),Ct=e=>{if(!e)return null;const t=(e=>e?.trim().toLowerCase()??"")(e),o=(e=>{const t=e.match(/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i);if(!t)return null;let o=t[1];3===o.length&&(o=o.split("").map(e=>`${e}${e}`).join(""));const r=parseInt(o.slice(0,2),16),a=parseInt(o.slice(2,4),16),n=parseInt(o.slice(4,6),16);return[r,a,n].some(e=>Number.isNaN(e))?null:{r:r,g:a,b:n}})(t);if(o)return o;const r=(e=>{const t=e.match(/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(\d*\.?\d+))?\s*\)$/i);return t?{r:xt(Number.parseInt(t[1],10),0,255),g:xt(Number.parseInt(t[2],10),0,255),b:xt(Number.parseInt(t[3],10),0,255)}:null})(t);return r||null},St=({r:e,g:t,b:o})=>{const r=e=>{const t=xt(Math.round(e),0,255).toString(16);return 1===t.length?`0${t}`:t};return`#${r(e)}${r(t)}${r(o)}`},Mt=(e,t,o)=>{const r=xt(o,0,1);return{r:Math.round(e.r+(t.r-e.r)*r),g:Math.round(e.g+(t.g-e.g)*r),b:Math.round(e.b+(t.b-e.b)*r)}},Pt=(e,t)=>{const o=xt(t,0,1);return`rgba(${xt(Math.round(e.r),0,255)}, ${xt(Math.round(e.g),0,255)}, ${xt(Math.round(e.b),0,255)}, ${o})`},zt={background:"#f8fafc",hoverBackground:"#f1f5f9",border:"#e2e8f0",hoverBorder:"#cbd5f5",shadow:"0 4px 12px rgba(15, 23, 42, 0.08)",hoverShadow:"0 6px 20px rgba(15, 23, 42, 0.14)"},Tt={background:"#1f2937",hoverBackground:"#27364a",border:"#334155",hoverBorder:"#3b4c63",shadow:"0 4px 12px rgba(15, 23, 42, 0.45)",hoverShadow:"0 6px 20px rgba(15, 23, 42, 0.55)"},Ft=(e,t)=>{const o=Ct(e);if(!o)return(e=>e?Tt:zt)(t);const r=(({r:e,g:t,b:o})=>{const r=[e,t,o].map(e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return.2126*r[0]+.7152*r[1]+.0722*r[2]})(o),a=Ct("#0f172a")??{r:15,g:23,b:42},n=Ct(t?"#f8fafc":"#f9fafb")??{r:249,g:250,b:251},i=Ct(t?"#334155":"#e2e8f0")??{r:226,g:232,b:240};let s,l;if(r>=.6){const e=t?.5:.7,r=Math.min(1,e+.15);s=Mt(o,a,e),l=Mt(o,a,r)}else if(r<=.35){const e=t?.9:.8,r=Math.min(1,e+(t?.05:.12));s=Mt(o,n,e),l=Mt(o,n,r)}else{const e=t?.45:.6,r=Math.min(1,e+.1);s=Mt(o,i,e),l=Mt(o,i,r)}const c=Mt(o,s,.65),d=Mt(o,l,.7),u=`0 4px 12px ${Pt(o,t?.28:.12)}`,g=`0 6px 20px ${Pt(o,t?.35:.18)}`;return{background:St(s),hoverBackground:St(l),border:St(c),hoverBorder:St(d),shadow:u,hoverShadow:g}},Lt=({questions:e,isDark:t,palette:i,resolvedTextColor:s,fontFamily:l,fontSize:c,isRtl:d,onQuestionClick:u,applyHoverState:p,headingLabel:m})=>{const b=r(null),[f,w]=o(!1),[v,y]=o(!1),k=a(()=>{const e=b.current;if(!e)return;const{scrollLeft:t,scrollWidth:o,clientWidth:r}=e;w(Math.abs(t)>1),y(Math.abs(t)+r<o-1)},[]);n(()=>{k();const e=b.current;if(!e)return;const t=new ResizeObserver(k);return t.observe(e),()=>t.disconnect()},[k,e]);const x=a(e=>{const t=b.current;if(!t)return;const o="left"===e?-150:150;t.scrollBy({left:d?-o:o,behavior:"smooth"})},[d]),C=t?"rgba(31,41,55,0.85)":"rgba(255,255,255,0.85)",S=t?"#e5e7eb":"#374151",M=t?"#4b5563":"#d1d5db";return h("div",{className:"px-4 py-4 border-t "+(t?"border-gray-700/50":"border-gray-200/60"),children:[h("div",{className:"text-xs mb-3 font-semibold tracking-wide uppercase "+(t?"text-gray-400":"text-gray-500"),children:[m||"Quick questions",":"]}),h("div",{className:"flex items-center gap-1.5",children:[g("button",{onClick:()=>x("left"),disabled:!f,"aria-label":"Scroll left",className:"flex-shrink-0 flex items-center justify-center w-7 h-7 rounded-full shadow-sm transition-all duration-200 hover:shadow-md active:scale-95",style:{backgroundColor:C,border:`1px solid ${M}`,color:S,backdropFilter:"blur(4px)",opacity:f?1:.35,cursor:f?"pointer":"default"},children:g(Ee,{size:16})}),g("div",{ref:b,onScroll:k,className:"flex-1 flex gap-3 overflow-x-auto pb-2",style:{scrollBehavior:"smooth",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map((e,t)=>{const o=J(e,d);return h("button",{onClick:()=>u?.(e),className:"group relative text-sm px-5 py-2.5 rounded-full font-medium transition-all duration-300 hover:scale-105 active:scale-95 whitespace-nowrap flex-shrink-0 overflow-hidden backdrop-blur-sm "+(o?"text-right":"text-left"),style:{direction:o?"rtl":"ltr",backgroundColor:i.background,border:`1.5px solid ${i.border}`,boxShadow:i.shadow},onMouseEnter:e=>{p(e.currentTarget,!0),e.currentTarget.style.transform="translateY(-2px)"},onMouseLeave:e=>{p(e.currentTarget,!1),e.currentTarget.style.transform="translateY(0)"},children:[g("div",{className:"absolute inset-0 bg-gradient-to-br from-white/0 via-white/5 to-white/10 opacity-0 group-hover:opacity-100 transition-opacity duration-300 rounded-xl"}),g("span",{className:"relative z-10",style:{direction:o?"rtl":"ltr",color:s,fontFamily:l,fontSize:c,textAlign:o?"right":"left"},children:e})]},t)})}),g("button",{onClick:()=>x("right"),disabled:!v,"aria-label":"Scroll right",className:"flex-shrink-0 flex items-center justify-center w-7 h-7 rounded-full shadow-sm transition-all duration-200 hover:shadow-md active:scale-95",style:{backgroundColor:C,border:`1px solid ${M}`,color:S,backdropFilter:"blur(4px)",opacity:v?1:.35,cursor:v?"pointer":"default"},children:g(Be,{size:16})})]})]})},Nt=({questions:e=[],isDark:o=!1,primaryColor:r="#2563eb",onQuestionClick:a,isTyping:n=!1,layout:i="vertical",fontFamily:s="Inter",fontSize:l="14px",textColor:c,isRtl:d=!1,questionTextColor:u,questionBoxColor:p,headingLabel:m})=>{if(!e.length||n)return null;const b=u??c??(o?"#f3f4f6":"#111827"),f=t(()=>Ft(b,o),[b,o]);return"horizontal"===i?g(Lt,{questions:e,isDark:o,palette:f,resolvedTextColor:b,fontFamily:s,fontSize:l,isRtl:d,onQuestionClick:a,applyHoverState:(e,t)=>{e.style.backgroundColor=t?f.hoverBackground:f.background,e.style.borderColor=t?f.hoverBorder:f.border,e.style.boxShadow=t?f.hoverShadow:f.shadow},headingLabel:m}):h("div",{style:{paddingInlineStart:"50px"},children:[m?g("div",{className:"mb-2",style:{color:o?"#9ca3af":"#6b7280",fontFamily:s,fontSize:`calc(${l} - 1px)`},children:m}):null,g("div",{className:"flex flex-wrap gap-2",children:e.map((e,t)=>{const n=J(e,d);return g("button",{onClick:()=>a?.(e),className:"transition-all duration-200 active:scale-[0.97]",style:{direction:n?"rtl":"ltr",fontFamily:s,fontSize:l,color:r,backgroundColor:o?"transparent":"#ffffff",border:`1.5px solid ${r}`,borderRadius:"9999px",padding:"5px 14px",fontWeight:500,lineHeight:"1.4",whiteSpace:"normal",textAlign:n?"right":"left"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=`${r}14`},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=o?"transparent":"#ffffff"},children:e},t)})})]})},At=({active:e=!1,processing:t=!1,deviceId:o,barWidth:a=3,barGap:i=1,barRadius:s=1.5,barColor:l,fadeEdges:c=!0,fadeWidth:d=24,barHeight:u=4,height:p=64,sensitivity:m=1,smoothingTimeConstant:b=.8,fftSize:f=256,historySize:w=60,updateRate:v=30,mode:y="static",onError:k,onStreamReady:x,onStreamEnd:C,className:S,...M})=>{const P=r(null),z=r(null),T=r([]),F=r(null),L=r(null),N=r(null),A=r(0),I=r(0),j=r(null),E=r([]),B=r(0),R=r([]),D=r(!0),V=r(null),$=r(0),O="number"==typeof p?`${p}px`:p;return n(()=>{const e=P.current,t=z.current;if(!e||!t)return;const o=new ResizeObserver(()=>{const o=t.getBoundingClientRect(),r=window.devicePixelRatio||1;e.width=o.width*r,e.height=o.height*r,e.style.width=`${o.width}px`,e.style.height=`${o.height}px`;const a=e.getContext("2d");a&&a.scale(r,r),V.current=null,$.current=o.width,D.current=!0});return o.observe(t),()=>o.disconnect()},[]),n(()=>{if(t&&!e){let e=0;B.current=0;const t=()=>{e+=.03,B.current=Math.min(1,B.current+.02);const o=[],r=Math.floor((z.current?.getBoundingClientRect().width||200)/(a+i));if("static"===y){const t=Math.floor(r/2);for(let a=0;a<r;a++){const r=(a-t)/t,n=1-.4*Math.abs(r),i=(.2+(.25*Math.sin(1.5*e+3*r)+.2*Math.sin(.8*e-2*r)+.15*Math.cos(2*e+r)))*n;let s=i;if(E.current.length>0&&B.current<1){const e=Math.min(a,E.current.length-1);s=(E.current[e]||0)*(1-B.current)+i*B.current}o.push(Math.max(.05,Math.min(1,s)))}}else for(let t=0;t<r;t++){const a=(t-r/2)/(r/2),n=1-.4*Math.abs(a),i=(.2+(.25*Math.sin(1.5*e+.15*t)+.2*Math.sin(.8*e-.1*t)+.15*Math.cos(2*e+.05*t)))*n;let s=i;if(E.current.length>0&&B.current<1){const e=Math.floor(t/r*E.current.length);s=(E.current[e]||0)*(1-B.current)+i*B.current}o.push(Math.max(.05,Math.min(1,s)))}"static"===y?R.current=o:T.current=o,D.current=!0,j.current=requestAnimationFrame(t)};return t(),()=>{j.current&&cancelAnimationFrame(j.current)}}if(!e&&!t){if("static"===y?R.current.length>0:T.current.length>0){let e=0;const t=()=>{e+=.03,e<1?("static"===y?R.current=R.current.map(t=>t*(1-e)):T.current=T.current.map(t=>t*(1-e)),D.current=!0,requestAnimationFrame(t)):"static"===y?R.current=[]:T.current=[]};t()}}},[t,e,a,i,y]),n(()=>{if(!e)return N.current&&(N.current.getTracks().forEach(e=>e.stop()),N.current=null,C?.()),L.current&&"closed"!==L.current.state&&(L.current.close(),L.current=null),void(A.current&&(cancelAnimationFrame(A.current),A.current=0));return(async()=>{try{const e=await navigator.mediaDevices.getUserMedia({audio:o?{deviceId:{exact:o},echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});N.current=e,x?.(e);const t=new(window.AudioContext||window.webkitAudioContext),r=t.createAnalyser();r.fftSize=f,r.smoothingTimeConstant=b;t.createMediaStreamSource(e).connect(r),L.current=t,F.current=r,T.current=[]}catch(e){k?.(e)}})(),()=>{N.current&&(N.current.getTracks().forEach(e=>e.stop()),N.current=null,C?.()),L.current&&"closed"!==L.current.state&&(L.current.close(),L.current=null),A.current&&(cancelAnimationFrame(A.current),A.current=0)}},[e,o,f,b,k,x,C]),n(()=>{const o=P.current;if(!o)return;const r=o.getContext("2d");if(!r)return;let n;const g=h=>{const p=o.getBoundingClientRect();if(e&&h-I.current>v&&(I.current=h,F.current)){const e=new Uint8Array(F.current.frequencyBinCount);if(F.current.getByteFrequencyData(e),"static"===y){const t=Math.floor(.05*e.length),o=Math.floor(.4*e.length),r=e.slice(t,o),n=Math.floor(p.width/(a+i)),s=Math.floor(n/2),l=[];for(let e=s-1;e>=0;e--){const t=Math.floor(e/s*r.length),o=Math.min(1,r[t]/255*m);l.push(Math.max(.05,o))}for(let e=0;e<s;e++){const t=Math.floor(e/s*r.length),o=Math.min(1,r[t]/255*m);l.push(Math.max(.05,o))}R.current=l,E.current=l}else{let t=0;const o=Math.floor(.05*e.length),r=Math.floor(.4*e.length),a=e.slice(o,r);for(let e=0;e<a.length;e++)t+=a[e];const n=t/a.length/255*m;T.current.push(Math.min(1,Math.max(.05,n))),E.current=[...T.current],T.current.length>w&&T.current.shift()}D.current=!0}if(!D.current&&!e)return void(n=requestAnimationFrame(g));D.current=e,r.clearRect(0,0,p.width,p.height);const b=l||getComputedStyle(o).color||"#000",f=a+i,k=Math.floor(p.width/f),x=p.height/2;if("static"===y){const o=t||e||R.current.length>0?R.current:[];for(let e=0;e<k&&e<o.length;e++){const t=o[e]||.1,n=e*f,i=Math.max(u,t*p.height*.8),l=x-i/2;r.fillStyle=b,r.globalAlpha=.4+.6*t,s>0?(r.beginPath(),r.roundRect(n,l,a,i,s),r.fill()):r.fillRect(n,l,a,i)}}else for(let e=0;e<k&&e<T.current.length;e++){const t=T.current.length-1-e,o=T.current[t]||.1,n=p.width-(e+1)*f,i=Math.max(u,o*p.height*.8),l=x-i/2;r.fillStyle=b,r.globalAlpha=.4+.6*o,s>0?(r.beginPath(),r.roundRect(n,l,a,i,s),r.fill()):r.fillRect(n,l,a,i)}if(c&&d>0&&p.width>0){if(!V.current||$.current!==p.width){const e=r.createLinearGradient(0,0,p.width,0),t=Math.min(.3,d/p.width);e.addColorStop(0,"rgba(255,255,255,1)"),e.addColorStop(t,"rgba(255,255,255,0)"),e.addColorStop(1-t,"rgba(255,255,255,0)"),e.addColorStop(1,"rgba(255,255,255,1)"),V.current=e,$.current=p.width}r.globalCompositeOperation="destination-out",r.fillStyle=V.current,r.fillRect(0,0,p.width,p.height),r.globalCompositeOperation="source-over"}r.globalAlpha=1,n=requestAnimationFrame(g)};return n=requestAnimationFrame(g),()=>{n&&cancelAnimationFrame(n)}},[e,t,m,v,w,a,u,i,s,l,c,d,y]),h("div",{className:ne("relative h-full w-full",S),ref:z,style:{height:O},"aria-label":e?"Live audio waveform":t?"Processing audio":"Audio waveform idle",role:"img",...M,children:[!e&&!t&&g("div",{className:"border-muted-foreground/20 absolute top-1/2 right-0 left-0 -translate-y-1/2 border-t-2 border-dotted"}),g("canvas",{className:"block h-full w-full",ref:P,"aria-hidden":"true"})]})},It=({messages:e=[],isDark:o,primaryColor:i,isLoading:s,agentMessageBubbleColor:l,userMessageBoxColor:c,textColor:d,assistantTextColor:u,userTextColor:m,fontFamily:b,agentMessageBubbleFontFamily:f,agentMessageBubbleFontSize:w,userMessageBubbleFontFamily:v,userMessageBubbleFontSize:y,fontSize:k,formatTime:x,isRtl:C=!1,defaultLanguage:S="en",quickQuestions:M=[],shouldShowQuickQuestions:z=!1,onQuickQuestion:T,quickQuestionsLayout:F="vertical",onDecision:L,disclaimerEnabled:N=!1,disclaimerText:A,disclaimerPosition:I="top",disclaimerLinkUrl:j,disclaimerLinkLabel:E,resolvedAgentBubbleColor:B,resolvedUserMessageColor:R,resolvedTextColor:D,isVoiceSessionActive:V=!1,voiceStatus:$="idle",messagesContainerRef:O,companyLogo:U,chatbotAvatarEnabled:H,chatbotAvatar:q,conciergeName:W,companyName:_,apiBaseUrl:Y,getAuthToken:Q,onPromptSuggestionClick:K,conversationResetKey:G,allowFeedback:X,provideCitations:Z,onFeedback:ee,headerTextColor:te,onRetryMessage:oe,beforePromptsSlot:re=null,promptsSlot:ne=null,quickQuestionsHeadingLabel:ie})=>{const se=r(null),le=r(!0),ce=r(!1),de=t(()=>e.map(e=>`${e.id}:${e.content?.length??0}:${e.isProcessing?1:0}`).join("|"),[e]),ue=a(()=>{const e=O?.current;if(!e)return;const t=e.scrollHeight-e.scrollTop-e.clientHeight;le.current=t<160},[O]);n(()=>{const e=O?.current;if(e)return e.addEventListener("scroll",ue,{passive:!0}),ue(),()=>{e.removeEventListener("scroll",ue)}},[ue,O]),n(()=>{G&&(le.current=!0,ce.current=!1)},[G]),n(()=>{if(ce.current||0===e.length||"undefined"==typeof window)return;ce.current=!0;let t,o=!1;const r=window.requestAnimationFrame(()=>{o||(t=window.requestAnimationFrame(()=>{o||(se.current?.scrollIntoView({behavior:"instant",block:"end"}),le.current=!0)}))});return()=>{o=!0,window.cancelAnimationFrame(r),window.cancelAnimationFrame(t)}},[0===e.length]),n(()=>{if(!le.current)return;if("undefined"==typeof window)return;let e=!1;const t=window.requestAnimationFrame(()=>{e||se.current?.scrollIntoView({behavior:"smooth",block:"end"})});return()=>{e=!0,window.cancelAnimationFrame(t)}},[de,s]),n(()=>{if(!V||"connected"!==$)return;if("undefined"==typeof window)return;let e=!1;const t=window.requestAnimationFrame(()=>{e||se.current?.scrollIntoView({behavior:"smooth",block:"end"})});return()=>{e=!0,window.cancelAnimationFrame(t)}},[V,$]);const ge=t(()=>ae(j),[j]),he=t(()=>J(A,C),[A,C]);return h(p,{children:[N&&A&&"top"===I&&g("div",{className:"flex justify-center",children:g("div",{className:"rounded-lg px-2 py-1 ",style:{color:o?"#d1d5db":"#6b7280",fontFamily:null!=b?b:"Inter",fontSize:null!=k?`calc(${k} - 2px)`:"12px",direction:he?"rtl":"ltr",textAlign:"center",borderColor:o?"#374151":"#e5e7eb"},children:h("p",{className:"leading-relaxed whitespace-pre-wrap break-words inline",dir:he?"rtl":"ltr",style:{color:o?"#d1d5db":"#6b7280",fontFamily:null!=b?b:"Inter",fontSize:null!=k?`calc(${k} - 2px)`:"12px"},children:[A,ge&&E&&g("a",{href:ge,target:"_blank",rel:"noopener noreferrer",title:ge,style:{color:o?"#93c5fd":"#2563eb",marginInlineStart:"4px",verticalAlign:"middle",display:"inline-flex",alignItems:"center"},children:E})]})})}),e.map(e=>g(kt,{message:e,isDark:o,primaryColor:i,agentMessageBubbleColor:l,userMessageBoxColor:c,resolvedUserMessageColor:R,resolvedAgentBubbleColor:B,textColor:d,assistantTextColor:u,userTextColor:m,fontFamily:b,agentMessageBubbleFontFamily:f,agentMessageBubbleFontSize:w,userMessageBubbleFontFamily:v,userMessageBubbleFontSize:y,fontSize:k,formatTime:x,isRtl:J(e.content,C),onDecision:L,onPromptSuggestionClick:K,companyLogo:H&&q?q:U,conciergeName:W,companyName:_,apiBaseUrl:Y,getAuthToken:Q,allowFeedback:X,provideCitations:Z,onFeedback:ee,headerTextColor:te,onRetryMessage:oe,defaultLanguage:S},e.id)),(()=>{const t=e[e.length-1],r=s&&"user"===t?.role,a=e.some(e=>"assistant"===e.role&&(e.isProcessing||!e.content));return r&&!a?g(kt,{message:P(),isDark:o,primaryColor:i,agentMessageBubbleColor:l,resolvedAgentBubbleColor:B,userMessageBoxColor:c,textColor:d,assistantTextColor:u,userTextColor:m,fontFamily:b,agentMessageBubbleFontFamily:f,agentMessageBubbleFontSize:w,userMessageBubbleFontFamily:v,userMessageBubbleFontSize:y,fontSize:k,formatTime:x,isRtl:C,onDecision:L,companyLogo:H&&q?q:U,conciergeName:W,companyName:_,apiBaseUrl:Y,getAuthToken:Q,headerTextColor:te,defaultLanguage:S},"skeleton-waiting"):null})(),re,ne?g("div",{className:"pt-1",children:ne}):z&&M.length>0&&g("div",{className:"pt-1",children:g(Nt,{questions:M,isDark:o,primaryColor:i,onQuestionClick:T,isTyping:s,layout:F,fontFamily:b,fontSize:k,textColor:d,isRtl:C,questionTextColor:u,questionBoxColor:l,headingLabel:ie})}),V&&"connected"===$&&!s&&g("div",{className:"flex gap-3 flex-row-reverse animate-in",children:g("div",{className:"flex flex-col items-end max-w-[75%] w-full",children:h("div",{className:"rounded-2xl px-4 py-2.5 shadow-lg rounded-tr-sm w-full",style:{background:`linear-gradient(135deg, ${R||i||"#2563eb"} 0%, ${R||i||"#2563eb"}dd 100%)`,width:"100px"},children:[g("span",{className:"sr-only",children:"Listening for voice input"}),g(At,{active:!0,barWidth:2,barHeight:4,barGap:2,barColor:m||D||"#FFFFFF",height:20,fadeEdges:!0,className:"min-w-[60px]","aria-hidden":"true"})]})})}),g("div",{ref:se,className:"h-px"})]})};function jt(e,t){return String(e||"").replace(/\/+$/,"")+(t.startsWith("/")?t:`/${t}`)}function Et({apiEndpoint:e,conversationId:t,size:o,authHeader:r}){fetch(jt(e,"/api/v1/chat-attachments/release"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversationId:t,size:o})}).catch(()=>{})}function Bt({orgId:e,conversationId:n,config:i,apiEndpoint:s,authHeader:l,onError:c}){const[d,u]=o([]),g=r(new Map),h=r(0),p=r(d);p.current=d;const m=r({conversationId:n,bytes:0});m.current.conversationId!==n&&(m.current={conversationId:n,bytes:0});const b=a(()=>(h.current+=1,`att-${Date.now()}-${h.current}`),[]),f=a((e,t)=>{u(o=>o.map(o=>o.id===e?{...o,...t}:o))},[]),w=a((e,t,o)=>{const r={status:"error",error:{code:t,message:o}};u(t=>{const o=t.map(t=>t.id===e?{...t,...r}:t),a=o.find(t=>t.id===e);return a&&c&&c(a),o})},[c]),v=a((e,t)=>{if(!i?.fileUploadEnabled)return{ok:!1,code:"feature_disabled",message:"File uploads are not enabled for this organization."};if(t>=i.fileUploadMaxFiles)return{ok:!1,code:"too_many_files",message:`Max ${i.fileUploadMaxFiles} files per message.`};const o=1024*i.fileUploadMaxSizeMB*1024;if(m.current.bytes+e.size>o){return{ok:!1,code:"size_exceeded",message:`This conversation has already used ${(m.current.bytes/1048576).toFixed(1)} MB of its ${i.fileUploadMaxSizeMB} MB upload limit - this file won't fit.`}}const r=(e.type||"").toLowerCase(),a=new Set((i.fileUploadAllowedMimes||[]).map(e=>String(e).toLowerCase()));return a.size>0&&!a.has(r)?{ok:!1,code:"mime_not_allowed",message:`File type "${e.type||"unknown"}" is not allowed.`}:{ok:!0}},[i]),y=a(async(e,t)=>{let o;try{o=await fetch(jt(s,"/api/v1/chat-attachments/presign"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...l?{Authorization:l}:{}},body:JSON.stringify({filename:t.name,mimeType:t.type,size:t.size,conversationId:n})})}catch(o){return m.current.bytes=Math.max(0,m.current.bytes-t.size),void w(e,"network","Network error while requesting upload.")}if(!o.ok){let r="Upload rejected by the server.",a="unknown";try{const e=await o.json();e?.error&&(r=e.error),e?.code&&(a=function(e){switch(e){case"feature_disabled":case"size_exceeded":case"mime_not_allowed":case"storage_unavailable":return e;default:return"unknown"}}(e.code))}catch{}return m.current.bytes=Math.max(0,m.current.bytes-t.size),void w(e,a,r)}let r=0;const a=()=>{r>0&&(Et({apiEndpoint:s,conversationId:n,size:r,authHeader:l}),r=0,f(e,{reservedBytes:0}))},i=()=>{m.current.bytes=Math.max(0,m.current.bytes-t.size)};let c;try{c=await o.json()}catch{return Et({apiEndpoint:s,conversationId:n,size:t.size,authHeader:l}),i(),f(e,{reservedBytes:0}),void w(e,"unknown","Malformed presign response.")}let d,u;("boolean"==typeof c.reserved?c.reserved:!c.useMultipart)&&(r=t.size,f(e,{reservedBytes:t.size}));try{if(c.useMultipart){const o=await function({url:e,file:t,conversationId:o,authHeader:r,onProgress:a,registerXhr:n}){return new Promise((r,i)=>{const s=new XMLHttpRequest;n(s),s.open("POST",e,!0),s.withCredentials=!0;const l=new FormData;l.append("conversationId",o),l.append("file",t,t.name),s.upload.onprogress=e=>{e.lengthComputable&&a(Math.round(e.loaded/e.total*100))},s.onload=()=>{if(s.status>=200&&s.status<300)try{const e=JSON.parse(s.responseText);r({url:"string"==typeof e?.url?e.url:void 0,storageKey:"string"==typeof e?.storageKey?e.storageKey:void 0})}catch{r({})}else i(new Error(`upload_status_${s.status}`))},s.onerror=()=>i(new Error("network")),s.onabort=()=>i({aborted:!0}),s.send(l)})}({url:jt(s,"/api/v1/chat-attachments/multipart"),file:t,conversationId:n,authHeader:l,onProgress:t=>f(e,{progress:t}),registerXhr:t=>g.current.set(e,t)});d=o.url,u=o.storageKey,r=t.size,f(e,{reservedBytes:t.size})}else{if(!c.uploadUrl)throw new Error("presign_missing_target");{await function({url:e,file:t,onProgress:o,registerXhr:r}){return new Promise((a,n)=>{const i=new XMLHttpRequest;r(i),i.open("PUT",e,!0),i.setRequestHeader("x-ms-blob-type","BlockBlob"),t.type&&i.setRequestHeader("Content-Type",t.type),i.upload.onprogress=e=>{e.lengthComputable&&o(Math.round(e.loaded/e.total*100))},i.onload=()=>{i.status>=200&&i.status<300?a():n(new Error(`upload_status_${i.status}`))},i.onerror=()=>n(new Error("network")),i.onabort=()=>n({aborted:!0}),i.send(t)})}({url:c.uploadUrl,file:t,onProgress:t=>f(e,{progress:t}),registerXhr:t=>g.current.set(e,t)});const o=await async function({apiEndpoint:e,storageKey:t,filename:o,mimeType:r,authHeader:a}){let n;try{n=await fetch(jt(e,"/api/v1/chat-attachments/confirm"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...a?{Authorization:a}:{}},body:JSON.stringify({storageKey:t,filename:o,mimeType:r})})}catch{return{ok:!1,code:"network",message:"Network error while verifying upload."}}if(n.ok)return{ok:!0};let i="Upload rejected - file content did not match its declared type.",s="content_mismatch";try{const e=await n.json();e?.error&&(i=e.error),"password_protected"===e?.code&&(s="password_protected")}catch{}return{ok:!1,code:s,message:i}}({apiEndpoint:s,storageKey:c.storageKey,filename:t.name,mimeType:t.type,authHeader:l});if(!o.ok)return g.current.delete(e),a(),i(),void w(e,o.code,o.message)}}}catch(t){if(g.current.delete(e),t&&t.aborted)return;return a(),i(),void w(e,"network","Upload failed. Please retry.")}g.current.delete(e),f(e,{status:"ready",progress:100,storageKey:u||c.storageKey,...d?{url:d}:{}})},[s,l,n,w,f]),k=a(async e=>{const t=Array.from(e);for(const e of t){const t=p.current.filter(e=>"error"!==e.status).length,o=v(e,t),r=b();if(!o.ok){const t={id:r,filename:e.name,size:e.size,mimeType:e.type,status:"error",error:{code:o.code,message:o.message}};u(e=>(c&&c(t),[...e,t]));continue}const a={id:r,filename:e.name,size:e.size,mimeType:e.type,status:"uploading",progress:0,reservedBytes:0};u(e=>[...e,a]),m.current.bytes+=e.size,y(r,e)}},[v,y,b,c]),x=a(e=>{const t=g.current.get(e);t&&(t.abort(),g.current.delete(e));const o=p.current.find(t=>t.id===e);o&&o.reservedBytes>0&&(Et({apiEndpoint:s,conversationId:n,size:o.reservedBytes,authHeader:l}),m.current.bytes=Math.max(0,m.current.bytes-o.reservedBytes)),u(t=>t.filter(t=>t.id!==e))},[s,l,n]),C=a(()=>{for(const e of g.current.values())e.abort();g.current.clear(),u([])},[]),S=t(()=>d.some(e=>"validating"===e.status||"uploading"===e.status),[d]),M=a(()=>d.filter(e=>"ready"===e.status&&"string"==typeof e.storageKey).map(e=>({filename:e.filename,mimeType:e.mimeType,size:e.size,storageKey:e.storageKey,url:e.url})),[d]);return{attachments:d,addFiles:k,removeAttachment:x,clearAll:C,isBusy:S,toSendPayload:M}}function Rt(e){if(!e||e<1024)return`${e||0} B`;const t=["KB","MB","GB"];let o=e/1024,r=0;for(;o>=1024&&r<t.length-1;)o/=1024,r+=1;return`${o.toFixed(o>=10?0:1)} ${t[r]}`}function Dt({attachment:e,onRemove:t,isDark:o}){const r="error"===e.status,a="uploading"===e.status,n="ready"===e.status,i=r?o?"rgba(239,68,68,0.15)":"#fee2e2":o?"#1f2937":"#f3f4f6",s=r?o?"#b91c1c":"#fca5a5":o?"#374151":"#e5e7eb",l=r?o?"#fca5a5":"#b91c1c":o?"#e5e7eb":"#374151",c=r?`${e.filename} - ${e.error?.message||"error"}`:a?`${e.filename} - uploading`:`${e.filename} - ready`;return h("div",{className:"inline-flex items-center gap-2 rounded-full pl-2 pr-1 py-1 text-xs",style:{backgroundColor:i,border:`1px solid ${s}`,color:l,maxWidth:240},title:r?e.error?.message:e.filename,"aria-label":c,children:[r?g(Re,{size:12,"aria-hidden":"true"}):a?g(Oe,{size:12,className:"animate-spin","aria-hidden":"true"}):g($e,{size:12,"aria-hidden":"true"}),g("span",{className:"truncate",style:{maxWidth:140,direction:"ltr"},children:e.filename}),n&&g("span",{className:"opacity-70 text-chip",children:Rt(e.size)}),a&&"number"==typeof e.progress&&h("span",{className:"opacity-70 text-chip",children:[e.progress,"%"]}),g("button",{type:"button",onClick:()=>t(e.id),className:"w-4 h-4 rounded-full inline-flex items-center justify-center",style:{backgroundColor:"transparent",border:"none",color:l,cursor:"pointer"},"aria-label":"Remove attachment",children:g(Xe,{size:12})})]})}const Vt=({suggestions:e,onSuggestionClick:t,promptPrimary:o,promptTextColor:r,promptFontFamily:a,promptFontSize:n,isRtl:i,t:s,questionDisplay:l=!0})=>g("div",{className:"mb-2 px-5",children:g("div",{className:"flex flex-col gap-2",role:"group","aria-label":s("suggestedQuestions"),children:e.map((e,s)=>{const c=((e,t=!0)=>{if(!e||"string"==typeof e)return e||"";const o="string"==typeof e.text?e.text:"";if(!t)return o;const r="string"==typeof e.submitText?e.submitText.trim():"";return r&&r!==o?r:o})(e,l),d=J(c,i);return g("button",{type:"button",onClick:()=>t(e.submitText||e.text||e,e,s),dir:d?"rtl":"ltr",className:"block w-full rounded-2xl px-4 py-2 border-0 transition-transform duration-150 active:scale-[0.99] "+(d?"text-right":"text-left"),style:{direction:d?"rtl":"ltr",textAlign:d?"right":"left",background:`linear-gradient(135deg, ${o} 0%, ${o}dd 100%)`,color:r,fontFamily:a,fontSize:n},children:c},`${e.text||e}-${s}`)})})}),$t=({onStopGeneration:e,inputValue:i,setInputValue:s,onSend:l,isDark:c,primaryColor:d,isOpen:u,isMinimized:b,isLoading:f,isConversationLoading:w=!1,placeholder:v,textColor:y,fontFamily:k,fontSize:x,isRtl:C=!1,csatVisible:S=!1,enableVoiceInteraction:M=!1,isVoiceSessionActive:P=!1,voiceStatus:z="idle",voiceError:T=null,onVoiceToggle:F,onBidiSubmit:L,disclaimerEnabled:N=!1,disclaimerText:A,disclaimerPosition:I="top",disclaimerLinkUrl:j,disclaimerLinkLabel:E,showPoweredBy:B=!0,onboardingQuestions:R=[],onboardingActive:D=!1,onboardingCompleted:V=!1,userMessageBubbleFontFamily:$,onboardingEnabled:O=!1,userMessageBubbleFontSize:U,userMessageBoxColor:W,resolvedUserMessageColor:_,userTextColor:Q,promptSuggestions:K,onPromptSuggestionClick:G,autoPromptQuestionDisplay:Z=!0,tagSelectorNode:ee=null,showResolveButton:te=!1,onResolve:oe,defaultLanguage:re="en",chatFeatures:ie,apiEndpoint:se,organizationId:le,conversationId:ce})=>{const de=t(()=>X(re),[re]),ue=t(()=>function(e){const t=Y(e),o=q[t]||H;return{beforeBrand:o.poweredByBefore??o.poweredBy??H.poweredByBefore,afterBrand:o.poweredByAfter??""}}(re),[re]),ge=t(()=>J(i,C),[i,C]),[he,pe]=o(!1),[me,be]=o(!1),fe=t(()=>({fileUploadEnabled:ie?.fileUploadEnabled??!1,fileUploadMaxSizeMB:ie?.fileUploadMaxSizeMB??10,fileUploadMaxFiles:ie?.fileUploadMaxFiles??3,fileUploadAllowedMimes:ie?.fileUploadAllowedMimes??[]}),[ie]),{attachments:we,addFiles:ve,removeAttachment:ye,clearAll:ke,isBusy:xe,toSendPayload:Ce}=Bt({orgId:le,conversationId:ce,config:fe,apiEndpoint:se,authHeader:void 0}),Se=r(null),Me=!!fe.fileUploadEnabled&&!!se,Pe=we.length>=fe.fileUploadMaxFiles,ze=`Max ${fe.fileUploadMaxFiles} files per message.`,Te=t(()=>fe.fileUploadAllowedMimes.length>0?fe.fileUploadAllowedMimes.join(","):void 0,[fe.fileUploadAllowedMimes]),[Fe,Le]=o({top:0,left:0,placement:"top",arrowOffset:0}),[Ne,Ae]=o(!1),je=r(null),Ee=r(null),Be=r(null),Re=r(null);at(k),at($),n(()=>{u&&!b&&Ee.current?.focus()},[u,b]),n(()=>{const e=Ee.current;if(e){e.style.height="auto";const t=e.scrollHeight,o=i.trim().length>0?20:48,r=Math.max(o,Math.min(t,120));e.style.height=`${r}px`}},[i]);const De=a(()=>{const e=Ce();e.length>0?(l(void 0,e),ke()):l()},[Ce,ke,l]),Ve=we.some(e=>"ready"===e.status),$e=!i.trim()&&!Ve||f||w||xe,Ue=c?"#374151":"#e5e7eb",He=R&&R.length>0,We=S||w||O&&(He&&!V)||"connecting"===z,Qe=S?de("pleaseSubmitRatingFirst"):He?D?de("completeOnboardingToEnableVoice"):V?"":de("sendMessageToCompleteOnboarding"):"",Ke=()=>{if(!Be.current)return;const e=Be.current.getBoundingClientRect(),t=220,o=e.top,r=window.innerHeight-e.bottom;let a="top",n=0,i=0;o>=73?(a="top",n=e.top-60-5-8,i=e.right-t,i<10&&(i=10),i+t>window.innerWidth-10&&(i=window.innerWidth-t-10)):r>=68?(a="bottom",n=e.bottom+8,i=e.right-t,i<10&&(i=10),i+t>window.innerWidth-10&&(i=window.innerWidth-t-10)):(a="top",n=Math.max(10,e.top-60-5-8),i=e.right-t,i<10&&(i=10),i+t>window.innerWidth-10&&(i=window.innerWidth-t-10));return{top:n,left:i,placement:a,arrowOffset:e.left+e.width/2-i}};n(()=>{if(me&&Qe){const e=()=>{const e=Ke();Le(e)};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}}},[me,Qe]),n(()=>()=>{je.current&&clearTimeout(je.current)},[]);const Ge=null!=_?_:null!=W?W:null!=d?d:"#2563eb",Je=null!=Q?Q:null!=y?y:"#FFFFFF",Xe=null!=$?$:null!=k?k:"Inter",Ze=null!=U?U:null!=x?x:null,et=Ze?`calc(${Ze} - 2px)`:"12px",tt=ae(j);return h("div",{className:"py-4 flex-shrink-0 relative "+(c?"bg-gray-900":"bg-white"),style:{overflow:"visible"},children:[ee||K.length>0&&G&&g(Vt,{suggestions:K,onSuggestionClick:G,questionDisplay:Z,promptPrimary:Ge,promptTextColor:Je,promptFontFamily:Xe,promptFontSize:et,isRtl:C,t:de}),g("div",{className:"my-4",style:{height:"1px",backgroundColor:Ue}}),Me&&we.length>0&&g("div",{className:"px-5 mb-2 flex flex-wrap gap-1.5",children:we.map(e=>g(Dt,{attachment:e,onRemove:ye,isDark:c},e.id))}),h("div",{className:"flex items-center px-5 gap-1.5",children:[Me&&g("input",{ref:Se,type:"file",multiple:!0,accept:Te,"aria-label":de("uploadFile"),className:"hidden",style:{display:"none"},onChange:e=>{const t=e.target.files;t&&t.length&&!Pe&&ve(t),e.currentTarget.value=""}}),h("div",{className:`flex-1 flex items-center gap-1 px-1 min-h-[48px] ${c?"bg-gray-800":"bg-gray-50"} rounded-2xl transition-all duration-200`,style:{borderStyle:"solid",borderColor:i&&i.trim().length>0?d||"#2563eb":Ue,borderWidth:i&&i.trim().length>0?"2px":"1px"},children:[Me&&h("div",{className:"relative group shrink-0",children:[g("button",{type:"button",onClick:()=>Se.current&&Se.current.click(),disabled:S||w||f||Pe,"aria-label":Pe?ze:"Attach file",title:Pe?ze:"Attach file",className:`h-8 w-8 rounded-lg flex items-center justify-center transition-colors duration-200 ${c?"text-gray-300 hover:bg-gray-700":"text-gray-500 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,style:{border:"none"},children:g(qe,{className:"w-4 h-4"})}),Pe&&g("div",{role:"tooltip",className:"pointer-events-none absolute bottom-full left-1/2 -translate-x-1/2 mb-2 opacity-0 group-hover:opacity-100 transition-opacity px-3 py-1.5 text-xs rounded-lg whitespace-nowrap shadow-lg "+(c?"bg-gray-700 text-gray-100":"bg-gray-800 text-white"),children:ze})]}),g("div",{className:"relative flex-1 flex items-center min-w-0",children:g("textarea",{id:"chat-widget-input",ref:Ee,"aria-label":v||de("typeYourMessage"),value:i,onChange:e=>{s(e.target.value)},onFocus:()=>pe(!0),onBlur:()=>pe(!1),onKeyDown:e=>{if("Enter"===e.key&&!e.shiftKey){if(e.preventDefault(),P&&L&&!Ve)return void L();if($e)return;De()}},placeholder:w?de("agentIsLoading"):v||de("typeYourMessage"),rows:1,disabled:S||w||f||P&&"connected"!==z,dir:ge?"rtl":"ltr",className:`w-full px-3 bg-transparent rounded-xl leading-normal ${c?"text-gray-100":"text-gray-900"} placeholder-gray-400 resize-none outline-none scrollbar-hide break-words`,style:{height:"auto",maxHeight:"120px",minHeight:"48px",paddingTop:i.trim().length>0?"12px":"0px",paddingBottom:i.trim().length>0?"12px":"0px",lineHeight:i.trim().length>0?"1.4":"48px",fontFamily:$||k||"Inter",fontSize:x||"14px",color:c?"#F3F4F6":"#1F2937",textAlign:ge?"right":"left",direction:ge?"rtl":"ltr",wordSpacing:"0",letterSpacing:"0"}})}),M&&h("div",{className:"relative shrink-0",onMouseEnter:()=>{if(We&&Qe){je.current&&(clearTimeout(je.current),je.current=null);const e=Ke();Le(e),be(!0)}},onMouseLeave:()=>{je.current&&(clearTimeout(je.current),je.current=null),be(!1)},children:[g("button",{style:{border:"none"},ref:Be,type:"button",onClick:F,"aria-label":de(P?"stopVoiceInput":"startVoiceInput"),className:`h-8 w-8 rounded-lg flex items-center justify-center transition-colors duration-200 ${P?"bg-red-500 text-white hover:bg-red-600":c?"text-gray-300 hover:bg-gray-700":"text-gray-500 hover:bg-gray-200"} ${We?"opacity-60 cursor-not-allowed":""}`,disabled:We,children:"connecting"===z?g(Oe,{className:"w-4 h-4 animate-spin"}):g(Ie,{className:"w-4 h-4"})}),me&&Qe&&"undefined"!=typeof document&&m(h("div",{ref:Re,className:"px-3 py-1.5 text-xs shadow-md pointer-events-none",style:{position:"fixed",top:`${Fe.top}px`,left:`${Fe.left}px`,maxWidth:"220px",whiteSpace:"normal",wordWrap:"break-word",minWidth:"180px",zIndex:999999,backgroundColor:c?"#1f2937":"#ffffff",color:c?"#f3f4f6":"#111827",border:c?"1px solid #374151":"1px solid #e5e7eb",borderRadius:"top"===Fe.placement?"6px 6px 6px 6px":"6px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",overflow:"visible"},children:[g("div",{className:"text-left leading-relaxed",children:Qe}),"top"===Fe.placement&&h(p,{children:[g("div",{style:{position:"absolute",top:"100%",left:`${Fe.arrowOffset}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:c?"6px solid #374151":"6px solid #e5e7eb",pointerEvents:"none"}}),g("div",{style:{position:"absolute",top:"100%",left:`${Fe.arrowOffset}px`,transform:"translateX(-50%)",marginTop:"-1px",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:c?"5px solid #1f2937":"5px solid #ffffff",pointerEvents:"none"}})]}),"bottom"===Fe.placement&&h(p,{children:[g("div",{className:"absolute bottom-full",style:{left:`${Fe.arrowOffset}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderBottom:c?"5px solid #374151":"5px solid #e5e7eb"}}),g("div",{className:"absolute bottom-full -mb-px",style:{left:`${Fe.arrowOffset}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:c?"4px solid #1f2937":"4px solid #ffffff"}})]})]}),document.body)]})]}),g("button",f&&!P&&"function"==typeof e?{onClick:e,className:"h-10 w-10 flex-shrink-0 rounded-xl transition-all duration-200 flex items-center justify-center shadow-md scale-100",style:{backgroundColor:d,color:"white",border:"none"},"aria-label":de("stopGenerating"),children:g(Ye,{className:"w-3.5 h-3.5",fill:"currentColor"})}:{onClick:P&&L&&!Ve?L:De,disabled:S||$e||P&&"connected"!==z,className:"h-10 w-10 flex-shrink-0 rounded-xl transition-all duration-200 flex items-center justify-center shadow-md disabled:opacity-40 disabled:cursor-not-allowed disabled:shadow-none "+(i.trim()?"scale-100":"scale-95"),style:{backgroundColor:i.trim()?d:c?"#374151":"#e5e7eb",color:i.trim()?"white":"#9ca3af",border:"none"},"aria-label":de("sendMessage"),children:g(_e,{className:"w-4 h-4 transition-transform",style:C?{transform:"rotate(-90deg)"}:void 0})})]}),P&&h("p",{"aria-live":"polite",className:`text-xs mt-2 px-5 ${"connected"===z?"text-status-success":"text-gray-500"} flex items-center gap-1`,children:[g("span",{className:"w-1.5 h-1.5 rounded-full bg-current inline-flex"}),de("connected"===z?"voiceSessionLive":"connectingVoice")]}),T&&g("p",{role:"alert",className:"text-xs mt-1 px-5 text-status-error",children:de(T)===T?de("voiceUnavailable"):de(T)}),N&&A&&"footer"===I&&h("p",{className:"text-xs mt-2 px-5 text-center",style:{color:c?"#d1d5db":"#6b7280",fontFamily:k||"Inter",fontSize:x?`calc(${x} - 2px)`:"12px",direction:C?"rtl":"ltr"},dir:C?"rtl":"ltr",children:[A,tt&&E&&g("a",{href:tt,target:"_blank",rel:"noopener noreferrer",title:tt,style:{color:c?"#93c5fd":"#2563eb",marginInlineStart:"4px",verticalAlign:"middle",display:"inline-flex",alignItems:"center"},children:E})]}),B&&g("div",{className:"mt-1.5 flex justify-center",children:g("a",{href:"https://eshal.ai",target:"_blank",rel:"noopener noreferrer",className:"no-underline",children:h("span",{dir:"ltr",className:"inline-flex items-center gap-1.5 py-1.5 px-3",children:[ue.beforeBrand&&g("span",{className:ne("font-sans text-[10px] font-medium",c?"text-gray-400":"text-gray-500"),children:ue.beforeBrand}),Ne?g("span",{className:ne("font-sans text-[10px] font-semibold",c?"text-gray-300":"text-gray-600"),children:"ESHAL"}):g("img",{src:c?"data:image/svg+xml,%3csvg width='219' height='54' xmlns='http://www.w3.org/2000/svg' version='1.0'%3e%3cg class='layer'%3e%3ctitle%3eEshal Logo%3c/title%3e%3cg clip-path='url(%23a)' transform='translate(-.708 -1.076)'%3e%3cg clip-path='url(%23b)'%3e%3cpath d='M21.79 54.75h4.5l3.93-.56 4.49-1.4 3.38-1.97 2.81-2.25 2.24-2.81 2.25-3.93 1.13-3.09v-.85l-3.65-1.12h-.57l-1.96 4.5-1.97 3.09-2.81 2.53-3.93 1.96-3.38.85-2.81.28h-2.81l-4.21-.57-3.94-1.4-2.81-1.97-2.25-2.24-1.96-3.38-1.41-4.21-.56-3.37-.28-3.1v-3.65l.56-5.06 1.12-4.21 1.97-3.94 2.53-2.81 2.25-1.68 2.81-1.41 3.37-.84 2.25-.28H26l4.78.84 4.5 2.25 2.53 2.53 1.4 2.53.56 2.53-.28 3.65-1.12 2.25-1.41 1.69-1.4.55-1.13-4.21-1.68-2.81-1.97-1.97-3.09-1.4-1.12-.28h-5.34l-3.09 1.12-2.25 1.69-1.41 1.97-.84 3.09.28 3.08 1.4 2.82 1.97 1.96 2.81 1.41 2.25.56 4.78.28 3.09-.28.84-.28-1.12 3.09-1.69 1.97-2.25.84h-3.65l-2.81-1.12-1.68-1.41-3.38 2.25.56 1.13 1.13 1.4 2.81 1.69 2.81.84h4.78l2.81-.84 2.53-1.69 1.96-2.25L35 34.8l.84-4.5 3.65-2.24 2.53-2.53 1.69-3.09.56-2.25.28-2.81-.56-3.93-1.12-2.82-2.25-3.09-3.09-2.81-4.22-2.25-4.5-1.12-2.52-.28h-4.5l-3.93.56-4.5 1.41-3.38 1.96-3.37 3.1-2.52 3.65-1.97 4.49-1.13 4.78-.28 2.25v9.27l.84 5.06 1.69 4.78 1.69 3.09 2.25 2.81 2.8 2.53 2.82 1.69 5.06 1.68zm1.12-27.54-2.53-.84-1.4-1.12-.84-1.69.28-2.53 1.12-1.4 2.25-1.13H26l2.81 1.41 1.41 1.97.84 2.8v2.25l-1.12.28zm0 0' fill='white'/%3e%3c/g%3e%3c/g%3e%3cpath d='M82.381 38.435v6.48h-27.06V9.965h26.41v6.5h-18.36v7.57h16.22v6.3h-16.22v8.1zm16.432 7.07c-2.77 0-5.44-.37-8.02-1.11-2.57-.75-4.65-1.72-6.22-2.92l2.75-6.09c1.5 1.09 3.28 1.98 5.34 2.64 2.07.67 4.13 1 6.19 1q3.45 0 5.1-1.02t1.65-2.73c0-.83-.33-1.52-.98-2.06-.65-.55-1.48-1-2.5-1.33-1.01-.33-2.39-.7-4.11-1.1-2.67-.63-4.85-1.26-6.55-1.89s-3.15-1.64-4.37-3.04c-1.21-1.41-1.82-3.27-1.82-5.6 0-2.03.55-3.86 1.64-5.51 1.11-1.66 2.76-2.96 4.97-3.92 2.22-.97 4.93-1.46 8.13-1.46 2.22 0 4.4.27 6.53.8s4 1.3 5.59 2.3l-2.5 6.14c-3.23-1.82-6.45-2.74-9.67-2.74-2.27 0-3.95.37-5.03 1.1-1.07.73-1.61 1.69-1.61 2.89q0 1.8 1.86 2.67c1.25.59 3.16 1.16 5.72 1.72 2.66.63 4.85 1.27 6.55 1.9 1.69.63 3.14 1.63 4.36 2.99 1.21 1.37 1.82 3.21 1.82 5.55 0 2-.56 3.82-1.67 5.46q-1.68 2.475-5.01 3.93c-2.23.95-4.95 1.43-8.14 1.43m50.913-35.54v34.95h-8.08v-14.33h-15.88v14.33h-8.09V9.965h8.09v13.78h15.88V9.965zm29.811 27.47h-16.22l-3.1 7.48h-8.29l15.58-34.95h7.98l15.62 34.95h-8.48zm-2.55-6.15-5.55-13.37-5.53 13.37zm16.274-21.32h8.09v28.36h17.52v6.59h-25.61zm0 0' fill='white'/%3e%3c/g%3e%3c/svg%3e":"data:image/svg+xml,%3csvg width='219' height='54' xmlns='http://www.w3.org/2000/svg' version='1.0'%3e%3cg class='layer'%3e%3ctitle%3eEshal Logo%3c/title%3e%3cg clip-path='url(%23a)' transform='translate(-.708 -1.076)'%3e%3cg clip-path='url(%23b)'%3e%3cpath d='M21.79 54.75h4.5l3.93-.56 4.49-1.4 3.38-1.97 2.81-2.25 2.24-2.81 2.25-3.93 1.13-3.09v-.85l-3.65-1.12h-.57l-1.96 4.5-1.97 3.09-2.81 2.53-3.93 1.96-3.38.85-2.81.28h-2.81l-4.21-.57-3.94-1.4-2.81-1.97-2.25-2.24-1.96-3.38-1.41-4.21-.56-3.37-.28-3.1v-3.65l.56-5.06 1.12-4.21 1.97-3.94 2.53-2.81 2.25-1.68 2.81-1.41 3.37-.84 2.25-.28H26l4.78.84 4.5 2.25 2.53 2.53 1.4 2.53.56 2.53-.28 3.65-1.12 2.25-1.41 1.69-1.4.55-1.13-4.21-1.68-2.81-1.97-1.97-3.09-1.4-1.12-.28h-5.34l-3.09 1.12-2.25 1.69-1.41 1.97-.84 3.09.28 3.08 1.4 2.82 1.97 1.96 2.81 1.41 2.25.56 4.78.28 3.09-.28.84-.28-1.12 3.09-1.69 1.97-2.25.84h-3.65l-2.81-1.12-1.68-1.41-3.38 2.25.56 1.13 1.13 1.4 2.81 1.69 2.81.84h4.78l2.81-.84 2.53-1.69 1.96-2.25L35 34.8l.84-4.5 3.65-2.24 2.53-2.53 1.69-3.09.56-2.25.28-2.81-.56-3.93-1.12-2.82-2.25-3.09-3.09-2.81-4.22-2.25-4.5-1.12-2.52-.28h-4.5l-3.93.56-4.5 1.41-3.38 1.96-3.37 3.1-2.52 3.65-1.97 4.49-1.13 4.78-.28 2.25v9.27l.84 5.06 1.69 4.78 1.69 3.09 2.25 2.81 2.8 2.53 2.82 1.69 5.06 1.68zm1.12-27.54-2.53-.84-1.4-1.12-.84-1.69.28-2.53 1.12-1.4 2.25-1.13H26l2.81 1.41 1.41 1.97.84 2.8v2.25l-1.12.28zm0 0' fill='black'/%3e%3c/g%3e%3c/g%3e%3cpath d='M82.381 38.435v6.48h-27.06V9.965h26.41v6.5h-18.36v7.57h16.22v6.3h-16.22v8.1zm16.432 7.07c-2.77 0-5.44-.37-8.02-1.11-2.57-.75-4.65-1.72-6.22-2.92l2.75-6.09c1.5 1.09 3.28 1.98 5.34 2.64 2.07.67 4.13 1 6.19 1q3.45 0 5.1-1.02t1.65-2.73c0-.83-.33-1.52-.98-2.06-.65-.55-1.48-1-2.5-1.33-1.01-.33-2.39-.7-4.11-1.1-2.67-.63-4.85-1.26-6.55-1.89s-3.15-1.64-4.37-3.04c-1.21-1.41-1.82-3.27-1.82-5.6 0-2.03.55-3.86 1.64-5.51 1.11-1.66 2.76-2.96 4.97-3.92 2.22-.97 4.93-1.46 8.13-1.46 2.22 0 4.4.27 6.53.8s4 1.3 5.59 2.3l-2.5 6.14c-3.23-1.82-6.45-2.74-9.67-2.74-2.27 0-3.95.37-5.03 1.1-1.07.73-1.61 1.69-1.61 2.89q0 1.8 1.86 2.67c1.25.59 3.16 1.16 5.72 1.72 2.66.63 4.85 1.27 6.55 1.9 1.69.63 3.14 1.63 4.36 2.99 1.21 1.37 1.82 3.21 1.82 5.55 0 2-.56 3.82-1.67 5.46q-1.68 2.475-5.01 3.93c-2.23.95-4.95 1.43-8.14 1.43m50.913-35.54v34.95h-8.08v-14.33h-15.88v14.33h-8.09V9.965h8.09v13.78h15.88V9.965zm29.811 27.47h-16.22l-3.1 7.48h-8.29l15.58-34.95h7.98l15.62 34.95h-8.48zm-2.55-6.15-5.55-13.37-5.53 13.37zm16.274-21.32h8.09v28.36h17.52v6.59h-25.61zm0 0' fill='black'/%3e%3c/g%3e%3c/svg%3e",alt:"ESHAL",className:ne("h-3",c?"opacity-60":"opacity-50"),onError:()=>Ae(!0)}),ue.afterBrand&&g("span",{className:ne("font-sans text-[10px] font-medium",c?"text-gray-400":"text-gray-500"),children:ue.afterBrand})]})})})]})},Ot=["sun","mon","tue","wed","thu","fri","sat"];function Ut(e){if(!e||"string"!=typeof e)return null;const t=e.match(/^(\d{1,2}):(\d{2})/);if(!t)return null;const o=parseInt(t[1],10),r=parseInt(t[2],10);return Number.isNaN(o)||Number.isNaN(r)?null:60*o+r}function Ht(e,t=new Date,o={}){if(!e||!e.showStatus)return null;const r=o.online||"Online now",a=o.officeOpen||"Online now",n=o.offlineFallback||"Offline";if("officeHours"!==e.statusMode)return{online:!0,label:r};const i=e.officeHours||{},{dayKey:s,minutes:l}=function(e,t){try{const o=new Intl.DateTimeFormat("en-US",{timeZone:e||void 0,weekday:"short",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),r=(o.find(e=>"weekday"===e.type)||{}).value||"";let a=parseInt((o.find(e=>"hour"===e.type)||{}).value||"0",10);const n=parseInt((o.find(e=>"minute"===e.type)||{}).value||"0",10);return 24===a&&(a=0),{dayKey:r.slice(0,3).toLowerCase(),minutes:60*a+n}}catch{return{dayKey:Ot[t.getDay()],minutes:60*t.getHours()+t.getMinutes()}}}(i.timezone,t),c=Array.isArray(i.days)?i.days.map(e=>String(e).slice(0,3).toLowerCase()):[],d=Ut(i.open),u=Ut(i.close);if(c.includes(s)&&(null!=d&&null!=u&&(d<=u?l>=d&&l<u:l>=d||l<u))){return{online:!0,label:(i.onlineMessage||"").trim()||a}}return{online:!1,label:(i.offlineMessage||"").trim()||n}}const qt=({conciergeName:e,companyName:a,companyLogo:i,primaryColor:s,isDark:l,isMinimized:c=!1,textColor:d,fontFamily:u,fontSize:p,onToggleTheme:m,onMinimize:b,onClose:f,headerTextBold:w=!1,headerTextItalic:v=!1,headerTextColor:y,headerFontFamily:k,headerFontSize:x,subtitle:C=null,showStatus:S=!1,statusMode:M="always",officeHours:P=null,onRefreshChat:z,onCopyChat:T,defaultLanguage:F="en"})=>{const L=s,N=y||"#FFFFFF",A=k||u||"Inter",I=x||p;at(A);const j=t(()=>X(F),[F]),E=Q(F),B=t(()=>J(C,E),[C,E]),R=t(()=>Ht({showStatus:S,statusMode:M,officeHours:P}),[S,M,P]),[D,V]=o(!1),$=r(null),O=r(null);n(()=>{if(!D)return;const e=e=>{$.current&&!e.composedPath().includes($.current)&&V(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[D]);const U=r(!1);n(()=>{if(D){U.current=!0;const e=$.current?.querySelector('[role="menuitem"]');e?.focus()}else U.current&&(U.current=!1,O.current?.focus())},[D]);const H=N;return h("div",{className:`text-white ${c?"px-4 py-2.5":"px-3 py-4"} flex items-center justify-between relative overflow-visible rounded-t-2xl z-[60]`,style:{background:L,fontFamily:A},children:[h("div",{className:"flex items-center gap-3 flex-1 min-w-0 pl-1",children:[h("div",{className:"relative w-11 h-11 flex-shrink-0",children:[g("div",{className:"w-full h-full rounded-full overflow-hidden flex items-center justify-center bg-white/20",children:i?g("img",{src:i,alt:"Logo",style:{display:"block",width:"100%",height:"100%",objectFit:"contain"},loading:"lazy"}):g("span",{className:"text-lg font-semibold leading-none",style:{color:H},children:(e||a||"")?.charAt(0)?.toUpperCase()})}),R?g("span",{title:R.label,className:ne("absolute bottom-0 h-3 w-3 rounded-full ring-2 ring-white",E?"left-0":"right-0"),style:{backgroundColor:R.online?"#22c55e":"#9ca3af",boxShadow:R.online?"0 0 0 3px rgba(34,197,94,0.25)":"none"},"aria-hidden":"true"}):null]}),h("div",{className:"flex flex-col justify-center min-w-0",style:{fontFamily:A},children:[g("h3",{title:e,className:ne("font-semibold leading-snug truncate",w&&"font-bold",v&&"italic"),style:{fontSize:I?`calc(${I} + 2px)`:"15px",color:H},children:e}),C?g("p",{title:C,className:"leading-snug truncate opacity-75",dir:B?"rtl":"ltr",style:{fontSize:"12px",color:H,textAlign:B?"right":"left"},children:C}):null]})]}),h("div",{className:"flex items-center gap-0 relative z-10 text-white flex-shrink-0 ml-1",children:[h("div",{className:"relative",ref:$,children:[g("button",{type:"button",ref:O,"aria-label":j("menu"),"aria-expanded":D,"aria-haspopup":"true",onClick:()=>V(e=>!e),onKeyDown:e=>{"Escape"===e.key&&D&&(e.preventDefault(),V(!1))},className:"inline-flex h-7 w-7 items-center justify-center cursor-pointer transition-opacity duration-200 hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40 rounded-full border-0 bg-transparent p-0",style:{color:H},children:g(Ve,{className:"w-4 h-4",strokeWidth:1.6})}),D&&h("div",{role:"menu","aria-label":j("menu"),dir:E?"rtl":"ltr",onKeyDown:e=>{if("Escape"===e.key)return e.preventDefault(),void V(!1);if("Tab"===e.key){const t=$.current?Array.from($.current.querySelectorAll('[role="menuitem"]')):[];if(0===t.length)return;const o=t[0],r=t[t.length-1],a=document.activeElement;e.shiftKey&&a===o?(e.preventDefault(),r.focus()):e.shiftKey||a!==r||(e.preventDefault(),o.focus())}},className:`absolute top-full mt-1 w-44 rounded-xl border shadow-lg py-1 z-[9999] animate-in fade-in slide-in-from-top-1 duration-150 ${E?"left-0":"right-0"} ${l?"bg-gray-800 border-gray-700":"bg-white border-gray-200"}`,style:{fontFamily:A},children:[h("button",{role:"menuitem",onClick:()=>{V(!1),z?.()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm leading-5 transition-colors cursor-pointer "+(l?"text-gray-200 hover:bg-gray-700":"text-gray-700 hover:bg-gray-50"),style:{fontFamily:A,fontSize:"14px",border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",textAlign:E?"right":"left"},children:[g(We,{className:"w-3.5 h-3.5 flex-shrink-0"}),j("refreshChat")]}),h("button",{role:"menuitem",onClick:()=>{V(!1),T?.()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm leading-5 transition-colors cursor-pointer "+(l?"text-gray-200 hover:bg-gray-700":"text-gray-700 hover:bg-gray-50"),style:{fontFamily:A,fontSize:"14px",border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",textAlign:E?"right":"left"},children:[g(De,{className:"w-3.5 h-3.5 flex-shrink-0"}),j("copyChat")]}),h("button",{role:"menuitem",onClick:()=>{V(!1),m?.()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm leading-5 transition-colors cursor-pointer "+(l?"text-gray-200 hover:bg-gray-700":"text-gray-700 hover:bg-gray-50"),style:{fontFamily:A,fontSize:"14px",border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",textAlign:E?"right":"left"},children:[g(l?Ke:He,{className:"w-3.5 h-3.5 flex-shrink-0"}),j(l?"lightMode":"nightMode")]})]})]}),g("button",{type:"button","aria-label":j("close"),onClick:f,className:"inline-flex h-7 w-7 items-center justify-center cursor-pointer transition-opacity duration-200 hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40 rounded-full border-0 bg-transparent p-0",style:{color:H},children:g(Xe,{className:"w-3.5 h-3.5",strokeWidth:1.6})})]})]})},Wt=({questions:e=[],collapsiblePrompt:a,onSubmit:n,primaryColor:i="#2563eb",isRtl:s=!1,isDark:l=!1,defaultLanguage:c="en"})=>{const d=t(()=>X(c),[c]),[u,p]=o({}),[m,b]=o({}),[f,w]=o(!1),v=r({}),y=[...e].sort((e,t)=>se(e.fieldType)-se(t.fieldType));return g("div",{className:"flex flex-col items-center justify-center p-5 h-full min-h-0 z-50 relative ",style:l?{backgroundColor:"#10141C"}:void 0,children:h("div",{className:"w-full max-w-sm rounded-3xl shadow-xl border p-8 transition-colors duration-300 bg-white border-gray-100",style:l?{backgroundColor:"#1E232B",border:"1px solid #2A303C",borderRadius:"14px"}:void 0,children:[a&&g("div",{className:"mb-5 text-left",children:g("h3",{className:"transition-colors duration-300 text-h4 font-semibold "+(l?"text-white":"text-[#4A5568]"),children:a})}),h("form",{onSubmit:async e=>{e.preventDefault();const t=(()=>{const e={};return y.forEach(t=>{const o=t.fieldType||"question",r=(u[o]??"").trim(),a=t.collectionPrompt||t.askToType||t.question||t.label||o,n=!0===t.required||"true"===t.required;r?("fullName"!==o&&"name"!==o||r.length<2&&(e[o]=d("nameInvalid")),"email"!==o||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)||(e[o]=d("emailInvalid")),"phone"!==o&&"mobileno"!==o||/^[+]?[\d\s-]{8,15}$/.test(r)||(e[o]=d("phoneInvalid"))):n&&(e[o]="email"===o?d("emailRequired"):"fullName"===o||"name"===o?d("nameRequired"):"phone"===o||"mobileno"===o?d("phoneRequired"):`${a} ${d("fieldRequiredSuffix")}`)}),b(e),e})();if(Object.keys(t).length>0){const e=y.map((e,t)=>e.fieldType||`question_${t}`).find(e=>t[e]);return void v.current[e]?.focus()}w(!0);try{await n(u)}finally{w(!1)}},className:"space-y-4",noValidate:!0,children:[y.map((e,t)=>{const o=e.fieldType||`question_${t}`,r=e.collectionPrompt||e.askToType||e.question||e.label;if(!r?.trim())return null;let a="text";"email"===o&&(a="email"),"phone"!==o&&"mobileno"!==o||(a="tel");const n=(o||"").toLowerCase(),i="fullname"===n||"name"===n||"username"===n,c="phone"===n||"mobileno"===n,f="email"===n?d("onboardingEmailPlaceholder"):i?d("onboardingNamePlaceholder"):c?d("onboardingPhonePlaceholder"):r,w=m[o],y="w-full h-12 rounded-lg text-sm px-4 outline-none border transition-colors focus:ring-0 "+(l?"text-white placeholder:text-[#A2A9B2] focus:border-[#5A6069]":"bg-white text-gray-900 placeholder:text-[#8C8C8C] focus:border-[#B0B0B0]"),k=w?"!border-status-error focus:!border-status-error":"",x=`onboarding-field-${o}`,C=`${x}-error`;return h("div",{className:"space-y-1",children:[g("label",{htmlFor:x,className:"sr-only",children:r}),g("input",{id:x,ref:e=>{v.current[o]=e},placeholder:f,type:a,value:u[o]??"",onChange:e=>((e,t)=>{p(o=>({...o,[e]:t})),m[e]&&b(t=>{const o={...t};return delete o[e],o})})(o,e.target.value),className:`${y} ${k}`,"aria-invalid":w?"true":"false","aria-describedby":w?C:void 0,style:{direction:s?"rtl":"ltr",...l?{backgroundColor:"#272C35",borderWidth:"1px",borderStyle:"solid",borderColor:w?void 0:"#3F444C"}:{borderWidth:"1px",borderStyle:"solid",borderColor:w?void 0:"#E0E0E0"}}}),w&&g("p",{id:C,role:"alert",className:"text-xs text-status-error px-1",children:m[o]})]},o)}),g("button",{type:"submit",disabled:f,"aria-busy":f,"aria-label":f?d("submitting"):void 0,className:"w-full h-12 text-sm border-none font-semibold shadow-xl hover:shadow-xl hover:scale-[1.02] active:scale-[0.98] transition-all rounded-xl mt-4 text-white",style:{backgroundColor:i},children:f?g(Oe,{className:"w-5 h-5 animate-spin","aria-hidden":"true"}):d("startChat")})]})]})})},_t=({categories:e=[],selectedCategoryId:t=null,onSelect:i,isDark:s=!1,primaryColor:l="#2563eb",fontFamily:c="Inter",isRtl:d=!1})=>{const u=r(null),[p,m]=o(!1),[b,f]=o(!1),w=a(()=>{const e=u.current;if(!e)return;const{scrollLeft:t,scrollWidth:o,clientWidth:r}=e;m(Math.abs(t)>1),f(Math.abs(t)+r<o-1)},[]);n(()=>{w();const e=u.current;if(!e)return;const t=new ResizeObserver(w);return t.observe(e),()=>t.disconnect()},[w,e]);const v=a(e=>{const t=u.current;if(!t)return;const o="left"===e?-150:150;t.scrollBy({left:d?-o:o,behavior:"smooth"})},[d]);if(!Array.isArray(e)||0===e.length)return null;const y=s?"rgba(31,41,55,0.85)":"rgba(255,255,255,0.95)",k=s?"#e5e7eb":"#374151",x=s?"#4b5563":"#d1d5db";return h("div",{className:"flex-shrink-0 px-2 py-2 border-b flex items-center gap-1",style:{backgroundColor:s?"#111827":"#ffffff",borderColor:s?"#374151":"#e5e7eb",fontFamily:c,direction:d?"rtl":"ltr"},role:"region","aria-label":"Filter by category",children:[g("button",{type:"button",onClick:()=>v("left"),disabled:!p,"aria-label":"Scroll categories left",className:"flex-shrink-0 flex items-center justify-center w-6 h-6 rounded-full transition-all duration-200",style:{backgroundColor:y,border:`1px solid ${x}`,color:k,opacity:p?1:.3,cursor:p?"pointer":"default"},children:g(Ee,{size:14})}),g("div",{ref:u,onScroll:w,className:"flex-1 flex gap-2 overflow-x-auto",style:{scrollBehavior:"smooth",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map(e=>{const o=t===e.id;return g("button",{type:"button",onClick:()=>i?.(o?null:e.id),"aria-pressed":o,className:"flex-shrink-0 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium transition-all duration-150 whitespace-nowrap",style:{backgroundColor:s?"#1f2937":"#ffffff",border:o?`1.5px solid ${l}`:"1px solid "+(s?"#374151":"#e5e7eb"),color:o?l:s?"#e5e7eb":"#374151",fontFamily:c},children:g("span",{children:e.label})},e.id)})}),g("button",{type:"button",onClick:()=>v("right"),disabled:!b,"aria-label":"Scroll categories right",className:"flex-shrink-0 flex items-center justify-center w-6 h-6 rounded-full transition-all duration-200",style:{backgroundColor:y,border:`1px solid ${x}`,color:k,opacity:b?1:.3,cursor:b?"pointer":"default"},children:g(Be,{size:14})})]})},Yt=({categories:e=[],selectedCategoryId:t=null,onSelect:o,isDark:r=!1,primaryColor:a="#2563eb",fontFamily:n="Inter",fontSize:i="14px",isRtl:s=!1,label:l="Choose a topic to get started:"})=>{if(!Array.isArray(e)||0===e.length)return null;return h("div",{className:"pl-[50px] pt-1",style:{direction:s?"rtl":"ltr",paddingLeft:s?0:50,paddingRight:s?50:void 0},role:"region","aria-label":"Category filter",children:[g("div",{className:"mb-2",style:{color:r?"#9ca3af":"#6b7280",fontFamily:n,fontSize:`calc(${i} - 1px)`},children:l}),g("div",{className:"flex flex-wrap gap-2",children:e.map(e=>{const s=t===e.id;return g("button",{type:"button",onClick:()=>o?.(s?null:e.id),"aria-pressed":s,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full transition-all duration-150 hover:scale-[1.02] active:scale-[0.98]",style:{backgroundColor:r?"#1f2937":"#ffffff",border:s?`1.5px solid ${a}`:"1px solid "+(r?"#374151":"#e5e7eb"),color:s?a:r?"#e5e7eb":"#374151",fontFamily:n,fontSize:`calc(${i} - 1px)`,fontWeight:500},children:e.label},e.id)})})]})};const Qt=[{value:"😡",label:"😡",bg:"bg-red-200"},{value:"😕",label:"😕",bg:"bg-orange-200"},{value:"😐",label:"😐",bg:"bg-yellow-200"},{value:"😊",label:"😊",bg:"bg-green-200"},{value:"😍",label:"😍",bg:"bg-pink-200"}],Kt=[{value:"positive",label:"👍"},{value:"negative",label:"👎"}],Gt=[{value:"1",label:"1"},{value:"2",label:"2"},{value:"3",label:"3"},{value:"4",label:"4"},{value:"5",label:"5"}],Jt=[{value:"1",label:"⭐"},{value:"2",label:"⭐"},{value:"3",label:"⭐"},{value:"4",label:"⭐"},{value:"5",label:"⭐"}],Xt=({format:e="EMOJI",prompt:r="How was your experience?",onRating:a,disabled:n=!1,isDark:i=!1,primaryColor:s="#2563eb",defaultLanguage:l="en"})=>{const c=t(()=>X(l),[l]),[d,u]=o(null),[p,m]=o(null),[b,f]=o(!1),w=async t=>{if(!n&&!b){u(t),f(!0);try{a&&a(t,e)}finally{f(!1)}}},v=(()=>{switch(e){case"THUMBS":return Kt;case"NUMERIC":return Gt;case"STARS":return Jt;default:return Qt}})();return h("div",{className:ne("transition-all duration-200 rounded-xl px-4",i?"bg-slate-800/50":"bg-slate-50/50"),children:[g("p",{className:ne("text-sm font-semibold text-center mb-3",i?"text-gray-300":"text-gray-500/80"),children:r}),h("div",{className:"flex justify-center items-center",children:["EMOJI"===e&&g("div",{className:"flex gap-2 justify-center items-center",children:v.map(e=>g("button",{onClick:()=>w(e.value),disabled:n||b,className:ne("flex items-center justify-center text-2xl transition-transform","bg-transparent border-0 p-0 cursor-pointer","hover:scale-110 active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed","focus:outline-none focus:ring-0",d===e.value?"":"opacity-80"),children:g("span",{role:"img","aria-label":`${c("rate")} ${e.value}`,children:e.label})},e.value))}),"THUMBS"===e&&g("div",{className:"flex gap-6 justify-center items-center",role:"group","aria-label":c("rateExperience"),children:v.map(e=>g("button",{"aria-label":1===e.value?c("thumbsUp"):c("thumbsDown"),onClick:()=>w(e.value),disabled:n||b,className:ne("w-10 h-10 rounded-xl border flex items-center justify-center shadow-md text-2xl transition-all","hover:scale-105 active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed","drop-shadow-md",i?"bg-gray-700 border-gray-600 hover:bg-gray-600":"bg-white border-gray-100 hover:bg-gray-50",d===e.value&&"ring-2 ring-primary/40 scale-110"),style:{borderColor:d===e.value?s:void 0},children:g("span",{className:"drop-shadow-md","aria-hidden":"true",children:e.label})},e.value))}),"NUMERIC"===e&&g("div",{className:"flex gap-2 justify-center items-center",role:"group","aria-label":c("rateExperience"),children:v.map(e=>g("button",{"aria-label":`${c("rate")} ${e.value}`,onClick:()=>w(e.value),disabled:n||b,className:ne("w-10 h-10 rounded-lg flex items-center justify-center text-sm font-semibold transition-all","hover:scale-105 active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed",d===e.value?"ring-2 ring-primary/40 scale-110 shadow-md text-white":i?"bg-gray-700 border border-gray-600 text-gray-300 hover:bg-gray-600":"bg-white border border-gray-200 text-gray-700 hover:bg-gray-50"),style:{backgroundColor:d===e.value?s:void 0,borderColor:d===e.value?s:void 0},children:e.label},e.value))}),"STARS"===e&&g("div",{className:"flex gap-2 justify-center items-center",onMouseLeave:()=>m(null),children:v.map(e=>{const t=p===e.value;return g("button",{onClick:()=>w(e.value),onMouseEnter:()=>m(e.value),disabled:n||b,className:ne("flex items-center justify-center text-2xl","bg-transparent border-0 p-0 cursor-pointer focus:outline-none","disabled:opacity-50 disabled:cursor-not-allowed"),style:{transform:t?"scale(1.25)":"scale(1)",filter:t?"brightness(1.1) drop-shadow(0 2px 4px rgba(0,0,0,0.15))":"none",opacity:t?1:.6,transition:"all 0.2s ease"},"aria-label":`${c("rate")} ${e.value}`,children:g("span",{"aria-hidden":"true",children:e.label})},e.value)})})]}),b&&g("p",{"aria-live":"polite",className:ne("text-xs mt-3 text-center",i?"text-slate-400":"text-slate-500"),children:c("submittingFeedback")})]})};async function Zt({apiBaseUrl:e,conversationId:t,chip:o,submitText:r,position:a,source:n="widget",getAuthToken:i,enabled:s=!0}={}){try{if(!1===s)return!1;if(!e||"string"!=typeof e)return!1;if(!t||"string"!=typeof t)return!1;const l=function({chip:e,submitText:t,position:o,conversationId:r,source:a="widget"}={}){const n=e&&"object"==typeof e,i=n&&"string"==typeof e.text?e.text:"",s="string"==typeof t&&t?t:n&&"string"==typeof e.submitText?e.submitText:"string"==typeof e?e:"",l=i||s;if(!l)return null;const c={conversationId:r,chipText:l,submitText:s||void 0,position:Number.isInteger(o)?o:void 0,source:a},d=n?e?.promptId:void 0;return"string"==typeof d&&d&&(c.promptId=d),c}({chip:o,submitText:r,position:a,conversationId:t,source:n});if(!l)return!1;const c=`${e.replace(/\/$/,"")}/api/v1/support/chip-click`,d=JSON.stringify(l);let u;if("function"==typeof i)try{u=await i()}catch{u=void 0}if(!u&&"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon&&"undefined"!=typeof Blob)try{if(navigator.sendBeacon(c,new Blob([d],{type:"application/json"})))return!0}catch{}if("function"!=typeof fetch)return!1;const g={"Content-Type":"application/json"};return u&&(g.Authorization=`Bearer ${u}`),await fetch(c,{method:"POST",headers:g,credentials:"include",keepalive:!0,body:d}),!0}catch{return!1}}const eo="#ffffff",to="#f5f5f5",oo="#000000",ro="#1f2937",ao="#f3f4f6",no="#2563eb",io="eshal:widget:size",so=(e,t)=>!e||(e=>e?.trim().toLowerCase())(e)===t,lo=e=>(e instanceof Date?e:new Date(e)).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}).replace(/am|pm/i,e=>e.toUpperCase()),co=e=>{const t=(e||"EMOJI").toString().trim().toUpperCase();return"THUMBS"===t||"THUMB"===t?"THUMBS":"STARS"===t||"STAR"===t?"STARS":"NUMERIC"===t||"NUMBER"===t?"NUMERIC":"EMOJI"},uo=({isOpen:e,isMinimized:i,isDark:s,onStopGeneration:l,primaryColor:c,textColor:d,conciergeName:u,companyName:m,companyLogo:b,chatbotAvatarEnabled:f,chatbotAvatar:w,messages:v,isLoading:y,isConversationLoading:k=!1,inputValue:x,setInputValue:C,onSend:S,onDirectSend:M,onToggleTheme:P,onMinimize:z,onClose:T,quickQuestions:F=[],quickQuestionsEnabled:L,onQuickQuestion:N,quickQuestionsLayout:A="vertical",agentMessageBubbleColor:I,userMessageBoxColor:j,assistantTextColor:E,userTextColor:B,fontFamily:R="Inter",agentMessageBubbleFontFamily:D,agentMessageBubbleFontSize:V,userMessageBubbleFontFamily:$,userMessageBubbleFontSize:O,fontSize:U="14px",defaultLanguage:H="en",onDecision:q,headerTextBold:W=!1,headerTextItalic:_=!1,headerTextColor:Y,headerFontFamily:K,headerFontSize:G,subtitle:J=null,showStatus:Z=!1,statusMode:ee="always",officeHours:te=null,enableVoiceInteraction:oe=!1,isVoiceSessionActive:re=!1,voiceStatus:ae="idle",voiceError:ie=null,voiceConclusionForCsat:se=!1,onVoiceToggle:ce,onBidiSubmit:de,disclaimerEnabled:ue=!1,disclaimerText:ge,disclaimerPosition:he="top",disclaimerLinkUrl:me,disclaimerLinkLabel:be,showPoweredBy:fe=!0,apiBaseUrl:we,apiKey:ve,getAuthToken:ye,conversationId:ke,conciergeId:xe,onboardingQuestions:Ce=[],onboardingActive:Se=!1,onboardingCompleted:Me=!1,onOnboardingFormSubmit:Pe,collectionPrompt:ze,csatEnabled:Te=!1,csatFormat:Fe="EMOJI",csatPrompt:Le="How was your experience?",onPromptSuggestionClick:Ne,onboardingEnabled:Ae=!1,onResetConversation:Ie,sessionExpiringSoon:je=!1,autoPromptEnabled:Ee=!0,autoPromptQuestionDisplay:Be=!0,autoPromptClickTelemetry:Re=!0,allowFeedback:De=!0,provideCitations:Ve=!0,onFeedback:$e,onRetryMessage:Oe,onRefreshChat:Ue,onCopyChat:He,filterCategories:qe=[],showFilterStep:We=!1,widgetFilter:_e=null,onWidgetFilterChange:Ye,onSynthesizeAssistantMessage:Ke,launcherPosition:Ge="bottom-right",chatFeatures:Je,organizationId:Xe})=>{at(R);const Ze=r(null),et=r(null),tt=t(()=>X(H),[H]);n(()=>{et.current?.focus()},[]);const ot=a((e,t,o)=>{Zt({apiBaseUrl:we,conversationId:ke,chip:t,submitText:null==e?void 0:String(e),position:o,source:"widget",getAuthToken:ye,enabled:Re})},[we,ye,ke,Re]),rt=a((e,t,o)=>{t&&"object"==typeof t&&ot(e,t,o),Ne?Ne(e):M?.(e)},[Ne,M,ot]),nt=Ge.includes("right"),it=Ge.includes("bottom"),[st,lt]=o(()=>{if("undefined"==typeof window)return null;try{const e=window.localStorage.getItem(io);if(!e)return null;const t=JSON.parse(e);if("number"==typeof t?.width&&"number"==typeof t?.height&&t.width>=320&&t.height>=400)return t}catch{}return null}),ct=r(null),dt=r({x:0,y:0}),ut=r({width:380,height:650});n(()=>{const e=e=>{const t=ct.current;if(!t)return;const o=e.clientX-dt.current.x,r=e.clientY-dt.current.y,a={...ut.current},n=.92*window.innerWidth,i=.85*window.innerHeight;if("corner"===t||"horizontal"===t){const e=nt?ut.current.width-o:ut.current.width+o;a.width=Math.min(Math.max(320,e),n)}if("corner"===t||"vertical"===t){const e=it?ut.current.height-r:ut.current.height+r;a.height=Math.min(Math.max(400,e),i)}lt(a)},t=()=>{ct.current&&(ct.current=null,document.body.style.cursor="",document.body.style.userSelect="")};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[nt,it]),n(()=>{if(st)try{window.localStorage.setItem(io,JSON.stringify(st))}catch{}},[st]);const gt=(e,t)=>{t.preventDefault(),t.stopPropagation(),ct.current=e,dt.current={x:t.clientX,y:t.clientY},ut.current=st??{width:380,height:650};const o={corner:nt===it?"nwse-resize":"nesw-resize",horizontal:"ew-resize",vertical:"ns-resize"};document.body.style.cursor=o[e],document.body.style.userSelect="none"},[ht,pt]=o(!1),[mt,bt]=o(()=>{try{return pe(Xe)?.csatSubmitted??!1}catch{return!1}}),[ft,wt]=o(!1),[vt,yt]=o(!1),[kt,xt]=o(0),[Ct,St]=o(""),[Mt,Pt]=o(!1);n(()=>{try{const e=pe(Xe)?.csatSubmitted??!1;bt(e),e&&pt(!1)}catch{}},[ke]),function(e,t=[],o={}){const{enabled:a=!0,threshold:i=30,behavior:s="smooth",delay:l=0}=o,c=r(!0);r(0),n(()=>{if(!a||!e.current)return;const t=e.current,o=()=>{const e=t.scrollHeight-t.scrollTop-t.clientHeight;c.current=e<i},r=()=>{o()};t.addEventListener("scroll",r,{passive:!0}),o();const n=setTimeout(()=>{c.current&&t&&t.scrollTo({top:t.scrollHeight,behavior:s})},l);return()=>{t.removeEventListener("scroll",r),clearTimeout(n)}},[e,a,i,s,l,...t])}(Ze,[v,y],{enabled:!0,threshold:30,behavior:"smooth",delay:0});const zt=Q(H),Tt=t(()=>s?so(I,eo)?ro:I||ro:I||eo,[I,s]),Ft=t(()=>s?so(d,oo)?ao:d||ao:d||oo,[s,d]),Lt=t(()=>s?so(j,to)?c||no:j||c||no:j||to,[s,c,j]),Nt=tt(vt?"conversationResolved":"typeYourMessage"),At=v?.some?.(e=>"user"===e.role),jt=t(()=>(v||[]).filter(e=>"user"===e.role).length,[v]),[Et,Bt]=o(0),Rt=_e?.category?(qe||[]).find(e=>e.id===_e.category):null,Dt=a(e=>{if(!Ye)return;const t=_e?.category||null;if(e){if(Ye({category:e,tags:[]}),Bt(jt),!At&&e!==t&&Ke){const t=(qe||[]).find(t=>t.id===e),o=t?.label||e,r=tt("categoryTopicsHeading").replace("{category}",o);Ke(r,{replaceMarker:"category-intro"})}}else Ye(null)},[Ye,_e,jt,qe,At,Ke,tt]);a(e=>{const t=_e?.category||Rt?.id;t&&Ye&&Ye({category:t,tags:[e]}),M&&M(e)},[_e,Rt,Ye,M]);const Vt=Array.isArray(qe)&&qe.length>0,Ot=Vt&&!At&&!_e?.category,Ut=!At&&F.length>0&&L&&!_e?.category,Ht=Ce&&Ce.length>0,Qt=Boolean(Te),Kt=Ae&&Ht&&!Me,Gt=a(async()=>{if(Qt&&!Mt&&!vt&&0!==kt){Pt(!0);try{const e={"Content-Type":"application/json"};if("function"==typeof ye){const t=await ye();t&&(e.Authorization=`Bearer ${t}`)}const t=co(Fe),o=await fetch(`${we.replace(/\/$/,"")}/api/v1/support/csat`,{method:"POST",headers:e,credentials:"include",body:JSON.stringify({conversationId:ke,rating:String(kt),ratingFormat:t,conciergeId:xe,feedback:Ct||void 0})});o.ok?(wt(!1),xt(0),St(""),Ye&&Ye(null),Ue?Ue():Ie&&Ie()):console.error("Failed to submit resolve feedback:",await o.text())}catch(e){console.error("Error submitting resolve feedback:",e)}finally{Pt(!1)}}},[Qt,Mt,vt,kt,Ct,ke,ye,xe,we,Fe,Ie,Ue,Ye]),Jt=a(()=>{if(!Qt||!ke||!At)return Ye&&Ye(null),Ue?Ue():Ie&&Ie(),void T?.();ft?(wt(!1),T?.()):vt?T?.():wt(!0)},[Qt,ke,At,ft,vt,T,Ye,Ue,Ie]);n(()=>{Qt||(ft&&wt(!1),vt&&yt(!1),0!==kt&&xt(0),Ct&&St(""))},[Qt,ft,vt,kt,Ct]);const uo=t(()=>{if(!v||!Array.isArray(v))return[];for(let e=v.length-1;e>=0;e-=1)if("assistant"===v[e]?.role){const t=v[e].prompts;return Array.isArray(t)?t:[]}return[]},[v]),go=r([]);n(()=>{uo.length>0?go.current=uo:v&&0!==v.length&&v.some(e=>"user"===e.role)||(go.current=[])},[uo,v]);const ho=r(jt);n(()=>{jt!==ho.current&&(ho.current=jt,go.current=[])},[jt]);const po=uo.length>0?uo:go.current;n(()=>{if(!Te)return;if(!ht)return;if(mt)return;const e=Ze.current;if(!e)return;const t=window.requestAnimationFrame(()=>{e.scrollTo({top:e.scrollHeight,behavior:"smooth"})});return()=>{window.cancelAnimationFrame(t)}},[ht,Te,mt]);const mo=()=>{const e=co(Fe);if("STARS"===e)return g("div",{className:"flex justify-center gap-2 mb-5",role:"group","aria-label":tt("rateExperience"),children:[1,2,3,4,5].map(e=>g("button",{"aria-label":`${tt("rate")} ${e}`,onClick:()=>xt(e),className:"transition-all duration-150 hover:scale-110 active:scale-95 bg-transparent border-0 p-0 cursor-pointer",disabled:Mt,children:g(Qe,{className:ne("w-8 h-8 transition-colors",e<=kt?"text-yellow-400 drop-shadow-sm":s?"text-gray-600":"text-gray-300"),fill:e<=kt?"#FBBF24":"none"})},e))});if("THUMBS"===e)return g("div",{className:"flex gap-4 justify-center mb-5",role:"group","aria-label":tt("rateExperience"),children:[{value:"positive",emoji:"👍"},{value:"negative",emoji:"👎"}].map(e=>g("button",{"aria-label":"positive"===e.value?tt("thumbsUp"):tt("thumbsDown"),onClick:()=>xt(e.value),disabled:Mt,className:ne("w-12 h-12 rounded-xl border flex items-center justify-center text-2xl transition-all hover:scale-105 active:scale-95",kt===e.value?"ring-2 ring-blue-300 scale-110 shadow-lg":"",s?"bg-gray-700 border-gray-600 hover:bg-gray-600":"bg-white border-gray-200 hover:bg-gray-50"),children:g("span",{className:"drop-shadow-md",children:e.emoji})},e.value))});return g("div",{className:"flex gap-2 justify-center items-center mb-5",role:"group","aria-label":tt("rateExperience"),children:[{value:1,emoji:"😡"},{value:2,emoji:"😕"},{value:3,emoji:"😐"},{value:4,emoji:"😊"},{value:5,emoji:"😍"}].map(e=>g("button",{"aria-label":`${tt("rate")} ${e.value}`,onClick:()=>xt(e.value),disabled:Mt,className:ne("rounded-full w-10 h-10 flex items-center justify-center text-xl transition-all hover:scale-110 active:scale-95 bg-transparent border-0 p-0 cursor-pointer",kt===e.value?"ring-2 ring-blue-100 scale-125 bg-gradient-to-b from-yellow-200 to-yellow-400 shadow-md":"grayscale-[0.3] opacity-80 hover:grayscale-0"),children:g("span",{role:"img","aria-label":`${tt("rate")} ${e.value}`,className:"drop-shadow-sm filter",children:e.emoji})},e.value))})};if(!e)return null;const bo=!i&&st?{width:st.width,height:st.height,maxWidth:"92vw",maxHeight:"85vh"}:void 0;return h("div",{dir:zt?"rtl":"ltr",className:"relative flex-shrink-0 z-50 "+(i?"w-80 h-auto":""),style:bo,children:[!i&&h(p,{children:[g("div",{onMouseDown:e=>gt("horizontal",e),className:"absolute top-0 h-full w-1.5 cursor-ew-resize hover:bg-blue-500/20 transition-colors z-[70] "+(nt?"left-0":"right-0"),"aria-hidden":!0}),g("div",{onMouseDown:e=>gt("vertical",e),className:"absolute left-0 w-full h-1.5 cursor-ns-resize hover:bg-blue-500/20 transition-colors z-[70] "+(it?"top-0":"bottom-0"),"aria-hidden":!0})]}),h("div",{id:"chat-window-panel",ref:et,role:"dialog","aria-modal":"true","aria-label":tt("openChat"),tabIndex:-1,className:`relative focus:outline-none ${st||i?"":"w-[380px]"} ${st||i?"":"h-[650px]"} ${i?"w-80 h-auto":""} ${st&&!i?"w-full h-full":""} max-w-[92vw] border rounded-2xl shadow-2xl bg-white border-gray-200 flex flex-col ${i?"":"max-h-[85vh]"} overflow-hidden ${s?"bg-gray-900 border-gray-700":""}`,children:[!i&&g("div",{onMouseDown:e=>gt("corner",e),"aria-hidden":"true",className:`absolute w-4 h-4 ${nt===it?"cursor-nwse-resize":"cursor-nesw-resize"} text-gray-400 hover:text-blue-500 transition-colors z-[71] flex p-0.5 ${it?"top-0 items-start":"bottom-0 items-end"} ${nt?"left-0 justify-start":"right-0 justify-end"}`,children:g("svg",{viewBox:"0 0 12 12",className:"w-3 h-3 "+(it&&nt?"rotate-180":it?"-rotate-90":nt?"rotate-90":""),"aria-hidden":!0,children:g("path",{d:"M11 1 L1 11 M11 5 L5 11 M11 9 L9 11",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"})})}),g(qt,{conciergeName:u,companyName:m,companyLogo:b,primaryColor:c,isDark:s,isMinimized:i,textColor:Ft,fontFamily:R,fontSize:U,onToggleTheme:P,onMinimize:z,onClose:Jt,headerTextBold:W,headerTextItalic:_,headerTextColor:Y,headerFontFamily:K,headerFontSize:G,subtitle:J,showStatus:Z,statusMode:ee,officeHours:te,onRefreshChat:Ue,onCopyChat:He,defaultLanguage:H}),!i&&Vt&&!Ot&&!(ft&&!vt)&&!(Se&&!Me)&&g(_t,{categories:qe,selectedCategoryId:_e?.category||null,onSelect:Dt,isDark:s,primaryColor:c,fontFamily:R,isRtl:zt}),!i&&h(p,{children:[g("div",{ref:Ze,role:"log","aria-live":"polite",className:`chat-messages flex-1 overflow-y-auto px-3 py-4 space-y-4 ${s?"bg-gray-900":"bg-gradient-to-b from-gray-50/50 to-white"} break-words`,children:ft&&!vt?g("div",{className:"animate-in slide-in-from-top-4 fade-in duration-300 mt-4 mx-2",children:h("div",{className:ne("w-full rounded-3xl p-6 shadow-lg",s?"bg-gray-800 shadow-black/20":"bg-white shadow-gray-200/80"),children:[g("p",{className:ne("text-sm font-medium text-center mb-5 [font-family:inherit]",s?"text-gray-300":"text-gray-500"),children:Le||tt("feedbackPrompt")}),mo(),g("textarea",{"aria-label":tt("feedbackPlaceholder"),value:Ct,onChange:e=>{e.target.value.length<=1e3&&St(e.target.value)},maxLength:1e3,placeholder:tt("feedbackPlaceholder"),rows:4,disabled:Mt,className:ne("w-full rounded-xl border px-4 py-3 text-sm [font-family:inherit] resize-none outline-none transition-colors mb-5",s?"bg-gray-700 border-gray-600 text-gray-100 placeholder-gray-400":"bg-gray-50 border-gray-200 text-gray-900 placeholder-gray-400")}),h("div",{className:"relative group",children:[g("button",{onClick:Gt,disabled:0===kt||Mt,"aria-describedby":0===kt?"resolve-rating-hint":void 0,className:ne("w-full py-3.5 rounded-xl text-sm font-semibold [font-family:inherit] transition-all duration-200 border-none outline-none focus:outline-none active:outline-none focus:ring-0 active:ring-0","disabled:opacity-50 disabled:cursor-not-allowed",s?"bg-gray-700 text-gray-100 hover:bg-gray-600":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:tt(Mt?"submitting":"submitFeedback")}),0===kt&&!Mt&&g("div",{id:"resolve-rating-hint",role:"tooltip",className:"absolute -top-8 left-1/2 -translate-x-1/2 whitespace-nowrap px-2 py-1 rounded-md text-xs bg-gray-800 text-white opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none",children:tt("selectRatingFirst")})]})]})}):Se&&!Me&&Pe?g(Wt,{questions:Ce,onPromptSuggestionClick:rt,collapsiblePrompt:ze,onSubmit:Pe,primaryColor:c,isRtl:zt,isDark:s,defaultLanguage:H}):h(p,{children:[je&&g("div",{role:"status",className:"mx-3 mt-1 mb-2 rounded-lg px-3 py-2 text-xs font-medium "+(s?"bg-amber-900/40 text-amber-200 border border-amber-700/50":"bg-amber-50 text-amber-800 border border-amber-200"),children:tt("sessionExpiringSoon")}),g(It,{messages:v,isDark:s,primaryColor:c,isLoading:y,agentMessageBubbleColor:I,userMessageBoxColor:j,textColor:d,assistantTextColor:E,userTextColor:B,fontFamily:R,agentMessageBubbleFontFamily:D,agentMessageBubbleFontSize:V,userMessageBubbleFontFamily:$,userMessageBubbleFontSize:O,fontSize:U,formatTime:lo,isRtl:zt,defaultLanguage:H,quickQuestions:F,shouldShowQuickQuestions:Ut,onQuickQuestion:N??M,quickQuestionsLayout:A,onDecision:q,disclaimerEnabled:ue,disclaimerText:ge,disclaimerPosition:he,disclaimerLinkUrl:me,disclaimerLinkLabel:be,resolvedAgentBubbleColor:Tt,resolvedUserMessageColor:Lt,resolvedTextColor:Ft,isVoiceSessionActive:re,voiceStatus:ae,messagesContainerRef:Ze,companyLogo:b,chatbotAvatarEnabled:f,chatbotAvatar:w,conciergeName:u,companyName:m,apiBaseUrl:we,getAuthToken:ye,onPromptSuggestionClick:rt,conversationResetKey:ke,allowFeedback:De,provideCitations:Ve,onFeedback:$e,onRetryMessage:Oe,headerTextColor:Y,beforePromptsSlot:Ot?g(Yt,{categories:qe,selectedCategoryId:_e?.category||null,onSelect:Dt,isDark:s,primaryColor:c,fontFamily:R,fontSize:U,isRtl:zt,label:tt("chooseTopicLabel")}):null,quickQuestionsHeadingLabel:Vt?tt("quickQuestionsHeadingLabel"):void 0}),ht&&Te&&!mt&&g("div",{className:"",children:g(Xt,{format:co(Fe),prompt:Le||tt("howWasYourExperience"),onRating:async(e,t)=>{bt(!0),pt(!1),(e=>{try{const t=pe(e);if(!t)return;t.csatSubmitted=!0,localStorage.setItem(`${le}_${e}`,JSON.stringify(t))}catch{}})(void 0);try{const o={"Content-Type":"application/json"};if("function"==typeof ye){const e=await ye();e&&(o.Authorization=`Bearer ${e}`)}const r=await fetch(`${we.replace(/\/$/,"")}/api/v1/support/csat`,{method:"POST",headers:o,credentials:"include",body:JSON.stringify({conversationId:ke,rating:e,ratingFormat:t,conciergeId:xe})});r.ok||console.error("CSAT submission failed:",await r.text())}catch(e){console.error("CSAT submission error:",e)}},disabled:!1,isDark:s,primaryColor:c,defaultLanguage:H})})]})}),!(Se&&!Me)&&g($t,{onStopGeneration:l,inputValue:x,setInputValue:C,onSend:S,isDark:s,primaryColor:c,isOpen:e,isMinimized:i,isLoading:y,isConversationLoading:k,placeholder:Nt,textColor:Ft,fontFamily:R,userMessageBubbleFontFamily:$,userMessageBubbleFontSize:O,fontSize:U,isRtl:zt,csatVisible:ht&&Te&&!mt||Qt&&(ft||vt),enableVoiceInteraction:oe,isVoiceSessionActive:re,voiceStatus:ae,voiceError:ie,onVoiceToggle:ce,onBidiSubmit:de,disclaimerEnabled:ue,disclaimerText:ge,disclaimerPosition:he,disclaimerLinkUrl:me,disclaimerLinkLabel:be,showPoweredBy:fe,defaultLanguage:H,onboardingQuestions:Ce,onboardingActive:Se,onboardingCompleted:Me,onboardingEnabled:Ae,userMessageBoxColor:j,resolvedUserMessageColor:Lt,userTextColor:B,promptSuggestions:ft||vt||!1===Ee||y?[]:po,onPromptSuggestionClick:rt,autoPromptQuestionDisplay:Be,tagSelectorNode:null,showResolveButton:Qt&&At&&!vt&&!ft&&!ht&&!Kt,onResolve:()=>{Qt&&wt(!0)},chatFeatures:Je,apiEndpoint:we,organizationId:Xe,conversationId:ke})]})]})]})},go=new Map;const ho=i(({isDark:e,primaryColor:o,onToggle:r,textColor:a,headerTextColor:n,defaultLanguage:i="en",isOpen:s=!1,className:l},c)=>{const d=t(()=>X(i),[i]),u=n||"#FFFFFF";return h("button",{ref:c,onClick:r,className:`group relative w-16 h-16 rounded-full shadow-2xl transition-all duration-300 flex items-center justify-center text-white overflow-hidden hover:scale-110 ${l||""}`,style:{background:`linear-gradient(135deg, ${o} 0%, ${o}dd 100%)`,boxShadow:`0 10px 30px ${o}40`,border:"none"},"aria-label":d(s?"closeChat":"openChat"),"aria-expanded":s,"aria-controls":"chat-window-panel",children:[g("div",{className:"absolute inset-0 rounded-full bg-white/20 scale-0 group-hover:scale-100 transition-transform duration-500"}),g("div",{className:"relative z-10 transition-transform duration-300",children:g(Ue,{className:"w-7 h-7",style:{color:u}})})]})});ho.displayName="ToggleButton";const po="0.2.12",mo=({getAuthToken:i,apiBaseUrl:s,darkMode:l,primaryColor:c,position:d,companyName:u,conciergeName:p,companyLogo:m,welcomeMessage:b,quickQuestions:f,quickQuestionsEnabled:w,quickQuestionsLayout:v="vertical",textColor:y,agentMessageBubbleColor:k,userMessageBoxColor:x,assistantTextColor:C,userTextColor:S,fontFamily:M,fontSize:P,defaultLanguage:z,apiKey:T,agentMessageBubbleFontFamily:F,agentMessageBubbleFontSize:L,userMessageBubbleFontFamily:N,userMessageBubbleFontSize:A,autoOpen:I=!1,openDelay:j=0,locale:E,className:B="",headerTextBold:R,headerTextItalic:D,enableVoiceInteraction:V,disclaimerEnabled:$,disclaimerText:O,disclaimerPosition:U,disclaimerLinkUrl:H,disclaimerLinkLabel:q,showPoweredBy:W,onboardingQuestions:_,collectionPrompt:Y,allowedDomains:Q,onboardingEnabled:K,wsBaseUrl:G})=>{const[J,X]=o(null),[Z,ee]=o(!0),[te,oe]=o(null),[re,ne]=o(!1),ie=e.useRef(!1);n(()=>{if(ie.current)return;(async()=>{if(!s)return oe("apiBaseUrl is required"),void ee(!1);try{ee(!0);const e=await(async(e,t)=>{if(!e)throw new Error("apiBaseUrl is required");try{const o=e.replace(/\/$/,""),r=po?`${o}/api/v1/deploy-agent?wv=${encodeURIComponent(po)}`:`${o}/api/v1/deploy-agent`,a={"Content-Type":"application/json"};if("function"==typeof t){const e=await t();e&&(a.Authorization=`Bearer ${e}`)}const n=await fetch(r,{method:"GET",headers:a,credentials:"include"});if(404===n.status)return null;if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(e){throw console.error("Failed to fetch agent configuration:",e),e}})(s,i);if(null===e)return ie.current=!0,ne(!0),X(null),void oe(null);X(e),oe(null)}catch(e){console.error("Failed to load agent configuration:",e),oe(e.message||"Failed to load configuration")}finally{ee(!1)}})()},[s,i]);const se=t(()=>{if(!J)return null;const e=J.config??{},t=e.identity??{},o=e.branding??{},r=e.typography??{},a=e.messages??{},n=e.voice??{},i=e.onboarding??{},s=e.disclaimer??{},g=e.csat??{},h=e.inactivity??{},v=e.behavior??{},T=e.security??{},I=e.layout??{},j=z??a.defaultLocale??"en",E=a.bundles?.[j]??{},B=a.bundles?.en??{},G={welcome:E.welcome||B.welcome,fallback:E.fallback||B.fallback,quickQuestions:Array.isArray(E.quickQuestions)&&E.quickQuestions.length>0?E.quickQuestions:B.quickQuestions},X=Q??T.allowedDomains??(T.domains??[]).map(e=>"string"==typeof e?e:e.domain).filter(Boolean)??[];return{darkMode:l??!1,primaryColor:c??o.brandColor??"#2563eb",companyName:u??t.companyName??"Support Team",conciergeName:p??t.conciergeName,companyLogo:m??o.avatar??null,chatbotAvatarEnabled:o.chatbotAvatarEnabled??!1,chatbotAvatar:o.chatbotAvatar??null,welcomeMessage:b??G.welcome??"Hi! How can we help?",fallbackMessage:G.fallback,quickQuestions:f??G.quickQuestions??[],quickQuestionsEnabled:w??a.quickQuestionsEnabled,textColor:y??"#000000",agentMessageBubbleColor:k??r.agentMessageBubbleColor,userMessageBoxColor:x??r.userMessageBoxColor,assistantTextColor:C??r.assistantTextColor??"#000000",userTextColor:S??r.userTextColor??"#000000",fontFamily:M??r.agentMessageBubbleFontFamily??"Inter",fontSize:P??r.agentMessageBubbleFontSize??"14px",defaultLanguage:j,headerTextBold:R??r.headerTextBold??!1,headerTextItalic:D??r.headerTextItalic??!1,headerTextColor:r.headerTextColor??"#FFFFFF",headerFontFamily:r.headerFontFamily,headerFontSize:r.headerFontSize,subtitle:t.subtitle??null,showStatus:t.showStatus??!1,statusMode:t.statusMode??"always",officeHours:t.officeHours??null,enableVoiceInteraction:V??n.enableVoiceInteraction??!1,disclaimerEnabled:$??s.enabled??!1,disclaimerText:O??s.text,disclaimerPosition:U??(Z=s.position,Z?Z.toLowerCase():"top"),disclaimerLinkUrl:ae(H??s.linkUrl),disclaimerLinkLabel:q??s.linkLabel,showPoweredBy:W??o.showPoweredBy??!0,onboardingQuestions:_??i.questions??[],collectionPrompt:Y??i.collapsiblePrompt??"Before we begin, I need to verify your details.",allowedDomains:X,launcherPosition:d??(e=>e?e.toLowerCase().replace(/_/g,"-"):"bottom-right")(I.launcherPosition),onboardingEnabled:K??i.enabled??!1,inactivityTimeoutValue:h.timeoutValue??null,inactivityTimeoutUnit:h.timeoutUnit??null,agentMessageBubbleFontFamily:F??r.agentMessageBubbleFontFamily??M??"Inter",agentMessageBubbleFontSize:L??r.agentMessageBubbleFontSize??P??"14px",userMessageBubbleFontFamily:N??r.userMessageBubbleFontFamily??M??"Inter",userMessageBubbleFontSize:A??r.userMessageBubbleFontSize??P??"14px",csatEnabled:g.enabled??!1,csatFormat:g.format??"EMOJI",csatPrompt:g.prompt??"How was your experience?",autoPromptEnabled:v.autoPromptEnabled??!0,autoPromptQuestionDisplay:v.autoPromptQuestionDisplay??!0,autoPromptClickTelemetry:v.autoPromptClickTelemetry??!0,allowFeedback:v.allowFeedback??!0,provideCitations:v.provideCitations??!0,organizationId:J.organizationId??null,chatFeatures:e.chatFeatures??null};var Z},[J,l,c,d,u,p,m,b,f,w,y,k,x,C,S,M,P,z,R,D,V,$,O,U,q,H,W,_,K,Y,Q,F,L,N,A]),le=t(()=>!se||((e=[])=>{if("undefined"==typeof window)return!1;const t=window.location.hostname.toLowerCase(),o=window.location.host.toLowerCase();return!(!e||0===e.length)&&e.some(e=>{const r=e.toLowerCase().trim();return r.includes(":")?o===r:t===r||t.endsWith("."+r)})})(se.allowedDomains),[se]),ce=t(()=>({welcomeMessage:"Hi! How can we help?",quickQuestions:[],apiBaseUrl:s||"",apiKey:T||"",getAuthToken:i,autoOpen:!1,openDelay:0,darkMode:!1,enableVoiceInteraction:!1,onboardingQuestions:[],onboardingEnabled:!1,collectionPrompt:void 0}),[s,T,i]),{isOpen:de,isMinimized:ue,isDark:ge,messages:he,inputValue:pe,isLoading:me,widgetRef:be,setInputValue:fe,handleSend:we,stopGeneration:ve,handleQuickQuestion:ye,sendMessage:ke,retryMessage:xe,toggleChat:Ce,toggleTheme:Se,toggleMinimize:Me,closeChat:ze,handleDecision:Te,isVoiceSessionActive:Fe,voiceStatus:Le,voiceError:Ne,voiceConclusionForCsat:Ae,handleVoiceToggle:Ie,sendBidiTextMessage:je,onboardingActive:Ee,onboardingCompleted:Be,handleOnboardingFormSubmit:Re,conversationId:De,resetConversation:Ve,sessionExpiringSoon:$e,updateMessageFeedback:Oe,widgetFilter:Ue,setWidgetFilter:He,addAssistantMessage:qe}=Pe(se?{welcomeMessage:se.welcomeMessage,fallbackMessage:se.fallbackMessage,quickQuestions:se.quickQuestions,apiBaseUrl:s,wsBaseUrl:G??J?.wsBaseUrl,apiKey:T,locale:se.defaultLanguage||E,organizationId:se.organizationId,getAuthToken:i,autoOpen:I,openDelay:j,darkMode:se.darkMode,enableVoiceInteraction:se.enableVoiceInteraction,onboardingQuestions:se.onboardingQuestions,onboardingEnabled:se.onboardingEnabled,collectionPrompt:se.collectionPrompt,provideCitations:se.provideCitations,inactivityTimeoutValue:se.inactivityTimeoutValue,inactivityTimeoutUnit:se.inactivityTimeoutUnit,messageLimits:J?.messageLimits}:ce),We=r(null),_e=r(de);n(()=>{_e.current&&!de&&We.current?.focus(),_e.current=de},[de]);const Ye=a((e,t,o)=>{if(Oe(e,t),!De||!s)return;const r=s.replace(/\/$/,"");(async()=>{try{const a={"Content-Type":"application/json"};if("function"==typeof i){const e=await i();e&&(a.Authorization=`Bearer ${e}`)}await fetch(`${r}/api/v1/support/feedback`,{method:"POST",headers:a,credentials:"include",body:JSON.stringify({messageContent:e,conversationId:De,feedback:t,feedbackText:o})})}catch(e){console.error("Feedback submission error:",e)}})()},[De,s,i,Oe]),Qe=a(()=>{Ve&&Ve()},[Ve]),{categories:Ke,hasFilters:Ge}=function(e,r){const a=!!e,[i,s]=o({categories:[],loading:a,error:null});n(()=>{if(!e)return void s({categories:[],loading:!1,error:null});const t=r?`${e}|__session__`:`${e}|__proxy__`,o=go.get(t);if(o)return void s({categories:o,loading:!1,error:null});let a=!1;s(e=>({...e,loading:!0,error:null}));const n=`${e.replace(/\/$/,"")}/api/v1/widget/filters`;return(async()=>{try{const e={Accept:"application/json"};if("function"==typeof r){const t=await r();t&&(e.Authorization=`Bearer ${t}`)}const o=await fetch(n,{method:"GET",headers:e});if(!o.ok)throw new Error(`filter catalog HTTP ${o.status}`);const i=await o.json(),l=Array.isArray(i?.categories)?i.categories:[];if(a)return;go.set(t,l),s({categories:l,loading:!1,error:null})}catch(e){if(a)return;console.warn("[useFilterCatalog] catalog fetch failed:",e),s({categories:[],loading:!1,error:e})}})(),()=>{a=!0}},[e,r]);const l=t(()=>Array.isArray(i.categories)&&i.categories.length>0,[i.categories]);return{...i,hasFilters:l}}(s,i),Je=a(()=>{const e=he.filter(e=>e.content&&""!==e.content.trim()).map(e=>`${"user"===e.role?"You":se?.conciergeName||"Assistant"}: ${e.content}`).join("\n\n");e&&navigator.clipboard.writeText(e).catch(()=>{})},[he,se?.conciergeName]);if(n(()=>{be.current&&se&&(be.current.style.setProperty("--cw-primary",se.primaryColor),se.fontFamily&&be.current.style.setProperty("--cw-font-family",se.fontFamily),se.textColor&&be.current.style.setProperty("--cw-text-color",se.textColor))},[se,be]),Z)return null;if(re)return null;if(te||!se)return console.error("ChatWidget configuration error:",te),null;if(!le)return null;const Xe={"bottom-right":"bottom-5 right-5","bottom-left":"bottom-5 left-5","top-right":"top-5 right-5","top-left":"top-5 left-5"};return g("div",{id:"chat-widget-root",children:h("div",{ref:be,className:`chat-widget-root fixed flex flex-col ${se.launcherPosition?.includes("left")?"items-start":"items-end"} z-[999999] ${ge?"dark":""} ${B} ${Xe[se.launcherPosition]||Xe["bottom-right"]}`,children:[g(uo,{isOpen:de,isMinimized:ue,isDark:ge,launcherPosition:se.launcherPosition,primaryColor:se.primaryColor,textColor:se.textColor,companyName:se.companyName,conciergeName:se.conciergeName,companyLogo:se.companyLogo,chatbotAvatarEnabled:se.chatbotAvatarEnabled,chatbotAvatar:se.chatbotAvatar,messages:he,isLoading:me,inputValue:pe,setInputValue:fe,onSend:we,onStopGeneration:ve,onDirectSend:ke,onToggleTheme:Se,onMinimize:Me,onClose:ze,quickQuestions:se.quickQuestions,quickQuestionsEnabled:se.quickQuestionsEnabled,onQuickQuestion:ye,quickQuestionsLayout:v,agentMessageBubbleColor:se.agentMessageBubbleColor,userMessageBoxColor:se.userMessageBoxColor,assistantTextColor:se.assistantTextColor,userTextColor:se.userTextColor,fontFamily:se.fontFamily,agentMessageBubbleFontFamily:se.agentMessageBubbleFontFamily,agentMessageBubbleFontSize:se.agentMessageBubbleFontSize,userMessageBubbleFontFamily:se.userMessageBubbleFontFamily,userMessageBubbleFontSize:se.userMessageBubbleFontSize,fontSize:se.fontSize,defaultLanguage:se.defaultLanguage||E,onDecision:Te,headerTextBold:se.headerTextBold,headerTextItalic:se.headerTextItalic,headerTextColor:se.headerTextColor,headerFontFamily:se.headerFontFamily,headerFontSize:se.headerFontSize,subtitle:se.subtitle,showStatus:se.showStatus,statusMode:se.statusMode,officeHours:se.officeHours,enableVoiceInteraction:se.enableVoiceInteraction,isVoiceSessionActive:Fe,voiceStatus:Le,voiceError:Ne,voiceConclusionForCsat:Ae,onVoiceToggle:Ie,onBidiSubmit:()=>je(pe),disclaimerEnabled:se.disclaimerEnabled,disclaimerText:se.disclaimerText,disclaimerPosition:se.disclaimerPosition,disclaimerLinkUrl:se.disclaimerLinkUrl,disclaimerLinkLabel:se.disclaimerLinkLabel,showPoweredBy:se.showPoweredBy,apiBaseUrl:s,apiKey:T,getAuthToken:i,conversationId:De,conciergeId:J?.conciergeId??J?.id,onboardingQuestions:se.onboardingQuestions,onboardingActive:Ee,onboardingCompleted:Be,onOnboardingFormSubmit:Re,collectionPrompt:se.collectionPrompt,csatEnabled:se.csatEnabled,csatFormat:se.csatFormat,csatPrompt:se.csatPrompt,onboardingEnabled:se.onboardingEnabled,onResetConversation:Ve,sessionExpiringSoon:$e,autoPromptEnabled:se.autoPromptEnabled,autoPromptQuestionDisplay:se.autoPromptQuestionDisplay,autoPromptClickTelemetry:se.autoPromptClickTelemetry,allowFeedback:se.allowFeedback,provideCitations:se.provideCitations,onFeedback:Ye,onRetryMessage:xe,onRefreshChat:Qe,onCopyChat:Je,filterCategories:Ke,showFilterStep:Ge,widgetFilter:Ue,onWidgetFilterChange:He,onSynthesizeAssistantMessage:qe,chatFeatures:se.chatFeatures,organizationId:se.organizationId}),g(ho,{ref:We,isDark:ge,primaryColor:se.primaryColor,onToggle:Ce,textColor:se.textColor,headerTextColor:se.headerTextColor,defaultLanguage:se.defaultLanguage||E,isOpen:de,className:de?"hidden":void 0})]})})};function bo(t){const o=r(null),a=r(null);return n(()=>{const e=o.current;if(!e||e.shadowRoot)return;const t=e.attachShadow({mode:"open"}),r=document.createElement("style");r.textContent=":host { all: initial; display: block; }",t.appendChild(r);const n=document.createElement("style");n.textContent='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.chat-widget-root{--cw-primary:#1d4ed8;--cw-primary-hover:#1e40af;--cw-status-success:160 84% 39%;--cw-status-success-bg:152 81% 96%;--cw-status-warning:35 100% 50%;--cw-status-warning-bg:34 100% 95%;--cw-status-error:350 89% 60%;--cw-status-error-bg:356 100% 97%;--cw-status-info:199 89% 48%;--cw-status-info-bg:204 100% 97%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.chat-widget-root.dark{--cw-status-success:158 64% 52%;--cw-status-success-bg:152 36% 14%;--cw-status-warning:38 92% 60%;--cw-status-warning-bg:36 33% 14%;--cw-status-error:350 89% 65%;--cw-status-error-bg:356 33% 16%;--cw-status-info:199 89% 58%;--cw-status-info-bg:204 33% 14%}.\\!container{width:100%!important}.container{width:100%}@media (min-width:640px){.\\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width:768px){.\\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width:1024px){.\\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width:1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width:1536px){.\\!container{max-width:1536px!important}.container{max-width:1536px}}#chat-widget-root .chat-widget-root *{box-sizing:border-box;margin:0;padding:0}#chat-widget-root .chat-messages::-webkit-scrollbar{width:6px}#chat-widget-root .chat-messages::-webkit-scrollbar-track{background:transparent}#chat-widget-root .chat-messages::-webkit-scrollbar-thumb{background:rgba(156,163,175,.5);border-radius:10px}#chat-widget-root .chat-messages::-webkit-scrollbar-thumb:hover{background:rgba(156,163,175,.7)}#chat-widget-root .dark .chat-messages::-webkit-scrollbar-thumb{background:rgba(75,85,99,.5)}#chat-widget-root .dark .chat-messages::-webkit-scrollbar-thumb:hover{background:rgba(75,85,99,.7)}#chat-widget-root .sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}#chat-widget-root .pointer-events-none{pointer-events:none}#chat-widget-root .visible{visibility:visible}#chat-widget-root .collapse{visibility:collapse}#chat-widget-root .static{position:static}#chat-widget-root .fixed{position:fixed}#chat-widget-root .absolute{position:absolute}#chat-widget-root .relative{position:relative}#chat-widget-root .sticky{position:sticky}#chat-widget-root .inset-0{inset:0}#chat-widget-root .-top-8{top:-2rem}#chat-widget-root .bottom-0{bottom:0}#chat-widget-root .bottom-5{bottom:1.25rem}#chat-widget-root .bottom-full{bottom:100%}#chat-widget-root .left-0{left:0}#chat-widget-root .left-1\\/2{left:50%}#chat-widget-root .left-5{left:1.25rem}#chat-widget-root .right-0{right:0}#chat-widget-root .right-5{right:1.25rem}#chat-widget-root .top-0{top:0}#chat-widget-root .top-1\\/2{top:50%}#chat-widget-root .top-5{top:1.25rem}#chat-widget-root .top-full{top:100%}#chat-widget-root .isolate{isolation:isolate}#chat-widget-root .z-10{z-index:10}#chat-widget-root .z-50{z-index:50}#chat-widget-root .z-\\[60\\]{z-index:60}#chat-widget-root .z-\\[70\\]{z-index:70}#chat-widget-root .z-\\[71\\]{z-index:71}#chat-widget-root .z-\\[999999\\]{z-index:999999}#chat-widget-root .z-\\[9999\\]{z-index:9999}#chat-widget-root .m-0{margin:0}#chat-widget-root .mx-2{margin-left:.5rem;margin-right:.5rem}#chat-widget-root .mx-3{margin-left:.75rem;margin-right:.75rem}#chat-widget-root .my-3{margin-bottom:.75rem;margin-top:.75rem}#chat-widget-root .my-4{margin-bottom:1rem;margin-top:1rem}#chat-widget-root .-mb-px{margin-bottom:-1px}#chat-widget-root .mb-1{margin-bottom:.25rem}#chat-widget-root .mb-1\\.5{margin-bottom:.375rem}#chat-widget-root .mb-2{margin-bottom:.5rem}#chat-widget-root .mb-3{margin-bottom:.75rem}#chat-widget-root .mb-4{margin-bottom:1rem}#chat-widget-root .mb-5{margin-bottom:1.25rem}#chat-widget-root .ml-1{margin-left:.25rem}#chat-widget-root .ms-0\\.5{margin-inline-start:.125rem}#chat-widget-root .mt-0\\.5{margin-top:.125rem}#chat-widget-root .mt-1{margin-top:.25rem}#chat-widget-root .mt-1\\.5{margin-top:.375rem}#chat-widget-root .mt-2{margin-top:.5rem}#chat-widget-root .mt-3{margin-top:.75rem}#chat-widget-root .mt-4{margin-top:1rem}#chat-widget-root .block{display:block}#chat-widget-root .inline-block{display:inline-block}#chat-widget-root .inline{display:inline}#chat-widget-root .flex{display:flex}#chat-widget-root .inline-flex{display:inline-flex}#chat-widget-root .table{display:table}#chat-widget-root .grid{display:grid}#chat-widget-root .hidden{display:none}#chat-widget-root .h-1\\.5{height:.375rem}#chat-widget-root .h-10{height:2.5rem}#chat-widget-root .h-11{height:2.75rem}#chat-widget-root .h-12{height:3rem}#chat-widget-root .h-16{height:4rem}#chat-widget-root .h-2{height:.5rem}#chat-widget-root .h-3{height:.75rem}#chat-widget-root .h-3\\.5{height:.875rem}#chat-widget-root .h-4{height:1rem}#chat-widget-root .h-5{height:1.25rem}#chat-widget-root .h-6{height:1.5rem}#chat-widget-root .h-7{height:1.75rem}#chat-widget-root .h-8{height:2rem}#chat-widget-root .h-\\[650px\\]{height:650px}#chat-widget-root .h-auto{height:auto}#chat-widget-root .h-full{height:100%}#chat-widget-root .h-px{height:1px}#chat-widget-root .max-h-\\[85vh\\]{max-height:85vh}#chat-widget-root .min-h-0{min-height:0}#chat-widget-root .min-h-\\[48px\\]{min-height:48px}#chat-widget-root .w-1\\.5{width:.375rem}#chat-widget-root .w-10{width:2.5rem}#chat-widget-root .w-11{width:2.75rem}#chat-widget-root .w-12{width:3rem}#chat-widget-root .w-16{width:4rem}#chat-widget-root .w-2{width:.5rem}#chat-widget-root .w-3{width:.75rem}#chat-widget-root .w-3\\.5{width:.875rem}#chat-widget-root .w-4{width:1rem}#chat-widget-root .w-44{width:11rem}#chat-widget-root .w-5{width:1.25rem}#chat-widget-root .w-6{width:1.5rem}#chat-widget-root .w-7{width:1.75rem}#chat-widget-root .w-8{width:2rem}#chat-widget-root .w-80{width:20rem}#chat-widget-root .w-96{width:24rem}#chat-widget-root .w-\\[380px\\]{width:380px}#chat-widget-root .w-full{width:100%}#chat-widget-root .min-w-0{min-width:0}#chat-widget-root .min-w-\\[60px\\]{min-width:60px}#chat-widget-root .min-w-full{min-width:100%}#chat-widget-root .max-w-\\[75\\%\\]{max-width:75%}#chat-widget-root .max-w-\\[92vw\\]{max-width:92vw}#chat-widget-root .max-w-full{max-width:100%}#chat-widget-root .max-w-none{max-width:none}#chat-widget-root .max-w-sm{max-width:24rem}#chat-widget-root .max-w-xs{max-width:20rem}#chat-widget-root .flex-1{flex:1 1 0%}#chat-widget-root .flex-shrink-0,#chat-widget-root .shrink-0{flex-shrink:0}#chat-widget-root .grow{flex-grow:1}#chat-widget-root .border-collapse{border-collapse:collapse}#chat-widget-root .-translate-x-1\\/2{--tw-translate-x:-50%}#chat-widget-root .-translate-x-1\\/2,#chat-widget-root .-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .-translate-y-1\\/2{--tw-translate-y:-50%}#chat-widget-root .-rotate-90{--tw-rotate:-90deg}#chat-widget-root .-rotate-90,#chat-widget-root .rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .rotate-180{--tw-rotate:180deg}#chat-widget-root .rotate-90{--tw-rotate:90deg}#chat-widget-root .rotate-90,#chat-widget-root .scale-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .scale-0{--tw-scale-x:0;--tw-scale-y:0}#chat-widget-root .scale-100{--tw-scale-x:1;--tw-scale-y:1}#chat-widget-root .scale-100,#chat-widget-root .scale-110{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .scale-110{--tw-scale-x:1.1;--tw-scale-y:1.1}#chat-widget-root .scale-125{--tw-scale-x:1.25;--tw-scale-y:1.25}#chat-widget-root .scale-125,#chat-widget-root .scale-95{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .scale-95{--tw-scale-x:.95;--tw-scale-y:.95}#chat-widget-root .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}#chat-widget-root .animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}#chat-widget-root .animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}#chat-widget-root .animate-spin{animation:spin 1s linear infinite}#chat-widget-root .cursor-ew-resize{cursor:ew-resize}#chat-widget-root .cursor-nesw-resize{cursor:nesw-resize}#chat-widget-root .cursor-not-allowed{cursor:not-allowed}#chat-widget-root .cursor-ns-resize{cursor:ns-resize}#chat-widget-root .cursor-nwse-resize{cursor:nwse-resize}#chat-widget-root .cursor-pointer{cursor:pointer}#chat-widget-root .resize-none{resize:none}#chat-widget-root .resize{resize:both}#chat-widget-root .list-decimal{list-style-type:decimal}#chat-widget-root .list-disc{list-style-type:disc}#chat-widget-root .list-none{list-style-type:none}#chat-widget-root .flex-row{flex-direction:row}#chat-widget-root .flex-row-reverse{flex-direction:row-reverse}#chat-widget-root .flex-col{flex-direction:column}#chat-widget-root .flex-wrap{flex-wrap:wrap}#chat-widget-root .items-start{align-items:flex-start}#chat-widget-root .items-end{align-items:flex-end}#chat-widget-root .items-center{align-items:center}#chat-widget-root .justify-start{justify-content:flex-start}#chat-widget-root .justify-end{justify-content:flex-end}#chat-widget-root .justify-center{justify-content:center}#chat-widget-root .justify-between{justify-content:space-between}#chat-widget-root .gap-0{gap:0}#chat-widget-root .gap-0\\.5{gap:.125rem}#chat-widget-root .gap-1{gap:.25rem}#chat-widget-root .gap-1\\.5{gap:.375rem}#chat-widget-root .gap-2{gap:.5rem}#chat-widget-root .gap-2\\.5{gap:.625rem}#chat-widget-root .gap-3{gap:.75rem}#chat-widget-root .gap-4{gap:1rem}#chat-widget-root .gap-6{gap:1.5rem}#chat-widget-root :is(.space-y-1>:not([hidden])~:not([hidden])){--tw-space-y-reverse:0;margin-bottom:calc(.25rem*var(--tw-space-y-reverse));margin-top:calc(.25rem*(1 - var(--tw-space-y-reverse)))}#chat-widget-root :is(.space-y-2>:not([hidden])~:not([hidden])){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}#chat-widget-root :is(.space-y-4>:not([hidden])~:not([hidden])){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}#chat-widget-root .overflow-hidden{overflow:hidden}#chat-widget-root .overflow-visible{overflow:visible}#chat-widget-root .overflow-x-auto{overflow-x:auto}#chat-widget-root .overflow-y-auto{overflow-y:auto}#chat-widget-root .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#chat-widget-root .whitespace-nowrap{white-space:nowrap}#chat-widget-root .whitespace-pre-wrap{white-space:pre-wrap}#chat-widget-root .break-words{overflow-wrap:break-word}#chat-widget-root .break-all{word-break:break-all}#chat-widget-root .rounded{border-radius:.25rem}#chat-widget-root .rounded-2xl{border-radius:1rem}#chat-widget-root .rounded-3xl{border-radius:1.5rem}#chat-widget-root .rounded-full{border-radius:9999px}#chat-widget-root .rounded-lg{border-radius:.5rem}#chat-widget-root .rounded-md{border-radius:.375rem}#chat-widget-root .rounded-xl{border-radius:.75rem}#chat-widget-root .rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}#chat-widget-root .rounded-tl-sm{border-top-left-radius:.125rem}#chat-widget-root .rounded-tr-sm{border-top-right-radius:.125rem}#chat-widget-root .border{border-width:1px}#chat-widget-root .border-0{border-width:0}#chat-widget-root .border-b{border-bottom-width:1px}#chat-widget-root .border-l-4{border-left-width:4px}#chat-widget-root .border-t{border-top-width:1px}#chat-widget-root .border-t-2{border-top-width:2px}#chat-widget-root .border-dotted{border-style:dotted}#chat-widget-root .border-none{border-style:none}#chat-widget-root .\\!border-status-error{border-color:hsl(var(--cw-status-error))!important}#chat-widget-root .border-amber-200{--tw-border-opacity:1;border-color:rgb(253 230 138/var(--tw-border-opacity,1))}#chat-widget-root .border-amber-700\\/50{border-color:rgba(180,83,9,.5)}#chat-widget-root .border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}#chat-widget-root .border-blue-700\\/50{border-color:rgba(29,78,216,.5)}#chat-widget-root .border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity,1))}#chat-widget-root .border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}#chat-widget-root .border-gray-200\\/60{border-color:rgba(229,231,235,.6)}#chat-widget-root .border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}#chat-widget-root .border-gray-600{--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity,1))}#chat-widget-root .border-gray-700{--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity,1))}#chat-widget-root .border-gray-700\\/50{border-color:rgba(55,65,81,.5)}#chat-widget-root .border-transparent{border-color:transparent}#chat-widget-root .bg-amber-50{--tw-bg-opacity:1;background-color:rgb(255 251 235/var(--tw-bg-opacity,1))}#chat-widget-root .bg-amber-900\\/40{background-color:rgba(120,53,15,.4)}#chat-widget-root .bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}#chat-widget-root .bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}#chat-widget-root .bg-blue-900\\/30{background-color:rgba(30,58,138,.3)}#chat-widget-root .bg-current{background-color:currentColor}#chat-widget-root .bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}#chat-widget-root .bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}#chat-widget-root .bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}#chat-widget-root .bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}#chat-widget-root .bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}#chat-widget-root .bg-gray-700\\/50{background-color:rgba(55,65,81,.5)}#chat-widget-root .bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}#chat-widget-root .bg-gray-800\\/50{background-color:rgba(31,41,55,.5)}#chat-widget-root .bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}#chat-widget-root .bg-green-200{--tw-bg-opacity:1;background-color:rgb(187 247 208/var(--tw-bg-opacity,1))}#chat-widget-root .bg-orange-200{--tw-bg-opacity:1;background-color:rgb(254 215 170/var(--tw-bg-opacity,1))}#chat-widget-root .bg-pink-200{--tw-bg-opacity:1;background-color:rgb(251 207 232/var(--tw-bg-opacity,1))}#chat-widget-root .bg-red-200{--tw-bg-opacity:1;background-color:rgb(254 202 202/var(--tw-bg-opacity,1))}#chat-widget-root .bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}#chat-widget-root .bg-slate-50\\/50{background-color:rgba(248,250,252,.5)}#chat-widget-root .bg-slate-800\\/50{background-color:rgba(30,41,59,.5)}#chat-widget-root .bg-transparent{background-color:transparent}#chat-widget-root .bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}#chat-widget-root .bg-white\\/10{background-color:hsla(0,0%,100%,.1)}#chat-widget-root .bg-white\\/20{background-color:hsla(0,0%,100%,.2)}#chat-widget-root .bg-yellow-200{--tw-bg-opacity:1;background-color:rgb(254 240 138/var(--tw-bg-opacity,1))}#chat-widget-root .bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}#chat-widget-root .bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}#chat-widget-root .from-gray-50\\/50{--tw-gradient-from:rgba(249,250,251,.5) var(--tw-gradient-from-position);--tw-gradient-to:rgba(249,250,251,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}#chat-widget-root .from-white\\/0{--tw-gradient-from:hsla(0,0%,100%,0) var(--tw-gradient-from-position);--tw-gradient-to:hsla(0,0%,100%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}#chat-widget-root .from-white\\/10{--tw-gradient-from:hsla(0,0%,100%,.1) var(--tw-gradient-from-position);--tw-gradient-to:hsla(0,0%,100%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}#chat-widget-root .from-yellow-200{--tw-gradient-from:#fef08a var(--tw-gradient-from-position);--tw-gradient-to:hsla(53,98%,77%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}#chat-widget-root .via-white\\/5{--tw-gradient-to:hsla(0,0%,100%,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),hsla(0,0%,100%,.05) var(--tw-gradient-via-position),var(--tw-gradient-to)}#chat-widget-root .to-white{--tw-gradient-to:#fff var(--tw-gradient-to-position)}#chat-widget-root .to-white\\/10{--tw-gradient-to:hsla(0,0%,100%,.1) var(--tw-gradient-to-position)}#chat-widget-root .to-yellow-400{--tw-gradient-to:#facc15 var(--tw-gradient-to-position)}#chat-widget-root .object-contain{-o-object-fit:contain;object-fit:contain}#chat-widget-root .p-0{padding:0}#chat-widget-root .p-0\\.5{padding:.125rem}#chat-widget-root .p-3{padding:.75rem}#chat-widget-root .p-5{padding:1.25rem}#chat-widget-root .p-6{padding:1.5rem}#chat-widget-root .p-8{padding:2rem}#chat-widget-root .px-1{padding-left:.25rem;padding-right:.25rem}#chat-widget-root .px-2{padding-left:.5rem;padding-right:.5rem}#chat-widget-root .px-2\\.5{padding-left:.625rem;padding-right:.625rem}#chat-widget-root .px-3{padding-left:.75rem;padding-right:.75rem}#chat-widget-root .px-4{padding-left:1rem;padding-right:1rem}#chat-widget-root .px-5{padding-left:1.25rem;padding-right:1.25rem}#chat-widget-root .py-1{padding-bottom:.25rem;padding-top:.25rem}#chat-widget-root .py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}#chat-widget-root .py-12{padding-bottom:3rem;padding-top:3rem}#chat-widget-root .py-2{padding-bottom:.5rem;padding-top:.5rem}#chat-widget-root .py-2\\.5{padding-bottom:.625rem;padding-top:.625rem}#chat-widget-root .py-3{padding-bottom:.75rem;padding-top:.75rem}#chat-widget-root .py-3\\.5{padding-bottom:.875rem;padding-top:.875rem}#chat-widget-root .py-4{padding-bottom:1rem;padding-top:1rem}#chat-widget-root .pb-1{padding-bottom:.25rem}#chat-widget-root .pb-2{padding-bottom:.5rem}#chat-widget-root .pl-1{padding-left:.25rem}#chat-widget-root .pl-2{padding-left:.5rem}#chat-widget-root .pl-4{padding-left:1rem}#chat-widget-root .pl-\\[50px\\]{padding-left:50px}#chat-widget-root .pr-1{padding-right:.25rem}#chat-widget-root .pt-1{padding-top:.25rem}#chat-widget-root .text-left{text-align:left}#chat-widget-root .text-center{text-align:center}#chat-widget-root .text-right{text-align:right}#chat-widget-root .align-text-bottom{vertical-align:text-bottom}#chat-widget-root .font-sans{font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}#chat-widget-root .text-2xl{font-size:1.5rem;line-height:2rem}#chat-widget-root .text-\\[10px\\]{font-size:10px}#chat-widget-root .text-base{font-size:1rem;line-height:1.5rem}#chat-widget-root .text-chip{font-size:11px;letter-spacing:0;line-height:1.4}#chat-widget-root .text-h4{font-size:18px;letter-spacing:0;line-height:1.3}#chat-widget-root .text-lg{font-size:1.125rem;line-height:1.75rem}#chat-widget-root .text-sm{font-size:.875rem;line-height:1.25rem}#chat-widget-root .text-xl{font-size:1.25rem;line-height:1.75rem}#chat-widget-root .text-xs{font-size:.75rem;line-height:1rem}#chat-widget-root .font-bold{font-weight:700}#chat-widget-root .font-medium{font-weight:500}#chat-widget-root .font-semibold{font-weight:600}#chat-widget-root .uppercase{text-transform:uppercase}#chat-widget-root .lowercase{text-transform:lowercase}#chat-widget-root .italic{font-style:italic}#chat-widget-root .tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}#chat-widget-root .leading-5{line-height:1.25rem}#chat-widget-root .leading-none{line-height:1}#chat-widget-root .leading-normal{line-height:1.5}#chat-widget-root .leading-relaxed{line-height:1.625}#chat-widget-root .leading-snug{line-height:1.375}#chat-widget-root .tracking-wide{letter-spacing:.025em}#chat-widget-root .text-\\[\\#4A5568\\]{--tw-text-opacity:1;color:rgb(74 85 104/var(--tw-text-opacity,1))}#chat-widget-root .text-amber-200{--tw-text-opacity:1;color:rgb(253 230 138/var(--tw-text-opacity,1))}#chat-widget-root .text-amber-800{--tw-text-opacity:1;color:rgb(146 64 14/var(--tw-text-opacity,1))}#chat-widget-root .text-current{color:currentColor}#chat-widget-root .text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-200{--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-500\\/80{color:hsla(220,9%,46%,.8)}#chat-widget-root .text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}#chat-widget-root .text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}#chat-widget-root .text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}#chat-widget-root .text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}#chat-widget-root .text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}#chat-widget-root .text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity,1))}#chat-widget-root .text-status-error{color:hsl(var(--cw-status-error))}#chat-widget-root .text-status-success{color:hsl(var(--cw-status-success))}#chat-widget-root .text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}#chat-widget-root .text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}#chat-widget-root .underline{text-decoration-line:underline}#chat-widget-root .no-underline{text-decoration-line:none}#chat-widget-root .placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(156 163 175/var(--tw-placeholder-opacity,1))}#chat-widget-root .placeholder-gray-400::placeholder{--tw-placeholder-opacity:1;color:rgb(156 163 175/var(--tw-placeholder-opacity,1))}#chat-widget-root .placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(107 114 128/var(--tw-placeholder-opacity,1))}#chat-widget-root .placeholder-gray-500::placeholder{--tw-placeholder-opacity:1;color:rgb(107 114 128/var(--tw-placeholder-opacity,1))}#chat-widget-root .opacity-0{opacity:0}#chat-widget-root .opacity-50{opacity:.5}#chat-widget-root .opacity-60{opacity:.6}#chat-widget-root .opacity-70{opacity:.7}#chat-widget-root .opacity-75{opacity:.75}#chat-widget-root .opacity-80{opacity:.8}#chat-widget-root .shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}#chat-widget-root .shadow,#chat-widget-root .shadow-2xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#chat-widget-root .shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)}#chat-widget-root .shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}#chat-widget-root .shadow-lg,#chat-widget-root .shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#chat-widget-root .shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}#chat-widget-root .shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}#chat-widget-root .shadow-sm,#chat-widget-root .shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#chat-widget-root .shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}#chat-widget-root .shadow-black\\/20{--tw-shadow-color:rgba(0,0,0,.2);--tw-shadow:var(--tw-shadow-colored)}#chat-widget-root .shadow-gray-200\\/80{--tw-shadow-color:rgba(229,231,235,.8);--tw-shadow:var(--tw-shadow-colored)}#chat-widget-root .outline-none{outline:2px solid transparent;outline-offset:2px}#chat-widget-root .outline{outline-style:solid}#chat-widget-root .ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)}#chat-widget-root .ring,#chat-widget-root .ring-2{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}#chat-widget-root .ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}#chat-widget-root .ring-blue-100{--tw-ring-opacity:1;--tw-ring-color:rgb(219 234 254/var(--tw-ring-opacity,1))}#chat-widget-root .ring-blue-300{--tw-ring-opacity:1;--tw-ring-color:rgb(147 197 253/var(--tw-ring-opacity,1))}#chat-widget-root .ring-white{--tw-ring-opacity:1;--tw-ring-color:rgb(255 255 255/var(--tw-ring-opacity,1))}#chat-widget-root .blur{--tw-blur:blur(8px)}#chat-widget-root .blur,#chat-widget-root .drop-shadow{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#chat-widget-root .drop-shadow{--tw-drop-shadow:drop-shadow(0 1px 2px rgba(0,0,0,.1)) drop-shadow(0 1px 1px rgba(0,0,0,.06))}#chat-widget-root .drop-shadow-md{--tw-drop-shadow:drop-shadow(0 4px 3px rgba(0,0,0,.07)) drop-shadow(0 2px 2px rgba(0,0,0,.06))}#chat-widget-root .drop-shadow-md,#chat-widget-root .drop-shadow-sm{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#chat-widget-root .drop-shadow-sm{--tw-drop-shadow:drop-shadow(0 1px 1px rgba(0,0,0,.05))}#chat-widget-root .grayscale-\\[0\\.3\\]{--tw-grayscale:grayscale(0.3)}#chat-widget-root .filter,#chat-widget-root .grayscale-\\[0\\.3\\]{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#chat-widget-root .backdrop-blur-sm{--tw-backdrop-blur:blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}#chat-widget-root .transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}#chat-widget-root .transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}#chat-widget-root .transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}#chat-widget-root .transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}#chat-widget-root .transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}#chat-widget-root .duration-150{transition-duration:.15s}#chat-widget-root .duration-200{transition-duration:.2s}#chat-widget-root .duration-300{transition-duration:.3s}#chat-widget-root .duration-500{transition-duration:.5s}#chat-widget-root :is(#chat-widget-root .animate-in){animation:slideIn .3s ease-out}#chat-widget-root :is(#chat-widget-root .transition-all){transition-duration:.3s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}#chat-widget-root .\\[font-family\\:inherit\\]{font-family:inherit}#chat-widget-root .placeholder\\:text-\\[\\#8C8C8C\\]::-moz-placeholder{--tw-text-opacity:1;color:rgb(140 140 140/var(--tw-text-opacity,1))}#chat-widget-root .placeholder\\:text-\\[\\#8C8C8C\\]::placeholder{--tw-text-opacity:1;color:rgb(140 140 140/var(--tw-text-opacity,1))}#chat-widget-root .placeholder\\:text-\\[\\#A2A9B2\\]::-moz-placeholder{--tw-text-opacity:1;color:rgb(162 169 178/var(--tw-text-opacity,1))}#chat-widget-root .placeholder\\:text-\\[\\#A2A9B2\\]::placeholder{--tw-text-opacity:1;color:rgb(162 169 178/var(--tw-text-opacity,1))}#chat-widget-root .hover\\:scale-105:hover{--tw-scale-x:1.05;--tw-scale-y:1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .hover\\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .hover\\:scale-\\[1\\.02\\]:hover{--tw-scale-x:1.02;--tw-scale-y:1.02;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .hover\\:border-blue-400:hover{--tw-border-opacity:1;border-color:rgb(96 165 250/var(--tw-border-opacity,1))}#chat-widget-root .hover\\:border-blue-600:hover{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}#chat-widget-root .hover\\:bg-blue-50:hover{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}#chat-widget-root .hover\\:bg-blue-500\\/20:hover{background-color:rgba(59,130,246,.2)}#chat-widget-root .hover\\:bg-blue-900\\/50:hover{background-color:rgba(30,58,138,.5)}#chat-widget-root .hover\\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}#chat-widget-root .hover\\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}#chat-widget-root .hover\\:bg-gray-600:hover{--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}#chat-widget-root .hover\\:bg-gray-700:hover{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}#chat-widget-root .hover\\:bg-red-600:hover{--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity,1))}#chat-widget-root .hover\\:bg-transparent:hover{background-color:transparent}#chat-widget-root .hover\\:text-blue-500:hover{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}#chat-widget-root .hover\\:text-gray-200:hover{--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}#chat-widget-root .hover\\:text-gray-300:hover{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}#chat-widget-root .hover\\:text-gray-600:hover{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}#chat-widget-root .hover\\:text-gray-700:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}#chat-widget-root .hover\\:underline:hover{text-decoration-line:underline}#chat-widget-root .hover\\:opacity-80:hover{opacity:.8}#chat-widget-root .hover\\:opacity-90:hover{opacity:.9}#chat-widget-root .hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#chat-widget-root .hover\\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#chat-widget-root .hover\\:grayscale-0:hover{--tw-grayscale:grayscale(0);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#chat-widget-root .focus\\:\\!border-status-error:focus{border-color:hsl(var(--cw-status-error))!important}#chat-widget-root .focus\\:border-\\[\\#5A6069\\]:focus{--tw-border-opacity:1;border-color:rgb(90 96 105/var(--tw-border-opacity,1))}#chat-widget-root .focus\\:border-\\[\\#B0B0B0\\]:focus{--tw-border-opacity:1;border-color:rgb(176 176 176/var(--tw-border-opacity,1))}#chat-widget-root .focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}#chat-widget-root .focus\\:ring-0:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}#chat-widget-root .focus\\:ring-1:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}#chat-widget-root .focus\\:ring-gray-300:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(209 213 219/var(--tw-ring-opacity,1))}#chat-widget-root .focus\\:ring-gray-600:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(75 85 99/var(--tw-ring-opacity,1))}#chat-widget-root .focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}#chat-widget-root .focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}#chat-widget-root .focus-visible\\:ring-white\\/40:focus-visible{--tw-ring-color:hsla(0,0%,100%,.4)}#chat-widget-root .active\\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .active\\:scale-\\[0\\.97\\]:active{--tw-scale-x:0.97;--tw-scale-y:0.97;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .active\\:scale-\\[0\\.98\\]:active{--tw-scale-x:0.98;--tw-scale-y:0.98;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .active\\:scale-\\[0\\.99\\]:active{--tw-scale-x:0.99;--tw-scale-y:0.99;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root .active\\:outline-none:active{outline:2px solid transparent;outline-offset:2px}#chat-widget-root .active\\:ring-0:active{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}#chat-widget-root .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}#chat-widget-root .disabled\\:opacity-40:disabled{opacity:.4}#chat-widget-root .disabled\\:opacity-50:disabled{opacity:.5}#chat-widget-root .disabled\\:shadow-none:disabled{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#chat-widget-root :is(.group:hover .group-hover\\:scale-100){--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#chat-widget-root :is(.group:hover .group-hover\\:opacity-100){opacity:1}#chat-widget-root .dark\\:text-gray-300:is(.dark *){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}#chat-widget-root .dark\\:text-gray-400:is(.dark *){--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}#chat-widget-root .rtl\\:rounded-tl-2xl:where([dir=rtl],[dir=rtl] *){border-top-left-radius:1rem}#chat-widget-root .rtl\\:rounded-tr-sm:where([dir=rtl],[dir=rtl] *){border-top-right-radius:.125rem}#chat-widget-root .\\[\\&\\:first-child\\]\\:\\!mt-0:first-child{margin-top:0!important}#chat-widget-root :is(.\\[\\&\\>\\*\\:first-child\\]\\:\\!mt-0>:first-child){margin-top:0!important}#chat-widget-root :is(.\\[\\&\\>\\*\\:last-child\\]\\:\\!mb-0>:last-child){margin-bottom:0!important}\n.chat-widget-root{position:fixed;z-index:999999}.chat-widget-container{color:var(--cw-text-color,inherit);font-family:var(\n --cw-font-family,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif\n )}#chat-widget-root .chat-messages p{overflow-wrap:anywhere;word-break:break-word}textarea#chat-widget-input::-moz-placeholder{border:none;line-height:48px;outline:none}textarea#chat-widget-input::placeholder{border:none;line-height:48px;outline:none}textarea#chat-widget-input{border:none;line-height:48px;outline:none}@keyframes slideIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes bounce{0%,to{transform:translateY(0)}50%{transform:translateY(-5px)}}#chat-widget-root .scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}#chat-widget-root .scrollbar-hide::-webkit-scrollbar{display:none}#chat-widget-root .slim-scrollbar-x{scrollbar-width:thin}#chat-widget-root .slim-scrollbar-x::-webkit-scrollbar{height:3px!important}#chat-widget-root .slim-scrollbar-x::-webkit-scrollbar-track{background:transparent!important}#chat-widget-root .slim-scrollbar-x::-webkit-scrollbar-thumb{background:#d1d5db!important;border-radius:2px!important}#chat-widget-root .slim-scrollbar-x::-webkit-scrollbar-thumb:hover{background:#9ca3af!important}@media print{.chat-widget-root{display:none!important}}',t.appendChild(n);const i=document.createElement("div");i.id="chat-widget-mount",t.appendChild(i),a.current=u(i)},[]),n(()=>{a.current?.render(e.createElement(mo,t))}),n(()=>()=>{const e=a.current;a.current=null,queueMicrotask(()=>e?.unmount())},[]),g("div",{ref:o,id:"chat-widget-host"})}export{$e as F,Oe as L,bo as S,lt as W,Ae as c,nt as s};