@vapi-ai/client-sdk-react
Version:
Vapi Client React SDK
25 lines • 173 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),O=require("react"),vi=require("@vapi-ai/web");function Si(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const g=Si(O),ur=({publicKey:e,callOptions:t,apiUrl:n,enabled:r=!0,onCallStart:i,onCallEnd:l,onMessage:a,onError:o,onTranscript:c})=>{const[s]=O.useState(()=>e?new vi(e,n):null),[u,h]=O.useState(!1),[d,p]=O.useState(!1),[k,w]=O.useState(!1),[T,x]=O.useState(0),[A,E]=O.useState("disconnected"),N=O.useRef({onCallStart:i,onCallEnd:l,onMessage:a,onError:o,onTranscript:c});O.useEffect(()=>{N.current={onCallStart:i,onCallEnd:l,onMessage:a,onError:o,onTranscript:c}}),O.useEffect(()=>{if(!s)return;const R=()=>{h(!0),E("connected"),N.current.onCallStart?.()},q=()=>{h(!1),E("disconnected"),x(0),p(!1),w(!1),N.current.onCallEnd?.()},F=()=>{p(!0)},L=()=>{p(!1)},I=$=>{x($)},M=$=>{$.type==="transcript"&&$.transcriptType==="final"&&($.role==="user"||$.role==="assistant")&&N.current.onTranscript?.({role:$.role,text:$.transcript,timestamp:new Date}),N.current.onMessage?.($)},z=$=>{console.error("Vapi error:",$),E("disconnected"),h(!1),p(!1),N.current.onError?.($)};return s.on("call-start",R),s.on("call-end",q),s.on("speech-start",F),s.on("speech-end",L),s.on("volume-level",I),s.on("message",M),s.on("error",z),()=>{s.removeListener("call-start",R),s.removeListener("call-end",q),s.removeListener("speech-start",F),s.removeListener("speech-end",L),s.removeListener("volume-level",I),s.removeListener("message",M),s.removeListener("error",z)}},[s]),O.useEffect(()=>()=>{s&&s.stop()},[s]);const P=O.useCallback(async()=>{if(!s||!r){console.error("Cannot start call: no vapi instance or not enabled");return}try{console.log("Starting call with options:",t),E("connecting"),await s.start(t)}catch(R){console.error("Error starting call:",R),E("disconnected"),N.current.onError?.(R)}},[s,t,r]),b=O.useCallback(async()=>{if(!s){console.log("Cannot end call: no vapi instance");return}console.log("Ending call"),s.stop()},[s]),V=O.useCallback(async()=>{u?await b():await P()},[u,P,b]),j=O.useCallback(()=>{if(!s||!u){console.log("Cannot toggle mute: no vapi instance or call not active");return}const R=!k;s.setMuted(R),w(R)},[s,u,k]);return{isCallActive:u,isSpeaking:d,volumeLevel:T,connectionStatus:A,isMuted:k,startCall:P,endCall:b,toggleCall:V,toggleMute:j}};async function Ei(e,t){const n=e.getReader();let r;for(;!(r=await n.read()).done;)t(r.value)}function Ai(e){let t,n,r,i=!1;return function(a){t===void 0?(t=a,n=0,r=-1):t=Mi(t,a);const o=t.length;let c=0;for(;n<o;){i&&(t[n]===10&&(c=++n),i=!1);let s=-1;for(;n<o&&s===-1;++n)switch(t[n]){case 58:r===-1&&(r=n-c);break;case 13:i=!0;case 10:s=n;break}if(s===-1)break;e(t.subarray(c,s),r),c=n,r=-1}c===o?t=void 0:c!==0&&(t=t.subarray(c),n-=c)}}function Ii(e,t,n){let r=wn();const i=new TextDecoder;return function(a,o){if(a.length===0)n?.(r),r=wn();else if(o>0){const c=i.decode(a.subarray(0,o)),s=o+(a[o+1]===32?2:1),u=i.decode(a.subarray(s));switch(c){case"data":r.data=r.data?r.data+`
`+u:u;break;case"event":r.event=u;break;case"id":e(r.id=u);break;case"retry":const h=parseInt(u,10);isNaN(h)||t(r.retry=h);break}}}}function Mi(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function wn(){return{data:"",event:"",id:"",retry:void 0}}var Ti=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const _t="text/event-stream",Li=1e3,Cn="last-event-id";function Fi(e,t){var{signal:n,headers:r,onopen:i,onmessage:l,onclose:a,onerror:o,openWhenHidden:c,fetch:s}=t,u=Ti(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((h,d)=>{const p=Object.assign({},r);p.accept||(p.accept=_t);let k;function w(){k.abort(),document.hidden||P()}c||document.addEventListener("visibilitychange",w);let T=Li,x=0;function A(){document.removeEventListener("visibilitychange",w),window.clearTimeout(x),k.abort()}n?.addEventListener("abort",()=>{A(),h()});const E=s??window.fetch,N=i??Pi;async function P(){var b;k=new AbortController;try{const V=await E(e,Object.assign(Object.assign({},u),{headers:p,signal:k.signal}));await N(V),await Ei(V.body,Ai(Ii(j=>{j?p[Cn]=j:delete p[Cn]},j=>{T=j},l))),a?.(),A(),h()}catch(V){if(!k.signal.aborted)try{const j=(b=o?.(V))!==null&&b!==void 0?b:T;window.clearTimeout(x),x=window.setTimeout(P,j)}catch(j){A(),d(j)}}}P()})}function Pi(e){const t=e.headers.get("content-type");if(!t?.startsWith(_t))throw new Error(`Expected content-type to be ${_t}, Actual: ${t}`)}class zi extends Error{}class vn extends Error{}class cr{apiUrl;publicKey;abortController=null;constructor(t){this.publicKey=t.publicKey,this.apiUrl=t.apiUrl||"https://api.vapi.ai"}async streamChat(t,n,r,i){this.abort(),this.abortController=new AbortController;try{await Fi(`${this.apiUrl}/chat/web`,{method:"POST",headers:{Authorization:`Bearer ${this.publicKey}`,"Content-Type":"application/json","X-Client-ID":"vapi-widget"},body:JSON.stringify({...t,stream:!0}),signal:this.abortController.signal,async onopen(l){if(!(l.ok&&l.headers.get("content-type")?.includes("text/event-stream")))throw l.status>=400&&l.status<500&&l.status!==429?new vn(`HTTP error! status: ${l.status}`):new zi(`HTTP error! status: ${l.status}`)},onmessage(l){if(l.data!=="[DONE]")try{const a=JSON.parse(l.data);(a.delta!==void 0||a.output!==void 0||a.path!==void 0)&&n(a)}catch{console.warn(`Failed to parse SSE data: ${l.data}`)}},onclose(){i?.()},onerror(l){if(l instanceof vn)throw r?.(l),l;if(l instanceof Error&&l.name==="AbortError")throw i?.(),l;console.warn("Retriable error occurred, retrying...",l)}})}catch(l){l instanceof Error&&l.name!=="AbortError"&&r?.(l)}return()=>this.abort()}abort(){this.abortController&&(this.abortController.abort(),this.abortController=null)}}function hr(e){return e.delta&&e.path==="chat.output[0].content"?e.delta:e.output!==void 0?e.output:null}const pr=(e,t,n,r,i)=>{if(!t||!e.trim())throw new Error("Chat is disabled or message is empty");if(!n||!r)throw new Error("Missing required configuration: publicKey and assistantId");if(!i)throw new Error("Chat client not initialized")},fr=e=>({role:"user",content:e.trim(),timestamp:new Date}),mr=e=>({role:"assistant",content:e,timestamp:new Date}),Ht=(e,t)=>{e.current="",t.current=null},dr=(e,t)=>{t(n=>{const r=[...n];return e.current=r.length,r.push({role:"assistant",content:"",timestamp:new Date}),r})},gr=(e,t,n,r)=>{console.error("Stream error:",e),t(!1),n.current=null,r?.(e)},yr=(e,t,n,r,i,l)=>{e.sessionId&&e.sessionId!==t&&n(e.sessionId);const a=hr(e);if(a&&(r.current+=a,i.current!==null)){const o=i.current;l(c=>{const s=[...c];return o<s.length&&(s[o]={...s[o],content:r.current}),s})}},xr=(e,t,n,r)=>{if(e(!1),t.current=null,n.current){const i=mr(n.current);r?.(i)}},br=({enabled:e=!0,publicKey:t,assistantId:n,assistantOverrides:r,apiUrl:i,sessionId:l,firstChatMessage:a,onMessage:o,onError:c})=>{const[s,u]=O.useState(()=>e&&a?[{role:"assistant",content:a,timestamp:new Date}]:[]),[h,d]=O.useState(!1),[p,k]=O.useState(!1),[w,T]=O.useState(l),x=O.useRef(null),A=O.useRef(null),E=O.useRef(""),N=O.useRef(null);O.useEffect(()=>(t&&e&&(x.current=new cr({publicKey:t,apiUrl:i})),()=>{A.current?.()}),[t,i,e]),O.useEffect(()=>{l&&T(l)},[l]);const P=O.useCallback(j=>{u(R=>[...R,j]),o?.(j)},[o]),b=O.useCallback(async j=>{try{pr(j,e,t,n,x.current),k(!0);const R=fr(j);P(R),Ht(E,N),dr(N,u),d(!0);const q=z=>gr(z,d,N,c),F=z=>yr(z,w,T,E,N,u),L=()=>xr(d,N,E,o);let I;a&&a.trim()!==""&&s.length===1&&s[0].role==="assistant"?I=[{role:"assistant",content:a},{role:"user",content:j.trim()}]:I=j.trim();const M=await x.current.streamChat({input:I,assistantId:n,assistantOverrides:r,sessionId:w,stream:!0},F,q,L);A.current=M}catch(R){throw console.error("Error sending message:",R),d(!1),N.current=null,c?.(R),R}finally{k(!1)}},[e,t,n,r,w,P,c,o,a,s]),V=O.useCallback(()=>{u(e&&a?[{role:"assistant",content:a,timestamp:new Date}]:[]),A.current?.(),d(!1),k(!1),Ht(E,N),T(void 0)},[e,a]);return{messages:s,isTyping:h,isLoading:p,sessionId:w,isEnabled:e,sendMessage:b,clearMessages:V}},kr=({mode:e,publicKey:t,assistantId:n,assistant:r,assistantOverrides:i,apiUrl:l,firstChatMessage:a,onCallStart:o,onCallEnd:c,onMessage:s,onError:u})=>{const[h,d]=O.useState(null),[p,k]=O.useState(!1),[w,T]=O.useState([]),x=()=>{if(r)return r;if(n)return i?{assistantId:n,assistantOverrides:i}:n},A=e==="voice"||e==="hybrid",E=ur({publicKey:t,callOptions:x(),apiUrl:l,enabled:A,onCallStart:()=>{e==="hybrid"&&(P.clearMessages(),T([])),d("voice"),k(!1),o?.()},onCallEnd:()=>{d(null),c?.()},onMessage:s,onError:u,onTranscript:I=>{const M={role:I.role,content:I.text,timestamp:I.timestamp};T(z=>[...z,M])}}),N=e==="chat"||e==="hybrid",P=br({enabled:N,publicKey:N?t:void 0,assistantId:N?n:void 0,assistantOverrides:N?i:void 0,apiUrl:l,onMessage:s,onError:u,firstChatMessage:a}),b=e==="voice"?w:e==="chat"?P.messages:[...w,...P.messages].sort((I,M)=>I.timestamp.getTime()-M.timestamp.getTime()),V=O.useCallback(I=>{k(I.length>0)},[]),j=O.useCallback(async I=>{e==="hybrid"&&(E.isCallActive&&await E.endCall(),h!=="chat"&&(T([]),P.clearMessages()),d("chat")),await P.sendMessage(I)},[e,P,E,h]),R=O.useCallback(async()=>{e==="hybrid"&&!E.isCallActive&&(P.clearMessages(),T([]),d("voice"),k(!1)),await E.toggleCall()},[e,E,P]),q=O.useCallback(()=>{T([]),P.clearMessages(),d(null),k(!1)},[P]),F=A&&!E.isCallActive&&!P.isLoading,L=N&&!P.isLoading;return{mode:e,activeMode:h,conversation:b,voice:{...E,isAvailable:F,toggleCall:R},chat:{...P,isAvailable:L,sendMessage:j,handleInput:V},clearConversation:q,isUserTyping:p}},wr={tiny:{button:{width:"3rem",height:"3rem"},expanded:{width:"18rem",height:"20rem"},icon:{width:"1.25rem",height:"1.25rem"}},compact:{button:{paddingLeft:"1rem",paddingRight:"1rem",paddingTop:"0.75rem",paddingBottom:"0.75rem",height:"3rem"},expanded:{width:"24rem",height:"32rem"},icon:{width:"1.25rem",height:"1.25rem"}},full:{button:{paddingLeft:"1.5rem",paddingRight:"1.5rem",paddingTop:"1rem",paddingBottom:"1rem",height:"3.5rem"},expanded:{width:"28rem",height:"40rem"},icon:{width:"1.5rem",height:"1.5rem"}}},Ni={none:{borderRadius:"0"},small:{borderRadius:"0.5rem"},medium:{borderRadius:"1rem"},large:{borderRadius:"1.5rem"}},ji={none:{borderRadius:"0"},small:{borderRadius:"0.5rem"},medium:{borderRadius:"1rem"},large:{borderRadius:"1.5rem"}},Vi={none:"rounded-none",small:"rounded-md",medium:"rounded-lg",large:"rounded-xl"},Ri={"bottom-right":{bottom:"1.5rem",right:"1.5rem"},"bottom-left":{bottom:"1.5rem",left:"1.5rem"},"top-right":{top:"1.5rem",right:"1.5rem"},"top-left":{top:"1.5rem",left:"1.5rem"},"bottom-center":{bottom:"1.5rem",left:"50%",transform:"translateX(-50%)"}},It={none:{borderRadius:"0"},small:{borderRadius:"0.5rem"},medium:{borderRadius:"1rem"},large:{borderRadius:"1.5rem"}},Bi=({consentTitle:e="Terms and conditions",consentContent:t,onAccept:n,onCancel:r,colors:i,styles:l,radius:a})=>{const o=l.theme==="dark",c=o?"#1F2937":"#E5E7EB",s=o?"#FFFFFF":"#111827",u=o?"#D1D5DB":"#4B5563",h={...It[a],backgroundColor:i.baseColor,border:`1px solid ${c}`,boxShadow:o?"0 25px 50px -12px rgba(0, 0, 0, 0.5)":"0 25px 50px -12px rgb(0 0 0 / 0.25)",padding:"1rem",maxWidth:"360px",minWidth:"300px"},d={color:s,fontSize:"1rem",fontWeight:"600",marginBottom:"0.75rem",margin:"0 0 0.75rem 0"},p={color:u,fontSize:"0.75rem",lineHeight:"1.5",marginBottom:"1rem",maxHeight:"120px",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:o?"#4B5563 transparent":"#CBD5E1 transparent"},k={display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"0.5rem"},w={...It[a],backgroundColor:"transparent",border:o?"none":"1px solid #D1D5DB",color:o?"#9CA3AF":"#4B5563",padding:"0.5rem 1rem",fontSize:"0.75rem",fontWeight:"500",cursor:"pointer",transition:"all 0.2s ease-in-out"},T={...It[a],backgroundColor:o?i.ctaButtonTextColor||"#FFFFFF":i.ctaButtonColor||"#000000",color:o?i.ctaButtonColor||"#000000":i.ctaButtonTextColor||"#FFFFFF",border:"none",padding:"0.5rem 1rem",fontSize:"0.75rem",fontWeight:"500",cursor:"pointer",transition:"all 0.2s ease-in-out"};return C.jsxs("div",{style:h,children:[C.jsx("style",{children:`
/* Custom scrollbar styles for webkit browsers */
.consent-terms-content::-webkit-scrollbar {
width: 6px;
}
.consent-terms-content::-webkit-scrollbar-track {
background: transparent;
}
.consent-terms-content::-webkit-scrollbar-thumb {
background: ${o?"#4B5563":"#CBD5E1"};
border-radius: 3px;
}
.consent-terms-content::-webkit-scrollbar-thumb:hover {
background: ${o?"#6B7280":"#94A3B8"};
}
.consent-cancel-button:hover {
background-color: ${o?"#1F2937":"#F9FAFB"} !important;
${o?"":"border-color: #9CA3AF !important;"}
}
.consent-accept-button:hover {
opacity: 0.9;
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
`}),C.jsx("h3",{style:d,children:e}),C.jsx("div",{className:"consent-terms-content",style:p,dangerouslySetInnerHTML:{__html:t}}),C.jsxs("div",{style:k,children:[C.jsx("button",{className:"consent-cancel-button",onClick:r,style:w,children:"Cancel"}),C.jsx("button",{className:"consent-accept-button",onClick:n,style:T,children:"Accept"})]})]})},dt=({size:e=40,connectionStatus:t,isCallActive:n,isSpeaking:r,isTyping:i,isError:l,volumeLevel:a=0,baseColor:o="#9CA3AF",animationType:c,animationSpeed:s,colors:u,barCount:h=17,barWidthRatio:d=.08,barHeightRatio:p=.19,className:k=""})=>{const[w,T]=O.useState(0),x=n,A=x?5:h,N=l?{animationType:"pulse",colors:"#EF4444",animationSpeed:300}:t==="connecting"?{animationType:"spin",colors:"#FCD34D",animationSpeed:1e3}:n&&r?{animationType:"scale",colors:"#F87171",animationSpeed:600}:n?{animationType:"none",colors:"#62F6B5",animationSpeed:1e3}:i?{animationType:"sequential",colors:"#60A5FA",animationSpeed:1e3}:{animationType:"none",colors:o,animationSpeed:3e3},P=c??N.animationType,b=s??N.animationSpeed,V=u??N.colors;O.useEffect(()=>{if(P!=="none"){const W=Date.now();let X;const m=()=>{T((Date.now()-W)/b),X=requestAnimationFrame(m)};return X=requestAnimationFrame(m),()=>cancelAnimationFrame(X)}},[P,b]);const j=x?24:253,q=(()=>{const W=j/2,X=j/2,m=j*.38;return Array.from({length:A},(H,Y)=>{const f=Y/A*2*Math.PI-Math.PI/2,Q=W+m*Math.cos(f),le=X+m*Math.sin(f),K=f*180/Math.PI+90;return{x:Q,y:le,rotate:K}})})(),F=()=>{const X=[.5,.75,1,.75,.5];return Array.from({length:5},(m,H)=>{const Q=X[H];return{x:1+H*4.8,y:6,width:2.8,baseHeight:16*Q,maxHeight:22,delay:H===2?0:Math.abs(H-2)*.2,rotate:0}})},L=W=>Array.isArray(V)?V[W%V.length]:V,I=(W,X)=>{const m=w%1;switch(P){case"rotate-fade":{const H=A,Y=m*H%H,Q=Math.min(Math.abs(W-Y),Math.abs(W-Y+H),Math.abs(W-Y-H))/(H/2);return{opacity:Math.max(.14,1-Q*.86),transform:""}}case"scale":{if(x&&"delay"in X){const H=X,Y=Math.max(0,Math.min(1,a)),f=[{sensitivity:.8,frequency:1.2,baseActivity:.3},{sensitivity:1,frequency:1.8,baseActivity:.4},{sensitivity:1.2,frequency:2.5,baseActivity:.5},{sensitivity:1,frequency:2,baseActivity:.4},{sensitivity:.9,frequency:1.5,baseActivity:.35}],Q=f[W]||f[2],K=w%1*Q.frequency%1,oe=Math.sin(K*2*Math.PI)*.3+Math.sin(K*6*Math.PI)*.2+Math.sin(K*12*Math.PI)*.1,ie=Y*Q.sensitivity,ke=Math.max(0,Math.min(1,Q.baseActivity+ie*.6+oe*Y*.4)),fe=.7+ke*1.1,ve=H.baseHeight*fe,je=12-ve/2;return{opacity:.4+ke*.6,height:ve,y:je,transform:""}}if(!x){const H=Math.max(0,Math.min(1,a)),Y=w%1,f=W/A*2*Math.PI,Q=Math.sin(Y*4*Math.PI+f)*.3+Math.sin(Y*8*Math.PI+f*2)*.2+Math.sin(Y*16*Math.PI+f*3)*.1,le=.7+.3*Math.sin(f+Math.PI/4),K=Math.max(0,Math.min(1,.3+H*le*.5+Q*H*.2));return{opacity:.4+K*.6,transform:K>.5?`scale(${1+(K-.5)*.4})`:""}}return{opacity:1,transform:""}}case"spin":{const H=m*2*Math.PI%(2*Math.PI),Y=W/A*2*Math.PI;return{opacity:.3+.7*(1-Math.abs((H-Y+Math.PI)%(2*Math.PI)-Math.PI)/Math.PI),transform:""}}case"pulse":return{opacity:.5+.5*Math.sin(m*2*Math.PI),transform:""};case"sequential":{const H=Math.floor(m*A)%A;return{opacity:W===H||W===(H+1)%A?1:.3,transform:""}}case"wave":{const H=m*2*Math.PI,Y=W/A*2*Math.PI;return{opacity:.5+.5*Math.sin(H+Y),transform:""}}default:return{opacity:1,transform:""}}},M=x?2.8:j*d,z=x?12:j*p,$=M/2,ne=x?F():q;return C.jsx("div",{className:`relative ${k}`,style:{width:e,height:e},children:C.jsxs("svg",{width:e,height:e,viewBox:`0 0 ${j} ${x?24:j+1}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[!x&&C.jsx("circle",{cx:j/2,cy:j/2,r:j*.38,fill:"none",stroke:o,strokeWidth:"1",opacity:"0.05"}),ne.map((W,X)=>{const m=P!=="none",H=m?I(X,W):{opacity:1},Y=m?L(X):V===o?o:L(X);if(x&&"width"in W){const f=W,Q=H.y!==void 0?H.y:12-f.baseHeight/2;return C.jsx("rect",{x:f.x,y:Q,width:f.width,height:H.height!==void 0?H.height:f.baseHeight,fill:Y,opacity:H.opacity,rx:f.width/2},X)}else{const f=W;let Q=z;if(P==="rotate-fade"){const oe=A,ie=w%1*oe,fe=Math.min(Math.abs(X-ie),Math.abs(X-ie+oe),Math.abs(X-ie-oe))/(oe/2),ve=.4+.6*(1-fe),je=Math.sin(fe*Math.PI)*.2;Q=z*(ve+je)}else{const ie=.7+.3*(1-Math.min(X,A-X)/(A/2));Q=z*ie}const le=f.x-M/2,K=f.y-Q/2;return C.jsx("rect",{x:le,y:K,width:M,height:Q,rx:$,fill:Y,opacity:H.opacity,transform:f.rotate!==0?`rotate(${f.rotate} ${f.x} ${f.y})`:void 0,style:{transition:P==="sequential"?"opacity 0.1s ease-in-out":void 0}},X)}})]})})},Di=({isCallActive:e,connectionStatus:t,isSpeaking:n,isTyping:r,volumeLevel:i,onClick:l,onToggleCall:a,mainLabel:o,ctaTitle:c,ctaSubtitle:s,colors:u,styles:h,mode:d})=>{const p=d==="voice"&&h.size==="tiny",k=()=>{p&&a?a():l()},w=c||o,T={...p&&e?{width:"5rem",height:"5rem"}:wr[h.size].button,...ji[h.radius],backgroundColor:e&&p?"#ef4444":u.ctaButtonColor,boxShadow:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",cursor:"pointer",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",...s&&(h.size==="compact"||h.size==="full")&&!p?{height:h.size==="compact"?"4rem":"4.5rem"}:{}};return C.jsx("div",{className:`hover:scale-105 hover:-translate-y-1 hover:shadow-xl ${p&&e?"animate-glow":""}`,style:T,onClick:k,children:C.jsxs("div",{className:"flex items-center space-x-2",style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[C.jsx(dt,{size:p&&e?48:h.size==="tiny"?24:28,connectionStatus:t,isCallActive:e,isSpeaking:n,isTyping:r,baseColor:u.accentColor,colors:u.accentColor,volumeLevel:i}),(h.size==="compact"||h.size==="full")&&!p&&C.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"},children:[C.jsx("span",{style:{color:u.ctaButtonTextColor,fontSize:"0.875rem",fontWeight:"500",lineHeight:"1.2"},children:w}),s&&C.jsx("span",{style:{color:u.ctaButtonTextColor,fontSize:"0.75rem",fontWeight:"400",opacity:.8,lineHeight:"1.2",marginTop:"0.125rem"},children:s})]})]})})},Oi=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228,48V96a12,12,0,0,1-12,12H168a12,12,0,0,1,0-24h19l-7.8-7.8a75.55,75.55,0,0,0-53.32-22.26h-.43A75.49,75.49,0,0,0,72.39,75.57,12,12,0,1,1,55.61,58.41a99.38,99.38,0,0,1,69.87-28.47H126A99.42,99.42,0,0,1,196.2,59.23L204,67V48a12,12,0,0,1,24,0ZM183.61,180.43a75.49,75.49,0,0,1-53.09,21.63h-.43A75.55,75.55,0,0,1,76.77,179.8L69,172H88a12,12,0,0,0,0-24H40a12,12,0,0,0-12,12v48a12,12,0,0,0,24,0V189l7.8,7.8A99.42,99.42,0,0,0,130,226.06h.56a99.38,99.38,0,0,0,69.87-28.47,12,12,0,0,0-16.78-17.16Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),g.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M222,48V96a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h33.52L183.47,72a81.51,81.51,0,0,0-57.53-24h-.46A81.5,81.5,0,0,0,68.19,71.28a6,6,0,1,1-8.38-8.58,93.38,93.38,0,0,1,65.67-26.76H126a93.45,93.45,0,0,1,66,27.53l18,18V48a6,6,0,0,1,12,0ZM187.81,184.72a81.5,81.5,0,0,1-57.29,23.34h-.46a81.51,81.51,0,0,1-57.53-24L54.48,166H88a6,6,0,0,0,0-12H40a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V174.48l18,18.05a93.45,93.45,0,0,0,66,27.53h.52a93.38,93.38,0,0,0,65.67-26.76,6,6,0,1,0-8.38-8.58Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M220,48V96a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h38.34L184.89,70.54A84,84,0,0,0,66.8,69.85a4,4,0,1,1-5.6-5.72,92,92,0,0,1,129.34.76L212,86.34V48a4,4,0,0,1,8,0ZM189.2,186.15a83.44,83.44,0,0,1-58.68,23.91h-.47a83.52,83.52,0,0,1-58.94-24.6L49.66,164H88a4,4,0,0,0,0-8H40a4,4,0,0,0-4,4v48a4,4,0,0,0,8,0V169.66l21.46,21.45A91.43,91.43,0,0,0,130,218.06h.51a91.45,91.45,0,0,0,64.28-26.19,4,4,0,1,0-5.6-5.72Z"}))]]),_i=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z",opacity:"0.2"}),g.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z"}))]]),Hi=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,180a52.06,52.06,0,0,0,52-52V64A52,52,0,0,0,76,64v64A52.06,52.06,0,0,0,128,180ZM100,64a28,28,0,0,1,56,0v64a28,28,0,0,1-56,0Zm40,155.22V240a12,12,0,0,1-24,0V219.22A92.14,92.14,0,0,1,36,128a12,12,0,0,1,24,0,68,68,0,0,0,136,0,12,12,0,0,1,24,0A92.14,92.14,0,0,1,140,219.22Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M168,64v64a40,40,0,0,1-40,40h0a40,40,0,0,1-40-40V64a40,40,0,0,1,40-40h0A40,40,0,0,1,168,64Z",opacity:"0.2"}),g.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M80,128V64a48,48,0,0,1,96,0v64a48,48,0,0,1-96,0Zm128,0a8,8,0,0,0-16,0,64,64,0,0,1-128,0,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.6A80.11,80.11,0,0,0,208,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,174a46.06,46.06,0,0,0,46-46V64a46,46,0,0,0-92,0v64A46.06,46.06,0,0,0,128,174ZM94,64a34,34,0,0,1,68,0v64a34,34,0,0,1-68,0Zm40,141.75V240a6,6,0,0,1-12,0V205.75A78.09,78.09,0,0,1,50,128a6,6,0,0,1,12,0,66,66,0,0,0,132,0,6,6,0,0,1,12,0A78.09,78.09,0,0,1,134,205.75Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,172a44.05,44.05,0,0,0,44-44V64a44,44,0,0,0-88,0v64A44.05,44.05,0,0,0,128,172ZM92,64a36,36,0,0,1,72,0v64a36,36,0,0,1-72,0Zm40,139.89V240a4,4,0,0,1-8,0V203.89A76.09,76.09,0,0,1,52,128a4,4,0,0,1,8,0,68,68,0,0,0,136,0,4,4,0,0,1,8,0A76.09,76.09,0,0,1,132,203.89Z"}))]]),Zi=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M56.88,39.93A12,12,0,1,0,39.12,56.07L76,96.64V128a52,52,0,0,0,72.11,48l11.26,12.39A67.34,67.34,0,0,1,128,196a68.07,68.07,0,0,1-68-68,12,12,0,0,0-24,0,92.14,92.14,0,0,0,80,91.22V240a12,12,0,0,0,24,0V219.23a90.39,90.39,0,0,0,35.92-12.68l23.2,25.52a12,12,0,0,0,17.76-16.14ZM128,156a28,28,0,0,1-28-28v-5l29.9,32.89C129.27,156,128.64,156,128,156Zm63-2.42A67.63,67.63,0,0,0,196,128a12,12,0,0,1,24,0,91.48,91.48,0,0,1-6.74,34.61,12,12,0,0,1-22.23-9ZM85.7,33.75A52,52,0,0,1,180,64v56.54a12,12,0,0,1-24,0V64a28,28,0,0,0-50.79-16.28,12,12,0,0,1-19.51-14Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M168,64v64a40,40,0,0,1-40,40h0a40,40,0,0,1-40-40V64a40,40,0,0,1,40-40h0A40,40,0,0,1,168,64Z",opacity:"0.2"}),g.createElement("path",{d:"M213.92,218.62l-160-176A8,8,0,0,0,42.08,53.38L80,95.09V128a48,48,0,0,0,69.11,43.12l11.1,12.2A63.41,63.41,0,0,1,128,192a64.07,64.07,0,0,1-64-64,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.59a78.83,78.83,0,0,0,35.16-12.22l30.92,34a8,8,0,1,0,11.84-10.76ZM128,160a32,32,0,0,1-32-32V112.69l41.66,45.82A32,32,0,0,1,128,160Zm57.52-3.91A63.32,63.32,0,0,0,192,128a8,8,0,0,1,16,0,79.16,79.16,0,0,1-8.11,35.12,8,8,0,0,1-7.19,4.49,7.88,7.88,0,0,1-3.51-.82A8,8,0,0,1,185.52,156.09ZM84,44.87A48,48,0,0,1,176,64v64a49.19,49.19,0,0,1-.26,5,8,8,0,0,1-8,7.17,8.13,8.13,0,0,1-.84,0,8,8,0,0,1-7.12-8.79c.11-1.1.17-2.24.17-3.36V64A32,32,0,0,0,98.64,51.25,8,8,0,1,1,84,44.87Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.38,229.92a8,8,0,0,1-11.3-.54l-30.92-34A78.83,78.83,0,0,1,136,207.59V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64.07,64.07,0,0,0,64,64,63.41,63.41,0,0,0,32.21-8.68l-11.1-12.2A48,48,0,0,1,80,128V95.09L42.08,53.38A8,8,0,0,1,53.92,42.62l160,176A8,8,0,0,1,213.38,229.92Zm-24.19-63.13a7.88,7.88,0,0,0,3.51.82,8,8,0,0,0,7.19-4.49A79.16,79.16,0,0,0,208,128a8,8,0,0,0-16,0,63.32,63.32,0,0,1-6.48,28.09A8,8,0,0,0,189.19,166.79Zm-27.33-29.22A8,8,0,0,0,175.74,133a49.49,49.49,0,0,0,.26-5V64A48,48,0,0,0,84,44.87a8,8,0,0,0,1.41,8.57Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M212.44,220,52.44,44A6,6,0,0,0,43.56,52L82,94.32V128a46,46,0,0,0,67.56,40.64l13.75,15.12A65.26,65.26,0,0,1,128,194a66.08,66.08,0,0,1-66-66,6,6,0,0,0-12,0,78.09,78.09,0,0,0,72,77.75V240a6,6,0,0,0,12,0V205.77a76.93,76.93,0,0,0,37.48-13L203.56,228a6,6,0,0,0,8.88-8.08ZM128,162a34,34,0,0,1-34-34V107.52l47.12,51.84A33.82,33.82,0,0,1,128,162Zm59.32-5A65.38,65.38,0,0,0,194,128a6,6,0,0,1,12,0,77.33,77.33,0,0,1-7.9,34.25A6,6,0,1,1,187.32,157ZM85.8,45.67A46,46,0,0,1,174,64v64a45.17,45.17,0,0,1-.25,4.81,6,6,0,0,1-6,5.38q-.31,0-.63,0a6,6,0,0,1-5.34-6.59A35.41,35.41,0,0,0,162,128V64A34,34,0,0,0,96.8,50.45a6,6,0,0,1-11-4.78Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.92,218.62l-160-176A8,8,0,0,0,42.08,53.38L80,95.09V128a48,48,0,0,0,69.11,43.12l11.1,12.2A63.41,63.41,0,0,1,128,192a64.07,64.07,0,0,1-64-64,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.59a78.83,78.83,0,0,0,35.16-12.22l30.92,34a8,8,0,1,0,11.84-10.76ZM128,160a32,32,0,0,1-32-32V112.69l41.66,45.82A32,32,0,0,1,128,160Zm57.52-3.91A63.32,63.32,0,0,0,192,128a8,8,0,0,1,16,0,79.16,79.16,0,0,1-8.11,35.12,8,8,0,0,1-7.19,4.49,7.88,7.88,0,0,1-3.51-.82A8,8,0,0,1,185.52,156.09ZM84,44.87A48,48,0,0,1,176,64v64a49.19,49.19,0,0,1-.26,5,8,8,0,0,1-8,7.17,8.13,8.13,0,0,1-.84,0,8,8,0,0,1-7.12-8.79c.11-1.1.17-2.24.17-3.36V64A32,32,0,0,0,98.64,51.25,8,8,0,1,1,84,44.87Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M211,221.31,51,45.31A4,4,0,0,0,45,50.69L84,93.55V128a44,44,0,0,0,66,38.12l16.38,18A67.21,67.21,0,0,1,128,196a68.07,68.07,0,0,1-68-68,4,4,0,0,0-8,0,76.09,76.09,0,0,0,72,75.89V240a4,4,0,0,0,8,0V203.89a75.1,75.1,0,0,0,39.79-13.77L205,226.69a4,4,0,1,0,5.92-5.38ZM128,164a36,36,0,0,1-36-36V102.35L144.43,160A35.83,35.83,0,0,1,128,164Zm61.12-6.15A67.44,67.44,0,0,0,196,128a4,4,0,0,1,8,0,75.28,75.28,0,0,1-7.7,33.37,4,4,0,0,1-7.18-3.52ZM87.63,46.46A44,44,0,0,1,172,64v64a44.2,44.2,0,0,1-.24,4.61,4,4,0,0,1-4,3.58l-.42,0a4,4,0,0,1-3.57-4.39A36.67,36.67,0,0,0,164,128V64A36,36,0,0,0,95,49.66a4,4,0,0,1-7.34-3.2Z"}))]]),qi=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230.14,25.86a20,20,0,0,0-19.57-5.11l-.22.07L18.44,79a20,20,0,0,0-3.06,37.25L99,157l40.71,83.65a19.81,19.81,0,0,0,18,11.38c.57,0,1.15,0,1.73-.07A19.82,19.82,0,0,0,177,237.56L235.18,45.65a1.42,1.42,0,0,0,.07-.22A20,20,0,0,0,230.14,25.86ZM156.91,221.07l-34.37-70.64,46-45.95a12,12,0,0,0-17-17l-46,46L34.93,99.09,210,46Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M223.69,42.18l-58.22,192a8,8,0,0,1-14.92,1.25L108,148,20.58,105.45a8,8,0,0,1,1.25-14.92l192-58.22A8,8,0,0,1,223.69,42.18Z",opacity:"0.2"}),g.createElement("path",{d:"M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M231.4,44.34s0,.1,0,.15l-58.2,191.94a15.88,15.88,0,0,1-14,11.51q-.69.06-1.38.06a15.86,15.86,0,0,1-14.42-9.15L107,164.15a4,4,0,0,1,.77-4.58l57.92-57.92a8,8,0,0,0-11.31-11.31L96.43,148.26a4,4,0,0,1-4.58.77L17.08,112.64a16,16,0,0,1,2.49-29.8l191.94-58.2.15,0A16,16,0,0,1,231.4,44.34Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M225.88,30.12a13.83,13.83,0,0,0-13.7-3.58l-.11,0L20.14,84.77A14,14,0,0,0,18,110.85l85.56,41.64L145.12,238a13.87,13.87,0,0,0,12.61,8c.4,0,.81,0,1.21-.05a13.9,13.9,0,0,0,12.29-10.09l58.2-191.93,0-.11A13.83,13.83,0,0,0,225.88,30.12Zm-8,10.4L159.73,232.43l0,.11a2,2,0,0,1-3.76.26l-40.68-83.58,49-49a6,6,0,1,0-8.49-8.49l-49,49L23.15,100a2,2,0,0,1,.31-3.74l.11,0L215.48,38.08a1.94,1.94,0,0,1,1.92.52A2,2,0,0,1,217.92,40.52Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224.47,31.52a11.87,11.87,0,0,0-11.82-3L20.74,86.67a12,12,0,0,0-1.91,22.38L105,151l41.92,86.15A11.88,11.88,0,0,0,157.74,244c.34,0,.69,0,1,0a11.89,11.89,0,0,0,10.52-8.63l58.21-192,0-.08A11.85,11.85,0,0,0,224.47,31.52Zm-4.62,9.54-58.23,192a4,4,0,0,1-7.48.59l-41.3-84.86,50-50a4,4,0,1,0-5.66-5.66l-50,50-84.9-41.31a3.88,3.88,0,0,1-2.27-4,3.93,3.93,0,0,1,3-3.54L214.9,36.16A3.93,3.93,0,0,1,216,36a4,4,0,0,1,2.79,1.19A3.93,3.93,0,0,1,219.85,41.06Z"}))]]),Ui=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z",opacity:"0.2"}),g.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z"}))]]),$i=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M60,96v64a12,12,0,0,1-24,0V96a12,12,0,0,1,24,0ZM88,20A12,12,0,0,0,76,32V224a12,12,0,0,0,24,0V32A12,12,0,0,0,88,20Zm40,32a12,12,0,0,0-12,12V192a12,12,0,0,0,24,0V64A12,12,0,0,0,128,52Zm40,32a12,12,0,0,0-12,12v64a12,12,0,0,0,24,0V96A12,12,0,0,0,168,84Zm40-16a12,12,0,0,0-12,12v96a12,12,0,0,0,24,0V80A12,12,0,0,0,208,68Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,96v64H48V96Z",opacity:"0.2"}),g.createElement("path",{d:"M56,96v64a8,8,0,0,1-16,0V96a8,8,0,0,1,16,0ZM88,24a8,8,0,0,0-8,8V224a8,8,0,0,0,16,0V32A8,8,0,0,0,88,24Zm40,32a8,8,0,0,0-8,8V192a8,8,0,0,0,16,0V64A8,8,0,0,0,128,56Zm40,32a8,8,0,0,0-8,8v64a8,8,0,0,0,16,0V96A8,8,0,0,0,168,88Zm40-16a8,8,0,0,0-8,8v96a8,8,0,0,0,16,0V80A8,8,0,0,0,208,72Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM72,152a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm32,32a8,8,0,0,1-16,0V72a8,8,0,0,1,16,0Zm32-16a8,8,0,0,1-16,0V88a8,8,0,0,1,16,0Zm32-16a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm32,8a8,8,0,0,1-16,0V96a8,8,0,0,1,16,0Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M54,96v64a6,6,0,0,1-12,0V96a6,6,0,0,1,12,0ZM88,26a6,6,0,0,0-6,6V224a6,6,0,0,0,12,0V32A6,6,0,0,0,88,26Zm40,32a6,6,0,0,0-6,6V192a6,6,0,0,0,12,0V64A6,6,0,0,0,128,58Zm40,32a6,6,0,0,0-6,6v64a6,6,0,0,0,12,0V96A6,6,0,0,0,168,90Zm40-16a6,6,0,0,0-6,6v96a6,6,0,0,0,12,0V80A6,6,0,0,0,208,74Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M56,96v64a8,8,0,0,1-16,0V96a8,8,0,0,1,16,0ZM88,24a8,8,0,0,0-8,8V224a8,8,0,0,0,16,0V32A8,8,0,0,0,88,24Zm40,32a8,8,0,0,0-8,8V192a8,8,0,0,0,16,0V64A8,8,0,0,0,128,56Zm40,32a8,8,0,0,0-8,8v64a8,8,0,0,0,16,0V96A8,8,0,0,0,168,88Zm40-16a8,8,0,0,0-8,8v96a8,8,0,0,0,16,0V80A8,8,0,0,0,208,72Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M52,96v64a4,4,0,0,1-8,0V96a4,4,0,0,1,8,0ZM88,28a4,4,0,0,0-4,4V224a4,4,0,0,0,8,0V32A4,4,0,0,0,88,28Zm40,32a4,4,0,0,0-4,4V192a4,4,0,0,0,8,0V64A4,4,0,0,0,128,60Zm40,32a4,4,0,0,0-4,4v64a4,4,0,0,0,8,0V96A4,4,0,0,0,168,92Zm40-16a4,4,0,0,0-4,4v96a4,4,0,0,0,8,0V80A4,4,0,0,0,208,76Z"}))]]),Wi=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),Xi=O.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Le=g.forwardRef((e,t)=>{const{alt:n,color:r,size:i,weight:l,mirrored:a,children:o,weights:c,...s}=e,{color:u="currentColor",size:h,weight:d="regular",mirrored:p=!1,...k}=g.useContext(Xi);return g.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i??h,height:i??h,fill:r??u,viewBox:"0 0 256 256",transform:a||p?"scale(-1, 1)":void 0,...k,...s},!!n&&g.createElement("title",null,n),o,c.get(l??d))});Le.displayName="IconBase";const Cr=g.forwardRef((e,t)=>g.createElement(Le,{ref:t,...e,weights:Oi}));Cr.displayName="ArrowsClockwiseIcon";const vr=g.forwardRef((e,t)=>g.createElement(Le,{ref:t,...e,weights:_i}));vr.displayName="ChatCircleIcon";const xt=g.forwardRef((e,t)=>g.createElement(Le,{ref:t,...e,weights:Hi}));xt.displayName="MicrophoneIcon";const Gt=g.forwardRef((e,t)=>g.createElement(Le,{ref:t,...e,weights:Zi}));Gt.displayName="MicrophoneSlashIcon";const en=g.forwardRef((e,t)=>g.createElement(Le,{ref:t,...e,weights:qi}));en.displayName="PaperPlaneTiltIcon";const tn=g.forwardRef((e,t)=>g.createElement(Le,{ref:t,...e,weights:Ui}));tn.displayName="StopIcon";const nn=g.forwardRef((e,t)=>g.createElement(Le,{ref:t,...e,weights:$i}));nn.displayName="WaveformIcon";const Sr=g.forwardRef((e,t)=>g.createElement(Le,{ref:t,...e,weights:Wi}));Sr.displayName="XIcon";const Yi=({mode:e,connectionStatus:t,isCallActive:n,isSpeaking:r,isTyping:i,hasActiveConversation:l,mainLabel:a,onClose:o,onReset:c,colors:s,styles:u})=>{const h=()=>t==="connecting"?"Connecting...":n?r?"Assistant Speaking...":"Listening...":i?"Assistant is typing...":l?e==="chat"?"Chat active":e==="hybrid"?"Ready to assist":"Connected":e==="voice"?"Click the microphone to start":e==="chat"?"Type a message below":"Choose voice or text";return C.jsxs("div",{className:`relative z-10 p-4 flex items-center justify-between border-b ${u.theme==="dark"?"text-white border-gray-800 shadow-lg":"text-gray-900 border-gray-200 shadow-sm"}`,style:{backgroundColor:s.baseColor},children:[C.jsxs("div",{className:"flex items-center space-x-3",children:[C.jsx(dt,{size:40,connectionStatus:t,isCallActive:n,isSpeaking:r,isTyping:i,baseColor:s.accentColor,colors:s.accentColor}),C.jsxs("div",{children:[C.jsx("div",{className:"font-medium",children:a}),C.jsx("div",{className:`text-sm ${u.theme==="dark"?"text-gray-300":"text-gray-600"}`,children:h()})]})]}),C.jsxs("div",{className:"flex items-center space-x-2",children:[C.jsx("button",{onClick:c,className:"w-8 h-8 rounded-full flex items-center justify-center transition-all}",title:"Reset conversation",children:C.jsx(Cr,{size:16,weight:"bold"})}),C.jsx("button",{onClick:o,className:"w-8 h-8 rounded-full flex items-center justify-center transition-all",children:C.jsx(Sr,{size:16,weight:"bold"})})]})]})};function Qi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ji=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gi={};function Sn(e,t){return(Gi.jsx?Ji:Ki).test(e)}const el=/[ \t\n\f\r]/g;function tl(e){return typeof e=="object"?e.type==="text"?En(e.value):!1:En(e)}function En(e){return e.replace(el,"")===""}class at{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}at.prototype.normal={};at.prototype.property={};at.prototype.space=void 0;function Er(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new at(n,r,t)}function Zt(e){return e.toLowerCase()}class pe{constructor(t,n){this.attribute=n,this.property=t}}pe.prototype.attribute="";pe.prototype.booleanish=!1;pe.prototype.boolean=!1;pe.prototype.commaOrSpaceSeparated=!1;pe.prototype.commaSeparated=!1;pe.prototype.defined=!1;pe.prototype.mustUseProperty=!1;pe.prototype.number=!1;pe.prototype.overloadedBoolean=!1;pe.prototype.property="";pe.prototype.spaceSeparated=!1;pe.prototype.space=void 0;let nl=0;const Z=Re(),re=Re(),qt=Re(),v=Re(),ee=Re(),qe=Re(),xe=Re();function Re(){return 2**++nl}const Ut=Object.freeze(Object.defineProperty({__proto__:null,boolean:Z,booleanish:re,commaOrSpaceSeparated:xe,commaSeparated:qe,number:v,overloadedBoolean:qt,spaceSeparated:ee},Symbol.toStringTag,{value:"Module"})),Mt=Object.keys(Ut);class rn extends pe{constructor(t,n,r,i){let l=-1;if(super(t,n),An(this,"space",i),typeof r=="number")for(;++l<Mt.length;){const a=Mt[l];An(this,Mt[l],(r&Ut[a])===Ut[a])}}}rn.prototype.defined=!0;function An(e,t,n){n&&(e[t]=n)}function $e(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new rn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Zt(r)]=r,n[Zt(l.attribute)]=r}return new at(t,n,e.space)}const Ar=$e({properties:{ariaActiveDescendant:null,ariaAtomic:re,ariaAutoComplete:null,ariaBusy:re,ariaChecked:re,ariaColCount:v,ariaColIndex:v,ariaColSpan:v,ariaControls:ee,ariaCurrent:null,ariaDescribedBy:ee,ariaDetails:null,ariaDisabled:re,ariaDropEffect:ee,ariaErrorMessage:null,ariaExpanded:re,ariaFlowTo:ee,ariaGrabbed:re,ariaHasPopup:null,ariaHidden:re,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ee,ariaLevel:v,ariaLive:null,ariaModal:re,ariaMultiLine:re,ariaMultiSelectable:re,ariaOrientation:null,ariaOwns:ee,ariaPlaceholder:null,ariaPosInSet:v,ariaPressed:re,ariaReadOnly:re,ariaRelevant:null,ariaRequired:re,ariaRoleDescription:ee,ariaRowCount:v,ariaRowIndex:v,ariaRowSpan:v,ariaSelected:re,ariaSetSize:v,ariaSort:null,ariaValueMax:v,ariaValueMin:v,ariaValueNow:v,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ir(e,t){return t in e?e[t]:t}function Mr(e,t){return Ir(e,t.toLowerCase())}const rl=$e({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qe,acceptCharset:ee,accessKey:ee,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:ee,autoFocus:Z,autoPlay:Z,blocking:ee,capture:null,charSet:null,checked:Z,cite:null,className:ee,cols:v,colSpan:null,content:null,contentEditable:re,controls:Z,controlsList:ee,coords:v|qe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:qt,draggable:re,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:ee,height:v,hidden:qt,high:v,href:null,hrefLang:null,htmlFor:ee,httpEquiv:ee,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:ee,itemRef:ee,itemScope:Z,itemType:ee,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:v,manifest:null,max:null,maxLength:v,media:null,method:null,min:null,minLength:v,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Z,optimum:v,pattern:null,ping:ee,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:ee,required:Z,reversed:Z,rows:v,rowSpan:v,sandbox:ee,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shape:null,size:v,sizes:null,slot:null,span:v,spellCheck:re,src:null,srcDoc:null,srcLang:null,srcSet:null,start:v,step:null,style:null,tabIndex:v,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:re,width:v,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ee,axis:null,background:null,bgColor:null,border:v,borderColor:null,bottomMargin:v,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:v,leftMargin:v,link:null,longDesc:null,lowSrc:null,marginHeight:v,marginWidth:v,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:v,rules:null,scheme:null,scrolling:re,standby:null,summary:null,text:null,topMargin:v,valueType:null,version:null,vAlign:null,vLink:null,vSpace:v,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Z,disableRemotePlayback:Z,prefix:null,property:null,results:v,security:null,unselectable:null},space:"html",transform:Mr}),il=$e({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marke