@eshal-bot/chat-widget 0.2.15 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chat-widget-MarkdownRenderer-VOzNYu1D.esm.js → chat-widget-MarkdownRenderer-CImk866C.esm.js} +1 -1
- package/dist/{chat-widget-index-CnsqQX_h.esm.js → chat-widget-index-DxXf_IzK.esm.js} +4 -4
- package/dist/chat-widget.esm.js +1 -1
- package/dist/chat-widget.js +6 -2
- package/dist/chat-widget.min.js +1 -1
- package/dist/chat-widget.umd.js +1 -1
- package/package.json +1 -1
package/dist/chat-widget.min.js
CHANGED
|
@@ -36,4 +36,4 @@ var lp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
36
36
|
*
|
|
37
37
|
* This source code is licensed under the ISC license.
|
|
38
38
|
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/let _p=null;function Ip(e){I.useEffect(()=>{if(!Fp||!e)return;const t=e.split(",")[0]?.trim();if(!t||Ap.has(t))return;if((e=>{const t=e.trim().toLowerCase();return!t||!!Lp.has(t)||Rp.some(e=>t.includes(e))})(t))return void Ap.add(t);let n=!0;return(async()=>{try{_p||(_p=Promise.resolve().then(function(){return Sh}));const e=await _p,r=e&&"default"in e?e.default:e,o=(e=>e.trim().replace(/\s+/g,"+"))(t);r.load({google:{families:[`${o}:300,400,500,600,700`]},fontactive:e=>{n&&Ap.add(e)},fontinactive:e=>{n&&Ap.add(e)}})}catch(e){}})(),()=>{n=!1}},[e])}const Bp="__eshalChatWidgetCitationContext",Dp="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:void 0,Op=Dp?Dp[Bp]||(Dp[Bp]=I.createContext(null)):I.createContext(null);function $p(e,t){return"string"!=typeof e||""===e?"":/^https?:\/\//i.test(e)?e:t?`${String(t).replace(/\/$/,"")}${e.startsWith("/")?"":"/"}${e}`:e}const Up="chat-widget-markdown-chunk.min.js",Vp="undefined"!=typeof document?document.currentScript?.src:void 0;let Hp=null;function Wp(){return"undefined"!=typeof window&&window.__eshalChatWidgetChunks?.MarkdownRenderer?Promise.resolve({default:window.__eshalChatWidgetChunks.MarkdownRenderer}):Hp||(Hp=new Promise((e,t)=>{const n=document.createElement("script");n.src=function(){if(Vp)return new URL(Up,Vp).toString();const e=Array.from(document.getElementsByTagName("script")).find(e=>/chat-widget(\.min)?\.js(\?.*)?$/.test(e.src));return e?new URL(Up,e.src).toString():Up}(),n.async=!0,n.onload=()=>{window.__eshalChatWidgetChunks?.MarkdownRenderer?e({default:window.__eshalChatWidgetChunks.MarkdownRenderer}):(Hp=null,t(new Error("[widget] markdown chunk loaded but did not register itself")))},n.onerror=()=>{Hp=null,t(new Error(`[widget] failed to load markdown chunk from ${n.src}`))},document.head.appendChild(n)}),Hp)}function qp(){return Wp()}var Qp={exports:{}},Kp={},Yp=I,Gp=Symbol.for("react.element"),Jp=Symbol.for("react.fragment"),Xp=Object.prototype.hasOwnProperty,Zp=Yp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,eg={key:!0,ref:!0,__self:!0,__source:!0};function tg(e,t,n){var r,o={},a=null,i=null;for(r in void 0!==n&&(a=""+n),void 0!==t.key&&(a=""+t.key),void 0!==t.ref&&(i=t.ref),t)Xp.call(t,r)&&!eg.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:Gp,type:e,key:a,ref:i,props:o,_owner:Zp.current}}Kp.Fragment=Jp,Kp.jsx=tg,Kp.jsxs=tg,Qp.exports=Kp;var ng=Qp.exports;const rg=I.lazy(qp);class og extends I.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){}render(){return this.state.failed?this.props.fallback:this.props.children}}const ag=/(```|`[^`]+`|(^|\n)\s{0,3}#{1,6}\s|(^|\n)\s*[-*+]\s|(^|\n)\s*\d+\.\s|(^|\n)\s*>\s|\[[^\]]*\]\([^)]*\)|\*\*|__|~~|(^|\n)\s*\||\[\d+\])/;const ig=({content:e,isDark:t,textColor:n,fontFamily:r,fontSize:o})=>ng.jsx("p",{className:"leading-relaxed [&:first-child]:!mt-0 whitespace-pre-wrap break-words",style:{color:n||(t?"#f3f4f6":"#1A1A1A"),fontFamily:r||"Inter",fontSize:o||"14px",margin:0,lineHeight:"1.6",padding:0,overflowWrap:"break-word"},children:e}),sg=({content:e,isStreaming:t,isDark:n=!1,isRtl:r=!1,textColor:o,fontFamily:a,fontSize:i,onButtonClick:s,provideCitations:l=!0})=>{const[c,u]=I.useState(""),[d,p]=I.useState(!1),g=I.useRef(e),f=I.useRef(0),h=I.useRef(null),m=I.useRef(0);I.useEffect(()=>{if(e!==g.current){if(g.current=e,f.current>=e.length)return u(e),void p(!1);e.length<c.length&&(f.current=0,u(""))}if(!t)return u(e),p(!1),void(h.current&&cancelAnimationFrame(h.current));p(!0);const n=t=>{if(t-m.current<16)h.current=requestAnimationFrame(n);else if(m.current=t,f.current<e.length){const t=Math.max(2,Math.floor(4*Math.random())),r=Math.min(f.current+t,e.length);u(e.slice(0,r)),f.current=r,h.current=requestAnimationFrame(n)}else p(!1)};return h.current=requestAnimationFrame(n),()=>{h.current&&cancelAnimationFrame(h.current)}},[e,t]);const b="string"==typeof(y=c)&&0!==y.length&&ag.test(y);var y;return ng.jsxs("div",{className:"relative",dir:"auto",style:{textAlign:r?"right":"left",color:o||(n?"#f3f4f6":"#1A1A1A"),fontFamily:a||"Inter",fontSize:i||"14px",margin:0,padding:0},children:[b?ng.jsx(og,{fallback:ng.jsx(ig,{content:c,isDark:n,textColor:o,fontFamily:a,fontSize:i}),children:ng.jsx(I.Suspense,{fallback:ng.jsx(ig,{content:c,isDark:n,textColor:o,fontFamily:a,fontSize:i}),children:ng.jsx(rg,{content:c,isStreaming:t,isDark:n,isRtl:r,textColor:o,fontFamily:a,fontSize:i,onButtonClick:s,provideCitations:l})})}):ng.jsx(ig,{content:c,isDark:n,textColor:o,fontFamily:a,fontSize:i}),d&&ng.jsx("span",{className:"inline-block w-1.5 h-4 bg-blue-500 ms-0.5 animate-pulse align-text-bottom",style:{animationDuration:"0.8s"}})]})},lg=({isDark:e,t:t})=>ng.jsxs("div",{className:"flex gap-1.5",role:"status","aria-label":t("agentIsTyping"),children:[ng.jsx("div",{className:`w-2 h-2 rounded-full ${e?"bg-gray-500":"bg-gray-400"} animate-bounce`,style:{animationDelay:"0ms"},"aria-hidden":"true"}),ng.jsx("div",{className:`w-2 h-2 rounded-full ${e?"bg-gray-500":"bg-gray-400"} animate-bounce`,style:{animationDelay:"150ms"},"aria-hidden":"true"}),ng.jsx("div",{className:`w-2 h-2 rounded-full ${e?"bg-gray-500":"bg-gray-400"} animate-bounce`,style:{animationDelay:"300ms"},"aria-hidden":"true"})]}),cg=({question:e,options:t,onDecision:n,disabled:r,isDark:o=!1})=>ng.jsxs("div",{className:"mt-3 p-3 rounded-lg border "+(o?"bg-blue-900/30 border-blue-700/50":"bg-blue-50 border-blue-200"),children:[ng.jsx("p",{className:"text-sm font-medium mb-2 "+(o?"text-gray-100":"text-gray-900"),children:e}),ng.jsx("div",{className:"space-y-2",children:t.map(e=>ng.jsx("button",{onClick:()=>n(e.id,e.label),disabled:r,className:"w-full text-left px-3 py-2 text-sm rounded transition-all "+(o?"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 ug({content:e,isDark:t}){const[n,r]=I.useState(!1),o=I.useCallback(()=>{e&&(navigator.clipboard?.writeText(e).catch(()=>{}),r(!0),setTimeout(()=>r(!1),1500))},[e]);return ng.jsx("button",{type:"button",onClick:o,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":n?"Copied":"Copy message",title:n?"Copied":"Copy message",children:n?ng.jsx(gp,{className:"w-3 h-3 text-green-500"}):ng.jsx(bp,{className:"w-3 h-3"})})}const dg=({message:e,formatTime:t,isDark:n,primaryColor:r,agentMessageBubbleColor:o,resolvedAgentBubbleColor:a,textColor:i,assistantTextColor:s,fontFamily:l,agentMessageBubbleFontFamily:c,agentMessageBubbleFontSize:u,fontSize:d,isRtl:p,onDecision:g,companyLogo:f,conciergeName:h,companyName:m,apiBaseUrl:b,getAuthToken:y,onPromptSuggestionClick:v,allowFeedback:w=!0,provideCitations:k=!0,onFeedback:x,headerTextColor:S,t:C})=>{const M="string"==typeof e.content?e.content:"",P=e.isProcessing&&(!M||0===M.length),z=zd(M,p),[E,j]=I.useState(()=>e?.feedback??null),[T,N]=I.useState(!1),[F,L]=I.useState(null),[R,A]=I.useState(""),_=I.useRef(null),B=I.useCallback(e=>{if(x&&M){if(E===e)return j(null),N(!1),L(null),A(""),void x(M,null);if("like"===e)return j("like"),N(!1),L(null),A(""),void x(M,"like");j(null),L("dislike"),N(!0),A(""),setTimeout(()=>_.current?.focus(),100)}},[E,x,M]),D=I.useCallback(()=>{x&&M&&F&&(j(F),x(M,F,R.trim()||void 0),N(!1),A(""),L(null))},[x,M,F,R]),O=I.useCallback(()=>{N(!1),A(""),L(null)},[]),$=!0===e?.isError,U=$?n?"rgba(239,68,68,0.15)":"#fee2e2":null!=a?a:null!=o?o:n?"#1f2937":"#FFFFFF",V=null!=o&&"#ffffff"!==o&&"#FFFFFF"!==o&&"#1f2937"!==o,H=$?n?"#fca5a5":"#991b1b":null!=s?s:null!=i?i:n?"#f3f4f6":"#1A1A1A",W=null!=c?c:null!=l?l:"Inter",q=null!=u?u:null!=d?d:"14px";Ip(W);const{onSourceActivate:Q,downloadingKey:K}=function({apiBaseUrl:e,getAuthToken:t}){const[n,r]=I.useState(null),o=I.useCallback(async n=>{if(!n)return;const o=n.url||n.source_id||n.sourceid||n.source_name||"",a=String(n.source_id||n.sourceid||"").startsWith("attachment:"),i="string"==typeof n.url&&n.url.includes("/api/v1/sharepoint/file/");if(!("file"===n.source_type||i||a||(n.source_id||n.sourceid)&&!n.url)){const e=function(e){return"string"==typeof e&&/^https?:\/\//i.test(e)?e:void 0}(n.url);if(e)try{window.open(e,"_blank","noopener,noreferrer")}catch{}return}if(e||a){r(o);try{let r;if(a){if(!n.url)throw new Error("attachment has no URL");const o={};if("function"==typeof t){const e=await t();e&&(o.Authorization=`Bearer ${e}`)}r=await fetch($p(n.url,e),{method:"GET",headers:o,credentials:"include"})}else if(i){const o=$p(n.url,e),a={};if("function"==typeof t){const e=await t();e&&(a.Authorization=`Bearer ${e}`)}r=await fetch(o,{method:"GET",headers:a,credentials:"include"})}else{const o=`${e.replace(/\/$/,"")}/api/v1/support/file-download`,a={"Content-Type":"application/json"};if("function"==typeof t){const e=await t();e&&(a.Authorization=`Bearer ${e}`)}r=await fetch(o,{method:"POST",headers:a,credentials:"include",body:JSON.stringify({source_id:n.source_id||n.sourceid,file_name:n.url||"",source_name:n.source_name||""})})}if(!r.ok){const e=await r.json().catch(()=>({}));throw new Error(e.details||e.error||r.statusText)}const o=await r.blob(),s=r.headers.get("content-disposition");let l=n.source_name||"download";if(!a){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"),u=URL.createObjectURL(o);c.href=u,c.download=l,document.body.appendChild(c),c.click(),c.remove(),URL.revokeObjectURL(u)}catch(e){}finally{r(null)}}},[e,t]);return{onSourceActivate:o,downloadingKey:n}}({apiBaseUrl:b,getAuthToken:y}),Y=I.useMemo(()=>({sources:e.sources||[],sourcesPreliminary:!!e.sourcesPreliminary,onSourceActivate:Q,downloadingKey:K,textColor:H}),[e.sources,e.sourcesPreliminary,Q,K,H]);return ng.jsx(Op.Provider,{value:Y,children:ng.jsxs("div",{className:"flex gap-3 flex-row animate-in min-w-0",children:[ng.jsx("div",{className:"flex-shrink-0 mt-1",children:ng.jsx("div",{className:"w-8 h-8 rounded-full overflow-hidden flex items-center justify-center",style:{backgroundColor:r||"#2563eb"},children:f?ng.jsx("div",{className:"w-full h-full bg-white/10 flex items-center justify-center",children:ng.jsx("img",{src:f,alt:h||m||"Assistant avatar",className:"object-contain rounded-full",style:{width:"100%",height:"100%"}})}):ng.jsx("div",{className:"w-full h-full flex items-center justify-center",style:{fontSize:"18px",fontFamily:l||"Inter",color:S||"#FFFFFF"},children:(h||"A").charAt(0).toUpperCase()})})}),ng.jsxs("div",{className:"flex flex-col items-start min-w-0 max-w-[75%]",children:[ng.jsx("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 "+(V?"border-transparent":n?"border-gray-700":"border-gray-200"),style:{backgroundColor:U,color:H,fontFamily:W,fontSize:q,direction:z?"rtl":"ltr",textAlign:z?"right":"left",...V?{borderColor:`${U}33`}:{}},children:P?ng.jsx(lg,{isDark:n,t:C}):ng.jsx(ng.Fragment,{children:e.requiresDecision&&e.decisionData&&g?ng.jsxs("div",{children:[M&&ng.jsx("div",{className:"mb-3",children:ng.jsx(sg,{content:M,isStreaming:e.isProcessing,isDark:n,isRtl:z,textColor:H,fontFamily:W,fontSize:q,onButtonClick:v,provideCitations:k})}),ng.jsx(cg,{question:e.decisionData.question,options:e.decisionData.options,onDecision:(t,n)=>g(e.decisionData.decisionId,t,n),disabled:!!e.decisionResponse,isDark:n}),e.decisionResponse&&ng.jsxs("div",{className:"mt-2 text-xs "+(n?"text-gray-400":"text-gray-500"),children:["Selected: ",e.decisionResponse.selectedOption]})]}):M?ng.jsx(ng.Fragment,{children:ng.jsx(sg,{content:M,isStreaming:e.isProcessing,isDark:n,isRtl:z,textColor:H,fontFamily:W,fontSize:q,onButtonClick:v,provideCitations:k})}):null})}),ng.jsxs("div",{className:"flex items-center gap-1.5 mt-1.5 px-1",children:[ng.jsx("p",{className:"text-xs leading-none "+(n?"text-gray-400":"text-gray-500"),dir:"auto",children:t(e.timestamp)}),!P&&!e.isProcessing&&M&&ng.jsx(ug,{content:M,isDark:n}),!1!==w&&x&&!P&&!e.isProcessing&&M&&"welcome"!==e.type&&!e.isWelcome&&ng.jsxs("div",{className:"flex items-center gap-0.5 ms-0.5",children:[ng.jsx("button",{type:"button",onClick:()=>B("like"),className:"p-0.5 rounded transition-colors "+("like"===E||"like"===F?"text-green-500":n?"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:ng.jsx(Tp,{className:"w-3 h-3"})}),ng.jsx("button",{type:"button",onClick:()=>B("dislike"),className:"p-0.5 rounded transition-colors "+("dislike"===E||"dislike"===F?"text-red-500":n?"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:ng.jsx(jp,{className:"w-3 h-3"})})]})]}),T&&"dislike"===F&&ng.jsxs("div",{className:"mt-2 w-full rounded-xl border p-3 shadow "+(n?"bg-gray-800 border-gray-700":"bg-white border-gray-200"),style:{direction:p?"rtl":"ltr"},children:[ng.jsx("textarea",{ref:_,value:R,onChange:e=>A(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key?(e.preventDefault(),D()):"Escape"===e.key&&(e.preventDefault(),O())},placeholder:C("feedbackPlaceholder"),"aria-label":C("feedbackPlaceholder"),rows:2,className:"w-full resize-none rounded-lg border px-2 py-1.5 text-xs focus:outline-none focus:ring-1 "+(n?"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:W,textAlign:p?"right":"left"}}),ng.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-1.5",children:[ng.jsx("button",{type:"button",onClick:O,className:"text-xs px-2 py-1 rounded transition-colors "+(n?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"),style:{border:"none",background:"transparent",cursor:"pointer"},children:C("cancel")}),ng.jsx("button",{type:"button",onClick:D,className:"text-xs px-2.5 py-1 rounded text-white transition-opacity hover:opacity-90",style:{backgroundColor:r||"#2563eb",border:"none",cursor:"pointer"},children:C("submit")})]})]})]})]})})},pg=({message:e,formatTime:t,userMessageBoxColor:n,primaryColor:r,resolvedUserMessageColor:o,textColor:a,userTextColor:i,fontFamily:s,userMessageBubbleFontFamily:l,userMessageBubbleFontSize:c,fontSize:u,isDark:d,isRtl:p,t:g,onRetryMessage:f})=>{const h=null!=o?o:null!=n?n:null!=r?r:"#2563eb",m=null!=i?i:null!=a?a:"#FFFFFF",b=null!=l?l:null!=s?s:"Inter",y=null!=c?c:null!=u?u:"14px",v=zd("string"==typeof e?.content?e.content:"",p);Ip(b);const w=Array.isArray(e.attachments)?e.attachments:[];return ng.jsx("div",{className:"flex gap-3 flex-row-reverse animate-in",children:ng.jsxs("div",{className:"flex flex-col items-end max-w-[75%]",children:[w.length>0&&ng.jsx("div",{className:"mb-1.5 flex flex-wrap justify-end gap-1.5",children:w.map((e,t)=>String(e.mimeType||"").startsWith("image/")&&e.url?ng.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"block rounded-md overflow-hidden",style:{maxWidth:160},title:e.filename,children:ng.jsx("img",{src:e.url,alt:e.filename||"attachment",style:{maxWidth:160,maxHeight:160,display:"block"}})},e.storageKey||t):ng.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs",style:{backgroundColor:d?"#1f2937":"#f3f4f6",color:d?"#e5e7eb":"#374151",border:"1px solid "+(d?"#374151":"#e5e7eb"),maxWidth:200},title:e.filename,children:[ng.jsx(vp,{size:12}),ng.jsx("span",{className:"truncate",style:{maxWidth:140,direction:"ltr"},children:e.filename})]},e.storageKey||t))}),e.content&&""!==e.content.trim()&&ng.jsx("div",{className:"rounded-2xl px-4 py-2.5 shadow-lg "+(v?"rounded-tl-sm":"rounded-tr-sm"),dir:"auto",style:{background:`linear-gradient(135deg, ${h} 0%, ${h}dd 100%)`,fontFamily:b,direction:v?"rtl":"ltr",textAlign:v?"right":"left"},children:ng.jsx("p",{className:"whitespace-pre-wrap break-words",dir:"auto",style:{color:m,fontFamily:b,fontSize:y,lineHeight:"1.5",textAlign:v?"right":"left",overflowWrap:"break-word",margin:0,padding:0},children:e.content})}),ng.jsxs("div",{className:"flex items-center gap-1.5 mt-1.5 px-1",children:[ng.jsx("p",{className:"text-xs leading-none "+(d?"text-gray-400":"text-gray-500"),dir:"auto",children:t(e.timestamp)}),e.content&&""!==e.content.trim()&&ng.jsx(ug,{content:e.content,isDark:d})]}),"failed"===e.status&&ng.jsxs("div",{className:"flex items-center gap-1.5 mt-1 px-1","data-testid":"message-failed-state",children:[ng.jsx("span",{className:"text-xs leading-none",style:{color:"#dc2626"},dir:"auto",children:g("messageNotDelivered")}),"function"==typeof f&&ng.jsx("button",{type:"button",onClick:()=>f(e),className:"text-xs leading-none font-medium underline",style:{color:"#dc2626"},dir:"auto",children:g("retrySend")})]})]})})},gg=({message:e,isDark:t,primaryColor:n,agentMessageBubbleColor:r,userMessageBoxColor:o,resolvedUserMessageColor:a,resolvedAgentBubbleColor:i,textColor:s,assistantTextColor:l,userTextColor:c,fontFamily:u,agentMessageBubbleFontFamily:d,agentMessageBubbleFontSize:p,userMessageBubbleFontFamily:g,userMessageBubbleFontSize:f,fontSize:h,formatTime:m,isRtl:b,onDecision:y,companyLogo:v,conciergeName:w,companyName:k,apiBaseUrl:x,getAuthToken:S,onPromptSuggestionClick:C,allowFeedback:M,provideCitations:P,onFeedback:z,headerTextColor:E,onRetryMessage:j,defaultLanguage:T="en"})=>{const N=I.useMemo(()=>jd(T),[T]);return e?"user"===e.role?ng.jsx(pg,{message:e,formatTime:m,userMessageBoxColor:o,primaryColor:n,resolvedUserMessageColor:a,textColor:s,userTextColor:c,fontFamily:u,userMessageBubbleFontFamily:g,userMessageBubbleFontSize:f,fontSize:h,isDark:t,isRtl:b,t:N,onRetryMessage:j}):ng.jsx(dg,{message:e,formatTime:m,isDark:t,primaryColor:n,agentMessageBubbleColor:r,resolvedAgentBubbleColor:i,textColor:s,assistantTextColor:l,fontFamily:u,agentMessageBubbleFontFamily:d,agentMessageBubbleFontSize:p,fontSize:h,isRtl:b,onDecision:y,companyLogo:v,conciergeName:w,companyName:k,apiBaseUrl:x,getAuthToken:S,onPromptSuggestionClick:C,allowFeedback:M,provideCitations:P,onFeedback:z,headerTextColor:E,t:N}):null};var fg=I.memo(gg);const hg=(e,t,n)=>Number.isNaN(e)?t:Math.min(Math.max(e,t),n),mg=e=>{if(!e)return null;const t=(e=>e?.trim().toLowerCase()??"")(e),n=(e=>{const t=e.match(/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i);if(!t)return null;let n=t[1];3===n.length&&(n=n.split("").map(e=>`${e}${e}`).join(""));const r=parseInt(n.slice(0,2),16),o=parseInt(n.slice(2,4),16),a=parseInt(n.slice(4,6),16);return[r,o,a].some(e=>Number.isNaN(e))?null:{r:r,g:o,b:a}})(t);if(n)return n;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:hg(Number.parseInt(t[1],10),0,255),g:hg(Number.parseInt(t[2],10),0,255),b:hg(Number.parseInt(t[3],10),0,255)}:null})(t);return r||null},bg=({r:e,g:t,b:n})=>{const r=e=>{const t=hg(Math.round(e),0,255).toString(16);return 1===t.length?`0${t}`:t};return`#${r(e)}${r(t)}${r(n)}`},yg=(e,t,n)=>{const r=hg(n,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)}},vg=(e,t)=>{const n=hg(t,0,1);return`rgba(${hg(Math.round(e.r),0,255)}, ${hg(Math.round(e.g),0,255)}, ${hg(Math.round(e.b),0,255)}, ${n})`},wg={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)"},kg={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)"},xg=(e,t)=>{const n=mg(e);if(!n)return(e=>e?kg:wg)(t);const r=(({r:e,g:t,b:n})=>{const r=[e,t,n].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]})(n),o=mg("#0f172a")??{r:15,g:23,b:42},a=mg(t?"#f8fafc":"#f9fafb")??{r:249,g:250,b:251},i=mg(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=yg(n,o,e),l=yg(n,o,r)}else if(r<=.35){const e=t?.9:.8,r=Math.min(1,e+(t?.05:.12));s=yg(n,a,e),l=yg(n,a,r)}else{const e=t?.45:.6,r=Math.min(1,e+.1);s=yg(n,i,e),l=yg(n,i,r)}const c=yg(n,s,.65),u=yg(n,l,.7),d=`0 4px 12px ${vg(n,t?.28:.12)}`,p=`0 6px 20px ${vg(n,t?.35:.18)}`;return{background:bg(s),hoverBackground:bg(l),border:bg(c),hoverBorder:bg(u),shadow:d,hoverShadow:p}},Sg=({questions:e,isDark:t,palette:n,resolvedTextColor:r,fontFamily:o,fontSize:a,isRtl:i,onQuestionClick:s,applyHoverState:l,headingLabel:c})=>{const u=I.useRef(null),[d,p]=I.useState(!1),[g,f]=I.useState(!1),h=I.useCallback(()=>{const e=u.current;if(!e)return;const{scrollLeft:t,scrollWidth:n,clientWidth:r}=e;p(Math.abs(t)>1),f(Math.abs(t)+r<n-1)},[]);I.useEffect(()=>{h();const e=u.current;if(!e)return;const t=new ResizeObserver(h);return t.observe(e),()=>t.disconnect()},[h,e]);const m=I.useCallback(e=>{const t=u.current;if(!t)return;const n="left"===e?-150:150;t.scrollBy({left:i?-n:n,behavior:"smooth"})},[i]),b=t?"rgba(31,41,55,0.85)":"rgba(255,255,255,0.85)",y=t?"#e5e7eb":"#374151",v=t?"#4b5563":"#d1d5db";return ng.jsxs("div",{className:"px-4 py-4 border-t "+(t?"border-gray-700/50":"border-gray-200/60"),children:[ng.jsxs("div",{className:"text-xs mb-3 font-semibold tracking-wide uppercase "+(t?"text-gray-400":"text-gray-500"),children:[c||"Quick questions",":"]}),ng.jsxs("div",{className:"flex items-center gap-1.5",children:[ng.jsx("button",{onClick:()=>m("left"),disabled:!d,"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:b,border:`1px solid ${v}`,color:y,backdropFilter:"blur(4px)",opacity:d?1:.35,cursor:d?"pointer":"default"},children:ng.jsx(fp,{size:16})}),ng.jsx("div",{ref:u,onScroll:h,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 c=zd(e,i);return ng.jsxs("button",{onClick:()=>s?.(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 "+(c?"text-right":"text-left"),style:{direction:c?"rtl":"ltr",backgroundColor:n.background,border:`1.5px solid ${n.border}`,boxShadow:n.shadow},onMouseEnter:e=>{l(e.currentTarget,!0),e.currentTarget.style.transform="translateY(-2px)"},onMouseLeave:e=>{l(e.currentTarget,!1),e.currentTarget.style.transform="translateY(0)"},children:[ng.jsx("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"}),ng.jsx("span",{className:"relative z-10",style:{direction:c?"rtl":"ltr",color:r,fontFamily:o,fontSize:a,textAlign:c?"right":"left"},children:e})]},t)})}),ng.jsx("button",{onClick:()=>m("right"),disabled:!g,"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:b,border:`1px solid ${v}`,color:y,backdropFilter:"blur(4px)",opacity:g?1:.35,cursor:g?"pointer":"default"},children:ng.jsx(hp,{size:16})})]})]})},Cg=({questions:e=[],isDark:t=!1,primaryColor:n="#2563eb",onQuestionClick:r,isTyping:o=!1,layout:a="vertical",fontFamily:i="Inter",fontSize:s="14px",textColor:l,isRtl:c=!1,questionTextColor:u,questionBoxColor:d,headingLabel:p})=>{if(!e.length||o)return null;const g=u??l??(t?"#f3f4f6":"#111827"),f=I.useMemo(()=>xg(g,t),[g,t]),h=(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};return"horizontal"===a?ng.jsx(Sg,{questions:e,isDark:t,palette:f,resolvedTextColor:g,fontFamily:i,fontSize:s,isRtl:c,onQuestionClick:r,applyHoverState:h,headingLabel:p}):ng.jsxs("div",{style:{paddingInlineStart:"50px"},children:[p?ng.jsx("div",{className:"mb-2",style:{color:t?"#9ca3af":"#6b7280",fontFamily:i,fontSize:`calc(${s} - 1px)`},children:p}):null,ng.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((e,o)=>{const a=zd(e,c);return ng.jsx("button",{onClick:()=>r?.(e),className:"transition-all duration-200 active:scale-[0.97]",style:{direction:a?"rtl":"ltr",fontFamily:i,fontSize:s,color:n,backgroundColor:t?"transparent":"#ffffff",border:`1.5px solid ${n}`,borderRadius:"9999px",padding:"5px 14px",fontWeight:500,lineHeight:"1.4",whiteSpace:"normal",textAlign:a?"right":"left"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=`${n}14`},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t?"transparent":"#ffffff"},children:e},o)})})]})},Mg=({active:e=!1,processing:t=!1,deviceId:n,barWidth:r=3,barGap:o=1,barRadius:a=1.5,barColor:i,fadeEdges:s=!0,fadeWidth:l=24,barHeight:c=4,height:u=64,sensitivity:d=1,smoothingTimeConstant:p=.8,fftSize:g=256,historySize:f=60,updateRate:h=30,mode:m="static",onError:b,onStreamReady:y,onStreamEnd:v,className:w,...k})=>{const x=I.useRef(null),S=I.useRef(null),C=I.useRef([]),M=I.useRef(null),P=I.useRef(null),z=I.useRef(null),E=I.useRef(0),j=I.useRef(0),T=I.useRef(null),N=I.useRef([]),F=I.useRef(0),L=I.useRef([]),R=I.useRef(!0),A=I.useRef(null),_=I.useRef(0),B="number"==typeof u?`${u}px`:u;return I.useEffect(()=>{const e=x.current,t=S.current;if(!e||!t)return;const n=new ResizeObserver(()=>{const n=t.getBoundingClientRect(),r=window.devicePixelRatio||1;e.width=n.width*r,e.height=n.height*r,e.style.width=`${n.width}px`,e.style.height=`${n.height}px`;const o=e.getContext("2d");o&&o.scale(r,r),A.current=null,_.current=n.width,R.current=!0});return n.observe(t),()=>n.disconnect()},[]),I.useEffect(()=>{if(t&&!e){let e=0;F.current=0;const t=()=>{e+=.03,F.current=Math.min(1,F.current+.02);const n=[],a=Math.floor((S.current?.getBoundingClientRect().width||200)/(r+o));if("static"===m){const t=Math.floor(a/2);for(let r=0;r<a;r++){const o=(r-t)/t,a=1-.4*Math.abs(o),i=(.2+(.25*Math.sin(1.5*e+3*o)+.2*Math.sin(.8*e-2*o)+.15*Math.cos(2*e+o)))*a;let s=i;if(N.current.length>0&&F.current<1){const e=Math.min(r,N.current.length-1);s=(N.current[e]||0)*(1-F.current)+i*F.current}n.push(Math.max(.05,Math.min(1,s)))}}else for(let t=0;t<a;t++){const r=(t-a/2)/(a/2),o=1-.4*Math.abs(r),i=(.2+(.25*Math.sin(1.5*e+.15*t)+.2*Math.sin(.8*e-.1*t)+.15*Math.cos(2*e+.05*t)))*o;let s=i;if(N.current.length>0&&F.current<1){const e=Math.floor(t/a*N.current.length);s=(N.current[e]||0)*(1-F.current)+i*F.current}n.push(Math.max(.05,Math.min(1,s)))}"static"===m?L.current=n:C.current=n,R.current=!0,T.current=requestAnimationFrame(t)};return t(),()=>{T.current&&cancelAnimationFrame(T.current)}}if(!e&&!t){if("static"===m?L.current.length>0:C.current.length>0){let e=0;const t=()=>{e+=.03,e<1?("static"===m?L.current=L.current.map(t=>t*(1-e)):C.current=C.current.map(t=>t*(1-e)),R.current=!0,requestAnimationFrame(t)):"static"===m?L.current=[]:C.current=[]};t()}}},[t,e,r,o,m]),I.useEffect(()=>{if(!e)return z.current&&(z.current.getTracks().forEach(e=>e.stop()),z.current=null,v?.()),P.current&&"closed"!==P.current.state&&(P.current.close(),P.current=null),void(E.current&&(cancelAnimationFrame(E.current),E.current=0));return(async()=>{try{const e=await navigator.mediaDevices.getUserMedia({audio:n?{deviceId:{exact:n},echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});z.current=e,y?.(e);const t=new(window.AudioContext||window.webkitAudioContext),r=t.createAnalyser();r.fftSize=g,r.smoothingTimeConstant=p;t.createMediaStreamSource(e).connect(r),P.current=t,M.current=r,C.current=[]}catch(e){b?.(e)}})(),()=>{z.current&&(z.current.getTracks().forEach(e=>e.stop()),z.current=null,v?.()),P.current&&"closed"!==P.current.state&&(P.current.close(),P.current=null),E.current&&(cancelAnimationFrame(E.current),E.current=0)}},[e,n,g,p,b,y,v]),I.useEffect(()=>{const n=x.current;if(!n)return;const u=n.getContext("2d");if(!u)return;let p;const g=b=>{const y=n.getBoundingClientRect();if(e&&b-j.current>h&&(j.current=b,M.current)){const e=new Uint8Array(M.current.frequencyBinCount);if(M.current.getByteFrequencyData(e),"static"===m){const t=Math.floor(.05*e.length),n=Math.floor(.4*e.length),a=e.slice(t,n),i=Math.floor(y.width/(r+o)),s=Math.floor(i/2),l=[];for(let e=s-1;e>=0;e--){const t=Math.floor(e/s*a.length),n=Math.min(1,a[t]/255*d);l.push(Math.max(.05,n))}for(let e=0;e<s;e++){const t=Math.floor(e/s*a.length),n=Math.min(1,a[t]/255*d);l.push(Math.max(.05,n))}L.current=l,N.current=l}else{let t=0;const n=Math.floor(.05*e.length),r=Math.floor(.4*e.length),o=e.slice(n,r);for(let e=0;e<o.length;e++)t+=o[e];const a=t/o.length/255*d;C.current.push(Math.min(1,Math.max(.05,a))),N.current=[...C.current],C.current.length>f&&C.current.shift()}R.current=!0}if(!R.current&&!e)return void(p=requestAnimationFrame(g));R.current=e,u.clearRect(0,0,y.width,y.height);const v=i||getComputedStyle(n).color||"#000",w=r+o,k=Math.floor(y.width/w),x=y.height/2;if("static"===m){const n=t||e||L.current.length>0?L.current:[];for(let e=0;e<k&&e<n.length;e++){const t=n[e]||.1,o=e*w,i=Math.max(c,t*y.height*.8),s=x-i/2;u.fillStyle=v,u.globalAlpha=.4+.6*t,a>0?(u.beginPath(),u.roundRect(o,s,r,i,a),u.fill()):u.fillRect(o,s,r,i)}}else for(let e=0;e<k&&e<C.current.length;e++){const t=C.current.length-1-e,n=C.current[t]||.1,o=y.width-(e+1)*w,i=Math.max(c,n*y.height*.8),s=x-i/2;u.fillStyle=v,u.globalAlpha=.4+.6*n,a>0?(u.beginPath(),u.roundRect(o,s,r,i,a),u.fill()):u.fillRect(o,s,r,i)}if(s&&l>0&&y.width>0){if(!A.current||_.current!==y.width){const e=u.createLinearGradient(0,0,y.width,0),t=Math.min(.3,l/y.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)"),A.current=e,_.current=y.width}u.globalCompositeOperation="destination-out",u.fillStyle=A.current,u.fillRect(0,0,y.width,y.height),u.globalCompositeOperation="source-over"}u.globalAlpha=1,p=requestAnimationFrame(g)};return p=requestAnimationFrame(g),()=>{p&&cancelAnimationFrame(p)}},[e,t,d,h,f,r,c,o,a,i,s,l,m]),ng.jsxs("div",{className:_d("relative h-full w-full",w),ref:S,style:{height:B},"aria-label":e?"Live audio waveform":t?"Processing audio":"Audio waveform idle",role:"img",...k,children:[!e&&!t&&ng.jsx("div",{className:"border-muted-foreground/20 absolute top-1/2 right-0 left-0 -translate-y-1/2 border-t-2 border-dotted"}),ng.jsx("canvas",{className:"block h-full w-full",ref:x,"aria-hidden":"true"})]})};function Pg(e){if(!e||"user"===e.role)return null;const t=e.metadata?.senderName;return"string"==typeof t&&t.trim()?t.trim():null}const zg=I.createContext(void 0);function Eg(e,t){for(let n=t+1;n<(e||[]).length;n+=1){const t=e[n];if("user"===t?.role&&!t.sendFailed)return"string"==typeof t.content?t.content:String(t.content??"")}}const jg=({messages:e=[],isDark:t,primaryColor:n,isLoading:r,agentMessageBubbleColor:o,userMessageBoxColor:a,textColor:i,assistantTextColor:s,userTextColor:l,fontFamily:c,agentMessageBubbleFontFamily:u,agentMessageBubbleFontSize:d,userMessageBubbleFontFamily:p,userMessageBubbleFontSize:g,fontSize:f,formatTime:h,isRtl:m=!1,defaultLanguage:b="en",quickQuestions:y=[],shouldShowQuickQuestions:v=!1,onQuickQuestion:w,quickQuestionsLayout:k="vertical",onDecision:x,disclaimerEnabled:S=!1,disclaimerText:C,disclaimerPosition:M="top",disclaimerLinkUrl:P,disclaimerLinkLabel:z,resolvedAgentBubbleColor:E,resolvedUserMessageColor:j,resolvedTextColor:T,isVoiceSessionActive:N=!1,voiceStatus:F="idle",messagesContainerRef:L,companyLogo:R,chatbotAvatarEnabled:A,chatbotAvatar:_,conciergeName:B,companyName:D,apiBaseUrl:O,getAuthToken:$,onPromptSuggestionClick:U,conversationResetKey:V,allowFeedback:H,provideCitations:W,onFeedback:q,headerTextColor:Q,onRetryMessage:K,beforePromptsSlot:Y=null,promptsSlot:G=null,quickQuestionsHeadingLabel:J})=>{const X=I.useRef(null),Z=I.useRef(!0),ee=I.useRef(!1),te=I.useMemo(()=>e.map(e=>`${e.id}:${e.content?.length??0}:${e.isProcessing?1:0}`).join("|"),[e]),ne=I.useCallback(()=>{const e=L?.current;if(!e)return;const t=e.scrollHeight-e.scrollTop-e.clientHeight;Z.current=t<160},[L]);I.useEffect(()=>{const e=L?.current;if(e)return e.addEventListener("scroll",ne,{passive:!0}),ne(),()=>{e.removeEventListener("scroll",ne)}},[ne,L]),I.useEffect(()=>{V&&(Z.current=!0,ee.current=!1)},[V]),I.useEffect(()=>{if(ee.current||0===e.length||"undefined"==typeof window)return;ee.current=!0;let t,n=!1;const r=window.requestAnimationFrame(()=>{n||(t=window.requestAnimationFrame(()=>{n||(X.current?.scrollIntoView({behavior:"instant",block:"end"}),Z.current=!0)}))});return()=>{n=!0,window.cancelAnimationFrame(r),window.cancelAnimationFrame(t)}},[0===e.length]),I.useEffect(()=>{if(!Z.current)return;if("undefined"==typeof window)return;let e=!1;const t=window.requestAnimationFrame(()=>{e||X.current?.scrollIntoView({behavior:"smooth",block:"end"})});return()=>{e=!0,window.cancelAnimationFrame(t)}},[te,r]),I.useEffect(()=>{if(!N||"connected"!==F)return;if("undefined"==typeof window)return;let e=!1;const t=window.requestAnimationFrame(()=>{e||X.current?.scrollIntoView({behavior:"smooth",block:"end"})});return()=>{e=!0,window.cancelAnimationFrame(t)}},[N,F]);const re=I.useMemo(()=>Ad(P),[P]),oe=I.useMemo(()=>function(e){const t=new Map;if(!Array.isArray(e))return t;const n=new Set;for(const r of e){const e=Pg(r);if(!e||!r.id)continue;const o=!n.has(e);n.add(e),t.set(r.id,{name:e,joined:o})}return t}(e),[e]),ae=I.useMemo(()=>zd(C,m),[C,m]);return ng.jsxs(ng.Fragment,{children:[S&&C&&"top"===M&&ng.jsx("div",{className:"flex justify-center",children:ng.jsx("div",{className:"rounded-lg px-2 py-1 ",style:{color:t?"#d1d5db":"#6b7280",fontFamily:null!=c?c:"Inter",fontSize:null!=f?`calc(${f} - 2px)`:"12px",direction:ae?"rtl":"ltr",textAlign:"center",borderColor:t?"#374151":"#e5e7eb"},children:ng.jsxs("p",{className:"leading-relaxed whitespace-pre-wrap break-words inline",dir:ae?"rtl":"ltr",style:{color:t?"#d1d5db":"#6b7280",fontFamily:null!=c?c:"Inter",fontSize:null!=f?`calc(${f} - 2px)`:"12px"},children:[C,re&&z&&ng.jsx("a",{href:re,target:"_blank",rel:"noopener noreferrer",title:re,style:{color:t?"#93c5fd":"#2563eb",marginInlineStart:"4px",verticalAlign:"middle",display:"inline-flex",alignItems:"center"},children:z})]})})}),e.map((r,y)=>{const v=oe.get(r.id);return ng.jsxs(zg.Provider,{value:"assistant"===r.role?Eg(e,y):void 0,children:[v?.joined&&ng.jsx("div",{role:"status","data-testid":"agent-joined-line",style:{textAlign:"center",fontSize:"12px",opacity:.7,margin:"8px 0"},children:Ed(b,"agentJoinedConversation").replace("{name}",v.name)}),v&&ng.jsx("div",{"data-testid":"agent-sender-name",style:{fontSize:"12px",fontWeight:600,opacity:.8,margin:"0 0 2px 4px",textAlign:m?"right":"left"},children:v.name}),ng.jsx(fg,{message:r,isDark:t,primaryColor:n,agentMessageBubbleColor:o,userMessageBoxColor:a,resolvedUserMessageColor:j,resolvedAgentBubbleColor:E,textColor:i,assistantTextColor:s,userTextColor:l,fontFamily:c,agentMessageBubbleFontFamily:u,agentMessageBubbleFontSize:d,userMessageBubbleFontFamily:p,userMessageBubbleFontSize:g,fontSize:f,formatTime:h,isRtl:zd(r.content,m),onDecision:x,onPromptSuggestionClick:U,companyLogo:A&&_?_:R,conciergeName:B,companyName:D,apiBaseUrl:O,getAuthToken:$,allowFeedback:H,provideCitations:W,onFeedback:q,headerTextColor:Q,onRetryMessage:K,defaultLanguage:b})]},r.id)}),(()=>{const y=e[e.length-1],v=r&&"user"===y?.role,w=e.some(e=>"assistant"===e.role&&(e.isProcessing||!e.content));return v&&!w?ng.jsx(fg,{message:nd(),isDark:t,primaryColor:n,agentMessageBubbleColor:o,resolvedAgentBubbleColor:E,userMessageBoxColor:a,textColor:i,assistantTextColor:s,userTextColor:l,fontFamily:c,agentMessageBubbleFontFamily:u,agentMessageBubbleFontSize:d,userMessageBubbleFontFamily:p,userMessageBubbleFontSize:g,fontSize:f,formatTime:h,isRtl:m,onDecision:x,companyLogo:A&&_?_:R,conciergeName:B,companyName:D,apiBaseUrl:O,getAuthToken:$,headerTextColor:Q,defaultLanguage:b},"skeleton-waiting"):null})(),Y,G?ng.jsx("div",{className:"pt-1",children:G}):v&&y.length>0&&ng.jsx("div",{className:"pt-1",children:ng.jsx(Cg,{questions:y,isDark:t,primaryColor:n,onQuestionClick:w,isTyping:r,layout:k,fontFamily:c,fontSize:f,textColor:i,isRtl:m,questionTextColor:s,questionBoxColor:o,headingLabel:J})}),N&&"connected"===F&&!r&&ng.jsx("div",{className:"flex gap-3 flex-row-reverse animate-in",children:ng.jsx("div",{className:"flex flex-col items-end max-w-[75%] w-full",children:ng.jsxs("div",{className:"rounded-2xl px-4 py-2.5 shadow-lg rounded-tr-sm w-full",style:{background:`linear-gradient(135deg, ${j||n||"#2563eb"} 0%, ${j||n||"#2563eb"}dd 100%)`,width:"100px"},children:[ng.jsx("span",{className:"sr-only",children:"Listening for voice input"}),ng.jsx(Mg,{active:!0,barWidth:2,barHeight:4,barGap:2,barColor:l||T||"#FFFFFF",height:20,fadeEdges:!0,className:"min-w-[60px]","aria-hidden":"true"})]})})}),ng.jsx("div",{ref:X,className:"h-px"})]})};function Tg(e,t){return String(e||"").replace(/\/+$/,"")+(t.startsWith("/")?t:`/${t}`)}function Ng({apiEndpoint:e,conversationId:t,size:n,authHeader:r}){fetch(Tg(e,"/api/v1/chat-attachments/release"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversationId:t,size:n})}).catch(()=>{})}function Fg({orgId:e,conversationId:t,config:n,apiEndpoint:r,authHeader:o,onError:a}){const[i,s]=I.useState([]),l=I.useRef(new Map),c=I.useRef(0),u=I.useRef(i);u.current=i;const d=I.useRef({conversationId:t,bytes:0});d.current.conversationId!==t&&(d.current={conversationId:t,bytes:0});const p=I.useCallback(()=>(c.current+=1,`att-${Date.now()}-${c.current}`),[]),g=I.useCallback((e,t)=>{s(n=>n.map(n=>n.id===e?{...n,...t}:n))},[]),f=I.useCallback((e,t,n)=>{const r={status:"error",error:{code:t,message:n}};s(t=>{const n=t.map(t=>t.id===e?{...t,...r}:t),o=n.find(t=>t.id===e);return o&&a&&a(o),n})},[a]),h=I.useCallback((e,t)=>{if(!n?.fileUploadEnabled)return{ok:!1,code:"feature_disabled",message:"File uploads are not enabled for this organization."};if(t>=n.fileUploadMaxFiles)return{ok:!1,code:"too_many_files",message:`Max ${n.fileUploadMaxFiles} files per message.`};const r=1024*n.fileUploadMaxSizeMB*1024;if(d.current.bytes+e.size>r){return{ok:!1,code:"size_exceeded",message:`This conversation has already used ${(d.current.bytes/1048576).toFixed(1)} MB of its ${n.fileUploadMaxSizeMB} MB upload limit - this file won't fit.`}}const o=(e.type||"").toLowerCase(),a=new Set((n.fileUploadAllowedMimes||[]).map(e=>String(e).toLowerCase()));return a.size>0&&!a.has(o)?{ok:!1,code:"mime_not_allowed",message:`File type "${e.type||"unknown"}" is not allowed.`}:{ok:!0}},[n]),m=I.useCallback(async(e,n)=>{let a;try{a=await fetch(Tg(r,"/api/v1/chat-attachments/presign"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...o?{Authorization:o}:{}},body:JSON.stringify({filename:n.name,mimeType:n.type,size:n.size,conversationId:t})})}catch(t){return d.current.bytes=Math.max(0,d.current.bytes-n.size),void f(e,"network","Network error while requesting upload.")}if(!a.ok){let t="Upload rejected by the server.",r="unknown";try{const e=await a.json();e?.error&&(t=e.error),e?.code&&(r=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 d.current.bytes=Math.max(0,d.current.bytes-n.size),void f(e,r,t)}let i=0;const s=()=>{i>0&&(Ng({apiEndpoint:r,conversationId:t,size:i,authHeader:o}),i=0,g(e,{reservedBytes:0}))},c=()=>{d.current.bytes=Math.max(0,d.current.bytes-n.size)};let u;try{u=await a.json()}catch{return Ng({apiEndpoint:r,conversationId:t,size:n.size,authHeader:o}),c(),g(e,{reservedBytes:0}),void f(e,"unknown","Malformed presign response.")}let p,h;("boolean"==typeof u.reserved?u.reserved:!u.useMultipart)&&(i=n.size,g(e,{reservedBytes:n.size}));try{if(u.useMultipart){const a=await function({url:e,file:t,conversationId:n,authHeader:r,onProgress:o,registerXhr:a}){return new Promise((r,i)=>{const s=new XMLHttpRequest;a(s),s.open("POST",e,!0),s.withCredentials=!0;const l=new FormData;l.append("conversationId",n),l.append("file",t,t.name),s.upload.onprogress=e=>{e.lengthComputable&&o(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:Tg(r,"/api/v1/chat-attachments/multipart"),file:n,conversationId:t,authHeader:o,onProgress:t=>g(e,{progress:t}),registerXhr:t=>l.current.set(e,t)});p=a.url,h=a.storageKey,i=n.size,g(e,{reservedBytes:n.size})}else{if(!u.uploadUrl)throw new Error("presign_missing_target");{await function({url:e,file:t,onProgress:n,registerXhr:r}){return new Promise((o,a)=>{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&&n(Math.round(e.loaded/e.total*100))},i.onload=()=>{i.status>=200&&i.status<300?o():a(new Error(`upload_status_${i.status}`))},i.onerror=()=>a(new Error("network")),i.onabort=()=>a({aborted:!0}),i.send(t)})}({url:u.uploadUrl,file:n,onProgress:t=>g(e,{progress:t}),registerXhr:t=>l.current.set(e,t)});const t=await async function({apiEndpoint:e,storageKey:t,filename:n,mimeType:r,authHeader:o}){let a;try{a=await fetch(Tg(e,"/api/v1/chat-attachments/confirm"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...o?{Authorization:o}:{}},body:JSON.stringify({storageKey:t,filename:n,mimeType:r})})}catch{return{ok:!1,code:"network",message:"Network error while verifying upload."}}if(a.ok)return{ok:!0};let i="Upload rejected - file content did not match its declared type.",s="content_mismatch";try{const e=await a.json();e?.error&&(i=e.error),"password_protected"===e?.code&&(s="password_protected")}catch{}return{ok:!1,code:s,message:i}}({apiEndpoint:r,storageKey:u.storageKey,filename:n.name,mimeType:n.type,authHeader:o});if(!t.ok)return l.current.delete(e),s(),c(),void f(e,t.code,t.message)}}}catch(t){if(l.current.delete(e),t&&t.aborted)return;return s(),c(),void f(e,"network","Upload failed. Please retry.")}l.current.delete(e),g(e,{status:"ready",progress:100,storageKey:h||u.storageKey,...p?{url:p}:{}})},[r,o,t,f,g]),b=I.useCallback(async e=>{const t=Array.from(e);for(const e of t){const t=u.current.filter(e=>"error"!==e.status).length,n=h(e,t),r=p();if(!n.ok){const t={id:r,filename:e.name,size:e.size,mimeType:e.type,status:"error",error:{code:n.code,message:n.message}};s(e=>(a&&a(t),[...e,t]));continue}const o={id:r,filename:e.name,size:e.size,mimeType:e.type,status:"uploading",progress:0,reservedBytes:0};s(e=>[...e,o]),d.current.bytes+=e.size,m(r,e)}},[h,m,p,a]),y=I.useCallback(e=>{const n=l.current.get(e);n&&(n.abort(),l.current.delete(e));const a=u.current.find(t=>t.id===e);a&&a.reservedBytes>0&&(Ng({apiEndpoint:r,conversationId:t,size:a.reservedBytes,authHeader:o}),d.current.bytes=Math.max(0,d.current.bytes-a.reservedBytes)),s(t=>t.filter(t=>t.id!==e))},[r,o,t]),v=I.useCallback(()=>{for(const e of l.current.values())e.abort();l.current.clear(),s([])},[]),w=I.useMemo(()=>i.some(e=>"validating"===e.status||"uploading"===e.status),[i]),k=I.useCallback(()=>i.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})),[i]);return{attachments:i,addFiles:b,removeAttachment:y,clearAll:v,isBusy:w,toSendPayload:k}}function Lg(e){if(!e||e<1024)return`${e||0} B`;const t=["KB","MB","GB"];let n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(n>=10?0:1)} ${t[r]}`}function Rg({attachment:e,onRemove:t,isDark:n}){const r="error"===e.status,o="uploading"===e.status,a="ready"===e.status,i=r?n?"rgba(239,68,68,0.15)":"#fee2e2":n?"#1f2937":"#f3f4f6",s=r?n?"#b91c1c":"#fca5a5":n?"#374151":"#e5e7eb",l=r?n?"#fca5a5":"#b91c1c":n?"#e5e7eb":"#374151",c=r?`${e.filename} - ${e.error?.message||"error"}`:o?`${e.filename} - uploading`:`${e.filename} - ready`;return ng.jsxs("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?ng.jsx(mp,{size:12,"aria-hidden":"true"}):o?ng.jsx(wp,{size:12,className:"animate-spin","aria-hidden":"true"}):ng.jsx(vp,{size:12,"aria-hidden":"true"}),ng.jsx("span",{className:"truncate",style:{maxWidth:140,direction:"ltr"},children:e.filename}),a&&ng.jsx("span",{className:"opacity-70 text-chip",children:Lg(e.size)}),o&&"number"==typeof e.progress&&ng.jsxs("span",{className:"opacity-70 text-chip",children:[e.progress,"%"]}),ng.jsx("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:ng.jsx(Np,{size:12})})]})}function Ag({prompts:e,getDisplayText:t,detectDirection:n,ambientIsRtl:r,wrapperProps:o,stackProps:a,getKey:i,getChipProps:s,onChipClick:l,onSelect:c,before:u,after:d}){const p=I.createElement("div",a,e.map((e,o)=>{const a=t(e),u=n(a,r);return I.createElement("button",{key:i(e,o),type:"button",...s({prompt:e,index:o,displayText:a,chipIsRtl:u}),onClick:t=>{l&&l(e,o),c(e,o,t)}},a)}));return null==u&&null==d?I.createElement("div",o,p):I.createElement("div",o,u,p,d)}const _g=({suggestions:e,onSuggestionClick:t,promptPrimary:n,promptTextColor:r,promptFontFamily:o,promptFontSize:a,isRtl:i,t:s,questionDisplay:l=!0})=>ng.jsx(Ag,{prompts:e,getDisplayText:e=>((e,t=!0)=>{if(!e||"string"==typeof e)return e||"";const n="string"==typeof e.text?e.text:"";if(!t)return n;const r="string"==typeof e.submitText?e.submitText.trim():"";return r&&r!==n?r:n})(e,l),detectDirection:zd,ambientIsRtl:i,wrapperProps:{className:"mb-2 px-5"},stackProps:{className:"flex flex-col gap-2",role:"group","aria-label":s("suggestedQuestions")},getKey:(e,t)=>`${e.text||e}-${t}`,getChipProps:({chipIsRtl:e})=>({dir:e?"rtl":"ltr",className:"block w-full rounded-2xl px-4 py-2 border-0 transition-transform duration-150 active:scale-[0.99] "+(e?"text-right":"text-left"),style:{direction:e?"rtl":"ltr",textAlign:e?"right":"left",background:`linear-gradient(135deg, ${n} 0%, ${n}dd 100%)`,color:r,fontFamily:o,fontSize:a}}),onSelect:(e,n)=>t(e.submitText||e.text||e,e,n)}),Ig=({onStopGeneration:e,inputValue:t,setInputValue:n,onSend:r,isDark:o,primaryColor:a,isOpen:i,isMinimized:s,isLoading:l,isConversationLoading:c=!1,placeholder:u,textColor:d,fontFamily:p,fontSize:g,isRtl:f=!1,csatVisible:h=!1,enableVoiceInteraction:m=!1,isVoiceSessionActive:b=!1,voiceStatus:y="idle",voiceError:v=null,onVoiceToggle:w,onBidiSubmit:k,disclaimerEnabled:x=!1,disclaimerText:S,disclaimerPosition:C="top",disclaimerLinkUrl:M,disclaimerLinkLabel:P,showPoweredBy:z=!0,onboardingQuestions:E=[],onboardingActive:j=!1,onboardingCompleted:T=!1,userMessageBubbleFontFamily:N,onboardingEnabled:F=!1,userMessageBubbleFontSize:L,userMessageBoxColor:R,resolvedUserMessageColor:A,userTextColor:_,promptSuggestions:B,onPromptSuggestionClick:D,autoPromptQuestionDisplay:O=!0,tagSelectorNode:$=null,showResolveButton:U=!1,onResolve:V,defaultLanguage:H="en",chatFeatures:W,apiEndpoint:q,organizationId:Q,conversationId:K})=>{const Y=I.useMemo(()=>jd(H),[H]),G=I.useMemo(()=>function(e){const t=Sd(e),n=wd[t]||vd;return{beforeBrand:n.poweredByBefore??n.poweredBy??vd.poweredByBefore,afterBrand:n.poweredByAfter??""}}(H),[H]),J=I.useMemo(()=>zd(t,f),[t,f]),[X,Z]=I.useState(!1),[ee,te]=I.useState(!1),ne=I.useMemo(()=>({fileUploadEnabled:W?.fileUploadEnabled??!1,fileUploadMaxSizeMB:W?.fileUploadMaxSizeMB??10,fileUploadMaxFiles:W?.fileUploadMaxFiles??3,fileUploadAllowedMimes:W?.fileUploadAllowedMimes??[]}),[W]),{attachments:re,addFiles:oe,removeAttachment:ae,clearAll:ie,isBusy:se,toSendPayload:le}=Fg({orgId:Q,conversationId:K,config:ne,apiEndpoint:q,authHeader:void 0}),ce=I.useRef(null),ue=I.useRef(new Set);I.useEffect(()=>{if(!b||!K||!q)return;const e=le().filter(e=>e.storageKey&&!ue.current.has(e.storageKey));e.length&&(e.forEach(e=>ue.current.add(e.storageKey)),fetch(`${String(q).replace(/\/$/,"")}/api/v1/chat-attachments/ingest`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversationId:K,attachments:e.map(e=>({storageKey:e.storageKey}))})}).catch(()=>{}))},[b,K,q,re,le]);const de=!!ne.fileUploadEnabled&&!!q,pe=re.length>=ne.fileUploadMaxFiles,ge=`Max ${ne.fileUploadMaxFiles} files per message.`,fe=I.useMemo(()=>ne.fileUploadAllowedMimes.length>0?ne.fileUploadAllowedMimes.join(","):void 0,[ne.fileUploadAllowedMimes]),[he,me]=I.useState({top:0,left:0,placement:"top",arrowOffset:0}),[be,ye]=I.useState(!1),ve=I.useRef(null),we=I.useRef(null),ke=I.useRef(null),xe=I.useRef(null);Ip(p),Ip(N),I.useEffect(()=>{i&&!s&&we.current?.focus()},[i,s]),I.useEffect(()=>{const e=we.current;if(e){e.style.height="auto";const n=e.scrollHeight,r=t.trim().length>0?20:48,o=Math.max(r,Math.min(n,120));e.style.height=`${o}px`}},[t]);const Se=I.useCallback(()=>{const e=le();e.length>0?(r(void 0,e),ie()):r()},[le,ie,r]),Ce=re.some(e=>"ready"===e.status),Me=!t.trim()&&!Ce||l||c||se,Pe=o?"#374151":"#e5e7eb",ze=E&&E.length>0,Ee=h||c||F&&(ze&&!T)||"connecting"===y,je=h?Y("pleaseSubmitRatingFirst"):ze?j?Y("completeOnboardingToEnableVoice"):T?"":Y("sendMessageToCompleteOnboarding"):"",Te=()=>{if(!ke.current)return;const e=ke.current.getBoundingClientRect(),t=220,n=e.top,r=window.innerHeight-e.bottom;let o="top",a=0,i=0;n>=73?(o="top",a=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?(o="bottom",a=e.bottom+8,i=e.right-t,i<10&&(i=10),i+t>window.innerWidth-10&&(i=window.innerWidth-t-10)):(o="top",a=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:a,left:i,placement:o,arrowOffset:e.left+e.width/2-i}};I.useEffect(()=>{if(ee&&je){const e=()=>{const e=Te();me(e)};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}}},[ee,je]),I.useEffect(()=>()=>{ve.current&&clearTimeout(ve.current)},[]);const Ne=null!=A?A:null!=R?R:null!=a?a:"#2563eb",Fe=null!=_?_:null!=d?d:"#FFFFFF",Le=null!=N?N:null!=p?p:"Inter",Re=null!=L?L:null!=g?g:null,Ae=Re?`calc(${Re} - 2px)`:"12px",_e=Ad(M);return ng.jsxs("div",{className:"py-4 flex-shrink-0 relative "+(o?"bg-gray-900":"bg-white"),style:{overflow:"visible"},children:[$||B.length>0&&D&&ng.jsx(_g,{suggestions:B,onSuggestionClick:D,questionDisplay:O,promptPrimary:Ne,promptTextColor:Fe,promptFontFamily:Le,promptFontSize:Ae,isRtl:f,t:Y}),ng.jsx("div",{className:"my-4",style:{height:"1px",backgroundColor:Pe}}),de&&re.length>0&&ng.jsx("div",{className:"px-5 mb-2 flex flex-wrap gap-1.5",children:re.map(e=>ng.jsx(Rg,{attachment:e,onRemove:ae,isDark:o},e.id))}),ng.jsxs("div",{className:"flex items-center px-5 gap-1.5",children:[de&&ng.jsx("input",{ref:ce,type:"file",multiple:!0,accept:fe,"aria-label":Y("uploadFile"),className:"hidden",style:{display:"none"},onChange:e=>{const t=e.target.files;t&&t.length&&!pe&&oe(t),e.currentTarget.value=""}}),ng.jsxs("div",{className:`flex-1 flex items-center gap-1 px-1 min-h-[48px] ${o?"bg-gray-800":"bg-gray-50"} rounded-2xl transition-all duration-200`,style:{borderStyle:"solid",borderColor:t&&t.trim().length>0?a||"#2563eb":Pe,borderWidth:t&&t.trim().length>0?"2px":"1px"},children:[de&&ng.jsxs("div",{className:"relative group shrink-0",children:[ng.jsx("button",{type:"button",onClick:()=>ce.current&&ce.current.click(),disabled:h||c||l||pe,"aria-label":pe?ge:"Attach file",title:pe?ge:"Attach file",className:`h-8 w-8 rounded-lg flex items-center justify-center transition-colors duration-200 ${o?"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:ng.jsx(Sp,{className:"w-4 h-4"})}),pe&&ng.jsx("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 "+(o?"bg-gray-700 text-gray-100":"bg-gray-800 text-white"),children:ge})]}),ng.jsx("div",{className:"relative flex-1 flex items-center min-w-0",children:ng.jsx("textarea",{id:"chat-widget-input",ref:we,"aria-label":u||Y("typeYourMessage"),value:t,onChange:e=>{n(e.target.value)},onFocus:()=>Z(!0),onBlur:()=>Z(!1),onKeyDown:e=>{if("Enter"===e.key&&!e.shiftKey){if(e.preventDefault(),b&&k&&!Ce)return void k();if(Me)return;Se()}},placeholder:c?Y("agentIsLoading"):u||Y("typeYourMessage"),rows:1,disabled:h||c||l||b&&"connected"!==y,dir:J?"rtl":"ltr",className:`w-full px-3 bg-transparent rounded-xl leading-normal ${o?"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:t.trim().length>0?"12px":"0px",paddingBottom:t.trim().length>0?"12px":"0px",lineHeight:t.trim().length>0?"1.4":"48px",fontFamily:N||p||"Inter",fontSize:g||"14px",color:o?"#F3F4F6":"#1F2937",textAlign:J?"right":"left",direction:J?"rtl":"ltr",wordSpacing:"0",letterSpacing:"0"}})}),m&&ng.jsxs("div",{className:"relative shrink-0",onMouseEnter:()=>{if(Ee&&je){ve.current&&(clearTimeout(ve.current),ve.current=null);const e=Te();me(e),te(!0)}},onMouseLeave:()=>{ve.current&&(clearTimeout(ve.current),ve.current=null),te(!1)},children:[ng.jsx("button",{style:{border:"none"},ref:ke,type:"button",onClick:w,"aria-label":Y(b?"stopVoiceInput":"startVoiceInput"),className:`h-8 w-8 rounded-lg flex items-center justify-center transition-colors duration-200 ${b?"bg-red-500 text-white hover:bg-red-600":o?"text-gray-300 hover:bg-gray-700":"text-gray-500 hover:bg-gray-200"} ${Ee?"opacity-60 cursor-not-allowed":""}`,disabled:Ee,children:"connecting"===y?ng.jsx(wp,{className:"w-4 h-4 animate-spin"}):ng.jsx(pp,{className:"w-4 h-4"})}),ee&&je&&"undefined"!=typeof document&&Hu.createPortal(ng.jsxs("div",{ref:xe,className:"px-3 py-1.5 text-xs shadow-md pointer-events-none",style:{position:"fixed",top:`${he.top}px`,left:`${he.left}px`,maxWidth:"220px",whiteSpace:"normal",wordWrap:"break-word",minWidth:"180px",zIndex:999999,backgroundColor:o?"#1f2937":"#ffffff",color:o?"#f3f4f6":"#111827",border:o?"1px solid #374151":"1px solid #e5e7eb",borderRadius:"top"===he.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:[ng.jsx("div",{className:"text-left leading-relaxed",children:je}),"top"===he.placement&&ng.jsxs(ng.Fragment,{children:[ng.jsx("div",{style:{position:"absolute",top:"100%",left:`${he.arrowOffset}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:o?"6px solid #374151":"6px solid #e5e7eb",pointerEvents:"none"}}),ng.jsx("div",{style:{position:"absolute",top:"100%",left:`${he.arrowOffset}px`,transform:"translateX(-50%)",marginTop:"-1px",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:o?"5px solid #1f2937":"5px solid #ffffff",pointerEvents:"none"}})]}),"bottom"===he.placement&&ng.jsxs(ng.Fragment,{children:[ng.jsx("div",{className:"absolute bottom-full",style:{left:`${he.arrowOffset}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderBottom:o?"5px solid #374151":"5px solid #e5e7eb"}}),ng.jsx("div",{className:"absolute bottom-full -mb-px",style:{left:`${he.arrowOffset}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:o?"4px solid #1f2937":"4px solid #ffffff"}})]})]}),document.body)]})]}),l&&!b&&"function"==typeof e?ng.jsx("button",{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:a,color:"white",border:"none"},"aria-label":Y("stopGenerating"),children:ng.jsx(Pp,{className:"w-3.5 h-3.5",fill:"currentColor"})}):ng.jsx("button",{onClick:b&&k&&!Ce?k:Se,disabled:h||Me||b&&"connected"!==y,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 "+(t.trim()?"scale-100":"scale-95"),style:{backgroundColor:t.trim()?a:o?"#374151":"#e5e7eb",color:t.trim()?"white":"#9ca3af",border:"none"},"aria-label":Y("sendMessage"),children:ng.jsx(Mp,{className:"w-4 h-4 transition-transform",style:f?{transform:"rotate(-90deg)"}:void 0})})]}),b&&ng.jsxs("p",{"aria-live":"polite",className:`text-xs mt-2 px-5 ${"connected"===y?"text-status-success":"text-gray-500"} flex items-center gap-1`,children:[ng.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current inline-flex"}),Y("connected"===y?"voiceSessionLive":"connectingVoice")]}),v&&ng.jsx("p",{role:"alert",className:"text-xs mt-1 px-5 text-status-error",children:Y(v)===v?Y("voiceUnavailable"):Y(v)}),x&&S&&"footer"===C&&ng.jsxs("p",{className:"text-xs mt-2 px-5 text-center",style:{color:o?"#d1d5db":"#6b7280",fontFamily:p||"Inter",fontSize:g?`calc(${g} - 2px)`:"12px",direction:f?"rtl":"ltr"},dir:f?"rtl":"ltr",children:[S,_e&&P&&ng.jsx("a",{href:_e,target:"_blank",rel:"noopener noreferrer",title:_e,style:{color:o?"#93c5fd":"#2563eb",marginInlineStart:"4px",verticalAlign:"middle",display:"inline-flex",alignItems:"center"},children:P})]}),z&&ng.jsx("div",{className:"mt-1.5 flex justify-center",children:ng.jsx("a",{href:"https://eshal.ai",target:"_blank",rel:"noopener noreferrer",className:"no-underline",children:ng.jsxs("span",{dir:"ltr",className:"inline-flex items-center gap-1.5 py-1.5 px-3",children:[G.beforeBrand&&ng.jsx("span",{className:_d("font-sans text-[10px] font-medium",o?"text-gray-400":"text-gray-500"),children:G.beforeBrand}),be?ng.jsx("span",{className:_d("font-sans text-[10px] font-semibold",o?"text-gray-300":"text-gray-600"),children:"ESHAL"}):ng.jsx("img",{src:o?"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:_d("h-3",o?"opacity-60":"opacity-50"),onError:()=>ye(!0)}),G.afterBrand&&ng.jsx("span",{className:_d("font-sans text-[10px] font-medium",o?"text-gray-400":"text-gray-500"),children:G.afterBrand})]})})})]})},Bg=["sun","mon","tue","wed","thu","fri","sat"];function Dg(e){if(!e||"string"!=typeof e)return null;const t=e.match(/^(\d{1,2}):(\d{2})/);if(!t)return null;const n=parseInt(t[1],10),r=parseInt(t[2],10);return Number.isNaN(n)||Number.isNaN(r)?null:60*n+r}function Og(e,t=new Date,n={}){if(!e||!e.showStatus)return null;const r=n.online||"Online now",o=n.officeOpen||"Online now",a=n.offlineFallback||"Offline";if("officeHours"!==e.statusMode)return{online:!0,label:r};const i=e.officeHours||{},{dayKey:s,minutes:l}=function(e,t){try{const n=new Intl.DateTimeFormat("en-US",{timeZone:e||void 0,weekday:"short",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),r=(n.find(e=>"weekday"===e.type)||{}).value||"";let o=parseInt((n.find(e=>"hour"===e.type)||{}).value||"0",10);const a=parseInt((n.find(e=>"minute"===e.type)||{}).value||"0",10);return 24===o&&(o=0),{dayKey:r.slice(0,3).toLowerCase(),minutes:60*o+a}}catch{return{dayKey:Bg[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()):[],u=Dg(i.open),d=Dg(i.close);if(c.includes(s)&&(null!=u&&null!=d&&(u<=d?l>=u&&l<d:l>=u||l<d))){return{online:!0,label:(i.onlineMessage||"").trim()||o}}return{online:!1,label:(i.offlineMessage||"").trim()||a}}const $g=({conciergeName:e,companyName:t,companyLogo:n,primaryColor:r,isDark:o,isMinimized:a=!1,textColor:i,fontFamily:s,fontSize:l,onToggleTheme:c,onMinimize:u,onClose:d,headerTextBold:p=!1,headerTextItalic:g=!1,headerTextColor:f,headerFontFamily:h,headerFontSize:m,subtitle:b=null,showStatus:y=!1,statusMode:v="always",officeHours:w=null,onRefreshChat:k,onCopyChat:x,defaultLanguage:S="en"})=>{const C=r,M=f||"#FFFFFF",P=h||s||"Inter",z=m||l;Ip(P);const E=I.useMemo(()=>jd(S),[S]),j=Cd(S),T=I.useMemo(()=>zd(b,j),[b,j]),N=I.useMemo(()=>Og({showStatus:y,statusMode:v,officeHours:w}),[y,v,w]),[F,L]=I.useState(!1),R=I.useRef(null),A=I.useRef(null);I.useEffect(()=>{if(!F)return;const e=e=>{R.current&&!e.composedPath().includes(R.current)&&L(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[F]);const _=I.useRef(!1);I.useEffect(()=>{if(F){_.current=!0;const e=R.current?.querySelector('[role="menuitem"]');e?.focus()}else _.current&&(_.current=!1,A.current?.focus())},[F]);const B=M;return ng.jsxs("div",{className:`text-white ${a?"px-4 py-2.5":"px-3 py-4"} flex items-center justify-between relative overflow-visible rounded-t-2xl z-[60]`,style:{background:C,fontFamily:P},children:[ng.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 pl-1",children:[ng.jsxs("div",{className:"relative w-11 h-11 flex-shrink-0",children:[ng.jsx("div",{className:"w-full h-full rounded-full overflow-hidden flex items-center justify-center bg-white/20",children:n?ng.jsx("img",{src:n,alt:"Logo",style:{display:"block",width:"100%",height:"100%",objectFit:"contain"},loading:"lazy"}):ng.jsx("span",{className:"text-lg font-semibold leading-none",style:{color:B},children:(e||t||"")?.charAt(0)?.toUpperCase()})}),N?ng.jsx("span",{title:N.label,className:_d("absolute bottom-0 h-3 w-3 rounded-full ring-2 ring-white",j?"left-0":"right-0"),style:{backgroundColor:N.online?"#22c55e":"#9ca3af",boxShadow:N.online?"0 0 0 3px rgba(34,197,94,0.25)":"none"},"aria-hidden":"true"}):null]}),ng.jsxs("div",{className:"flex flex-col justify-center min-w-0",style:{fontFamily:P},children:[ng.jsx("h3",{title:e,className:_d("font-semibold leading-snug truncate",p&&"font-bold",g&&"italic"),style:{fontSize:z?`calc(${z} + 2px)`:"15px",color:B},children:e}),b?ng.jsx("p",{title:b,className:"leading-snug truncate opacity-75",dir:T?"rtl":"ltr",style:{fontSize:"12px",color:B,textAlign:T?"right":"left"},children:b}):null]})]}),ng.jsxs("div",{className:"flex items-center gap-0 relative z-10 text-white flex-shrink-0 ml-1",children:[ng.jsxs("div",{className:"relative",ref:R,children:[ng.jsx("button",{type:"button",ref:A,"aria-label":E("menu"),"aria-expanded":F,"aria-haspopup":"true",onClick:()=>L(e=>!e),onKeyDown:e=>{"Escape"===e.key&&F&&(e.preventDefault(),L(!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:B},children:ng.jsx(yp,{className:"w-4 h-4",strokeWidth:1.6})}),F&&ng.jsxs("div",{role:"menu","aria-label":E("menu"),dir:j?"rtl":"ltr",onKeyDown:e=>{if("Escape"===e.key)return e.preventDefault(),void L(!1);if("Tab"===e.key){const t=R.current?Array.from(R.current.querySelectorAll('[role="menuitem"]')):[];if(0===t.length)return;const n=t[0],r=t[t.length-1],o=document.activeElement;e.shiftKey&&o===n?(e.preventDefault(),r.focus()):e.shiftKey||o!==r||(e.preventDefault(),n.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 ${j?"left-0":"right-0"} ${o?"bg-gray-800 border-gray-700":"bg-white border-gray-200"}`,style:{fontFamily:P},children:[ng.jsxs("button",{role:"menuitem",onClick:()=>{L(!1),k?.()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm leading-5 transition-colors cursor-pointer "+(o?"text-gray-200 hover:bg-gray-700":"text-gray-700 hover:bg-gray-50"),style:{fontFamily:P,fontSize:"14px",border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",textAlign:j?"right":"left"},children:[ng.jsx(Cp,{className:"w-3.5 h-3.5 flex-shrink-0"}),E("refreshChat")]}),ng.jsxs("button",{role:"menuitem",onClick:()=>{L(!1),x?.()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm leading-5 transition-colors cursor-pointer "+(o?"text-gray-200 hover:bg-gray-700":"text-gray-700 hover:bg-gray-50"),style:{fontFamily:P,fontSize:"14px",border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",textAlign:j?"right":"left"},children:[ng.jsx(bp,{className:"w-3.5 h-3.5 flex-shrink-0"}),E("copyChat")]}),ng.jsxs("button",{role:"menuitem",onClick:()=>{L(!1),c?.()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm leading-5 transition-colors cursor-pointer "+(o?"text-gray-200 hover:bg-gray-700":"text-gray-700 hover:bg-gray-50"),style:{fontFamily:P,fontSize:"14px",border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",textAlign:j?"right":"left"},children:[o?ng.jsx(Ep,{className:"w-3.5 h-3.5 flex-shrink-0"}):ng.jsx(xp,{className:"w-3.5 h-3.5 flex-shrink-0"}),E(o?"lightMode":"nightMode")]})]})]}),ng.jsx("button",{type:"button","aria-label":E("close"),onClick:d,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:B},children:ng.jsx(Np,{className:"w-3.5 h-3.5",strokeWidth:1.6})})]})]})},Ug=({questions:e=[],collapsiblePrompt:t,onSubmit:n,primaryColor:r="#2563eb",isRtl:o=!1,isDark:a=!1,defaultLanguage:i="en",fontFamily:s})=>{const l=I.useMemo(()=>jd(i),[i]),[c,u]=I.useState({}),[d,p]=I.useState({}),[g,f]=I.useState(!1),h=I.useRef({}),m=[...e].sort((e,t)=>Bd(e.fieldType)-Bd(t.fieldType));return ng.jsx("div",{className:"flex flex-col items-center justify-center p-6 h-full min-h-0 z-50 relative ",style:{...s?{fontFamily:s}:{},...a?{backgroundColor:"#10141C"}:{}},children:ng.jsxs("div",{className:"w-full max-w-sm rounded-2xl shadow-xl border p-8 transition-colors duration-300 bg-white border-gray-100",style:a?{backgroundColor:"#1E232B",border:"1px solid #2A303C"}:void 0,children:[t&&ng.jsx("div",{className:"mb-4 text-start",children:ng.jsx("h3",{className:"transition-colors duration-300 text-sm font-semibold mb-1 "+(a?"text-white":"text-[#4A5568]"),children:t})}),ng.jsxs("form",{onSubmit:async e=>{e.preventDefault();const t=(()=>{const e={};return m.forEach(t=>{const n=t.fieldType||"question",r=(c[n]??"").trim(),o=t.collectionPrompt||t.askToType||t.question||t.label||n,a=!0===t.required||"true"===t.required;r?("fullName"!==n&&"name"!==n||r.length<2&&(e[n]=l("nameInvalid")),"email"!==n||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)||(e[n]=l("emailInvalid")),"phone"!==n&&"mobileno"!==n||/^[+]?[\d\s-]{8,15}$/.test(r)||(e[n]=l("phoneInvalid"))):a&&(e[n]="email"===n?l("emailRequired"):"fullName"===n||"name"===n?l("nameRequired"):"phone"===n||"mobileno"===n?l("phoneRequired"):`${o} ${l("fieldRequiredSuffix")}`)}),p(e),e})();if(Object.keys(t).length>0){const e=m.map((e,t)=>e.fieldType||`question_${t}`).find(e=>t[e]);return void h.current[e]?.focus()}f(!0);try{await n(c)}finally{f(!1)}},className:"space-y-4",noValidate:!0,children:[m.map((e,t)=>{const n=e.fieldType||`question_${t}`,r=e.collectionPrompt||e.askToType||e.question||e.label;if(!r?.trim())return null;let i="text";"email"===n&&(i="email"),"phone"!==n&&"mobileno"!==n||(i="tel");const s=(n||"").toLowerCase(),g="fullname"===s||"name"===s||"username"===s,f="phone"===s||"mobileno"===s,m="email"===s?l("onboardingEmailPlaceholder"):g?l("onboardingNamePlaceholder"):f?l("onboardingPhonePlaceholder"):r,b=d[n],y="w-full h-12 rounded-xl text-base px-3 outline-none border transition-colors focus:ring-0 "+(a?"text-white placeholder:text-[#A2A9B2] focus:border-[#5A6069]":"bg-white text-gray-900 placeholder:text-[#8C8C8C] focus:border-[#B0B0B0]"),v=b?"!border-status-error focus:!border-status-error":"",w=`onboarding-field-${n}`,k=`${w}-error`;return ng.jsxs("div",{className:"space-y-1",children:[ng.jsx("label",{htmlFor:w,className:"sr-only",children:r}),ng.jsx("input",{id:w,ref:e=>{h.current[n]=e},placeholder:m,type:i,value:c[n]??"",onChange:e=>((e,t)=>{u(n=>({...n,[e]:t})),d[e]&&p(t=>{const n={...t};return delete n[e],n})})(n,e.target.value),className:`${y} ${v}`,"aria-invalid":b?"true":"false","aria-describedby":b?k:void 0,style:{direction:o?"rtl":"ltr",fontFamily:"inherit",...a?{backgroundColor:"#272C35",borderWidth:"1px",borderStyle:"solid",borderColor:b?void 0:"#3F444C"}:{borderWidth:"1px",borderStyle:"solid",borderColor:b?void 0:"#E0E0E0"}}}),b&&ng.jsx("p",{id:k,role:"alert",className:"text-xs text-status-error px-1",children:d[n]})]},n)}),ng.jsx("button",{type:"submit",disabled:g,"aria-busy":g,"aria-label":g?l("submitting"):void 0,className:"w-full h-12 inline-flex items-center justify-center 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:r,fontFamily:"inherit"},children:g?ng.jsx(wp,{className:"w-5 h-5 animate-spin","aria-hidden":"true"}):l("startChat")})]})]})})},Vg=({categories:e=[],selectedCategoryId:t=null,onSelect:n,isDark:r=!1,primaryColor:o="#2563eb",fontFamily:a="Inter",isRtl:i=!1})=>{const s=I.useRef(null),[l,c]=I.useState(!1),[u,d]=I.useState(!1),p=I.useCallback(()=>{const e=s.current;if(!e)return;const{scrollLeft:t,scrollWidth:n,clientWidth:r}=e;c(Math.abs(t)>1),d(Math.abs(t)+r<n-1)},[]);I.useEffect(()=>{p();const e=s.current;if(!e)return;const t=new ResizeObserver(p);return t.observe(e),()=>t.disconnect()},[p,e]);const g=I.useCallback(e=>{const t=s.current;if(!t)return;const n="left"===e?-150:150;t.scrollBy({left:i?-n:n,behavior:"smooth"})},[i]);if(!Array.isArray(e)||0===e.length)return null;const f=r?"rgba(31,41,55,0.85)":"rgba(255,255,255,0.95)",h=r?"#e5e7eb":"#374151",m=r?"#4b5563":"#d1d5db",b=r?"#111827":"#ffffff",y=r?"#374151":"#e5e7eb";return ng.jsxs("div",{className:"flex-shrink-0 px-2 py-2 border-b flex items-center gap-1",style:{backgroundColor:b,borderColor:y,fontFamily:a,direction:i?"rtl":"ltr"},role:"region","aria-label":"Filter by category",children:[ng.jsx("button",{type:"button",onClick:()=>g("left"),disabled:!l,"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:f,border:`1px solid ${m}`,color:h,opacity:l?1:.3,cursor:l?"pointer":"default"},children:ng.jsx(fp,{size:14})}),ng.jsx("div",{ref:s,onScroll:p,className:"flex-1 flex gap-2 overflow-x-auto",style:{scrollBehavior:"smooth",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map(e=>{const i=t===e.id;return ng.jsx("button",{type:"button",onClick:()=>n?.(i?null:e.id),"aria-pressed":i,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:r?"#1f2937":"#ffffff",border:i?`1.5px solid ${o}`:"1px solid "+(r?"#374151":"#e5e7eb"),color:i?o:r?"#e5e7eb":"#374151",fontFamily:a},children:ng.jsx("span",{children:e.label})},e.id)})}),ng.jsx("button",{type:"button",onClick:()=>g("right"),disabled:!u,"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:f,border:`1px solid ${m}`,color:h,opacity:u?1:.3,cursor:u?"pointer":"default"},children:ng.jsx(hp,{size:14})})]})},Hg=({categories:e=[],selectedCategoryId:t=null,onSelect:n,isDark:r=!1,primaryColor:o="#2563eb",fontFamily:a="Inter",fontSize:i="14px",isRtl:s=!1,label:l="Choose a topic to get started:"})=>{if(!Array.isArray(e)||0===e.length)return null;const c=r?"#9ca3af":"#6b7280";return ng.jsxs("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:[ng.jsx("div",{className:"mb-2",style:{color:c,fontFamily:a,fontSize:`calc(${i} - 1px)`},children:l}),ng.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(e=>{const s=t===e.id;return ng.jsx("button",{type:"button",onClick:()=>n?.(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 ${o}`:"1px solid "+(r?"#374151":"#e5e7eb"),color:s?o:r?"#e5e7eb":"#374151",fontFamily:a,fontSize:`calc(${i} - 1px)`,fontWeight:500},children:e.label},e.id)})})]})};const Wg=[{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"}],qg=[{value:"positive",label:"👍"},{value:"negative",label:"👎"}],Qg=[{value:"1",label:"1"},{value:"2",label:"2"},{value:"3",label:"3"},{value:"4",label:"4"},{value:"5",label:"5"}],Kg=[{value:"1",label:"⭐"},{value:"2",label:"⭐"},{value:"3",label:"⭐"},{value:"4",label:"⭐"},{value:"5",label:"⭐"}],Yg=({format:e="EMOJI",prompt:t="How was your experience?",onRating:n,disabled:r=!1,isDark:o=!1,primaryColor:a="#2563eb",defaultLanguage:i="en"})=>{const s=I.useMemo(()=>jd(i),[i]),[l,c]=I.useState(null),[u,d]=I.useState(null),[p,g]=I.useState(!1),f=async t=>{if(!r&&!p){c(t),g(!0);try{n&&n(t,e)}finally{g(!1)}}},h=(()=>{switch(e){case"THUMBS":return qg;case"NUMERIC":return Qg;case"STARS":return Kg;default:return Wg}})();return ng.jsxs("div",{className:_d("transition-all duration-200 rounded-xl px-4",o?"bg-slate-800/50":"bg-slate-50/50"),children:[ng.jsx("p",{className:_d("text-sm font-semibold text-center mb-3",o?"text-gray-300":"text-gray-500/80"),children:t}),ng.jsxs("div",{className:"flex justify-center items-center",children:["EMOJI"===e&&ng.jsx("div",{className:"flex gap-2 justify-center items-center",children:h.map(e=>ng.jsx("button",{onClick:()=>f(e.value),disabled:r||p,className:_d("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",l===e.value?"":"opacity-80"),children:ng.jsx("span",{role:"img","aria-label":`${s("rate")} ${e.value}`,children:e.label})},e.value))}),"THUMBS"===e&&ng.jsx("div",{className:"flex gap-6 justify-center items-center",role:"group","aria-label":s("rateExperience"),children:h.map(e=>ng.jsx("button",{"aria-label":1===e.value?s("thumbsUp"):s("thumbsDown"),onClick:()=>f(e.value),disabled:r||p,className:_d("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",o?"bg-gray-700 border-gray-600 hover:bg-gray-600":"bg-white border-gray-100 hover:bg-gray-50",l===e.value&&"ring-2 ring-primary/40 scale-110"),style:{borderColor:l===e.value?a:void 0},children:ng.jsx("span",{className:"drop-shadow-md","aria-hidden":"true",children:e.label})},e.value))}),"NUMERIC"===e&&ng.jsx("div",{className:"flex gap-2 justify-center items-center",role:"group","aria-label":s("rateExperience"),children:h.map(e=>ng.jsx("button",{"aria-label":`${s("rate")} ${e.value}`,onClick:()=>f(e.value),disabled:r||p,className:_d("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",l===e.value?"ring-2 ring-primary/40 scale-110 shadow-md text-white":o?"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:l===e.value?a:void 0,borderColor:l===e.value?a:void 0},children:e.label},e.value))}),"STARS"===e&&ng.jsx("div",{className:"flex gap-2 justify-center items-center",onMouseLeave:()=>d(null),children:h.map(e=>{const t=u===e.value;return ng.jsx("button",{onClick:()=>f(e.value),onMouseEnter:()=>d(e.value),disabled:r||p,className:_d("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":`${s("rate")} ${e.value}`,children:ng.jsx("span",{"aria-hidden":"true",children:e.label})},e.value)})})]}),p&&ng.jsx("p",{"aria-live":"polite",className:_d("text-xs mt-3 text-center",o?"text-slate-400":"text-slate-500"),children:s("submittingFeedback")})]})};async function Gg({apiBaseUrl:e,conversationId:t,chip:n,submitText:r,position:o,source:a="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:n,conversationId:r,source:o="widget"}={}){const a=e&&"object"==typeof e,i=a&&"string"==typeof e.text?e.text:"",s="string"==typeof t&&t?t:a&&"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(n)?n:void 0,source:o},u=a?e?.promptId:void 0;return"string"==typeof u&&u&&(c.promptId=u),c}({chip:n,submitText:r,position:o,conversationId:t,source:a});if(!l)return!1;const c=`${e.replace(/\/$/,"")}/api/v1/support/chip-click`,u=JSON.stringify(l);let d;if("function"==typeof i)try{d=await i()}catch{d=void 0}if(!d&&"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon&&"undefined"!=typeof Blob)try{if(navigator.sendBeacon(c,new Blob([u],{type:"application/json"})))return!0}catch{}if("function"!=typeof fetch)return!1;const p={"Content-Type":"application/json"};return d&&(p.Authorization=`Bearer ${d}`),await fetch(c,{method:"POST",headers:p,credentials:"include",keepalive:!0,body:u}),!0}catch{return!1}}const Jg="#ffffff",Xg="#f5f5f5",Zg="#000000",ef="#1f2937",tf="#f3f4f6",nf="#2563eb",rf="eshal:widget:size",of=(e,t)=>!e||(e=>e?.trim().toLowerCase())(e)===t,af=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()),sf=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"},lf=({isOpen:e,isMinimized:t,isDark:n,onStopGeneration:r,primaryColor:o,textColor:a,conciergeName:i,companyName:s,companyLogo:l,chatbotAvatarEnabled:c,chatbotAvatar:u,messages:d,isLoading:p,isConversationLoading:g=!1,inputValue:f,setInputValue:h,onSend:m,onDirectSend:b,onToggleTheme:y,onMinimize:v,onClose:w,quickQuestions:k=[],quickQuestionsEnabled:x,onQuickQuestion:S,quickQuestionsLayout:C="vertical",agentMessageBubbleColor:M,userMessageBoxColor:P,assistantTextColor:z,userTextColor:E,fontFamily:j="Inter",agentMessageBubbleFontFamily:T,agentMessageBubbleFontSize:N,userMessageBubbleFontFamily:F,userMessageBubbleFontSize:L,fontSize:R="14px",defaultLanguage:A="en",onDecision:_,headerTextBold:B=!1,headerTextItalic:D=!1,headerTextColor:O,headerFontFamily:$,headerFontSize:U,subtitle:V=null,showStatus:H=!1,statusMode:W="always",officeHours:q=null,enableVoiceInteraction:Q=!1,isVoiceSessionActive:K=!1,voiceStatus:Y="idle",voiceError:G=null,voiceConclusionForCsat:J=!1,onVoiceToggle:X,onBidiSubmit:Z,disclaimerEnabled:ee=!1,disclaimerText:te,disclaimerPosition:ne="top",disclaimerLinkUrl:re,disclaimerLinkLabel:oe,showPoweredBy:ae=!0,apiBaseUrl:ie,apiKey:se,getAuthToken:le,conversationId:ce,conciergeId:ue,onboardingQuestions:de=[],onboardingActive:pe=!1,onboardingCompleted:ge=!1,onOnboardingFormSubmit:fe,collectionPrompt:he,csatEnabled:me=!1,csatFormat:be="EMOJI",csatPrompt:ye="How was your experience?",onPromptSuggestionClick:ve,onboardingEnabled:we=!1,onResetConversation:ke,sessionExpiringSoon:xe=!1,autoPromptEnabled:Se=!0,autoPromptQuestionDisplay:Ce=!0,autoPromptClickTelemetry:Me=!0,allowFeedback:Pe=!0,provideCitations:ze=!0,onFeedback:Ee,onRetryMessage:je,onRefreshChat:Te,onCopyChat:Ne,filterCategories:Fe=[],showFilterStep:Le=!1,widgetFilter:Re=null,onWidgetFilterChange:Ae,onSynthesizeAssistantMessage:_e,launcherPosition:Ie="bottom-right",chatFeatures:Be,organizationId:De})=>{Ip(j);const Oe=I.useRef(null),$e=I.useRef(null),Ue=I.useMemo(()=>jd(A),[A]);I.useEffect(()=>{$e.current?.focus()},[]);const Ve=I.useCallback((e,t,n)=>{Gg({apiBaseUrl:ie,conversationId:ce,chip:t,submitText:null==e?void 0:String(e),position:n,source:"widget",getAuthToken:le,enabled:Me})},[ie,le,ce,Me]),He=I.useCallback((e,t,n)=>{t&&"object"==typeof t&&Ve(e,t,n),ve?ve(e):b?.(e)},[ve,b,Ve]),We=Ie.includes("right"),qe=Ie.includes("bottom"),[Qe,Ke]=I.useState(()=>{if("undefined"==typeof window)return null;try{const e=window.localStorage.getItem(rf);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}),Ye=I.useRef(null),Ge=I.useRef({x:0,y:0}),Je=I.useRef({width:380,height:650});I.useEffect(()=>{const e=e=>{const t=Ye.current;if(!t)return;const n=e.clientX-Ge.current.x,r=e.clientY-Ge.current.y,o={...Je.current},a=.92*window.innerWidth,i=.85*window.innerHeight;if("corner"===t||"horizontal"===t){const e=We?Je.current.width-n:Je.current.width+n;o.width=Math.min(Math.max(320,e),a)}if("corner"===t||"vertical"===t){const e=qe?Je.current.height-r:Je.current.height+r;o.height=Math.min(Math.max(400,e),i)}Ke(o)},t=()=>{Ye.current&&(Ye.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)}},[We,qe]),I.useEffect(()=>{if(Qe)try{window.localStorage.setItem(rf,JSON.stringify(Qe))}catch{}},[Qe]);const Xe=(e,t)=>{t.preventDefault(),t.stopPropagation(),Ye.current=e,Ge.current={x:t.clientX,y:t.clientY},Je.current=Qe??{width:380,height:650};const n={corner:We===qe?"nwse-resize":"nesw-resize",horizontal:"ew-resize",vertical:"ns-resize"};document.body.style.cursor=n[e],document.body.style.userSelect="none"},[Ze,et]=I.useState(!1),[tt,nt]=I.useState(()=>{try{return Wd(De)?.csatSubmitted??!1}catch{return!1}}),[rt,ot]=I.useState(!1),[at,it]=I.useState(!1),[st,lt]=I.useState(0),[ct,ut]=I.useState(""),[dt,pt]=I.useState(!1);I.useEffect(()=>{try{const e=Wd(De)?.csatSubmitted??!1;nt(e),e&&et(!1)}catch{}},[ce]),function(e,t=[],n={}){const{enabled:r=!0,threshold:o=30,behavior:a="smooth",delay:i=0}=n,s=I.useRef(!0);I.useRef(0),I.useEffect(()=>{if(!r||!e.current)return;const t=e.current,n=()=>{const e=t.scrollHeight-t.scrollTop-t.clientHeight;s.current=e<o},l=()=>{n()};t.addEventListener("scroll",l,{passive:!0}),n();const c=setTimeout(()=>{s.current&&t&&t.scrollTo({top:t.scrollHeight,behavior:a})},i);return()=>{t.removeEventListener("scroll",l),clearTimeout(c)}},[e,r,o,a,i,...t])}(Oe,[d,p],{enabled:!0,threshold:30,behavior:"smooth",delay:0});const gt=Cd(A),ft=I.useMemo(()=>n?of(M,Jg)?ef:M||ef:M||Jg,[M,n]),ht=I.useMemo(()=>n?of(a,Zg)?tf:a||tf:a||Zg,[n,a]),mt=I.useMemo(()=>n?of(P,Xg)?o||nf:P||o||nf:P||Xg,[n,o,P]),bt=Ue(at?"conversationResolved":"typeYourMessage"),yt=d?.some?.(e=>"user"===e.role),vt=I.useMemo(()=>(d||[]).filter(e=>"user"===e.role).length,[d]),[wt,kt]=I.useState(0),xt=Re?.category?(Fe||[]).find(e=>e.id===Re.category):null,St=I.useCallback(e=>{if(!Ae)return;const t=Re?.category||null;if(e){if(Ae({category:e,tags:[]}),kt(vt),!yt&&e!==t&&_e){const t=(Fe||[]).find(t=>t.id===e),n=t?.label||e,r=Ue("categoryTopicsHeading").replace("{category}",n);_e(r,{replaceMarker:"category-intro"})}}else Ae(null)},[Ae,Re,vt,Fe,yt,_e,Ue]);I.useCallback(e=>{const t=Re?.category||xt?.id;t&&Ae&&Ae({category:t,tags:[e]}),b&&b(e)},[Re,xt,Ae,b]);const Ct=Array.isArray(Fe)&&Fe.length>0,Mt=Ct&&!yt&&!Re?.category,Pt=!yt&&k.length>0&&x&&!Re?.category,zt=de&&de.length>0,Et=Boolean(me),jt=we&&zt&&!ge,Tt=I.useCallback(async()=>{if(Et&&!dt&&!at&&0!==st){pt(!0);try{const e={"Content-Type":"application/json"};if("function"==typeof le){const t=await le();t&&(e.Authorization=`Bearer ${t}`)}const t=sf(be);(await fetch(`${ie.replace(/\/$/,"")}/api/v1/support/csat`,{method:"POST",headers:e,credentials:"include",body:JSON.stringify({conversationId:ce,rating:String(st),ratingFormat:t,conciergeId:ue,feedback:ct||void 0})})).ok&&(ot(!1),lt(0),ut(""),Ae&&Ae(null),Te?Te():ke&&ke())}catch(e){}finally{pt(!1)}}},[Et,dt,at,st,ct,ce,le,ue,ie,be,ke,Te,Ae]),Nt=I.useCallback(()=>{if(!Et||!ce||!yt)return Ae&&Ae(null),Te?Te():ke&&ke(),void w?.();rt?(ot(!1),w?.()):at?w?.():ot(!0)},[Et,ce,yt,rt,at,w,Ae,Te,ke]);I.useEffect(()=>{Et||(rt&&ot(!1),at&&it(!1),0!==st&<(0),ct&&ut(""))},[Et,rt,at,st,ct]);const Ft=I.useMemo(()=>{if(!d||!Array.isArray(d))return[];for(let e=d.length-1;e>=0;e-=1)if("assistant"===d[e]?.role){const t=d[e].prompts;return Array.isArray(t)?t:[]}return[]},[d]),Lt=I.useRef([]);I.useEffect(()=>{Ft.length>0?Lt.current=Ft:d&&0!==d.length&&d.some(e=>"user"===e.role)||(Lt.current=[])},[Ft,d]);const Rt=I.useRef(vt);I.useEffect(()=>{vt!==Rt.current&&(Rt.current=vt,Lt.current=[])},[vt]);const At=Array.isArray(d)&&d.some(e=>"user"===e?.role),_t=Ft.length>0?Ft:At?Lt.current:[];I.useEffect(()=>{if(!me)return;if(!Ze)return;if(tt)return;const e=Oe.current;if(!e)return;const t=window.requestAnimationFrame(()=>{e.scrollTo({top:e.scrollHeight,behavior:"smooth"})});return()=>{window.cancelAnimationFrame(t)}},[Ze,me,tt]);const It=()=>{const e=sf(be);if("STARS"===e)return ng.jsx("div",{className:"flex justify-center gap-2 mb-5",role:"group","aria-label":Ue("rateExperience"),children:[1,2,3,4,5].map(e=>ng.jsx("button",{"aria-label":`${Ue("rate")} ${e}`,onClick:()=>lt(e),className:"transition-all duration-150 hover:scale-110 active:scale-95 bg-transparent border-0 p-0 cursor-pointer",disabled:dt,children:ng.jsx(zp,{className:_d("w-8 h-8 transition-colors",e<=st?"text-yellow-400 drop-shadow-sm":n?"text-gray-600":"text-gray-300"),fill:e<=st?"#FBBF24":"none"})},e))});if("THUMBS"===e)return ng.jsx("div",{className:"flex gap-4 justify-center mb-5",role:"group","aria-label":Ue("rateExperience"),children:[{value:"positive",emoji:"👍"},{value:"negative",emoji:"👎"}].map(e=>ng.jsx("button",{"aria-label":"positive"===e.value?Ue("thumbsUp"):Ue("thumbsDown"),onClick:()=>lt(e.value),disabled:dt,className:_d("w-12 h-12 rounded-xl border flex items-center justify-center text-2xl transition-all hover:scale-105 active:scale-95",st===e.value?"ring-2 ring-blue-300 scale-110 shadow-lg":"",n?"bg-gray-700 border-gray-600 hover:bg-gray-600":"bg-white border-gray-200 hover:bg-gray-50"),children:ng.jsx("span",{className:"drop-shadow-md",children:e.emoji})},e.value))});return ng.jsx("div",{className:"flex gap-2 justify-center items-center mb-5",role:"group","aria-label":Ue("rateExperience"),children:[{value:1,emoji:"😡"},{value:2,emoji:"😕"},{value:3,emoji:"😐"},{value:4,emoji:"😊"},{value:5,emoji:"😍"}].map(e=>ng.jsx("button",{"aria-label":`${Ue("rate")} ${e.value}`,onClick:()=>lt(e.value),disabled:dt,className:_d("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",st===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:ng.jsx("span",{role:"img","aria-label":`${Ue("rate")} ${e.value}`,className:"drop-shadow-sm filter",children:e.emoji})},e.value))})};if(!e)return null;const Bt=!t&&Qe?{width:Qe.width,height:Qe.height,maxWidth:"92vw",maxHeight:"85vh"}:void 0;return ng.jsxs("div",{dir:gt?"rtl":"ltr",className:"relative flex-shrink-0 z-50 "+(t?"w-80 h-auto":""),style:Bt,children:[!t&&ng.jsxs(ng.Fragment,{children:[ng.jsx("div",{onMouseDown:e=>Xe("horizontal",e),className:"absolute top-0 h-full w-1.5 cursor-ew-resize hover:bg-blue-500/20 transition-colors z-[70] "+(We?"left-0":"right-0"),"aria-hidden":!0}),ng.jsx("div",{onMouseDown:e=>Xe("vertical",e),className:"absolute left-0 w-full h-1.5 cursor-ns-resize hover:bg-blue-500/20 transition-colors z-[70] "+(qe?"top-0":"bottom-0"),"aria-hidden":!0})]}),ng.jsxs("div",{id:"chat-window-panel",ref:$e,role:"dialog","aria-modal":"true","aria-label":Ue("openChat"),tabIndex:-1,className:`relative focus:outline-none ${Qe||t?"":"w-[380px]"} ${Qe||t?"":"h-[650px]"} ${t?"w-80 h-auto":""} ${Qe&&!t?"w-full h-full":""} max-w-[92vw] border rounded-2xl shadow-2xl bg-white border-gray-200 flex flex-col ${t?"":"max-h-[85vh]"} overflow-hidden ${n?"bg-gray-900 border-gray-700":""}`,children:[!t&&ng.jsx("div",{onMouseDown:e=>Xe("corner",e),"aria-hidden":"true",className:`absolute w-4 h-4 ${We===qe?"cursor-nwse-resize":"cursor-nesw-resize"} text-gray-400 hover:text-blue-500 transition-colors z-[71] flex p-0.5 ${qe?"top-0 items-start":"bottom-0 items-end"} ${We?"left-0 justify-start":"right-0 justify-end"}`,children:ng.jsx("svg",{viewBox:"0 0 12 12",className:"w-3 h-3 "+(qe&&We?"rotate-180":qe?"-rotate-90":We?"rotate-90":""),"aria-hidden":!0,children:ng.jsx("path",{d:"M11 1 L1 11 M11 5 L5 11 M11 9 L9 11",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"})})}),ng.jsx($g,{conciergeName:i,companyName:s,companyLogo:l,primaryColor:o,isDark:n,isMinimized:t,textColor:ht,fontFamily:j,fontSize:R,onToggleTheme:y,onMinimize:v,onClose:Nt,headerTextBold:B,headerTextItalic:D,headerTextColor:O,headerFontFamily:$,headerFontSize:U,subtitle:V,showStatus:H,statusMode:W,officeHours:q,onRefreshChat:Te,onCopyChat:Ne,defaultLanguage:A}),!t&&Ct&&!Mt&&!(rt&&!at)&&!(pe&&!ge)&&ng.jsx(Vg,{categories:Fe,selectedCategoryId:Re?.category||null,onSelect:St,isDark:n,primaryColor:o,fontFamily:j,isRtl:gt}),!t&&ng.jsxs(ng.Fragment,{children:[ng.jsx("div",{ref:Oe,role:"log","aria-live":"polite",className:`chat-messages flex-1 overflow-y-auto px-3 py-4 space-y-4 ${n?"bg-gray-900":"bg-gradient-to-b from-gray-50/50 to-white"} break-words`,children:rt&&!at?ng.jsx("div",{className:"animate-in slide-in-from-top-4 fade-in duration-300 mt-4 mx-2",children:ng.jsxs("div",{className:_d("w-full rounded-3xl p-6 shadow-lg",n?"bg-gray-800 shadow-black/20":"bg-white shadow-gray-200/80"),children:[ng.jsx("p",{className:_d("text-sm font-medium text-center mb-5 [font-family:inherit]",n?"text-gray-300":"text-gray-500"),children:ye||Ue("feedbackPrompt")}),It(),ng.jsx("textarea",{"aria-label":Ue("feedbackPlaceholder"),value:ct,onChange:e=>{e.target.value.length<=1e3&&ut(e.target.value)},maxLength:1e3,placeholder:Ue("feedbackPlaceholder"),rows:4,disabled:dt,className:_d("w-full rounded-xl border px-4 py-3 text-sm [font-family:inherit] resize-none outline-none transition-colors mb-5",n?"bg-gray-700 border-gray-600 text-gray-100 placeholder-gray-400":"bg-gray-50 border-gray-200 text-gray-900 placeholder-gray-400")}),ng.jsxs("div",{className:"relative group",children:[ng.jsx("button",{onClick:Tt,disabled:0===st||dt,"aria-describedby":0===st?"resolve-rating-hint":void 0,className:_d("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",n?"bg-gray-700 text-gray-100 hover:bg-gray-600":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:Ue(dt?"submitting":"submitFeedback")}),0===st&&!dt&&ng.jsx("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:Ue("selectRatingFirst")})]})]})}):pe&&!ge&&fe?ng.jsx(Ug,{questions:de,onPromptSuggestionClick:He,collapsiblePrompt:he,onSubmit:fe,primaryColor:o,isRtl:gt,isDark:n,defaultLanguage:A,fontFamily:j}):ng.jsxs(ng.Fragment,{children:[xe&&ng.jsx("div",{role:"status",className:"mx-3 mt-1 mb-2 rounded-lg px-3 py-2 text-xs font-medium "+(n?"bg-amber-900/40 text-amber-200 border border-amber-700/50":"bg-amber-50 text-amber-800 border border-amber-200"),children:Ue("sessionExpiringSoon")}),ng.jsx(jg,{messages:d,isDark:n,primaryColor:o,isLoading:p,agentMessageBubbleColor:M,userMessageBoxColor:P,textColor:a,assistantTextColor:z,userTextColor:E,fontFamily:j,agentMessageBubbleFontFamily:T,agentMessageBubbleFontSize:N,userMessageBubbleFontFamily:F,userMessageBubbleFontSize:L,fontSize:R,formatTime:af,isRtl:gt,defaultLanguage:A,quickQuestions:k,shouldShowQuickQuestions:Pt,onQuickQuestion:S??b,quickQuestionsLayout:C,onDecision:_,disclaimerEnabled:ee,disclaimerText:te,disclaimerPosition:ne,disclaimerLinkUrl:re,disclaimerLinkLabel:oe,resolvedAgentBubbleColor:ft,resolvedUserMessageColor:mt,resolvedTextColor:ht,isVoiceSessionActive:K,voiceStatus:Y,messagesContainerRef:Oe,companyLogo:l,chatbotAvatarEnabled:c,chatbotAvatar:u,conciergeName:i,companyName:s,apiBaseUrl:ie,getAuthToken:le,onPromptSuggestionClick:He,conversationResetKey:ce,allowFeedback:Pe,provideCitations:ze,onFeedback:Ee,onRetryMessage:je,headerTextColor:O,beforePromptsSlot:Mt?ng.jsx(Hg,{categories:Fe,selectedCategoryId:Re?.category||null,onSelect:St,isDark:n,primaryColor:o,fontFamily:j,fontSize:R,isRtl:gt,label:Ue("chooseTopicLabel")}):null,quickQuestionsHeadingLabel:Ct?Ue("quickQuestionsHeadingLabel"):void 0}),Ze&&me&&!tt&&ng.jsx("div",{className:"",children:ng.jsx(Yg,{format:sf(be),prompt:ye||Ue("howWasYourExperience"),onRating:async(e,t)=>{nt(!0),et(!1),(e=>{try{const t=Wd(e);if(!t)return;t.csatSubmitted=!0,localStorage.setItem(`${Dd}_${e}`,JSON.stringify(t))}catch{}})(void 0);try{const n={"Content-Type":"application/json"};if("function"==typeof le){const e=await le();e&&(n.Authorization=`Bearer ${e}`)}(await fetch(`${ie.replace(/\/$/,"")}/api/v1/support/csat`,{method:"POST",headers:n,credentials:"include",body:JSON.stringify({conversationId:ce,rating:e,ratingFormat:t,conciergeId:ue})})).ok}catch(e){}},disabled:!1,isDark:n,primaryColor:o,defaultLanguage:A})})]})}),!(pe&&!ge)&&ng.jsx(Ig,{onStopGeneration:r,inputValue:f,setInputValue:h,onSend:m,isDark:n,primaryColor:o,isOpen:e,isMinimized:t,isLoading:p,isConversationLoading:g,placeholder:bt,textColor:ht,fontFamily:j,userMessageBubbleFontFamily:F,userMessageBubbleFontSize:L,fontSize:R,isRtl:gt,csatVisible:Ze&&me&&!tt||Et&&(rt||at),enableVoiceInteraction:Q,isVoiceSessionActive:K,voiceStatus:Y,voiceError:G,onVoiceToggle:X,onBidiSubmit:Z,disclaimerEnabled:ee,disclaimerText:te,disclaimerPosition:ne,disclaimerLinkUrl:re,disclaimerLinkLabel:oe,showPoweredBy:ae,defaultLanguage:A,onboardingQuestions:de,onboardingActive:pe,onboardingCompleted:ge,onboardingEnabled:we,userMessageBoxColor:P,resolvedUserMessageColor:mt,userTextColor:E,promptSuggestions:rt||at||!1===Se||p?[]:_t,onPromptSuggestionClick:He,autoPromptQuestionDisplay:Ce,tagSelectorNode:null,showResolveButton:Et&&yt&&!at&&!rt&&!Ze&&!jt,onResolve:()=>{Et&&ot(!0)},chatFeatures:Be,apiEndpoint:ie,organizationId:De,conversationId:ce})]})]})]})},cf=new Map;const uf={whatsapp:["wa.me","api.whatsapp.com"],telegram:["t.me"],messenger:["m.me"],instagram:["ig.me","instagram.com","www.instagram.com"]},df={whatsapp:"WhatsApp",telegram:"Telegram",messenger:"Messenger",instagram:"Instagram"};const pf=I.forwardRef(({isDark:e,primaryColor:t,onToggle:n,textColor:r,headerTextColor:o,defaultLanguage:a="en",isOpen:i=!1,className:s,channelLinks:l},c)=>{const u=I.useMemo(()=>jd(a),[a]),d=I.useMemo(()=>function(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||"object"!=typeof n)continue;const e="string"==typeof n.type?n.type.toLowerCase():"",r=uf[e];if(!r||"string"!=typeof n.url)continue;let o;try{o=new URL(n.url)}catch{continue}"https:"===o.protocol&&r.includes(o.hostname.toLowerCase())&&t.push({type:e,url:o.toString(),label:"string"==typeof n.label&&n.label.trim()?n.label.trim():df[e]})}return t}(l),[l]),[p,g]=I.useState(!1),f=d.length>0,h=t,m=o||"#FFFFFF",b={display:"block",width:"100%",padding:"8px 12px",textAlign:"start",fontSize:"14px",color:e?"#F1F5F9":"#0F172A",background:"transparent",border:"none",borderRadius:"6px",textDecoration:"none",cursor:"pointer"};return ng.jsxs("div",{className:`relative ${s||""}`,children:[f&&p&&!i&&ng.jsxs("div",{role:"menu","aria-label":u("chooseChannel"),"data-testid":"channel-picker",style:{position:"absolute",bottom:"76px",right:0,minWidth:"180px",padding:"6px",borderRadius:"8px",border:"1px solid "+(e?"#334155":"#E2E8F0"),background:e?"#1E293B":"#FFFFFF",boxShadow:"0 10px 30px rgba(15, 23, 42, 0.15)"},children:[ng.jsx("button",{type:"button",role:"menuitem",style:b,onClick:()=>{g(!1),n?.()},children:u("chatHere")}),d.map(e=>ng.jsx("a",{role:"menuitem",href:e.url,target:"_blank",rel:"noopener noreferrer",style:b,onClick:()=>g(!1),children:e.label},`${e.type}-${e.url}`))]}),ng.jsxs("button",{ref:c,onClick:()=>{!f||i?n?.():g(e=>!e)},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",style:{background:`linear-gradient(135deg, ${h} 0%, ${h}dd 100%)`,boxShadow:`0 10px 30px ${h}40`,border:"none"},"aria-label":u(i?"closeChat":"openChat"),"aria-expanded":f&&p||i,"aria-haspopup":f?"menu":void 0,"aria-controls":"chat-window-panel",children:[ng.jsx("div",{className:"absolute inset-0 rounded-full bg-white/20 scale-0 group-hover:scale-100 transition-transform duration-500"}),ng.jsx("div",{className:"relative z-10 transition-transform duration-300",children:ng.jsx(kp,{className:"w-7 h-7",style:{color:m}})})]})]})});pf.displayName="ToggleButton";const gf="0.2.15",ff=({getAuthToken:e,apiBaseUrl:t,darkMode:n,primaryColor:r,position:o,companyName:a,conciergeName:i,companyLogo:s,welcomeMessage:l,quickQuestions:c,quickQuestionsEnabled:u,quickQuestionsLayout:d="vertical",textColor:p,agentMessageBubbleColor:g,userMessageBoxColor:f,assistantTextColor:h,userTextColor:m,fontFamily:b,fontSize:y,defaultLanguage:v,apiKey:w,agentMessageBubbleFontFamily:k,agentMessageBubbleFontSize:x,userMessageBubbleFontFamily:S,userMessageBubbleFontSize:C,autoOpen:M=!1,openDelay:P=0,locale:z,className:E="",headerTextBold:j,headerTextItalic:T,enableVoiceInteraction:N,disclaimerEnabled:F,disclaimerText:L,disclaimerPosition:R,disclaimerLinkUrl:A,disclaimerLinkLabel:_,showPoweredBy:B,onboardingQuestions:D,collectionPrompt:O,allowedDomains:$,onboardingEnabled:U,wsBaseUrl:V,channelLinks:H})=>{const[W,q]=I.useState(null),[Q,K]=I.useState(!0),[Y,G]=I.useState(null),[J,X]=I.useState(!1),Z=I.useRef(!1);I.useEffect(()=>{if(Z.current)return;(async()=>{if(!t)return G("apiBaseUrl is required"),void K(!1);try{K(!0);const n=await(async(e,t)=>{if(!e)throw new Error("apiBaseUrl is required");try{const n=e.replace(/\/$/,""),r=gf?`${n}/api/v1/deploy-agent?wv=${encodeURIComponent(gf)}`:`${n}/api/v1/deploy-agent`,o={"Content-Type":"application/json"};if("function"==typeof t){const e=await t();e&&(o.Authorization=`Bearer ${e}`)}const a=await fetch(r,{method:"GET",headers:o,credentials:"include"});if(404===a.status)return null;if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return await a.json()}catch(e){throw e}})(t,e);if(null===n)return Z.current=!0,X(!0),q(null),void G(null);q(n),G(null)}catch(e){G(e.message||"Failed to load configuration")}finally{K(!1)}})()},[t,e]);const ee=I.useMemo(()=>{if(!W)return null;const e=W.config??{},t=e.identity??{},d=e.branding??{},w=e.typography??{},M=e.messages??{},P=e.voice??{},z=e.onboarding??{},E=e.disclaimer??{},I=e.csat??{},V=e.inactivity??{},q=e.behavior??{},Q=e.security??{},K=e.layout??{},Y=v??M.defaultLocale??"en",G=M.bundles?.[Y]??{},J=M.bundles?.en??{},X={welcome:G.welcome||J.welcome,fallback:G.fallback||J.fallback,quickQuestions:Array.isArray(G.quickQuestions)&&G.quickQuestions.length>0?G.quickQuestions:J.quickQuestions},Z=$??Q.allowedDomains??(Q.domains??[]).map(e=>"string"==typeof e?e:e.domain).filter(Boolean)??[];return{darkMode:n??!1,primaryColor:r??d.brandColor??"#2563eb",companyName:a??t.companyName??"Support Team",conciergeName:i??t.conciergeName,companyLogo:s??d.avatar??null,chatbotAvatarEnabled:d.chatbotAvatarEnabled??!1,chatbotAvatar:d.chatbotAvatar??null,welcomeMessage:l??X.welcome??"Hi! How can we help?",fallbackMessage:X.fallback,quickQuestions:c??X.quickQuestions??[],quickQuestionsEnabled:u??M.quickQuestionsEnabled,textColor:p??"#000000",agentMessageBubbleColor:g??w.agentMessageBubbleColor,userMessageBoxColor:f??w.userMessageBoxColor,assistantTextColor:h??w.assistantTextColor??"#000000",userTextColor:m??w.userTextColor??"#000000",fontFamily:b??w.agentMessageBubbleFontFamily??"Inter",fontSize:y??w.agentMessageBubbleFontSize??"14px",defaultLanguage:Y,headerTextBold:j??w.headerTextBold??!1,headerTextItalic:T??w.headerTextItalic??!1,headerTextColor:w.headerTextColor??"#FFFFFF",headerFontFamily:w.headerFontFamily,headerFontSize:w.headerFontSize,subtitle:t.subtitle??null,showStatus:t.showStatus??!1,statusMode:t.statusMode??"always",officeHours:t.officeHours??null,enableVoiceInteraction:N??P.enableVoiceInteraction??!1,disclaimerEnabled:F??E.enabled??!1,disclaimerText:L??E.text,disclaimerPosition:R??(ee=E.position,ee?ee.toLowerCase():"top"),disclaimerLinkUrl:Ad(A??E.linkUrl),disclaimerLinkLabel:_??E.linkLabel,showPoweredBy:B??d.showPoweredBy??!0,onboardingQuestions:D??z.questions??[],collectionPrompt:O??z.collapsiblePrompt??"Before we begin, I need to verify your details.",allowedDomains:Z,launcherPosition:o??(e=>e?e.toLowerCase().replace(/_/g,"-"):"bottom-right")(K.launcherPosition),onboardingEnabled:U??z.enabled??!1,inactivityTimeoutValue:V.timeoutValue??null,inactivityTimeoutUnit:V.timeoutUnit??null,agentMessageBubbleFontFamily:k??w.agentMessageBubbleFontFamily??b??"Inter",agentMessageBubbleFontSize:x??w.agentMessageBubbleFontSize??y??"14px",userMessageBubbleFontFamily:S??w.userMessageBubbleFontFamily??b??"Inter",userMessageBubbleFontSize:C??w.userMessageBubbleFontSize??y??"14px",csatEnabled:I.enabled??!1,csatFormat:I.format??"EMOJI",csatPrompt:I.prompt??"How was your experience?",autoPromptEnabled:q.autoPromptEnabled??!0,autoPromptQuestionDisplay:q.autoPromptQuestionDisplay??!0,autoPromptClickTelemetry:q.autoPromptClickTelemetry??!0,allowFeedback:q.allowFeedback??!0,provideCitations:q.provideCitations??!0,organizationId:W.organizationId??null,chatFeatures:e.chatFeatures??null,channelLinks:H??e.channelLinks??null};var ee},[H,W,n,r,o,a,i,s,l,c,u,p,g,f,h,m,b,y,v,j,T,N,F,L,R,_,A,B,D,U,O,$,k,x,S,C]),te=I.useMemo(()=>!ee||((e=[])=>{if("undefined"==typeof window)return!1;const t=window.location.hostname.toLowerCase(),n=window.location.host.toLowerCase();return!(!e||0===e.length)&&e.some(e=>{const r=e.toLowerCase().trim();return r.includes(":")?n===r:t===r||t.endsWith("."+r)})})(ee.allowedDomains),[ee]),ne=I.useMemo(()=>({welcomeMessage:"Hi! How can we help?",quickQuestions:[],apiBaseUrl:t||"",apiKey:w||"",getAuthToken:e,autoOpen:!1,openDelay:0,darkMode:!1,enableVoiceInteraction:!1,onboardingQuestions:[],onboardingEnabled:!1,collectionPrompt:void 0}),[t,w,e]),{isOpen:re,isMinimized:oe,isDark:ae,messages:ie,inputValue:se,isLoading:le,widgetRef:ce,setInputValue:ue,handleSend:de,stopGeneration:pe,handleQuickQuestion:ge,sendMessage:fe,retryMessage:he,toggleChat:me,toggleTheme:be,toggleMinimize:ye,closeChat:ve,handleDecision:we,isVoiceSessionActive:ke,voiceStatus:xe,voiceError:Se,voiceConclusionForCsat:Ce,handleVoiceToggle:Me,sendBidiTextMessage:Pe,onboardingActive:ze,onboardingCompleted:Ee,handleOnboardingFormSubmit:je,conversationId:Te,resetConversation:Ne,sessionExpiringSoon:Fe,updateMessageFeedback:Le,widgetFilter:Re,setWidgetFilter:Ae,addAssistantMessage:_e}=ap(ee?{welcomeMessage:ee.welcomeMessage,fallbackMessage:ee.fallbackMessage,quickQuestions:ee.quickQuestions,apiBaseUrl:t,wsBaseUrl:V??W?.wsBaseUrl,apiKey:w,locale:ee.defaultLanguage||z,organizationId:ee.organizationId,getAuthToken:e,autoOpen:M,openDelay:P,darkMode:ee.darkMode,enableVoiceInteraction:ee.enableVoiceInteraction,onboardingQuestions:ee.onboardingQuestions,onboardingEnabled:ee.onboardingEnabled,collectionPrompt:ee.collectionPrompt,provideCitations:ee.provideCitations,inactivityTimeoutValue:ee.inactivityTimeoutValue,inactivityTimeoutUnit:ee.inactivityTimeoutUnit,messageLimits:W?.messageLimits}:ne),Ie=I.useRef(null),Be=I.useRef(re);I.useEffect(()=>{Be.current&&!re&&Ie.current?.focus(),Be.current=re},[re]);const De=I.useCallback((n,r,o)=>{if(Le(n,r),!Te||!t)return;const a=t.replace(/\/$/,"");(async()=>{try{const t={"Content-Type":"application/json"};if("function"==typeof e){const n=await e();n&&(t.Authorization=`Bearer ${n}`)}await fetch(`${a}/api/v1/support/feedback`,{method:"POST",headers:t,credentials:"include",body:JSON.stringify({messageContent:n,conversationId:Te,feedback:r,feedbackText:o})})}catch(e){}})()},[Te,t,e,Le]),Oe=I.useCallback(()=>{Ne&&Ne()},[Ne]),{categories:$e,hasFilters:Ue}=function(e,t){const n=!!e,[r,o]=I.useState({categories:[],loading:n,error:null});I.useEffect(()=>{if(!e)return void o({categories:[],loading:!1,error:null});const n=t?`${e}|__session__`:`${e}|__proxy__`,r=cf.get(n);if(r)return void o({categories:r,loading:!1,error:null});let a=!1;o(e=>({...e,loading:!0,error:null}));const i=`${e.replace(/\/$/,"")}/api/v1/widget/filters`;return(async()=>{try{const e={Accept:"application/json"};if("function"==typeof t){const n=await t();n&&(e.Authorization=`Bearer ${n}`)}const r=await fetch(i,{method:"GET",headers:e});if(!r.ok)throw new Error(`filter catalog HTTP ${r.status}`);const s=await r.json(),l=Array.isArray(s?.categories)?s.categories:[];if(a)return;cf.set(n,l),o({categories:l,loading:!1,error:null})}catch(e){if(a)return;o({categories:[],loading:!1,error:e})}})(),()=>{a=!0}},[e,t]);const a=I.useMemo(()=>Array.isArray(r.categories)&&r.categories.length>0,[r.categories]);return{...r,hasFilters:a}}(t,e),Ve=I.useCallback(()=>{const e=ie.filter(e=>e.content&&""!==e.content.trim()).map(e=>`${"user"===e.role?"You":ee?.conciergeName||"Assistant"}: ${e.content}`).join("\n\n");e&&navigator.clipboard.writeText(e).catch(()=>{})},[ie,ee?.conciergeName]);if(I.useEffect(()=>{ce.current&&ee&&(ce.current.style.setProperty("--cw-primary",ee.primaryColor),ee.fontFamily&&ce.current.style.setProperty("--cw-font-family",ee.fontFamily),ee.textColor&&ce.current.style.setProperty("--cw-text-color",ee.textColor))},[ee,ce]),Q)return null;if(J)return null;if(Y||!ee)return null;if(!te)return null;const He={"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 ng.jsx("div",{id:"chat-widget-root",children:ng.jsxs("div",{ref:ce,className:`chat-widget-root fixed flex flex-col ${ee.launcherPosition?.includes("left")?"items-start":"items-end"} z-[999999] ${ae?"dark":""} ${E} ${He[ee.launcherPosition]||He["bottom-right"]}`,children:[ng.jsx(lf,{isOpen:re,isMinimized:oe,isDark:ae,launcherPosition:ee.launcherPosition,primaryColor:ee.primaryColor,textColor:ee.textColor,companyName:ee.companyName,conciergeName:ee.conciergeName,companyLogo:ee.companyLogo,chatbotAvatarEnabled:ee.chatbotAvatarEnabled,chatbotAvatar:ee.chatbotAvatar,messages:ie,isLoading:le,inputValue:se,setInputValue:ue,onSend:de,onStopGeneration:pe,onDirectSend:fe,onToggleTheme:be,onMinimize:ye,onClose:ve,quickQuestions:ee.quickQuestions,quickQuestionsEnabled:ee.quickQuestionsEnabled,onQuickQuestion:ge,quickQuestionsLayout:d,agentMessageBubbleColor:ee.agentMessageBubbleColor,userMessageBoxColor:ee.userMessageBoxColor,assistantTextColor:ee.assistantTextColor,userTextColor:ee.userTextColor,fontFamily:ee.fontFamily,agentMessageBubbleFontFamily:ee.agentMessageBubbleFontFamily,agentMessageBubbleFontSize:ee.agentMessageBubbleFontSize,userMessageBubbleFontFamily:ee.userMessageBubbleFontFamily,userMessageBubbleFontSize:ee.userMessageBubbleFontSize,fontSize:ee.fontSize,defaultLanguage:ee.defaultLanguage||z,onDecision:we,headerTextBold:ee.headerTextBold,headerTextItalic:ee.headerTextItalic,headerTextColor:ee.headerTextColor,headerFontFamily:ee.headerFontFamily,headerFontSize:ee.headerFontSize,subtitle:ee.subtitle,showStatus:ee.showStatus,statusMode:ee.statusMode,officeHours:ee.officeHours,enableVoiceInteraction:ee.enableVoiceInteraction,isVoiceSessionActive:ke,voiceStatus:xe,voiceError:Se,voiceConclusionForCsat:Ce,onVoiceToggle:Me,onBidiSubmit:()=>Pe(se),disclaimerEnabled:ee.disclaimerEnabled,disclaimerText:ee.disclaimerText,disclaimerPosition:ee.disclaimerPosition,disclaimerLinkUrl:ee.disclaimerLinkUrl,disclaimerLinkLabel:ee.disclaimerLinkLabel,showPoweredBy:ee.showPoweredBy,apiBaseUrl:t,apiKey:w,getAuthToken:e,conversationId:Te,conciergeId:W?.conciergeId??W?.id,onboardingQuestions:ee.onboardingQuestions,onboardingActive:ze,onboardingCompleted:Ee,onOnboardingFormSubmit:je,collectionPrompt:ee.collectionPrompt,csatEnabled:ee.csatEnabled,csatFormat:ee.csatFormat,csatPrompt:ee.csatPrompt,onboardingEnabled:ee.onboardingEnabled,onResetConversation:Ne,sessionExpiringSoon:Fe,autoPromptEnabled:ee.autoPromptEnabled,autoPromptQuestionDisplay:ee.autoPromptQuestionDisplay,autoPromptClickTelemetry:ee.autoPromptClickTelemetry,allowFeedback:ee.allowFeedback,provideCitations:ee.provideCitations,onFeedback:De,onRetryMessage:he,onRefreshChat:Oe,onCopyChat:Ve,filterCategories:$e,showFilterStep:Ue,widgetFilter:Re,onWidgetFilterChange:Ae,onSynthesizeAssistantMessage:_e,chatFeatures:ee.chatFeatures,organizationId:ee.organizationId}),ng.jsx(pf,{ref:Ie,isDark:ae,primaryColor:ee.primaryColor,onToggle:me,textColor:ee.textColor,headerTextColor:ee.headerTextColor,defaultLanguage:ee.defaultLanguage||z,isOpen:re,className:re?"hidden":void 0,channelLinks:ee.channelLinks})]})})};class hf extends I.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){}render(){return this.state.hasError?ng.jsx("div",{role:"alert",style:{position:"fixed",bottom:"20px",right:"20px",maxWidth:"280px",padding:"10px 14px",borderRadius:"10px",background:"#1f2937",color:"#f3f4f6",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",lineHeight:1.4,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",zIndex:2147483647},children:"Chat is temporarily unavailable. Please refresh the page to try again."}):this.props.children}}"undefined"!=typeof window&&(window.__eshalChatWidgetReact=I),function(){let e=null,t=null,n=null,r={},o=null;const a={darkMode:!1,primaryColor:"#2563eb",position:"bottom-right",companyName:"Support Team",conciergeName:null,companyLogo:null,welcomeMessage:"Hi! How can we help?",quickQuestions:[],quickQuestionsLayout:"vertical",textColor:"#fcfcfc",agentMessageBubbleColor:void 0,userMessageBoxColor:void 0,assistantTextColor:void 0,userTextColor:void 0,fontFamily:"Inter",fontSize:"14px",defaultLanguage:"en",autoOpen:!1,openDelay:0,apiBaseUrl:null,wsBaseUrl:null,apiKey:null,organizationId:null,sessionUrl:null,userId:null,userName:null,userEmail:null,locale:"en",headerTextBold:!1,headerTextItalic:!1,enableVoiceInteraction:!1,disclaimerEnabled:!1,disclaimerText:void 0,disclaimerPosition:"top",showPoweredBy:!0,onboardingQuestions:[],onboardingEnabled:!1,collectionPrompt:void 0,allowedDomains:[],onOpen:null,onClose:null},i={init:async function(s={}){if(r={...a,...s},r.sessionUrl&&!o&&(o=await(async e=>{if(e.sessionUrl)try{const t=await fetch(e.sessionUrl,{method:"POST",headers:{"Content-Type":"application/json",...e.apiKey&&{Authorization:`Bearer ${e.apiKey}`}},body:JSON.stringify({userId:e.userId,userName:e.userName,userEmail:e.userEmail}),credentials:"include"});return(await t.json()).sessionId}catch(e){return null}return null})(r)),n||(n=document.createElement("div"),n.id="chat-widget-host",document.body.appendChild(n)),!n.shadowRoot){const e=n.attachShadow({mode:"open"}),r=document.createElement("style");r.textContent=":host { all: initial; display: block; }",e.appendChild(r);const o=document.createElement("style");o.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 .invisible{visibility:hidden}#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 .text-start{text-align:start}#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}#chat-widget-root .hover\\:scale-105:hover,#chat-widget-root .hover\\:scale-110:hover{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}#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)}#chat-widget-root .hover\\:shadow-md:hover,#chat-widget-root .hover\\:shadow-xl:hover{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)}#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)}#chat-widget-root .focus\\:ring-0:focus,#chat-widget-root .focus\\:ring-1:focus{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)}#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}#chat-widget-root .active\\:scale-95:active,#chat-widget-root .active\\:scale-\\[0\\.97\\]:active{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}#chat-widget-root .active\\:scale-\\[0\\.98\\]:active{--tw-scale-x:0.98;--tw-scale-y:0.98}#chat-widget-root .active\\:scale-\\[0\\.98\\]:active,#chat-widget-root .active\\:scale-\\[0\\.99\\]:active{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}#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}}',e.appendChild(o),t=document.createElement("div"),t.id="chat-widget-mount",e.appendChild(t)}e||(e=Vu(t)),void 0===s.darkMode&&(r.darkMode=window.matchMedia("(prefers-color-scheme: dark)").matches);const l=r.apiBaseUrl?{apiBaseUrl:r.apiBaseUrl,...void 0!==s.wsBaseUrl&&{wsBaseUrl:r.wsBaseUrl},...void 0!==s.position&&{position:r.position},...void 0!==s.quickQuestionsLayout&&{quickQuestionsLayout:r.quickQuestionsLayout},...void 0!==s.darkMode&&{darkMode:r.darkMode},...void 0!==s.primaryColor&&{primaryColor:r.primaryColor},...void 0!==s.companyName&&{companyName:r.companyName},...void 0!==s.conciergeName&&{conciergeName:r.conciergeName},...void 0!==s.companyLogo&&{companyLogo:r.companyLogo},...void 0!==s.welcomeMessage&&{welcomeMessage:r.welcomeMessage},...void 0!==s.quickQuestions&&{quickQuestions:r.quickQuestions},...void 0!==s.channelLinks&&{channelLinks:r.channelLinks},...void 0!==s.textColor&&{textColor:r.textColor},...void 0!==s.agentMessageBubbleColor&&{agentMessageBubbleColor:r.agentMessageBubbleColor},...void 0!==s.userMessageBoxColor&&{userMessageBoxColor:r.userMessageBoxColor},...void 0!==s.assistantTextColor&&{assistantTextColor:r.assistantTextColor},...void 0!==s.userTextColor&&{userTextColor:r.userTextColor},...void 0!==s.fontFamily&&{fontFamily:r.fontFamily},...void 0!==s.fontSize&&{fontSize:r.fontSize},...void 0!==s.defaultLanguage&&{defaultLanguage:r.defaultLanguage},...void 0!==s.locale&&{locale:r.locale},...void 0!==s.headerTextBold&&{headerTextBold:r.headerTextBold},...void 0!==s.headerTextItalic&&{headerTextItalic:r.headerTextItalic},...void 0!==s.enableVoiceInteraction&&{enableVoiceInteraction:r.enableVoiceInteraction},...void 0!==s.disclaimerEnabled&&{disclaimerEnabled:r.disclaimerEnabled},...void 0!==s.disclaimerText&&{disclaimerText:r.disclaimerText},...void 0!==s.disclaimerPosition&&{disclaimerPosition:r.disclaimerPosition},...void 0!==s.onboardingQuestions&&{onboardingQuestions:r.onboardingQuestions},...void 0!==s.onboardingEnabled&&{onboardingEnabled:r.onboardingEnabled},...void 0!==s.showPoweredBy&&{showPoweredBy:r.showPoweredBy},...void 0!==s.collectionPrompt&&{collectionPrompt:r.collectionPrompt},...void 0!==s.allowedDomains&&s.allowedDomains.length>0&&{allowedDomains:r.allowedDomains},...void 0!==s.autoOpen&&{autoOpen:r.autoOpen},...void 0!==s.openDelay&&{openDelay:r.openDelay},...void 0!==s.apiKey&&{apiKey:r.apiKey},...void 0!==s.className&&{className:r.className}}:{...r,apiBaseUrl:r.apiBaseUrl,wsBaseUrl:r.wsBaseUrl,organizationId:r.organizationId};try{e.render(I.createElement(hf,null,I.createElement(ff,l)))}catch(e){t&&(t.innerHTML='<div role="alert" style="position:fixed;bottom:20px;right:20px;max-width:280px;padding:10px 14px;border-radius:10px;background:#1f2937;color:#f3f4f6;font-family:-apple-system,BlinkMacSystemFont,\'Segoe UI\',Roboto,Arial,sans-serif;font-size:13px;line-height:1.4;box-shadow:0 4px 12px rgba(0,0,0,0.15);z-index:2147483647;">Chat is temporarily unavailable. Please refresh the page to try again.</div>')}return r.onOpen&&r.autoOpen&&setTimeout(()=>r.onOpen(),r.openDelay),i},updateConfig:function(e){return r={...r,...e},this.init(r),i},open:function(){return this.updateConfig({autoOpen:!0,openDelay:0}),r.onOpen&&r.onOpen(),i},close:function(){return this.updateConfig({autoOpen:!1}),r.onClose&&r.onClose(),i},toggleTheme:function(){return r.darkMode=!r.darkMode,this.updateConfig({darkMode:r.darkMode}),i},destroy:function(){return e&&(e.unmount(),e=null),n&&n.parentNode&&(n.parentNode.removeChild(n),n=null),t=null,o=null,r={},i},getConfig:function(){return{...r}}};"undefined"!=typeof window&&(window.ChatWidget=i,window.ChatWidget.version=gf,window.ChatWidgetConfig&&document.addEventListener("DOMContentLoaded",()=>{i.init(window.ChatWidgetConfig)}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{(void 0===r.darkMode||r.autoTheme)&&i.updateConfig({darkMode:e.matches})})),"undefined"!=typeof module&&module.exports&&(module.exports=i)}();var mf={exports:{}};function bf(e){try{const t=window[e];return t.setItem("__ft__","1"),t.removeItem("__ft__"),"1"}catch{return"0"}}function yf(){try{return Array.from(navigator.plugins||[]).map(e=>`${e.name}::${e.filename}`).sort().join("|")}catch{return""}}function vf(){try{return Array.from(navigator.mimeTypes||[]).map(e=>e.type).sort().join("|")}catch{return""}}function wf(){try{const e=document.createElement("canvas");e.width=240,e.height=60;const t=e.getContext("2d");return t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(125,1,62,20),t.fillStyle="#069",t.font="11pt no-real-font-abc",t.fillText("user-trace:canvas,🔍<canvas>",2,15),t.fillStyle="rgba(102,204,0,0.7)",t.font="18pt Arial",t.fillText("user-trace:canvas,🔍<canvas>",4,45),e.toDataURL().slice(-50)}catch{return"nocanvas"}}function kf(){try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return"nowebgl";const n=t.getExtension("WEBGL_debug_renderer_info"),r=n?t.getParameter(n.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR);return`${r}::${n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)}`}catch{return"nowebgl"}}function xf(){const e=["Arial","Courier New","Georgia","Times New Roman","Verdana","Helvetica","Comic Sans MS","Impact","Tahoma","Trebuchet MS","Palatino Linotype","Lucida Console","Lucida Sans Unicode","MS Sans Serif","MS Serif","Symbol","Wingdings","Franklin Gothic Medium","Book Antiqua","Garamond","Calibri","Cambria","Consolas","Candara","Optima","Segoe UI","Gill Sans","Century Gothic","Futura"];try{const t=document.createElement("canvas").getContext("2d"),n="monospace",r="mmmmmmmmmmlli",o="72px";t.font=`${o} ${n}`;const a=t.measureText(r).width;return e.filter(e=>(t.font=`${o} '${e}', ${n}`,t.measureText(r).width!==a)).join(",")}catch{return""}}function Sf(){try{return window.OfflineAudioContext||window.webkitOfflineAudioContext?"audio-supported":"noaudio"}catch{return"noaudio"}}var Cf={generateFingerprint:function(){const e=function(){const e=navigator||{},t=screen||{};return{userAgent:e.userAgent||"",language:e.language||"",languages:(e.languages||[]).join(","),platform:e.platform||"",hardwareConcurrency:e.hardwareConcurrency||0,deviceMemory:e.deviceMemory||0,maxTouchPoints:e.maxTouchPoints||0,cookieEnabled:e.cookieEnabled?"1":"0",doNotTrack:e.doNotTrack||"unknown",screenWidth:t.width||0,screenHeight:t.height||0,colorDepth:t.colorDepth||0,pixelDepth:t.pixelDepth||0,devicePixelRatio:"undefined"!=typeof devicePixelRatio?devicePixelRatio:1,timezoneOffset:(new Date).getTimezoneOffset(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"",sessionStorage:bf("sessionStorage"),localStorage:bf("localStorage"),indexedDB:"undefined"!=typeof indexedDB?"1":"0",cpuClass:e.cpuClass||"unknown",oscpu:e.oscpu||"unknown",vendor:e.vendor||"",vendorSub:e.vendorSub||"",productSub:e.productSub||"",plugins:yf(),mimeTypes:vf(),canvas:wf(),webgl:kf(),fonts:xf(),audioContext:Sf()}}(),t=function(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t^e.charCodeAt(n),t&=t;return(t>>>0).toString(16).padStart(8,"0")}(Object.values(e).join("|||")),n=["nocanvas"!==e.canvas,"nowebgl"!==e.webgl&&""!==e.webgl,""!==e.fonts,""!==e.plugins,e.hardwareConcurrency>0,""!==e.timezone];return{id:t,signals:e,confidence:Math.round(n.filter(Boolean).length/n.length*100)}}};const Mf=[{url:"https://api.ipify.org?format=json",parse:e=>e.ip},{url:"https://api64.ipify.org?format=json",parse:e=>e.ip},{url:"https://api.my-ip.io/v2/ip.json",parse:e=>e.ip},{url:"https://ipapi.co/json/",parse:e=>e.ip}];async function Pf(e,t=4e3){const n=new AbortController,r=setTimeout(()=>n.abort(),t);try{const t=await fetch(e,{signal:n.signal});if(!t.ok)throw new Error(`HTTP ${t.status}`);return await t.json()}finally{clearTimeout(r)}}function zf(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)||/^[0-9a-f:]{2,39}$/i.test(e)}var Ef={detectIP:async function(){for(const e of Mf)try{const t=await Pf(e.url),n=e.parse(t);if(n&&zf(n))return{ip:n,source:new URL(e.url).hostname}}catch{}return null},getIPVersion:function(e){return e?/^(\d{1,3}\.){3}\d{1,3}$/.test(e)?"v4":/^[0-9a-f:]{2,39}$/i.test(e)?"v6":"unknown":"unknown"}};let jf={apiKeys:{},preferredProvider:null,timeoutMs:5e3};function Tf(e={}){const t=[e.ipinfo&&{name:"ipinfo.io",tier:"free-with-key",freeLimit:"50,000 req/month",signup:"https://ipinfo.io/signup",buildUrl:t=>`https://ipinfo.io/${t}/json?token=${e.ipinfo}`,parse:e=>{if(e.error)throw new Error(e.error.message||"Failed");const[t,n]=(e.loc||"0,0").split(",").map(Number);return{ip:e.ip||"",country:e.country||"",countryCode:e.country||"",region:e.region||"",regionCode:"",city:e.city||"",zip:e.postal||"",latitude:t,longitude:n,timezone:e.timezone||"",isp:e.org||"",org:e.org||"",proxy:!1,hosting:!1}}},e.ipgeolocation&&{name:"ipgeolocation.io",tier:"free-with-key",freeLimit:"1,000 req/day",signup:"https://ipgeolocation.io/signup.html",buildUrl:t=>`https://api.ipgeolocation.io/ipgeo?apiKey=${e.ipgeolocation}&ip=${t}`,parse:e=>{if(e.message)throw new Error(e.message);return{ip:e.ip||"",country:e.country_name||"",countryCode:e.country_code2||"",region:e.state_prov||"",regionCode:e.state_code||"",city:e.city||"",zip:e.zipcode||"",latitude:parseFloat(e.latitude)||0,longitude:parseFloat(e.longitude)||0,timezone:e.time_zone?.name||"",isp:e.isp||"",org:e.organization||"",proxy:e.security?.is_proxy||!1,hosting:e.security?.is_hosting||!1}}},e.abstractapi&&{name:"abstractapi.com",tier:"free-with-key",freeLimit:"20,000 req/month",signup:"https://app.abstractapi.com/users/signup?target=/api/ip-geolocation",buildUrl:t=>`https://ipgeolocation.abstractapi.com/v1/?api_key=${e.abstractapi}&ip_address=${t}`,parse:e=>{if(e.error)throw new Error(e.error.message||"Failed");return{ip:e.ip_address||"",country:e.country||"",countryCode:e.country_code||"",region:e.region||"",regionCode:e.region_iso_code||"",city:e.city||"",zip:e.postal_code||"",latitude:e.latitude||0,longitude:e.longitude||0,timezone:e.timezone?.name||"",isp:e.connection?.isp_name||"",org:e.connection?.org_name||"",proxy:e.security?.is_vpn||!1,hosting:e.security?.is_hosting||!1}}},e.ip2location&&{name:"ip2location.io",tier:"free-with-key",freeLimit:"30,000 req/month",signup:"https://www.ip2location.io/sign-up",buildUrl:t=>`https://api.ip2location.io/?key=${e.ip2location}&ip=${t}&format=json`,parse:e=>{if(e.error)throw new Error(e.error.error_message||"Failed");return{ip:e.ip||"",country:e.country_name||"",countryCode:e.country_code||"",region:e.region_name||"",regionCode:"",city:e.city_name||"",zip:e.zip_code||"",latitude:e.latitude||0,longitude:e.longitude||0,timezone:e.time_zone||"",isp:e.isp||"",org:e.domain||"",proxy:e.is_proxy||!1,hosting:!1}}},e.ipstack&&{name:"ipstack.com",tier:"free-with-key",freeLimit:"100 req/month",signup:"https://ipstack.com/product",buildUrl:t=>`https://api.ipstack.com/${t}?access_key=${e.ipstack}`,parse:e=>{if(e.error)throw new Error(e.error.info||"Failed");return{ip:e.ip||"",country:e.country_name||"",countryCode:e.country_code||"",region:e.region_name||"",regionCode:e.region_code||"",city:e.city||"",zip:e.zip||"",latitude:e.latitude||0,longitude:e.longitude||0,timezone:e.time_zone?.id||"",isp:e.connection?.isp||"",org:"",proxy:!1,hosting:!1}}}].filter(Boolean),n=[{name:"ip-api.com",tier:"free",freeLimit:"45 req/min (no key needed)",buildUrl:e=>`https://ip-api.com/json/${e}?fields=status,message,country,countryCode,region,regionName,city,zip,lat,lon,timezone,isp,org,proxy,hosting,query`,parse:e=>{if("success"!==e.status)throw new Error(e.message||"Failed");return{ip:e.query||"",country:e.country||"",countryCode:e.countryCode||"",region:e.regionName||"",regionCode:e.region||"",city:e.city||"",zip:e.zip||"",latitude:e.lat||0,longitude:e.lon||0,timezone:e.timezone||"",isp:e.isp||"",org:e.org||"",proxy:e.proxy||!1,hosting:e.hosting||!1}}},{name:"ipwho.is",tier:"free",freeLimit:"unlimited (fair use, no key needed)",buildUrl:e=>`https://ipwho.is/${e}`,parse:e=>{if(!e.success)throw new Error(e.message||"Failed");return{ip:e.ip||"",country:e.country||"",countryCode:e.country_code||"",region:e.region||"",regionCode:e.region_code||"",city:e.city||"",zip:e.postal||"",latitude:e.latitude||0,longitude:e.longitude||0,timezone:e.timezone?.id||"",isp:e.connection?.isp||"",org:e.connection?.org||"",proxy:!1,hosting:!1}}},{name:"ipapi.co",tier:"free",freeLimit:"1,000 req/day (no key needed)",buildUrl:e=>`https://ipapi.co/${e}/json/`,parse:e=>{if(e.error)throw new Error(e.reason||"Failed");return{ip:e.ip||"",country:e.country_name||"",countryCode:e.country_code||"",region:e.region||"",regionCode:e.region_code||"",city:e.city||"",zip:e.postal||"",latitude:e.latitude||0,longitude:e.longitude||0,timezone:e.timezone||"",isp:e.org||"",org:e.org||"",proxy:!1,hosting:!1}}},{name:"freeipapi.com",tier:"free",freeLimit:"unlimited (fair use, no key needed)",buildUrl:e=>`https://freeipapi.com/api/json/${e}`,parse:e=>({ip:e.ipAddress||"",country:e.countryName||"",countryCode:e.countryCode||"",region:e.regionName||"",regionCode:e.regionCode||"",city:e.cityName||"",zip:e.zipCode||"",latitude:e.latitude||0,longitude:e.longitude||0,timezone:e.timeZone||"",isp:"",org:"",proxy:!1,hosting:!1})}],r=["freeipapi.com","ipwho.is","ipapi.co","ip-api.com"];return n.sort((e,t)=>r.indexOf(e.name)-r.indexOf(t.name)),[...t,...n]}async function Nf(e,t=5e3){const n=new AbortController,r=setTimeout(()=>n.abort(),t);try{const t=await fetch(e,{signal:n.signal});if(!t.ok)throw new Error(`HTTP ${t.status}`);return await t.json()}finally{clearTimeout(r)}}const Ff={enableHighAccuracy:!0,timeout:8e3,maximumAge:3e5};function Lf(e={}){return new Promise(t=>"undefined"!=typeof navigator&&navigator.geolocation?"undefined"!=typeof window&&!1===window.isSecureContext?t(null):void navigator.geolocation.getCurrentPosition(e=>t({latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy}),()=>t(null),{...Ff,...e}):t(null))}async function Rf(e,t,n={}){if("number"!=typeof e||"number"!=typeof t)return null;const r=n.timeoutMs||jf.timeoutMs||5e3,o=`https://api.bigdatacloud.net/data/reverse-geocode-client?latitude=${e}&longitude=${t}&localityLanguage=${n.localityLanguage||"en"}`;try{const n=await Nf(o,r),a=n.city||n.locality||"";return a||n.countryName?{city:a,region:n.principalSubdivision||"",regionCode:(n.principalSubdivisionCode||"").split("-").pop()||"",country:n.countryName||"",countryCode:n.countryCode||"",latitude:e,longitude:t}:null}catch{return null}}var Af={configureGeo:function(e={}){e.apiKeys&&(jf.apiKeys={...jf.apiKeys,...e.apiKeys}),void 0!==e.preferredProvider&&(jf.preferredProvider=e.preferredProvider),void 0!==e.timeoutMs&&(jf.timeoutMs=e.timeoutMs)},resolveLocation:async function(e,t={}){const n={apiKeys:{...jf.apiKeys,...t.apiKeys||{}},preferredProvider:t.preferredProvider||jf.preferredProvider,timeoutMs:t.timeoutMs||jf.timeoutMs};let r=Tf(n.apiKeys);if(n.preferredProvider){const e=r.findIndex(e=>e.name===n.preferredProvider);if(e>0){const[t]=r.splice(e,1);r.unshift(t)}}for(const t of r)try{const r=await Nf(t.buildUrl(e),n.timeoutMs);return{...t.parse(r),source:t.name,tier:t.tier}}catch{}return null},listProviders:function(e={}){return Tf({...jf.apiKeys,...e}).map(({name:e,tier:t,freeLimit:n,signup:r})=>({name:e,tier:t,freeLimit:n,signup:r||"—"}))},getBrowserGeolocation:Lf,getGeolocationPermission:async function(){try{if("undefined"==typeof navigator||!navigator.permissions||!navigator.permissions.query)return"unsupported";return(await navigator.permissions.query({name:"geolocation"})).state}catch{return"unsupported"}},reverseGeocode:Rf,getBrowserLocation:async function(e={}){const t=await Lf(e);if(!t)return null;const n=await Rf(t.latitude,t.longitude,e),r=!(!n||!n.city&&!n.country);return{...r?n:{},latitude:t.latitude,longitude:t.longitude,accuracy:t.accuracy,...r?{source:"gps"}:{}}},toMapsUrl:function(e,t){return`https://www.google.com/maps?q=${e},${t}`}};const _f="__ut_sid__",If="__ut_uid__",Bf="__ut_meta__";function Df(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("");return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20)].join("-")}function Of(e,t){try{return e.getItem(t)}catch{return null}}function $f(e,t,n){try{return e.setItem(t,n),!0}catch{return!1}}var Uf={getOrCreateUserID:function(){let e=Of(localStorage,If),t=!1;return e||(e=Df(),t=!0,$f(localStorage,If,e)),{uid:e,isNew:t}},getOrCreateSessionID:function(){let e=Of(sessionStorage,_f),t=!1;return e||(e=Df(),t=!0,$f(sessionStorage,_f,e)),{sid:e,isNew:t}},saveSessionMeta:function(e){try{const t=JSON.stringify({...e,savedAt:(new Date).toISOString()});$f(localStorage,Bf,t)}catch{}},loadSessionMeta:function(){try{const e=Of(localStorage,Bf);return e?JSON.parse(e):null}catch{return null}},clearSession:function(){try{localStorage.removeItem(If)}catch{}try{localStorage.removeItem(Bf)}catch{}try{sessionStorage.removeItem(_f)}catch{}},getBrowserContext:function(){return{userAgent:navigator.userAgent,platform:navigator.platform||"unknown",language:navigator.language||"unknown",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,screenRes:`${screen.width}x${screen.height}`,viewportRes:`${window.innerWidth}x${window.innerHeight}`,colorDepth:screen.colorDepth,touchSupport:navigator.maxTouchPoints>0,cookieEnabled:navigator.cookieEnabled,referrer:document.referrer||null,currentUrl:window.location.href,loadedAt:(new Date).toISOString()}}};const{generateFingerprint:Vf}=Cf,{detectIP:Hf,getIPVersion:Wf}=Ef,{configureGeo:qf,resolveLocation:Qf,listProviders:Kf,getBrowserGeolocation:Yf,getGeolocationPermission:Gf,reverseGeocode:Jf,getBrowserLocation:Xf,toMapsUrl:Zf}=Af,{getOrCreateUserID:eh,getOrCreateSessionID:th,saveSessionMeta:nh,loadSessionMeta:rh,clearSession:oh,getBrowserContext:ah}=Uf;mf.exports=class{constructor(e={}){this._options={onReady:e.onReady||null,onError:e.onError||null,geoFromBrowser:void 0===e.geoFromBrowser||e.geoFromBrowser,geoApiKeys:e.geoApiKeys||null,geoOptions:e.geoOptions||null,cache:!1!==e.cache,maxAgeMs:e.maxAgeMs||3e5,autoInit:e.autoInit||!1,webhookUrl:e.webhookUrl||null},this.profile=null,this._ready=!1,this._options.autoInit&&this.init().catch(()=>{})}async init(){if(this._options.cache){const e=rh();if(e&&e.savedAt){if(Date.now()-new Date(e.savedAt).getTime()<this._options.maxAgeMs)return this.profile=e,this._ready=!0,this._options.onReady&&this._options.onReady(this.profile),this.profile}}try{const{uid:e,isNew:t}=eh(),{sid:n,isNew:r}=th(),{id:o,signals:a,confidence:i}=Vf(),s=this._options.geoApiKeys?{apiKeys:this._options.geoApiKeys}:{},[l,c]=await Promise.all([(async()=>{const e=await Hf(),t=e?.ip||"unknown",n="unknown"!==t?await Qf(t,s):null;return{ip:t,ipVersion:e?Wf(t):"unknown",geo:n}})(),this._collectBrowserLocation()]),{ip:u,ipVersion:d}=l;let p=l.geo,g=null;c&&(g={latitude:c.latitude,longitude:c.longitude,accuracy:c.accuracy},"gps"===c.source&&(p={...p||{},...c}));const f=ah();return this.profile={uid:e,sid:n,isNewUser:t,isNewSession:r,fingerprintId:o,fingerprintConfidence:i,ip:u,ipVersion:d,geo:p||null,browserGeo:g||null,browser:f,raw:a,createdAt:(new Date).toISOString(),...p?{mapsUrl:Zf(p.latitude,p.longitude)}:{}},nh(this.profile),this._options.webhookUrl&&this._sendToWebhook(this.profile),this._ready=!0,this._options.onReady&&this._options.onReady(this.profile),this.profile}catch(e){throw this._options.onError&&this._options.onError(e),e}}async _collectBrowserLocation(){const e=this._options.geoFromBrowser;if(!e)return null;if("auto"===e){if("granted"!==await Gf())return null}return Xf(this._options.geoOptions||{})}async captureBrowserLocation(e={}){const t=await Xf({...this._options.geoOptions||{},...e});return t&&this.profile?(this.profile.browserGeo={latitude:t.latitude,longitude:t.longitude,accuracy:t.accuracy},this.profile.mapsUrl=Zf(t.latitude,t.longitude),"gps"===t.source&&(this.profile.geo={...this.profile.geo||{},...t}),nh(this.profile),this._options.onReady&&this._options.onReady(this.profile),this.profile):this.profile}getProfile(){return this.profile}isKnownUser(e){return this.profile?.uid===e}async refresh(){return oh(),this.profile=null,this._ready=!1,this.init()}clear(){oh(),this.profile=null,this._ready=!1}getSummary(){if(!this.profile)return null;const{uid:e,sid:t,fingerprintId:n,ip:r,geo:o,browser:a,createdAt:i}=this.profile;return{uid:e,sid:t,fingerprintId:n,ip:r,country:o?.country||"unknown",city:o?.city||"unknown",isp:o?.isp||"unknown",proxy:o?.proxy||!1,timezone:o?.timezone||a.timezone,userAgent:a.userAgent,language:a.language,createdAt:i}}async _sendToWebhook(e){try{await fetch(this._options.webhookUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}};var ih=mf.exports.generateFingerprint=Vf,sh=mf.exports.detectIP=Hf,lh=mf.exports.configureGeo=qf,ch=mf.exports.resolveLocation=Qf,uh=mf.exports.listProviders=Kf,dh=mf.exports.getBrowserGeolocation=Yf,ph=mf.exports.getGeolocationPermission=Gf,gh=mf.exports.reverseGeocode=Jf,fh=mf.exports.getBrowserLocation=Xf,hh=mf.exports.getOrCreateUserID=eh,mh=mf.exports.getOrCreateSessionID=th,bh=mf.exports.clearSession=oh,yh=mf.exports.getBrowserContext=ah,vh=mf.exports,wh=e({__proto__:null,clearSession:bh,configureGeo:lh,default:vh,detectIP:sh,generateFingerprint:ih,getBrowserContext:yh,getBrowserGeolocation:dh,getBrowserLocation:fh,getGeolocationPermission:ph,getOrCreateSessionID:mh,getOrCreateUserID:hh,listProviders:uh,resolveLocation:ch,reverseGeocode:gh},[vh]),kh={exports:{}};!function(e){!function(){function t(e,t,n){return e.call.apply(e.bind,arguments)}function n(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function r(e,o,a){return(r=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?t:n).apply(null,arguments)}var o=Date.now||function(){return+new Date};function a(e,t){this.a=e,this.o=t||e,this.c=this.o.document}var i=!!window.FontFace;function s(e,t,n,r){if(t=e.c.createElement(t),n)for(var o in n)n.hasOwnProperty(o)&&("style"==o?t.style.cssText=n[o]:t.setAttribute(o,n[o]));return r&&t.appendChild(e.c.createTextNode(r)),t}function l(e,t,n){(e=e.c.getElementsByTagName(t)[0])||(e=document.documentElement),e.insertBefore(n,e.lastChild)}function c(e){e.parentNode&&e.parentNode.removeChild(e)}function u(e,t,n){t=t||[],n=n||[];for(var r=e.className.split(/\s+/),o=0;o<t.length;o+=1){for(var a=!1,i=0;i<r.length;i+=1)if(t[o]===r[i]){a=!0;break}a||r.push(t[o])}for(t=[],o=0;o<r.length;o+=1){for(a=!1,i=0;i<n.length;i+=1)if(r[o]===n[i]){a=!0;break}a||t.push(r[o])}e.className=t.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function d(e,t){for(var n=e.className.split(/\s+/),r=0,o=n.length;r<o;r++)if(n[r]==t)return!0;return!1}function p(e,t,n){function r(){u&&o&&a&&(u(c),u=null)}t=s(e,"link",{rel:"stylesheet",href:t,media:"all"});var o=!1,a=!0,c=null,u=n||null;i?(t.onload=function(){o=!0,r()},t.onerror=function(){o=!0,c=Error("Stylesheet failed to load"),r()}):setTimeout(function(){o=!0,r()},0),l(e,"head",t)}function g(e,t,n,r){var o=e.c.getElementsByTagName("head")[0];if(o){var a=s(e,"script",{src:t}),i=!1;return a.onload=a.onreadystatechange=function(){i||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(i=!0,n&&n(null),a.onload=a.onreadystatechange=null,"HEAD"==a.parentNode.tagName&&o.removeChild(a))},o.appendChild(a),setTimeout(function(){i||(i=!0,n&&n(Error("Script load timeout")))},r||5e3),a}return null}function f(){this.a=0,this.c=null}function h(e){return e.a++,function(){e.a--,b(e)}}function m(e,t){e.c=t,b(e)}function b(e){0==e.a&&e.c&&(e.c(),e.c=null)}function y(e){this.a=e||"-"}function v(e,t){this.c=e,this.f=4,this.a="n";var n=(t||"n4").match(/^([nio])([1-9])$/i);n&&(this.a=n[1],this.f=parseInt(n[2],10))}function w(e){var t=[];e=e.split(/,\s*/);for(var n=0;n<e.length;n++){var r=e[n].replace(/['"]/g,"");-1!=r.indexOf(" ")||/^\d/.test(r)?t.push("'"+r+"'"):t.push(r)}return t.join(",")}function k(e){return e.a+e.f}function x(e){var t="normal";return"o"===e.a?t="oblique":"i"===e.a&&(t="italic"),t}function S(e){var t=4,n="n",r=null;return e&&((r=e.match(/(normal|oblique|italic)/i))&&r[1]&&(n=r[1].substr(0,1).toLowerCase()),(r=e.match(/([1-9]00|normal|bold)/i))&&r[1]&&(/bold/i.test(r[1])?t=7:/[1-9]00/.test(r[1])&&(t=parseInt(r[1].substr(0,1),10)))),n+t}function C(e,t){this.c=e,this.f=e.o.document.documentElement,this.h=t,this.a=new y("-"),this.j=!1!==t.events,this.g=!1!==t.classes}function M(e){if(e.g){var t=d(e.f,e.a.c("wf","active")),n=[],r=[e.a.c("wf","loading")];t||n.push(e.a.c("wf","inactive")),u(e.f,n,r)}P(e,"inactive")}function P(e,t,n){e.j&&e.h[t]&&(n?e.h[t](n.c,k(n)):e.h[t]())}function z(){this.c={}}function E(e,t){this.c=e,this.f=t,this.a=s(this.c,"span",{"aria-hidden":"true"},this.f)}function j(e){l(e.c,"body",e.a)}function T(e){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+w(e.c)+";font-style:"+x(e)+";font-weight:"+e.f+"00;"}function N(e,t,n,r,o,a){this.g=e,this.j=t,this.a=r,this.c=n,this.f=o||3e3,this.h=a||void 0}function F(e,t,n,r,o,a,i){this.v=e,this.B=t,this.c=n,this.a=r,this.s=i||"BESbswy",this.f={},this.w=o||3e3,this.u=a||null,this.m=this.j=this.h=this.g=null,this.g=new E(this.c,this.s),this.h=new E(this.c,this.s),this.j=new E(this.c,this.s),this.m=new E(this.c,this.s),e=T(e=new v(this.a.c+",serif",k(this.a))),this.g.a.style.cssText=e,e=T(e=new v(this.a.c+",sans-serif",k(this.a))),this.h.a.style.cssText=e,e=T(e=new v("serif",k(this.a))),this.j.a.style.cssText=e,e=T(e=new v("sans-serif",k(this.a))),this.m.a.style.cssText=e,j(this.g),j(this.h),j(this.j),j(this.m)}y.prototype.c=function(e){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n].replace(/[\W_]+/g,"").toLowerCase());return t.join(this.a)},N.prototype.start=function(){var e=this.c.o.document,t=this,n=o(),r=new Promise(function(r,a){!function i(){o()-n>=t.f?a():e.fonts.load(function(e){return x(e)+" "+e.f+"00 300px "+w(e.c)}(t.a),t.h).then(function(e){1<=e.length?r():setTimeout(i,25)},function(){a()})}()}),a=null,i=new Promise(function(e,n){a=setTimeout(n,t.f)});Promise.race([i,r]).then(function(){a&&(clearTimeout(a),a=null),t.g(t.a)},function(){t.j(t.a)})};var L={D:"serif",C:"sans-serif"},R=null;function A(){if(null===R){var e=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);R=!!e&&(536>parseInt(e[1],10)||536===parseInt(e[1],10)&&11>=parseInt(e[2],10))}return R}function _(e,t,n){for(var r in L)if(L.hasOwnProperty(r)&&t===e.f[L[r]]&&n===e.f[L[r]])return!0;return!1}function I(e){var t,n=e.g.a.offsetWidth,a=e.h.a.offsetWidth;(t=n===e.f.serif&&a===e.f["sans-serif"])||(t=A()&&_(e,n,a)),t?o()-e.A>=e.w?A()&&_(e,n,a)&&(null===e.u||e.u.hasOwnProperty(e.a.c))?B(e,e.v):B(e,e.B):function(e){setTimeout(r(function(){I(this)},e),50)}(e):B(e,e.v)}function B(e,t){setTimeout(r(function(){c(this.g.a),c(this.h.a),c(this.j.a),c(this.m.a),t(this.a)},e),0)}function D(e,t,n){this.c=e,this.a=t,this.f=0,this.m=this.j=!1,this.s=n}F.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=o(),I(this)};var O=null;function $(e){0==--e.f&&e.j&&(e.m?((e=e.a).g&&u(e.f,[e.a.c("wf","active")],[e.a.c("wf","loading"),e.a.c("wf","inactive")]),P(e,"active")):M(e.a))}function U(e){this.j=e,this.a=new z,this.h=0,this.f=this.g=!0}function V(e,t,n,o,a){var i=0==--e.h;(e.f||e.g)&&setTimeout(function(){var e=a||null,s=o||{};if(0===n.length&&i)M(t.a);else{t.f+=n.length,i&&(t.j=i);var l,c=[];for(l=0;l<n.length;l++){var d=n[l],p=s[d.c],g=t.a,f=d;if(g.g&&u(g.f,[g.a.c("wf",f.c,k(f).toString(),"loading")]),P(g,"fontloading",f),g=null,null===O)if(window.FontFace){f=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent);var h=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);O=f?42<parseInt(f[1],10):!h}else O=!1;g=O?new N(r(t.g,t),r(t.h,t),t.c,d,t.s,p):new F(r(t.g,t),r(t.h,t),t.c,d,t.s,e,p),c.push(g)}for(l=0;l<c.length;l++)c[l].start()}},0)}function H(e,t){this.c=e,this.a=t}function W(e,t){this.c=e,this.a=t}function q(e,t){this.c=e||Q,this.a=[],this.f=[],this.g=t||""}D.prototype.g=function(e){var t=this.a;t.g&&u(t.f,[t.a.c("wf",e.c,k(e).toString(),"active")],[t.a.c("wf",e.c,k(e).toString(),"loading"),t.a.c("wf",e.c,k(e).toString(),"inactive")]),P(t,"fontactive",e),this.m=!0,$(this)},D.prototype.h=function(e){var t=this.a;if(t.g){var n=d(t.f,t.a.c("wf",e.c,k(e).toString(),"active")),r=[],o=[t.a.c("wf",e.c,k(e).toString(),"loading")];n||r.push(t.a.c("wf",e.c,k(e).toString(),"inactive")),u(t.f,r,o)}P(t,"fontinactive",e),$(this)},U.prototype.load=function(e){this.c=new a(this.j,e.context||this.j),this.g=!1!==e.events,this.f=!1!==e.classes,function(e,t,n){var r=[],o=n.timeout;!function(e){e.g&&u(e.f,[e.a.c("wf","loading")]),P(e,"loading")}(t);r=function(e,t,n){var r,o=[];for(r in t)if(t.hasOwnProperty(r)){var a=e.c[r];a&&o.push(a(t[r],n))}return o}(e.a,n,e.c);var a=new D(e.c,t,o);for(e.h=r.length,t=0,n=r.length;t<n;t++)r[t].load(function(t,n,r){V(e,a,t,n,r)})}(this,new C(this.c,e),e)},H.prototype.load=function(e){function t(){if(a["__mti_fntLst"+r]){var n,o=a["__mti_fntLst"+r](),i=[];if(o)for(var s=0;s<o.length;s++){var l=o[s].fontfamily;null!=o[s].fontStyle&&null!=o[s].fontWeight?(n=o[s].fontStyle+o[s].fontWeight,i.push(new v(l,n))):i.push(new v(l))}e(i)}else setTimeout(function(){t()},50)}var n=this,r=n.a.projectId,o=n.a.version;if(r){var a=n.c.o;g(this.c,(n.a.api||"https://fast.fonts.net/jsapi")+"/"+r+".js"+(o?"?v="+o:""),function(o){o?e([]):(a["__MonotypeConfiguration__"+r]=function(){return n.a},t())}).id="__MonotypeAPIScript__"+r}else e([])},W.prototype.load=function(e){var t,n,r=this.a.urls||[],o=this.a.families||[],a=this.a.testStrings||{},i=new f;for(t=0,n=r.length;t<n;t++)p(this.c,r[t],h(i));var s=[];for(t=0,n=o.length;t<n;t++)if((r=o[t].split(":"))[1])for(var l=r[1].split(","),c=0;c<l.length;c+=1)s.push(new v(r[0],l[c]));else s.push(new v(r[0]));m(i,function(){e(s,a)})};var Q="https://fonts.googleapis.com/css";function K(e){this.f=e,this.a=[],this.c={}}var Y={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},G={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},J={i:"i",italic:"i",n:"n",normal:"n"},X=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function Z(e,t){this.c=e,this.a=t}var ee={Arimo:!0,Cousine:!0,Tinos:!0};function te(e,t){this.c=e,this.a=t}function ne(e,t){this.c=e,this.f=t,this.a=[]}Z.prototype.load=function(e){var t=new f,n=this.c,r=new q(this.a.api,this.a.text),o=this.a.families;!function(e,t){for(var n=t.length,r=0;r<n;r++){var o=t[r].split(":");3==o.length&&e.f.push(o.pop());var a="";2==o.length&&""!=o[1]&&(a=":"),e.a.push(o.join(a))}}(r,o);var a=new K(o);!function(e){for(var t=e.f.length,n=0;n<t;n++){var r=e.f[n].split(":"),o=r[0].replace(/\+/g," "),a=["n4"];if(2<=r.length){var i;if(i=[],s=r[1])for(var s,l=(s=s.split(",")).length,c=0;c<l;c++){var u;if((u=s[c]).match(/^[\w-]+$/))if(null==(d=X.exec(u.toLowerCase())))u="";else{if(u=null==(u=d[2])||""==u?"n":J[u],null==(d=d[1])||""==d)d="4";else var d=G[d]||(isNaN(d)?"4":d.substr(0,1));u=[u,d].join("")}else u="";u&&i.push(u)}0<i.length&&(a=i),3==r.length&&(i=[],0<(r=(r=r[2])?r.split(","):i).length&&(r=Y[r[0]])&&(e.c[o]=r))}for(e.c[o]||(r=Y[o])&&(e.c[o]=r),r=0;r<a.length;r+=1)e.a.push(new v(o,a[r]))}}(a),p(n,function(e){if(0==e.a.length)throw Error("No fonts to load!");if(-1!=e.c.indexOf("kit="))return e.c;for(var t=e.a.length,n=[],r=0;r<t;r++)n.push(e.a[r].replace(/ /g,"+"));return t=e.c+"?family="+n.join("%7C"),0<e.f.length&&(t+="&subset="+e.f.join(",")),0<e.g.length&&(t+="&text="+encodeURIComponent(e.g)),t}(r),h(t)),m(t,function(){e(a.a,a.c,ee)})},te.prototype.load=function(e){var t=this.a.id,n=this.c.o;t?g(this.c,(this.a.api||"https://use.typekit.net")+"/"+t+".js",function(t){if(t)e([]);else if(n.Typekit&&n.Typekit.config&&n.Typekit.config.fn){t=n.Typekit.config.fn;for(var r=[],o=0;o<t.length;o+=2)for(var a=t[o],i=t[o+1],s=0;s<i.length;s++)r.push(new v(a,i[s]));try{n.Typekit.load({events:!1,classes:!1,async:!0})}catch(e){}e(r)}},2e3):e([])},ne.prototype.load=function(e){var t=this.f.id,n=this.c.o,r=this;t?(n.__webfontfontdeckmodule__||(n.__webfontfontdeckmodule__={}),n.__webfontfontdeckmodule__[t]=function(t,n){for(var o=0,a=n.fonts.length;o<a;++o){var i=n.fonts[o];r.a.push(new v(i.name,S("font-weight:"+i.weight+";font-style:"+i.style)))}e(r.a)},g(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+function(e){return e.o.location.hostname||e.a.location.hostname}(this.c)+"/"+t+".js",function(t){t&&e([])})):e([])};var re=new U(window);re.a.c.custom=function(e,t){return new W(t,e)},re.a.c.fontdeck=function(e,t){return new ne(t,e)},re.a.c.monotype=function(e,t){return new H(t,e)},re.a.c.typekit=function(e,t){return new te(t,e)},re.a.c.google=function(e,t){return new Z(t,e)};var oe={load:r(re.load,re)};e.exports?e.exports=oe:(window.WebFont=oe,window.WebFontConfig&&re.load(window.WebFontConfig))}()}(kh);var xh=kh.exports,Sh=e({__proto__:null,default:xh},[xh])}();
|
|
39
|
+
*/let _p=null;function Ip(e){I.useEffect(()=>{if(!Fp||!e)return;const t=e.split(",")[0]?.trim();if(!t||Ap.has(t))return;if((e=>{const t=e.trim().toLowerCase();return!t||!!Lp.has(t)||Rp.some(e=>t.includes(e))})(t))return void Ap.add(t);let n=!0;return(async()=>{try{_p||(_p=Promise.resolve().then(function(){return Sh}));const e=await _p,r=e&&"default"in e?e.default:e,o=(e=>e.trim().replace(/\s+/g,"+"))(t);r.load({google:{families:[`${o}:300,400,500,600,700`]},fontactive:e=>{n&&Ap.add(e)},fontinactive:e=>{n&&Ap.add(e)}})}catch(e){}})(),()=>{n=!1}},[e])}const Bp="__eshalChatWidgetCitationContext",Dp="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:void 0,Op=Dp?Dp[Bp]||(Dp[Bp]=I.createContext(null)):I.createContext(null);function $p(e,t){return"string"!=typeof e||""===e?"":/^https?:\/\//i.test(e)?e:t?`${String(t).replace(/\/$/,"")}${e.startsWith("/")?"":"/"}${e}`:e}const Up="chat-widget-markdown-chunk.min.js",Vp="undefined"!=typeof document?document.currentScript?.src:void 0;let Hp=null;function Wp(){return"undefined"!=typeof window&&window.__eshalChatWidgetChunks?.MarkdownRenderer?Promise.resolve({default:window.__eshalChatWidgetChunks.MarkdownRenderer}):Hp||(Hp=new Promise((e,t)=>{const n=document.createElement("script");n.src=function(){if(Vp)return new URL(Up,Vp).toString();const e=Array.from(document.getElementsByTagName("script")).find(e=>/chat-widget(\.min)?\.js(\?.*)?$/.test(e.src));return e?new URL(Up,e.src).toString():Up}(),n.async=!0,n.onload=()=>{window.__eshalChatWidgetChunks?.MarkdownRenderer?e({default:window.__eshalChatWidgetChunks.MarkdownRenderer}):(Hp=null,t(new Error("[widget] markdown chunk loaded but did not register itself")))},n.onerror=()=>{Hp=null,t(new Error(`[widget] failed to load markdown chunk from ${n.src}`))},document.head.appendChild(n)}),Hp)}function qp(){return Wp()}var Qp={exports:{}},Kp={},Yp=I,Gp=Symbol.for("react.element"),Jp=Symbol.for("react.fragment"),Xp=Object.prototype.hasOwnProperty,Zp=Yp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,eg={key:!0,ref:!0,__self:!0,__source:!0};function tg(e,t,n){var r,o={},a=null,i=null;for(r in void 0!==n&&(a=""+n),void 0!==t.key&&(a=""+t.key),void 0!==t.ref&&(i=t.ref),t)Xp.call(t,r)&&!eg.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:Gp,type:e,key:a,ref:i,props:o,_owner:Zp.current}}Kp.Fragment=Jp,Kp.jsx=tg,Kp.jsxs=tg,Qp.exports=Kp;var ng=Qp.exports;const rg=I.lazy(qp);class og extends I.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){}render(){return this.state.failed?this.props.fallback:this.props.children}}const ag=/(```|`[^`]+`|(^|\n)\s{0,3}#{1,6}\s|(^|\n)\s*[-*+]\s|(^|\n)\s*\d+\.\s|(^|\n)\s*>\s|\[[^\]]*\]\([^)]*\)|\*\*|__|~~|(^|\n)\s*\||\[\d+\])/;const ig=({content:e,isDark:t,textColor:n,fontFamily:r,fontSize:o})=>ng.jsx("p",{className:"leading-relaxed [&:first-child]:!mt-0 whitespace-pre-wrap break-words",style:{color:n||(t?"#f3f4f6":"#1A1A1A"),fontFamily:r||"Inter",fontSize:o||"14px",margin:0,lineHeight:"1.6",padding:0,overflowWrap:"break-word"},children:e}),sg=({content:e,isStreaming:t,isDark:n=!1,isRtl:r=!1,textColor:o,fontFamily:a,fontSize:i,onButtonClick:s,provideCitations:l=!0})=>{const[c,u]=I.useState(""),[d,p]=I.useState(!1),g=I.useRef(e),f=I.useRef(0),h=I.useRef(null),m=I.useRef(0);I.useEffect(()=>{if(e!==g.current){if(g.current=e,f.current>=e.length)return u(e),void p(!1);e.length<c.length&&(f.current=0,u(""))}if(!t)return u(e),p(!1),void(h.current&&cancelAnimationFrame(h.current));p(!0);const n=t=>{if(t-m.current<16)h.current=requestAnimationFrame(n);else if(m.current=t,f.current<e.length){const t=Math.max(2,Math.floor(4*Math.random())),r=Math.min(f.current+t,e.length);u(e.slice(0,r)),f.current=r,h.current=requestAnimationFrame(n)}else p(!1)};return h.current=requestAnimationFrame(n),()=>{h.current&&cancelAnimationFrame(h.current)}},[e,t]);const b="string"==typeof(y=c)&&0!==y.length&&ag.test(y);var y;return ng.jsxs("div",{className:"relative",dir:"auto",style:{textAlign:r?"right":"left",color:o||(n?"#f3f4f6":"#1A1A1A"),fontFamily:a||"Inter",fontSize:i||"14px",margin:0,padding:0},children:[b?ng.jsx(og,{fallback:ng.jsx(ig,{content:c,isDark:n,textColor:o,fontFamily:a,fontSize:i}),children:ng.jsx(I.Suspense,{fallback:ng.jsx(ig,{content:c,isDark:n,textColor:o,fontFamily:a,fontSize:i}),children:ng.jsx(rg,{content:c,isStreaming:t,isDark:n,isRtl:r,textColor:o,fontFamily:a,fontSize:i,onButtonClick:s,provideCitations:l})})}):ng.jsx(ig,{content:c,isDark:n,textColor:o,fontFamily:a,fontSize:i}),d&&ng.jsx("span",{className:"inline-block w-1.5 h-4 bg-blue-500 ms-0.5 animate-pulse align-text-bottom",style:{animationDuration:"0.8s"}})]})},lg=({isDark:e,t:t})=>ng.jsxs("div",{className:"flex gap-1.5",role:"status","aria-label":t("agentIsTyping"),children:[ng.jsx("div",{className:`w-2 h-2 rounded-full ${e?"bg-gray-500":"bg-gray-400"} animate-bounce`,style:{animationDelay:"0ms"},"aria-hidden":"true"}),ng.jsx("div",{className:`w-2 h-2 rounded-full ${e?"bg-gray-500":"bg-gray-400"} animate-bounce`,style:{animationDelay:"150ms"},"aria-hidden":"true"}),ng.jsx("div",{className:`w-2 h-2 rounded-full ${e?"bg-gray-500":"bg-gray-400"} animate-bounce`,style:{animationDelay:"300ms"},"aria-hidden":"true"})]}),cg=({question:e,options:t,onDecision:n,disabled:r,isDark:o=!1})=>ng.jsxs("div",{className:"mt-3 p-3 rounded-lg border "+(o?"bg-blue-900/30 border-blue-700/50":"bg-blue-50 border-blue-200"),children:[ng.jsx("p",{className:"text-sm font-medium mb-2 "+(o?"text-gray-100":"text-gray-900"),children:e}),ng.jsx("div",{className:"space-y-2",children:t.map(e=>ng.jsx("button",{onClick:()=>n(e.id,e.label),disabled:r,className:"w-full text-left px-3 py-2 text-sm rounded transition-all "+(o?"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 ug({content:e,isDark:t}){const[n,r]=I.useState(!1),o=I.useCallback(()=>{e&&(navigator.clipboard?.writeText(e).catch(()=>{}),r(!0),setTimeout(()=>r(!1),1500))},[e]);return ng.jsx("button",{type:"button",onClick:o,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":n?"Copied":"Copy message",title:n?"Copied":"Copy message",children:n?ng.jsx(gp,{className:"w-3 h-3 text-green-500"}):ng.jsx(bp,{className:"w-3 h-3"})})}const dg=({message:e,formatTime:t,isDark:n,primaryColor:r,agentMessageBubbleColor:o,resolvedAgentBubbleColor:a,textColor:i,assistantTextColor:s,fontFamily:l,agentMessageBubbleFontFamily:c,agentMessageBubbleFontSize:u,fontSize:d,isRtl:p,onDecision:g,companyLogo:f,conciergeName:h,companyName:m,apiBaseUrl:b,getAuthToken:y,onPromptSuggestionClick:v,allowFeedback:w=!0,provideCitations:k=!0,onFeedback:x,headerTextColor:S,t:C})=>{const M="string"==typeof e.content?e.content:"",P=e.isProcessing&&(!M||0===M.length),z=zd(M,p),[E,j]=I.useState(()=>e?.feedback??null),[T,N]=I.useState(!1),[F,L]=I.useState(null),[R,A]=I.useState(""),_=I.useRef(null),B=I.useCallback(e=>{if(x&&M){if(E===e)return j(null),N(!1),L(null),A(""),void x(M,null);if("like"===e)return j("like"),N(!1),L(null),A(""),void x(M,"like");j(null),L("dislike"),N(!0),A(""),setTimeout(()=>_.current?.focus(),100)}},[E,x,M]),D=I.useCallback(()=>{x&&M&&F&&(j(F),x(M,F,R.trim()||void 0),N(!1),A(""),L(null))},[x,M,F,R]),O=I.useCallback(()=>{N(!1),A(""),L(null)},[]),$=!0===e?.isError,U=$?n?"rgba(239,68,68,0.15)":"#fee2e2":null!=a?a:null!=o?o:n?"#1f2937":"#FFFFFF",V=null!=o&&"#ffffff"!==o&&"#FFFFFF"!==o&&"#1f2937"!==o,H=$?n?"#fca5a5":"#991b1b":null!=s?s:null!=i?i:n?"#f3f4f6":"#1A1A1A",W=null!=c?c:null!=l?l:"Inter",q=null!=u?u:null!=d?d:"14px";Ip(W);const{onSourceActivate:Q,downloadingKey:K}=function({apiBaseUrl:e,getAuthToken:t}){const[n,r]=I.useState(null),o=I.useCallback(async n=>{if(!n)return;const o=n.url||n.source_id||n.sourceid||n.source_name||"",a=String(n.source_id||n.sourceid||"").startsWith("attachment:"),i="string"==typeof n.url&&n.url.includes("/api/v1/sharepoint/file/");if(!("file"===n.source_type||i||a||(n.source_id||n.sourceid)&&!n.url)){const e=function(e){return"string"==typeof e&&/^https?:\/\//i.test(e)?e:void 0}(n.url);if(e)try{window.open(e,"_blank","noopener,noreferrer")}catch{}return}if(e||a){r(o);try{let r;if(a){if(!n.url)throw new Error("attachment has no URL");const o={};if("function"==typeof t){const e=await t();e&&(o.Authorization=`Bearer ${e}`)}r=await fetch($p(n.url,e),{method:"GET",headers:o,credentials:"include"})}else if(i){const o=$p(n.url,e),a={};if("function"==typeof t){const e=await t();e&&(a.Authorization=`Bearer ${e}`)}r=await fetch(o,{method:"GET",headers:a,credentials:"include"})}else{const o=`${e.replace(/\/$/,"")}/api/v1/support/file-download`,a={"Content-Type":"application/json"};if("function"==typeof t){const e=await t();e&&(a.Authorization=`Bearer ${e}`)}r=await fetch(o,{method:"POST",headers:a,credentials:"include",body:JSON.stringify({source_id:n.source_id||n.sourceid,file_name:n.url||"",source_name:n.source_name||""})})}if(!r.ok){const e=await r.json().catch(()=>({}));throw new Error(e.details||e.error||r.statusText)}const o=await r.blob(),s=r.headers.get("content-disposition");let l=n.source_name||"download";if(!a){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"),u=URL.createObjectURL(o);c.href=u,c.download=l,document.body.appendChild(c),c.click(),c.remove(),URL.revokeObjectURL(u)}catch(e){}finally{r(null)}}},[e,t]);return{onSourceActivate:o,downloadingKey:n}}({apiBaseUrl:b,getAuthToken:y}),Y=I.useMemo(()=>({sources:e.sources||[],sourcesPreliminary:!!e.sourcesPreliminary,onSourceActivate:Q,downloadingKey:K,textColor:H}),[e.sources,e.sourcesPreliminary,Q,K,H]);return ng.jsx(Op.Provider,{value:Y,children:ng.jsxs("div",{className:"flex gap-3 flex-row animate-in min-w-0",children:[ng.jsx("div",{className:"flex-shrink-0 mt-1",children:ng.jsx("div",{className:"w-8 h-8 rounded-full overflow-hidden flex items-center justify-center",style:{backgroundColor:r||"#2563eb"},children:f?ng.jsx("div",{className:"w-full h-full bg-white/10 flex items-center justify-center",children:ng.jsx("img",{src:f,alt:h||m||"Assistant avatar",className:"object-contain rounded-full",style:{width:"100%",height:"100%"}})}):ng.jsx("div",{className:"w-full h-full flex items-center justify-center",style:{fontSize:"18px",fontFamily:l||"Inter",color:S||"#FFFFFF"},children:(h||"A").charAt(0).toUpperCase()})})}),ng.jsxs("div",{className:"flex flex-col items-start min-w-0 max-w-[75%]",children:[ng.jsx("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 "+(V?"border-transparent":n?"border-gray-700":"border-gray-200"),style:{backgroundColor:U,color:H,fontFamily:W,fontSize:q,direction:z?"rtl":"ltr",textAlign:z?"right":"left",...V?{borderColor:`${U}33`}:{}},children:P?ng.jsx(lg,{isDark:n,t:C}):ng.jsx(ng.Fragment,{children:e.requiresDecision&&e.decisionData&&g?ng.jsxs("div",{children:[M&&ng.jsx("div",{className:"mb-3",children:ng.jsx(sg,{content:M,isStreaming:e.isProcessing,isDark:n,isRtl:z,textColor:H,fontFamily:W,fontSize:q,onButtonClick:v,provideCitations:k})}),ng.jsx(cg,{question:e.decisionData.question,options:e.decisionData.options,onDecision:(t,n)=>g(e.decisionData.decisionId,t,n),disabled:!!e.decisionResponse,isDark:n}),e.decisionResponse&&ng.jsxs("div",{className:"mt-2 text-xs "+(n?"text-gray-400":"text-gray-500"),children:["Selected: ",e.decisionResponse.selectedOption]})]}):M?ng.jsx(ng.Fragment,{children:ng.jsx(sg,{content:M,isStreaming:e.isProcessing,isDark:n,isRtl:z,textColor:H,fontFamily:W,fontSize:q,onButtonClick:v,provideCitations:k})}):null})}),ng.jsxs("div",{className:"flex items-center gap-1.5 mt-1.5 px-1",children:[ng.jsx("p",{className:"text-xs leading-none "+(n?"text-gray-400":"text-gray-500"),dir:"auto",children:t(e.timestamp)}),!P&&!e.isProcessing&&M&&ng.jsx(ug,{content:M,isDark:n}),!1!==w&&x&&!P&&!e.isProcessing&&M&&"welcome"!==e.type&&!e.isWelcome&&ng.jsxs("div",{className:"flex items-center gap-0.5 ms-0.5",children:[ng.jsx("button",{type:"button",onClick:()=>B("like"),className:"p-0.5 rounded transition-colors "+("like"===E||"like"===F?"text-green-500":n?"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:ng.jsx(Tp,{className:"w-3 h-3"})}),ng.jsx("button",{type:"button",onClick:()=>B("dislike"),className:"p-0.5 rounded transition-colors "+("dislike"===E||"dislike"===F?"text-red-500":n?"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:ng.jsx(jp,{className:"w-3 h-3"})})]})]}),T&&"dislike"===F&&ng.jsxs("div",{className:"mt-2 w-full rounded-xl border p-3 shadow "+(n?"bg-gray-800 border-gray-700":"bg-white border-gray-200"),style:{direction:p?"rtl":"ltr"},children:[ng.jsx("textarea",{ref:_,value:R,onChange:e=>A(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key?(e.preventDefault(),D()):"Escape"===e.key&&(e.preventDefault(),O())},placeholder:C("feedbackPlaceholder"),"aria-label":C("feedbackPlaceholder"),rows:2,className:"w-full resize-none rounded-lg border px-2 py-1.5 text-xs focus:outline-none focus:ring-1 "+(n?"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:W,textAlign:p?"right":"left"}}),ng.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-1.5",children:[ng.jsx("button",{type:"button",onClick:O,className:"text-xs px-2 py-1 rounded transition-colors "+(n?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"),style:{border:"none",background:"transparent",cursor:"pointer"},children:C("cancel")}),ng.jsx("button",{type:"button",onClick:D,className:"text-xs px-2.5 py-1 rounded text-white transition-opacity hover:opacity-90",style:{backgroundColor:r||"#2563eb",border:"none",cursor:"pointer"},children:C("submit")})]})]})]})]})})},pg=({message:e,formatTime:t,userMessageBoxColor:n,primaryColor:r,resolvedUserMessageColor:o,textColor:a,userTextColor:i,fontFamily:s,userMessageBubbleFontFamily:l,userMessageBubbleFontSize:c,fontSize:u,isDark:d,isRtl:p,t:g,onRetryMessage:f})=>{const h=null!=o?o:null!=n?n:null!=r?r:"#2563eb",m=null!=i?i:null!=a?a:"#FFFFFF",b=null!=l?l:null!=s?s:"Inter",y=null!=c?c:null!=u?u:"14px",v=zd("string"==typeof e?.content?e.content:"",p);Ip(b);const w=Array.isArray(e.attachments)?e.attachments:[];return ng.jsx("div",{className:"flex gap-3 flex-row-reverse animate-in",children:ng.jsxs("div",{className:"flex flex-col items-end max-w-[75%]",children:[w.length>0&&ng.jsx("div",{className:"mb-1.5 flex flex-wrap justify-end gap-1.5",children:w.map((e,t)=>String(e.mimeType||"").startsWith("image/")&&e.url?ng.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"block rounded-md overflow-hidden",style:{maxWidth:160},title:e.filename,children:ng.jsx("img",{src:e.url,alt:e.filename||"attachment",style:{maxWidth:160,maxHeight:160,display:"block"}})},e.storageKey||t):ng.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs",style:{backgroundColor:d?"#1f2937":"#f3f4f6",color:d?"#e5e7eb":"#374151",border:"1px solid "+(d?"#374151":"#e5e7eb"),maxWidth:200},title:e.filename,children:[ng.jsx(vp,{size:12}),ng.jsx("span",{className:"truncate",style:{maxWidth:140,direction:"ltr"},children:e.filename})]},e.storageKey||t))}),e.content&&""!==e.content.trim()&&ng.jsx("div",{className:"rounded-2xl px-4 py-2.5 shadow-lg "+(v?"rounded-tl-sm":"rounded-tr-sm"),dir:"auto",style:{background:`linear-gradient(135deg, ${h} 0%, ${h}dd 100%)`,fontFamily:b,direction:v?"rtl":"ltr",textAlign:v?"right":"left"},children:ng.jsx("p",{className:"whitespace-pre-wrap break-words",dir:"auto",style:{color:m,fontFamily:b,fontSize:y,lineHeight:"1.5",textAlign:v?"right":"left",overflowWrap:"break-word",margin:0,padding:0},children:e.content})}),ng.jsxs("div",{className:"flex items-center gap-1.5 mt-1.5 px-1",children:[ng.jsx("p",{className:"text-xs leading-none "+(d?"text-gray-400":"text-gray-500"),dir:"auto",children:t(e.timestamp)}),e.content&&""!==e.content.trim()&&ng.jsx(ug,{content:e.content,isDark:d})]}),"failed"===e.status&&ng.jsxs("div",{className:"flex items-center gap-1.5 mt-1 px-1","data-testid":"message-failed-state",children:[ng.jsx("span",{className:"text-xs leading-none",style:{color:"#dc2626"},dir:"auto",children:g("messageNotDelivered")}),"function"==typeof f&&ng.jsx("button",{type:"button",onClick:()=>f(e),className:"text-xs leading-none font-medium underline",style:{color:"#dc2626"},dir:"auto",children:g("retrySend")})]})]})})},gg=({message:e,isDark:t,primaryColor:n,agentMessageBubbleColor:r,userMessageBoxColor:o,resolvedUserMessageColor:a,resolvedAgentBubbleColor:i,textColor:s,assistantTextColor:l,userTextColor:c,fontFamily:u,agentMessageBubbleFontFamily:d,agentMessageBubbleFontSize:p,userMessageBubbleFontFamily:g,userMessageBubbleFontSize:f,fontSize:h,formatTime:m,isRtl:b,onDecision:y,companyLogo:v,conciergeName:w,companyName:k,apiBaseUrl:x,getAuthToken:S,onPromptSuggestionClick:C,allowFeedback:M,provideCitations:P,onFeedback:z,headerTextColor:E,onRetryMessage:j,defaultLanguage:T="en"})=>{const N=I.useMemo(()=>jd(T),[T]);return e?"user"===e.role?ng.jsx(pg,{message:e,formatTime:m,userMessageBoxColor:o,primaryColor:n,resolvedUserMessageColor:a,textColor:s,userTextColor:c,fontFamily:u,userMessageBubbleFontFamily:g,userMessageBubbleFontSize:f,fontSize:h,isDark:t,isRtl:b,t:N,onRetryMessage:j}):ng.jsx(dg,{message:e,formatTime:m,isDark:t,primaryColor:n,agentMessageBubbleColor:r,resolvedAgentBubbleColor:i,textColor:s,assistantTextColor:l,fontFamily:u,agentMessageBubbleFontFamily:d,agentMessageBubbleFontSize:p,fontSize:h,isRtl:b,onDecision:y,companyLogo:v,conciergeName:w,companyName:k,apiBaseUrl:x,getAuthToken:S,onPromptSuggestionClick:C,allowFeedback:M,provideCitations:P,onFeedback:z,headerTextColor:E,t:N}):null};var fg=I.memo(gg);const hg=(e,t,n)=>Number.isNaN(e)?t:Math.min(Math.max(e,t),n),mg=e=>{if(!e)return null;const t=(e=>e?.trim().toLowerCase()??"")(e),n=(e=>{const t=e.match(/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i);if(!t)return null;let n=t[1];3===n.length&&(n=n.split("").map(e=>`${e}${e}`).join(""));const r=parseInt(n.slice(0,2),16),o=parseInt(n.slice(2,4),16),a=parseInt(n.slice(4,6),16);return[r,o,a].some(e=>Number.isNaN(e))?null:{r:r,g:o,b:a}})(t);if(n)return n;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:hg(Number.parseInt(t[1],10),0,255),g:hg(Number.parseInt(t[2],10),0,255),b:hg(Number.parseInt(t[3],10),0,255)}:null})(t);return r||null},bg=({r:e,g:t,b:n})=>{const r=e=>{const t=hg(Math.round(e),0,255).toString(16);return 1===t.length?`0${t}`:t};return`#${r(e)}${r(t)}${r(n)}`},yg=(e,t,n)=>{const r=hg(n,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)}},vg=(e,t)=>{const n=hg(t,0,1);return`rgba(${hg(Math.round(e.r),0,255)}, ${hg(Math.round(e.g),0,255)}, ${hg(Math.round(e.b),0,255)}, ${n})`},wg={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)"},kg={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)"},xg=(e,t)=>{const n=mg(e);if(!n)return(e=>e?kg:wg)(t);const r=(({r:e,g:t,b:n})=>{const r=[e,t,n].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]})(n),o=mg("#0f172a")??{r:15,g:23,b:42},a=mg(t?"#f8fafc":"#f9fafb")??{r:249,g:250,b:251},i=mg(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=yg(n,o,e),l=yg(n,o,r)}else if(r<=.35){const e=t?.9:.8,r=Math.min(1,e+(t?.05:.12));s=yg(n,a,e),l=yg(n,a,r)}else{const e=t?.45:.6,r=Math.min(1,e+.1);s=yg(n,i,e),l=yg(n,i,r)}const c=yg(n,s,.65),u=yg(n,l,.7),d=`0 4px 12px ${vg(n,t?.28:.12)}`,p=`0 6px 20px ${vg(n,t?.35:.18)}`;return{background:bg(s),hoverBackground:bg(l),border:bg(c),hoverBorder:bg(u),shadow:d,hoverShadow:p}},Sg=({questions:e,isDark:t,palette:n,resolvedTextColor:r,fontFamily:o,fontSize:a,isRtl:i,onQuestionClick:s,applyHoverState:l,headingLabel:c})=>{const u=I.useRef(null),[d,p]=I.useState(!1),[g,f]=I.useState(!1),h=I.useCallback(()=>{const e=u.current;if(!e)return;const{scrollLeft:t,scrollWidth:n,clientWidth:r}=e;p(Math.abs(t)>1),f(Math.abs(t)+r<n-1)},[]);I.useEffect(()=>{h();const e=u.current;if(!e)return;const t=new ResizeObserver(h);return t.observe(e),()=>t.disconnect()},[h,e]);const m=I.useCallback(e=>{const t=u.current;if(!t)return;const n="left"===e?-150:150;t.scrollBy({left:i?-n:n,behavior:"smooth"})},[i]),b=t?"rgba(31,41,55,0.85)":"rgba(255,255,255,0.85)",y=t?"#e5e7eb":"#374151",v=t?"#4b5563":"#d1d5db";return ng.jsxs("div",{className:"px-4 py-4 border-t "+(t?"border-gray-700/50":"border-gray-200/60"),children:[ng.jsxs("div",{className:"text-xs mb-3 font-semibold tracking-wide uppercase "+(t?"text-gray-400":"text-gray-500"),children:[c||"Quick questions",":"]}),ng.jsxs("div",{className:"flex items-center gap-1.5",children:[ng.jsx("button",{onClick:()=>m("left"),disabled:!d,"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:b,border:`1px solid ${v}`,color:y,backdropFilter:"blur(4px)",opacity:d?1:.35,cursor:d?"pointer":"default"},children:ng.jsx(fp,{size:16})}),ng.jsx("div",{ref:u,onScroll:h,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 c=zd(e,i);return ng.jsxs("button",{onClick:()=>s?.(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 "+(c?"text-right":"text-left"),style:{direction:c?"rtl":"ltr",backgroundColor:n.background,border:`1.5px solid ${n.border}`,boxShadow:n.shadow},onMouseEnter:e=>{l(e.currentTarget,!0),e.currentTarget.style.transform="translateY(-2px)"},onMouseLeave:e=>{l(e.currentTarget,!1),e.currentTarget.style.transform="translateY(0)"},children:[ng.jsx("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"}),ng.jsx("span",{className:"relative z-10",style:{direction:c?"rtl":"ltr",color:r,fontFamily:o,fontSize:a,textAlign:c?"right":"left"},children:e})]},t)})}),ng.jsx("button",{onClick:()=>m("right"),disabled:!g,"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:b,border:`1px solid ${v}`,color:y,backdropFilter:"blur(4px)",opacity:g?1:.35,cursor:g?"pointer":"default"},children:ng.jsx(hp,{size:16})})]})]})},Cg=({questions:e=[],isDark:t=!1,primaryColor:n="#2563eb",onQuestionClick:r,isTyping:o=!1,layout:a="vertical",fontFamily:i="Inter",fontSize:s="14px",textColor:l,isRtl:c=!1,questionTextColor:u,questionBoxColor:d,headingLabel:p})=>{if(!e.length||o)return null;const g=u??l??(t?"#f3f4f6":"#111827"),f=I.useMemo(()=>xg(g,t),[g,t]),h=(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};if("horizontal"===a)return ng.jsx(Sg,{questions:e,isDark:t,palette:f,resolvedTextColor:g,fontFamily:i,fontSize:s,isRtl:c,onQuestionClick:r,applyHoverState:h,headingLabel:p});const m=u??l??(t?"#f3f4f6":"#1A1A1A");return ng.jsxs("div",{style:{paddingInlineStart:"50px"},children:[p?ng.jsx("div",{className:"mb-2",style:{color:t?"#9ca3af":"#6b7280",fontFamily:i,fontSize:`calc(${s} - 1px)`},children:p}):null,ng.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((e,o)=>{const a=zd(e,c);return ng.jsx("button",{onClick:()=>r?.(e),className:"transition-all duration-200 active:scale-[0.97]",style:{direction:a?"rtl":"ltr",fontFamily:i,fontSize:s,color:m,backgroundColor:t?"transparent":"#ffffff",border:`1.5px solid ${n}`,borderRadius:"9999px",padding:"5px 14px",fontWeight:500,lineHeight:"1.4",whiteSpace:"normal",textAlign:a?"right":"left"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=`${n}14`},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t?"transparent":"#ffffff"},children:e},o)})})]})},Mg=({active:e=!1,processing:t=!1,deviceId:n,barWidth:r=3,barGap:o=1,barRadius:a=1.5,barColor:i,fadeEdges:s=!0,fadeWidth:l=24,barHeight:c=4,height:u=64,sensitivity:d=1,smoothingTimeConstant:p=.8,fftSize:g=256,historySize:f=60,updateRate:h=30,mode:m="static",onError:b,onStreamReady:y,onStreamEnd:v,className:w,...k})=>{const x=I.useRef(null),S=I.useRef(null),C=I.useRef([]),M=I.useRef(null),P=I.useRef(null),z=I.useRef(null),E=I.useRef(0),j=I.useRef(0),T=I.useRef(null),N=I.useRef([]),F=I.useRef(0),L=I.useRef([]),R=I.useRef(!0),A=I.useRef(null),_=I.useRef(0),B="number"==typeof u?`${u}px`:u;return I.useEffect(()=>{const e=x.current,t=S.current;if(!e||!t)return;const n=new ResizeObserver(()=>{const n=t.getBoundingClientRect(),r=window.devicePixelRatio||1;e.width=n.width*r,e.height=n.height*r,e.style.width=`${n.width}px`,e.style.height=`${n.height}px`;const o=e.getContext("2d");o&&o.scale(r,r),A.current=null,_.current=n.width,R.current=!0});return n.observe(t),()=>n.disconnect()},[]),I.useEffect(()=>{if(t&&!e){let e=0;F.current=0;const t=()=>{e+=.03,F.current=Math.min(1,F.current+.02);const n=[],a=Math.floor((S.current?.getBoundingClientRect().width||200)/(r+o));if("static"===m){const t=Math.floor(a/2);for(let r=0;r<a;r++){const o=(r-t)/t,a=1-.4*Math.abs(o),i=(.2+(.25*Math.sin(1.5*e+3*o)+.2*Math.sin(.8*e-2*o)+.15*Math.cos(2*e+o)))*a;let s=i;if(N.current.length>0&&F.current<1){const e=Math.min(r,N.current.length-1);s=(N.current[e]||0)*(1-F.current)+i*F.current}n.push(Math.max(.05,Math.min(1,s)))}}else for(let t=0;t<a;t++){const r=(t-a/2)/(a/2),o=1-.4*Math.abs(r),i=(.2+(.25*Math.sin(1.5*e+.15*t)+.2*Math.sin(.8*e-.1*t)+.15*Math.cos(2*e+.05*t)))*o;let s=i;if(N.current.length>0&&F.current<1){const e=Math.floor(t/a*N.current.length);s=(N.current[e]||0)*(1-F.current)+i*F.current}n.push(Math.max(.05,Math.min(1,s)))}"static"===m?L.current=n:C.current=n,R.current=!0,T.current=requestAnimationFrame(t)};return t(),()=>{T.current&&cancelAnimationFrame(T.current)}}if(!e&&!t){if("static"===m?L.current.length>0:C.current.length>0){let e=0;const t=()=>{e+=.03,e<1?("static"===m?L.current=L.current.map(t=>t*(1-e)):C.current=C.current.map(t=>t*(1-e)),R.current=!0,requestAnimationFrame(t)):"static"===m?L.current=[]:C.current=[]};t()}}},[t,e,r,o,m]),I.useEffect(()=>{if(!e)return z.current&&(z.current.getTracks().forEach(e=>e.stop()),z.current=null,v?.()),P.current&&"closed"!==P.current.state&&(P.current.close(),P.current=null),void(E.current&&(cancelAnimationFrame(E.current),E.current=0));return(async()=>{try{const e=await navigator.mediaDevices.getUserMedia({audio:n?{deviceId:{exact:n},echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});z.current=e,y?.(e);const t=new(window.AudioContext||window.webkitAudioContext),r=t.createAnalyser();r.fftSize=g,r.smoothingTimeConstant=p;t.createMediaStreamSource(e).connect(r),P.current=t,M.current=r,C.current=[]}catch(e){b?.(e)}})(),()=>{z.current&&(z.current.getTracks().forEach(e=>e.stop()),z.current=null,v?.()),P.current&&"closed"!==P.current.state&&(P.current.close(),P.current=null),E.current&&(cancelAnimationFrame(E.current),E.current=0)}},[e,n,g,p,b,y,v]),I.useEffect(()=>{const n=x.current;if(!n)return;const u=n.getContext("2d");if(!u)return;let p;const g=b=>{const y=n.getBoundingClientRect();if(e&&b-j.current>h&&(j.current=b,M.current)){const e=new Uint8Array(M.current.frequencyBinCount);if(M.current.getByteFrequencyData(e),"static"===m){const t=Math.floor(.05*e.length),n=Math.floor(.4*e.length),a=e.slice(t,n),i=Math.floor(y.width/(r+o)),s=Math.floor(i/2),l=[];for(let e=s-1;e>=0;e--){const t=Math.floor(e/s*a.length),n=Math.min(1,a[t]/255*d);l.push(Math.max(.05,n))}for(let e=0;e<s;e++){const t=Math.floor(e/s*a.length),n=Math.min(1,a[t]/255*d);l.push(Math.max(.05,n))}L.current=l,N.current=l}else{let t=0;const n=Math.floor(.05*e.length),r=Math.floor(.4*e.length),o=e.slice(n,r);for(let e=0;e<o.length;e++)t+=o[e];const a=t/o.length/255*d;C.current.push(Math.min(1,Math.max(.05,a))),N.current=[...C.current],C.current.length>f&&C.current.shift()}R.current=!0}if(!R.current&&!e)return void(p=requestAnimationFrame(g));R.current=e,u.clearRect(0,0,y.width,y.height);const v=i||getComputedStyle(n).color||"#000",w=r+o,k=Math.floor(y.width/w),x=y.height/2;if("static"===m){const n=t||e||L.current.length>0?L.current:[];for(let e=0;e<k&&e<n.length;e++){const t=n[e]||.1,o=e*w,i=Math.max(c,t*y.height*.8),s=x-i/2;u.fillStyle=v,u.globalAlpha=.4+.6*t,a>0?(u.beginPath(),u.roundRect(o,s,r,i,a),u.fill()):u.fillRect(o,s,r,i)}}else for(let e=0;e<k&&e<C.current.length;e++){const t=C.current.length-1-e,n=C.current[t]||.1,o=y.width-(e+1)*w,i=Math.max(c,n*y.height*.8),s=x-i/2;u.fillStyle=v,u.globalAlpha=.4+.6*n,a>0?(u.beginPath(),u.roundRect(o,s,r,i,a),u.fill()):u.fillRect(o,s,r,i)}if(s&&l>0&&y.width>0){if(!A.current||_.current!==y.width){const e=u.createLinearGradient(0,0,y.width,0),t=Math.min(.3,l/y.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)"),A.current=e,_.current=y.width}u.globalCompositeOperation="destination-out",u.fillStyle=A.current,u.fillRect(0,0,y.width,y.height),u.globalCompositeOperation="source-over"}u.globalAlpha=1,p=requestAnimationFrame(g)};return p=requestAnimationFrame(g),()=>{p&&cancelAnimationFrame(p)}},[e,t,d,h,f,r,c,o,a,i,s,l,m]),ng.jsxs("div",{className:_d("relative h-full w-full",w),ref:S,style:{height:B},"aria-label":e?"Live audio waveform":t?"Processing audio":"Audio waveform idle",role:"img",...k,children:[!e&&!t&&ng.jsx("div",{className:"border-muted-foreground/20 absolute top-1/2 right-0 left-0 -translate-y-1/2 border-t-2 border-dotted"}),ng.jsx("canvas",{className:"block h-full w-full",ref:x,"aria-hidden":"true"})]})};function Pg(e){if(!e||"user"===e.role)return null;const t=e.metadata?.senderName;return"string"==typeof t&&t.trim()?t.trim():null}const zg=I.createContext(void 0);function Eg(e,t){for(let n=t+1;n<(e||[]).length;n+=1){const t=e[n];if("user"===t?.role&&!t.sendFailed)return"string"==typeof t.content?t.content:String(t.content??"")}}const jg=({messages:e=[],isDark:t,primaryColor:n,isLoading:r,agentMessageBubbleColor:o,userMessageBoxColor:a,textColor:i,assistantTextColor:s,userTextColor:l,fontFamily:c,agentMessageBubbleFontFamily:u,agentMessageBubbleFontSize:d,userMessageBubbleFontFamily:p,userMessageBubbleFontSize:g,fontSize:f,formatTime:h,isRtl:m=!1,defaultLanguage:b="en",quickQuestions:y=[],shouldShowQuickQuestions:v=!1,onQuickQuestion:w,quickQuestionsLayout:k="vertical",onDecision:x,disclaimerEnabled:S=!1,disclaimerText:C,disclaimerPosition:M="top",disclaimerLinkUrl:P,disclaimerLinkLabel:z,resolvedAgentBubbleColor:E,resolvedUserMessageColor:j,resolvedTextColor:T,isVoiceSessionActive:N=!1,voiceStatus:F="idle",messagesContainerRef:L,companyLogo:R,chatbotAvatarEnabled:A,chatbotAvatar:_,conciergeName:B,companyName:D,apiBaseUrl:O,getAuthToken:$,onPromptSuggestionClick:U,conversationResetKey:V,allowFeedback:H,provideCitations:W,onFeedback:q,headerTextColor:Q,onRetryMessage:K,beforePromptsSlot:Y=null,promptsSlot:G=null,quickQuestionsHeadingLabel:J})=>{const X=I.useRef(null),Z=I.useRef(!0),ee=I.useRef(!1),te=I.useMemo(()=>e.map(e=>`${e.id}:${e.content?.length??0}:${e.isProcessing?1:0}`).join("|"),[e]),ne=I.useCallback(()=>{const e=L?.current;if(!e)return;const t=e.scrollHeight-e.scrollTop-e.clientHeight;Z.current=t<160},[L]);I.useEffect(()=>{const e=L?.current;if(e)return e.addEventListener("scroll",ne,{passive:!0}),ne(),()=>{e.removeEventListener("scroll",ne)}},[ne,L]),I.useEffect(()=>{V&&(Z.current=!0,ee.current=!1)},[V]),I.useEffect(()=>{if(ee.current||0===e.length||"undefined"==typeof window)return;ee.current=!0;let t,n=!1;const r=window.requestAnimationFrame(()=>{n||(t=window.requestAnimationFrame(()=>{n||(X.current?.scrollIntoView({behavior:"instant",block:"end"}),Z.current=!0)}))});return()=>{n=!0,window.cancelAnimationFrame(r),window.cancelAnimationFrame(t)}},[0===e.length]),I.useEffect(()=>{if(!Z.current)return;if("undefined"==typeof window)return;let e=!1;const t=window.requestAnimationFrame(()=>{e||X.current?.scrollIntoView({behavior:"smooth",block:"end"})});return()=>{e=!0,window.cancelAnimationFrame(t)}},[te,r]),I.useEffect(()=>{if(!N||"connected"!==F)return;if("undefined"==typeof window)return;let e=!1;const t=window.requestAnimationFrame(()=>{e||X.current?.scrollIntoView({behavior:"smooth",block:"end"})});return()=>{e=!0,window.cancelAnimationFrame(t)}},[N,F]);const re=I.useMemo(()=>Ad(P),[P]),oe=I.useMemo(()=>function(e){const t=new Map;if(!Array.isArray(e))return t;const n=new Set;for(const r of e){const e=Pg(r);if(!e||!r.id)continue;const o=!n.has(e);n.add(e),t.set(r.id,{name:e,joined:o})}return t}(e),[e]),ae=I.useMemo(()=>zd(C,m),[C,m]);return ng.jsxs(ng.Fragment,{children:[S&&C&&"top"===M&&ng.jsx("div",{className:"flex justify-center",children:ng.jsx("div",{className:"rounded-lg px-2 py-1 ",style:{color:t?"#d1d5db":"#6b7280",fontFamily:null!=c?c:"Inter",fontSize:null!=f?`calc(${f} - 2px)`:"12px",direction:ae?"rtl":"ltr",textAlign:"center",borderColor:t?"#374151":"#e5e7eb"},children:ng.jsxs("p",{className:"leading-relaxed whitespace-pre-wrap break-words inline",dir:ae?"rtl":"ltr",style:{color:t?"#d1d5db":"#6b7280",fontFamily:null!=c?c:"Inter",fontSize:null!=f?`calc(${f} - 2px)`:"12px"},children:[C,re&&z&&ng.jsx("a",{href:re,target:"_blank",rel:"noopener noreferrer",title:re,style:{color:t?"#93c5fd":"#2563eb",marginInlineStart:"4px",verticalAlign:"middle",display:"inline-flex",alignItems:"center"},children:z})]})})}),e.map((r,y)=>{const v=oe.get(r.id);return ng.jsxs(zg.Provider,{value:"assistant"===r.role?Eg(e,y):void 0,children:[v?.joined&&ng.jsx("div",{role:"status","data-testid":"agent-joined-line",style:{textAlign:"center",fontSize:"12px",opacity:.7,margin:"8px 0"},children:Ed(b,"agentJoinedConversation").replace("{name}",v.name)}),v&&ng.jsx("div",{"data-testid":"agent-sender-name",style:{fontSize:"12px",fontWeight:600,opacity:.8,margin:"0 0 2px 4px",textAlign:m?"right":"left"},children:v.name}),ng.jsx(fg,{message:r,isDark:t,primaryColor:n,agentMessageBubbleColor:o,userMessageBoxColor:a,resolvedUserMessageColor:j,resolvedAgentBubbleColor:E,textColor:i,assistantTextColor:s,userTextColor:l,fontFamily:c,agentMessageBubbleFontFamily:u,agentMessageBubbleFontSize:d,userMessageBubbleFontFamily:p,userMessageBubbleFontSize:g,fontSize:f,formatTime:h,isRtl:zd(r.content,m),onDecision:x,onPromptSuggestionClick:U,companyLogo:A&&_?_:R,conciergeName:B,companyName:D,apiBaseUrl:O,getAuthToken:$,allowFeedback:H,provideCitations:W,onFeedback:q,headerTextColor:Q,onRetryMessage:K,defaultLanguage:b})]},r.id)}),(()=>{const y=e[e.length-1],v=r&&"user"===y?.role,w=e.some(e=>"assistant"===e.role&&(e.isProcessing||!e.content));return v&&!w?ng.jsx(fg,{message:nd(),isDark:t,primaryColor:n,agentMessageBubbleColor:o,resolvedAgentBubbleColor:E,userMessageBoxColor:a,textColor:i,assistantTextColor:s,userTextColor:l,fontFamily:c,agentMessageBubbleFontFamily:u,agentMessageBubbleFontSize:d,userMessageBubbleFontFamily:p,userMessageBubbleFontSize:g,fontSize:f,formatTime:h,isRtl:m,onDecision:x,companyLogo:A&&_?_:R,conciergeName:B,companyName:D,apiBaseUrl:O,getAuthToken:$,headerTextColor:Q,defaultLanguage:b},"skeleton-waiting"):null})(),Y,G?ng.jsx("div",{className:"pt-1",children:G}):v&&y.length>0&&ng.jsx("div",{className:"pt-1",children:ng.jsx(Cg,{questions:y,isDark:t,primaryColor:n,onQuestionClick:w,isTyping:r,layout:k,fontFamily:c,fontSize:f,textColor:i,isRtl:m,questionTextColor:s,questionBoxColor:o,headingLabel:J})}),N&&"connected"===F&&!r&&ng.jsx("div",{className:"flex gap-3 flex-row-reverse animate-in",children:ng.jsx("div",{className:"flex flex-col items-end max-w-[75%] w-full",children:ng.jsxs("div",{className:"rounded-2xl px-4 py-2.5 shadow-lg rounded-tr-sm w-full",style:{background:`linear-gradient(135deg, ${j||n||"#2563eb"} 0%, ${j||n||"#2563eb"}dd 100%)`,width:"100px"},children:[ng.jsx("span",{className:"sr-only",children:"Listening for voice input"}),ng.jsx(Mg,{active:!0,barWidth:2,barHeight:4,barGap:2,barColor:l||T||"#FFFFFF",height:20,fadeEdges:!0,className:"min-w-[60px]","aria-hidden":"true"})]})})}),ng.jsx("div",{ref:X,className:"h-px"})]})};function Tg(e,t){return String(e||"").replace(/\/+$/,"")+(t.startsWith("/")?t:`/${t}`)}function Ng({apiEndpoint:e,conversationId:t,size:n,authHeader:r}){fetch(Tg(e,"/api/v1/chat-attachments/release"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversationId:t,size:n})}).catch(()=>{})}function Fg({orgId:e,conversationId:t,config:n,apiEndpoint:r,authHeader:o,onError:a}){const[i,s]=I.useState([]),l=I.useRef(new Map),c=I.useRef(0),u=I.useRef(i);u.current=i;const d=I.useRef({conversationId:t,bytes:0});d.current.conversationId!==t&&(d.current={conversationId:t,bytes:0});const p=I.useCallback(()=>(c.current+=1,`att-${Date.now()}-${c.current}`),[]),g=I.useCallback((e,t)=>{s(n=>n.map(n=>n.id===e?{...n,...t}:n))},[]),f=I.useCallback((e,t,n)=>{const r={status:"error",error:{code:t,message:n}};s(t=>{const n=t.map(t=>t.id===e?{...t,...r}:t),o=n.find(t=>t.id===e);return o&&a&&a(o),n})},[a]),h=I.useCallback((e,t)=>{if(!n?.fileUploadEnabled)return{ok:!1,code:"feature_disabled",message:"File uploads are not enabled for this organization."};if(t>=n.fileUploadMaxFiles)return{ok:!1,code:"too_many_files",message:`Max ${n.fileUploadMaxFiles} files per message.`};const r=1024*n.fileUploadMaxSizeMB*1024;if(d.current.bytes+e.size>r){return{ok:!1,code:"size_exceeded",message:`This conversation has already used ${(d.current.bytes/1048576).toFixed(1)} MB of its ${n.fileUploadMaxSizeMB} MB upload limit - this file won't fit.`}}const o=(e.type||"").toLowerCase(),a=new Set((n.fileUploadAllowedMimes||[]).map(e=>String(e).toLowerCase()));return a.size>0&&!a.has(o)?{ok:!1,code:"mime_not_allowed",message:`File type "${e.type||"unknown"}" is not allowed.`}:{ok:!0}},[n]),m=I.useCallback(async(e,n)=>{let a;try{a=await fetch(Tg(r,"/api/v1/chat-attachments/presign"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...o?{Authorization:o}:{}},body:JSON.stringify({filename:n.name,mimeType:n.type,size:n.size,conversationId:t})})}catch(t){return d.current.bytes=Math.max(0,d.current.bytes-n.size),void f(e,"network","Network error while requesting upload.")}if(!a.ok){let t="Upload rejected by the server.",r="unknown";try{const e=await a.json();e?.error&&(t=e.error),e?.code&&(r=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 d.current.bytes=Math.max(0,d.current.bytes-n.size),void f(e,r,t)}let i=0;const s=()=>{i>0&&(Ng({apiEndpoint:r,conversationId:t,size:i,authHeader:o}),i=0,g(e,{reservedBytes:0}))},c=()=>{d.current.bytes=Math.max(0,d.current.bytes-n.size)};let u;try{u=await a.json()}catch{return Ng({apiEndpoint:r,conversationId:t,size:n.size,authHeader:o}),c(),g(e,{reservedBytes:0}),void f(e,"unknown","Malformed presign response.")}let p,h;("boolean"==typeof u.reserved?u.reserved:!u.useMultipart)&&(i=n.size,g(e,{reservedBytes:n.size}));try{if(u.useMultipart){const a=await function({url:e,file:t,conversationId:n,authHeader:r,onProgress:o,registerXhr:a}){return new Promise((r,i)=>{const s=new XMLHttpRequest;a(s),s.open("POST",e,!0),s.withCredentials=!0;const l=new FormData;l.append("conversationId",n),l.append("file",t,t.name),s.upload.onprogress=e=>{e.lengthComputable&&o(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:Tg(r,"/api/v1/chat-attachments/multipart"),file:n,conversationId:t,authHeader:o,onProgress:t=>g(e,{progress:t}),registerXhr:t=>l.current.set(e,t)});p=a.url,h=a.storageKey,i=n.size,g(e,{reservedBytes:n.size})}else{if(!u.uploadUrl)throw new Error("presign_missing_target");{await function({url:e,file:t,onProgress:n,registerXhr:r}){return new Promise((o,a)=>{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&&n(Math.round(e.loaded/e.total*100))},i.onload=()=>{i.status>=200&&i.status<300?o():a(new Error(`upload_status_${i.status}`))},i.onerror=()=>a(new Error("network")),i.onabort=()=>a({aborted:!0}),i.send(t)})}({url:u.uploadUrl,file:n,onProgress:t=>g(e,{progress:t}),registerXhr:t=>l.current.set(e,t)});const t=await async function({apiEndpoint:e,storageKey:t,filename:n,mimeType:r,authHeader:o}){let a;try{a=await fetch(Tg(e,"/api/v1/chat-attachments/confirm"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...o?{Authorization:o}:{}},body:JSON.stringify({storageKey:t,filename:n,mimeType:r})})}catch{return{ok:!1,code:"network",message:"Network error while verifying upload."}}if(a.ok)return{ok:!0};let i="Upload rejected - file content did not match its declared type.",s="content_mismatch";try{const e=await a.json();e?.error&&(i=e.error),"password_protected"===e?.code&&(s="password_protected")}catch{}return{ok:!1,code:s,message:i}}({apiEndpoint:r,storageKey:u.storageKey,filename:n.name,mimeType:n.type,authHeader:o});if(!t.ok)return l.current.delete(e),s(),c(),void f(e,t.code,t.message)}}}catch(t){if(l.current.delete(e),t&&t.aborted)return;return s(),c(),void f(e,"network","Upload failed. Please retry.")}l.current.delete(e),g(e,{status:"ready",progress:100,storageKey:h||u.storageKey,...p?{url:p}:{}})},[r,o,t,f,g]),b=I.useCallback(async e=>{const t=Array.from(e);for(const e of t){const t=u.current.filter(e=>"error"!==e.status).length,n=h(e,t),r=p();if(!n.ok){const t={id:r,filename:e.name,size:e.size,mimeType:e.type,status:"error",error:{code:n.code,message:n.message}};s(e=>(a&&a(t),[...e,t]));continue}const o={id:r,filename:e.name,size:e.size,mimeType:e.type,status:"uploading",progress:0,reservedBytes:0};s(e=>[...e,o]),d.current.bytes+=e.size,m(r,e)}},[h,m,p,a]),y=I.useCallback(e=>{const n=l.current.get(e);n&&(n.abort(),l.current.delete(e));const a=u.current.find(t=>t.id===e);a&&a.reservedBytes>0&&(Ng({apiEndpoint:r,conversationId:t,size:a.reservedBytes,authHeader:o}),d.current.bytes=Math.max(0,d.current.bytes-a.reservedBytes)),s(t=>t.filter(t=>t.id!==e))},[r,o,t]),v=I.useCallback(()=>{for(const e of l.current.values())e.abort();l.current.clear(),s([])},[]),w=I.useMemo(()=>i.some(e=>"validating"===e.status||"uploading"===e.status),[i]),k=I.useCallback(()=>i.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})),[i]);return{attachments:i,addFiles:b,removeAttachment:y,clearAll:v,isBusy:w,toSendPayload:k}}function Lg(e){if(!e||e<1024)return`${e||0} B`;const t=["KB","MB","GB"];let n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(n>=10?0:1)} ${t[r]}`}function Rg({attachment:e,onRemove:t,isDark:n}){const r="error"===e.status,o="uploading"===e.status,a="ready"===e.status,i=r?n?"rgba(239,68,68,0.15)":"#fee2e2":n?"#1f2937":"#f3f4f6",s=r?n?"#b91c1c":"#fca5a5":n?"#374151":"#e5e7eb",l=r?n?"#fca5a5":"#b91c1c":n?"#e5e7eb":"#374151",c=r?`${e.filename} - ${e.error?.message||"error"}`:o?`${e.filename} - uploading`:`${e.filename} - ready`;return ng.jsxs("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?ng.jsx(mp,{size:12,"aria-hidden":"true"}):o?ng.jsx(wp,{size:12,className:"animate-spin","aria-hidden":"true"}):ng.jsx(vp,{size:12,"aria-hidden":"true"}),ng.jsx("span",{className:"truncate",style:{maxWidth:140,direction:"ltr"},children:e.filename}),a&&ng.jsx("span",{className:"opacity-70 text-chip",children:Lg(e.size)}),o&&"number"==typeof e.progress&&ng.jsxs("span",{className:"opacity-70 text-chip",children:[e.progress,"%"]}),ng.jsx("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:ng.jsx(Np,{size:12})})]})}function Ag({prompts:e,getDisplayText:t,detectDirection:n,ambientIsRtl:r,wrapperProps:o,stackProps:a,getKey:i,getChipProps:s,onChipClick:l,onSelect:c,before:u,after:d}){const p=I.createElement("div",a,e.map((e,o)=>{const a=t(e),u=n(a,r);return I.createElement("button",{key:i(e,o),type:"button",...s({prompt:e,index:o,displayText:a,chipIsRtl:u}),onClick:t=>{l&&l(e,o),c(e,o,t)}},a)}));return null==u&&null==d?I.createElement("div",o,p):I.createElement("div",o,u,p,d)}const _g=({suggestions:e,onSuggestionClick:t,promptPrimary:n,promptTextColor:r,promptFontFamily:o,promptFontSize:a,isRtl:i,t:s,questionDisplay:l=!0})=>ng.jsx(Ag,{prompts:e,getDisplayText:e=>((e,t=!0)=>{if(!e||"string"==typeof e)return e||"";const n="string"==typeof e.text?e.text:"";if(!t)return n;const r="string"==typeof e.submitText?e.submitText.trim():"";return r&&r!==n?r:n})(e,l),detectDirection:zd,ambientIsRtl:i,wrapperProps:{className:"mb-2 px-5"},stackProps:{className:"flex flex-col gap-2",role:"group","aria-label":s("suggestedQuestions")},getKey:(e,t)=>`${e.text||e}-${t}`,getChipProps:({chipIsRtl:e})=>({dir:e?"rtl":"ltr",className:"block w-full rounded-2xl px-4 py-2 border-0 transition-transform duration-150 active:scale-[0.99] "+(e?"text-right":"text-left"),style:{direction:e?"rtl":"ltr",textAlign:e?"right":"left",background:`linear-gradient(135deg, ${n} 0%, ${n}dd 100%)`,color:r,fontFamily:o,fontSize:a}}),onSelect:(e,n)=>t(e.submitText||e.text||e,e,n)}),Ig=({onStopGeneration:e,inputValue:t,setInputValue:n,onSend:r,isDark:o,primaryColor:a,isOpen:i,isMinimized:s,isLoading:l,isConversationLoading:c=!1,placeholder:u,textColor:d,fontFamily:p,fontSize:g,isRtl:f=!1,csatVisible:h=!1,enableVoiceInteraction:m=!1,isVoiceSessionActive:b=!1,voiceStatus:y="idle",voiceError:v=null,onVoiceToggle:w,onBidiSubmit:k,disclaimerEnabled:x=!1,disclaimerText:S,disclaimerPosition:C="top",disclaimerLinkUrl:M,disclaimerLinkLabel:P,showPoweredBy:z=!0,onboardingQuestions:E=[],onboardingActive:j=!1,onboardingCompleted:T=!1,userMessageBubbleFontFamily:N,onboardingEnabled:F=!1,userMessageBubbleFontSize:L,userMessageBoxColor:R,resolvedUserMessageColor:A,userTextColor:_,promptSuggestions:B,onPromptSuggestionClick:D,autoPromptQuestionDisplay:O=!0,tagSelectorNode:$=null,showResolveButton:U=!1,onResolve:V,defaultLanguage:H="en",chatFeatures:W,apiEndpoint:q,organizationId:Q,conversationId:K})=>{const Y=I.useMemo(()=>jd(H),[H]),G=I.useMemo(()=>function(e){const t=Sd(e),n=wd[t]||vd;return{beforeBrand:n.poweredByBefore??n.poweredBy??vd.poweredByBefore,afterBrand:n.poweredByAfter??""}}(H),[H]),J=I.useMemo(()=>zd(t,f),[t,f]),[X,Z]=I.useState(!1),[ee,te]=I.useState(!1),ne=I.useMemo(()=>({fileUploadEnabled:W?.fileUploadEnabled??!1,fileUploadMaxSizeMB:W?.fileUploadMaxSizeMB??10,fileUploadMaxFiles:W?.fileUploadMaxFiles??3,fileUploadAllowedMimes:W?.fileUploadAllowedMimes??[]}),[W]),{attachments:re,addFiles:oe,removeAttachment:ae,clearAll:ie,isBusy:se,toSendPayload:le}=Fg({orgId:Q,conversationId:K,config:ne,apiEndpoint:q,authHeader:void 0}),ce=I.useRef(null),ue=I.useRef(new Set);I.useEffect(()=>{if(!b||!K||!q)return;const e=le().filter(e=>e.storageKey&&!ue.current.has(e.storageKey));e.length&&(e.forEach(e=>ue.current.add(e.storageKey)),fetch(`${String(q).replace(/\/$/,"")}/api/v1/chat-attachments/ingest`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversationId:K,attachments:e.map(e=>({storageKey:e.storageKey}))})}).catch(()=>{}))},[b,K,q,re,le]);const de=!!ne.fileUploadEnabled&&!!q,pe=re.length>=ne.fileUploadMaxFiles,ge=`Max ${ne.fileUploadMaxFiles} files per message.`,fe=I.useMemo(()=>ne.fileUploadAllowedMimes.length>0?ne.fileUploadAllowedMimes.join(","):void 0,[ne.fileUploadAllowedMimes]),[he,me]=I.useState({top:0,left:0,placement:"top",arrowOffset:0}),[be,ye]=I.useState(!1),ve=I.useRef(null),we=I.useRef(null),ke=I.useRef(null),xe=I.useRef(null);Ip(p),Ip(N),I.useEffect(()=>{i&&!s&&we.current?.focus()},[i,s]),I.useEffect(()=>{const e=we.current;if(e){e.style.height="auto";const n=e.scrollHeight,r=t.trim().length>0?20:48,o=Math.max(r,Math.min(n,120));e.style.height=`${o}px`}},[t]);const Se=I.useCallback(()=>{const e=le();e.length>0?(r(void 0,e),ie()):r()},[le,ie,r]),Ce=re.some(e=>"ready"===e.status),Me=!t.trim()&&!Ce||l||c||se,Pe=o?"#374151":"#e5e7eb",ze=E&&E.length>0,Ee=h||c||F&&(ze&&!T)||"connecting"===y,je=h?Y("pleaseSubmitRatingFirst"):ze?j?Y("completeOnboardingToEnableVoice"):T?"":Y("sendMessageToCompleteOnboarding"):"",Te=()=>{if(!ke.current)return;const e=ke.current.getBoundingClientRect(),t=220,n=e.top,r=window.innerHeight-e.bottom;let o="top",a=0,i=0;n>=73?(o="top",a=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?(o="bottom",a=e.bottom+8,i=e.right-t,i<10&&(i=10),i+t>window.innerWidth-10&&(i=window.innerWidth-t-10)):(o="top",a=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:a,left:i,placement:o,arrowOffset:e.left+e.width/2-i}};I.useEffect(()=>{if(ee&&je){const e=()=>{const e=Te();me(e)};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}}},[ee,je]),I.useEffect(()=>()=>{ve.current&&clearTimeout(ve.current)},[]);const Ne=null!=A?A:null!=R?R:null!=a?a:"#2563eb",Fe=null!=_?_:null!=d?d:"#FFFFFF",Le=null!=N?N:null!=p?p:"Inter",Re=null!=L?L:null!=g?g:null,Ae=Re?`calc(${Re} - 2px)`:"12px",_e=Ad(M);return ng.jsxs("div",{className:"py-4 flex-shrink-0 relative "+(o?"bg-gray-900":"bg-white"),style:{overflow:"visible"},children:[$||B.length>0&&D&&ng.jsx(_g,{suggestions:B,onSuggestionClick:D,questionDisplay:O,promptPrimary:Ne,promptTextColor:Fe,promptFontFamily:Le,promptFontSize:Ae,isRtl:f,t:Y}),ng.jsx("div",{className:"my-4",style:{height:"1px",backgroundColor:Pe}}),de&&re.length>0&&ng.jsx("div",{className:"px-5 mb-2 flex flex-wrap gap-1.5",children:re.map(e=>ng.jsx(Rg,{attachment:e,onRemove:ae,isDark:o},e.id))}),ng.jsxs("div",{className:"flex items-center px-5 gap-1.5",children:[de&&ng.jsx("input",{ref:ce,type:"file",multiple:!0,accept:fe,"aria-label":Y("uploadFile"),className:"hidden",style:{display:"none"},onChange:e=>{const t=e.target.files;t&&t.length&&!pe&&oe(t),e.currentTarget.value=""}}),ng.jsxs("div",{className:`flex-1 flex items-center gap-1 px-1 min-h-[48px] ${o?"bg-gray-800":"bg-gray-50"} rounded-2xl transition-all duration-200`,style:{borderStyle:"solid",borderColor:t&&t.trim().length>0?a||"#2563eb":Pe,borderWidth:t&&t.trim().length>0?"2px":"1px"},children:[de&&ng.jsxs("div",{className:"relative group shrink-0",children:[ng.jsx("button",{type:"button",onClick:()=>ce.current&&ce.current.click(),disabled:h||c||l||pe,"aria-label":pe?ge:"Attach file",title:pe?ge:"Attach file",className:`h-8 w-8 rounded-lg flex items-center justify-center transition-colors duration-200 ${o?"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:ng.jsx(Sp,{className:"w-4 h-4"})}),pe&&ng.jsx("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 "+(o?"bg-gray-700 text-gray-100":"bg-gray-800 text-white"),children:ge})]}),ng.jsx("div",{className:"relative flex-1 flex items-center min-w-0",children:ng.jsx("textarea",{id:"chat-widget-input",ref:we,"aria-label":u||Y("typeYourMessage"),value:t,onChange:e=>{n(e.target.value)},onFocus:()=>Z(!0),onBlur:()=>Z(!1),onKeyDown:e=>{if("Enter"===e.key&&!e.shiftKey){if(e.preventDefault(),b&&k&&!Ce)return void k();if(Me)return;Se()}},placeholder:c?Y("agentIsLoading"):u||Y("typeYourMessage"),rows:1,disabled:h||c||l||b&&"connected"!==y,dir:J?"rtl":"ltr",className:`w-full px-3 bg-transparent rounded-xl leading-normal ${o?"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:t.trim().length>0?"12px":"0px",paddingBottom:t.trim().length>0?"12px":"0px",lineHeight:t.trim().length>0?"1.4":"48px",fontFamily:N||p||"Inter",fontSize:g||"14px",color:o?"#F3F4F6":"#1F2937",textAlign:J?"right":"left",direction:J?"rtl":"ltr",wordSpacing:"0",letterSpacing:"0"}})}),m&&ng.jsxs("div",{className:"relative shrink-0",onMouseEnter:()=>{if(Ee&&je){ve.current&&(clearTimeout(ve.current),ve.current=null);const e=Te();me(e),te(!0)}},onMouseLeave:()=>{ve.current&&(clearTimeout(ve.current),ve.current=null),te(!1)},children:[ng.jsx("button",{style:{border:"none"},ref:ke,type:"button",onClick:w,"aria-label":Y(b?"stopVoiceInput":"startVoiceInput"),className:`h-8 w-8 rounded-lg flex items-center justify-center transition-colors duration-200 ${b?"bg-red-500 text-white hover:bg-red-600":o?"text-gray-300 hover:bg-gray-700":"text-gray-500 hover:bg-gray-200"} ${Ee?"opacity-60 cursor-not-allowed":""}`,disabled:Ee,children:"connecting"===y?ng.jsx(wp,{className:"w-4 h-4 animate-spin"}):ng.jsx(pp,{className:"w-4 h-4"})}),ee&&je&&"undefined"!=typeof document&&Hu.createPortal(ng.jsxs("div",{ref:xe,className:"px-3 py-1.5 text-xs shadow-md pointer-events-none",style:{position:"fixed",top:`${he.top}px`,left:`${he.left}px`,maxWidth:"220px",whiteSpace:"normal",wordWrap:"break-word",minWidth:"180px",zIndex:999999,backgroundColor:o?"#1f2937":"#ffffff",color:o?"#f3f4f6":"#111827",border:o?"1px solid #374151":"1px solid #e5e7eb",borderRadius:"top"===he.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:[ng.jsx("div",{className:"text-left leading-relaxed",children:je}),"top"===he.placement&&ng.jsxs(ng.Fragment,{children:[ng.jsx("div",{style:{position:"absolute",top:"100%",left:`${he.arrowOffset}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:o?"6px solid #374151":"6px solid #e5e7eb",pointerEvents:"none"}}),ng.jsx("div",{style:{position:"absolute",top:"100%",left:`${he.arrowOffset}px`,transform:"translateX(-50%)",marginTop:"-1px",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:o?"5px solid #1f2937":"5px solid #ffffff",pointerEvents:"none"}})]}),"bottom"===he.placement&&ng.jsxs(ng.Fragment,{children:[ng.jsx("div",{className:"absolute bottom-full",style:{left:`${he.arrowOffset}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderBottom:o?"5px solid #374151":"5px solid #e5e7eb"}}),ng.jsx("div",{className:"absolute bottom-full -mb-px",style:{left:`${he.arrowOffset}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:o?"4px solid #1f2937":"4px solid #ffffff"}})]})]}),document.body)]})]}),l&&!b&&"function"==typeof e?ng.jsx("button",{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:a,color:"white",border:"none"},"aria-label":Y("stopGenerating"),children:ng.jsx(Pp,{className:"w-3.5 h-3.5",fill:"currentColor"})}):ng.jsx("button",{onClick:b&&k&&!Ce?k:Se,disabled:h||Me||b&&"connected"!==y,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 "+(t.trim()?"scale-100":"scale-95"),style:{backgroundColor:t.trim()?a:o?"#374151":"#e5e7eb",color:t.trim()?"white":"#9ca3af",border:"none"},"aria-label":Y("sendMessage"),children:ng.jsx(Mp,{className:"w-4 h-4 transition-transform",style:f?{transform:"rotate(-90deg)"}:void 0})})]}),b&&ng.jsxs("p",{"aria-live":"polite",className:`text-xs mt-2 px-5 ${"connected"===y?"text-status-success":"text-gray-500"} flex items-center gap-1`,children:[ng.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current inline-flex"}),Y("connected"===y?"voiceSessionLive":"connectingVoice")]}),v&&ng.jsx("p",{role:"alert",className:"text-xs mt-1 px-5 text-status-error",children:Y(v)===v?Y("voiceUnavailable"):Y(v)}),x&&S&&"footer"===C&&ng.jsxs("p",{className:"text-xs mt-2 px-5 text-center",style:{color:o?"#d1d5db":"#6b7280",fontFamily:p||"Inter",fontSize:g?`calc(${g} - 2px)`:"12px",direction:f?"rtl":"ltr"},dir:f?"rtl":"ltr",children:[S,_e&&P&&ng.jsx("a",{href:_e,target:"_blank",rel:"noopener noreferrer",title:_e,style:{color:o?"#93c5fd":"#2563eb",marginInlineStart:"4px",verticalAlign:"middle",display:"inline-flex",alignItems:"center"},children:P})]}),z&&ng.jsx("div",{className:"mt-1.5 flex justify-center",children:ng.jsx("a",{href:"https://eshal.ai",target:"_blank",rel:"noopener noreferrer",className:"no-underline",children:ng.jsxs("span",{dir:"ltr",className:"inline-flex items-center gap-1.5 py-1.5 px-3",children:[G.beforeBrand&&ng.jsx("span",{className:_d("font-sans text-[10px] font-medium",o?"text-gray-400":"text-gray-500"),children:G.beforeBrand}),be?ng.jsx("span",{className:_d("font-sans text-[10px] font-semibold",o?"text-gray-300":"text-gray-600"),children:"ESHAL"}):ng.jsx("img",{src:o?"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:_d("h-3",o?"opacity-60":"opacity-50"),onError:()=>ye(!0)}),G.afterBrand&&ng.jsx("span",{className:_d("font-sans text-[10px] font-medium",o?"text-gray-400":"text-gray-500"),children:G.afterBrand})]})})})]})},Bg=["sun","mon","tue","wed","thu","fri","sat"];function Dg(e){if(!e||"string"!=typeof e)return null;const t=e.match(/^(\d{1,2}):(\d{2})/);if(!t)return null;const n=parseInt(t[1],10),r=parseInt(t[2],10);return Number.isNaN(n)||Number.isNaN(r)?null:60*n+r}function Og(e,t=new Date,n={}){if(!e||!e.showStatus)return null;const r=n.online||"Online now",o=n.officeOpen||"Online now",a=n.offlineFallback||"Offline";if("officeHours"!==e.statusMode)return{online:!0,label:r};const i=e.officeHours||{},{dayKey:s,minutes:l}=function(e,t){try{const n=new Intl.DateTimeFormat("en-US",{timeZone:e||void 0,weekday:"short",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),r=(n.find(e=>"weekday"===e.type)||{}).value||"";let o=parseInt((n.find(e=>"hour"===e.type)||{}).value||"0",10);const a=parseInt((n.find(e=>"minute"===e.type)||{}).value||"0",10);return 24===o&&(o=0),{dayKey:r.slice(0,3).toLowerCase(),minutes:60*o+a}}catch{return{dayKey:Bg[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()):[],u=Dg(i.open),d=Dg(i.close);if(c.includes(s)&&(null!=u&&null!=d&&(u<=d?l>=u&&l<d:l>=u||l<d))){return{online:!0,label:(i.onlineMessage||"").trim()||o}}return{online:!1,label:(i.offlineMessage||"").trim()||a}}const $g=({conciergeName:e,companyName:t,companyLogo:n,primaryColor:r,isDark:o,isMinimized:a=!1,textColor:i,fontFamily:s,fontSize:l,onToggleTheme:c,onMinimize:u,onClose:d,headerTextBold:p=!1,headerTextItalic:g=!1,headerTextColor:f,headerFontFamily:h,headerFontSize:m,subtitle:b=null,showStatus:y=!1,statusMode:v="always",officeHours:w=null,onRefreshChat:k,onCopyChat:x,defaultLanguage:S="en"})=>{const C=r,M=f||"#FFFFFF",P=h||s||"Inter",z=m||l;Ip(P);const E=I.useMemo(()=>jd(S),[S]),j=Cd(S),T=I.useMemo(()=>zd(b,j),[b,j]),N=I.useMemo(()=>Og({showStatus:y,statusMode:v,officeHours:w}),[y,v,w]),[F,L]=I.useState(!1),R=I.useRef(null),A=I.useRef(null);I.useEffect(()=>{if(!F)return;const e=e=>{R.current&&!e.composedPath().includes(R.current)&&L(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[F]);const _=I.useRef(!1);I.useEffect(()=>{if(F){_.current=!0;const e=R.current?.querySelector('[role="menuitem"]');e?.focus()}else _.current&&(_.current=!1,A.current?.focus())},[F]);const B=M;return ng.jsxs("div",{className:`text-white ${a?"px-4 py-2.5":"px-3 py-4"} flex items-center justify-between relative overflow-visible rounded-t-2xl z-[60]`,style:{background:C,fontFamily:P},children:[ng.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 pl-1",children:[ng.jsxs("div",{className:"relative w-11 h-11 flex-shrink-0",children:[ng.jsx("div",{className:"w-full h-full rounded-full overflow-hidden flex items-center justify-center bg-white/20",children:n?ng.jsx("img",{src:n,alt:"Logo",style:{display:"block",width:"100%",height:"100%",objectFit:"contain"},loading:"lazy"}):ng.jsx("span",{className:"text-lg font-semibold leading-none",style:{color:B},children:(e||t||"")?.charAt(0)?.toUpperCase()})}),N?ng.jsx("span",{title:N.label,className:_d("absolute bottom-0 h-3 w-3 rounded-full ring-2 ring-white",j?"left-0":"right-0"),style:{backgroundColor:N.online?"#22c55e":"#9ca3af",boxShadow:N.online?"0 0 0 3px rgba(34,197,94,0.25)":"none"},"aria-hidden":"true"}):null]}),ng.jsxs("div",{className:"flex flex-col justify-center min-w-0",style:{fontFamily:P},children:[ng.jsx("h3",{title:e,className:_d("font-semibold leading-snug truncate",p&&"font-bold",g&&"italic"),style:{fontSize:z?`calc(${z} + 2px)`:"15px",color:B},children:e}),b?ng.jsx("p",{title:b,className:"leading-snug truncate opacity-75",dir:T?"rtl":"ltr",style:{fontSize:"12px",color:B,textAlign:T?"right":"left"},children:b}):null]})]}),ng.jsxs("div",{className:"flex items-center gap-0 relative z-10 text-white flex-shrink-0 ml-1",children:[ng.jsxs("div",{className:"relative",ref:R,children:[ng.jsx("button",{type:"button",ref:A,"aria-label":E("menu"),"aria-expanded":F,"aria-haspopup":"true",onClick:()=>L(e=>!e),onKeyDown:e=>{"Escape"===e.key&&F&&(e.preventDefault(),L(!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:B},children:ng.jsx(yp,{className:"w-4 h-4",strokeWidth:1.6})}),F&&ng.jsxs("div",{role:"menu","aria-label":E("menu"),dir:j?"rtl":"ltr",onKeyDown:e=>{if("Escape"===e.key)return e.preventDefault(),void L(!1);if("Tab"===e.key){const t=R.current?Array.from(R.current.querySelectorAll('[role="menuitem"]')):[];if(0===t.length)return;const n=t[0],r=t[t.length-1],o=document.activeElement;e.shiftKey&&o===n?(e.preventDefault(),r.focus()):e.shiftKey||o!==r||(e.preventDefault(),n.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 ${j?"left-0":"right-0"} ${o?"bg-gray-800 border-gray-700":"bg-white border-gray-200"}`,style:{fontFamily:P},children:[ng.jsxs("button",{role:"menuitem",onClick:()=>{L(!1),k?.()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm leading-5 transition-colors cursor-pointer "+(o?"text-gray-200 hover:bg-gray-700":"text-gray-700 hover:bg-gray-50"),style:{fontFamily:P,fontSize:"14px",border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",textAlign:j?"right":"left"},children:[ng.jsx(Cp,{className:"w-3.5 h-3.5 flex-shrink-0"}),E("refreshChat")]}),ng.jsxs("button",{role:"menuitem",onClick:()=>{L(!1),x?.()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm leading-5 transition-colors cursor-pointer "+(o?"text-gray-200 hover:bg-gray-700":"text-gray-700 hover:bg-gray-50"),style:{fontFamily:P,fontSize:"14px",border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",textAlign:j?"right":"left"},children:[ng.jsx(bp,{className:"w-3.5 h-3.5 flex-shrink-0"}),E("copyChat")]}),ng.jsxs("button",{role:"menuitem",onClick:()=>{L(!1),c?.()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm leading-5 transition-colors cursor-pointer "+(o?"text-gray-200 hover:bg-gray-700":"text-gray-700 hover:bg-gray-50"),style:{fontFamily:P,fontSize:"14px",border:"none",background:"transparent",appearance:"none",WebkitAppearance:"none",textAlign:j?"right":"left"},children:[o?ng.jsx(Ep,{className:"w-3.5 h-3.5 flex-shrink-0"}):ng.jsx(xp,{className:"w-3.5 h-3.5 flex-shrink-0"}),E(o?"lightMode":"nightMode")]})]})]}),ng.jsx("button",{type:"button","aria-label":E("close"),onClick:d,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:B},children:ng.jsx(Np,{className:"w-3.5 h-3.5",strokeWidth:1.6})})]})]})},Ug=({questions:e=[],collapsiblePrompt:t,onSubmit:n,primaryColor:r="#2563eb",isRtl:o=!1,isDark:a=!1,defaultLanguage:i="en",fontFamily:s})=>{const l=I.useMemo(()=>jd(i),[i]),[c,u]=I.useState({}),[d,p]=I.useState({}),[g,f]=I.useState(!1),h=I.useRef({}),m=[...e].sort((e,t)=>Bd(e.fieldType)-Bd(t.fieldType));return ng.jsx("div",{className:"flex flex-col items-center justify-center p-6 h-full min-h-0 z-50 relative ",style:{...s?{fontFamily:s}:{},...a?{backgroundColor:"#10141C"}:{}},children:ng.jsxs("div",{className:"w-full max-w-sm rounded-2xl shadow-xl border p-8 transition-colors duration-300 bg-white border-gray-100",style:a?{backgroundColor:"#1E232B",border:"1px solid #2A303C"}:void 0,children:[t&&ng.jsx("div",{className:"mb-4 text-start",children:ng.jsx("h3",{className:"transition-colors duration-300 text-sm font-semibold mb-1 "+(a?"text-white":"text-[#4A5568]"),children:t})}),ng.jsxs("form",{onSubmit:async e=>{e.preventDefault();const t=(()=>{const e={};return m.forEach(t=>{const n=t.fieldType||"question",r=(c[n]??"").trim(),o=t.collectionPrompt||t.askToType||t.question||t.label||n,a=!0===t.required||"true"===t.required;r?("fullName"!==n&&"name"!==n||r.length<2&&(e[n]=l("nameInvalid")),"email"!==n||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)||(e[n]=l("emailInvalid")),"phone"!==n&&"mobileno"!==n||/^[+]?[\d\s-]{8,15}$/.test(r)||(e[n]=l("phoneInvalid"))):a&&(e[n]="email"===n?l("emailRequired"):"fullName"===n||"name"===n?l("nameRequired"):"phone"===n||"mobileno"===n?l("phoneRequired"):`${o} ${l("fieldRequiredSuffix")}`)}),p(e),e})();if(Object.keys(t).length>0){const e=m.map((e,t)=>e.fieldType||`question_${t}`).find(e=>t[e]);return void h.current[e]?.focus()}f(!0);try{await n(c)}finally{f(!1)}},className:"space-y-4",noValidate:!0,children:[m.map((e,t)=>{const n=e.fieldType||`question_${t}`,r=e.collectionPrompt||e.askToType||e.question||e.label;if(!r?.trim())return null;let i="text";"email"===n&&(i="email"),"phone"!==n&&"mobileno"!==n||(i="tel");const s=(n||"").toLowerCase(),g="fullname"===s||"name"===s||"username"===s,f="phone"===s||"mobileno"===s,m="email"===s?l("onboardingEmailPlaceholder"):g?l("onboardingNamePlaceholder"):f?l("onboardingPhonePlaceholder"):r,b=d[n],y="w-full h-12 rounded-xl text-base px-3 outline-none border transition-colors focus:ring-0 "+(a?"text-white placeholder:text-[#A2A9B2] focus:border-[#5A6069]":"bg-white text-gray-900 placeholder:text-[#8C8C8C] focus:border-[#B0B0B0]"),v=b?"!border-status-error focus:!border-status-error":"",w=`onboarding-field-${n}`,k=`${w}-error`;return ng.jsxs("div",{className:"space-y-1",children:[ng.jsx("label",{htmlFor:w,className:"sr-only",children:r}),ng.jsx("input",{id:w,ref:e=>{h.current[n]=e},placeholder:m,type:i,value:c[n]??"",onChange:e=>((e,t)=>{u(n=>({...n,[e]:t})),d[e]&&p(t=>{const n={...t};return delete n[e],n})})(n,e.target.value),className:`${y} ${v}`,"aria-invalid":b?"true":"false","aria-describedby":b?k:void 0,style:{direction:o?"rtl":"ltr",fontFamily:"inherit",...a?{backgroundColor:"#272C35",borderWidth:"1px",borderStyle:"solid",borderColor:b?void 0:"#3F444C"}:{borderWidth:"1px",borderStyle:"solid",borderColor:b?void 0:"#E0E0E0"}}}),b&&ng.jsx("p",{id:k,role:"alert",className:"text-xs text-status-error px-1",children:d[n]})]},n)}),ng.jsx("button",{type:"submit",disabled:g,"aria-busy":g,"aria-label":g?l("submitting"):void 0,className:"w-full h-12 inline-flex items-center justify-center 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:r,fontFamily:"inherit"},children:g?ng.jsx(wp,{className:"w-5 h-5 animate-spin","aria-hidden":"true"}):l("startChat")})]})]})})},Vg=({categories:e=[],selectedCategoryId:t=null,onSelect:n,isDark:r=!1,primaryColor:o="#2563eb",fontFamily:a="Inter",isRtl:i=!1})=>{const s=I.useRef(null),[l,c]=I.useState(!1),[u,d]=I.useState(!1),p=I.useCallback(()=>{const e=s.current;if(!e)return;const{scrollLeft:t,scrollWidth:n,clientWidth:r}=e;c(Math.abs(t)>1),d(Math.abs(t)+r<n-1)},[]);I.useEffect(()=>{p();const e=s.current;if(!e)return;const t=new ResizeObserver(p);return t.observe(e),()=>t.disconnect()},[p,e]);const g=I.useCallback(e=>{const t=s.current;if(!t)return;const n="left"===e?-150:150;t.scrollBy({left:i?-n:n,behavior:"smooth"})},[i]);if(!Array.isArray(e)||0===e.length)return null;const f=r?"rgba(31,41,55,0.85)":"rgba(255,255,255,0.95)",h=r?"#e5e7eb":"#374151",m=r?"#4b5563":"#d1d5db",b=r?"#111827":"#ffffff",y=r?"#374151":"#e5e7eb";return ng.jsxs("div",{className:"flex-shrink-0 px-2 py-2 border-b flex items-center gap-1",style:{backgroundColor:b,borderColor:y,fontFamily:a,direction:i?"rtl":"ltr"},role:"region","aria-label":"Filter by category",children:[ng.jsx("button",{type:"button",onClick:()=>g("left"),disabled:!l,"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:f,border:`1px solid ${m}`,color:h,opacity:l?1:.3,cursor:l?"pointer":"default"},children:ng.jsx(fp,{size:14})}),ng.jsx("div",{ref:s,onScroll:p,className:"flex-1 flex gap-2 overflow-x-auto",style:{scrollBehavior:"smooth",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map(e=>{const i=t===e.id;return ng.jsx("button",{type:"button",onClick:()=>n?.(i?null:e.id),"aria-pressed":i,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:r?"#1f2937":"#ffffff",border:i?`1.5px solid ${o}`:"1px solid "+(r?"#374151":"#e5e7eb"),color:i?o:r?"#e5e7eb":"#374151",fontFamily:a},children:ng.jsx("span",{children:e.label})},e.id)})}),ng.jsx("button",{type:"button",onClick:()=>g("right"),disabled:!u,"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:f,border:`1px solid ${m}`,color:h,opacity:u?1:.3,cursor:u?"pointer":"default"},children:ng.jsx(hp,{size:14})})]})},Hg=({categories:e=[],selectedCategoryId:t=null,onSelect:n,isDark:r=!1,primaryColor:o="#2563eb",fontFamily:a="Inter",fontSize:i="14px",isRtl:s=!1,label:l="Choose a topic to get started:"})=>{if(!Array.isArray(e)||0===e.length)return null;const c=r?"#9ca3af":"#6b7280";return ng.jsxs("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:[ng.jsx("div",{className:"mb-2",style:{color:c,fontFamily:a,fontSize:`calc(${i} - 1px)`},children:l}),ng.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(e=>{const s=t===e.id;return ng.jsx("button",{type:"button",onClick:()=>n?.(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 ${o}`:"1px solid "+(r?"#374151":"#e5e7eb"),color:s?o:r?"#e5e7eb":"#374151",fontFamily:a,fontSize:`calc(${i} - 1px)`,fontWeight:500},children:e.label},e.id)})})]})};const Wg=[{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"}],qg=[{value:"positive",label:"👍"},{value:"negative",label:"👎"}],Qg=[{value:"1",label:"1"},{value:"2",label:"2"},{value:"3",label:"3"},{value:"4",label:"4"},{value:"5",label:"5"}],Kg=[{value:"1",label:"⭐"},{value:"2",label:"⭐"},{value:"3",label:"⭐"},{value:"4",label:"⭐"},{value:"5",label:"⭐"}],Yg=({format:e="EMOJI",prompt:t="How was your experience?",onRating:n,disabled:r=!1,isDark:o=!1,primaryColor:a="#2563eb",defaultLanguage:i="en"})=>{const s=I.useMemo(()=>jd(i),[i]),[l,c]=I.useState(null),[u,d]=I.useState(null),[p,g]=I.useState(!1),f=async t=>{if(!r&&!p){c(t),g(!0);try{n&&n(t,e)}finally{g(!1)}}},h=(()=>{switch(e){case"THUMBS":return qg;case"NUMERIC":return Qg;case"STARS":return Kg;default:return Wg}})();return ng.jsxs("div",{className:_d("transition-all duration-200 rounded-xl px-4",o?"bg-slate-800/50":"bg-slate-50/50"),children:[ng.jsx("p",{className:_d("text-sm font-semibold text-center mb-3",o?"text-gray-300":"text-gray-500/80"),children:t}),ng.jsxs("div",{className:"flex justify-center items-center",children:["EMOJI"===e&&ng.jsx("div",{className:"flex gap-2 justify-center items-center",children:h.map(e=>ng.jsx("button",{onClick:()=>f(e.value),disabled:r||p,className:_d("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",l===e.value?"":"opacity-80"),children:ng.jsx("span",{role:"img","aria-label":`${s("rate")} ${e.value}`,children:e.label})},e.value))}),"THUMBS"===e&&ng.jsx("div",{className:"flex gap-6 justify-center items-center",role:"group","aria-label":s("rateExperience"),children:h.map(e=>ng.jsx("button",{"aria-label":1===e.value?s("thumbsUp"):s("thumbsDown"),onClick:()=>f(e.value),disabled:r||p,className:_d("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",o?"bg-gray-700 border-gray-600 hover:bg-gray-600":"bg-white border-gray-100 hover:bg-gray-50",l===e.value&&"ring-2 ring-primary/40 scale-110"),style:{borderColor:l===e.value?a:void 0},children:ng.jsx("span",{className:"drop-shadow-md","aria-hidden":"true",children:e.label})},e.value))}),"NUMERIC"===e&&ng.jsx("div",{className:"flex gap-2 justify-center items-center",role:"group","aria-label":s("rateExperience"),children:h.map(e=>ng.jsx("button",{"aria-label":`${s("rate")} ${e.value}`,onClick:()=>f(e.value),disabled:r||p,className:_d("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",l===e.value?"ring-2 ring-primary/40 scale-110 shadow-md text-white":o?"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:l===e.value?a:void 0,borderColor:l===e.value?a:void 0},children:e.label},e.value))}),"STARS"===e&&ng.jsx("div",{className:"flex gap-2 justify-center items-center",onMouseLeave:()=>d(null),children:h.map(e=>{const t=u===e.value;return ng.jsx("button",{onClick:()=>f(e.value),onMouseEnter:()=>d(e.value),disabled:r||p,className:_d("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":`${s("rate")} ${e.value}`,children:ng.jsx("span",{"aria-hidden":"true",children:e.label})},e.value)})})]}),p&&ng.jsx("p",{"aria-live":"polite",className:_d("text-xs mt-3 text-center",o?"text-slate-400":"text-slate-500"),children:s("submittingFeedback")})]})};async function Gg({apiBaseUrl:e,conversationId:t,chip:n,submitText:r,position:o,source:a="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:n,conversationId:r,source:o="widget"}={}){const a=e&&"object"==typeof e,i=a&&"string"==typeof e.text?e.text:"",s="string"==typeof t&&t?t:a&&"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(n)?n:void 0,source:o},u=a?e?.promptId:void 0;return"string"==typeof u&&u&&(c.promptId=u),c}({chip:n,submitText:r,position:o,conversationId:t,source:a});if(!l)return!1;const c=`${e.replace(/\/$/,"")}/api/v1/support/chip-click`,u=JSON.stringify(l);let d;if("function"==typeof i)try{d=await i()}catch{d=void 0}if(!d&&"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon&&"undefined"!=typeof Blob)try{if(navigator.sendBeacon(c,new Blob([u],{type:"application/json"})))return!0}catch{}if("function"!=typeof fetch)return!1;const p={"Content-Type":"application/json"};return d&&(p.Authorization=`Bearer ${d}`),await fetch(c,{method:"POST",headers:p,credentials:"include",keepalive:!0,body:u}),!0}catch{return!1}}const Jg="#ffffff",Xg="#f5f5f5",Zg="#000000",ef="#1f2937",tf="#f3f4f6",nf="#2563eb",rf="eshal:widget:size",of=(e,t)=>!e||(e=>e?.trim().toLowerCase())(e)===t,af=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()),sf=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"},lf=({isOpen:e,isMinimized:t,isDark:n,onStopGeneration:r,primaryColor:o,textColor:a,conciergeName:i,companyName:s,companyLogo:l,chatbotAvatarEnabled:c,chatbotAvatar:u,messages:d,isLoading:p,isConversationLoading:g=!1,inputValue:f,setInputValue:h,onSend:m,onDirectSend:b,onToggleTheme:y,onMinimize:v,onClose:w,quickQuestions:k=[],quickQuestionsEnabled:x,onQuickQuestion:S,quickQuestionsLayout:C="vertical",agentMessageBubbleColor:M,userMessageBoxColor:P,assistantTextColor:z,userTextColor:E,fontFamily:j="Inter",agentMessageBubbleFontFamily:T,agentMessageBubbleFontSize:N,userMessageBubbleFontFamily:F,userMessageBubbleFontSize:L,fontSize:R="14px",defaultLanguage:A="en",onDecision:_,headerTextBold:B=!1,headerTextItalic:D=!1,headerTextColor:O,headerFontFamily:$,headerFontSize:U,subtitle:V=null,showStatus:H=!1,statusMode:W="always",officeHours:q=null,enableVoiceInteraction:Q=!1,isVoiceSessionActive:K=!1,voiceStatus:Y="idle",voiceError:G=null,voiceConclusionForCsat:J=!1,onVoiceToggle:X,onBidiSubmit:Z,disclaimerEnabled:ee=!1,disclaimerText:te,disclaimerPosition:ne="top",disclaimerLinkUrl:re,disclaimerLinkLabel:oe,showPoweredBy:ae=!0,apiBaseUrl:ie,apiKey:se,getAuthToken:le,conversationId:ce,conciergeId:ue,onboardingQuestions:de=[],onboardingActive:pe=!1,onboardingCompleted:ge=!1,onOnboardingFormSubmit:fe,collectionPrompt:he,csatEnabled:me=!1,csatFormat:be="EMOJI",csatPrompt:ye="How was your experience?",onPromptSuggestionClick:ve,onboardingEnabled:we=!1,onResetConversation:ke,sessionExpiringSoon:xe=!1,autoPromptEnabled:Se=!0,autoPromptQuestionDisplay:Ce=!0,autoPromptClickTelemetry:Me=!0,allowFeedback:Pe=!0,provideCitations:ze=!0,onFeedback:Ee,onRetryMessage:je,onRefreshChat:Te,onCopyChat:Ne,filterCategories:Fe=[],showFilterStep:Le=!1,widgetFilter:Re=null,onWidgetFilterChange:Ae,onSynthesizeAssistantMessage:_e,launcherPosition:Ie="bottom-right",chatFeatures:Be,organizationId:De})=>{Ip(j);const Oe=I.useRef(null),$e=I.useRef(null),Ue=I.useMemo(()=>jd(A),[A]);I.useEffect(()=>{$e.current?.focus()},[]);const Ve=I.useCallback((e,t,n)=>{Gg({apiBaseUrl:ie,conversationId:ce,chip:t,submitText:null==e?void 0:String(e),position:n,source:"widget",getAuthToken:le,enabled:Me})},[ie,le,ce,Me]),He=I.useCallback((e,t,n)=>{t&&"object"==typeof t&&Ve(e,t,n),ve?ve(e):b?.(e)},[ve,b,Ve]),We=Ie.includes("right"),qe=Ie.includes("bottom"),[Qe,Ke]=I.useState(()=>{if("undefined"==typeof window)return null;try{const e=window.localStorage.getItem(rf);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}),Ye=I.useRef(null),Ge=I.useRef({x:0,y:0}),Je=I.useRef({width:380,height:650});I.useEffect(()=>{const e=e=>{const t=Ye.current;if(!t)return;const n=e.clientX-Ge.current.x,r=e.clientY-Ge.current.y,o={...Je.current},a=.92*window.innerWidth,i=.85*window.innerHeight;if("corner"===t||"horizontal"===t){const e=We?Je.current.width-n:Je.current.width+n;o.width=Math.min(Math.max(320,e),a)}if("corner"===t||"vertical"===t){const e=qe?Je.current.height-r:Je.current.height+r;o.height=Math.min(Math.max(400,e),i)}Ke(o)},t=()=>{Ye.current&&(Ye.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)}},[We,qe]),I.useEffect(()=>{if(Qe)try{window.localStorage.setItem(rf,JSON.stringify(Qe))}catch{}},[Qe]);const Xe=(e,t)=>{t.preventDefault(),t.stopPropagation(),Ye.current=e,Ge.current={x:t.clientX,y:t.clientY},Je.current=Qe??{width:380,height:650};const n={corner:We===qe?"nwse-resize":"nesw-resize",horizontal:"ew-resize",vertical:"ns-resize"};document.body.style.cursor=n[e],document.body.style.userSelect="none"},[Ze,et]=I.useState(!1),[tt,nt]=I.useState(()=>{try{return Wd(De)?.csatSubmitted??!1}catch{return!1}}),[rt,ot]=I.useState(!1),[at,it]=I.useState(!1),[st,lt]=I.useState(0),[ct,ut]=I.useState(""),[dt,pt]=I.useState(!1);I.useEffect(()=>{try{const e=Wd(De)?.csatSubmitted??!1;nt(e),e&&et(!1)}catch{}},[ce]),function(e,t=[],n={}){const{enabled:r=!0,threshold:o=30,behavior:a="smooth",delay:i=0}=n,s=I.useRef(!0);I.useRef(0),I.useEffect(()=>{if(!r||!e.current)return;const t=e.current,n=()=>{const e=t.scrollHeight-t.scrollTop-t.clientHeight;s.current=e<o},l=()=>{n()};t.addEventListener("scroll",l,{passive:!0}),n();const c=setTimeout(()=>{s.current&&t&&t.scrollTo({top:t.scrollHeight,behavior:a})},i);return()=>{t.removeEventListener("scroll",l),clearTimeout(c)}},[e,r,o,a,i,...t])}(Oe,[d,p],{enabled:!0,threshold:30,behavior:"smooth",delay:0});const gt=Cd(A),ft=I.useMemo(()=>n?of(M,Jg)?ef:M||ef:M||Jg,[M,n]),ht=I.useMemo(()=>n?of(a,Zg)?tf:a||tf:a||Zg,[n,a]),mt=I.useMemo(()=>n?of(P,Xg)?o||nf:P||o||nf:P||Xg,[n,o,P]),bt=Ue(at?"conversationResolved":"typeYourMessage"),yt=d?.some?.(e=>"user"===e.role),vt=I.useMemo(()=>(d||[]).filter(e=>"user"===e.role).length,[d]),[wt,kt]=I.useState(0),xt=Re?.category?(Fe||[]).find(e=>e.id===Re.category):null,St=I.useCallback(e=>{if(!Ae)return;const t=Re?.category||null;if(e){if(Ae({category:e,tags:[]}),kt(vt),!yt&&e!==t&&_e){const t=(Fe||[]).find(t=>t.id===e),n=t?.label||e,r=Ue("categoryTopicsHeading").replace("{category}",n);_e(r,{replaceMarker:"category-intro"})}}else Ae(null)},[Ae,Re,vt,Fe,yt,_e,Ue]);I.useCallback(e=>{const t=Re?.category||xt?.id;t&&Ae&&Ae({category:t,tags:[e]}),b&&b(e)},[Re,xt,Ae,b]);const Ct=Array.isArray(Fe)&&Fe.length>0,Mt=Ct&&!yt&&!Re?.category,Pt=!yt&&k.length>0&&x&&!Re?.category,zt=de&&de.length>0,Et=Boolean(me),jt=we&&zt&&!ge,Tt=I.useCallback(async()=>{if(Et&&!dt&&!at&&0!==st){pt(!0);try{const e={"Content-Type":"application/json"};if("function"==typeof le){const t=await le();t&&(e.Authorization=`Bearer ${t}`)}const t=sf(be);(await fetch(`${ie.replace(/\/$/,"")}/api/v1/support/csat`,{method:"POST",headers:e,credentials:"include",body:JSON.stringify({conversationId:ce,rating:String(st),ratingFormat:t,conciergeId:ue,feedback:ct||void 0})})).ok&&(ot(!1),lt(0),ut(""),Ae&&Ae(null),Te?Te():ke&&ke())}catch(e){}finally{pt(!1)}}},[Et,dt,at,st,ct,ce,le,ue,ie,be,ke,Te,Ae]),Nt=I.useCallback(()=>{if(!Et||!ce||!yt)return Ae&&Ae(null),Te?Te():ke&&ke(),void w?.();rt?(ot(!1),w?.()):at?w?.():ot(!0)},[Et,ce,yt,rt,at,w,Ae,Te,ke]);I.useEffect(()=>{Et||(rt&&ot(!1),at&&it(!1),0!==st&<(0),ct&&ut(""))},[Et,rt,at,st,ct]);const Ft=I.useMemo(()=>{if(!d||!Array.isArray(d))return[];for(let e=d.length-1;e>=0;e-=1)if("assistant"===d[e]?.role){const t=d[e].prompts;return Array.isArray(t)?t:[]}return[]},[d]),Lt=I.useRef([]);I.useEffect(()=>{Ft.length>0?Lt.current=Ft:d&&0!==d.length&&d.some(e=>"user"===e.role)||(Lt.current=[])},[Ft,d]);const Rt=I.useRef(vt);I.useEffect(()=>{vt!==Rt.current&&(Rt.current=vt,Lt.current=[])},[vt]);const At=Array.isArray(d)&&d.some(e=>"user"===e?.role),_t=Ft.length>0?Ft:At?Lt.current:[];I.useEffect(()=>{if(!me)return;if(!Ze)return;if(tt)return;const e=Oe.current;if(!e)return;const t=window.requestAnimationFrame(()=>{e.scrollTo({top:e.scrollHeight,behavior:"smooth"})});return()=>{window.cancelAnimationFrame(t)}},[Ze,me,tt]);const It=()=>{const e=sf(be);if("STARS"===e)return ng.jsx("div",{className:"flex justify-center gap-2 mb-5",role:"group","aria-label":Ue("rateExperience"),children:[1,2,3,4,5].map(e=>ng.jsx("button",{"aria-label":`${Ue("rate")} ${e}`,onClick:()=>lt(e),className:"transition-all duration-150 hover:scale-110 active:scale-95 bg-transparent border-0 p-0 cursor-pointer",disabled:dt,children:ng.jsx(zp,{className:_d("w-8 h-8 transition-colors",e<=st?"text-yellow-400 drop-shadow-sm":n?"text-gray-600":"text-gray-300"),fill:e<=st?"#FBBF24":"none"})},e))});if("THUMBS"===e)return ng.jsx("div",{className:"flex gap-4 justify-center mb-5",role:"group","aria-label":Ue("rateExperience"),children:[{value:"positive",emoji:"👍"},{value:"negative",emoji:"👎"}].map(e=>ng.jsx("button",{"aria-label":"positive"===e.value?Ue("thumbsUp"):Ue("thumbsDown"),onClick:()=>lt(e.value),disabled:dt,className:_d("w-12 h-12 rounded-xl border flex items-center justify-center text-2xl transition-all hover:scale-105 active:scale-95",st===e.value?"ring-2 ring-blue-300 scale-110 shadow-lg":"",n?"bg-gray-700 border-gray-600 hover:bg-gray-600":"bg-white border-gray-200 hover:bg-gray-50"),children:ng.jsx("span",{className:"drop-shadow-md",children:e.emoji})},e.value))});return ng.jsx("div",{className:"flex gap-2 justify-center items-center mb-5",role:"group","aria-label":Ue("rateExperience"),children:[{value:1,emoji:"😡"},{value:2,emoji:"😕"},{value:3,emoji:"😐"},{value:4,emoji:"😊"},{value:5,emoji:"😍"}].map(e=>ng.jsx("button",{"aria-label":`${Ue("rate")} ${e.value}`,onClick:()=>lt(e.value),disabled:dt,className:_d("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",st===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:ng.jsx("span",{role:"img","aria-label":`${Ue("rate")} ${e.value}`,className:"drop-shadow-sm filter",children:e.emoji})},e.value))})};if(!e)return null;const Bt=!t&&Qe?{width:Qe.width,height:Qe.height,maxWidth:"92vw",maxHeight:"85vh"}:void 0;return ng.jsxs("div",{dir:gt?"rtl":"ltr",className:"relative flex-shrink-0 z-50 "+(t?"w-80 h-auto":""),style:Bt,children:[!t&&ng.jsxs(ng.Fragment,{children:[ng.jsx("div",{onMouseDown:e=>Xe("horizontal",e),className:"absolute top-0 h-full w-1.5 cursor-ew-resize hover:bg-blue-500/20 transition-colors z-[70] "+(We?"left-0":"right-0"),"aria-hidden":!0}),ng.jsx("div",{onMouseDown:e=>Xe("vertical",e),className:"absolute left-0 w-full h-1.5 cursor-ns-resize hover:bg-blue-500/20 transition-colors z-[70] "+(qe?"top-0":"bottom-0"),"aria-hidden":!0})]}),ng.jsxs("div",{id:"chat-window-panel",ref:$e,role:"dialog","aria-modal":"true","aria-label":Ue("openChat"),tabIndex:-1,className:`relative focus:outline-none ${Qe||t?"":"w-[380px]"} ${Qe||t?"":"h-[650px]"} ${t?"w-80 h-auto":""} ${Qe&&!t?"w-full h-full":""} max-w-[92vw] border rounded-2xl shadow-2xl bg-white border-gray-200 flex flex-col ${t?"":"max-h-[85vh]"} overflow-hidden ${n?"bg-gray-900 border-gray-700":""}`,children:[!t&&ng.jsx("div",{onMouseDown:e=>Xe("corner",e),"aria-hidden":"true",className:`absolute w-4 h-4 ${We===qe?"cursor-nwse-resize":"cursor-nesw-resize"} text-gray-400 hover:text-blue-500 transition-colors z-[71] flex p-0.5 ${qe?"top-0 items-start":"bottom-0 items-end"} ${We?"left-0 justify-start":"right-0 justify-end"}`,children:ng.jsx("svg",{viewBox:"0 0 12 12",className:"w-3 h-3 "+(qe&&We?"rotate-180":qe?"-rotate-90":We?"rotate-90":""),"aria-hidden":!0,children:ng.jsx("path",{d:"M11 1 L1 11 M11 5 L5 11 M11 9 L9 11",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"})})}),ng.jsx($g,{conciergeName:i,companyName:s,companyLogo:l,primaryColor:o,isDark:n,isMinimized:t,textColor:ht,fontFamily:j,fontSize:R,onToggleTheme:y,onMinimize:v,onClose:Nt,headerTextBold:B,headerTextItalic:D,headerTextColor:O,headerFontFamily:$,headerFontSize:U,subtitle:V,showStatus:H,statusMode:W,officeHours:q,onRefreshChat:Te,onCopyChat:Ne,defaultLanguage:A}),!t&&Ct&&!Mt&&!(rt&&!at)&&!(pe&&!ge)&&ng.jsx(Vg,{categories:Fe,selectedCategoryId:Re?.category||null,onSelect:St,isDark:n,primaryColor:o,fontFamily:j,isRtl:gt}),!t&&ng.jsxs(ng.Fragment,{children:[ng.jsx("div",{ref:Oe,role:"log","aria-live":"polite",className:`chat-messages flex-1 overflow-y-auto px-3 py-4 space-y-4 ${n?"bg-gray-900":"bg-gradient-to-b from-gray-50/50 to-white"} break-words`,children:rt&&!at?ng.jsx("div",{className:"animate-in slide-in-from-top-4 fade-in duration-300 mt-4 mx-2",children:ng.jsxs("div",{className:_d("w-full rounded-3xl p-6 shadow-lg",n?"bg-gray-800 shadow-black/20":"bg-white shadow-gray-200/80"),children:[ng.jsx("p",{className:_d("text-sm font-medium text-center mb-5 [font-family:inherit]",n?"text-gray-300":"text-gray-500"),children:ye||Ue("feedbackPrompt")}),It(),ng.jsx("textarea",{"aria-label":Ue("feedbackPlaceholder"),value:ct,onChange:e=>{e.target.value.length<=1e3&&ut(e.target.value)},maxLength:1e3,placeholder:Ue("feedbackPlaceholder"),rows:4,disabled:dt,className:_d("w-full rounded-xl border px-4 py-3 text-sm [font-family:inherit] resize-none outline-none transition-colors mb-5",n?"bg-gray-700 border-gray-600 text-gray-100 placeholder-gray-400":"bg-gray-50 border-gray-200 text-gray-900 placeholder-gray-400")}),ng.jsxs("div",{className:"relative group",children:[ng.jsx("button",{onClick:Tt,disabled:0===st||dt,"aria-describedby":0===st?"resolve-rating-hint":void 0,className:_d("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",n?"bg-gray-700 text-gray-100 hover:bg-gray-600":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:Ue(dt?"submitting":"submitFeedback")}),0===st&&!dt&&ng.jsx("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:Ue("selectRatingFirst")})]})]})}):pe&&!ge&&fe?ng.jsx(Ug,{questions:de,onPromptSuggestionClick:He,collapsiblePrompt:he,onSubmit:fe,primaryColor:o,isRtl:gt,isDark:n,defaultLanguage:A,fontFamily:j}):ng.jsxs(ng.Fragment,{children:[xe&&ng.jsx("div",{role:"status",className:"mx-3 mt-1 mb-2 rounded-lg px-3 py-2 text-xs font-medium "+(n?"bg-amber-900/40 text-amber-200 border border-amber-700/50":"bg-amber-50 text-amber-800 border border-amber-200"),children:Ue("sessionExpiringSoon")}),ng.jsx(jg,{messages:d,isDark:n,primaryColor:o,isLoading:p,agentMessageBubbleColor:M,userMessageBoxColor:P,textColor:a,assistantTextColor:z,userTextColor:E,fontFamily:j,agentMessageBubbleFontFamily:T,agentMessageBubbleFontSize:N,userMessageBubbleFontFamily:F,userMessageBubbleFontSize:L,fontSize:R,formatTime:af,isRtl:gt,defaultLanguage:A,quickQuestions:k,shouldShowQuickQuestions:Pt,onQuickQuestion:S??b,quickQuestionsLayout:C,onDecision:_,disclaimerEnabled:ee,disclaimerText:te,disclaimerPosition:ne,disclaimerLinkUrl:re,disclaimerLinkLabel:oe,resolvedAgentBubbleColor:ft,resolvedUserMessageColor:mt,resolvedTextColor:ht,isVoiceSessionActive:K,voiceStatus:Y,messagesContainerRef:Oe,companyLogo:l,chatbotAvatarEnabled:c,chatbotAvatar:u,conciergeName:i,companyName:s,apiBaseUrl:ie,getAuthToken:le,onPromptSuggestionClick:He,conversationResetKey:ce,allowFeedback:Pe,provideCitations:ze,onFeedback:Ee,onRetryMessage:je,headerTextColor:O,beforePromptsSlot:Mt?ng.jsx(Hg,{categories:Fe,selectedCategoryId:Re?.category||null,onSelect:St,isDark:n,primaryColor:o,fontFamily:j,fontSize:R,isRtl:gt,label:Ue("chooseTopicLabel")}):null,quickQuestionsHeadingLabel:Ct?Ue("quickQuestionsHeadingLabel"):void 0}),Ze&&me&&!tt&&ng.jsx("div",{className:"",children:ng.jsx(Yg,{format:sf(be),prompt:ye||Ue("howWasYourExperience"),onRating:async(e,t)=>{nt(!0),et(!1),(e=>{try{const t=Wd(e);if(!t)return;t.csatSubmitted=!0,localStorage.setItem(`${Dd}_${e}`,JSON.stringify(t))}catch{}})(void 0);try{const n={"Content-Type":"application/json"};if("function"==typeof le){const e=await le();e&&(n.Authorization=`Bearer ${e}`)}(await fetch(`${ie.replace(/\/$/,"")}/api/v1/support/csat`,{method:"POST",headers:n,credentials:"include",body:JSON.stringify({conversationId:ce,rating:e,ratingFormat:t,conciergeId:ue})})).ok}catch(e){}},disabled:!1,isDark:n,primaryColor:o,defaultLanguage:A})})]})}),!(pe&&!ge)&&ng.jsx(Ig,{onStopGeneration:r,inputValue:f,setInputValue:h,onSend:m,isDark:n,primaryColor:o,isOpen:e,isMinimized:t,isLoading:p,isConversationLoading:g,placeholder:bt,textColor:ht,fontFamily:j,userMessageBubbleFontFamily:F,userMessageBubbleFontSize:L,fontSize:R,isRtl:gt,csatVisible:Ze&&me&&!tt||Et&&(rt||at),enableVoiceInteraction:Q,isVoiceSessionActive:K,voiceStatus:Y,voiceError:G,onVoiceToggle:X,onBidiSubmit:Z,disclaimerEnabled:ee,disclaimerText:te,disclaimerPosition:ne,disclaimerLinkUrl:re,disclaimerLinkLabel:oe,showPoweredBy:ae,defaultLanguage:A,onboardingQuestions:de,onboardingActive:pe,onboardingCompleted:ge,onboardingEnabled:we,userMessageBoxColor:P,resolvedUserMessageColor:mt,userTextColor:E,promptSuggestions:rt||at||!1===Se||p?[]:_t,onPromptSuggestionClick:He,autoPromptQuestionDisplay:Ce,tagSelectorNode:null,showResolveButton:Et&&yt&&!at&&!rt&&!Ze&&!jt,onResolve:()=>{Et&&ot(!0)},chatFeatures:Be,apiEndpoint:ie,organizationId:De,conversationId:ce})]})]})]})},cf=new Map;const uf={whatsapp:["wa.me","api.whatsapp.com"],telegram:["t.me"],messenger:["m.me"],instagram:["ig.me","instagram.com","www.instagram.com"]},df={whatsapp:"WhatsApp",telegram:"Telegram",messenger:"Messenger",instagram:"Instagram"};const pf=I.forwardRef(({isDark:e,primaryColor:t,onToggle:n,textColor:r,headerTextColor:o,defaultLanguage:a="en",isOpen:i=!1,className:s,channelLinks:l},c)=>{const u=I.useMemo(()=>jd(a),[a]),d=I.useMemo(()=>function(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||"object"!=typeof n)continue;const e="string"==typeof n.type?n.type.toLowerCase():"",r=uf[e];if(!r||"string"!=typeof n.url)continue;let o;try{o=new URL(n.url)}catch{continue}"https:"===o.protocol&&r.includes(o.hostname.toLowerCase())&&t.push({type:e,url:o.toString(),label:"string"==typeof n.label&&n.label.trim()?n.label.trim():df[e]})}return t}(l),[l]),[p,g]=I.useState(!1),f=d.length>0,h=t,m=o||"#FFFFFF",b={display:"block",width:"100%",padding:"8px 12px",textAlign:"start",fontSize:"14px",color:e?"#F1F5F9":"#0F172A",background:"transparent",border:"none",borderRadius:"6px",textDecoration:"none",cursor:"pointer"};return ng.jsxs("div",{className:`relative ${s||""}`,children:[f&&p&&!i&&ng.jsxs("div",{role:"menu","aria-label":u("chooseChannel"),"data-testid":"channel-picker",style:{position:"absolute",bottom:"76px",right:0,minWidth:"180px",padding:"6px",borderRadius:"8px",border:"1px solid "+(e?"#334155":"#E2E8F0"),background:e?"#1E293B":"#FFFFFF",boxShadow:"0 10px 30px rgba(15, 23, 42, 0.15)"},children:[ng.jsx("button",{type:"button",role:"menuitem",style:b,onClick:()=>{g(!1),n?.()},children:u("chatHere")}),d.map(e=>ng.jsx("a",{role:"menuitem",href:e.url,target:"_blank",rel:"noopener noreferrer",style:b,onClick:()=>g(!1),children:e.label},`${e.type}-${e.url}`))]}),ng.jsxs("button",{ref:c,onClick:()=>{!f||i?n?.():g(e=>!e)},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",style:{background:`linear-gradient(135deg, ${h} 0%, ${h}dd 100%)`,boxShadow:`0 10px 30px ${h}40`,border:"none"},"aria-label":u(i?"closeChat":"openChat"),"aria-expanded":f&&p||i,"aria-haspopup":f?"menu":void 0,"aria-controls":"chat-window-panel",children:[ng.jsx("div",{className:"absolute inset-0 rounded-full bg-white/20 scale-0 group-hover:scale-100 transition-transform duration-500"}),ng.jsx("div",{className:"relative z-10 transition-transform duration-300",children:ng.jsx(kp,{className:"w-7 h-7",style:{color:m}})})]})]})});pf.displayName="ToggleButton";const gf="0.2.16",ff=({getAuthToken:e,apiBaseUrl:t,darkMode:n,primaryColor:r,position:o,companyName:a,conciergeName:i,companyLogo:s,welcomeMessage:l,quickQuestions:c,quickQuestionsEnabled:u,quickQuestionsLayout:d="vertical",textColor:p,agentMessageBubbleColor:g,userMessageBoxColor:f,assistantTextColor:h,userTextColor:m,fontFamily:b,fontSize:y,defaultLanguage:v,apiKey:w,agentMessageBubbleFontFamily:k,agentMessageBubbleFontSize:x,userMessageBubbleFontFamily:S,userMessageBubbleFontSize:C,autoOpen:M=!1,openDelay:P=0,locale:z,className:E="",headerTextBold:j,headerTextItalic:T,enableVoiceInteraction:N,disclaimerEnabled:F,disclaimerText:L,disclaimerPosition:R,disclaimerLinkUrl:A,disclaimerLinkLabel:_,showPoweredBy:B,onboardingQuestions:D,collectionPrompt:O,allowedDomains:$,onboardingEnabled:U,wsBaseUrl:V,channelLinks:H})=>{const[W,q]=I.useState(null),[Q,K]=I.useState(!0),[Y,G]=I.useState(null),[J,X]=I.useState(!1),Z=I.useRef(!1);I.useEffect(()=>{if(Z.current)return;(async()=>{if(!t)return G("apiBaseUrl is required"),void K(!1);try{K(!0);const n=await(async(e,t)=>{if(!e)throw new Error("apiBaseUrl is required");try{const n=e.replace(/\/$/,""),r=gf?`${n}/api/v1/deploy-agent?wv=${encodeURIComponent(gf)}`:`${n}/api/v1/deploy-agent`,o={"Content-Type":"application/json"};if("function"==typeof t){const e=await t();e&&(o.Authorization=`Bearer ${e}`)}const a=await fetch(r,{method:"GET",headers:o,credentials:"include"});if(404===a.status)return null;if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return await a.json()}catch(e){throw e}})(t,e);if(null===n)return Z.current=!0,X(!0),q(null),void G(null);q(n),G(null)}catch(e){G(e.message||"Failed to load configuration")}finally{K(!1)}})()},[t,e]);const ee=I.useMemo(()=>{if(!W)return null;const e=W.config??{},t=e.identity??{},d=e.branding??{},w=e.typography??{},M=e.messages??{},P=e.voice??{},z=e.onboarding??{},E=e.disclaimer??{},I=e.csat??{},V=e.inactivity??{},q=e.behavior??{},Q=e.security??{},K=e.layout??{},Y=v??M.defaultLocale??"en",G=M.bundles?.[Y]??{},J=M.bundles?.en??{},X={welcome:G.welcome||J.welcome,fallback:G.fallback||J.fallback,quickQuestions:Array.isArray(G.quickQuestions)&&G.quickQuestions.length>0?G.quickQuestions:J.quickQuestions},Z=$??Q.allowedDomains??(Q.domains??[]).map(e=>"string"==typeof e?e:e.domain).filter(Boolean)??[];return{darkMode:n??!1,primaryColor:r??d.brandColor??"#2563eb",companyName:a??t.companyName??"Support Team",conciergeName:i??t.conciergeName,companyLogo:s??d.avatar??null,chatbotAvatarEnabled:d.chatbotAvatarEnabled??!1,chatbotAvatar:d.chatbotAvatar??null,welcomeMessage:l??X.welcome??"Hi! How can we help?",fallbackMessage:X.fallback,quickQuestions:c??X.quickQuestions??[],quickQuestionsEnabled:u??M.quickQuestionsEnabled,textColor:p??"#000000",agentMessageBubbleColor:g??w.agentMessageBubbleColor,userMessageBoxColor:f??w.userMessageBoxColor,assistantTextColor:h??w.assistantTextColor??"#000000",userTextColor:m??w.userTextColor??"#000000",fontFamily:b??w.agentMessageBubbleFontFamily??"Inter",fontSize:y??w.agentMessageBubbleFontSize??"14px",defaultLanguage:Y,headerTextBold:j??w.headerTextBold??!1,headerTextItalic:T??w.headerTextItalic??!1,headerTextColor:w.headerTextColor??"#FFFFFF",headerFontFamily:w.headerFontFamily,headerFontSize:w.headerFontSize,subtitle:t.subtitle??null,showStatus:t.showStatus??!1,statusMode:t.statusMode??"always",officeHours:t.officeHours??null,enableVoiceInteraction:N??P.enableVoiceInteraction??!1,disclaimerEnabled:F??E.enabled??!1,disclaimerText:L??E.text,disclaimerPosition:R??(ee=E.position,ee?ee.toLowerCase():"top"),disclaimerLinkUrl:Ad(A??E.linkUrl),disclaimerLinkLabel:_??E.linkLabel,showPoweredBy:B??d.showPoweredBy??!0,onboardingQuestions:D??z.questions??[],collectionPrompt:O??z.collapsiblePrompt??"Before we begin, I need to verify your details.",allowedDomains:Z,launcherPosition:o??(e=>e?e.toLowerCase().replace(/_/g,"-"):"bottom-right")(K.launcherPosition),onboardingEnabled:U??z.enabled??!1,inactivityTimeoutValue:V.timeoutValue??null,inactivityTimeoutUnit:V.timeoutUnit??null,agentMessageBubbleFontFamily:k??w.agentMessageBubbleFontFamily??b??"Inter",agentMessageBubbleFontSize:x??w.agentMessageBubbleFontSize??y??"14px",userMessageBubbleFontFamily:S??w.userMessageBubbleFontFamily??b??"Inter",userMessageBubbleFontSize:C??w.userMessageBubbleFontSize??y??"14px",csatEnabled:I.enabled??!1,csatFormat:I.format??"EMOJI",csatPrompt:I.prompt??"How was your experience?",autoPromptEnabled:q.autoPromptEnabled??!0,autoPromptQuestionDisplay:q.autoPromptQuestionDisplay??!0,autoPromptClickTelemetry:q.autoPromptClickTelemetry??!0,allowFeedback:q.allowFeedback??!0,provideCitations:q.provideCitations??!0,organizationId:W.organizationId??null,chatFeatures:e.chatFeatures??null,channelLinks:H??e.channelLinks??null};var ee},[H,W,n,r,o,a,i,s,l,c,u,p,g,f,h,m,b,y,v,j,T,N,F,L,R,_,A,B,D,U,O,$,k,x,S,C]),te=I.useMemo(()=>!ee||((e=[])=>{if("undefined"==typeof window)return!1;const t=window.location.hostname.toLowerCase(),n=window.location.host.toLowerCase();return!(!e||0===e.length)&&e.some(e=>{const r=e.toLowerCase().trim();return r.includes(":")?n===r:t===r||t.endsWith("."+r)})})(ee.allowedDomains),[ee]),ne=I.useMemo(()=>({welcomeMessage:"Hi! How can we help?",quickQuestions:[],apiBaseUrl:t||"",apiKey:w||"",getAuthToken:e,autoOpen:!1,openDelay:0,darkMode:!1,enableVoiceInteraction:!1,onboardingQuestions:[],onboardingEnabled:!1,collectionPrompt:void 0}),[t,w,e]),{isOpen:re,isMinimized:oe,isDark:ae,messages:ie,inputValue:se,isLoading:le,widgetRef:ce,setInputValue:ue,handleSend:de,stopGeneration:pe,handleQuickQuestion:ge,sendMessage:fe,retryMessage:he,toggleChat:me,toggleTheme:be,toggleMinimize:ye,closeChat:ve,handleDecision:we,isVoiceSessionActive:ke,voiceStatus:xe,voiceError:Se,voiceConclusionForCsat:Ce,handleVoiceToggle:Me,sendBidiTextMessage:Pe,onboardingActive:ze,onboardingCompleted:Ee,handleOnboardingFormSubmit:je,conversationId:Te,resetConversation:Ne,sessionExpiringSoon:Fe,updateMessageFeedback:Le,widgetFilter:Re,setWidgetFilter:Ae,addAssistantMessage:_e}=ap(ee?{welcomeMessage:ee.welcomeMessage,fallbackMessage:ee.fallbackMessage,quickQuestions:ee.quickQuestions,apiBaseUrl:t,wsBaseUrl:V??W?.wsBaseUrl,apiKey:w,locale:ee.defaultLanguage||z,organizationId:ee.organizationId,getAuthToken:e,autoOpen:M,openDelay:P,darkMode:ee.darkMode,enableVoiceInteraction:ee.enableVoiceInteraction,onboardingQuestions:ee.onboardingQuestions,onboardingEnabled:ee.onboardingEnabled,collectionPrompt:ee.collectionPrompt,provideCitations:ee.provideCitations,inactivityTimeoutValue:ee.inactivityTimeoutValue,inactivityTimeoutUnit:ee.inactivityTimeoutUnit,messageLimits:W?.messageLimits}:ne),Ie=I.useRef(null),Be=I.useRef(re);I.useEffect(()=>{Be.current&&!re&&Ie.current?.focus(),Be.current=re},[re]);const De=I.useCallback((n,r,o)=>{if(Le(n,r),!Te||!t)return;const a=t.replace(/\/$/,"");(async()=>{try{const t={"Content-Type":"application/json"};if("function"==typeof e){const n=await e();n&&(t.Authorization=`Bearer ${n}`)}await fetch(`${a}/api/v1/support/feedback`,{method:"POST",headers:t,credentials:"include",body:JSON.stringify({messageContent:n,conversationId:Te,feedback:r,feedbackText:o})})}catch(e){}})()},[Te,t,e,Le]),Oe=I.useCallback(()=>{Ne&&Ne()},[Ne]),{categories:$e,hasFilters:Ue}=function(e,t){const n=!!e,[r,o]=I.useState({categories:[],loading:n,error:null});I.useEffect(()=>{if(!e)return void o({categories:[],loading:!1,error:null});const n=t?`${e}|__session__`:`${e}|__proxy__`,r=cf.get(n);if(r)return void o({categories:r,loading:!1,error:null});let a=!1;o(e=>({...e,loading:!0,error:null}));const i=`${e.replace(/\/$/,"")}/api/v1/widget/filters`;return(async()=>{try{const e={Accept:"application/json"};if("function"==typeof t){const n=await t();n&&(e.Authorization=`Bearer ${n}`)}const r=await fetch(i,{method:"GET",headers:e});if(!r.ok)throw new Error(`filter catalog HTTP ${r.status}`);const s=await r.json(),l=Array.isArray(s?.categories)?s.categories:[];if(a)return;cf.set(n,l),o({categories:l,loading:!1,error:null})}catch(e){if(a)return;o({categories:[],loading:!1,error:e})}})(),()=>{a=!0}},[e,t]);const a=I.useMemo(()=>Array.isArray(r.categories)&&r.categories.length>0,[r.categories]);return{...r,hasFilters:a}}(t,e),Ve=I.useCallback(()=>{const e=ie.filter(e=>e.content&&""!==e.content.trim()).map(e=>`${"user"===e.role?"You":ee?.conciergeName||"Assistant"}: ${e.content}`).join("\n\n");e&&navigator.clipboard.writeText(e).catch(()=>{})},[ie,ee?.conciergeName]);if(I.useEffect(()=>{ce.current&&ee&&(ce.current.style.setProperty("--cw-primary",ee.primaryColor),ee.fontFamily&&ce.current.style.setProperty("--cw-font-family",ee.fontFamily),ee.textColor&&ce.current.style.setProperty("--cw-text-color",ee.textColor))},[ee,ce]),Q)return null;if(J)return null;if(Y||!ee)return null;if(!te)return null;const He={"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 ng.jsx("div",{id:"chat-widget-root",children:ng.jsxs("div",{ref:ce,className:`chat-widget-root fixed flex flex-col ${ee.launcherPosition?.includes("left")?"items-start":"items-end"} z-[999999] ${ae?"dark":""} ${E} ${He[ee.launcherPosition]||He["bottom-right"]}`,children:[ng.jsx(lf,{isOpen:re,isMinimized:oe,isDark:ae,launcherPosition:ee.launcherPosition,primaryColor:ee.primaryColor,textColor:ee.textColor,companyName:ee.companyName,conciergeName:ee.conciergeName,companyLogo:ee.companyLogo,chatbotAvatarEnabled:ee.chatbotAvatarEnabled,chatbotAvatar:ee.chatbotAvatar,messages:ie,isLoading:le,inputValue:se,setInputValue:ue,onSend:de,onStopGeneration:pe,onDirectSend:fe,onToggleTheme:be,onMinimize:ye,onClose:ve,quickQuestions:ee.quickQuestions,quickQuestionsEnabled:ee.quickQuestionsEnabled,onQuickQuestion:ge,quickQuestionsLayout:d,agentMessageBubbleColor:ee.agentMessageBubbleColor,userMessageBoxColor:ee.userMessageBoxColor,assistantTextColor:ee.assistantTextColor,userTextColor:ee.userTextColor,fontFamily:ee.fontFamily,agentMessageBubbleFontFamily:ee.agentMessageBubbleFontFamily,agentMessageBubbleFontSize:ee.agentMessageBubbleFontSize,userMessageBubbleFontFamily:ee.userMessageBubbleFontFamily,userMessageBubbleFontSize:ee.userMessageBubbleFontSize,fontSize:ee.fontSize,defaultLanguage:ee.defaultLanguage||z,onDecision:we,headerTextBold:ee.headerTextBold,headerTextItalic:ee.headerTextItalic,headerTextColor:ee.headerTextColor,headerFontFamily:ee.headerFontFamily,headerFontSize:ee.headerFontSize,subtitle:ee.subtitle,showStatus:ee.showStatus,statusMode:ee.statusMode,officeHours:ee.officeHours,enableVoiceInteraction:ee.enableVoiceInteraction,isVoiceSessionActive:ke,voiceStatus:xe,voiceError:Se,voiceConclusionForCsat:Ce,onVoiceToggle:Me,onBidiSubmit:()=>Pe(se),disclaimerEnabled:ee.disclaimerEnabled,disclaimerText:ee.disclaimerText,disclaimerPosition:ee.disclaimerPosition,disclaimerLinkUrl:ee.disclaimerLinkUrl,disclaimerLinkLabel:ee.disclaimerLinkLabel,showPoweredBy:ee.showPoweredBy,apiBaseUrl:t,apiKey:w,getAuthToken:e,conversationId:Te,conciergeId:W?.conciergeId??W?.id,onboardingQuestions:ee.onboardingQuestions,onboardingActive:ze,onboardingCompleted:Ee,onOnboardingFormSubmit:je,collectionPrompt:ee.collectionPrompt,csatEnabled:ee.csatEnabled,csatFormat:ee.csatFormat,csatPrompt:ee.csatPrompt,onboardingEnabled:ee.onboardingEnabled,onResetConversation:Ne,sessionExpiringSoon:Fe,autoPromptEnabled:ee.autoPromptEnabled,autoPromptQuestionDisplay:ee.autoPromptQuestionDisplay,autoPromptClickTelemetry:ee.autoPromptClickTelemetry,allowFeedback:ee.allowFeedback,provideCitations:ee.provideCitations,onFeedback:De,onRetryMessage:he,onRefreshChat:Oe,onCopyChat:Ve,filterCategories:$e,showFilterStep:Ue,widgetFilter:Re,onWidgetFilterChange:Ae,onSynthesizeAssistantMessage:_e,chatFeatures:ee.chatFeatures,organizationId:ee.organizationId}),ng.jsx(pf,{ref:Ie,isDark:ae,primaryColor:ee.primaryColor,onToggle:me,textColor:ee.textColor,headerTextColor:ee.headerTextColor,defaultLanguage:ee.defaultLanguage||z,isOpen:re,className:re?"hidden":void 0,channelLinks:ee.channelLinks})]})})};class hf extends I.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){}render(){return this.state.hasError?ng.jsx("div",{role:"alert",style:{position:"fixed",bottom:"20px",right:"20px",maxWidth:"280px",padding:"10px 14px",borderRadius:"10px",background:"#1f2937",color:"#f3f4f6",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",lineHeight:1.4,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",zIndex:2147483647},children:"Chat is temporarily unavailable. Please refresh the page to try again."}):this.props.children}}"undefined"!=typeof window&&(window.__eshalChatWidgetReact=I),function(){let e=null,t=null,n=null,r={},o=null;const a={darkMode:!1,primaryColor:"#2563eb",position:"bottom-right",companyName:"Support Team",conciergeName:null,companyLogo:null,welcomeMessage:"Hi! How can we help?",quickQuestions:[],quickQuestionsLayout:"vertical",textColor:"#fcfcfc",agentMessageBubbleColor:void 0,userMessageBoxColor:void 0,assistantTextColor:void 0,userTextColor:void 0,fontFamily:"Inter",fontSize:"14px",defaultLanguage:"en",autoOpen:!1,openDelay:0,apiBaseUrl:null,wsBaseUrl:null,apiKey:null,organizationId:null,sessionUrl:null,userId:null,userName:null,userEmail:null,locale:"en",headerTextBold:!1,headerTextItalic:!1,enableVoiceInteraction:!1,disclaimerEnabled:!1,disclaimerText:void 0,disclaimerPosition:"top",showPoweredBy:!0,onboardingQuestions:[],onboardingEnabled:!1,collectionPrompt:void 0,allowedDomains:[],onOpen:null,onClose:null},i={init:async function(s={}){if(r={...a,...s},r.sessionUrl&&!o&&(o=await(async e=>{if(e.sessionUrl)try{const t=await fetch(e.sessionUrl,{method:"POST",headers:{"Content-Type":"application/json",...e.apiKey&&{Authorization:`Bearer ${e.apiKey}`}},body:JSON.stringify({userId:e.userId,userName:e.userName,userEmail:e.userEmail}),credentials:"include"});return(await t.json()).sessionId}catch(e){return null}return null})(r)),n||(n=document.createElement("div"),n.id="chat-widget-host",document.body.appendChild(n)),!n.shadowRoot){const e=n.attachShadow({mode:"open"}),r=document.createElement("style");r.textContent=":host { all: initial; display: block; }",e.appendChild(r);const o=document.createElement("style");o.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 .invisible{visibility:hidden}#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 .text-start{text-align:start}#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}#chat-widget-root .hover\\:scale-105:hover,#chat-widget-root .hover\\:scale-110:hover{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}#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)}#chat-widget-root .hover\\:shadow-md:hover,#chat-widget-root .hover\\:shadow-xl:hover{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)}#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)}#chat-widget-root .focus\\:ring-0:focus,#chat-widget-root .focus\\:ring-1:focus{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)}#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}#chat-widget-root .active\\:scale-95:active,#chat-widget-root .active\\:scale-\\[0\\.97\\]:active{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}#chat-widget-root .active\\:scale-\\[0\\.98\\]:active{--tw-scale-x:0.98;--tw-scale-y:0.98}#chat-widget-root .active\\:scale-\\[0\\.98\\]:active,#chat-widget-root .active\\:scale-\\[0\\.99\\]:active{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}#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}}',e.appendChild(o),t=document.createElement("div"),t.id="chat-widget-mount",e.appendChild(t)}e||(e=Vu(t)),void 0===s.darkMode&&(r.darkMode=window.matchMedia("(prefers-color-scheme: dark)").matches);const l=r.apiBaseUrl?{apiBaseUrl:r.apiBaseUrl,...void 0!==s.wsBaseUrl&&{wsBaseUrl:r.wsBaseUrl},...void 0!==s.position&&{position:r.position},...void 0!==s.quickQuestionsLayout&&{quickQuestionsLayout:r.quickQuestionsLayout},...void 0!==s.darkMode&&{darkMode:r.darkMode},...void 0!==s.primaryColor&&{primaryColor:r.primaryColor},...void 0!==s.companyName&&{companyName:r.companyName},...void 0!==s.conciergeName&&{conciergeName:r.conciergeName},...void 0!==s.companyLogo&&{companyLogo:r.companyLogo},...void 0!==s.welcomeMessage&&{welcomeMessage:r.welcomeMessage},...void 0!==s.quickQuestions&&{quickQuestions:r.quickQuestions},...void 0!==s.channelLinks&&{channelLinks:r.channelLinks},...void 0!==s.textColor&&{textColor:r.textColor},...void 0!==s.agentMessageBubbleColor&&{agentMessageBubbleColor:r.agentMessageBubbleColor},...void 0!==s.userMessageBoxColor&&{userMessageBoxColor:r.userMessageBoxColor},...void 0!==s.assistantTextColor&&{assistantTextColor:r.assistantTextColor},...void 0!==s.userTextColor&&{userTextColor:r.userTextColor},...void 0!==s.fontFamily&&{fontFamily:r.fontFamily},...void 0!==s.fontSize&&{fontSize:r.fontSize},...void 0!==s.defaultLanguage&&{defaultLanguage:r.defaultLanguage},...void 0!==s.locale&&{locale:r.locale},...void 0!==s.headerTextBold&&{headerTextBold:r.headerTextBold},...void 0!==s.headerTextItalic&&{headerTextItalic:r.headerTextItalic},...void 0!==s.enableVoiceInteraction&&{enableVoiceInteraction:r.enableVoiceInteraction},...void 0!==s.disclaimerEnabled&&{disclaimerEnabled:r.disclaimerEnabled},...void 0!==s.disclaimerText&&{disclaimerText:r.disclaimerText},...void 0!==s.disclaimerPosition&&{disclaimerPosition:r.disclaimerPosition},...void 0!==s.onboardingQuestions&&{onboardingQuestions:r.onboardingQuestions},...void 0!==s.onboardingEnabled&&{onboardingEnabled:r.onboardingEnabled},...void 0!==s.showPoweredBy&&{showPoweredBy:r.showPoweredBy},...void 0!==s.collectionPrompt&&{collectionPrompt:r.collectionPrompt},...void 0!==s.allowedDomains&&s.allowedDomains.length>0&&{allowedDomains:r.allowedDomains},...void 0!==s.autoOpen&&{autoOpen:r.autoOpen},...void 0!==s.openDelay&&{openDelay:r.openDelay},...void 0!==s.apiKey&&{apiKey:r.apiKey},...void 0!==s.className&&{className:r.className}}:{...r,apiBaseUrl:r.apiBaseUrl,wsBaseUrl:r.wsBaseUrl,organizationId:r.organizationId};try{e.render(I.createElement(hf,null,I.createElement(ff,l)))}catch(e){t&&(t.innerHTML='<div role="alert" style="position:fixed;bottom:20px;right:20px;max-width:280px;padding:10px 14px;border-radius:10px;background:#1f2937;color:#f3f4f6;font-family:-apple-system,BlinkMacSystemFont,\'Segoe UI\',Roboto,Arial,sans-serif;font-size:13px;line-height:1.4;box-shadow:0 4px 12px rgba(0,0,0,0.15);z-index:2147483647;">Chat is temporarily unavailable. Please refresh the page to try again.</div>')}return r.onOpen&&r.autoOpen&&setTimeout(()=>r.onOpen(),r.openDelay),i},updateConfig:function(e){return r={...r,...e},this.init(r),i},open:function(){return this.updateConfig({autoOpen:!0,openDelay:0}),r.onOpen&&r.onOpen(),i},close:function(){return this.updateConfig({autoOpen:!1}),r.onClose&&r.onClose(),i},toggleTheme:function(){return r.darkMode=!r.darkMode,this.updateConfig({darkMode:r.darkMode}),i},destroy:function(){return e&&(e.unmount(),e=null),n&&n.parentNode&&(n.parentNode.removeChild(n),n=null),t=null,o=null,r={},i},getConfig:function(){return{...r}}};"undefined"!=typeof window&&(window.ChatWidget=i,window.ChatWidget.version=gf,window.ChatWidgetConfig&&document.addEventListener("DOMContentLoaded",()=>{i.init(window.ChatWidgetConfig)}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{(void 0===r.darkMode||r.autoTheme)&&i.updateConfig({darkMode:e.matches})})),"undefined"!=typeof module&&module.exports&&(module.exports=i)}();var mf={exports:{}};function bf(e){try{const t=window[e];return t.setItem("__ft__","1"),t.removeItem("__ft__"),"1"}catch{return"0"}}function yf(){try{return Array.from(navigator.plugins||[]).map(e=>`${e.name}::${e.filename}`).sort().join("|")}catch{return""}}function vf(){try{return Array.from(navigator.mimeTypes||[]).map(e=>e.type).sort().join("|")}catch{return""}}function wf(){try{const e=document.createElement("canvas");e.width=240,e.height=60;const t=e.getContext("2d");return t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(125,1,62,20),t.fillStyle="#069",t.font="11pt no-real-font-abc",t.fillText("user-trace:canvas,🔍<canvas>",2,15),t.fillStyle="rgba(102,204,0,0.7)",t.font="18pt Arial",t.fillText("user-trace:canvas,🔍<canvas>",4,45),e.toDataURL().slice(-50)}catch{return"nocanvas"}}function kf(){try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return"nowebgl";const n=t.getExtension("WEBGL_debug_renderer_info"),r=n?t.getParameter(n.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR);return`${r}::${n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)}`}catch{return"nowebgl"}}function xf(){const e=["Arial","Courier New","Georgia","Times New Roman","Verdana","Helvetica","Comic Sans MS","Impact","Tahoma","Trebuchet MS","Palatino Linotype","Lucida Console","Lucida Sans Unicode","MS Sans Serif","MS Serif","Symbol","Wingdings","Franklin Gothic Medium","Book Antiqua","Garamond","Calibri","Cambria","Consolas","Candara","Optima","Segoe UI","Gill Sans","Century Gothic","Futura"];try{const t=document.createElement("canvas").getContext("2d"),n="monospace",r="mmmmmmmmmmlli",o="72px";t.font=`${o} ${n}`;const a=t.measureText(r).width;return e.filter(e=>(t.font=`${o} '${e}', ${n}`,t.measureText(r).width!==a)).join(",")}catch{return""}}function Sf(){try{return window.OfflineAudioContext||window.webkitOfflineAudioContext?"audio-supported":"noaudio"}catch{return"noaudio"}}var Cf={generateFingerprint:function(){const e=function(){const e=navigator||{},t=screen||{};return{userAgent:e.userAgent||"",language:e.language||"",languages:(e.languages||[]).join(","),platform:e.platform||"",hardwareConcurrency:e.hardwareConcurrency||0,deviceMemory:e.deviceMemory||0,maxTouchPoints:e.maxTouchPoints||0,cookieEnabled:e.cookieEnabled?"1":"0",doNotTrack:e.doNotTrack||"unknown",screenWidth:t.width||0,screenHeight:t.height||0,colorDepth:t.colorDepth||0,pixelDepth:t.pixelDepth||0,devicePixelRatio:"undefined"!=typeof devicePixelRatio?devicePixelRatio:1,timezoneOffset:(new Date).getTimezoneOffset(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"",sessionStorage:bf("sessionStorage"),localStorage:bf("localStorage"),indexedDB:"undefined"!=typeof indexedDB?"1":"0",cpuClass:e.cpuClass||"unknown",oscpu:e.oscpu||"unknown",vendor:e.vendor||"",vendorSub:e.vendorSub||"",productSub:e.productSub||"",plugins:yf(),mimeTypes:vf(),canvas:wf(),webgl:kf(),fonts:xf(),audioContext:Sf()}}(),t=function(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t^e.charCodeAt(n),t&=t;return(t>>>0).toString(16).padStart(8,"0")}(Object.values(e).join("|||")),n=["nocanvas"!==e.canvas,"nowebgl"!==e.webgl&&""!==e.webgl,""!==e.fonts,""!==e.plugins,e.hardwareConcurrency>0,""!==e.timezone];return{id:t,signals:e,confidence:Math.round(n.filter(Boolean).length/n.length*100)}}};const Mf=[{url:"https://api.ipify.org?format=json",parse:e=>e.ip},{url:"https://api64.ipify.org?format=json",parse:e=>e.ip},{url:"https://api.my-ip.io/v2/ip.json",parse:e=>e.ip},{url:"https://ipapi.co/json/",parse:e=>e.ip}];async function Pf(e,t=4e3){const n=new AbortController,r=setTimeout(()=>n.abort(),t);try{const t=await fetch(e,{signal:n.signal});if(!t.ok)throw new Error(`HTTP ${t.status}`);return await t.json()}finally{clearTimeout(r)}}function zf(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)||/^[0-9a-f:]{2,39}$/i.test(e)}var Ef={detectIP:async function(){for(const e of Mf)try{const t=await Pf(e.url),n=e.parse(t);if(n&&zf(n))return{ip:n,source:new URL(e.url).hostname}}catch{}return null},getIPVersion:function(e){return e?/^(\d{1,3}\.){3}\d{1,3}$/.test(e)?"v4":/^[0-9a-f:]{2,39}$/i.test(e)?"v6":"unknown":"unknown"}};let jf={apiKeys:{},preferredProvider:null,timeoutMs:5e3};function Tf(e={}){const t=[e.ipinfo&&{name:"ipinfo.io",tier:"free-with-key",freeLimit:"50,000 req/month",signup:"https://ipinfo.io/signup",buildUrl:t=>`https://ipinfo.io/${t}/json?token=${e.ipinfo}`,parse:e=>{if(e.error)throw new Error(e.error.message||"Failed");const[t,n]=(e.loc||"0,0").split(",").map(Number);return{ip:e.ip||"",country:e.country||"",countryCode:e.country||"",region:e.region||"",regionCode:"",city:e.city||"",zip:e.postal||"",latitude:t,longitude:n,timezone:e.timezone||"",isp:e.org||"",org:e.org||"",proxy:!1,hosting:!1}}},e.ipgeolocation&&{name:"ipgeolocation.io",tier:"free-with-key",freeLimit:"1,000 req/day",signup:"https://ipgeolocation.io/signup.html",buildUrl:t=>`https://api.ipgeolocation.io/ipgeo?apiKey=${e.ipgeolocation}&ip=${t}`,parse:e=>{if(e.message)throw new Error(e.message);return{ip:e.ip||"",country:e.country_name||"",countryCode:e.country_code2||"",region:e.state_prov||"",regionCode:e.state_code||"",city:e.city||"",zip:e.zipcode||"",latitude:parseFloat(e.latitude)||0,longitude:parseFloat(e.longitude)||0,timezone:e.time_zone?.name||"",isp:e.isp||"",org:e.organization||"",proxy:e.security?.is_proxy||!1,hosting:e.security?.is_hosting||!1}}},e.abstractapi&&{name:"abstractapi.com",tier:"free-with-key",freeLimit:"20,000 req/month",signup:"https://app.abstractapi.com/users/signup?target=/api/ip-geolocation",buildUrl:t=>`https://ipgeolocation.abstractapi.com/v1/?api_key=${e.abstractapi}&ip_address=${t}`,parse:e=>{if(e.error)throw new Error(e.error.message||"Failed");return{ip:e.ip_address||"",country:e.country||"",countryCode:e.country_code||"",region:e.region||"",regionCode:e.region_iso_code||"",city:e.city||"",zip:e.postal_code||"",latitude:e.latitude||0,longitude:e.longitude||0,timezone:e.timezone?.name||"",isp:e.connection?.isp_name||"",org:e.connection?.org_name||"",proxy:e.security?.is_vpn||!1,hosting:e.security?.is_hosting||!1}}},e.ip2location&&{name:"ip2location.io",tier:"free-with-key",freeLimit:"30,000 req/month",signup:"https://www.ip2location.io/sign-up",buildUrl:t=>`https://api.ip2location.io/?key=${e.ip2location}&ip=${t}&format=json`,parse:e=>{if(e.error)throw new Error(e.error.error_message||"Failed");return{ip:e.ip||"",country:e.country_name||"",countryCode:e.country_code||"",region:e.region_name||"",regionCode:"",city:e.city_name||"",zip:e.zip_code||"",latitude:e.latitude||0,longitude:e.longitude||0,timezone:e.time_zone||"",isp:e.isp||"",org:e.domain||"",proxy:e.is_proxy||!1,hosting:!1}}},e.ipstack&&{name:"ipstack.com",tier:"free-with-key",freeLimit:"100 req/month",signup:"https://ipstack.com/product",buildUrl:t=>`https://api.ipstack.com/${t}?access_key=${e.ipstack}`,parse:e=>{if(e.error)throw new Error(e.error.info||"Failed");return{ip:e.ip||"",country:e.country_name||"",countryCode:e.country_code||"",region:e.region_name||"",regionCode:e.region_code||"",city:e.city||"",zip:e.zip||"",latitude:e.latitude||0,longitude:e.longitude||0,timezone:e.time_zone?.id||"",isp:e.connection?.isp||"",org:"",proxy:!1,hosting:!1}}}].filter(Boolean),n=[{name:"ip-api.com",tier:"free",freeLimit:"45 req/min (no key needed)",buildUrl:e=>`https://ip-api.com/json/${e}?fields=status,message,country,countryCode,region,regionName,city,zip,lat,lon,timezone,isp,org,proxy,hosting,query`,parse:e=>{if("success"!==e.status)throw new Error(e.message||"Failed");return{ip:e.query||"",country:e.country||"",countryCode:e.countryCode||"",region:e.regionName||"",regionCode:e.region||"",city:e.city||"",zip:e.zip||"",latitude:e.lat||0,longitude:e.lon||0,timezone:e.timezone||"",isp:e.isp||"",org:e.org||"",proxy:e.proxy||!1,hosting:e.hosting||!1}}},{name:"ipwho.is",tier:"free",freeLimit:"unlimited (fair use, no key needed)",buildUrl:e=>`https://ipwho.is/${e}`,parse:e=>{if(!e.success)throw new Error(e.message||"Failed");return{ip:e.ip||"",country:e.country||"",countryCode:e.country_code||"",region:e.region||"",regionCode:e.region_code||"",city:e.city||"",zip:e.postal||"",latitude:e.latitude||0,longitude:e.longitude||0,timezone:e.timezone?.id||"",isp:e.connection?.isp||"",org:e.connection?.org||"",proxy:!1,hosting:!1}}},{name:"ipapi.co",tier:"free",freeLimit:"1,000 req/day (no key needed)",buildUrl:e=>`https://ipapi.co/${e}/json/`,parse:e=>{if(e.error)throw new Error(e.reason||"Failed");return{ip:e.ip||"",country:e.country_name||"",countryCode:e.country_code||"",region:e.region||"",regionCode:e.region_code||"",city:e.city||"",zip:e.postal||"",latitude:e.latitude||0,longitude:e.longitude||0,timezone:e.timezone||"",isp:e.org||"",org:e.org||"",proxy:!1,hosting:!1}}},{name:"freeipapi.com",tier:"free",freeLimit:"unlimited (fair use, no key needed)",buildUrl:e=>`https://freeipapi.com/api/json/${e}`,parse:e=>({ip:e.ipAddress||"",country:e.countryName||"",countryCode:e.countryCode||"",region:e.regionName||"",regionCode:e.regionCode||"",city:e.cityName||"",zip:e.zipCode||"",latitude:e.latitude||0,longitude:e.longitude||0,timezone:e.timeZone||"",isp:"",org:"",proxy:!1,hosting:!1})}],r=["freeipapi.com","ipwho.is","ipapi.co","ip-api.com"];return n.sort((e,t)=>r.indexOf(e.name)-r.indexOf(t.name)),[...t,...n]}async function Nf(e,t=5e3){const n=new AbortController,r=setTimeout(()=>n.abort(),t);try{const t=await fetch(e,{signal:n.signal});if(!t.ok)throw new Error(`HTTP ${t.status}`);return await t.json()}finally{clearTimeout(r)}}const Ff={enableHighAccuracy:!0,timeout:8e3,maximumAge:3e5};function Lf(e={}){return new Promise(t=>"undefined"!=typeof navigator&&navigator.geolocation?"undefined"!=typeof window&&!1===window.isSecureContext?t(null):void navigator.geolocation.getCurrentPosition(e=>t({latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy}),()=>t(null),{...Ff,...e}):t(null))}async function Rf(e,t,n={}){if("number"!=typeof e||"number"!=typeof t)return null;const r=n.timeoutMs||jf.timeoutMs||5e3,o=`https://api.bigdatacloud.net/data/reverse-geocode-client?latitude=${e}&longitude=${t}&localityLanguage=${n.localityLanguage||"en"}`;try{const n=await Nf(o,r),a=n.city||n.locality||"";return a||n.countryName?{city:a,region:n.principalSubdivision||"",regionCode:(n.principalSubdivisionCode||"").split("-").pop()||"",country:n.countryName||"",countryCode:n.countryCode||"",latitude:e,longitude:t}:null}catch{return null}}var Af={configureGeo:function(e={}){e.apiKeys&&(jf.apiKeys={...jf.apiKeys,...e.apiKeys}),void 0!==e.preferredProvider&&(jf.preferredProvider=e.preferredProvider),void 0!==e.timeoutMs&&(jf.timeoutMs=e.timeoutMs)},resolveLocation:async function(e,t={}){const n={apiKeys:{...jf.apiKeys,...t.apiKeys||{}},preferredProvider:t.preferredProvider||jf.preferredProvider,timeoutMs:t.timeoutMs||jf.timeoutMs};let r=Tf(n.apiKeys);if(n.preferredProvider){const e=r.findIndex(e=>e.name===n.preferredProvider);if(e>0){const[t]=r.splice(e,1);r.unshift(t)}}for(const t of r)try{const r=await Nf(t.buildUrl(e),n.timeoutMs);return{...t.parse(r),source:t.name,tier:t.tier}}catch{}return null},listProviders:function(e={}){return Tf({...jf.apiKeys,...e}).map(({name:e,tier:t,freeLimit:n,signup:r})=>({name:e,tier:t,freeLimit:n,signup:r||"—"}))},getBrowserGeolocation:Lf,getGeolocationPermission:async function(){try{if("undefined"==typeof navigator||!navigator.permissions||!navigator.permissions.query)return"unsupported";return(await navigator.permissions.query({name:"geolocation"})).state}catch{return"unsupported"}},reverseGeocode:Rf,getBrowserLocation:async function(e={}){const t=await Lf(e);if(!t)return null;const n=await Rf(t.latitude,t.longitude,e),r=!(!n||!n.city&&!n.country);return{...r?n:{},latitude:t.latitude,longitude:t.longitude,accuracy:t.accuracy,...r?{source:"gps"}:{}}},toMapsUrl:function(e,t){return`https://www.google.com/maps?q=${e},${t}`}};const _f="__ut_sid__",If="__ut_uid__",Bf="__ut_meta__";function Df(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("");return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20)].join("-")}function Of(e,t){try{return e.getItem(t)}catch{return null}}function $f(e,t,n){try{return e.setItem(t,n),!0}catch{return!1}}var Uf={getOrCreateUserID:function(){let e=Of(localStorage,If),t=!1;return e||(e=Df(),t=!0,$f(localStorage,If,e)),{uid:e,isNew:t}},getOrCreateSessionID:function(){let e=Of(sessionStorage,_f),t=!1;return e||(e=Df(),t=!0,$f(sessionStorage,_f,e)),{sid:e,isNew:t}},saveSessionMeta:function(e){try{const t=JSON.stringify({...e,savedAt:(new Date).toISOString()});$f(localStorage,Bf,t)}catch{}},loadSessionMeta:function(){try{const e=Of(localStorage,Bf);return e?JSON.parse(e):null}catch{return null}},clearSession:function(){try{localStorage.removeItem(If)}catch{}try{localStorage.removeItem(Bf)}catch{}try{sessionStorage.removeItem(_f)}catch{}},getBrowserContext:function(){return{userAgent:navigator.userAgent,platform:navigator.platform||"unknown",language:navigator.language||"unknown",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,screenRes:`${screen.width}x${screen.height}`,viewportRes:`${window.innerWidth}x${window.innerHeight}`,colorDepth:screen.colorDepth,touchSupport:navigator.maxTouchPoints>0,cookieEnabled:navigator.cookieEnabled,referrer:document.referrer||null,currentUrl:window.location.href,loadedAt:(new Date).toISOString()}}};const{generateFingerprint:Vf}=Cf,{detectIP:Hf,getIPVersion:Wf}=Ef,{configureGeo:qf,resolveLocation:Qf,listProviders:Kf,getBrowserGeolocation:Yf,getGeolocationPermission:Gf,reverseGeocode:Jf,getBrowserLocation:Xf,toMapsUrl:Zf}=Af,{getOrCreateUserID:eh,getOrCreateSessionID:th,saveSessionMeta:nh,loadSessionMeta:rh,clearSession:oh,getBrowserContext:ah}=Uf;mf.exports=class{constructor(e={}){this._options={onReady:e.onReady||null,onError:e.onError||null,geoFromBrowser:void 0===e.geoFromBrowser||e.geoFromBrowser,geoApiKeys:e.geoApiKeys||null,geoOptions:e.geoOptions||null,cache:!1!==e.cache,maxAgeMs:e.maxAgeMs||3e5,autoInit:e.autoInit||!1,webhookUrl:e.webhookUrl||null},this.profile=null,this._ready=!1,this._options.autoInit&&this.init().catch(()=>{})}async init(){if(this._options.cache){const e=rh();if(e&&e.savedAt){if(Date.now()-new Date(e.savedAt).getTime()<this._options.maxAgeMs)return this.profile=e,this._ready=!0,this._options.onReady&&this._options.onReady(this.profile),this.profile}}try{const{uid:e,isNew:t}=eh(),{sid:n,isNew:r}=th(),{id:o,signals:a,confidence:i}=Vf(),s=this._options.geoApiKeys?{apiKeys:this._options.geoApiKeys}:{},[l,c]=await Promise.all([(async()=>{const e=await Hf(),t=e?.ip||"unknown",n="unknown"!==t?await Qf(t,s):null;return{ip:t,ipVersion:e?Wf(t):"unknown",geo:n}})(),this._collectBrowserLocation()]),{ip:u,ipVersion:d}=l;let p=l.geo,g=null;c&&(g={latitude:c.latitude,longitude:c.longitude,accuracy:c.accuracy},"gps"===c.source&&(p={...p||{},...c}));const f=ah();return this.profile={uid:e,sid:n,isNewUser:t,isNewSession:r,fingerprintId:o,fingerprintConfidence:i,ip:u,ipVersion:d,geo:p||null,browserGeo:g||null,browser:f,raw:a,createdAt:(new Date).toISOString(),...p?{mapsUrl:Zf(p.latitude,p.longitude)}:{}},nh(this.profile),this._options.webhookUrl&&this._sendToWebhook(this.profile),this._ready=!0,this._options.onReady&&this._options.onReady(this.profile),this.profile}catch(e){throw this._options.onError&&this._options.onError(e),e}}async _collectBrowserLocation(){const e=this._options.geoFromBrowser;if(!e)return null;if("auto"===e){if("granted"!==await Gf())return null}return Xf(this._options.geoOptions||{})}async captureBrowserLocation(e={}){const t=await Xf({...this._options.geoOptions||{},...e});return t&&this.profile?(this.profile.browserGeo={latitude:t.latitude,longitude:t.longitude,accuracy:t.accuracy},this.profile.mapsUrl=Zf(t.latitude,t.longitude),"gps"===t.source&&(this.profile.geo={...this.profile.geo||{},...t}),nh(this.profile),this._options.onReady&&this._options.onReady(this.profile),this.profile):this.profile}getProfile(){return this.profile}isKnownUser(e){return this.profile?.uid===e}async refresh(){return oh(),this.profile=null,this._ready=!1,this.init()}clear(){oh(),this.profile=null,this._ready=!1}getSummary(){if(!this.profile)return null;const{uid:e,sid:t,fingerprintId:n,ip:r,geo:o,browser:a,createdAt:i}=this.profile;return{uid:e,sid:t,fingerprintId:n,ip:r,country:o?.country||"unknown",city:o?.city||"unknown",isp:o?.isp||"unknown",proxy:o?.proxy||!1,timezone:o?.timezone||a.timezone,userAgent:a.userAgent,language:a.language,createdAt:i}}async _sendToWebhook(e){try{await fetch(this._options.webhookUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}};var ih=mf.exports.generateFingerprint=Vf,sh=mf.exports.detectIP=Hf,lh=mf.exports.configureGeo=qf,ch=mf.exports.resolveLocation=Qf,uh=mf.exports.listProviders=Kf,dh=mf.exports.getBrowserGeolocation=Yf,ph=mf.exports.getGeolocationPermission=Gf,gh=mf.exports.reverseGeocode=Jf,fh=mf.exports.getBrowserLocation=Xf,hh=mf.exports.getOrCreateUserID=eh,mh=mf.exports.getOrCreateSessionID=th,bh=mf.exports.clearSession=oh,yh=mf.exports.getBrowserContext=ah,vh=mf.exports,wh=e({__proto__:null,clearSession:bh,configureGeo:lh,default:vh,detectIP:sh,generateFingerprint:ih,getBrowserContext:yh,getBrowserGeolocation:dh,getBrowserLocation:fh,getGeolocationPermission:ph,getOrCreateSessionID:mh,getOrCreateUserID:hh,listProviders:uh,resolveLocation:ch,reverseGeocode:gh},[vh]),kh={exports:{}};!function(e){!function(){function t(e,t,n){return e.call.apply(e.bind,arguments)}function n(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function r(e,o,a){return(r=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?t:n).apply(null,arguments)}var o=Date.now||function(){return+new Date};function a(e,t){this.a=e,this.o=t||e,this.c=this.o.document}var i=!!window.FontFace;function s(e,t,n,r){if(t=e.c.createElement(t),n)for(var o in n)n.hasOwnProperty(o)&&("style"==o?t.style.cssText=n[o]:t.setAttribute(o,n[o]));return r&&t.appendChild(e.c.createTextNode(r)),t}function l(e,t,n){(e=e.c.getElementsByTagName(t)[0])||(e=document.documentElement),e.insertBefore(n,e.lastChild)}function c(e){e.parentNode&&e.parentNode.removeChild(e)}function u(e,t,n){t=t||[],n=n||[];for(var r=e.className.split(/\s+/),o=0;o<t.length;o+=1){for(var a=!1,i=0;i<r.length;i+=1)if(t[o]===r[i]){a=!0;break}a||r.push(t[o])}for(t=[],o=0;o<r.length;o+=1){for(a=!1,i=0;i<n.length;i+=1)if(r[o]===n[i]){a=!0;break}a||t.push(r[o])}e.className=t.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function d(e,t){for(var n=e.className.split(/\s+/),r=0,o=n.length;r<o;r++)if(n[r]==t)return!0;return!1}function p(e,t,n){function r(){u&&o&&a&&(u(c),u=null)}t=s(e,"link",{rel:"stylesheet",href:t,media:"all"});var o=!1,a=!0,c=null,u=n||null;i?(t.onload=function(){o=!0,r()},t.onerror=function(){o=!0,c=Error("Stylesheet failed to load"),r()}):setTimeout(function(){o=!0,r()},0),l(e,"head",t)}function g(e,t,n,r){var o=e.c.getElementsByTagName("head")[0];if(o){var a=s(e,"script",{src:t}),i=!1;return a.onload=a.onreadystatechange=function(){i||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(i=!0,n&&n(null),a.onload=a.onreadystatechange=null,"HEAD"==a.parentNode.tagName&&o.removeChild(a))},o.appendChild(a),setTimeout(function(){i||(i=!0,n&&n(Error("Script load timeout")))},r||5e3),a}return null}function f(){this.a=0,this.c=null}function h(e){return e.a++,function(){e.a--,b(e)}}function m(e,t){e.c=t,b(e)}function b(e){0==e.a&&e.c&&(e.c(),e.c=null)}function y(e){this.a=e||"-"}function v(e,t){this.c=e,this.f=4,this.a="n";var n=(t||"n4").match(/^([nio])([1-9])$/i);n&&(this.a=n[1],this.f=parseInt(n[2],10))}function w(e){var t=[];e=e.split(/,\s*/);for(var n=0;n<e.length;n++){var r=e[n].replace(/['"]/g,"");-1!=r.indexOf(" ")||/^\d/.test(r)?t.push("'"+r+"'"):t.push(r)}return t.join(",")}function k(e){return e.a+e.f}function x(e){var t="normal";return"o"===e.a?t="oblique":"i"===e.a&&(t="italic"),t}function S(e){var t=4,n="n",r=null;return e&&((r=e.match(/(normal|oblique|italic)/i))&&r[1]&&(n=r[1].substr(0,1).toLowerCase()),(r=e.match(/([1-9]00|normal|bold)/i))&&r[1]&&(/bold/i.test(r[1])?t=7:/[1-9]00/.test(r[1])&&(t=parseInt(r[1].substr(0,1),10)))),n+t}function C(e,t){this.c=e,this.f=e.o.document.documentElement,this.h=t,this.a=new y("-"),this.j=!1!==t.events,this.g=!1!==t.classes}function M(e){if(e.g){var t=d(e.f,e.a.c("wf","active")),n=[],r=[e.a.c("wf","loading")];t||n.push(e.a.c("wf","inactive")),u(e.f,n,r)}P(e,"inactive")}function P(e,t,n){e.j&&e.h[t]&&(n?e.h[t](n.c,k(n)):e.h[t]())}function z(){this.c={}}function E(e,t){this.c=e,this.f=t,this.a=s(this.c,"span",{"aria-hidden":"true"},this.f)}function j(e){l(e.c,"body",e.a)}function T(e){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+w(e.c)+";font-style:"+x(e)+";font-weight:"+e.f+"00;"}function N(e,t,n,r,o,a){this.g=e,this.j=t,this.a=r,this.c=n,this.f=o||3e3,this.h=a||void 0}function F(e,t,n,r,o,a,i){this.v=e,this.B=t,this.c=n,this.a=r,this.s=i||"BESbswy",this.f={},this.w=o||3e3,this.u=a||null,this.m=this.j=this.h=this.g=null,this.g=new E(this.c,this.s),this.h=new E(this.c,this.s),this.j=new E(this.c,this.s),this.m=new E(this.c,this.s),e=T(e=new v(this.a.c+",serif",k(this.a))),this.g.a.style.cssText=e,e=T(e=new v(this.a.c+",sans-serif",k(this.a))),this.h.a.style.cssText=e,e=T(e=new v("serif",k(this.a))),this.j.a.style.cssText=e,e=T(e=new v("sans-serif",k(this.a))),this.m.a.style.cssText=e,j(this.g),j(this.h),j(this.j),j(this.m)}y.prototype.c=function(e){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n].replace(/[\W_]+/g,"").toLowerCase());return t.join(this.a)},N.prototype.start=function(){var e=this.c.o.document,t=this,n=o(),r=new Promise(function(r,a){!function i(){o()-n>=t.f?a():e.fonts.load(function(e){return x(e)+" "+e.f+"00 300px "+w(e.c)}(t.a),t.h).then(function(e){1<=e.length?r():setTimeout(i,25)},function(){a()})}()}),a=null,i=new Promise(function(e,n){a=setTimeout(n,t.f)});Promise.race([i,r]).then(function(){a&&(clearTimeout(a),a=null),t.g(t.a)},function(){t.j(t.a)})};var L={D:"serif",C:"sans-serif"},R=null;function A(){if(null===R){var e=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);R=!!e&&(536>parseInt(e[1],10)||536===parseInt(e[1],10)&&11>=parseInt(e[2],10))}return R}function _(e,t,n){for(var r in L)if(L.hasOwnProperty(r)&&t===e.f[L[r]]&&n===e.f[L[r]])return!0;return!1}function I(e){var t,n=e.g.a.offsetWidth,a=e.h.a.offsetWidth;(t=n===e.f.serif&&a===e.f["sans-serif"])||(t=A()&&_(e,n,a)),t?o()-e.A>=e.w?A()&&_(e,n,a)&&(null===e.u||e.u.hasOwnProperty(e.a.c))?B(e,e.v):B(e,e.B):function(e){setTimeout(r(function(){I(this)},e),50)}(e):B(e,e.v)}function B(e,t){setTimeout(r(function(){c(this.g.a),c(this.h.a),c(this.j.a),c(this.m.a),t(this.a)},e),0)}function D(e,t,n){this.c=e,this.a=t,this.f=0,this.m=this.j=!1,this.s=n}F.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=o(),I(this)};var O=null;function $(e){0==--e.f&&e.j&&(e.m?((e=e.a).g&&u(e.f,[e.a.c("wf","active")],[e.a.c("wf","loading"),e.a.c("wf","inactive")]),P(e,"active")):M(e.a))}function U(e){this.j=e,this.a=new z,this.h=0,this.f=this.g=!0}function V(e,t,n,o,a){var i=0==--e.h;(e.f||e.g)&&setTimeout(function(){var e=a||null,s=o||{};if(0===n.length&&i)M(t.a);else{t.f+=n.length,i&&(t.j=i);var l,c=[];for(l=0;l<n.length;l++){var d=n[l],p=s[d.c],g=t.a,f=d;if(g.g&&u(g.f,[g.a.c("wf",f.c,k(f).toString(),"loading")]),P(g,"fontloading",f),g=null,null===O)if(window.FontFace){f=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent);var h=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);O=f?42<parseInt(f[1],10):!h}else O=!1;g=O?new N(r(t.g,t),r(t.h,t),t.c,d,t.s,p):new F(r(t.g,t),r(t.h,t),t.c,d,t.s,e,p),c.push(g)}for(l=0;l<c.length;l++)c[l].start()}},0)}function H(e,t){this.c=e,this.a=t}function W(e,t){this.c=e,this.a=t}function q(e,t){this.c=e||Q,this.a=[],this.f=[],this.g=t||""}D.prototype.g=function(e){var t=this.a;t.g&&u(t.f,[t.a.c("wf",e.c,k(e).toString(),"active")],[t.a.c("wf",e.c,k(e).toString(),"loading"),t.a.c("wf",e.c,k(e).toString(),"inactive")]),P(t,"fontactive",e),this.m=!0,$(this)},D.prototype.h=function(e){var t=this.a;if(t.g){var n=d(t.f,t.a.c("wf",e.c,k(e).toString(),"active")),r=[],o=[t.a.c("wf",e.c,k(e).toString(),"loading")];n||r.push(t.a.c("wf",e.c,k(e).toString(),"inactive")),u(t.f,r,o)}P(t,"fontinactive",e),$(this)},U.prototype.load=function(e){this.c=new a(this.j,e.context||this.j),this.g=!1!==e.events,this.f=!1!==e.classes,function(e,t,n){var r=[],o=n.timeout;!function(e){e.g&&u(e.f,[e.a.c("wf","loading")]),P(e,"loading")}(t);r=function(e,t,n){var r,o=[];for(r in t)if(t.hasOwnProperty(r)){var a=e.c[r];a&&o.push(a(t[r],n))}return o}(e.a,n,e.c);var a=new D(e.c,t,o);for(e.h=r.length,t=0,n=r.length;t<n;t++)r[t].load(function(t,n,r){V(e,a,t,n,r)})}(this,new C(this.c,e),e)},H.prototype.load=function(e){function t(){if(a["__mti_fntLst"+r]){var n,o=a["__mti_fntLst"+r](),i=[];if(o)for(var s=0;s<o.length;s++){var l=o[s].fontfamily;null!=o[s].fontStyle&&null!=o[s].fontWeight?(n=o[s].fontStyle+o[s].fontWeight,i.push(new v(l,n))):i.push(new v(l))}e(i)}else setTimeout(function(){t()},50)}var n=this,r=n.a.projectId,o=n.a.version;if(r){var a=n.c.o;g(this.c,(n.a.api||"https://fast.fonts.net/jsapi")+"/"+r+".js"+(o?"?v="+o:""),function(o){o?e([]):(a["__MonotypeConfiguration__"+r]=function(){return n.a},t())}).id="__MonotypeAPIScript__"+r}else e([])},W.prototype.load=function(e){var t,n,r=this.a.urls||[],o=this.a.families||[],a=this.a.testStrings||{},i=new f;for(t=0,n=r.length;t<n;t++)p(this.c,r[t],h(i));var s=[];for(t=0,n=o.length;t<n;t++)if((r=o[t].split(":"))[1])for(var l=r[1].split(","),c=0;c<l.length;c+=1)s.push(new v(r[0],l[c]));else s.push(new v(r[0]));m(i,function(){e(s,a)})};var Q="https://fonts.googleapis.com/css";function K(e){this.f=e,this.a=[],this.c={}}var Y={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},G={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},J={i:"i",italic:"i",n:"n",normal:"n"},X=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function Z(e,t){this.c=e,this.a=t}var ee={Arimo:!0,Cousine:!0,Tinos:!0};function te(e,t){this.c=e,this.a=t}function ne(e,t){this.c=e,this.f=t,this.a=[]}Z.prototype.load=function(e){var t=new f,n=this.c,r=new q(this.a.api,this.a.text),o=this.a.families;!function(e,t){for(var n=t.length,r=0;r<n;r++){var o=t[r].split(":");3==o.length&&e.f.push(o.pop());var a="";2==o.length&&""!=o[1]&&(a=":"),e.a.push(o.join(a))}}(r,o);var a=new K(o);!function(e){for(var t=e.f.length,n=0;n<t;n++){var r=e.f[n].split(":"),o=r[0].replace(/\+/g," "),a=["n4"];if(2<=r.length){var i;if(i=[],s=r[1])for(var s,l=(s=s.split(",")).length,c=0;c<l;c++){var u;if((u=s[c]).match(/^[\w-]+$/))if(null==(d=X.exec(u.toLowerCase())))u="";else{if(u=null==(u=d[2])||""==u?"n":J[u],null==(d=d[1])||""==d)d="4";else var d=G[d]||(isNaN(d)?"4":d.substr(0,1));u=[u,d].join("")}else u="";u&&i.push(u)}0<i.length&&(a=i),3==r.length&&(i=[],0<(r=(r=r[2])?r.split(","):i).length&&(r=Y[r[0]])&&(e.c[o]=r))}for(e.c[o]||(r=Y[o])&&(e.c[o]=r),r=0;r<a.length;r+=1)e.a.push(new v(o,a[r]))}}(a),p(n,function(e){if(0==e.a.length)throw Error("No fonts to load!");if(-1!=e.c.indexOf("kit="))return e.c;for(var t=e.a.length,n=[],r=0;r<t;r++)n.push(e.a[r].replace(/ /g,"+"));return t=e.c+"?family="+n.join("%7C"),0<e.f.length&&(t+="&subset="+e.f.join(",")),0<e.g.length&&(t+="&text="+encodeURIComponent(e.g)),t}(r),h(t)),m(t,function(){e(a.a,a.c,ee)})},te.prototype.load=function(e){var t=this.a.id,n=this.c.o;t?g(this.c,(this.a.api||"https://use.typekit.net")+"/"+t+".js",function(t){if(t)e([]);else if(n.Typekit&&n.Typekit.config&&n.Typekit.config.fn){t=n.Typekit.config.fn;for(var r=[],o=0;o<t.length;o+=2)for(var a=t[o],i=t[o+1],s=0;s<i.length;s++)r.push(new v(a,i[s]));try{n.Typekit.load({events:!1,classes:!1,async:!0})}catch(e){}e(r)}},2e3):e([])},ne.prototype.load=function(e){var t=this.f.id,n=this.c.o,r=this;t?(n.__webfontfontdeckmodule__||(n.__webfontfontdeckmodule__={}),n.__webfontfontdeckmodule__[t]=function(t,n){for(var o=0,a=n.fonts.length;o<a;++o){var i=n.fonts[o];r.a.push(new v(i.name,S("font-weight:"+i.weight+";font-style:"+i.style)))}e(r.a)},g(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+function(e){return e.o.location.hostname||e.a.location.hostname}(this.c)+"/"+t+".js",function(t){t&&e([])})):e([])};var re=new U(window);re.a.c.custom=function(e,t){return new W(t,e)},re.a.c.fontdeck=function(e,t){return new ne(t,e)},re.a.c.monotype=function(e,t){return new H(t,e)},re.a.c.typekit=function(e,t){return new te(t,e)},re.a.c.google=function(e,t){return new Z(t,e)};var oe={load:r(re.load,re)};e.exports?e.exports=oe:(window.WebFont=oe,window.WebFontConfig&&re.load(window.WebFontConfig))}()}(kh);var xh=kh.exports,Sh=e({__proto__:null,default:xh},[xh])}();
|