@accurix/centrinfo-widget 1.0.0 โ†’ 1.1.0

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/index.cjs CHANGED
@@ -1,11 +1,4 @@
1
- let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`);var r=class extends Error{constructor(e,t){super(t),this.status=e,this.name=`ApiError`}};const i=()=>({agentName:`Assistant`,greeting:`Hi! ๐Ÿ‘‹ How can I help you today?`,allowVoiceInput:!1,availableActions:[]});var a=class{constructor(e,t,n){this.baseUrl=e,this.token=t,this.gifApiKey=n}headers(e=!0){let t={Authorization:`Bearer ${this.token}`};return e&&(t[`Content-Type`]=`application/json`),t}async json(e){let t;try{t=await e.json()}catch{t=void 0}if(!e.ok){let n=s(t)??`request failed (${e.status})`;throw new r(e.status,n)}return t?.data??t}async bootstrap(){try{let e=await fetch(`${this.baseUrl}/public-chat/bootstrap`,{headers:this.headers(!1)});if(!e.ok)return i();let t=await this.json(e);return{...i(),...t}}catch{return i()}}async stream(e,t,n){let r=await fetch(`${this.baseUrl}/public-chat/stream`,{method:`POST`,headers:this.headers(),body:JSON.stringify({question:e,sessionId:t}),signal:n.signal});return!r.ok||!r.body?this.send(e,t,n):c(r.body,n)}async send(e,t,n){let r=await fetch(`${this.baseUrl}/public-chat`,{method:`POST`,headers:this.headers(),body:JSON.stringify({question:e,sessionId:t}),signal:n.signal}),i=await this.json(r);return n.onChunk(i.answer??``),{answer:i.answer??``,sources:i.sources??[],suggestedReplies:i.suggestedReplies??[],availableActions:i.availableActions??[],handoffOffered:i.handoffOffered??!1,requestedContactFields:u(i.requestedContactFields),conversationEnded:i.conversationEnded??!1}}async action(e,t){let n=await fetch(`${this.baseUrl}/public-chat/${e}`,{method:`POST`,headers:this.headers(),body:JSON.stringify(t)}),r=await this.json(n);return{ok:!0,note:r?.note,booking:r?.booking}}async identify(e,t){if(!(!e||!t))try{let n=await fetch(`${this.baseUrl}/public-chat/identify`,{method:`POST`,headers:this.headers(),body:JSON.stringify(o(e,t))});if(!n.ok)try{await n.text()}catch{}}catch{}}async transcribe(e,t){let n=await fetch(`${this.baseUrl}/public-chat/transcribe`,{method:`POST`,headers:this.headers(),body:JSON.stringify({audioBase64:e,mimeType:t})});return(await this.json(n)).text??``}async endConversation(e){try{let t=await fetch(`${this.baseUrl}/public-chat/end`,{method:`POST`,headers:this.headers(),body:JSON.stringify({sessionId:e})});if(!t.ok)try{await t.text()}catch{}}catch{}}async sendFeedback(e){try{let t=await fetch(`${this.baseUrl}/public-chat/feedback`,{method:`POST`,headers:this.headers(),body:JSON.stringify(e)});if(!t.ok)try{await t.text()}catch{}}catch{}}async extract(e,t,n){let r=await fetch(`${this.baseUrl}/public-chat/extract`,{method:`POST`,headers:this.headers(),body:JSON.stringify({fileBase64:e,mimeType:t,filename:n})});return(await this.json(r)).text??``}async demoSlots(e,t){try{let n=`from=${encodeURIComponent(e)}&to=${encodeURIComponent(t)}`,r=await fetch(`${this.baseUrl}/public-chat/demo-slots?${n}`,{headers:this.headers(!1)});if(!r.ok)return{taken:[],busy:[]};let i=await this.json(r);return{taken:i?.taken??[],busy:i?.busy??[]}}catch{return{taken:[],busy:[]}}}async searchGifs(e){if(!this.gifApiKey)return[];let t=`https://tenor.googleapis.com/v2/search?q=${encodeURIComponent(e.trim()||`trending`)}&key=${this.gifApiKey}&limit=24&media_filter=tinygif,gif&contentfilter=high`;try{let e=await fetch(t);return e.ok?((await e.json()).results??[]).map(e=>({id:e.id,url:e.media_formats?.gif?.url??e.media_formats?.tinygif?.url??``,preview:e.media_formats?.tinygif?.url??e.media_formats?.gif?.url??``,alt:e.content_description||`GIF`})).filter(e=>e.url):[]}catch{return[]}}};const o=(e,t)=>{let n={...t.customAttributes??{},...t.metadata??{}};t.createdAt!==void 0&&(n.createdAt=t.createdAt),t.avatarUrl&&(n.avatarUrl=t.avatarUrl),t.company&&(n.company=t.company);let r={sessionId:e},i=t.externalId??t.userId;return i&&(r.externalId=i),t.email&&(r.email=t.email),t.firstName&&(r.firstName=t.firstName),t.lastName&&(r.lastName=t.lastName),t.name&&(r.name=t.name),t.phone&&(r.phone=t.phone),Object.keys(n).length>0&&(r.metadata=n),r},s=e=>{let t=e?.message;if(Array.isArray(t))return t.join(`, `);if(typeof t==`string`)return t},c=async(e,t)=>{let n=e.getReader(),i=new TextDecoder,a={answer:``,sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1,requestedContactFields:[],conversationEnded:!1},o=``;for(;;){let{done:e,value:s}=await n.read();if(e)break;o+=i.decode(s,{stream:!0});let c;for(;(c=o.indexOf(`
2
-
3
- `))!==-1;){let e=o.slice(0,c);o=o.slice(c+2);let n=l(e);if(n){if(n.event===`error`)throw new r(502,n.data?.message??`stream error`);if(n.event===`chunk`&&typeof n.data?.text==`string`)a.answer+=n.data.text,t.onChunk(n.data.text);else if(n.event===`final`&&n.data)a.sources=n.data.sources??[],a.suggestedReplies=n.data.suggestedReplies??[],a.availableActions=n.data.availableActions??[],a.handoffOffered=!!n.data.handoffOffered,a.requestedContactFields=u(n.data.requestedContactFields),a.conversationEnded=!!n.data.conversationEnded;else if(n.event===`done`)return a}}}return a},l=e=>{let t=`message`,n=[];for(let r of e.split(`
4
- `))r.startsWith(`event:`)?t=r.slice(6).trim():r.startsWith(`data:`)&&n.push(r.slice(5).trim());if(n.length===0)return{event:t};try{return{event:t,data:JSON.parse(n.join(`
5
- `))}}catch{return{event:t}}},u=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],d=e=>new Promise(t=>setTimeout(t,e)),f={agentName:`Sara`,agentAvatarUrl:``,greeting:`Hi! ๐Ÿ‘‹ I'm Sara, the Northwind assistant. Ask me anything about tracking, customs, or pricing โ€” or book a demo.`,allowVoiceInput:!0,availableActions:[`public_book_demo`,`public_capture_contact`,`public_submit_inquiry`],agentDescription:`I help with shipment tracking, customs, and pricing.`,welcomeSubtitle:`Ask me anything โ€” most answers are instant.`,disclaimerText:`Sara is an AI assistant; answers may be imperfect.`,starterQuestions:[`How do I track a shipment?`,`How does customs work?`,`What's your pricing?`]},p=[{match:/^\s*(hi+|hey+|hello|yo|sup|howdy|hola|thanks|thank you|thx|good (morning|afternoon|evening))\b/i,result:{answer:`Hello! ๐Ÿ‘‹ How can I help you today?`,sources:[],suggestedReplies:[`How do I track a shipment?`,`How does customs work?`],handoffOffered:!1}},{match:/track|shipment|where|status/i,result:{answer:`You can track any shipment in real time from the **Tracking** tab โ€” we merge GPS pings with carrier scan events, so the status is usually fresher than the carrier's own site. Each shipment also has a shareable link you can send to customers.`,sources:[{title:`Real-time tracking`,url:`https://northwind.example/docs/tracking`},{title:`Shareable tracking links`,url:`https://northwind.example/docs/share`}],suggestedReplies:[`How fresh is the data?`,`Can customers track too?`],handoffOffered:!1}},{match:/custom|clear|duty|tariff|import/i,result:{answer:`Customs is automated end-to-end: HS codes are auto-classified from your product catalog, duties are estimated up front, and most lanes are pre-cleared before the freight lands. If a shipment needs a human broker, we flag it early so it never sits at the border.`,sources:[{title:`Smart customs`,url:`https://northwind.example/docs/customs`}],suggestedReplies:[`Which countries are pre-cleared?`,`What does it cost?`],handoffOffered:!1}},{match:/price|cost|pricing|plan|quote/i,result:{answer:`Pricing is usage-based โ€” you pay per shipment, with volume tiers that kick in automatically. There's no platform fee and no per-seat charge. I can have someone put together a quote for your lanes if you'd like.`,sources:[{title:`Pricing`,url:`https://northwind.example/pricing`}],suggestedReplies:[`How do volume tiers work?`,`Is there a free trial?`],handoffOffered:!1}}],m={answer:`That's a great question โ€” I don't have a confident answer from Northwind's published docs yet. Want me to pass it to the team so a human can follow up? You can also book a quick demo.`,sources:[],suggestedReplies:[`What can you help with?`],handoffOffered:!0};var h=class{async bootstrap(){return await d(180),f}async stream(e,t,n){await d(550);let r=p.find(t=>t.match.test(e)),i=r?r.result:m,a=i.answer.split(/(\s+)/);for(let e of a){if(n.signal?.aborted)break;n.onChunk(e),await d(18+Math.min(40,e.length*6))}return{...i,availableActions:f.availableActions}}async action(e,t){return await d(450),{ok:!0,note:{"book-demo":`Demo requested โ€” we'll email you a few times that work. ๐Ÿ“…`,contact:`Got it โ€” saved your details. โœ…`,inquiry:`Thanks! We'll get back to you shortly. โœ‰๏ธ`,"request-callback":`We'll call you back soon. ๐Ÿ“ž`,"subscribe-newsletter":`You're subscribed. ๐ŸŽ‰`}[e]}}async transcribe(e,t){return await d(700),`How do I track a shipment?`}async extract(e,t,n){return await d(600),`[Attached file${n?`: ${n}`:``}] Invoice #4821 โ€” 3 pallets, Rotterdam โ†’ Lagos, ETA 12 days.`}async identify(e,t){await d(50)}async endConversation(e){await d(50)}async sendFeedback(){await d(50)}async demoSlots(e,t){return await d(150),{taken:[[11,0],[15,0]].map(([e,t])=>{let n=new Date;return n.setHours(e,t,0,0),n.toISOString()}),busy:[]}}async searchGifs(e){await d(280);let t=e.trim().toLowerCase(),n=t?y.filter(e=>e.alt.includes(t)||e.tags.some(e=>e.includes(t)||t.includes(e))):y;return(n.length>0?n:y).map(e=>({id:e.id,url:v(e.emoji,e.anim),preview:v(e.emoji,e.anim),alt:e.alt}))}};const g=`<animateTransform attributeName='transform' attributeType='XML' type='translate' values='0 0;0 -16;0 0' dur='0.7s' repeatCount='indefinite'/>`,_=`<animateTransform attributeName='transform' attributeType='XML' type='rotate' values='-14 64 110;14 64 110;-14 64 110' dur='0.9s' repeatCount='indefinite'/>`,v=(e,t)=>{let n=`<svg xmlns='http://www.w3.org/2000/svg' width='128' height='128'><rect width='128' height='128' rx='14' fill='#eef1f4'/><text x='64' y='88' font-size='64' text-anchor='middle'>${e}${t}</text></svg>`;return`data:image/svg+xml,${encodeURIComponent(n)}`},y=[{id:`g1`,emoji:`๐Ÿ‘`,alt:`thumbs up`,tags:[`thumbs`,`yes`,`ok`,`great`,`good`],anim:g},{id:`g2`,emoji:`๐ŸŽ‰`,alt:`celebrate`,tags:[`party`,`yay`,`congrats`,`celebrate`],anim:_},{id:`g3`,emoji:`๐Ÿ‘‹`,alt:`wave hello`,tags:[`hi`,`hello`,`hey`,`wave`,`bye`],anim:_},{id:`g4`,emoji:`โค๏ธ`,alt:`heart`,tags:[`love`,`thanks`,`heart`],anim:g},{id:`g5`,emoji:`๐Ÿค”`,alt:`thinking`,tags:[`hmm`,`think`,`thinking`],anim:_},{id:`g6`,emoji:`๐Ÿ˜‚`,alt:`laughing`,tags:[`lol`,`funny`,`haha`,`laugh`],anim:g},{id:`g7`,emoji:`๐Ÿ”ฅ`,alt:`fire`,tags:[`fire`,`hot`,`lit`,`awesome`],anim:g},{id:`g8`,emoji:`๐Ÿš€`,alt:`rocket`,tags:[`rocket`,`launch`,`fast`,`go`],anim:_}],b=e=>new Promise(t=>setTimeout(t,e));var x=class{constructor(e,t){this.real=e,this.strings=t}bootstrap(){return this.real.bootstrap()}async stream(e,t,n){await b(300);for(let e of this.strings.previewReply.split(/(\s+)/)){if(n.signal?.aborted)break;n.onChunk(e),await b(16)}return{answer:this.strings.previewReply,sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1}}async action(){return await b(250),{ok:!0,note:this.strings.previewActionNote}}async identify(){}async endConversation(){}async sendFeedback(){}async transcribe(){return``}async extract(){return``}async searchGifs(){return[]}async demoSlots(){return{taken:[],busy:[]}}};const S=[{name:`Smileys`,emojis:`๐Ÿ˜€.๐Ÿ˜ƒ.๐Ÿ˜„.๐Ÿ˜.๐Ÿ˜….๐Ÿ˜‚.๐Ÿคฃ.๐Ÿ˜Š.๐Ÿ˜‡.๐Ÿ™‚.๐Ÿ™ƒ.๐Ÿ˜‰.๐Ÿ˜Œ.๐Ÿ˜.๐Ÿฅฐ.๐Ÿ˜˜.๐Ÿ˜‹.๐Ÿ˜›.๐Ÿ˜œ.๐Ÿคช.๐Ÿค—.๐Ÿคญ.๐Ÿค”.๐Ÿค.๐Ÿ˜.๐Ÿ˜ถ.๐Ÿ˜.๐Ÿ™„.๐Ÿ˜ด.๐Ÿฅณ.๐Ÿ˜Ž.๐Ÿค“.๐Ÿฅบ.๐Ÿ˜ข.๐Ÿ˜ญ.๐Ÿ˜ค.๐Ÿ˜ .๐Ÿคฏ.๐Ÿ˜ฌ.๐Ÿ˜ฑ.๐Ÿคฉ.๐Ÿฅฑ`.split(`.`)},{name:`Gestures`,emojis:[`๐Ÿ‘`,`๐Ÿ‘Ž`,`๐Ÿ‘Œ`,`๐ŸคŒ`,`โœŒ๏ธ`,`๐Ÿคž`,`๐ŸคŸ`,`๐Ÿค˜`,`๐Ÿค™`,`๐Ÿ‘ˆ`,`๐Ÿ‘‰`,`๐Ÿ‘†`,`๐Ÿ‘‡`,`โœ‹`,`๐Ÿ–๏ธ`,`๐Ÿ‘‹`,`๐Ÿค`,`๐Ÿ™`,`๐Ÿ’ช`,`๐Ÿ‘`,`๐Ÿ™Œ`,`๐Ÿ‘`,`๐Ÿคฒ`,`๐Ÿซถ`]},{name:`Hearts & symbols`,emojis:`โค๏ธ.๐Ÿงก.๐Ÿ’›.๐Ÿ’š.๐Ÿ’™.๐Ÿ’œ.๐Ÿ–ค.๐Ÿค.๐Ÿ’”.โฃ๏ธ.๐Ÿ’•.๐Ÿ’–.๐Ÿ’˜.๐Ÿ’.โœจ.โญ.๐ŸŒŸ.๐Ÿ’ซ.๐Ÿ”ฅ.๐ŸŽ‰.๐ŸŽŠ.โœ….โŒ.โšก.๐Ÿ’ฏ.๐Ÿš€`.split(`.`)},{name:`Animals & nature`,emojis:[`๐Ÿถ`,`๐Ÿฑ`,`๐ŸฆŠ`,`๐Ÿป`,`๐Ÿผ`,`๐Ÿจ`,`๐Ÿฆ`,`๐Ÿฎ`,`๐Ÿธ`,`๐Ÿต`,`๐Ÿง`,`๐Ÿฆ„`,`๐Ÿ`,`๐Ÿฆ‹`,`๐Ÿข`,`๐Ÿฌ`,`๐ŸŒท`,`๐ŸŒธ`,`๐ŸŒน`,`๐ŸŒป`,`๐ŸŒณ`,`๐Ÿ€`]},{name:`Food & drink`,emojis:[`๐ŸŽ`,`๐ŸŒ`,`๐Ÿ‰`,`๐Ÿ“`,`๐Ÿ’`,`๐Ÿฅ‘`,`๐Ÿ”`,`๐ŸŸ`,`๐Ÿ•`,`๐ŸŒฎ`,`๐Ÿฟ`,`๐Ÿฉ`,`๐Ÿช`,`๐ŸŽ‚`,`โ˜•`,`๐Ÿต`,`๐Ÿบ`,`๐Ÿฅ‚`,`๐Ÿท`]},{name:`Objects & travel`,emojis:`๐Ÿš€.โœˆ๏ธ.๐Ÿš—.๐Ÿ .๐Ÿ“ฆ.๐Ÿ“ฑ.๐Ÿ’ป.โŒš.๐Ÿ“ท.๐Ÿ’ก.๐Ÿ”‘.๐ŸŽ.๐Ÿ“Œ.โœ๏ธ.๐Ÿ“.๐Ÿ“ž.๐Ÿ“ง.๐Ÿ’ฐ.๐Ÿ“ˆ.โฐ.๐Ÿ””.๐ŸŽฏ.๐Ÿ†.๐ŸŽฎ.๐ŸŽต.๐Ÿ’ฌ.๐Ÿ‘€`.split(`.`)}],C={inquiry:{title:`Leave a message`,submit:`Send message`,fields:[{key:`visitorName`,label:`Name`,kind:`text`,identity:`name`},{key:`visitorEmail`,label:`Email`,kind:`email`,required:!0,identity:`email`},{key:`message`,label:`Message`,kind:`textarea`,required:!0,placeholder:`How can we help?`}]},contact:{title:`Share your details`,submit:`Save`,fields:[{key:`name`,label:`Name`,kind:`text`,identity:`name`},{key:`email`,label:`Email`,kind:`email`,required:!0,identity:`email`},{key:`phone`,label:`Phone`,kind:`tel`,identity:`phone`}]},"book-demo":{title:`Book a demo`,submit:`Request demo`,fields:[{key:`visitorName`,label:`Name`,kind:`text`,identity:`name`},{key:`visitorEmail`,label:`Email`,kind:`email`,required:!0,identity:`email`},{key:`preferredAt`,label:`Preferred time`,kind:`text`,placeholder:`e.g. Thursday 3pm`},{key:`notes`,label:`Notes`,kind:`textarea`,placeholder:`Anything we should know?`}]},"request-callback":{title:`Request a callback`,submit:`Request callback`,fields:[{key:`visitorName`,label:`Name`,kind:`text`,identity:`name`},{key:`visitorPhone`,label:`Phone`,kind:`tel`,required:!0,identity:`phone`},{key:`bestTime`,label:`Best time to call`,kind:`text`,placeholder:`e.g. tomorrow afternoon`},{key:`topic`,label:`Topic`,kind:`text`,placeholder:`What should we call about?`}]},"subscribe-newsletter":{title:`Subscribe`,submit:`Subscribe`,fields:[{key:`visitorName`,label:`Name`,kind:`text`,identity:`name`},{key:`visitorEmail`,label:`Email`,kind:`email`,required:!0,identity:`email`}]}},w={openChat:`Open chat`,closeChat:`Close chat`,muteSounds:`Mute sounds`,unmuteSounds:`Unmute sounds`,statusOnline:`Online ยท replies instantly`,statusOffline:`Away ยท leave a message`,composerPlaceholder:`Type your messageโ€ฆ`,send:`Send message`,emoji:`Emoji`,gifs:`GIFs`,attachFile:`Attach a file`,recordVoice:`Record a voice message`,stopRecording:`Stop recording`,stop:`Stop`,copy:`Copy`,copied:`Copied`,retry:`Retry`,clearChat:`Clear conversation`,clearChatConfirm:`Clear this conversation?`,clearChatConfirmBody:`This clears the messages on this device and starts a fresh chat.`,clearConfirmCta:`Clear chat`,endChat:`End conversation`,endChatConfirm:`End this conversation?`,endChatConfirmBody:`You won't be able to send more messages in this chat, but you can start a new one anytime.`,endConfirmCta:`End conversation`,conversationEnded:`This conversation has ended.`,startNewChat:`Start a new conversation`,pastConversations:`Past conversations`,viewingPast:`Viewing a past conversation (read-only)`,backToChat:`Back to current chat`,historyEnded:`ended`,feedbackHelpful:`Helpful`,feedbackNotHelpful:`Not helpful`,feedbackThanks:`Thanks for the feedback`,csatPrompt:`How was this chat?`,feedbackCommentPlaceholder:`What went wrong? (optional)`,feedbackSend:`Send`,cancel:`Cancel`,newMessages:`New messages`,poweredBy:`Powered by`,searchGifs:`Search GIFsโ€ฆ`,searchingGifs:`Searchingโ€ฆ`,noGifs:`No GIFs found`,assistantTyping:`Assistant is typing`,emptyReply:`Sorry, I couldn't generate a reply.`,errorGeneric:`Something went wrong reaching the assistant. Please try again.`,errorRateLimit:`Youโ€™re sending messages a little fast โ€” give it a second and try again.`,attaching:`Reading fileโ€ฆ`,attachTooLarge:`That file is too large (max 8 MB).`,attachFailed:`Couldnโ€™t read that file โ€” try another.`,handoffTitle:`Want our team to follow up?`,handoffName:`Name (optional)`,handoffEmail:`Your email`,handoffNotify:`Notify the team`,sending:`Sendingโ€ฆ`,handoffShared:`Iโ€™ve shared this with our team โ€” theyโ€™ll get back to you at {email}.`,formThanks:`Thanks! Weโ€™ll be in touch.`,formError:`Something went wrong โ€” please try again.`,bookingPickTime:`What time works best?`,bookingDuration:`30-minute demo`,bookingRequested:`Requested for {when} โ€” weโ€™ll confirm by email.`,bookingConfirmed:`Youโ€™re booked for {when}! A calendar invite is on its way. ๐Ÿ“…`,bookingSlotTaken:`That time was just taken โ€” please pick another.`,bookingViaProvider:`Pick a time that works for you on {provider}.`,bookingOpenScheduler:`Open the scheduler`,bookingLinkOpened:`Opening the scheduler โ€” pick a time that suits you. ๐Ÿ“…`,bookingMeetingLink:`Meeting link`,previewReply:`๐Ÿ‘‹ This is a preview โ€” replies here are samples. Publish the widget on your site to chat with the live AI.`,previewActionNote:`Preview โ€” nothing was actually sent. This works for real once you publish.`,previewBanner:`Preview โ€” sample replies, no AI`},T=(e,t)=>e.replace(/\{(\w+)\}/g,(e,n)=>t[n]??``),E=e=>e?{...w,...e}:w,D=(0,e.createContext)(w),O=D.Provider,k=()=>(0,t.useContext)(D),A=(e,t)=>(0,n.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,...t,children:e}),ee=e=>(0,n.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,n.jsx)(`path`,{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M5 3.25h14A3.75 3.75 0 0 1 22.75 7v6A3.75 3.75 0 0 1 19 16.75h-7.19l-4.26 3.84A.75.75 0 0 1 6.25 20v-3.32A3.75 3.75 0 0 1 2.25 13V7A3.75 3.75 0 0 1 6 3.25Zm3 7.75a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z`})}),te=e=>A((0,n.jsx)(`path`,{d:`m6 9 6 6 6-6`}),e),j=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),(0,n.jsx)(`path`,{d:`M22 2 11 13`})]}),e),ne=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`}),(0,n.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`}),(0,n.jsx)(`line`,{x1:`12`,y1:`19`,x2:`12`,y2:`22`})]}),e),M=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M15 3h6v6`}),(0,n.jsx)(`path`,{d:`M10 14 21 3`}),(0,n.jsx)(`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`})]}),e),N=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`18`,rx:`2`}),(0,n.jsx)(`line`,{x1:`16`,y1:`2`,x2:`16`,y2:`6`}),(0,n.jsx)(`line`,{x1:`8`,y1:`2`,x2:`8`,y2:`6`}),(0,n.jsx)(`line`,{x1:`3`,y1:`10`,x2:`21`,y2:`10`})]}),e),P=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}),(0,n.jsx)(`path`,{d:`m22 7-10 5L2 7`})]}),e),F=e=>A((0,n.jsx)(`path`,{d:`M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92Z`}),e),re=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,n.jsx)(`path`,{d:`M8.5 14.5a4 4 0 0 0 7 0`}),(0,n.jsx)(`line`,{x1:`9`,y1:`9.5`,x2:`9.01`,y2:`9.5`}),(0,n.jsx)(`line`,{x1:`15`,y1:`9.5`,x2:`15.01`,y2:`9.5`})]}),e),I=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,n.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]}),e),L=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M11 5 6 9H2v6h4l5 4z`}),(0,n.jsx)(`path`,{d:`M15.5 8.5a5 5 0 0 1 0 7`}),(0,n.jsx)(`path`,{d:`M19 5a9 9 0 0 1 0 14`})]}),e),ie=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M11 5 6 9H2v6h4l5 4z`}),(0,n.jsx)(`line`,{x1:`22`,y1:`9`,x2:`16`,y2:`15`}),(0,n.jsx)(`line`,{x1:`16`,y1:`9`,x2:`22`,y2:`15`})]}),e),R=e=>A((0,n.jsx)(`path`,{d:`M20 6 9 17l-5-5`}),e),z=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`}),(0,n.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),e),ae=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M1 4v6h6`}),(0,n.jsx)(`path`,{d:`M3.51 15a9 9 0 1 0 2.13-9.36L1 10`})]}),e),oe=e=>A((0,n.jsx)(`rect`,{x:`6`,y:`6`,width:`12`,height:`12`,rx:`2`}),e),se=e=>A((0,n.jsx)(`path`,{d:`M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48`}),e),ce=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M18.36 6.64a9 9 0 1 1-12.73 0`}),(0,n.jsx)(`line`,{x1:`12`,y1:`2`,x2:`12`,y2:`12`})]}),e),le=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,n.jsx)(`path`,{d:`M12 7v5l3 2`})]}),e),ue=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M7 10v12`}),(0,n.jsx)(`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`})]}),e),de=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`path`,{d:`M17 14V2`}),(0,n.jsx)(`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`})]}),e),fe=e=>A((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,n.jsx)(`path`,{d:`m19 12-7 7-7-7`})]}),e),pe=/(`[^`]+`)|(\*\*[^*]+\*\*)|(\[[^\]]+\]\(https?:\/\/[^\s)]+\))|(https?:\/\/[^\s)]+)/g,B=e=>{let t=[],r=0,i=0,a;for(pe.lastIndex=0;(a=pe.exec(e))!==null;){a.index>r&&t.push(e.slice(r,a.index));let o=a[0];if(o.startsWith("`"))t.push((0,n.jsx)(`code`,{class:`cf-md-code`,children:o.slice(1,-1)},i++));else if(o.startsWith(`**`))t.push((0,n.jsx)(`strong`,{children:o.slice(2,-2)},i++));else if(o.startsWith(`[`)){let e=/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/.exec(o),r=e?e[1]:o,a=e?e[2]:`#`;t.push((0,n.jsx)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer nofollow`,children:r},i++))}else t.push((0,n.jsx)(`a`,{href:o,target:`_blank`,rel:`noopener noreferrer nofollow`,children:o},i++));r=a.index+o.length}return r<e.length&&t.push(e.slice(r)),t},me=/^(```|#{1,6}\s|\s*[-*]\s|\s*\d+\.\s)/,he=e=>{let t=e.replace(/\r\n/g,`
6
- `).split(`
7
- `),r=[],i=0,a=0;for(;a<t.length;){let e=t[a];if(e.trim().startsWith("```")){let e=[];for(a++;a<t.length&&!t[a].trim().startsWith("```");)e.push(t[a]),a++;a++,r.push((0,n.jsx)(`pre`,{class:`cf-md-pre`,children:(0,n.jsx)(`code`,{children:e.join(`
8
- `)})},i++));continue}if(e.trim()===``){a++;continue}let o=/^(#{1,6})\s+(.*)$/.exec(e);if(o){r.push((0,n.jsx)(`div`,{class:`cf-md-h`,children:B(o[2])},i++)),a++;continue}if(/^\s*[-*]\s+/.test(e)){let e=[];for(;a<t.length&&/^\s*[-*]\s+/.test(t[a]);)e.push((0,n.jsx)(`li`,{children:B(t[a].replace(/^\s*[-*]\s+/,``))},e.length)),a++;r.push((0,n.jsx)(`ul`,{class:`cf-md-list`,children:e},i++));continue}if(/^\s*\d+\.\s+/.test(e)){let e=[];for(;a<t.length&&/^\s*\d+\.\s+/.test(t[a]);)e.push((0,n.jsx)(`li`,{children:B(t[a].replace(/^\s*\d+\.\s+/,``))},e.length)),a++;r.push((0,n.jsx)(`ol`,{class:`cf-md-list`,children:e},i++));continue}let s=[e];for(a++;a<t.length&&t[a].trim()!==``&&!me.test(t[a]);)s.push(t[a]),a++;r.push((0,n.jsx)(`p`,{children:B(s.join(` `))},i++))}return r},ge=()=>{let e=(0,t.useRef)(null);return(0,t.useEffect)(()=>{let t=requestAnimationFrame(()=>e.current?.scrollIntoView({block:`end`}));return()=>cancelAnimationFrame(t)},[]),e},_e=e=>e.trim().split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()??``).join(``)||`๐Ÿค–`,ve=({persona:e,small:t})=>{let r=t?`cf-msg__avatar`:`cf-header__avatar`;return e?.agentAvatarUrl?(0,n.jsx)(`span`,{class:r,children:(0,n.jsx)(`img`,{src:e.agentAvatarUrl,alt:``})}):(0,n.jsx)(`span`,{class:r,children:e?_e(e.agentName):`ยท`})},ye=()=>{let e=k();return(0,n.jsxs)(`div`,{class:`cf-msg__bubble cf-typing`,"aria-label":e.assistantTyping,children:[(0,n.jsx)(`span`,{class:`cf-typing__dot`}),(0,n.jsx)(`span`,{class:`cf-typing__dot`}),(0,n.jsx)(`span`,{class:`cf-typing__dot`})]})},be=3,V=({msg:e})=>{if(!e.sources||e.sources.length===0)return null;let t=new Set,r=[];for(let n of e.sources){let e=(n.url||n.title||``).toLowerCase();!e||t.has(e)||(t.add(e),r.push(n))}if(r.length===0)return null;let i=r.slice(0,3),a=r.length-i.length;return(0,n.jsxs)(`div`,{class:`cf-sources`,children:[i.map((e,t)=>e.url?(0,n.jsxs)(`a`,{class:`cf-source`,href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,title:e.title||e.url,children:[(0,n.jsx)(M,{}),(0,n.jsx)(`span`,{children:e.title||e.url})]},t):(0,n.jsxs)(`span`,{class:`cf-source`,title:e.title,children:[(0,n.jsx)(M,{}),(0,n.jsx)(`span`,{children:e.title})]},t)),a>0&&(0,n.jsxs)(`span`,{class:`cf-source cf-source--more`,children:[`+`,a,` more`]})]})},H=({replies:e,onPick:t})=>e&&e.length>0?(0,n.jsx)(`div`,{class:`cf-chips`,children:e.map((e,r)=>(0,n.jsx)(`button`,{type:`button`,class:`cf-chip`,onClick:()=>t(e),children:e},r))}):null,U={public_book_demo:{type:`book-demo`,label:`Book a demo`,Icon:N},public_submit_inquiry:{type:`inquiry`,label:`Leave a message`,Icon:P},public_request_callback:{type:`request-callback`,label:`Request a callback`,Icon:F},public_subscribe_newsletter:{type:`subscribe-newsletter`,label:`Subscribe`,Icon:P}},xe=({field:e,value:t,onInput:r})=>{let i=e.placeholder??e.label,a={class:`cf-form__input`,placeholder:e.required?`${i} *`:i,value:t,"aria-label":e.label,onInput:e=>r(e.target.value)};return e.kind===`textarea`?(0,n.jsx)(`textarea`,{rows:2,...a}):(0,n.jsx)(`input`,{type:e.kind,...a})},Se=({spec:e,visitor:r,onSubmit:i,onCancel:a})=>{let o=k(),s=ge(),[c,l]=(0,t.useState)(()=>{let t={};for(let n of e.fields)n.identity&&r[n.identity]&&(t[n.key]=r[n.identity]);return t}),[u,d]=(0,t.useState)(`idle`),[f,p]=(0,t.useState)(``),m=e=>!!(e.identity&&r[e.identity]?.trim()),h=e.fields.filter(e=>!m(e)),g=h.every(e=>!e.required||(c[e.key]?.trim()??``)!==``),_=r.email||r.name||``;return u===`done`?(0,n.jsxs)(`div`,{class:`cf-form cf-form--done`,children:[(0,n.jsx)(R,{}),(0,n.jsx)(`span`,{children:f})]}):(0,n.jsxs)(`div`,{class:`cf-form`,ref:s,children:[(0,n.jsx)(`div`,{class:`cf-form__title`,children:e.title}),h.length===0&&_&&(0,n.jsxs)(`div`,{class:`cf-form__as`,children:[`as `,_]}),h.map(e=>(0,n.jsx)(xe,{field:e,value:c[e.key]??``,onInput:t=>l(n=>({...n,[e.key]:t}))},e.key)),u===`error`&&(0,n.jsx)(`div`,{class:`cf-form__err`,children:o.formError}),(0,n.jsxs)(`div`,{class:`cf-form__actions`,children:[a&&(0,n.jsx)(`button`,{type:`button`,class:`cf-form__cancel`,onClick:a,children:`Cancel`}),(0,n.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:!g||u===`submitting`,onClick:async()=>{if(!g||u===`submitting`)return;d(`submitting`);let t={},n={};for(let r of e.fields){let e=c[r.key]?.trim();e&&(t[r.key]=e,r.identity&&(n[r.identity]=e))}try{p((await i(t,n)).note||o.formThanks),d(`done`)}catch{d(`error`)}},children:u===`submitting`?o.sending:e.submit})]})]})},W=e=>String(e).padStart(2,`0`),Ce=()=>{let e=[];for(let t=9;t<=17;t++)e.push(`${W(t)}:00`),e.push(`${W(t)}:30`);return e},we=e=>{let t=new Date;return t.setHours(0,0,0,0),Array.from({length:e},(e,n)=>{let r=new Date(t);return r.setDate(t.getDate()+n),r})},G=(e,t)=>{let[n,r]=t.split(`:`).map(Number),i=new Date(e.getFullYear(),e.getMonth(),e.getDate(),n??0,r??0);try{return new Intl.DateTimeFormat(void 0,{weekday:`short`,day:`numeric`,month:`short`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,timeZoneName:`short`}).format(i)}catch{return`${e.toDateString()} ${t}`}},K=(e,t)=>{let[n,r]=t.split(`:`).map(Number);return new Date(e.getFullYear(),e.getMonth(),e.getDate(),n??0,r??0)},q=({visitor:e,onSubmit:r,onCancel:i,onDemoSlots:a,scheduler:o})=>{let s=k(),c=ge(),l=(0,t.useMemo)(()=>we(14),[]),u=(0,t.useMemo)(()=>Ce(),[]),[d,f]=(0,t.useState)((0,t.useMemo)(()=>{let e=Date.now();for(let t=0;t<l.length;t++)if(u.some(n=>K(l[t],n).getTime()>e))return t;return 0},[l,u])),[p,m]=(0,t.useState)(null),[h,g]=(0,t.useState)(e.name??``),[_,v]=(0,t.useState)(e.email??``),[y,b]=(0,t.useState)(`idle`),[x,S]=(0,t.useState)(``),[w,E]=(0,t.useState)(``),[D,O]=(0,t.useState)(``),A=o?.connected&&o.mode===`link`,ee=async()=>{if(y===`submitting`||!e.email?.trim()&&!_.trim())return;b(`submitting`),E(``);let t={};_.trim()&&(t.email=_.trim()),h.trim()&&(t.name=h.trim());try{let e=await r({..._.trim()?{visitorEmail:_.trim()}:{},...h.trim()?{visitorName:h.trim()}:{}},t),n=e.booking?.schedulingLink||o?.bookingLink||``;if(!n){b(`error`);return}try{window.open(n,`_blank`,`noopener,noreferrer`)}catch{}O(n),S(e.note||s.bookingLinkOpened),b(`done`)}catch{b(`error`)}},[te,j]=(0,t.useState)(new Set),[ne,N]=(0,t.useState)([]),[P,F]=(0,t.useState)(0),[re,I]=(0,t.useState)(!1);(0,t.useEffect)(()=>{if(!a)return;let e=!0,t=new Date,n=new Date;return n.setDate(n.getDate()+15),a(t.toISOString(),n.toISOString()).then(t=>{e&&(j(new Set(t.taken.map(e=>Date.parse(e)).filter(e=>!Number.isNaN(e)))),N(t.busy.map(e=>[Date.parse(e.start),Date.parse(e.end)]).filter(([e,t])=>!Number.isNaN(e)&&!Number.isNaN(t))))}).catch(()=>{}),()=>{e=!1}},[a,P]);let L=!!e.email?.trim(),ie=!!p&&(L||_.trim()!==``),z=e.email||e.name||``,ae=e=>te.has(K(l[d],e).getTime()),oe=e=>K(l[d],e).getTime()<=Date.now(),se=e=>{let t=K(l[d],e).getTime(),n=t+18e5;return ne.some(([e,r])=>t<r&&n>e)},ce=async()=>{if(!ie||y===`submitting`||!p)return;b(`submitting`),I(!1),E(``);let e=K(l[d],p),t=G(l[d],p),n={};_.trim()&&(n.email=_.trim()),h.trim()&&(n.name=h.trim());try{let i=await r({preferredAt:t,slotAt:e.toISOString(),..._.trim()?{visitorEmail:_.trim()}:{},...h.trim()?{visitorName:h.trim()}:{}},n);i.booking?.confirmed?(S(i.note||T(s.bookingConfirmed,{when:t})),O(i.booking.meetingUrl||i.booking.eventLink||``)):S(i.note||T(s.bookingRequested,{when:t})),b(`done`)}catch(t){if(t?.status===409)j(t=>new Set(t).add(e.getTime())),m(null),I(!0),F(e=>e+1),b(`idle`);else{let e=t?.message;E(e&&e.length<120?e:``),b(`error`)}}};return y===`done`?(0,n.jsxs)(`div`,{class:`cf-form cf-form--done`,children:[(0,n.jsx)(R,{}),(0,n.jsx)(`span`,{children:x}),D&&(0,n.jsxs)(`a`,{class:`cf-booking__link`,href:D,target:`_blank`,rel:`noopener noreferrer`,children:[A?s.bookingOpenScheduler:s.bookingMeetingLink,` `,(0,n.jsx)(M,{})]})]}):A?(0,n.jsxs)(`div`,{class:`cf-form cf-booking`,ref:c,children:[(0,n.jsx)(`div`,{class:`cf-form__title`,children:C[`book-demo`].title}),(0,n.jsx)(`div`,{class:`cf-booking__hint`,children:T(s.bookingViaProvider,{provider:o?.label??`the scheduler`})}),L?z?(0,n.jsxs)(`div`,{class:`cf-form__as`,children:[`as `,z]}):null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`input`,{class:`cf-form__input`,type:`text`,placeholder:s.handoffName,value:h,"aria-label":s.handoffName,onInput:e=>g(e.target.value)}),(0,n.jsx)(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${s.handoffEmail} *`,value:_,"aria-label":s.handoffEmail,onInput:e=>v(e.target.value)})]}),y===`error`&&(0,n.jsx)(`div`,{class:`cf-form__err`,children:w||s.formError}),(0,n.jsxs)(`div`,{class:`cf-form__actions`,children:[i&&(0,n.jsx)(`button`,{type:`button`,class:`cf-form__cancel`,onClick:i,children:s.cancel}),(0,n.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:y===`submitting`||!L&&_.trim()===``,onClick:ee,children:y===`submitting`?s.sending:s.bookingOpenScheduler})]})]}):(0,n.jsxs)(`div`,{class:`cf-form cf-booking`,ref:c,children:[(0,n.jsx)(`div`,{class:`cf-form__title`,children:C[`book-demo`].title}),(0,n.jsxs)(`div`,{class:`cf-booking__hint`,children:[s.bookingPickTime,` ยท `,(0,n.jsx)(`span`,{class:`cf-booking__dur`,children:s.bookingDuration})]}),(0,n.jsx)(`div`,{class:`cf-booking__dates`,role:`tablist`,"aria-label":`Pick a day`,children:l.map((e,t)=>(0,n.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===d,class:`cf-booking__date ${t===d?`is-selected`:``}`,onClick:()=>{f(t),m(null)},children:[(0,n.jsx)(`span`,{class:`cf-booking__dow`,children:e.toLocaleDateString(void 0,{weekday:`short`})}),(0,n.jsx)(`span`,{class:`cf-booking__dom`,children:e.getDate()})]},t))}),(0,n.jsx)(`div`,{class:`cf-booking__slots`,role:`listbox`,"aria-label":`Pick a time`,children:u.map(e=>{let t=oe(e),r=se(e),i=ae(e),a=i||t||r;return(0,n.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":p===e,disabled:a,title:t?`Earlier today`:r?`Busy on the calendar`:i?`Already booked`:void 0,class:`cf-booking__slot ${p===e?`is-selected`:``} ${a?`is-taken`:``}`,onClick:()=>m(e),children:e},e)})}),re&&(0,n.jsx)(`div`,{class:`cf-form__err`,children:s.bookingSlotTaken}),L?z?(0,n.jsxs)(`div`,{class:`cf-form__as`,children:[`as `,z]}):null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`input`,{class:`cf-form__input`,type:`text`,placeholder:s.handoffName,value:h,"aria-label":s.handoffName,onInput:e=>g(e.target.value)}),(0,n.jsx)(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${s.handoffEmail} *`,value:_,"aria-label":s.handoffEmail,onInput:e=>v(e.target.value)})]}),y===`error`&&(0,n.jsx)(`div`,{class:`cf-form__err`,children:w||s.formError}),(0,n.jsxs)(`div`,{class:`cf-form__actions`,children:[i&&(0,n.jsx)(`button`,{type:`button`,class:`cf-form__cancel`,onClick:i,children:s.cancel}),(0,n.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:!ie||y===`submitting`,onClick:ce,children:y===`submitting`?s.sending:C[`book-demo`].submit})]})]})},J=({actions:e,visitor:r,onSubmitForm:i,onDemoSlots:a,scheduler:o,exclude:s=[]})=>{let[c,l]=(0,t.useState)(null),u=(e??[]).map(e=>U[e]).filter(e=>!!e&&!s.includes(e.type));return u.length===0?null:c===`book-demo`?(0,n.jsx)(q,{visitor:r,onCancel:()=>l(null),onSubmit:(e,t)=>i(`book-demo`,e,t),onDemoSlots:a,scheduler:o}):c?(0,n.jsx)(Se,{spec:C[c],visitor:r,onCancel:()=>l(null),onSubmit:(e,t)=>i(c,e,t)}):(0,n.jsx)(`div`,{class:`cf-actions`,children:u.map(({type:e,label:t,Icon:r})=>(0,n.jsxs)(`button`,{type:`button`,class:`cf-action`,onClick:()=>l(e),children:[(0,n.jsx)(r,{}),t]},e))})},Y=({hasEmail:e,visitor:r,question:i,onSubmitForm:a})=>{let o=k(),[s,c]=(0,t.useState)(!1),[l,u]=(0,t.useState)(!1),[d,f]=(0,t.useState)(r.name??``),[p,m]=(0,t.useState)(r.email??``);if(e)return null;if(s){let e=r.email||p;return(0,n.jsxs)(`div`,{class:`cf-handoff cf-handoff--done`,children:[(0,n.jsx)(R,{}),(0,n.jsx)(`span`,{children:T(o.handoffShared,{email:e})})]})}let h=async()=>{if(!(!p.trim()||l)){u(!0);try{await a(`inquiry`,{visitorEmail:p.trim(),...d.trim()?{visitorName:d.trim()}:{},message:i||`I had a question the assistant couldnโ€™t answer.`,subject:`Help request from chat`},{email:p.trim(),name:d.trim()||void 0}),c(!0)}catch{u(!1)}}};return(0,n.jsxs)(`div`,{class:`cf-handoff`,children:[(0,n.jsx)(`div`,{class:`cf-handoff__title`,children:o.handoffTitle}),(0,n.jsx)(`input`,{class:`cf-form__input`,type:`text`,placeholder:o.handoffName,value:d,"aria-label":o.handoffName,onInput:e=>f(e.target.value)}),(0,n.jsx)(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${o.handoffEmail} *`,value:p,"aria-label":o.handoffEmail,onInput:e=>m(e.target.value)}),(0,n.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:!p.trim()||l,onClick:h,children:l?o.sending:o.handoffNotify})]})},Te=({text:e})=>{let r=k(),[i,a]=(0,t.useState)(!1);return(0,n.jsxs)(`button`,{type:`button`,class:`cf-tool`,onClick:async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1500)}catch{}},"aria-label":r.copy,children:[i?(0,n.jsx)(R,{}):(0,n.jsx)(z,{}),i?r.copied:r.copy]})},Ee=({items:e,onPick:t})=>e.length===0?null:(0,n.jsx)(`div`,{class:`cf-starters`,children:e.map((e,r)=>(0,n.jsx)(`button`,{type:`button`,class:`cf-starter`,onClick:()=>t(e),children:e},r))}),De=({msg:e,onRate:r})=>{let i=k(),[a,o]=(0,t.useState)(!1),[s,c]=(0,t.useState)(``),l=e.feedback,u=()=>{r(e.id,`up`),o(!1)},d=()=>{r(e.id,`down`),o(!0)},f=()=>{r(e.id,`down`,s.trim()),o(!1)};return(0,n.jsxs)(`div`,{class:`cf-feedback`,children:[(0,n.jsxs)(`div`,{class:`cf-feedback__row`,children:[(0,n.jsx)(`button`,{type:`button`,class:`cf-feedback__btn ${l===`up`?`is-active`:``}`,"aria-label":i.feedbackHelpful,"aria-pressed":l===`up`,onClick:u,children:(0,n.jsx)(ue,{})}),(0,n.jsx)(`button`,{type:`button`,class:`cf-feedback__btn ${l===`down`?`is-active`:``}`,"aria-label":i.feedbackNotHelpful,"aria-pressed":l===`down`,onClick:d,children:(0,n.jsx)(de,{})}),l&&!a&&(0,n.jsx)(`span`,{class:`cf-feedback__thanks`,children:i.feedbackThanks})]}),a&&l===`down`&&(0,n.jsxs)(`div`,{class:`cf-feedback__comment`,children:[(0,n.jsx)(`textarea`,{class:`cf-feedback__input`,rows:2,placeholder:i.feedbackCommentPlaceholder,value:s,onInput:e=>c(e.target.value)}),(0,n.jsx)(`button`,{type:`button`,class:`cf-feedback__send`,onClick:f,children:i.feedbackSend})]})]})},Oe=({msg:e,persona:t,isLast:r,visitor:i,hasEmail:a,lastQuestion:o,showActions:s,onPickReply:c,onSubmitForm:l,onDemoSlots:u,onRetry:d,ratable:f,onRate:p})=>{let m=k(),h=e.role===`user`,g=e.requestedContactFields?.includes(`email`)===!0,_=r&&!h&&!!(e.handoffOffered||g),v=_&&!a?[`inquiry`]:[],y=!e.pending&&!e.streaming;return(0,n.jsxs)(`div`,{class:`cf-msg cf-msg--${h?`user`:`agent`}`,children:[!h&&(0,n.jsx)(ve,{persona:t,small:!0}),(0,n.jsxs)(`div`,{class:`cf-msg__col`,children:[e.pending&&e.content===``?(0,n.jsx)(ye,{}):e.imageUrl?(0,n.jsxs)(`div`,{class:`cf-msg__bubble cf-msg__bubble--media`,children:[(0,n.jsx)(`img`,{class:`cf-msg__media`,src:e.imageUrl,alt:`GIF`}),e.content&&(0,n.jsx)(`span`,{class:`cf-msg__caption`,children:e.content})]}):(0,n.jsxs)(`div`,{class:`cf-msg__bubble`,children:[h?e.content:he(e.content),e.streaming&&(0,n.jsx)(`span`,{class:`cf-caret`,"aria-hidden":`true`})]}),h&&e.attachmentName&&(0,n.jsxs)(`div`,{class:`cf-attach-chip`,title:e.attachmentName,children:[(0,n.jsx)(se,{}),(0,n.jsx)(`span`,{children:e.attachmentName})]}),!h&&(0,n.jsxs)(n.Fragment,{children:[y&&(e.error||e.content)&&(0,n.jsx)(`div`,{class:`cf-msg__tools`,children:e.error?(0,n.jsxs)(`button`,{type:`button`,class:`cf-tool`,onClick:()=>d(e.id,e.retryText??``),children:[(0,n.jsx)(ae,{}),m.retry]}):(0,n.jsx)(Te,{text:e.content})}),y&&f&&!e.error&&e.content&&(0,n.jsx)(De,{msg:e,onRate:p}),(0,n.jsx)(V,{msg:e}),r&&(0,n.jsx)(H,{replies:e.suggestedReplies,onPick:c}),_&&(0,n.jsx)(Y,{hasEmail:a,visitor:i,question:o,onSubmitForm:l}),s&&(0,n.jsx)(J,{actions:e.availableActions,visitor:i,onSubmitForm:l,onDemoSlots:u,scheduler:t?.scheduler,exclude:v})]})]})]})},ke=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).split(`,`)[1]??``),r.onerror=n,r.readAsDataURL(e)}),Ae=({onPick:e})=>(0,n.jsx)(`div`,{class:`cf-picker cf-emoji`,children:S.map(t=>(0,n.jsxs)(`div`,{class:`cf-emoji__group`,children:[(0,n.jsx)(`div`,{class:`cf-emoji__label`,children:t.name}),(0,n.jsx)(`div`,{class:`cf-emoji__grid`,children:t.emojis.map((t,r)=>(0,n.jsx)(`button`,{type:`button`,class:`cf-emoji__btn`,onClick:()=>e(t),"aria-label":t,children:t},r))})]},t.name))}),je=({onSearch:e,onPick:r})=>{let i=k(),[a,o]=(0,t.useState)(``),[s,c]=(0,t.useState)([]),[l,u]=(0,t.useState)(!0);return(0,t.useEffect)(()=>{let t=!0;u(!0);let n=setTimeout(()=>{e(a).then(e=>t&&(c(e),u(!1))).catch(()=>t&&(c([]),u(!1)))},300);return()=>{t=!1,clearTimeout(n)}},[a,e]),(0,n.jsxs)(`div`,{class:`cf-picker cf-gif`,children:[(0,n.jsx)(`input`,{class:`cf-gif__search`,placeholder:i.searchGifs,value:a,"aria-label":i.searchGifs,onInput:e=>o(e.target.value)}),(0,n.jsx)(`div`,{class:`cf-gif__grid`,children:l?(0,n.jsx)(`div`,{class:`cf-gif__hint`,children:i.searchingGifs}):s.length===0?(0,n.jsx)(`div`,{class:`cf-gif__hint`,children:i.noGifs}):s.map(e=>(0,n.jsx)(`button`,{type:`button`,class:`cf-gif__item`,onClick:()=>r(e.url),"aria-label":e.alt,children:(0,n.jsx)(`img`,{src:e.preview,alt:e.alt,loading:`lazy`})},e.id))}),(0,n.jsx)(`div`,{class:`cf-gif__powered`,children:`via Tenor`})]})},Me=8*1024*1024,Ne=`image/png,image/jpeg,image/webp,image/gif,application/pdf`,Pe=({onSend:e,onSendGif:r,disabled:i,allowVoice:a,onTranscribe:o,gifEnabled:s,onSearchGifs:c,allowAttach:l,onExtract:u})=>{let d=k(),[f,p]=(0,t.useState)(``),[m,h]=(0,t.useState)(!1),[g,_]=(0,t.useState)(`none`),[v,y]=(0,t.useState)(null),[b,x]=(0,t.useState)(!1),[S,C]=(0,t.useState)(``),w=(0,t.useRef)(null),T=(0,t.useRef)(null),E=(0,t.useRef)(null),D=(0,t.useRef)(null),O=(0,t.useRef)([]);(0,t.useEffect)(()=>{let e=w.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,110)}px`)},[f]),(0,t.useEffect)(()=>{if(g===`none`)return;let e=e=>{T.current&&!e.composedPath().includes(T.current)&&_(`none`)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[g]);let A=e=>_(t=>t===e?`none`:e),ee=e=>{let t=w.current;if(!t){p(t=>t+e);return}let n=t.selectionStart??f.length,r=t.selectionEnd??f.length;p(f.slice(0,n)+e+f.slice(r)),requestAnimationFrame(()=>{t.focus();let r=n+e.length;t.setSelectionRange(r,r)})},te=e=>{_(`none`),r(e)},M=async e=>{let t=e.target,n=t.files?.[0];if(t.value=``,n){if(C(``),n.size>8388608){C(d.attachTooLarge);return}x(!0);try{let e=await u(await ke(n),n.type||`application/octet-stream`,n.name);if(!e){C(d.attachFailed);return}y({name:n.name,text:e})}catch{C(d.attachFailed)}finally{x(!1)}}},N=(!!f.trim()||!!v)&&!i&&!b,P=()=>{N&&(e(f,v?{attachmentName:v.name,attachmentText:v.text}:void 0),p(``),y(null),C(``))},F=e=>{e.key===`Enter`&&!e.shiftKey?(e.preventDefault(),P()):e.key===`Escape`&&g!==`none`&&(e.preventDefault(),e.stopPropagation(),_(`none`))},L=async()=>{if(m){D.current?.stop();return}try{let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e);O.current=[],t.ondataavailable=e=>e.data.size>0&&O.current.push(e.data),t.onstop=async()=>{e.getTracks().forEach(e=>e.stop()),h(!1);let n=new Blob(O.current,{type:t.mimeType||`audio/webm`});try{let e=await o(await ke(n),n.type);e&&p(t=>t?`${t} ${e}`:e)}catch{}},D.current=t,t.start(),h(!0)}catch{let e=await o(``,`audio/webm`).catch(()=>``);e&&p(t=>t?`${t} ${e}`:e)}};return(0,n.jsxs)(`div`,{class:`cf-composer`,ref:T,children:[g===`emoji`&&(0,n.jsx)(Ae,{onPick:ee}),g===`gif`&&(0,n.jsx)(je,{onSearch:c,onPick:te}),(v||b||S)&&(0,n.jsx)(`div`,{class:`cf-attach-row`,children:b?(0,n.jsx)(`span`,{class:`cf-attach-status`,children:d.attaching}):S?(0,n.jsx)(`span`,{class:`cf-attach-status cf-attach-status--err`,children:S}):v&&(0,n.jsxs)(`span`,{class:`cf-attach-chip`,title:v.name,children:[(0,n.jsx)(se,{}),(0,n.jsx)(`span`,{children:v.name}),(0,n.jsx)(`button`,{type:`button`,class:`cf-attach-x`,"aria-label":`Remove attachment`,onClick:()=>y(null),children:(0,n.jsx)(I,{})})]})}),(0,n.jsxs)(`div`,{class:`cf-composer__field`,children:[(0,n.jsx)(`button`,{type:`button`,class:`cf-iconbtn ${g===`emoji`?`is-active`:``}`,"aria-label":d.emoji,"aria-pressed":g===`emoji`,onClick:()=>A(`emoji`),children:g===`emoji`?(0,n.jsx)(I,{}):(0,n.jsx)(re,{})}),s&&(0,n.jsx)(`button`,{type:`button`,class:`cf-iconbtn cf-gifbtn ${g===`gif`?`is-active`:``}`,"aria-label":d.gifs,"aria-pressed":g===`gif`,onClick:()=>A(`gif`),children:(0,n.jsx)(`span`,{class:`cf-gif-label`,children:`GIF`})}),l&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`input`,{ref:E,type:`file`,class:`cf-file-input`,accept:`image/png,image/jpeg,image/webp,image/gif,application/pdf`,onChange:M,tabIndex:-1,"aria-hidden":`true`}),(0,n.jsx)(`button`,{type:`button`,class:`cf-iconbtn`,"aria-label":d.attachFile,disabled:b,onClick:()=>E.current?.click(),children:(0,n.jsx)(se,{})})]}),(0,n.jsx)(`textarea`,{ref:w,class:`cf-textarea`,rows:1,placeholder:d.composerPlaceholder,value:f,"aria-label":d.composerPlaceholder,disabled:i,onInput:e=>p(e.target.value),onKeyDown:F}),a&&(0,n.jsx)(`button`,{type:`button`,class:`cf-iconbtn cf-mic ${m?`is-recording`:``}`,"aria-label":m?d.stopRecording:d.recordVoice,"aria-pressed":m,onClick:L,children:(0,n.jsx)(ne,{})}),(0,n.jsx)(`button`,{type:`button`,class:`cf-send`,"aria-label":d.send,disabled:!N,onClick:P,children:(0,n.jsx)(j,{})})]})]})};let Fe=!0,X=null;const Ie=e=>{Fe=e},Le=()=>{let e=typeof window<`u`?window.AudioContext??window.webkitAudioContext:void 0;if(!e)return null;if(!X)try{X=new e}catch{return null}return X.state===`suspended`&&X.resume(),X},Z=(e,t,n,r,i,a)=>{let o=e.createOscillator(),s=e.createGain();o.type=i,o.frequency.setValueAtTime(t,n),o.connect(s),s.connect(e.destination),s.gain.setValueAtTime(1e-4,n),s.gain.exponentialRampToValueAtTime(a,n+.012),s.gain.exponentialRampToValueAtTime(1e-4,n+r),o.start(n),o.stop(n+r+.03)},Re=e=>{if(!Fe)return;let t=Le();if(!t)return;let n=t.currentTime;try{e===`open`?(Z(t,523,n,.12,`sine`,.05),Z(t,784,n+.08,.16,`sine`,.05)):e===`send`?Z(t,660,n,.08,`triangle`,.04):e===`receive`&&(Z(t,880,n,.1,`sine`,.045),Z(t,1175,n+.09,.14,`sine`,.045))}catch{}},Q=()=>typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.round(Math.random()*1e9)}`,ze=e=>{try{return e===`none`?null:e===`session`?sessionStorage:localStorage}catch{return null}},$=e=>`centrinfo:session:${e.slice(0,12)}`,Be=e=>`centrinfo:visitor:${e.slice(0,12)}`,Ve=(e,t)=>`centrinfo:chat:${e.slice(0,12)}:${t}`,He=e=>`centrinfo:history:${e.slice(0,12)}`,Ue=20,We=720*60*60*1e3,Ge=1440*60*1e3,Ke=(e,t)=>{try{return JSON.parse(e?.getItem(Be(t))||`{}`)}catch{return{}}},qe=(e,t)=>{if(!e)return Q();try{let n=$(t),r=e.getItem(n);if(r)return r;let i=Q();return e.setItem(n,i),i}catch{return Q()}},Je=(e,t,n)=>{if(!e)return{};try{let r=e.getItem(Ve(t,n));return r?JSON.parse(r):{}}catch{return{}}},Ye=(e,t,n)=>{let{ts:r,messages:i}=Je(e,t,n);return!Array.isArray(i)||typeof r==`number`&&Date.now()-r>We?[]:i},Xe=(e,t,n)=>{let{ts:r,messages:i,ended:a}=Je(e,t,n);return!Array.isArray(i)||i.length===0||typeof r==`number`&&Date.now()-r>We?!1:a===!0||typeof r==`number`&&Date.now()-r>864e5},Ze=(e,t,n,r,i)=>{if(e)try{let a=r.filter(e=>!e.pending).slice(-50);if(a.length===0)return;e.setItem(Ve(t,n),JSON.stringify({ts:Date.now(),messages:a,ended:i}))}catch{}},Qe=(e,t)=>{if(!e)return[];try{let n=e.getItem(He(t)),r=n?JSON.parse(n):[];return Array.isArray(r)?r:[]}catch{return[]}},$e=(e,t,n)=>{if(e)try{e.setItem(He(t),JSON.stringify(n.slice(0,20)))}catch{}},et=(e,t)=>{if(e)try{let n=`centrinfo:chat:${t.slice(0,12)}:`,r=new Set([$(t),Be(t),He(t)]),i=[];for(let t=0;t<e.length;t++){let a=e.key(t);a&&(r.has(a)||a.startsWith(n))&&i.push(a)}i.forEach(t=>e.removeItem(t))}catch{}},tt=e=>{let t=(e.find(e=>e.role===`user`&&e.content.trim())?.content||e.find(e=>e.content.trim())?.content||``).trim().replace(/\s+/g,` `);return t.length>60?t.slice(0,60)+`โ€ฆ`:t||`Conversation`},nt=(e,n)=>{let r=(0,t.useRef)(ze(n.persistence)).current,i=(0,t.useRef)(qe(r,n.token)),a=(0,t.useRef)(null),[o,s]=(0,t.useState)(null),[c,l]=(0,t.useState)(()=>Ye(r,n.token,i.current)),[u,d]=(0,t.useState)(!1),[f,p]=(0,t.useState)(()=>Xe(r,n.token,i.current)),[m,h]=(0,t.useState)(()=>Ke(r,n.token)),[g,_]=(0,t.useState)(()=>Qe(r,n.token)),[v,y]=(0,t.useState)(null),[b,x]=(0,t.useState)([]),S=(0,t.useRef)(m);(0,t.useEffect)(()=>{S.current=m},[m]);let C=(0,t.useCallback)(()=>{a.current?.abort(),et(r,n.token);let e=Q();i.current=e;try{r?.setItem($(n.token),e)}catch{}y(null),x([]),p(!1),_([]),h({}),l(o?[{id:Q(),role:`assistant`,content:o.greeting,availableActions:o.availableActions}]:[])},[r,n.token,o]),w=(0,t.useCallback)(e=>{try{r?.setItem(Be(n.token),JSON.stringify(e))}catch{}},[r,n.token]),T=(0,t.useCallback)(t=>{let n=(t.email??``).trim().toLowerCase(),r=(S.current.email??``).trim().toLowerCase();n&&r&&n!==r&&C();let a={};t.email?.trim()&&(a.email=t.email.trim()),t.phone?.trim()&&(a.phone=t.phone.trim());let o=[t.firstName,t.lastName].filter(e=>!!e?.trim()).join(` `).trim()||t.name?.trim()||``;o&&(a.name=o),Object.keys(a).length>0&&h(e=>{let t={...a,...e};return w(t),t}),e.identify(i.current,t).catch(()=>{})},[e,w,C]);(0,t.useEffect)(()=>{let t=!0;return e.bootstrap().then(e=>{t&&(s(e),l(t=>t.length>0?t:[{id:Q(),role:`assistant`,content:e.greeting,availableActions:e.availableActions}]))}),n.user&&T(n.user),()=>{t=!1}},[]),(0,t.useEffect)(()=>{Ze(r,n.token,i.current,c,f)},[c,f,r,n.token]),(0,t.useEffect)(()=>{c.some(e=>e.role===`user`)&&_(e=>{let t=i.current,a=[{sessionId:t,ts:Date.now(),title:tt(c),ended:f},...e.filter(e=>e.sessionId!==t)];return $e(r,n.token,a),a.slice(0,20)})},[c,f,r,n.token]);let E=(0,t.useCallback)((e,t)=>{l(n=>n.map(n=>n.id===e?{...n,...t}:n))},[]),D=(0,t.useCallback)((t,r)=>{d(!0);let o=new AbortController;a.current=o,e.stream(t,i.current,{signal:o.signal,onChunk:e=>l(t=>t.map(t=>t.id===r?{...t,content:t.content+e,pending:!1,streaming:!0}:t))}).then(e=>{l(t=>t.map(t=>t.id===r?{...t,content:e.answer||t.content||n.strings.emptyReply,pending:!1,streaming:!1,error:!1,retryText:void 0,sources:e.sources,suggestedReplies:e.suggestedReplies,availableActions:e.availableActions,handoffOffered:e.handoffOffered,requestedContactFields:e.requestedContactFields}:t)),Re(`receive`),n.onMessage?.({role:`assistant`,content:e.answer}),e.handoffOffered&&n.onHandoff?.(),e.conversationEnded&&p(!0)}).catch(e=>{if(o.signal.aborted){E(r,{pending:!1,streaming:!1});return}E(r,{content:e?.status===429?n.strings.errorRateLimit:n.strings.errorGeneric,pending:!1,streaming:!1,error:!0,retryText:t})}).finally(()=>{d(!1),a.current=null})},[e,n,E]),O=(0,t.useCallback)((e,t={})=>{let r=e.trim(),{imageUrl:i,attachmentName:a,attachmentText:o}=t;if(!r&&!i&&!o||u||f)return;let s=r;o?s=`${r}\n\n[Attached file${a?` "${a}"`:``}]:\n${o}`.trim():!s&&i&&(s=i);let c={id:Q(),role:`user`,content:r,imageUrl:i,attachmentName:a},d=Q();l(e=>[...e,c,{id:d,role:`assistant`,content:``,pending:!0}]),Re(`send`),n.onMessage?.({role:`user`,content:s}),D(s,d)},[u,f,n,D]),k=(0,t.useCallback)(()=>a.current?.abort(),[]),A=(0,t.useCallback)((e,t)=>{u||f||!t||(E(e,{content:``,pending:!0,streaming:!1,error:!1}),Re(`send`),D(t,e))},[u,f,E,D]),ee=(0,t.useCallback)((t,n,r)=>{E(t,{feedback:n});let a=c.findIndex(e=>e.id===t),o=a>=0?c[a]?.content:void 0,s;for(let e=a-1;e>=0;e--)if(c[e]?.role===`user`){s=c[e]?.content;break}e.sendFeedback({sessionId:i.current,messageId:t,rating:n,comment:r,question:s,answer:o}).catch(()=>{})},[e,E,c]),te=(0,t.useCallback)(async(t,r,a={})=>{n.onAction?.(t);let o=await e.action(t,{sessionId:i.current,...r}),s={};return a.name?.trim()&&(s.name=a.name.trim()),a.email?.trim()&&(s.email=a.email.trim()),a.phone?.trim()&&(s.phone=a.phone.trim()),Object.keys(s).length>0&&(h(e=>{let t={...e,...s};return w(t),t}),s.email&&t!==`contact`&&e.action(`contact`,{sessionId:i.current,...s}).catch(()=>{})),Re(`receive`),o},[e,n,w]),j=(0,t.useCallback)(e=>{let t=e.trim();t&&l(e=>e.some(e=>e.role===`assistant`&&e.content===t)?e:[...e,{id:Q(),role:`assistant`,content:t}])},[]),ne=(0,t.useCallback)((t,n)=>{e.sendFeedback({sessionId:i.current,messageId:`__csat__`,rating:t,comment:n}).catch(()=>{})},[e]),M=(0,t.useCallback)((t,n)=>e.transcribe(t,n),[e]),N=(0,t.useCallback)((t,n,r)=>e.extract(t,n,r),[e]),P=(0,t.useCallback)(t=>e.searchGifs(t),[e]),F=(0,t.useCallback)((t,n)=>e.demoSlots(t,n),[e]),re=(0,t.useCallback)(e=>O(``,{imageUrl:e}),[O]),I=n.demo||!!n.gifApiKey,L=(0,t.useCallback)(()=>{a.current?.abort(),p(!0),e.endConversation(i.current).catch(()=>{})},[e]),ie=(0,t.useCallback)(()=>{a.current?.abort();let e=Q();i.current=e;try{r?.setItem($(n.token),e)}catch{}y(null),x([]),p(!1),l(o?[{id:Q(),role:`assistant`,content:o.greeting,availableActions:o.availableActions}]:[])},[r,n.token,o]),R=(0,t.useCallback)(e=>{if(e===i.current){y(null);return}x(Ye(r,n.token,e)),y(e)},[r,n.token]),z=(0,t.useCallback)(()=>{y(null),x([])},[]);return{persona:o,messages:c,sending:u,visitor:m,starters:n.starters.length>0?n.starters:o?.starterQuestions??[],hasEmail:!!m.email,send:O,sendGif:re,stop:k,retry:A,rateMessage:ee,injectAssistant:j,submitCsat:ne,submitForm:te,transcribe:M,extract:N,searchGifs:P,demoSlots:F,gifEnabled:I,identify:T,ended:f,endConversation:L,startNew:ie,history:g,viewingSessionId:v,viewMessages:b,openConversation:R,closeHistoryView:z,shutdown:C}},rt=e=>{let[n,r]=(0,t.useState)(`light`);return(0,t.useEffect)(()=>{if(e!==`auto`||typeof matchMedia>`u`)return;let t=matchMedia(`(prefers-color-scheme: dark)`),n=()=>r(t.matches?`dark`:`light`);return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]),e===`auto`?n:e},it=({transport:e,config:r,bindControls:i})=>{let a=r.strings,{persona:o,messages:s,sending:c,visitor:l,hasEmail:u,starters:d,send:f,sendGif:p,stop:m,retry:h,rateMessage:g,injectAssistant:_,submitCsat:v,submitForm:y,transcribe:b,extract:x,searchGifs:S,demoSlots:C,gifEnabled:w,identify:T,ended:E,endConversation:D,startNew:k,history:A,viewingSessionId:j,viewMessages:ne,openConversation:M,closeHistoryView:N,shutdown:P}=nt(e,r),[F,re]=(0,t.useState)(r.openByDefault),[I,R]=(0,t.useState)(0),[z,ae]=(0,t.useState)(()=>{try{return localStorage.getItem(`centrinfo:muted`)===`1`}catch{return!1}}),se=rt(r.theme);(0,t.useEffect)(()=>{Ie(r.sound&&!z)},[r.sound,z]);let pe=(0,t.useCallback)(()=>{ae(e=>{let t=!e;try{localStorage.setItem(`centrinfo:muted`,t?`1`:`0`)}catch{}return t})},[]),B=(0,t.useRef)(null),me=(0,t.useRef)(null),he=(0,t.useRef)(null),ge=(0,t.useRef)(0),[_e,ye]=(0,t.useState)(!0),[be,V]=(0,t.useState)(!1),[H,U]=(0,t.useState)(!1),xe=(0,t.useRef)(null),[Se,W]=(0,t.useState)(!1),[Ce,we]=(0,t.useState)(!1),G=!!j,K=G?ne:s,q=(0,t.useCallback)(()=>{re(!0),R(0),Re(`open`),r.onOpen?.(),r.onShow?.()},[r]),J=(0,t.useCallback)(()=>{re(!1),r.onClose?.(),r.onHide?.(),me.current?.focus()},[r]),Y=(0,t.useCallback)(()=>F?J():q(),[F,q,J]),Te=(0,t.useCallback)(()=>U(!0),[]),De=(0,t.useCallback)(()=>{D(),U(!1)},[D]),ke=(0,t.useCallback)(()=>{k(),V(!1),ye(!0)},[k]);(0,t.useEffect)(()=>{H&&xe.current?.focus()},[H]),(0,t.useEffect)(()=>{i({open:q,close:J,toggle:Y,identify:T,startNew:k,endConversation:D,shutdown:P})},[i,q,J,Y,T,k,D,P]),(0,t.useEffect)(()=>{let e=s.filter(e=>e.role===`assistant`&&!e.pending).length;if(F){ge.current=e;return}e>ge.current&&R(e-ge.current)},[s,F]),(0,t.useEffect)(()=>{r.onUnreadChange?.(I)},[I,r]),(0,t.useEffect)(()=>{let e=r.sessionDurationMinutes;if(!e||e<=0)return;let t=setTimeout(()=>P(),e*60*1e3);return()=>clearTimeout(t)},[r.sessionDurationMinutes,s,F,P]),(0,t.useEffect)(()=>{let e=r.customLauncherSelector;if(!e||typeof document>`u`)return;let t=[];try{t=Array.from(document.querySelectorAll(e))}catch{return}let n=e=>{e.preventDefault(),Y()};return t.forEach(e=>e.addEventListener(`click`,n)),()=>t.forEach(e=>e.removeEventListener(`click`,n))},[r.customLauncherSelector,Y]);let Ae=(0,t.useRef)(!1);(0,t.useEffect)(()=>{let e=r.proactiveMessage?.trim();if(!e||Ae.current)return;let t=r.proactiveOnPaths??[],n=typeof location<`u`?location.pathname:``;if(t.length>0&&!t.some(e=>n.includes(e)))return;let i=`centrinfo:proactive:${r.token.slice(0,12)}`;try{if(sessionStorage.getItem(i)===`1`)return}catch{}let a=setTimeout(()=>{if(!(F||E||s.some(e=>e.role===`user`))){Ae.current=!0;try{sessionStorage.setItem(i,`1`)}catch{}_(e),q()}},Math.max(0,r.proactiveDelaySeconds)*1e3);return()=>clearTimeout(a)},[r.proactiveMessage]),(0,t.useEffect)(()=>{let e=he.current;!F||!e||(s[s.length-1]?.role===`user`||_e?(e.scrollTop=e.scrollHeight,V(!1)):V(!0))},[s,F,c,_e]);let je=(0,t.useCallback)(()=>{let e=he.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<80;ye(t),t&&V(!1)},[]),Me=(0,t.useCallback)(()=>{let e=he.current;e&&(e.scrollTop=e.scrollHeight),V(!1),ye(!0)},[]),[Ne,Fe]=(0,t.useState)(``),X=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(X.current&&!c){let e=[...s].reverse().find(e=>e.role===`assistant`&&!e.streaming&&!e.pending&&e.content);e&&Fe(e.content)}X.current=c},[c,s]),(0,t.useEffect)(()=>{if(!F)return;let e=B.current;H||e?.querySelector(`.cf-textarea`)?.focus();let t=t=>{if(t.key===`Escape`){if(t.preventDefault(),H){U(!1);return}J();return}if(t.key!==`Tab`||!e)return;let n=e.querySelectorAll(`button, [href], textarea, input, [tabindex]:not([tabindex="-1"])`),r=Array.from(n).filter(e=>!e.hasAttribute(`disabled`));if(r.length===0)return;let i=r[0],a=r[r.length-1],o=e.getRootNode()instanceof ShadowRoot?e.getRootNode().activeElement:document.activeElement;t.shiftKey&&o===i?(t.preventDefault(),a.focus()):!t.shiftKey&&o===a&&(t.preventDefault(),i.focus())};return e?.addEventListener(`keydown`,t),()=>e?.removeEventListener(`keydown`,t)},[F,J,H]),(0,t.useEffect)(()=>{let e=B.current;e&&(F?e.removeAttribute(`inert`):e.setAttribute(`inert`,``))},[F]);let Le=r.accentColor??o?.accentColor,Z={zIndex:r.zIndex,"--cf-h-pad":`${r.horizontalPadding}px`,"--cf-v-pad":`${r.verticalPadding}px`,...Le?{"--cf-accent":Le,"--cf-accent-2":`color-mix(in oklab, ${Le} 76%, #14141f)`}:{}},Q=e=>f(e),ze=[...s].reverse().find(e=>e.role===`user`&&e.content.trim())?.content??``,$=s.some(e=>e.role===`user`),Be=!$&&!!(o?.agentDescription||o?.welcomeSubtitle);return(0,n.jsx)(O,{value:a,children:(0,n.jsxs)(`div`,{class:`cf-root`,"data-theme":se,"data-align":r.alignment,style:Z,children:[(0,n.jsxs)(`div`,{ref:B,class:`cf-panel ${F?`is-open`:``}`,role:`dialog`,"aria-modal":`false`,"aria-label":`Chat with ${o?.agentName??`us`}`,"aria-hidden":!F,children:[(0,n.jsxs)(`div`,{class:`cf-header`,children:[(0,n.jsx)(ve,{persona:o}),(0,n.jsxs)(`div`,{class:`cf-header__meta`,children:[(0,n.jsx)(`div`,{class:`cf-header__name`,children:o?.agentName??`Chat`}),(0,n.jsx)(`div`,{class:`cf-header__status ${o?.offline?`cf-header__status--offline`:``}`,children:(0,n.jsx)(`span`,{class:`cf-header__status-text`,children:o?.offline?a.statusOffline:a.statusOnline})})]}),(0,n.jsxs)(`div`,{class:`cf-header__actions`,children:[A.length>0&&(0,n.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":a.pastConversations,title:a.pastConversations,"aria-pressed":Se,onClick:()=>W(e=>!e),children:(0,n.jsx)(le,{})}),$&&!E&&!G&&(0,n.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":a.endChat,title:a.endChat,onClick:Te,children:(0,n.jsx)(ce,{})}),r.sound&&(0,n.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":z?a.unmuteSounds:a.muteSounds,"aria-pressed":z,onClick:pe,children:z?(0,n.jsx)(ie,{}):(0,n.jsx)(L,{})}),(0,n.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":a.closeChat,onClick:J,children:(0,n.jsx)(te,{})})]})]}),r.preview&&(0,n.jsx)(`div`,{class:`cf-preview-banner`,children:a.previewBanner}),G&&(0,n.jsx)(`div`,{class:`cf-viewing-banner`,children:a.viewingPast}),(0,n.jsxs)(`div`,{class:`cf-body`,ref:he,role:`log`,onScroll:je,children:[Be&&!G&&(0,n.jsxs)(`div`,{class:`cf-welcome`,children:[o?.agentDescription&&(0,n.jsx)(`p`,{class:`cf-welcome__desc`,children:o.agentDescription}),o?.welcomeSubtitle&&(0,n.jsx)(`p`,{class:`cf-welcome__sub`,children:o.welcomeSubtitle})]}),K.map((e,t)=>(0,n.jsx)(Oe,{msg:e,persona:o,isLast:!G&&t===K.length-1,visitor:l,hasEmail:u,lastQuestion:ze,showActions:!G&&t===K.length-1&&(!$||!!e.handoffOffered),onPickReply:Q,onSubmitForm:y,onDemoSlots:C,onRetry:h,ratable:!G&&K.slice(0,t).some(e=>e.role===`user`),onRate:g},e.id)),!$&&!G&&(0,n.jsx)(Ee,{items:d,onPick:f}),be&&(0,n.jsxs)(`button`,{type:`button`,class:`cf-newmsg`,onClick:Me,children:[(0,n.jsx)(fe,{}),a.newMessages]})]}),(0,n.jsx)(`div`,{class:`cf-sr-live`,"aria-live":`polite`,"aria-atomic":`true`,children:Ne}),c&&!E&&!G&&(0,n.jsx)(`div`,{class:`cf-stopbar`,children:(0,n.jsxs)(`button`,{type:`button`,class:`cf-stop`,onClick:m,children:[(0,n.jsx)(oe,{}),a.stop]})}),G?(0,n.jsx)(`div`,{class:`cf-ended`,children:(0,n.jsx)(`button`,{type:`button`,class:`cf-ended__btn`,onClick:N,children:a.backToChat})}):E?(0,n.jsxs)(`div`,{class:`cf-ended`,children:[(0,n.jsx)(`p`,{class:`cf-ended__text`,children:a.conversationEnded}),r.csat&&$?Ce?(0,n.jsx)(`p`,{class:`cf-ended__text`,children:a.feedbackThanks}):(0,n.jsxs)(`div`,{class:`cf-csat`,children:[(0,n.jsx)(`span`,{class:`cf-csat__q`,children:a.csatPrompt}),(0,n.jsx)(`button`,{type:`button`,class:`cf-csat__btn`,"aria-label":a.feedbackHelpful,onClick:()=>{v(`up`),we(!0)},children:(0,n.jsx)(ue,{})}),(0,n.jsx)(`button`,{type:`button`,class:`cf-csat__btn`,"aria-label":a.feedbackNotHelpful,onClick:()=>{v(`down`),we(!0)},children:(0,n.jsx)(de,{})})]}):null,(0,n.jsx)(`button`,{type:`button`,class:`cf-ended__btn`,onClick:ke,children:a.startNewChat})]}):(0,n.jsx)(Pe,{onSend:f,onSendGif:p,disabled:c,allowVoice:!!o?.allowVoiceInput,onTranscribe:b,gifEnabled:w,onSearchGifs:S,allowAttach:r.attachments,onExtract:x}),!E&&o?.disclaimerText&&(0,n.jsx)(`div`,{class:`cf-disclaimer`,children:o.disclaimerText}),(0,n.jsxs)(`div`,{class:`cf-footer`,children:[a.poweredBy,` `,(0,n.jsx)(`a`,{href:`https://accurix.tech/centrinfo`,target:`_blank`,rel:`noopener noreferrer`,children:`Centrinfo`})]}),H&&(0,n.jsx)(`div`,{class:`cf-confirm`,onClick:()=>U(!1),children:(0,n.jsxs)(`div`,{class:`cf-confirm__card`,role:`alertdialog`,"aria-modal":`true`,"aria-label":a.endChatConfirm,onClick:e=>e.stopPropagation(),children:[(0,n.jsx)(`div`,{class:`cf-confirm__title`,children:a.endChatConfirm}),(0,n.jsx)(`div`,{class:`cf-confirm__body`,children:a.endChatConfirmBody}),(0,n.jsxs)(`div`,{class:`cf-confirm__actions`,children:[(0,n.jsx)(`button`,{ref:xe,type:`button`,class:`cf-confirm__btn cf-confirm__btn--cancel`,onClick:()=>U(!1),children:a.cancel}),(0,n.jsx)(`button`,{type:`button`,class:`cf-confirm__btn cf-confirm__btn--danger`,onClick:De,children:a.endConfirmCta})]})]})}),Se&&(0,n.jsx)(`div`,{class:`cf-confirm`,onClick:()=>W(!1),children:(0,n.jsxs)(`div`,{class:`cf-history`,role:`dialog`,"aria-modal":`true`,"aria-label":a.pastConversations,onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)(`div`,{class:`cf-history__head`,children:[(0,n.jsx)(`span`,{children:a.pastConversations}),(0,n.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":a.closeChat,onClick:()=>W(!1),children:(0,n.jsx)(te,{})})]}),(0,n.jsx)(`div`,{class:`cf-history__list`,children:A.map(e=>(0,n.jsxs)(`button`,{type:`button`,class:`cf-history__item ${e.sessionId===j?`is-active`:``}`,onClick:()=>{M(e.sessionId),W(!1)},children:[(0,n.jsx)(`span`,{class:`cf-history__title`,children:e.title}),(0,n.jsxs)(`span`,{class:`cf-history__meta`,children:[new Date(e.ts).toLocaleDateString(void 0,{month:`short`,day:`numeric`}),e.ended?` ยท ${a.historyEnded}`:``]})]},e.sessionId))})]})})]}),!r.hideDefaultLauncher&&(0,n.jsxs)(`button`,{ref:me,type:`button`,class:`cf-launcher`,"aria-label":F?a.closeChat:a.openChat,"aria-expanded":F,onClick:Y,children:[r.launcherIcon?(0,n.jsx)(`img`,{class:`cf-launcher__img`,src:r.launcherIcon,alt:``}):(0,n.jsx)(ee,{}),!F&&I>0&&(0,n.jsx)(`span`,{class:`cf-launcher__badge`,children:I})]})]})})},at=`https://api.accurixtech.com`,ot=e=>{if(!e||typeof e.token!=`string`||e.token.length===0)throw Error("[centrinfo-widget] `token` is required โ€” pass your pub_* token to Centrinfo.init({ token }).");return{token:e.token,apiBaseUrl:(e.apiBaseUrl??`https://api.accurixtech.com`).replace(/\/$/,``),accentColor:e.accentColor,launcherIcon:e.launcherIcon,gifApiKey:e.gifApiKey,theme:e.theme??`auto`,openByDefault:e.openByDefault??!1,sound:e.sound??!0,starters:e.starters??[],strings:E(e.labels),persistence:e.persistence??`local`,attachments:e.attachments??!0,zIndex:e.zIndex??2147483e3,demo:e.demo??!1,preview:e.preview??!1,alignment:e.alignment===`left`?`left`:`right`,horizontalPadding:typeof e.horizontalPadding==`number`?e.horizontalPadding:20,verticalPadding:typeof e.verticalPadding==`number`?e.verticalPadding:20,hideDefaultLauncher:e.hideDefaultLauncher??!1,customLauncherSelector:e.customLauncherSelector,sessionDurationMinutes:typeof e.sessionDurationMinutes==`number`?e.sessionDurationMinutes:0,proactiveMessage:e.proactiveMessage,proactiveDelaySeconds:typeof e.proactiveDelaySeconds==`number`?e.proactiveDelaySeconds:5,proactiveOnPaths:e.proactiveOnPaths,csat:e.csat??!0,user:e.user,onOpen:e.onOpen,onClose:e.onClose,onShow:e.onShow,onHide:e.onHide,onUnreadChange:e.onUnreadChange,onMessage:e.onMessage,onAction:e.onAction,onHandoff:e.onHandoff}},st=`
1
+ const e=require(`./config-BfVMFkZ4.cjs`);let t=require(`preact`),n=require(`preact/hooks`),r=require(`preact/jsx-runtime`);const i=[`audio/webm;codecs=opus`,`audio/webm`,`audio/ogg;codecs=opus`,`audio/ogg`],a=e=>{let t=globalThis.MediaRecorder;if(typeof t?.isTypeSupported==`function`){for(let n of i)if(t.isTypeSupported(n))try{return new t(e,{mimeType:n})}catch{}}return new t(e)},o=e=>{if(!(!e||e.state!==`recording`)){try{e.requestData()}catch{}e.stop()}},s=[{name:`Smileys`,emojis:`๐Ÿ˜€.๐Ÿ˜ƒ.๐Ÿ˜„.๐Ÿ˜.๐Ÿ˜….๐Ÿ˜‚.๐Ÿคฃ.๐Ÿ˜Š.๐Ÿ˜‡.๐Ÿ™‚.๐Ÿ™ƒ.๐Ÿ˜‰.๐Ÿ˜Œ.๐Ÿ˜.๐Ÿฅฐ.๐Ÿ˜˜.๐Ÿ˜‹.๐Ÿ˜›.๐Ÿ˜œ.๐Ÿคช.๐Ÿค—.๐Ÿคญ.๐Ÿค”.๐Ÿค.๐Ÿ˜.๐Ÿ˜ถ.๐Ÿ˜.๐Ÿ™„.๐Ÿ˜ด.๐Ÿฅณ.๐Ÿ˜Ž.๐Ÿค“.๐Ÿฅบ.๐Ÿ˜ข.๐Ÿ˜ญ.๐Ÿ˜ค.๐Ÿ˜ .๐Ÿคฏ.๐Ÿ˜ฌ.๐Ÿ˜ฑ.๐Ÿคฉ.๐Ÿฅฑ`.split(`.`)},{name:`Gestures`,emojis:[`๐Ÿ‘`,`๐Ÿ‘Ž`,`๐Ÿ‘Œ`,`๐ŸคŒ`,`โœŒ๏ธ`,`๐Ÿคž`,`๐ŸคŸ`,`๐Ÿค˜`,`๐Ÿค™`,`๐Ÿ‘ˆ`,`๐Ÿ‘‰`,`๐Ÿ‘†`,`๐Ÿ‘‡`,`โœ‹`,`๐Ÿ–๏ธ`,`๐Ÿ‘‹`,`๐Ÿค`,`๐Ÿ™`,`๐Ÿ’ช`,`๐Ÿ‘`,`๐Ÿ™Œ`,`๐Ÿ‘`,`๐Ÿคฒ`,`๐Ÿซถ`]},{name:`Hearts & symbols`,emojis:`โค๏ธ.๐Ÿงก.๐Ÿ’›.๐Ÿ’š.๐Ÿ’™.๐Ÿ’œ.๐Ÿ–ค.๐Ÿค.๐Ÿ’”.โฃ๏ธ.๐Ÿ’•.๐Ÿ’–.๐Ÿ’˜.๐Ÿ’.โœจ.โญ.๐ŸŒŸ.๐Ÿ’ซ.๐Ÿ”ฅ.๐ŸŽ‰.๐ŸŽŠ.โœ….โŒ.โšก.๐Ÿ’ฏ.๐Ÿš€`.split(`.`)},{name:`Animals & nature`,emojis:[`๐Ÿถ`,`๐Ÿฑ`,`๐ŸฆŠ`,`๐Ÿป`,`๐Ÿผ`,`๐Ÿจ`,`๐Ÿฆ`,`๐Ÿฎ`,`๐Ÿธ`,`๐Ÿต`,`๐Ÿง`,`๐Ÿฆ„`,`๐Ÿ`,`๐Ÿฆ‹`,`๐Ÿข`,`๐Ÿฌ`,`๐ŸŒท`,`๐ŸŒธ`,`๐ŸŒน`,`๐ŸŒป`,`๐ŸŒณ`,`๐Ÿ€`]},{name:`Food & drink`,emojis:[`๐ŸŽ`,`๐ŸŒ`,`๐Ÿ‰`,`๐Ÿ“`,`๐Ÿ’`,`๐Ÿฅ‘`,`๐Ÿ”`,`๐ŸŸ`,`๐Ÿ•`,`๐ŸŒฎ`,`๐Ÿฟ`,`๐Ÿฉ`,`๐Ÿช`,`๐ŸŽ‚`,`โ˜•`,`๐Ÿต`,`๐Ÿบ`,`๐Ÿฅ‚`,`๐Ÿท`]},{name:`Objects & travel`,emojis:`๐Ÿš€.โœˆ๏ธ.๐Ÿš—.๐Ÿ .๐Ÿ“ฆ.๐Ÿ“ฑ.๐Ÿ’ป.โŒš.๐Ÿ“ท.๐Ÿ’ก.๐Ÿ”‘.๐ŸŽ.๐Ÿ“Œ.โœ๏ธ.๐Ÿ“.๐Ÿ“ž.๐Ÿ“ง.๐Ÿ’ฐ.๐Ÿ“ˆ.โฐ.๐Ÿ””.๐ŸŽฏ.๐Ÿ†.๐ŸŽฎ.๐ŸŽต.๐Ÿ’ฌ.๐Ÿ‘€`.split(`.`)}],c={inquiry:{title:`Leave a message`,submit:`Send message`,fields:[{key:`visitorName`,label:`Full name`,kind:`text`,required:!0,identity:`name`},{key:`visitorEmail`,label:`Email`,kind:`email`,required:!0,identity:`email`},{key:`message`,label:`Message`,kind:`textarea`,required:!0,placeholder:`How can we help?`}]},contact:{title:`Share your details`,submit:`Save`,fields:[{key:`name`,label:`Full name`,kind:`text`,required:!0,identity:`name`},{key:`email`,label:`Email`,kind:`email`,required:!0,identity:`email`},{key:`phone`,label:`Phone`,kind:`tel`,required:!0,identity:`phone`}]},"book-demo":{title:`Book a demo`,submit:`Request demo`,fields:[{key:`visitorName`,label:`Full name`,kind:`text`,required:!0,identity:`name`},{key:`visitorEmail`,label:`Email`,kind:`email`,required:!0,identity:`email`},{key:`preferredAt`,label:`Preferred time`,kind:`text`,placeholder:`e.g. Thursday 3pm`},{key:`notes`,label:`Notes`,kind:`textarea`,placeholder:`Anything we should know?`}]},"request-callback":{title:`Request a callback`,submit:`Request callback`,fields:[{key:`visitorName`,label:`Full name`,kind:`text`,required:!0,identity:`name`},{key:`visitorPhone`,label:`Phone`,kind:`tel`,required:!0,identity:`phone`},{key:`bestTime`,label:`Best time to call`,kind:`text`,placeholder:`e.g. tomorrow afternoon`},{key:`topic`,label:`Topic`,kind:`text`,placeholder:`What should we call about?`}]},"subscribe-newsletter":{title:`Subscribe`,submit:`Subscribe`,fields:[{key:`visitorName`,label:`Full name`,kind:`text`,required:!0,identity:`name`},{key:`visitorEmail`,label:`Email`,kind:`email`,required:!0,identity:`email`}]}},l=(e,t)=>(0,r.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,...t,children:e}),u=e=>(0,r.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,r.jsx)(`path`,{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M5 3.25h14A3.75 3.75 0 0 1 22.75 7v6A3.75 3.75 0 0 1 19 16.75h-7.19l-4.26 3.84A.75.75 0 0 1 6.25 20v-3.32A3.75 3.75 0 0 1 2.25 13V7A3.75 3.75 0 0 1 6 3.25Zm3 7.75a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z`})}),d=e=>l((0,r.jsx)(`path`,{d:`m6 9 6 6 6-6`}),e),f=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),(0,r.jsx)(`path`,{d:`M22 2 11 13`})]}),e),p=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`}),(0,r.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`}),(0,r.jsx)(`line`,{x1:`12`,y1:`19`,x2:`12`,y2:`22`})]}),e),m=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M9 9v1a3 3 0 0 0 4.24 2.73`}),(0,r.jsx)(`path`,{d:`M15 5.5V5a3 3 0 0 0-5.94-.6`}),(0,r.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-9.9 6.36`}),(0,r.jsx)(`path`,{d:`M5 10v2a6.98 6.98 0 0 0 1.11 3.79`}),(0,r.jsx)(`line`,{x1:`12`,y1:`19`,x2:`12`,y2:`22`}),(0,r.jsx)(`line`,{x1:`2`,y1:`2`,x2:`22`,y2:`22`})]}),e),h=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M15 3h6v6`}),(0,r.jsx)(`path`,{d:`M10 14 21 3`}),(0,r.jsx)(`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`})]}),e),g=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`18`,rx:`2`}),(0,r.jsx)(`line`,{x1:`16`,y1:`2`,x2:`16`,y2:`6`}),(0,r.jsx)(`line`,{x1:`8`,y1:`2`,x2:`8`,y2:`6`}),(0,r.jsx)(`line`,{x1:`3`,y1:`10`,x2:`21`,y2:`10`})]}),e),_=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}),(0,r.jsx)(`path`,{d:`m22 7-10 5L2 7`})]}),e),v=e=>l((0,r.jsx)(`path`,{d:`M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92Z`}),e),y=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,r.jsx)(`path`,{d:`M8.5 14.5a4 4 0 0 0 7 0`}),(0,r.jsx)(`line`,{x1:`9`,y1:`9.5`,x2:`9.01`,y2:`9.5`}),(0,r.jsx)(`line`,{x1:`15`,y1:`9.5`,x2:`15.01`,y2:`9.5`})]}),e),b=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,r.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]}),e),x=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M11 5 6 9H2v6h4l5 4z`}),(0,r.jsx)(`path`,{d:`M15.5 8.5a5 5 0 0 1 0 7`}),(0,r.jsx)(`path`,{d:`M19 5a9 9 0 0 1 0 14`})]}),e),S=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M11 5 6 9H2v6h4l5 4z`}),(0,r.jsx)(`line`,{x1:`22`,y1:`9`,x2:`16`,y2:`15`}),(0,r.jsx)(`line`,{x1:`16`,y1:`9`,x2:`22`,y2:`15`})]}),e),C=e=>l((0,r.jsx)(`path`,{d:`M20 6 9 17l-5-5`}),e),w=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`}),(0,r.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),e),ee=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M1 4v6h6`}),(0,r.jsx)(`path`,{d:`M3.51 15a9 9 0 1 0 2.13-9.36L1 10`})]}),e),T=e=>l((0,r.jsx)(`rect`,{x:`6`,y:`6`,width:`12`,height:`12`,rx:`2`}),e),E=e=>l((0,r.jsx)(`path`,{d:`M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48`}),e),D=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M18.36 6.64a9 9 0 1 1-12.73 0`}),(0,r.jsx)(`line`,{x1:`12`,y1:`2`,x2:`12`,y2:`12`})]}),e),te=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,r.jsx)(`path`,{d:`M12 7v5l3 2`})]}),e),ne=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M7 10v12`}),(0,r.jsx)(`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`})]}),e),O=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M17 14V2`}),(0,r.jsx)(`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`})]}),e),k=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M15 3h6v6`}),(0,r.jsx)(`path`,{d:`M9 21H3v-6`}),(0,r.jsx)(`path`,{d:`M21 3l-7 7`}),(0,r.jsx)(`path`,{d:`M3 21l7-7`})]}),e),A=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`path`,{d:`M9 3v6H3`}),(0,r.jsx)(`path`,{d:`M15 21v-6h6`}),(0,r.jsx)(`path`,{d:`M9 9 2 2`}),(0,r.jsx)(`path`,{d:`M15 15l7 7`})]}),e),j=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`14`,rx:`2`}),(0,r.jsx)(`rect`,{x:`11`,y:`11`,width:`8`,height:`6`,rx:`1`,fill:`currentColor`,stroke:`none`})]}),e),re=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`rect`,{x:`4`,y:`5`,width:`16`,height:`14`,rx:`2`}),(0,r.jsx)(`path`,{d:`M12 15V9`}),(0,r.jsx)(`path`,{d:`m8.5 12.5 3.5-3.5 3.5 3.5`})]}),e),ie=e=>l((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,r.jsx)(`path`,{d:`m19 12-7 7-7-7`})]}),e),ae=e=>{if(!e)return`Live data`;let t=new Date(e);return Number.isNaN(t.getTime())?`Live data`:`Updated ${new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t)}`},M=({answeredAt:e,reportingPeriod:t,filters:n=[],rowCount:i})=>(0,r.jsxs)(`div`,{class:`cf-analytics-meta`,"data-testid":`analytics-result-meta`,"aria-label":`Result details`,children:[(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{"aria-hidden":`true`,class:`cf-analytics-meta__dot`}),ae(e)]}),t?.label?(0,r.jsx)(`span`,{children:t.label}):null,typeof i==`number`?(0,r.jsxs)(`span`,{children:[i,` `,i===1?`row`:`rows`]}):null,n.length>0?(0,r.jsxs)(`span`,{children:[n.length,` applied `,n.length===1?`filter`:`filters`]}):null]}),oe=({label:e,value:t,detail:n})=>(0,r.jsxs)(`section`,{class:`cf-analytics-kpi`,"aria-label":e,"data-testid":`analytics-kpi`,children:[(0,r.jsx)(`div`,{class:`cf-analytics-kpi__label`,children:e}),(0,r.jsx)(`div`,{class:`cf-analytics-kpi__value`,children:t}),n?(0,r.jsx)(`div`,{class:`cf-analytics-kpi__detail`,children:n}):null]}),N=({title:e=`No matching data`,description:t=`No approved records matched this question.`})=>(0,r.jsxs)(`section`,{class:`cf-analytics-empty`,role:`status`,"data-testid":`analytics-empty-state`,children:[(0,r.jsx)(`p`,{children:e}),(0,r.jsx)(`p`,{children:t})]}),P=({explanation:e,onFollowUp:t,showLead:n=!1,maxFollowUps:i=3})=>(0,r.jsxs)(`section`,{class:`cf-analytics-explanation`,"data-testid":`inline-analytics-explanation`,"aria-label":`Analysis and supporting evidence`,children:[n?(0,r.jsxs)(`div`,{class:`cf-analytics-explanation__lead`,"data-testid":`analytics-explanation-lead`,children:[(0,r.jsxs)(`div`,{class:`cf-analytics-explanation__lead-meta`,children:[(0,r.jsx)(`span`,{class:`cf-analytics-explanation__eyebrow`,children:`Answer from your data`}),(0,r.jsxs)(`span`,{class:`cf-analytics-explanation__provenance`,children:[(0,r.jsx)(`span`,{"aria-hidden":`true`,class:`cf-analytics-explanation__provenance-dot`}),e.source===`ai_grounded`?`AI-assisted ยท evidence checked`:`Based on current values`]})]}),(0,r.jsx)(`h3`,{class:`cf-analytics-explanation__headline`,children:e.headline}),(0,r.jsx)(`p`,{class:`cf-analytics-explanation__summary`,children:e.summary})]}):null,(0,r.jsxs)(`div`,{class:`cf-analytics-explanation__body`,children:[(e.evidence?.length??0)>0?(0,r.jsxs)(`section`,{class:`cf-analytics-explanation__section`,children:[(0,r.jsx)(`h4`,{class:`cf-analytics-explanation__heading`,children:`What the numbers show`}),(0,r.jsx)(`ul`,{class:`cf-analytics-explanation__evidence`,children:e.evidence?.slice(0,4).map(e=>(0,r.jsxs)(`li`,{class:`cf-analytics-explanation__evidence-item`,children:[(0,r.jsx)(`span`,{"aria-hidden":`true`,class:`cf-analytics-explanation__evidence-bullet`}),(0,r.jsx)(`span`,{children:e})]},e))})]}):null,e.businessMeaning?(0,r.jsxs)(`section`,{class:`cf-analytics-explanation__meaning`,children:[(0,r.jsx)(`h4`,{class:`cf-analytics-explanation__heading`,children:`Why this may matter`}),(0,r.jsx)(`p`,{class:`cf-analytics-explanation__paragraph`,children:e.businessMeaning})]}):null,(e.possibleDrivers?.length??0)>0?(0,r.jsxs)(`section`,{class:`cf-analytics-explanation__section`,children:[(0,r.jsxs)(`div`,{class:`cf-analytics-explanation__section-heading`,children:[(0,r.jsx)(`h4`,{class:`cf-analytics-explanation__heading`,children:`Possibilities worth checking`}),(0,r.jsx)(`span`,{class:`cf-analytics-explanation__hint`,children:`These are not proven causes`})]}),(0,r.jsx)(`div`,{class:`cf-analytics-explanation__drivers`,children:e.possibleDrivers?.slice(0,2).map(e=>(0,r.jsxs)(`article`,{class:`cf-analytics-explanation__driver`,children:[(0,r.jsx)(`p`,{class:`cf-analytics-explanation__driver-title`,children:e.hypothesis}),(0,r.jsxs)(`p`,{class:`cf-analytics-explanation__driver-body`,children:[(0,r.jsx)(`span`,{class:`cf-analytics-explanation__driver-label`,children:`How to check:`}),` `,e.howToCheck]})]},`${e.hypothesis}-${e.howToCheck}`))})]}):null,(e.recommendations?.length??0)>0?(0,r.jsxs)(`section`,{class:`cf-analytics-explanation__section`,children:[(0,r.jsx)(`h4`,{class:`cf-analytics-explanation__heading`,children:`Useful next steps`}),(0,r.jsx)(`div`,{class:`cf-analytics-explanation__recommendations`,children:e.recommendations?.slice(0,3).map((e,t)=>(0,r.jsxs)(`article`,{class:`cf-analytics-explanation__recommendation`,children:[(0,r.jsx)(`span`,{class:`cf-analytics-explanation__recommendation-index`,children:t+1}),(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`p`,{class:`cf-analytics-explanation__recommendation-title`,children:e.action}),(0,r.jsx)(`p`,{class:`cf-analytics-explanation__recommendation-body`,children:e.why}),e.successMetric?(0,r.jsxs)(`p`,{class:`cf-analytics-explanation__recommendation-body`,children:[(0,r.jsx)(`span`,{class:`cf-analytics-explanation__driver-label`,children:`Watch:`}),` `,e.successMetric]}):null]})]},`${e.action}-${e.why}`))})]}):null,e.forecast?(0,r.jsxs)(`section`,{class:`cf-analytics-explanation__outlook`,children:[(0,r.jsxs)(`div`,{class:`cf-analytics-explanation__outlook-header`,children:[(0,r.jsx)(`h4`,{class:`cf-analytics-explanation__heading`,children:`Outlook`}),(0,r.jsx)(`span`,{class:`cf-analytics-explanation__outlook-badge`,children:`Validated estimate`})]}),(0,r.jsx)(`p`,{class:`cf-analytics-explanation__paragraph`,children:e.forecast.text}),e.forecast.limitations?(0,r.jsx)(`p`,{class:`cf-analytics-explanation__recommendation-body`,children:e.forecast.limitations}):null]}):null,t&&(e.followUps?.length??0)>0?(0,r.jsxs)(`section`,{class:`cf-analytics-explanation__section cf-analytics-explanation__follow-up`,children:[(0,r.jsx)(`h4`,{class:`cf-analytics-explanation__heading`,children:`Ask a follow-up`}),(0,r.jsx)(`div`,{class:`cf-analytics-explanation__questions`,children:e.followUps?.slice(0,i).map(e=>(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-explanation__question`,onClick:()=>t(e),children:e},e))})]}):null,(e.limitations?.length??0)>0?(0,r.jsxs)(`details`,{class:`cf-analytics-explanation__limits`,children:[(0,r.jsx)(`summary`,{class:`cf-analytics-explanation__limits-summary`,children:`Important limits`}),(0,r.jsx)(`ul`,{class:`cf-analytics-explanation__limits-list`,children:e.limitations?.map(e=>(0,r.jsx)(`li`,{children:e},e))})]}):null]}),(0,r.jsx)(`p`,{class:`cf-analytics-explanation__source`,children:e.source===`ai_grounded`?`AI-assisted wording, checked against the live values shown here.`:`Based only on the live values shown here.`})]}),se=()=>{let e=(0,n.useRef)(null);return(0,n.useEffect)(()=>{let t=requestAnimationFrame(()=>e.current?.scrollIntoView({block:`end`}));return()=>cancelAnimationFrame(t)},[]),e},ce=e=>e.trim().split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()??``).join(``)||`๐Ÿค–`,F=e=>{let t=e?.avatarId?.trim().toLowerCase().replace(/[^a-z0-9-]/g,`-`);return t?` cf-avatar-preset--${t}`:``},le={"support-guide":`SG`,"sales-host":`SH`,"calm-advisor":`CA`,"technical-guide":`TG`,"school-desk":`SD`,"front-office":`FO`},I=e=>{let t=e?.avatarId?.trim().toLowerCase();return t&&le[t]||(e?ce(e.agentName):`ยท`)},ue=({persona:e,small:t,hideWhenMissing:n})=>{let i=t?`cf-msg__avatar`:`cf-header__avatar`,a=e?.agentAvatarUrl?.trim();return a?(0,r.jsx)(`span`,{class:i,children:(0,r.jsx)(`img`,{src:a,alt:``})}):n?null:(0,r.jsx)(`span`,{class:`${i}${F(e)}`,children:I(e)})},L=()=>{let t=e.c(),[i,a]=(0,n.useState)(0),o=[`Thinking`,`Checking available information`,`Preparing your response`];return(0,n.useEffect)(()=>{let e=[window.setTimeout(()=>a(1),1800),window.setTimeout(()=>a(2),5e3)];return()=>e.forEach(e=>window.clearTimeout(e))},[]),(0,r.jsxs)(`div`,{class:`cf-msg__bubble cf-typing`,"aria-label":t.assistantTyping,children:[(0,r.jsx)(`span`,{class:`cf-typing__label`,"aria-live":`polite`,children:o[i]}),(0,r.jsx)(`span`,{class:`cf-typing__dot`}),(0,r.jsx)(`span`,{class:`cf-typing__dot`}),(0,r.jsx)(`span`,{class:`cf-typing__dot`})]})},de=3,fe=({msg:e})=>{if(!e.sources||e.sources.length===0)return null;let t=new Set,n=[];for(let r of e.sources){let e=(r.url||r.title||``).toLowerCase();!e||t.has(e)||(t.add(e),n.push(r))}if(n.length===0)return null;let i=n.slice(0,3),a=n.length-i.length;return(0,r.jsxs)(`div`,{class:`cf-sources`,children:[i.map((e,t)=>e.url?(0,r.jsxs)(`a`,{class:`cf-source`,href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,title:e.title||e.url,children:[(0,r.jsx)(h,{}),(0,r.jsx)(`span`,{children:e.title||e.url})]},t):(0,r.jsxs)(`span`,{class:`cf-source`,title:e.title,children:[(0,r.jsx)(h,{}),(0,r.jsx)(`span`,{children:e.title})]},t)),a>0&&(0,r.jsxs)(`span`,{class:`cf-source cf-source--more`,children:[`+`,a,` more`]})]})},R=({replies:e,onPick:t})=>e&&e.length>0?(0,r.jsx)(`div`,{class:`cf-chips`,children:e.map((e,n)=>(0,r.jsx)(`button`,{type:`button`,class:`cf-chip`,onClick:()=>t(e),children:e},n))}):null,pe=({persona:e,starters:t,onPick:n,onFocusComposer:i,speaking:a,voiceState:o=`idle`,replyPending:s=!1,pinned:c=!1,muted:l=!1,onToggleMute:u,onEndCall:d,onTalkNow:f,showTalkNow:m=!1,micLevel:h=0,theaterMode:g=!1,onToggleTheater:_,onMinimize:v,audioDevices:y=[],selectedAudioDeviceId:b=``,onSelectAudioDevice:x,connectingOnly:S=!1})=>{if(!e||!(e.talkbackMode===`avatar`||e.widgetModule===`assistant`||e.allowVoiceInput))return null;let C=e.agentAvatarUrl?.trim()||``,w=e.assistantMediaUrl?.trim()||C,ee=e.assistantMediaKind===`video`&&!!w,T=t.slice(0,3),E=o!==`idle`,D=o===`idle`?`Speak with ${e.agentName}`:`End voice chat`,te=c&&!E&&!a,ne=o===`connecting`||o===`processing`||E&&s,O=[`cf-assistant-card__stage`,`cf-assistant-card__stage--local`,E?`is-live`:``,ne?`is-thinking`:``,o===`listening`&&!l?`is-listening`:``,a||o===`speaking`?`is-speaking`:``,l?`is-muted`:``].filter(Boolean).join(` `),k=o===`listening`&&!l?{"--cf-listen":String(Math.max(.18,Math.min(1,h*8)))}:void 0,A=ne&&(0,r.jsxs)(`span`,{class:`cf-call-ripple`,"aria-hidden":`true`,children:[(0,r.jsx)(`span`,{}),(0,r.jsx)(`span`,{}),(0,r.jsx)(`span`,{})]});if(S)return(0,r.jsxs)(`div`,{class:`cf-assistant-card cf-assistant-card--connecting`,"aria-live":`polite`,children:[(0,r.jsxs)(`div`,{class:`cf-assistant-card__connecting-avatar`,children:[C?(0,r.jsx)(`img`,{src:C,alt:``}):(0,r.jsx)(`span`,{class:`cf-assistant-card__connecting-face${F(e)}`,children:I(e)}),A]}),(0,r.jsxs)(`div`,{class:`cf-assistant-card__connecting-copy`,children:[(0,r.jsx)(`span`,{class:`cf-assistant-card__connecting-eyebrow`,children:e.agentName}),(0,r.jsx)(`strong`,{children:`Connecting with the AIโ€ฆ`})]})]});let j=E&&d&&(0,r.jsx)(ze,{voiceState:o,muted:l,onToggleMute:u??(()=>{}),onEndCall:d,onTalkNow:f??(()=>{}),showTalkNow:m,micLevel:h,theaterMode:g,onToggleTheater:_??(()=>{}),onMinimize:v??(()=>{}),audioDevices:y,selectedAudioDeviceId:b,onSelectAudioDevice:x??(()=>{})});return te?(0,r.jsx)(`div`,{class:`cf-assistant-card cf-assistant-card--pinned cf-assistant-card--compact`,children:(0,r.jsxs)(`button`,{type:`button`,class:`cf-assistant-card__compact-speak`,onClick:i,children:[C?(0,r.jsx)(`span`,{class:`cf-assistant-card__compact-avatar`,children:(0,r.jsx)(`img`,{src:C,alt:``})}):null,(0,r.jsx)(`span`,{class:`cf-assistant-card__compact-mic`,"aria-hidden":`true`,children:(0,r.jsx)(p,{})}),(0,r.jsx)(`span`,{class:`cf-assistant-card__compact-label`,children:D})]})}):(0,r.jsxs)(`div`,{class:`cf-assistant-card ${c?`cf-assistant-card--pinned`:``} ${a?`is-speaking`:``}`,children:[(w||e.allowVoiceInput)&&(0,r.jsxs)(`div`,{class:O,style:k,children:[(0,r.jsxs)(`div`,{class:`cf-assistant-card__media ${w?`cf-assistant-card__media--uploaded`:`cf-assistant-card__media--generated`}${F(e)}`,children:[ee?(0,r.jsx)(`video`,{src:w,muted:!0,loop:!0,playsInline:!0,autoPlay:!0}):w?(0,r.jsx)(`img`,{src:w,alt:``}):(0,r.jsx)(`div`,{class:`cf-assistant-card__avatar-stage${F(e)}`,children:(0,r.jsxs)(`div`,{class:`cf-assistant-card__face`,children:[(0,r.jsx)(`span`,{class:`cf-assistant-card__initials`,children:I(e)}),(0,r.jsx)(`span`,{class:`cf-assistant-card__eye cf-assistant-card__eye--left`}),(0,r.jsx)(`span`,{class:`cf-assistant-card__eye cf-assistant-card__eye--right`}),(0,r.jsx)(`span`,{class:`cf-assistant-card__mouth`})]})}),w&&!ee&&(0,r.jsx)(`span`,{class:`cf-assistant-card__mouth cf-assistant-card__mouth--overlay`}),(0,r.jsx)(`span`,{class:`cf-avatar-aura cf-avatar-aura--one`,"aria-hidden":`true`}),(0,r.jsx)(`span`,{class:`cf-avatar-aura cf-avatar-aura--two`,"aria-hidden":`true`}),(0,r.jsx)(`span`,{class:`cf-avatar-listen-ring`,"aria-hidden":`true`}),(0,r.jsxs)(`span`,{class:`cf-avatar-wave`,"aria-hidden":`true`,children:[(0,r.jsx)(`span`,{}),(0,r.jsx)(`span`,{}),(0,r.jsx)(`span`,{}),(0,r.jsx)(`span`,{})]})]}),A,e.allowVoiceInput&&(j||(0,r.jsxs)(`button`,{type:`button`,class:`cf-assistant-card__speak`,onClick:i,children:[(0,r.jsx)(p,{}),D]}))]}),!c&&(0,r.jsxs)(r.Fragment,{children:[e.agentDescription?(0,r.jsx)(`p`,{class:`cf-assistant-card__copy`,children:e.agentDescription}):(0,r.jsx)(`p`,{class:`cf-assistant-card__copy`,children:e.greeting}),T.length>0&&(0,r.jsx)(`div`,{class:`cf-assistant-card__chips`,children:T.map(e=>(0,r.jsx)(`button`,{type:`button`,class:`cf-assistant-card__chip`,onClick:()=>n(e),children:e},e))}),e.disclaimerText||e.assistantPrivacyUrl?(0,r.jsxs)(`p`,{class:`cf-assistant-card__privacy`,children:[e.disclaimerText||`This chat may be recorded for quality and support.`,e.assistantPrivacyUrl?(0,r.jsxs)(r.Fragment,{children:[` `,(0,r.jsx)(`a`,{href:e.assistantPrivacyUrl,target:`_blank`,rel:`noopener noreferrer nofollow`,children:`Privacy Policy`})]}):null]}):null]})]})},me={public_book_demo:{type:`book-demo`,label:`Book a demo`,description:`Pick a time or request a demo from the team.`,Icon:g},public_submit_inquiry:{type:`inquiry`,label:`Leave a message`,description:`Send your question and contact details.`,Icon:_},public_request_callback:{type:`request-callback`,label:`Request a callback`,description:`Share your phone number and best time to call.`,Icon:v},public_subscribe_newsletter:{type:`subscribe-newsletter`,label:`Subscribe`,description:`Get product updates and useful announcements.`,Icon:_}},he=({field:e,value:t,onInput:n})=>{let i=e.placeholder??e.label,a={class:`cf-form__input`,placeholder:e.required?`${i} *`:i,value:t,"aria-label":e.label,onInput:e=>n(e.target.value)};return e.kind===`textarea`?(0,r.jsx)(`textarea`,{rows:2,...a}):(0,r.jsx)(`input`,{type:e.kind,...a})},ge=({spec:t,visitor:i,onSubmit:a,onCancel:o})=>{let s=e.c(),c=se(),[l,u]=(0,n.useState)(()=>{let e={};for(let n of t.fields)n.identity&&i[n.identity]&&(e[n.key]=i[n.identity]);return e}),[d,f]=(0,n.useState)(`idle`),[p,m]=(0,n.useState)(``),h=e=>!!(e.identity&&i[e.identity]?.trim()),g=t.fields.filter(e=>!h(e)),_=g.every(e=>!e.required||(l[e.key]?.trim()??``)!==``),v=i.email||i.name||``;return d===`done`?(0,r.jsxs)(`div`,{class:`cf-form cf-form--done`,children:[(0,r.jsx)(C,{}),(0,r.jsx)(`span`,{children:p})]}):(0,r.jsxs)(`div`,{class:`cf-form`,ref:c,children:[(0,r.jsx)(`div`,{class:`cf-form__title`,children:t.title}),g.length===0&&v&&(0,r.jsxs)(`div`,{class:`cf-form__as`,children:[`as `,v]}),g.map(e=>(0,r.jsx)(he,{field:e,value:l[e.key]??``,onInput:t=>u(n=>({...n,[e.key]:t}))},e.key)),d===`error`&&(0,r.jsx)(`div`,{class:`cf-form__err`,children:s.formError}),(0,r.jsxs)(`div`,{class:`cf-form__actions`,children:[o&&(0,r.jsx)(`button`,{type:`button`,class:`cf-form__cancel`,onClick:o,children:`Cancel`}),(0,r.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:!_||d===`submitting`,onClick:async()=>{if(!_||d===`submitting`)return;f(`submitting`);let e={},n={};for(let r of t.fields){let t=l[r.key]?.trim();t&&(e[r.key]=t,r.identity&&(n[r.identity]=t))}try{m((await a(e,n)).note||s.formThanks),f(`done`)}catch{f(`error`)}},children:d===`submitting`?s.sending:t.submit})]})]})},_e=e=>String(e).padStart(2,`0`),ve=()=>{let e=[];for(let t=9;t<=17;t++)e.push(`${_e(t)}:00`),e.push(`${_e(t)}:30`);return e},ye=e=>{let t=new Date;return t.setHours(0,0,0,0),Array.from({length:e},(e,n)=>{let r=new Date(t);return r.setDate(t.getDate()+n),r})},be=(e,t)=>{let[n,r]=t.split(`:`).map(Number),i=new Date(e.getFullYear(),e.getMonth(),e.getDate(),n??0,r??0);try{return new Intl.DateTimeFormat(void 0,{weekday:`short`,day:`numeric`,month:`short`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,timeZoneName:`short`}).format(i)}catch{return`${e.toDateString()} ${t}`}},xe=(e,t)=>{let[n,r]=t.split(`:`).map(Number);return new Date(e.getFullYear(),e.getMonth(),e.getDate(),n??0,r??0)},Se=({visitor:t,onSubmit:i,onCancel:a,onDemoSlots:o,scheduler:s})=>{let l=e.c(),u=se(),d=(0,n.useMemo)(()=>ye(14),[]),f=(0,n.useMemo)(()=>ve(),[]),[p,m]=(0,n.useState)((0,n.useMemo)(()=>{let e=Date.now();for(let t=0;t<d.length;t++)if(f.some(n=>xe(d[t],n).getTime()>e))return t;return 0},[d,f])),[g,_]=(0,n.useState)(null),[v,y]=(0,n.useState)(t.name??``),[b,x]=(0,n.useState)(t.email??``),[S,w]=(0,n.useState)(`idle`),[ee,T]=(0,n.useState)(``),[E,D]=(0,n.useState)(``),[te,ne]=(0,n.useState)(``),O=s?.connected&&s.mode===`link`,k=async()=>{if(S===`submitting`||!t.name?.trim()&&!v.trim()||!t.email?.trim()&&!b.trim())return;w(`submitting`),D(``);let e={};b.trim()&&(e.email=b.trim()),v.trim()&&(e.name=v.trim());try{let t=await i({...b.trim()?{visitorEmail:b.trim()}:{},...v.trim()?{visitorName:v.trim()}:{}},e),n=t.booking?.schedulingLink||s?.bookingLink||``;if(!n){w(`error`);return}try{window.open(n,`_blank`,`noopener,noreferrer`)}catch{}ne(n),T(t.note||l.bookingLinkOpened),w(`done`)}catch{w(`error`)}},[A,j]=(0,n.useState)(new Set),[re,ie]=(0,n.useState)([]),[ae,M]=(0,n.useState)(0),[oe,N]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!o)return;let e=!0,t=new Date,n=new Date;return n.setDate(n.getDate()+15),o(t.toISOString(),n.toISOString()).then(t=>{e&&(j(new Set(t.taken.map(e=>Date.parse(e)).filter(e=>!Number.isNaN(e)))),ie(t.busy.map(e=>[Date.parse(e.start),Date.parse(e.end)]).filter(([e,t])=>!Number.isNaN(e)&&!Number.isNaN(t))))}).catch(()=>{}),()=>{e=!1}},[o,ae]);let P=!!t.email?.trim(),ce=!!t.name?.trim(),F=!!g&&(ce||v.trim()!==``)&&(P||b.trim()!==``),le=t.email||t.name||``,I=e=>A.has(xe(d[p],e).getTime()),ue=e=>xe(d[p],e).getTime()<=Date.now(),L=e=>{let t=xe(d[p],e).getTime(),n=t+18e5;return re.some(([e,r])=>t<r&&n>e)},de=async()=>{if(!F||S===`submitting`||!g)return;w(`submitting`),N(!1),D(``);let t=xe(d[p],g),n=be(d[p],g),r={};b.trim()&&(r.email=b.trim()),v.trim()&&(r.name=v.trim());try{let a=await i({preferredAt:n,slotAt:t.toISOString(),...b.trim()?{visitorEmail:b.trim()}:{},...v.trim()?{visitorName:v.trim()}:{}},r);a.booking?.confirmed?(T(a.note||e.s(l.bookingConfirmed,{when:n})),ne(a.booking.meetingUrl||a.booking.eventLink||``)):T(a.note||e.s(l.bookingRequested,{when:n})),w(`done`)}catch(e){if(e?.status===409)j(e=>new Set(e).add(t.getTime())),_(null),N(!0),M(e=>e+1),w(`idle`);else{let t=e?.message;D(t&&t.length<120?t:``),w(`error`)}}};return S===`done`?(0,r.jsxs)(`div`,{class:`cf-form cf-form--done`,children:[(0,r.jsx)(C,{}),(0,r.jsx)(`span`,{children:ee}),te&&(0,r.jsxs)(`a`,{class:`cf-booking__link`,href:te,target:`_blank`,rel:`noopener noreferrer`,children:[O?l.bookingOpenScheduler:l.bookingMeetingLink,` `,(0,r.jsx)(h,{})]})]}):O?(0,r.jsxs)(`div`,{class:`cf-form cf-booking`,ref:u,children:[(0,r.jsx)(`div`,{class:`cf-form__title`,children:c[`book-demo`].title}),(0,r.jsx)(`div`,{class:`cf-booking__hint`,children:e.s(l.bookingViaProvider,{provider:s?.label??`the scheduler`})}),P?le?(0,r.jsxs)(`div`,{class:`cf-form__as`,children:[`as `,le]}):null:(0,r.jsxs)(r.Fragment,{children:[!t.name?.trim()&&(0,r.jsx)(`input`,{class:`cf-form__input`,type:`text`,placeholder:`${l.handoffName} *`,value:v,"aria-label":l.handoffName,onInput:e=>y(e.target.value)}),(0,r.jsx)(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${l.handoffEmail} *`,value:b,"aria-label":l.handoffEmail,onInput:e=>x(e.target.value)})]}),S===`error`&&(0,r.jsx)(`div`,{class:`cf-form__err`,children:E||l.formError}),(0,r.jsxs)(`div`,{class:`cf-form__actions`,children:[a&&(0,r.jsx)(`button`,{type:`button`,class:`cf-form__cancel`,onClick:a,children:l.cancel}),(0,r.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:S===`submitting`||!t.name?.trim()&&v.trim()===``||!P&&b.trim()===``,onClick:k,children:S===`submitting`?l.sending:l.bookingOpenScheduler})]})]}):(0,r.jsxs)(`div`,{class:`cf-form cf-booking`,ref:u,children:[(0,r.jsx)(`div`,{class:`cf-form__title`,children:c[`book-demo`].title}),(0,r.jsxs)(`div`,{class:`cf-booking__hint`,children:[l.bookingPickTime,` ยท `,(0,r.jsx)(`span`,{class:`cf-booking__dur`,children:l.bookingDuration})]}),(0,r.jsx)(`div`,{class:`cf-booking__dates`,role:`tablist`,"aria-label":`Pick a day`,children:d.map((e,t)=>(0,r.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===p,class:`cf-booking__date ${t===p?`is-selected`:``}`,onClick:()=>{m(t),_(null)},children:[(0,r.jsx)(`span`,{class:`cf-booking__dow`,children:e.toLocaleDateString(void 0,{weekday:`short`})}),(0,r.jsx)(`span`,{class:`cf-booking__dom`,children:e.getDate()})]},t))}),(0,r.jsx)(`div`,{class:`cf-booking__slots`,role:`listbox`,"aria-label":`Pick a time`,children:f.map(e=>{let t=ue(e),n=L(e),i=I(e),a=i||t||n;return(0,r.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":g===e,disabled:a,title:t?`Earlier today`:n?`Busy on the calendar`:i?`Already booked`:void 0,class:`cf-booking__slot ${g===e?`is-selected`:``} ${a?`is-taken`:``}`,onClick:()=>_(e),children:e},e)})}),oe&&(0,r.jsx)(`div`,{class:`cf-form__err`,children:l.bookingSlotTaken}),le?(0,r.jsxs)(`div`,{class:`cf-form__as`,children:[`as `,le]}):null,!ce&&(0,r.jsx)(`input`,{class:`cf-form__input`,type:`text`,placeholder:`${l.handoffName} *`,value:v,"aria-label":l.handoffName,onInput:e=>y(e.target.value)}),!P&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${l.handoffEmail} *`,value:b,"aria-label":l.handoffEmail,onInput:e=>x(e.target.value)})}),S===`error`&&(0,r.jsx)(`div`,{class:`cf-form__err`,children:E||l.formError}),(0,r.jsxs)(`div`,{class:`cf-form__actions`,children:[a&&(0,r.jsx)(`button`,{type:`button`,class:`cf-form__cancel`,onClick:a,children:l.cancel}),(0,r.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:!F||S===`submitting`,onClick:de,children:S===`submitting`?l.sending:c[`book-demo`].submit})]})]})},Ce=({actions:e,visitor:t,onSubmitForm:i,onDemoSlots:a,scheduler:o,exclude:s=[]})=>{let[l,u]=(0,n.useState)(null),[f,p]=(0,n.useState)(!1),m=(e??[]).map(e=>me[e]).filter(e=>!!e&&!s.includes(e.type));if(m.length===0)return null;let h=()=>{u(null),p(!1)},g=()=>u(null);if(l===`book-demo`)return(0,r.jsxs)(`div`,{class:`cf-action-drawer is-open`,role:`dialog`,"aria-label":`Book a demo`,children:[(0,r.jsx)(`div`,{class:`cf-action-drawer__handle`,"aria-hidden":`true`}),(0,r.jsxs)(`div`,{class:`cf-action-drawer__head`,children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`span`,{class:`cf-action-drawer__eyebrow`,children:`Contact options`}),(0,r.jsx)(`strong`,{children:`Book a demo`})]}),(0,r.jsx)(`button`,{type:`button`,class:`cf-action-drawer__close`,onClick:g,children:(0,r.jsx)(b,{})})]}),(0,r.jsx)(Se,{visitor:t,onCancel:g,onSubmit:(e,t)=>i(`book-demo`,e,t),onDemoSlots:a,scheduler:o})]});if(l){let e=m.find(e=>e.type===l);return(0,r.jsxs)(`div`,{class:`cf-action-drawer is-open`,role:`dialog`,"aria-label":e?.label??`Contact`,children:[(0,r.jsx)(`div`,{class:`cf-action-drawer__handle`,"aria-hidden":`true`}),(0,r.jsxs)(`div`,{class:`cf-action-drawer__head`,children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`span`,{class:`cf-action-drawer__eyebrow`,children:`Contact options`}),(0,r.jsx)(`strong`,{children:e?.label??c[l].title})]}),(0,r.jsx)(`button`,{type:`button`,class:`cf-action-drawer__close`,onClick:g,children:(0,r.jsx)(b,{})})]}),(0,r.jsx)(ge,{spec:c[l],visitor:t,onCancel:g,onSubmit:(e,t)=>i(l,e,t)})]})}return f?(0,r.jsxs)(`div`,{class:`cf-action-drawer cf-action-drawer--menu`,children:[(0,r.jsx)(`div`,{class:`cf-action-drawer__handle`,"aria-hidden":`true`}),(0,r.jsxs)(`div`,{class:`cf-action-drawer__head`,children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`span`,{class:`cf-action-drawer__eyebrow`,children:`Need help?`}),(0,r.jsx)(`strong`,{children:`Choose what you want to do`})]}),(0,r.jsx)(`button`,{type:`button`,class:`cf-action-drawer__close`,onClick:h,children:(0,r.jsx)(b,{})})]}),(0,r.jsx)(`div`,{class:`cf-action-drawer__grid`,children:m.map(({type:e,label:t,description:n,Icon:i})=>(0,r.jsxs)(`button`,{type:`button`,class:`cf-action-card`,onClick:()=>u(e),children:[(0,r.jsx)(`span`,{class:`cf-action-card__icon`,children:(0,r.jsx)(i,{})}),(0,r.jsxs)(`span`,{class:`cf-action-card__copy`,children:[(0,r.jsx)(`strong`,{children:t}),(0,r.jsx)(`small`,{children:n})]}),(0,r.jsx)(d,{})]},e))}),(0,r.jsx)(`p`,{class:`cf-action-drawer__note`,children:`Weโ€™ll ask for your full name and the best email or phone so the team can reach you.`})]}):(0,r.jsxs)(`button`,{type:`button`,class:`cf-action-trigger`,onClick:()=>p(!0),children:[(0,r.jsx)(`span`,{class:`cf-action-trigger__icon`,children:(0,r.jsx)(_,{})}),(0,r.jsxs)(`span`,{class:`cf-action-trigger__copy`,children:[(0,r.jsx)(`strong`,{children:`Contact options`}),(0,r.jsx)(`small`,{children:`Demo, message, callback`})]}),(0,r.jsx)(d,{})]})},z=({hasEmail:t,visitor:i,question:a,onSubmitForm:o})=>{let s=e.c(),[c,l]=(0,n.useState)(!1),[u,d]=(0,n.useState)(!1),[f,p]=(0,n.useState)(i.name??``),[m,h]=(0,n.useState)(i.email??``);if(t)return(0,r.jsxs)(`div`,{class:`cf-handoff cf-handoff--done`,children:[(0,r.jsx)(C,{}),(0,r.jsx)(`span`,{children:`Weโ€™ve alerted the team. If someone is available, they can continue here.`})]});if(c){let t=i.email||m;return(0,r.jsxs)(`div`,{class:`cf-handoff cf-handoff--done`,children:[(0,r.jsx)(C,{}),(0,r.jsx)(`span`,{children:e.s(s.handoffShared,{email:t})})]})}let g=async()=>{if(!(!m.trim()||u)){d(!0);try{await o(`inquiry`,{visitorEmail:m.trim(),...f.trim()?{visitorName:f.trim()}:{},message:a||`I had a question the assistant couldnโ€™t answer.`,subject:`Help request from chat`},{email:m.trim(),name:f.trim()||void 0}),l(!0)}catch{d(!1)}}};return(0,r.jsxs)(`div`,{class:`cf-handoff`,children:[(0,r.jsx)(`div`,{class:`cf-handoff__title`,children:s.handoffTitle}),(0,r.jsx)(`input`,{class:`cf-form__input`,type:`text`,placeholder:s.handoffName,value:f,"aria-label":s.handoffName,onInput:e=>p(e.target.value)}),(0,r.jsx)(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${s.handoffEmail} *`,value:m,"aria-label":s.handoffEmail,onInput:e=>h(e.target.value)}),(0,r.jsx)(`button`,{type:`button`,class:`cf-form__submit`,disabled:!m.trim()||u,onClick:g,children:u?s.sending:s.handoffNotify})]})},we=({text:t})=>{let i=e.c(),[a,o]=(0,n.useState)(!1);return(0,r.jsxs)(`button`,{type:`button`,class:`cf-tool`,onClick:async()=>{try{await navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),1500)}catch{}},"aria-label":i.copy,children:[a?(0,r.jsx)(C,{}):(0,r.jsx)(w,{}),a?i.copied:i.copy]})},Te=({items:e,onPick:t})=>e.length===0?null:(0,r.jsx)(`div`,{class:`cf-starters`,children:e.map((e,n)=>(0,r.jsx)(`button`,{type:`button`,class:`cf-starter`,onClick:()=>t(e),children:e},n))}),Ee=({items:e})=>{let t=e.filter(e=>e.label.trim()&&e.url.trim()).slice(0,4);return t.length===0?null:(0,r.jsx)(`div`,{class:`cf-featured-links`,children:t.map((e,t)=>(0,r.jsxs)(`a`,{class:`cf-featured-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,title:e.label,children:[(0,r.jsx)(h,{}),(0,r.jsx)(`span`,{children:e.label})]},`${e.url}-${t}`))})},De=({msg:t,onRate:i})=>{let a=e.c(),[o,s]=(0,n.useState)(!1),[c,l]=(0,n.useState)(``),u=t.feedback,d=()=>{i(t.id,`up`),s(!1)},f=()=>{i(t.id,`down`),s(!0)},p=()=>{i(t.id,`down`,c.trim()),s(!1)};return(0,r.jsxs)(`div`,{class:`cf-feedback`,children:[(0,r.jsxs)(`div`,{class:`cf-feedback__row`,children:[(0,r.jsx)(`button`,{type:`button`,class:`cf-feedback__btn ${u===`up`?`is-active`:``}`,"aria-label":a.feedbackHelpful,"aria-pressed":u===`up`,onClick:d,children:(0,r.jsx)(ne,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-feedback__btn ${u===`down`?`is-active`:``}`,"aria-label":a.feedbackNotHelpful,"aria-pressed":u===`down`,onClick:f,children:(0,r.jsx)(O,{})}),u&&!o&&(0,r.jsx)(`span`,{class:`cf-feedback__thanks`,children:a.feedbackThanks})]}),o&&u===`down`&&(0,r.jsxs)(`div`,{class:`cf-feedback__comment`,children:[(0,r.jsx)(`textarea`,{class:`cf-feedback__input`,rows:2,placeholder:a.feedbackCommentPlaceholder,value:c,onInput:e=>l(e.target.value)}),(0,r.jsx)(`button`,{type:`button`,class:`cf-feedback__send`,onClick:p,children:a.feedbackSend})]})]})},Oe=({msg:t,persona:n,isLast:i,visitor:a,hasEmail:o,lastQuestion:s,showActions:c,onPickReply:l,onSubmitForm:u,onDemoSlots:d,onRetry:f,ratable:p,onRate:m,onExpandVisualization:h})=>{let g=e.c(),_=t.role===`user`,v=t.liveEventType??``,y=t.content.trim().toLowerCase(),b=v===`handoff_queued`||v===`agent_joined`||v===`agent_left`||v===`conversation_ended`||y.includes(`joined the chat`)||y.includes(`left the chat`)||y.includes(`support agents will be with you`),x=t.role===`system`||b,S=t.requestedContactFields?.includes(`email`)===!0,C=i&&!_&&!x&&!!(t.handoffOffered||S),w=C&&!o?[`inquiry`]:[],T=!t.pending&&!t.streaming;return x?(0,r.jsx)(`div`,{class:`cf-msg cf-msg--system`,children:(0,r.jsxs)(`div`,{class:`cf-system-event`,children:[(0,r.jsx)(`div`,{class:`cf-system-event__mark`,"aria-hidden":`true`}),(0,r.jsx)(`div`,{class:`cf-system-event__text`,children:t.content}),t.createdAt&&(0,r.jsx)(`div`,{class:`cf-system-event__time`,children:new Date(t.createdAt).toLocaleString(void 0,{day:`2-digit`,month:`short`,year:`numeric`,hour:`numeric`,minute:`2-digit`})})]})}):(0,r.jsxs)(`div`,{class:`cf-msg cf-msg--${_?`user`:`agent`}`,children:[!_&&(0,r.jsx)(ue,{persona:n,small:!0}),(0,r.jsxs)(`div`,{class:`cf-msg__col`,children:[t.pending&&t.content===``?(0,r.jsx)(L,{}):t.imageUrl?(0,r.jsxs)(`div`,{class:`cf-msg__bubble cf-msg__bubble--media`,children:[(0,r.jsx)(`img`,{class:`cf-msg__media`,src:t.imageUrl,alt:`GIF`}),t.content&&(0,r.jsx)(`span`,{class:`cf-msg__caption`,children:t.content})]}):(0,r.jsxs)(`div`,{class:`cf-msg__bubble`,children:[_?t.content:e.a(t.content),t.streaming&&(0,r.jsx)(`span`,{class:`cf-caret`,"aria-hidden":`true`})]}),!_&&t.visualization?(0,r.jsx)(ke,{visualization:t.visualization,onExpand:h?()=>h(t.id):void 0,expandControlId:t.id}):null,!_&&t.visualization?.explanation?(0,r.jsx)(P,{explanation:t.visualization.explanation,onFollowUp:l,showLead:!t.content.toLocaleLowerCase().includes(t.visualization.explanation.headline.toLocaleLowerCase())}):null,_&&t.attachmentName&&(0,r.jsxs)(`div`,{class:`cf-attach-chip`,title:t.attachmentName,children:[(0,r.jsx)(E,{}),(0,r.jsx)(`span`,{children:t.attachmentName})]}),!_&&(0,r.jsxs)(r.Fragment,{children:[T&&(t.error||t.content)&&(0,r.jsxs)(`div`,{class:`cf-msg__actions`,children:[(0,r.jsx)(`div`,{class:`cf-msg__tools`,children:t.error?(0,r.jsxs)(`button`,{type:`button`,class:`cf-tool`,onClick:()=>f(t.id,t.retryText??``),children:[(0,r.jsx)(ee,{}),g.retry]}):(0,r.jsx)(we,{text:t.content})}),p&&!t.error&&t.content&&(0,r.jsx)(De,{msg:t,onRate:m})]}),(0,r.jsx)(fe,{msg:t}),i&&(0,r.jsx)(R,{replies:t.suggestedReplies,onPick:l}),C&&(0,r.jsx)(z,{hasEmail:o,visitor:a,question:s,onSubmitForm:u}),c&&(0,r.jsx)(Ce,{actions:t.availableActions,visitor:a,onSubmitForm:u,onDemoSlots:d,scheduler:n?.scheduler,exclude:w})]})]})]})},ke=({visualization:t,expanded:i=!1,onExpand:a,onClose:o,expandControlId:s})=>{let c=(0,n.useMemo)(()=>e.m(t),[t]),[l,u]=(0,n.useState)(c?.type);(0,n.useEffect)(()=>u(c?.type),[c]);let d=(0,n.useMemo)(()=>e.g(t),[t]),f=(0,n.useMemo)(()=>e.m(t,l),[l,t]),p=t.rows??[],m=t.columns?.length?t.columns:Object.keys(p[0]??{}),h=m.map(e=>{let n=t.columnMetadata?.find(t=>t.key===e);return n?{key:e,label:n.label,dataType:n.dataType,currencyCode:n.currencyCode}:e});if(p.length===0)return(0,r.jsx)(N,{});let g=(0,r.jsx)(M,{answeredAt:t.freshness?.answeredAt,reportingPeriod:t.reportingPeriod,filters:t.appliedFilters,rowCount:t.rowCount??p.length}),_=()=>t.tableAvailable===!1||m.length===0?null:(0,r.jsxs)(`div`,{class:`cf-analytics-visualization${i?` is-expanded`:``}`,children:[(0,r.jsxs)(`div`,{class:`cf-analytics-visualization__header`,children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`div`,{class:`cf-analytics-visualization__title`,children:t.title?.trim()||`Result details`}),g]}),(0,r.jsxs)(`div`,{class:`cf-analytics-visualization__actions`,children:[t.downloadAvailable?(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-visualization__download`,onClick:()=>B(m,p),children:`Download`}):null,i&&o?(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-visualization__close`,"aria-label":`Restore assistant view`,onClick:o,children:(0,r.jsx)(b,{})}):a&&t.expandable!==!1?(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-visualization__expand`,"aria-label":`Expand table`,"data-visualization-message":s,onClick:a,children:(0,r.jsx)(k,{})}):null]})]}),(0,r.jsx)(e.l,{rows:p,columns:h,maxRows:100,expanded:i,classPrefix:`cf`})]});if(t.presentation===`table`||!t.presentation&&t.type===`table`)return _();let v=t.chartRecommendation?.valueFields?.[0]??t.valueFields?.[0]??t.value??m[1];if(t.presentation===`kpi`||!t.presentation&&t.type===`kpi`){let n=p[0]?.[v??m[0]??``],a=typeof n==`number`?n:Number(n),s=t.columnMetadata?.find(e=>e.key===v),c=Number.isFinite(a)?e.h(a,s,t):String(n??`No value`);return(0,r.jsxs)(`div`,{class:`cf-analytics-visualization${i?` is-expanded`:``}`,children:[(0,r.jsxs)(`div`,{class:`cf-analytics-visualization__header`,children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`div`,{class:`cf-analytics-visualization__title`,children:`Live metric`}),g]}),i&&o?(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-visualization__close`,"aria-label":`Restore assistant view`,onClick:o,children:(0,r.jsx)(b,{})}):null]}),(0,r.jsx)(oe,{label:s?.label??v??`Current value`,value:c,detail:t.explanation?.summary})]})}return f?(0,r.jsxs)(`div`,{class:`cf-analytics-visualization${i?` is-expanded`:``}`,children:[(0,r.jsxs)(`div`,{class:`cf-analytics-visualization__header`,children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`div`,{class:`cf-analytics-visualization__title`,children:f.title}),g]}),(0,r.jsxs)(`div`,{class:`cf-analytics-visualization__actions`,children:[d.length>1?(0,r.jsxs)(`label`,{class:`cf-analytics-chart-picker`,children:[(0,r.jsx)(`span`,{children:`Chart`}),(0,r.jsx)(`select`,{"aria-label":`Chart type`,value:l??f.type,onChange:e=>u(e.currentTarget.value),children:d.map(e=>(0,r.jsx)(`option`,{value:e.type,children:e.label},e.type))})]}):null,i&&o?(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-visualization__close`,"aria-label":`Restore assistant view`,onClick:o,children:(0,r.jsx)(b,{})}):a&&t.expandable!==!1?(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-visualization__expand`,"aria-label":`Expand chart`,"data-visualization-message":s,onClick:a,children:(0,r.jsx)(k,{})}):null]})]}),(0,r.jsx)(e.p,{model:f,expanded:i}),(0,r.jsx)(`p`,{class:`cf-analytics-chart__summary`,children:f.summary}),t.downloadAvailable?(0,r.jsx)(`button`,{type:`button`,class:`cf-analytics-visualization__download`,onClick:()=>B(m,p),children:`Download this data`}):null]}):_()},B=(t,n)=>{if(typeof document>`u`||t.length===0)return;let r=e.f(n,t),i=URL.createObjectURL(new Blob([r],{type:`text/csv;charset=utf-8`})),a=document.createElement(`a`);a.href=i,a.download=`analytics-result.csv`,a.click(),URL.revokeObjectURL(i)},V=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).split(`,`)[1]??``),r.onerror=n,r.readAsDataURL(e)}),H=({onPick:e})=>(0,r.jsx)(`div`,{class:`cf-picker cf-emoji`,children:s.map(t=>(0,r.jsxs)(`div`,{class:`cf-emoji__group`,children:[(0,r.jsx)(`div`,{class:`cf-emoji__label`,children:t.name}),(0,r.jsx)(`div`,{class:`cf-emoji__grid`,children:t.emojis.map((t,n)=>(0,r.jsx)(`button`,{type:`button`,class:`cf-emoji__btn`,onClick:()=>e(t),"aria-label":t,children:t},n))})]},t.name))}),Ae=({onSearch:t,onPick:i})=>{let a=e.c(),[o,s]=(0,n.useState)(``),[c,l]=(0,n.useState)([]),[u,d]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{let e=!0;d(!0);let n=setTimeout(()=>{t(o).then(t=>e&&(l(t),d(!1))).catch(()=>e&&(l([]),d(!1)))},300);return()=>{e=!1,clearTimeout(n)}},[o,t]),(0,r.jsxs)(`div`,{class:`cf-picker cf-gif`,children:[(0,r.jsx)(`input`,{class:`cf-gif__search`,placeholder:a.searchGifs,value:o,"aria-label":a.searchGifs,onInput:e=>s(e.target.value)}),(0,r.jsx)(`div`,{class:`cf-gif__grid`,children:u?(0,r.jsx)(`div`,{class:`cf-gif__hint`,children:a.searchingGifs}):c.length===0?(0,r.jsx)(`div`,{class:`cf-gif__hint`,children:a.noGifs}):c.map(e=>(0,r.jsx)(`button`,{type:`button`,class:`cf-gif__item`,onClick:()=>i(e.url),"aria-label":e.alt,children:(0,r.jsx)(`img`,{src:e.preview,alt:e.alt,loading:`lazy`})},e.id))}),(0,r.jsx)(`div`,{class:`cf-gif__powered`,children:`via Tenor`})]})},je=8*1024*1024,Me=`image/png,image/jpeg,image/webp,image/gif,application/pdf`,Ne=12e3,Pe=250,Fe=e=>{switch(e){case`connecting`:return`Connecting with AIโ€ฆ`;case`listening`:return`Listening now โ€” go ahead.`;case`speaking`:return`AI is speaking โ€” talk to interrupt.`;case`processing`:return`Understanding what you saidโ€ฆ`;case`noise`:return`I couldn't hear clear words. Try again closer to the mic.`;case`misunderstood`:return`I didn't understand that. Please try again.`;case`denied`:return`Microphone access is blocked. Allow the mic or type your question.`;case`muted`:return`Muted โ€” tap the mic to unmute.`;case`timeout`:return`Didn't hear anything for a while โ€” ending the call.`;default:return``}},Ie=.004,Le=({muted:e,listening:t,micLevel:n,onToggleMute:i})=>(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn ${e?`is-muted`:``} ${t?`is-listening`:``} ${t&&n>=.004?`is-hot`:``}`,"aria-label":e?`Unmute microphone`:`Mute microphone`,"aria-pressed":e,onClick:i,style:t?{"--cf-wave":String(Math.max(.2,Math.min(1,n*6)))}:void 0,children:e?(0,r.jsx)(m,{}):(0,r.jsx)(p,{})}),Re=({audioDevices:e,selectedAudioDeviceId:t,onSelectAudioDevice:i})=>{let[a,o]=(0,n.useState)(!1),s=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!a)return;let e=e=>{s.current&&!e.composedPath().includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[a]);let c=[{deviceId:``,label:`Default microphone`},...e];return(0,r.jsxs)(`div`,{class:`cf-call-more`,ref:s,children:[(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn cf-call-btn--microphones`,"aria-label":`Choose microphone`,"aria-expanded":a,onClick:()=>o(e=>!e),children:(0,r.jsx)(d,{})}),a&&(0,r.jsxs)(`div`,{class:`cf-call-menu`,role:`menu`,children:[(0,r.jsx)(`div`,{class:`cf-call-menu__label`,children:`Microphone`}),c.map(e=>(0,r.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.deviceId===t,class:`cf-call-menu__item ${e.deviceId===t?`is-active`:``}`,onClick:()=>{i(e.deviceId),o(!1)},children:[e.deviceId===t?(0,r.jsx)(C,{}):(0,r.jsx)(`span`,{class:`cf-call-menu__spacer`}),(0,r.jsx)(`span`,{children:e.label})]},e.deviceId))]})]})},ze=({voiceState:e,muted:t,onToggleMute:n,onEndCall:i,onTalkNow:a,showTalkNow:o,micLevel:s,theaterMode:c,onToggleTheater:l,onMinimize:u,audioDevices:d,selectedAudioDeviceId:f,onSelectAudioDevice:m})=>(0,r.jsxs)(`div`,{class:`cf-call-controls`,children:[(0,r.jsx)(Le,{muted:t,listening:e===`listening`&&!t,micLevel:s,onToggleMute:n}),(0,r.jsx)(Re,{audioDevices:d,selectedAudioDeviceId:f,onSelectAudioDevice:m}),o&&(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn cf-call-btn--talk`,"aria-label":`Talk now`,onClick:a,children:(0,r.jsx)(p,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn`,"aria-label":c?`Exit expanded view`:`Expand view`,"aria-pressed":c,onClick:l,children:c?(0,r.jsx)(A,{}):(0,r.jsx)(k,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn`,"aria-label":`Minimize voice chat`,onClick:u,children:(0,r.jsx)(j,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn cf-call-btn--end`,"aria-label":`End voice chat`,onClick:i,children:(0,r.jsx)(D,{})})]}),Be=({persona:e,voiceState:t,muted:n,onToggleMute:i,onEndCall:a,micLevel:o,onExpand:s})=>{let c=e=>e.stopPropagation(),l=e?.assistantMediaUrl?.trim()||e?.agentAvatarUrl?.trim()||``,u=e?.assistantMediaKind===`video`&&!!l,d=e?.agentName||`Assistant`;return(0,r.jsxs)(`div`,{class:[`cf-floating-call-card`,t===`listening`&&!n?`is-listening`:``,t===`speaking`?`is-speaking`:``,t===`processing`||t===`connecting`?`is-thinking`:``,n?`is-muted`:``].filter(Boolean).join(` `),style:t===`listening`&&!n?{"--cf-listen":String(Math.max(.18,Math.min(1,o*8)))}:void 0,role:`button`,tabIndex:0,"aria-label":`Reopen voice chat with ${d}`,onClick:s,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s())},children:[(0,r.jsx)(`div`,{class:`cf-floating-call-card__media`,"aria-hidden":`true`,children:l?u?(0,r.jsx)(`video`,{src:l,muted:!0,loop:!0,playsInline:!0,autoPlay:!0}):(0,r.jsx)(`img`,{src:l,alt:``}):(0,r.jsxs)(`div`,{class:`cf-floating-call-card__avatar${F(e)}`,children:[(0,r.jsx)(`span`,{children:I(e)}),(0,r.jsx)(`span`,{class:`cf-floating-call-card__eye cf-floating-call-card__eye--left`}),(0,r.jsx)(`span`,{class:`cf-floating-call-card__eye cf-floating-call-card__eye--right`}),(0,r.jsx)(`span`,{class:`cf-floating-call-card__mouth`})]})}),(0,r.jsx)(`div`,{class:`cf-floating-call-card__shade`,"aria-hidden":`true`}),(0,r.jsxs)(`div`,{class:`cf-floating-call-card__controls`,onClick:c,onKeyDown:c,role:`presentation`,children:[(0,r.jsx)(Le,{muted:n,listening:t===`listening`&&!n,micLevel:o,onToggleMute:i}),(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn cf-call-btn--restore`,"aria-label":`Restore voice chat`,onClick:e=>{c(e),s()},children:(0,r.jsx)(re,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-call-btn cf-call-btn--end`,"aria-label":`End voice chat`,onClick:e=>{c(e),a()},children:(0,r.jsx)(D,{})})]})]})},Ve=({onSend:t,onSendGif:i,onTyping:s,disabled:c,allowVoice:l,onTranscribe:u,gifEnabled:d,onSearchGifs:m,allowAttach:h,onExtract:g,voiceStartSignal:_=0,onVoiceStateChange:v})=>{let x=e.c(),[S,C]=(0,n.useState)(``),[w,ee]=(0,n.useState)(!1),[T,D]=(0,n.useState)(!1),[te,ne]=(0,n.useState)(`idle`),[O,k]=(0,n.useState)(`none`),[A,j]=(0,n.useState)(null),[re,ie]=(0,n.useState)(!1),[ae,M]=(0,n.useState)(``),oe=(0,n.useRef)(null),N=(0,n.useRef)(null),P=(0,n.useRef)(null),se=(0,n.useRef)(null),ce=(0,n.useRef)([]),F=(0,n.useRef)(void 0),le=(0,n.useRef)(null),I=(0,n.useRef)(void 0),ue=(0,n.useRef)(0),L=e=>{ne(e),v?.(e)},de=()=>{F.current&&window.clearTimeout(F.current),F.current=void 0,I.current&&cancelAnimationFrame(I.current),I.current=void 0,le.current?.close().catch(()=>void 0),le.current=null};(0,n.useEffect)(()=>{let e=oe.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,110)}px`)},[S]),(0,n.useEffect)(()=>{if(O===`none`)return;let e=e=>{N.current&&!e.composedPath().includes(N.current)&&k(`none`)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[O]);let fe=e=>k(t=>t===e?`none`:e),R=e=>{let t=oe.current;if(!t){C(t=>t+e);return}let n=t.selectionStart??S.length,r=t.selectionEnd??S.length;C(S.slice(0,n)+e+S.slice(r)),requestAnimationFrame(()=>{t.focus();let r=n+e.length;t.setSelectionRange(r,r)})},pe=e=>{k(`none`),i(e)},me=async e=>{let t=e.target,n=t.files?.[0];if(t.value=``,n){if(M(``),n.size>8388608){M(x.attachTooLarge);return}ie(!0);try{let e=await g(await V(n),n.type||`application/octet-stream`,n.name);if(!e){M(x.attachFailed);return}j({name:n.name,text:e})}catch{M(x.attachFailed)}finally{ie(!1)}}},he=(!!S.trim()||!!A)&&!c&&!re&&!T,ge=()=>{he&&(t(S,A?{attachmentName:A.name,attachmentText:A.text}:void 0),s?.(!1),C(``),j(null),M(``))},_e=e=>{let n=e.trim();if(!n||c){L(`misunderstood`),window.setTimeout(()=>L(`idle`),2500);return}let r=S.trim();t(r?`${r} ${n}`:n),s?.(!1),C(``),j(null),M(``),L(`idle`)},ve=e=>{e.key===`Enter`&&!e.shiftKey?(e.preventDefault(),ge()):e.key===`Escape`&&O!==`none`&&(e.preventDefault(),e.stopPropagation(),k(`none`))},ye=async()=>{if(w){o(se.current);return}try{L(`connecting`);let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=a(e);ce.current=[],ue.current=0;try{let t=window.AudioContext??window.webkitAudioContext;if(t){let n=new t;le.current=n;let r=n.createMediaStreamSource(e),i=n.createAnalyser();i.fftSize=512,r.connect(i);let a=new Uint8Array(i.frequencyBinCount),o=()=>{i.getByteTimeDomainData(a);let e=0;for(let t of a){let n=(t-128)/128;e+=n*n}ue.current=Math.max(ue.current,Math.sqrt(e/a.length)),I.current=requestAnimationFrame(o)};o()}}catch{}t.ondataavailable=e=>e.data.size>0&&ce.current.push(e.data),t.onstop=async()=>{de(),e.getTracks().forEach(e=>e.stop()),ee(!1);let n=new Blob(ce.current,{type:t.mimeType||`audio/webm`});if(n.size===0||n.size<900||ue.current<.006){L(`noise`),window.setTimeout(()=>L(`idle`),3200);return}D(!0),L(`processing`);try{let e=await V(n);if(!e.trim()){L(`noise`),window.setTimeout(()=>L(`idle`),3200);return}let t=typeof navigator<`u`&&(navigator.languages?.[0]||navigator.language)||void 0;_e(await u(e,n.type,t))}catch{L(`misunderstood`),window.setTimeout(()=>L(`idle`),3e3)}finally{D(!1)}},se.current=t,t.start(250),ee(!0),L(`listening`),F.current=window.setTimeout(()=>{o(se.current)},12e3)}catch{L(`denied`),window.setTimeout(()=>L(`idle`),3500)}};return(0,n.useEffect)(()=>{!_||!l||c||w||T||ye()},[_]),(0,n.useEffect)(()=>()=>de(),[]),(0,r.jsxs)(`div`,{class:`cf-composer`,ref:N,children:[O===`emoji`&&(0,r.jsx)(H,{onPick:R}),O===`gif`&&(0,r.jsx)(Ae,{onSearch:m,onPick:pe}),(A||re||ae)&&(0,r.jsx)(`div`,{class:`cf-attach-row`,children:re?(0,r.jsx)(`span`,{class:`cf-attach-status`,children:x.attaching}):ae?(0,r.jsx)(`span`,{class:`cf-attach-status cf-attach-status--err`,children:ae}):A&&(0,r.jsxs)(`span`,{class:`cf-attach-chip`,title:A.name,children:[(0,r.jsx)(E,{}),(0,r.jsx)(`span`,{children:A.name}),(0,r.jsx)(`button`,{type:`button`,class:`cf-attach-x`,"aria-label":`Remove attachment`,onClick:()=>j(null),children:(0,r.jsx)(b,{})})]})}),te!==`idle`&&(0,r.jsxs)(`div`,{class:`cf-voice-state`,"aria-live":`polite`,children:[(0,r.jsx)(`span`,{class:`cf-voice-state__dot ${w?`is-live`:``}`}),Fe(te)]}),(0,r.jsxs)(`div`,{class:`cf-composer__field`,children:[(0,r.jsx)(`button`,{type:`button`,class:`cf-iconbtn ${O===`emoji`?`is-active`:``}`,"aria-label":x.emoji,"aria-pressed":O===`emoji`,onClick:()=>fe(`emoji`),children:O===`emoji`?(0,r.jsx)(b,{}):(0,r.jsx)(y,{})}),d&&(0,r.jsx)(`button`,{type:`button`,class:`cf-iconbtn cf-gifbtn ${O===`gif`?`is-active`:``}`,"aria-label":x.gifs,"aria-pressed":O===`gif`,onClick:()=>fe(`gif`),children:(0,r.jsx)(`span`,{class:`cf-gif-label`,children:`GIF`})}),h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`input`,{ref:P,type:`file`,class:`cf-file-input`,accept:`image/png,image/jpeg,image/webp,image/gif,application/pdf`,onChange:me,tabIndex:-1,"aria-hidden":`true`}),(0,r.jsx)(`button`,{type:`button`,class:`cf-iconbtn`,"aria-label":x.attachFile,disabled:re,onClick:()=>P.current?.click(),children:(0,r.jsx)(E,{})})]}),(0,r.jsx)(`textarea`,{ref:oe,class:`cf-textarea`,rows:1,placeholder:x.composerPlaceholder,value:S,"aria-label":x.composerPlaceholder,disabled:c,onInput:e=>{let t=e.target.value;C(t),s?.(!!t.trim())},onKeyDown:ve}),l&&(0,r.jsx)(`button`,{type:`button`,class:`cf-iconbtn cf-mic ${w?`is-recording`:``}`,"aria-label":w?x.stopRecording:x.recordVoice,"aria-pressed":w,disabled:T||c,onClick:ye,children:(0,r.jsx)(p,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-send`,"aria-label":x.send,disabled:!he,onClick:ge,children:(0,r.jsx)(f,{})})]})]})},He=({name:e,greeting:t})=>(0,r.jsxs)(`section`,{class:`cf-empty-welcome`,"aria-label":`${e} welcome`,children:[(0,r.jsx)(`span`,{class:`cf-empty-welcome__eyebrow`,children:`Ready when you are`}),(0,r.jsx)(`h2`,{children:e}),t?(0,r.jsx)(`p`,{children:t}):(0,r.jsx)(`p`,{children:`Ask a question, leave a message, or book a demo.`})]}),Ue=e=>{let[t,r]=(0,n.useState)(`light`);return(0,n.useEffect)(()=>{if(e!==`auto`||typeof matchMedia>`u`)return;let t=matchMedia(`(prefers-color-scheme: dark)`),n=()=>r(t.matches?`dark`:`light`);return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]),e===`auto`?t:e},We=1e4,Ge=1400,Ke=.0038,qe=.0022,Je=1600,Ye=550,Xe=350,Ze=.001,Qe=6e4,$e=90,et=.009,tt=280,nt=250,rt=250,it=e=>e.replace(/\[[^\]]{0,60}\]/g,` `).replace(/\(([^)]{0,60})\)/g,(e,t)=>at.has(t.trim().toLowerCase().replace(/[.!?,โ€ฆ]+$/,``).replace(/\s+/g,` `))?` `:e).replace(/\*[^*]{0,60}\*/g,` `).replace(/\s+/g,` `).trim(),at=new Set(`background noise.engine noise.noise.inaudible.unintelligible.silence.no speech.static.music.laughter.applause.wind.breathing.click.clicks.clicking.mouse click.mouse clicks.beep.beeps.beeping.tap.taps.tapping.typing.keyboard typing.cough.coughing.sigh.hmm.mm.mmm.uh.um.ah.oh`.split(`.`)),ot=e=>{let t=e.trim().toLowerCase().replace(/[()[\]*]/g,` `).replace(/[.!?,โ€ฆ]+$/,``).replace(/\s+/g,` `).trim();return!t||/^(?:sh+\s*)+$/.test(t)?!0:at.has(t)},st=e=>{let t=e.trim().toLowerCase().replace(/\s+/g,` `);return t?t.includes(`transcribe this audio recording verbatim`)||t.includes(`preserve the spoken language and any code-switching`)||t.includes(`output only the transcribed text, no commentary`):!1},ct={end:`end the call`,mute:`mute your microphone`,minimize:`minimize the chat`,expand:`expand the view`,shrink:`exit the expanded view`},lt=e=>e.trim().toLowerCase().replace(/[^\p{L}\p{N}\s']/gu,` `).replace(/\s+/g,` `).trim(),ut=[{action:`shrink`,re:/\b(?:exit|leave|quit|close)\b[\s\w]*\b(?:full ?screen|expanded|theat(?:er|re))\b|\bshrink\b|\bsmaller view\b/},{action:`end`,re:/\b(?:end|close|stop|finish|hang ?up|quit|exit)\b[\s\w]*\b(?:call|chat|conversation|convo|session|talking)\b|\bhang ?up\b|\bgood ?bye\b|^bye(?: bye)?$/},{action:`mute`,re:/\bmute\b|\bstop listening\b/},{action:`minimize`,re:/\bminimi[sz]e\b|\bhide\b[\s\w]*\b(?:chat|call|window|widget)\b/},{action:`expand`,re:/\bexpand\b|\bmaximi[sz]e\b|\bfull ?screen\b|\btheat(?:er|re) mode\b|\bbigger view\b/}],dt=/^(?:yes|yeah|yep|yup|sure|correct|confirm|affirmative|go ahead|do it|please do|ok(?:ay)?)\b/,ft=/^(?:no|nope|nah|cancel|never ?mind|don'?t|stop)\b/,pt=/^(?:end|close|stop|finish|hang ?up|quit|exit|bye|good ?bye)\b/,mt=e=>{let t=lt(e);if(!t)return null;for(let{action:e,re:n}of ut)if(n.test(t)){let n=t.split(` `).length;return{action:e,confident:e===`end`?n<=10:n<=6}}return null},ht=e=>`I didn't catch yes or no. Say yes to ${ct[e]}, or no to keep talking.`,gt=e=>`I caught some audio, but not enough clear words. Try again a little closer to the mic, or type your question for ${e?.agentName?.trim()||`the assistant`}.`,_t=e=>{let t=lt(e).replace(/\b(?:um|uh|erm|hmm)\b/g,``).trim();return!t||t.split(/\s+/).length<=2&&/^(?:can|could|would|will|do|does|is|are|what|why|how|where|when)\b/.test(t)?!0:/\b(?:can you|could you|would you|will you|do you|can i|could i|would i|i want to|i need to|tell me about|what about|how about|about|with|to|for|please)$/i.test(t)},vt=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result??``).split(`,`)[1]??``),r.onerror=()=>n(r.error),r.readAsDataURL(e)}),yt=(e,t)=>{let n=window.AudioContext??window.webkitAudioContext;if(!n)return null;let r,i=!1,a=new n;try{let n=a.createMediaStreamSource(e),o=a.createAnalyser();o.fftSize=512,n.connect(o);let s=new Uint8Array(o.frequencyBinCount),c=()=>{if(i)return;o.getByteTimeDomainData(s);let e=0;for(let t of s){let n=(t-128)/128;e+=n*n}t(Math.sqrt(e/s.length),performance.now()),i||(r=requestAnimationFrame(c))};c()}catch{return a.close().catch(()=>void 0),null}return{stop:()=>{i||(i=!0,r!==void 0&&cancelAnimationFrame(r),r=void 0,a.close().catch(()=>void 0))}}},bt=e=>({...e?{deviceId:{exact:e}}:{},echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}),xt=({transport:t,config:i,bindControls:s})=>{let c=i.strings,[l,f]=(0,n.useState)(i.openByDefault),{persona:p,messages:m,sending:h,assistantSpeaking:g,visitor:_,hasEmail:v,liveMode:y,assignedAgentName:b,agentTypingName:C,starters:w,featuredLinks:ee,send:E,sendGif:k,notifyTyping:A,stop:j,retry:re,rateMessage:ae,injectAssistant:M,appendUserDraft:oe,patchMessage:N,removeMessage:P,submitCsat:se,submitForm:ce,transcribe:F,extract:le,searchGifs:I,demoSlots:L,gifEnabled:de,identify:fe,ended:R,endConversation:me,startNew:he,history:ge,viewingSessionId:_e,viewMessages:ve,openConversation:ye,closeHistoryView:be,shutdown:xe,stopSpeaking:Se,speakAssistantText:z}=e.n(t,i,l),[we,De]=(0,n.useState)(0),[B,V]=(0,n.useState)(`idle`),[H,Ae]=(0,n.useState)(!1),[je,Me]=(0,n.useState)(!1),[Ne,Pe]=(0,n.useState)(0),[Fe,Ie]=(0,n.useState)(!1),[Le,Re]=(0,n.useState)(null),[ze,Ge]=(0,n.useState)([]),[Ke,Ye]=(0,n.useState)(``),[Xe,Ze]=(0,n.useState)(()=>{try{return localStorage.getItem(`centrinfo:muted`)===`1`}catch{return!1}}),$e=Ue(i.theme),et=m.some(e=>e.role===`assistant`&&(e.pending||e.streaming)),tt=h||et||g,nt=p?.soundEnabled??!0;(0,n.useEffect)(()=>{e.i(i.sound&&nt&&!Xe)},[i.sound,nt,Xe]);let rt=(0,n.useCallback)(()=>{Ze(e=>{let t=!e;try{localStorage.setItem(`centrinfo:muted`,t?`1`:`0`)}catch{}return t})},[]),at=(0,n.useRef)(null),ut=(0,n.useRef)(null),xt=(0,n.useRef)(null),St=(0,n.useRef)(0),U=(0,n.useRef)(!1),W=(0,n.useRef)(!1),G=(0,n.useRef)(!1),Ct=(0,n.useRef)(0),wt=(0,n.useRef)(!1),K=(0,n.useRef)(null),Tt=(0,n.useRef)(null),Et=(0,n.useRef)([]),Dt=(0,n.useRef)(void 0),Ot=(0,n.useRef)(void 0),kt=(0,n.useRef)(null),At=(0,n.useRef)(0),jt=(0,n.useRef)(0),Mt=(0,n.useRef)(!1),Nt=(0,n.useRef)(0),Pt=(0,n.useRef)(null),Ft=(0,n.useRef)(null),It=(0,n.useRef)(0),q=(0,n.useRef)(null),Lt=(0,n.useRef)([]),Rt=(0,n.useRef)(0),zt=(0,n.useRef)(0),Bt=(0,n.useRef)(0),Vt=(0,n.useRef)(null),Ht=(0,n.useRef)(!1),Ut=(0,n.useRef)(null),J=(0,n.useRef)(``),Wt=(0,n.useRef)(()=>{}),Gt=(0,n.useRef)(``),Kt=(0,n.useRef)(h),qt=(0,n.useRef)(g),Jt=(0,n.useRef)(tt),Yt=(0,n.useRef)(B),Xt=(0,n.useRef)(0);(0,n.useEffect)(()=>{Kt.current=h},[h]),(0,n.useEffect)(()=>{qt.current=g},[g]),(0,n.useEffect)(()=>{Jt.current=tt},[tt]),(0,n.useEffect)(()=>{Yt.current=B},[B]);let[Zt,Qt]=(0,n.useState)(!0),[$t,en]=(0,n.useState)(!1),tn=(0,n.useRef)(0),[nn,rn]=(0,n.useState)(!1),an=(0,n.useRef)(null),[on,sn]=(0,n.useState)(!1),[cn,ln]=(0,n.useState)(!1),Y=!!_e,un=Y?ve:m,dn=un.find(e=>e.id===Le&&e.visualization)?.visualization;(0,n.useEffect)(()=>{!Le||dn||(Re(null),Ie(!1))},[dn,Le]);let fn=(0,n.useCallback)(()=>{f(!0),De(0),e.r(`open`),i.onOpen?.(),i.onShow?.()},[i]),X=(0,n.useCallback)(()=>{f(!1),Ie(!1),Re(null),i.onClose?.(),i.onHide?.(),ut.current?.focus()},[i]),pn=(0,n.useCallback)(()=>l?X():fn(),[l,fn,X]),mn=(0,n.useCallback)(()=>rn(!0),[]),hn=(0,n.useCallback)(()=>{me(),rn(!1)},[me]),gn=(0,n.useCallback)(()=>{he(),en(!1),Qt(!0)},[he]);(0,n.useEffect)(()=>{nn&&an.current?.focus()},[nn]),(0,n.useEffect)(()=>{s({open:fn,close:X,toggle:pn,identify:fe,startNew:he,endConversation:me,shutdown:xe})},[s,fn,X,pn,fe,he,me,xe]),(0,n.useEffect)(()=>{let e=m.filter(e=>e.role===`assistant`&&!e.pending).length;if(l){St.current=e;return}e>St.current&&De(e-St.current)},[m,l]),(0,n.useEffect)(()=>{i.onUnreadChange?.(we)},[we,i]),(0,n.useEffect)(()=>{let e=i.sessionDurationMinutes;if(!e||e<=0)return;let t=setTimeout(()=>xe(),e*60*1e3);return()=>clearTimeout(t)},[i.sessionDurationMinutes,m,l,xe]),(0,n.useEffect)(()=>{let e=i.customLauncherSelector;if(!e||typeof document>`u`)return;let t=[];try{t=Array.from(document.querySelectorAll(e))}catch{return}let n=e=>{e.preventDefault(),pn()};return t.forEach(e=>e.addEventListener(`click`,n)),()=>t.forEach(e=>e.removeEventListener(`click`,n))},[i.customLauncherSelector,pn]);let _n=(0,n.useRef)(!1);(0,n.useEffect)(()=>{let e=i.proactiveMessage?.trim();if(!e||_n.current)return;let t=i.proactiveOnPaths??[],n=typeof location<`u`?location.pathname:``;if(t.length>0&&!t.some(e=>n.includes(e)))return;let r=`centrinfo:proactive:${i.token.slice(0,12)}`;try{if(sessionStorage.getItem(r)===`1`)return}catch{}let a=setTimeout(()=>{if(!(l||R||m.some(e=>e.role===`user`))){_n.current=!0;try{sessionStorage.setItem(r,`1`)}catch{}M(e),fn()}},Math.max(0,i.proactiveDelaySeconds)*1e3);return()=>clearTimeout(a)},[i.proactiveMessage]),(0,n.useEffect)(()=>{let e=xt.current;if(!l||!e)return;let t=m[m.length-1],n=Date.now()<tn.current;t?.role===`user`||Zt||n?(requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight}),en(!1),n&&Qt(!0)):en(!0)},[m,l,h,Zt]);let vn=(0,n.useCallback)(()=>{let e=xt.current;if(!e)return;if(U.current&&!Y){Qt(!0),en(!1);return}let t=e.scrollHeight-e.scrollTop-e.clientHeight<80;Qt(t),t&&en(!1)},[Y]),yn=(0,n.useCallback)(()=>{let e=xt.current;e&&(e.scrollTop=e.scrollHeight),en(!1),Qt(!0)},[]),bn=(0,n.useCallback)(()=>{tn.current=Date.now()+3e3,requestAnimationFrame(yn)},[yn]);(0,n.useEffect)(()=>{if(!l||Y||!H||B===`connecting`)return;tn.current=Date.now()+6e4,yn();let e=requestAnimationFrame(()=>{yn(),requestAnimationFrame(yn)}),t=[80,180,360].map(e=>window.setTimeout(yn,e));return()=>{cancelAnimationFrame(e),t.forEach(e=>window.clearTimeout(e))}},[g,m,l,yn,h,H,Y,B]);let xn=(0,n.useCallback)(()=>{at.current?.querySelector(`.cf-textarea`)?.focus()},[]),Sn=(0,n.useCallback)(()=>{Dt.current&&window.clearTimeout(Dt.current),Dt.current=void 0,Ot.current&&window.clearTimeout(Ot.current),Ot.current=void 0,kt.current?.stop(),kt.current=null,Pe(0)},[]),Z=(0,n.useCallback)(()=>{Ft.current?.stop(),Ft.current=null,o(q.current),Pt.current?.getTracks().forEach(e=>e.stop()),Pt.current=null,It.current=0,zt.current=0},[]),Cn=(0,n.useCallback)(()=>{Sn(),Tt.current?.getTracks().forEach(e=>e.stop()),Tt.current=null},[Sn]),Q=(0,n.useCallback)(()=>{U.current=!1,G.current=!1,W.current=!1,wt.current=!1,Vt.current=null,Ht.current=!1,Ut.current=null,J.current=``,Ae(!1),Me(!1),Ie(!1),Re(null),Z(),Se();let e=K.current;e?.state===`recording`?o(e):(Cn(),V(`idle`))},[Z,Se,Cn]),wn=(0,n.useCallback)(()=>{Fe&&Re(null),Ie(!Fe)},[Fe]),Tn=(0,n.useCallback)(e=>{Re(e),Ie(!0)},[]),En=(0,n.useCallback)(()=>{let e=Le;Re(null),Ie(!1),window.requestAnimationFrame(()=>{Array.from(at.current?.querySelectorAll(`[data-visualization-message]`)??[]).find(t=>t.dataset.visualizationMessage===e)?.focus()})},[Le]),Dn=(0,n.useCallback)(()=>{Re(null),Ie(!1)},[]),On=(0,n.useCallback)((e,t)=>{if(Date.now()-Ct.current>=Qe){V(`timeout`),Ot.current=window.setTimeout(()=>Q(),2400);return}V(e),Ot.current=window.setTimeout(()=>{U.current&&!W.current&&!qt.current&&t()},1400)},[Q]),kn=(0,n.useCallback)((e,t,n)=>{Date.now()-Ct.current<Qe&&!W.current&&(G.current=!0,z(t)),On(e,n)},[On,z]),An=(0,n.useCallback)((e,t)=>{bn(),Ct.current=Date.now(),G.current=!0,t&&N(t,{content:e,pending:!0,streaming:!1});let n=()=>{if(U.current){if(Kt.current){window.setTimeout(n,80);return}t&&Ut.current===t&&(Ut.current=null),E(e,{forceVoicePlayback:!0,userMessageId:t})}};n()},[bn,N,E]),jn=(0,n.useCallback)(async(e,t,n,r=`normal`,i)=>{let a=null,o=e=>a||(bn(),a=Ut.current||oe(e),Ut.current=a,N(a,{content:J.current||e,pending:!0,streaming:!1}),a),s=()=>{a&&(Ut.current===a&&(Ut.current=null),J.current=``,P(a),a=null)},c=()=>{J.current=``,V(`listening`),window.setTimeout(()=>{U.current&&!W.current&&!Kt.current&&!K.current&&n()},120)},l=e.size===0,u=e.size<350&&t<.001;if(l||u){if(r===`barge`){c();return}let e=Vt.current;kn(`noise`,e?ht(e):gt(p),n),J.current=``;return}V(`processing`);let d=++Xt.current,f=o(`Listening...`);try{let t=typeof navigator<`u`&&(navigator.languages?.[0]||navigator.language)||void 0;N(f,{content:J.current?`${J.current} ...`:`Transcribing...`,pending:!0});let a=await vt(e);if(!a.trim()){if(s(),r===`barge`){c();return}kn(`noise`,Vt.current?ht(Vt.current):gt(p),n);return}let o=it(await F(a,e.type,t,i));if(d!==Xt.current){s();return}let l=[J.current,o].map(e=>e.trim()).filter(Boolean).join(` `).replace(/\s+/g,` `).trim();if(!l||ot(l)||st(l)){if(s(),r===`barge`){c();return}let e=Vt.current;kn(`misunderstood`,e?ht(e):gt(p),n);return}let u=Vt.current;if(u){let e=lt(l);if(dt.test(e)||u===`end`&&pt.test(e)){s(),Vt.current=null,Wt.current(u);return}if(ft.test(e)){s(),Vt.current=null;let e=`Okay, never mind โ€” what would you like to know?`;M(e),G.current=!0,V(`speaking`),z(e);return}s();let t=ht(u);M(t),G.current=!0,V(`speaking`),z(t);return}let m=mt(l);if(m){if(s(),Ct.current=Date.now(),m.confident){Wt.current(m.action);return}Vt.current=m.action;let e=`Just to confirm โ€” you want me to ${ct[m.action]}? Please say yes or no.`;M(e),G.current=!0,V(`speaking`),z(e);return}if(N(f,{content:l,pending:!0}),_t(l)){J.current=l,V(`listening`),n();return}J.current=``,An(l,f)}catch(e){if(s(),r===`barge`){c();return}kn(`misunderstood`,`I couldn't convert your speech to text. Please check the speech service configuration or type your question.${e instanceof Error&&e.message.trim()?` (${e.message.trim()})`:``}`,n)}},[oe,bn,kn,M,N,p,P,An,z,F]),$=(0,n.useCallback)(async()=>{if(!(!U.current||W.current)&&!(!p?.allowVoiceInput||R||Y)&&!Kt.current&&!K.current){Z(),G.current=!1;try{V(`connecting`);let e=await navigator.mediaDevices.getUserMedia({audio:bt(Gt.current)});if(!U.current||W.current){e.getTracks().forEach(e=>e.stop());return}navigator.mediaDevices.enumerateDevices().then(e=>{Ge(e.filter(e=>e.kind===`audioinput`).map((e,t)=>({deviceId:e.deviceId,label:e.label||`Microphone ${t+1}`})))}).catch(()=>{});let t=a(e);K.current=t,Tt.current=e,Et.current=[],At.current=0,Mt.current=!1,Nt.current=0;let n=performance.now();kt.current=yt(e,(e,r)=>{if(At.current=Math.max(At.current,e),e>=.0038)Mt.current=!0,Nt.current=0;else if(Mt.current&&e<=qe){Nt.current||(Nt.current=r);let e=r-Nt.current,i=r-n;if(e>=Je&&i>=550&&t.state===`recording`){o(t);return}}else Nt.current=0;r-jt.current>90&&(jt.current=r,Pe(e))}),t.ondataavailable=e=>{e.data.size>0&&Et.current.push(e.data)},t.onstop=async()=>{if(Cn(),K.current=null,wt.current){wt.current=!1,U.current&&!W.current?(V(`idle`),$()):V(U.current&&W.current?`muted`:`idle`);return}if(!U.current){V(`idle`);return}await jn(new Blob(Et.current,{type:t.mimeType||`audio/webm`}),At.current,$,`normal`,Math.max(0,(performance.now()-n)/1e3))},t.start(250),V(`listening`),Dt.current=window.setTimeout(()=>{o(K.current)},We)}catch{V(`denied`),Ot.current=window.setTimeout(()=>Q(),3500)}}},[R,Q,jn,p,p?.allowVoiceInput,Z,Cn,Y]),Mn=(0,n.useCallback)(()=>{if(U.current){Q();return}xn(),!(!p?.allowVoiceInput||Kt.current||R||Y)&&(Ct.current=Date.now(),G.current=!1,W.current=!1,U.current=!0,Me(!1),Ae(!0),V(`connecting`),$())},[R,Q,xn,p,p?.allowVoiceInput,$,Y]),Nn=(0,n.useCallback)(()=>{Me(e=>{let t=!e;if(W.current=t,t){let e=K.current;e?.state===`recording`?(wt.current=!0,o(e)):(Cn(),V(`muted`))}else U.current&&!R&&!Y&&(V(`idle`),$());return t})},[R,$,Cn,Y]),Pn=(0,n.useCallback)((e,t)=>{M(e),t&&(G.current=!0),V(`speaking`),z(e)},[M,z]),Fn=(0,n.useCallback)(e=>{switch(Ct.current=Date.now(),e){case`end`:G.current=!1,Ht.current=!0,Pn(`Okay โ€” ending our call now. Goodbye!`,!1),window.setTimeout(()=>{Ht.current&&(Ht.current=!1,Q())},2e3);break;case`mute`:{W.current||Nn();let e=`Muted. Tap the mic button when you want me to listen again.`;M(e),z(e);break}case`minimize`:X(),Pn(`Minimized โ€” I'm still listening. Tap the call pill to bring the chat back.`,!0);break;case`expand`:Ie(!0),Pn(`Sure โ€” expanding the view.`,!0);break;case`shrink`:Re(null),Ie(!1),Pn(`Okay โ€” back to the smaller view.`,!0);break}},[X,Q,M,z,Pn,Nn]);(0,n.useEffect)(()=>{Wt.current=Fn},[Fn]);let In=(0,n.useRef)(!1);(0,n.useEffect)(()=>{In.current&&!g&&Ht.current&&(Ht.current=!1,Q()),In.current=g},[g,Q]);let Ln=(0,n.useCallback)(e=>{Gt.current=e,Ye(e);let t=K.current;t?.state===`recording`&&(wt.current=!0,o(t))},[]),Rn=(0,n.useCallback)(()=>{if(!(!U.current||W.current)){if(Z(),j(),Se(),Ct.current=Date.now(),V(`listening`),Kt.current){let e=()=>{if(!(!U.current||W.current)){if(Kt.current){window.setTimeout(e,70);return}G.current=!1,$()}};window.setTimeout(e,70);return}G.current=!1,$()}},[$,j,Z,Se]),zn=(0,n.useCallback)(async()=>{if(!(Pt.current||Ft.current)&&!(!U.current||W.current))try{let e=await navigator.mediaDevices.getUserMedia({audio:bt(Gt.current)});if(!U.current||W.current||K.current||Pt.current||!Jt.current&&Yt.current!==`processing`){e.getTracks().forEach(e=>e.stop());return}Pt.current=e,It.current=0,zt.current=0,Bt.current=0;let t=()=>{if(q.current)return;j(),Se(),Xt.current+=1,Ct.current=Date.now(),G.current=!1,V(`listening`);let t=a(e);q.current=t,Lt.current=[],Rt.current=performance.now(),zt.current=0,t.ondataavailable=e=>{e.data.size>0&&Lt.current.push(e.data)},t.onstop=async()=>{let e=Lt.current,n=Bt.current,r=t.mimeType||`audio/webm`;q.current=null,Lt.current=[],Z(),U.current&&await jn(new Blob(e,{type:r}),n,$,`barge`,Math.max(0,(performance.now()-Rt.current)/1e3))},t.start(250)};Ft.current=yt(e,(e,n)=>{if(Bt.current=Math.max(Bt.current,e),n-jt.current>90&&(jt.current=n,Pe(e)),e>=.009)It.current||(It.current=n),n-It.current>=280&&t(),zt.current=0;else if(q.current&&e<=qe){zt.current||(zt.current=n);let e=n-zt.current,t=n-Rt.current;e>=Je&&t>=550&&q.current.state===`recording`&&o(q.current)}else q.current&&n-Rt.current>=We&&q.current.state===`recording`?o(q.current):(It.current=0,zt.current=0)}),Ft.current||Z()}catch{}},[jn,$,j,Z,Se]);(0,n.useEffect)(()=>{if(!(H&&!je&&!R&&!Y&&(tt||B===`processing`))){Z();return}let e=window.setTimeout(()=>void zn(),250);return()=>window.clearTimeout(e)},[tt,R,zn,Z,H,je,B,Y]);let Bn=H&&!je&&(h||g||B===`processing`);(0,n.useEffect)(()=>{!H||je||g&&V(`speaking`)},[g,H,je]),(0,n.useEffect)(()=>{if(!H||je||!G.current||h||g||![`processing`,`speaking`,`noise`,`misunderstood`].includes(B))return;let e=window.setTimeout(()=>{!U.current||W.current||Kt.current||(G.current=!1,$())},700);return()=>window.clearTimeout(e)},[g,h,$,H,je,B]),(0,n.useEffect)(()=>()=>Q(),[Q]);let[Vn,Hn]=(0,n.useState)(``),Un=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(Un.current&&!h){let e=[...m].reverse().find(e=>e.role===`assistant`&&!e.streaming&&!e.pending&&e.content);e&&Hn(e.content)}Un.current=h},[h,m]),(0,n.useEffect)(()=>{if(!l)return;let e=at.current;nn||e?.querySelector(`.cf-textarea`)?.focus();let t=t=>{if(t.key===`Escape`){if(t.preventDefault(),nn){rn(!1);return}X();return}if(t.key!==`Tab`||!e)return;let n=e.querySelectorAll(`button, [href], textarea, input, [tabindex]:not([tabindex="-1"])`),r=Array.from(n).filter(e=>!e.hasAttribute(`disabled`));if(r.length===0)return;let i=r[0],a=r[r.length-1],o=e.getRootNode()instanceof ShadowRoot?e.getRootNode().activeElement:document.activeElement;t.shiftKey&&o===i?(t.preventDefault(),a.focus()):!t.shiftKey&&o===a&&(t.preventDefault(),i.focus())};return e?.addEventListener(`keydown`,t),()=>e?.removeEventListener(`keydown`,t)},[l,X,nn]),(0,n.useEffect)(()=>{let e=at.current;e&&(l?e.removeAttribute(`inert`):e.setAttribute(`inert`,``))},[l]);let Wn=i.accentColor??i.themeTokens?.accent??p?.accentColor,Gn={zIndex:i.zIndex,"--cf-h-pad":`${i.horizontalPadding}px`,"--cf-v-pad":`${i.verticalPadding}px`,...i.themeTokens?.accentText?{"--cf-accent-ink":i.themeTokens.accentText}:{},...i.themeTokens?.accentStrong?{"--cf-accent-2":i.themeTokens.accentStrong}:{},...i.themeTokens?.background?{"--cf-bg":i.themeTokens.background}:{},...i.themeTokens?.surface?{"--cf-surface":i.themeTokens.surface}:{},...i.themeTokens?.surfaceMuted?{"--cf-surface-2":i.themeTokens.surfaceMuted}:{},...i.themeTokens?.text?{"--cf-text":i.themeTokens.text}:{},...i.themeTokens?.mutedText?{"--cf-muted":i.themeTokens.mutedText}:{},...i.themeTokens?.border?{"--cf-border":i.themeTokens.border}:{},...i.themeTokens?.shadow?{"--cf-shadow":i.themeTokens.shadow}:{},...i.themeTokens?.radius?{"--cf-radius":i.themeTokens.radius}:{},...i.themeTokens?.fontFamily?{"--cf-font":i.themeTokens.fontFamily}:{},...Wn?{"--cf-accent":Wn,"--cf-accent-2":i.themeTokens?.accentStrong??`color-mix(in oklab, ${Wn} 76%, #14141f)`}:{}},Kn=e=>E(e),qn=[...m].reverse().find(e=>e.role===`user`&&e.content.trim())?.content??``,Jn=m.some(e=>e.role===`user`),Yn=p?.talkbackMode===`avatar`||p?.widgetModule===`assistant`||!!p?.allowVoiceInput,Xn=!Y&&Yn&&!Jn?un.filter((e,t)=>!(t===0&&e.role===`assistant`)):un,Zn=y===`human`&&b?b:p?.agentName??`Chat`,Qn=y===`human`?`Live support`:y===`queued`?`Waiting for the team`:p?.offline?c.statusOffline:c.statusOnline,$n=!R&&!Y?p?.availableActions:void 0,er=H&&B===`connecting`&&!Y;return(0,r.jsx)(e.o,{value:c,children:(0,r.jsxs)(`div`,{class:`cf-root`,"data-theme":$e,"data-align":i.alignment,"data-display":`floating`,style:Gn,children:[Fe&&l&&(0,r.jsx)(`div`,{class:`cf-theater-backdrop`,onClick:Dn}),(0,r.jsxs)(`div`,{ref:at,class:`cf-panel ${l?`is-open`:``} ${H?`cf-panel--call`:``} ${er?`cf-panel--voice-connecting`:``} ${Fe&&l?`cf-panel--theater`:``} ${dn?`cf-panel--analytics-focus`:``}`,role:`dialog`,"aria-modal":`false`,"aria-label":`Chat with ${p?.agentName??`us`}`,"aria-hidden":!l,children:[(0,r.jsxs)(`div`,{class:`cf-header`,children:[(0,r.jsx)(ue,{persona:p,hideWhenMissing:!0}),(0,r.jsxs)(`div`,{class:`cf-header__meta`,children:[(0,r.jsx)(`div`,{class:`cf-header__name`,children:Zn}),(0,r.jsx)(`div`,{class:`cf-header__status ${y===`ai`&&p?.offline?`cf-header__status--offline`:``}`,children:(0,r.jsx)(`span`,{class:`cf-header__status-text`,children:Qn})})]}),(0,r.jsxs)(`div`,{class:`cf-header__actions`,children:[ge.length>0&&(0,r.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":c.pastConversations,title:c.pastConversations,"aria-pressed":on,onClick:()=>sn(e=>!e),children:(0,r.jsx)(te,{})}),Jn&&!R&&!Y&&(0,r.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":c.endChat,title:c.endChat,onClick:mn,children:(0,r.jsx)(D,{})}),i.sound&&nt&&(0,r.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":Xe?c.unmuteSounds:c.muteSounds,"aria-pressed":Xe,onClick:rt,children:Xe?(0,r.jsx)(S,{}):(0,r.jsx)(x,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-header__btn cf-header__close`,"aria-label":c.closeChat,onClick:X,children:(0,r.jsx)(d,{})})]})]}),(0,r.jsx)(`div`,{class:`cf-panel__video`,children:dn?(0,r.jsx)(`div`,{class:`cf-analytics-focus`,role:`region`,"aria-label":`Expanded analytics result`,children:(0,r.jsx)(ke,{visualization:dn,expanded:!0,onClose:En})}):!Y&&Yn?(0,r.jsx)(pe,{persona:p,starters:[],onPick:E,onFocusComposer:Mn,speaking:g,voiceState:B,replyPending:H&&h&&!g,pinned:!0,muted:je,onToggleMute:Nn,onEndCall:Q,onTalkNow:Rn,showTalkNow:Bn,micLevel:Ne,theaterMode:Fe,onToggleTheater:wn,onMinimize:X,audioDevices:ze,selectedAudioDeviceId:Ke,onSelectAudioDevice:Ln,connectingOnly:er}):null}),!er&&(0,r.jsxs)(`div`,{class:`cf-panel__chat`,children:[i.preview&&(0,r.jsx)(`div`,{class:`cf-preview-banner`,children:c.previewBanner}),Y&&(0,r.jsx)(`div`,{class:`cf-viewing-banner`,children:c.viewingPast}),(0,r.jsxs)(`div`,{class:`cf-body`,ref:xt,role:`log`,onScroll:vn,children:[Xn.map((e,t)=>(0,r.jsx)(Oe,{msg:e,persona:p,isLast:!Y&&t===Xn.length-1,visitor:_,hasEmail:v,lastQuestion:qn,showActions:!Y&&t===Xn.length-1&&!!e.handoffOffered,onPickReply:Kn,onSubmitForm:ce,onDemoSlots:L,onRetry:re,ratable:!Y&&Xn.slice(0,t).some(e=>e.role===`user`),onRate:ae,onExpandVisualization:Y?void 0:Tn},e.id)),!Jn&&!Y&&(0,r.jsxs)(r.Fragment,{children:[Xn.length===0&&(0,r.jsx)(He,{name:p?.agentName??`Assistant`,greeting:p?.greeting}),(0,r.jsx)(Te,{items:w,onPick:E}),(0,r.jsx)(Ee,{items:ee})]}),$t&&(0,r.jsxs)(`button`,{type:`button`,class:`cf-newmsg`,onClick:yn,children:[(0,r.jsx)(ie,{}),c.newMessages]})]}),(0,r.jsx)(`div`,{class:`cf-sr-live`,"aria-live":`polite`,"aria-atomic":`true`,children:Vn}),h&&!R&&!Y&&(0,r.jsx)(`div`,{class:`cf-stopbar`,children:(0,r.jsxs)(`button`,{type:`button`,class:`cf-stop`,onClick:j,children:[(0,r.jsx)(T,{}),c.stop]})}),Y?(0,r.jsx)(`div`,{class:`cf-ended`,children:(0,r.jsx)(`button`,{type:`button`,class:`cf-ended__btn`,onClick:be,children:c.backToChat})}):R?(0,r.jsxs)(`div`,{class:`cf-ended`,children:[(0,r.jsx)(`p`,{class:`cf-ended__text`,children:c.conversationEnded}),i.csat&&Jn?cn?(0,r.jsx)(`p`,{class:`cf-ended__text`,children:c.feedbackThanks}):(0,r.jsxs)(`div`,{class:`cf-csat`,children:[(0,r.jsx)(`span`,{class:`cf-csat__q`,children:c.csatPrompt}),(0,r.jsx)(`button`,{type:`button`,class:`cf-csat__btn`,"aria-label":c.feedbackHelpful,onClick:()=>{se(`up`),ln(!0)},children:(0,r.jsx)(ne,{})}),(0,r.jsx)(`button`,{type:`button`,class:`cf-csat__btn`,"aria-label":c.feedbackNotHelpful,onClick:()=>{se(`down`),ln(!0)},children:(0,r.jsx)(O,{})})]}):null,(0,r.jsx)(`button`,{type:`button`,class:`cf-ended__btn`,onClick:gn,children:c.startNewChat})]}):(0,r.jsxs)(r.Fragment,{children:[C?(0,r.jsxs)(`div`,{class:`cf-live-typing`,"aria-live":`polite`,children:[C,` is typingโ€ฆ`]}):null,$n&&$n.length>0&&(0,r.jsx)(`div`,{class:`cf-footer-actions`,children:(0,r.jsx)(Ce,{actions:$n,visitor:_,onSubmitForm:ce,onDemoSlots:L,scheduler:p?.scheduler})}),(0,r.jsx)(Ve,{onSend:E,onSendGif:k,onTyping:A,disabled:h,allowVoice:!!p?.allowVoiceInput,onTranscribe:F,gifEnabled:de,onSearchGifs:I,allowAttach:i.attachments,onExtract:le})]}),!R&&p?.disclaimerText&&(0,r.jsx)(`div`,{class:`cf-disclaimer`,children:p.disclaimerText}),(0,r.jsxs)(`div`,{class:`cf-footer`,children:[c.poweredBy,` `,(0,r.jsx)(`a`,{href:`https://accurix.tech/centrinfo`,target:`_blank`,rel:`noopener noreferrer`,children:`Centrinfo`})]})]}),nn&&(0,r.jsx)(`div`,{class:`cf-confirm`,onClick:()=>rn(!1),children:(0,r.jsxs)(`div`,{class:`cf-confirm__card`,role:`alertdialog`,"aria-modal":`true`,"aria-label":c.endChatConfirm,onClick:e=>e.stopPropagation(),children:[(0,r.jsx)(`div`,{class:`cf-confirm__title`,children:c.endChatConfirm}),(0,r.jsx)(`div`,{class:`cf-confirm__body`,children:c.endChatConfirmBody}),(0,r.jsxs)(`div`,{class:`cf-confirm__actions`,children:[(0,r.jsx)(`button`,{ref:an,type:`button`,class:`cf-confirm__btn cf-confirm__btn--cancel`,onClick:()=>rn(!1),children:c.cancel}),(0,r.jsx)(`button`,{type:`button`,class:`cf-confirm__btn cf-confirm__btn--danger`,onClick:hn,children:c.endConfirmCta})]})]})}),on&&(0,r.jsx)(`div`,{class:`cf-confirm`,onClick:()=>sn(!1),children:(0,r.jsxs)(`div`,{class:`cf-history`,role:`dialog`,"aria-modal":`true`,"aria-label":c.pastConversations,onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)(`div`,{class:`cf-history__head`,children:[(0,r.jsx)(`span`,{children:c.pastConversations}),(0,r.jsx)(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":c.closeChat,onClick:()=>sn(!1),children:(0,r.jsx)(d,{})})]}),(0,r.jsx)(`div`,{class:`cf-history__list`,children:ge.map(e=>(0,r.jsxs)(`button`,{type:`button`,class:`cf-history__item ${e.sessionId===_e?`is-active`:``}`,onClick:()=>{ye(e.sessionId),sn(!1)},children:[(0,r.jsx)(`span`,{class:`cf-history__title`,children:e.title}),(0,r.jsxs)(`span`,{class:`cf-history__meta`,children:[new Date(e.ts).toLocaleDateString(void 0,{month:`short`,day:`numeric`}),e.ended?` ยท ${c.historyEnded}`:``]})]},e.sessionId))})]})})]}),H&&!l?(0,r.jsx)(Be,{persona:p,voiceState:B,muted:je,onToggleMute:Nn,onEndCall:Q,micLevel:Ne,onExpand:fn}):Fe&&l?null:!i.hideDefaultLauncher&&(0,r.jsxs)(`button`,{ref:ut,type:`button`,class:`cf-launcher`,"aria-label":l?c.closeChat:c.openChat,"aria-expanded":l,onClick:pn,children:[i.launcherIcon?(0,r.jsx)(`img`,{class:`cf-launcher__img`,src:i.launcherIcon,alt:``}):(0,r.jsx)(u,{}),!l&&we>0&&(0,r.jsx)(`span`,{class:`cf-launcher__badge`,children:we})]})]})})},St=`
9
2
  :host {
10
3
  all: initial;
11
4
  }
@@ -27,8 +20,8 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
27
20
  bottom: 0;
28
21
  right: 0;
29
22
  font-family: var(--cf-font);
30
- font-size: 15px;
31
- line-height: 1.5;
23
+ font-size: 14px;
24
+ line-height: 1.45;
32
25
  color: var(--cf-text);
33
26
  -webkit-font-smoothing: antialiased;
34
27
  }
@@ -135,24 +128,132 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
135
128
  z-index: 2;
136
129
  width: 384px;
137
130
  max-width: calc(100vw - 32px);
138
- height: 640px;
131
+ height: min(88vh, 820px);
132
+ min-height: 560px;
139
133
  max-height: calc(100vh - 40px);
140
134
  background: var(--cf-bg);
141
135
  border-radius: var(--cf-radius);
142
136
  box-shadow: var(--cf-shadow);
143
- display: flex;
144
- flex-direction: column;
137
+ /* Grid (not flex) so theater mode below can reflow header/video/chat into a
138
+ two-column split purely in CSS, without reordering the DOM. */
139
+ display: grid;
140
+ grid-template-columns: 1fr;
141
+ grid-template-rows: auto auto minmax(0, 1fr);
142
+ grid-template-areas: 'header' 'video' 'chat';
145
143
  overflow: hidden;
146
144
  transform-origin: bottom right;
147
145
  opacity: 0;
148
- transform: translateY(16px) scale(0.96);
146
+ transform: translateY(22px) scale(0.94);
149
147
  pointer-events: none;
150
- transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
148
+ transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
149
+ height 0.28s ease, width 0.28s ease;
151
150
  }
152
151
  .cf-panel.is-open {
153
152
  opacity: 1;
154
153
  transform: translateY(0) scale(1);
155
154
  pointer-events: auto;
155
+ animation: cf-panel-open 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
156
+ }
157
+
158
+ .cf-panel > .cf-header { grid-area: header; }
159
+ /* Stacked ABOVE .cf-panel__chat (which sits right below it in the docked
160
+ layout) so the call bar's popover โ€” which opens downward and overlaps
161
+ that space โ€” paints over the transcript instead of getting interleaved
162
+ with message bubbles underneath it. */
163
+ .cf-panel__video {
164
+ grid-area: video;
165
+ position: relative;
166
+ z-index: 5;
167
+ min-width: 0;
168
+ }
169
+ .cf-panel__chat {
170
+ grid-area: chat;
171
+ display: flex;
172
+ flex-direction: column;
173
+ min-height: 0;
174
+ min-width: 0;
175
+ }
176
+ /* A live voice call gets more room for the transcript underneath the avatar card. */
177
+ .cf-panel.cf-panel--call {
178
+ height: min(90vh, 840px);
179
+ }
180
+ .cf-panel.cf-panel--voice-connecting {
181
+ height: min(72vh, 560px);
182
+ min-height: 420px;
183
+ grid-template-rows: auto minmax(0, 1fr);
184
+ grid-template-areas: 'header' 'video';
185
+ }
186
+ .cf-panel--voice-connecting .cf-panel__video {
187
+ display: grid;
188
+ min-height: 0;
189
+ }
190
+ /* Expanded "theater" view โ€” video and chat side by side in a large centered
191
+ modal instead of the corner bubble. Only reachable from an active call's
192
+ expand button, so it never applies below the existing mobile breakpoint. */
193
+ @media (min-width: 640px) {
194
+ .cf-panel.cf-panel--theater {
195
+ inset: 0;
196
+ margin: auto;
197
+ width: min(1040px, calc(100vw - 48px));
198
+ height: min(760px, calc(100vh - 48px));
199
+ max-width: none;
200
+ max-height: none;
201
+ grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
202
+ grid-template-rows: auto minmax(0, 1fr);
203
+ grid-template-areas: 'header header' 'video chat';
204
+ }
205
+ .cf-panel.cf-panel--theater.is-open {
206
+ transform: none;
207
+ }
208
+ .cf-panel--theater .cf-panel__video { height: 100%; }
209
+ .cf-panel--theater .cf-assistant-card--pinned {
210
+ height: 100%;
211
+ margin: 0;
212
+ padding: 0;
213
+ border: 0;
214
+ border-right: 1px solid var(--cf-border);
215
+ }
216
+ .cf-panel--theater .cf-assistant-card--pinned .cf-assistant-card__stage {
217
+ height: 100%;
218
+ border-radius: 0;
219
+ }
220
+ .cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__face {
221
+ width: min(220px, 38vw);
222
+ height: min(220px, 38vw);
223
+ }
224
+ .cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__initials {
225
+ font-size: clamp(42px, 7vw, 76px);
226
+ transform: translateY(-14px);
227
+ }
228
+ .cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__eye {
229
+ top: 43%;
230
+ width: 11px;
231
+ height: 11px;
232
+ }
233
+ .cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__eye--left { left: 34%; }
234
+ .cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__eye--right { right: 34%; }
235
+ .cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__mouth {
236
+ bottom: 27%;
237
+ width: 52px;
238
+ height: 8px;
239
+ }
240
+ .cf-panel--theater .cf-avatar-wave {
241
+ bottom: 92px;
242
+ }
243
+ /* The call bar sits near the BOTTOM of the full-height theater video pane
244
+ (vs. near the top of the short docked card), so its popover flips to
245
+ open upward here โ€” there's room above it, none below. */
246
+ .cf-panel--theater .cf-call-menu {
247
+ top: auto;
248
+ bottom: calc(100% + 8px);
249
+ }
250
+ }
251
+ .cf-theater-backdrop {
252
+ position: fixed;
253
+ inset: 0;
254
+ z-index: 1;
255
+ background: rgba(10, 14, 20, 0.55);
256
+ pointer-events: auto;
156
257
  }
157
258
 
158
259
  /* Left-aligned messenger (alignment: 'left') โ€” dock to the left edge. */
@@ -188,6 +289,10 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
188
289
  height: 100%;
189
290
  object-fit: cover;
190
291
  }
292
+ .cf-header__avatar[class*='cf-avatar-preset--'],
293
+ .cf-msg__avatar[class*='cf-avatar-preset--'] {
294
+ background: linear-gradient(135deg, var(--cf-avatar-a, var(--cf-accent)), var(--cf-avatar-b, var(--cf-accent-2)));
295
+ }
191
296
  .cf-header__meta {
192
297
  min-width: 0;
193
298
  flex: 1 1 auto;
@@ -276,12 +381,13 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
276
381
 
277
382
  /* ---------- Body / messages ---------- */
278
383
  .cf-body {
279
- flex: 1;
384
+ flex: 1 1 0;
385
+ min-height: 0;
280
386
  overflow-y: auto;
281
387
  /* Never scroll/shift horizontally โ€” a long source pill or code line is
282
388
  clipped, not allowed to push the whole thread sideways. */
283
389
  overflow-x: hidden;
284
- padding: 18px 16px 8px;
390
+ padding: 12px 14px 8px;
285
391
  display: flex;
286
392
  flex-direction: column;
287
393
  gap: 12px;
@@ -295,6 +401,38 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
295
401
  background: var(--cf-border);
296
402
  border-radius: 4px;
297
403
  }
404
+ .cf-empty-welcome {
405
+ display: flex;
406
+ flex-direction: column;
407
+ gap: 5px;
408
+ margin: 4px 0 2px;
409
+ padding: 14px 14px 13px;
410
+ border-radius: 18px;
411
+ background:
412
+ radial-gradient(circle at 14% 0%, color-mix(in oklab, var(--cf-accent) 20%, transparent), transparent 34%),
413
+ linear-gradient(135deg, color-mix(in oklab, var(--cf-surface) 88%, var(--cf-bg)), var(--cf-bg));
414
+ border: 1px solid color-mix(in oklab, var(--cf-border) 78%, var(--cf-accent));
415
+ }
416
+ .cf-empty-welcome__eyebrow {
417
+ color: var(--cf-accent);
418
+ font-size: 10px;
419
+ font-weight: 800;
420
+ letter-spacing: 0.11em;
421
+ text-transform: uppercase;
422
+ }
423
+ .cf-empty-welcome h2 {
424
+ margin: 0;
425
+ color: var(--cf-text);
426
+ font-size: 17px;
427
+ line-height: 1.15;
428
+ letter-spacing: -0.02em;
429
+ }
430
+ .cf-empty-welcome p {
431
+ margin: 0;
432
+ color: var(--cf-muted);
433
+ font-size: 12.8px;
434
+ line-height: 1.45;
435
+ }
298
436
  .cf-msg {
299
437
  display: flex;
300
438
  gap: 8px;
@@ -304,6 +442,10 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
304
442
  .cf-msg--user {
305
443
  justify-content: flex-end;
306
444
  }
445
+ .cf-msg--system {
446
+ justify-content: center;
447
+ margin: 4px 0;
448
+ }
307
449
  .cf-msg__avatar {
308
450
  width: 26px;
309
451
  height: 26px;
@@ -327,7 +469,7 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
327
469
  words like "Hello" never split mid-word. */
328
470
  overflow-wrap: break-word;
329
471
  white-space: pre-wrap;
330
- font-size: 14.5px;
472
+ font-size: 13.5px;
331
473
  }
332
474
  .cf-msg--agent .cf-msg__bubble {
333
475
  background: var(--cf-surface);
@@ -348,11 +490,103 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
348
490
  .cf-msg__bubble p:last-child { margin-bottom: 0; }
349
491
  .cf-msg__col { min-width: 0; max-width: 85%; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
350
492
  .cf-msg--user .cf-msg__col { align-items: flex-end; }
493
+ .cf-system-event {
494
+ width: min(280px, 88%);
495
+ display: flex;
496
+ flex-direction: column;
497
+ align-items: center;
498
+ gap: 4px;
499
+ text-align: center;
500
+ color: var(--cf-muted);
501
+ }
502
+ .cf-system-event__mark {
503
+ width: 7px;
504
+ height: 7px;
505
+ border-radius: 999px;
506
+ background: color-mix(in srgb, var(--cf-accent, #2f7f55) 72%, transparent);
507
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--cf-accent, #2f7f55) 12%, transparent);
508
+ }
509
+ .cf-system-event__text {
510
+ max-width: 100%;
511
+ padding: 7px 11px;
512
+ border: 1px solid var(--cf-border);
513
+ border-radius: 999px;
514
+ background: color-mix(in srgb, var(--cf-surface, #ffffff) 86%, transparent);
515
+ font-size: 12.5px;
516
+ font-weight: 600;
517
+ line-height: 1.35;
518
+ color: var(--cf-muted);
519
+ overflow-wrap: break-word;
520
+ }
521
+ .cf-system-event__time {
522
+ font-size: 11px;
523
+ line-height: 1.2;
524
+ color: var(--cf-muted);
525
+ }
351
526
 
352
527
  /* ---------- Markdown in answers ---------- */
353
- .cf-msg__bubble .cf-md-h { font-weight: 700; font-size: 14.5px; margin: 4px 0 2px; }
354
- .cf-msg__bubble ul.cf-md-list, .cf-msg__bubble ol.cf-md-list { margin: 4px 0; padding-left: 20px; }
355
- .cf-msg__bubble .cf-md-list li { margin: 2px 0; }
528
+ .cf-msg__bubble .cf-md-h {
529
+ margin: 12px 0 5px;
530
+ color: var(--cf-text);
531
+ font-size: 14.5px;
532
+ font-weight: 750;
533
+ line-height: 1.3;
534
+ }
535
+ .cf-msg__bubble .cf-md-h:first-child { margin-top: 0; }
536
+ .cf-msg__bubble .cf-md-h--1,
537
+ .cf-msg__bubble .cf-md-h--2 { font-size: 15.5px; }
538
+ .cf-msg__bubble p.cf-md-list-intro {
539
+ margin: 11px 0 5px;
540
+ color: var(--cf-text);
541
+ font-weight: 750;
542
+ line-height: 1.35;
543
+ }
544
+ .cf-msg__bubble ul.cf-md-list,
545
+ .cf-msg__bubble ol.cf-md-list {
546
+ display: grid;
547
+ gap: 9px;
548
+ margin: 8px 0 11px;
549
+ padding: 0;
550
+ list-style: none;
551
+ }
552
+ .cf-msg__bubble .cf-md-list li {
553
+ position: relative;
554
+ min-width: 0;
555
+ padding-left: 18px;
556
+ line-height: 1.52;
557
+ }
558
+ .cf-msg__bubble ul.cf-md-list > li::before {
559
+ position: absolute;
560
+ top: .58em;
561
+ left: 2px;
562
+ width: 6px;
563
+ height: 6px;
564
+ border-radius: 50%;
565
+ background: var(--cf-accent);
566
+ content: "";
567
+ }
568
+ .cf-msg__bubble ol.cf-md-list { counter-reset: cf-answer-item; }
569
+ .cf-msg__bubble ol.cf-md-list > li { padding-left: 25px; counter-increment: cf-answer-item; }
570
+ .cf-msg__bubble ol.cf-md-list > li::before {
571
+ position: absolute;
572
+ top: .08em;
573
+ left: 0;
574
+ display: grid;
575
+ width: 19px;
576
+ height: 19px;
577
+ place-items: center;
578
+ border-radius: 50%;
579
+ color: var(--cf-accent);
580
+ background: var(--cf-accent-soft);
581
+ content: counter(cf-answer-item);
582
+ font-size: 10px;
583
+ font-weight: 750;
584
+ }
585
+ .cf-msg__bubble .cf-md-list li > strong:first-child {
586
+ display: inline;
587
+ color: var(--cf-text);
588
+ font-weight: 750;
589
+ }
356
590
  .cf-md-code {
357
591
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
358
592
  font-size: 0.86em;
@@ -390,6 +624,7 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
390
624
  }
391
625
 
392
626
  /* message tools (copy / retry) */
627
+ .cf-msg__actions { display: flex; align-items: flex-start; gap: 2px; }
393
628
  .cf-msg__tools { display: flex; gap: 6px; }
394
629
  .cf-tool {
395
630
  display: inline-flex;
@@ -407,7 +642,7 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
407
642
  .cf-tool svg { width: 13px; height: 13px; }
408
643
 
409
644
  /* Per-message ๐Ÿ‘/๐Ÿ‘Ž feedback. */
410
- .cf-feedback { margin-top: 4px; }
645
+ .cf-feedback { margin-top: 0; }
411
646
  .cf-feedback__row { display: flex; align-items: center; gap: 4px; }
412
647
  .cf-feedback__btn {
413
648
  display: inline-flex;
@@ -456,20 +691,85 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
456
691
  .cf-feedback__send:hover { opacity: 0.9; }
457
692
 
458
693
  /* conversation starters */
459
- .cf-starters { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 2px 0 4px 34px; }
694
+ .cf-starters {
695
+ display: flex;
696
+ flex-direction: column;
697
+ align-items: flex-start;
698
+ min-width: 0;
699
+ gap: 8px;
700
+ margin: 2px 0 4px 34px;
701
+ }
460
702
  .cf-starter {
461
- padding: 9px 13px;
703
+ max-width: 100%;
704
+ padding: 8px 12px;
462
705
  border-radius: 14px;
463
706
  border: 1px solid var(--cf-border);
464
707
  background: var(--cf-bg);
465
708
  color: var(--cf-text);
466
- font-size: 13.5px;
709
+ font-size: 12.8px;
467
710
  font-weight: 500;
468
711
  text-align: left;
712
+ overflow-wrap: anywhere;
469
713
  transition: border-color 0.15s ease, transform 0.1s ease;
470
714
  }
471
715
  .cf-starter:hover { border-color: var(--cf-accent); }
472
716
  .cf-starter:active { transform: scale(0.98); }
717
+ .cf-starter:focus-visible {
718
+ outline: 2px solid var(--cf-accent-2);
719
+ outline-offset: 2px;
720
+ }
721
+ .cf-featured-links {
722
+ display: flex;
723
+ flex-wrap: wrap;
724
+ align-items: flex-start;
725
+ min-width: 0;
726
+ gap: 8px;
727
+ margin: 2px 0 4px;
728
+ }
729
+ .cf-featured-link {
730
+ flex: 0 1 auto;
731
+ min-width: 0;
732
+ max-width: 100%;
733
+ display: inline-flex;
734
+ align-items: center;
735
+ gap: 7px;
736
+ min-width: 0;
737
+ min-height: 34px;
738
+ padding: 7px 11px;
739
+ border-radius: 999px;
740
+ border: 1px solid color-mix(in srgb, var(--cf-accent) 55%, var(--cf-border));
741
+ background: color-mix(in srgb, var(--cf-accent) 10%, var(--cf-bg));
742
+ color: var(--cf-text);
743
+ font-size: 13px;
744
+ font-weight: 500;
745
+ text-decoration: none;
746
+ transition: border-color 0.15s ease, background-color 0.15s ease;
747
+ }
748
+ .cf-featured-link svg {
749
+ width: 14px;
750
+ height: 14px;
751
+ flex: 0 0 14px;
752
+ }
753
+ .cf-featured-link svg {
754
+ width: 14px;
755
+ height: 14px;
756
+ flex: 0 0 14px;
757
+ color: var(--cf-accent);
758
+ }
759
+ .cf-featured-link span {
760
+ min-width: 0;
761
+ overflow: hidden;
762
+ text-overflow: ellipsis;
763
+ white-space: nowrap;
764
+ }
765
+ .cf-featured-link:hover {
766
+ border-color: var(--cf-accent);
767
+ background: color-mix(in srgb, var(--cf-accent) 16%, var(--cf-bg));
768
+ }
769
+ .cf-featured-link:focus-visible {
770
+ outline: 2px solid var(--cf-accent-2);
771
+ outline-offset: 2px;
772
+ }
473
773
 
474
774
  /* stop generating */
475
775
  .cf-stopbar { display: flex; justify-content: center; padding: 6px 0 2px; flex-shrink: 0; }
@@ -492,13 +792,25 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
492
792
 
493
793
  /* typing */
494
794
  .cf-typing {
795
+ max-width: 100%;
796
+ flex-wrap: wrap;
495
797
  display: inline-flex;
798
+ align-items: center;
496
799
  gap: 4px;
497
- padding: 13px 14px;
800
+ padding: 10px 13px;
801
+ min-width: 98px;
802
+ }
803
+ .cf-typing__label {
804
+ min-width: 0;
805
+ overflow-wrap: anywhere;
806
+ margin-right: 3px;
807
+ color: var(--cf-muted);
808
+ font-size: 12px;
809
+ font-weight: 650;
498
810
  }
499
811
  .cf-typing__dot {
500
- width: 7px;
501
- height: 7px;
812
+ width: 5px;
813
+ height: 5px;
502
814
  border-radius: 50%;
503
815
  background: var(--cf-muted);
504
816
  animation: cf-typing 1.1s infinite ease-in-out;
@@ -565,7 +877,7 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
565
877
  background: var(--cf-surface);
566
878
  border: 1px solid var(--cf-border);
567
879
  color: var(--cf-text);
568
- font-size: 13.5px;
880
+ font-size: 12.8px;
569
881
  font-weight: 600;
570
882
  transition: border-color 0.15s ease, transform 0.1s ease;
571
883
  }
@@ -756,6 +1068,13 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
756
1068
  border-top: 1px solid var(--cf-border);
757
1069
  background: var(--cf-bg);
758
1070
  }
1071
+ .cf-live-typing {
1072
+ flex-shrink: 0;
1073
+ padding: 8px 14px 0;
1074
+ color: var(--cf-muted);
1075
+ font-size: 12px;
1076
+ background: var(--cf-bg);
1077
+ }
759
1078
  .cf-composer__field {
760
1079
  display: flex;
761
1080
  align-items: flex-end;
@@ -767,6 +1086,23 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
767
1086
  transition: border-color 0.15s ease;
768
1087
  }
769
1088
  .cf-composer__field:focus-within { border-color: var(--cf-accent); }
1089
+ .cf-voice-state {
1090
+ display: inline-flex;
1091
+ align-items: center;
1092
+ gap: 8px;
1093
+ margin: 0 0 8px 2px;
1094
+ color: var(--cf-muted);
1095
+ font-size: 12.5px;
1096
+ }
1097
+ .cf-voice-state__dot {
1098
+ width: 8px;
1099
+ height: 8px;
1100
+ border-radius: 999px;
1101
+ background: var(--cf-accent);
1102
+ }
1103
+ .cf-voice-state__dot.is-live {
1104
+ animation: cf-pulse 1s infinite;
1105
+ }
770
1106
  .cf-textarea {
771
1107
  flex: 1;
772
1108
  border: none;
@@ -899,255 +1235,2043 @@ let e=require(`preact`),t=require(`preact/hooks`),n=require(`preact/jsx-runtime`
899
1235
  .cf-footer a { color: var(--cf-muted); text-decoration: none; font-weight: 600; }
900
1236
  .cf-footer a:hover { color: var(--cf-accent); }
901
1237
 
902
- /* ---------- Welcome intro (token branding) ---------- */
903
- .cf-welcome { text-align: center; padding: 2px 14px 4px; }
904
- .cf-welcome__desc { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--cf-text); }
905
- .cf-welcome__sub { margin: 0; font-size: 12.5px; color: var(--cf-muted); }
906
-
907
- /* Offline presence dot (amber instead of green). */
908
- .cf-header__status--offline::before { background: #e2c07e; box-shadow: 0 0 0 2px rgba(226, 192, 126, 0.3); }
909
-
910
- /* Disclaimer fine-print under the composer. */
911
- .cf-disclaimer { padding: 0 16px 2px; font-size: 10.5px; line-height: 1.45; color: var(--cf-muted); text-align: center; }
912
-
913
- /* Read-only banner shown while viewing a past conversation. */
914
- .cf-viewing-banner {
915
- padding: 7px 16px;
916
- font-size: 12px;
917
- font-weight: 600;
918
- text-align: center;
919
- color: var(--cf-muted);
920
- background: var(--cf-surface);
921
- border-bottom: 1px solid var(--cf-border);
1238
+ /* ---------- Footer lead actions ---------- */
1239
+ .cf-footer-actions {
922
1240
  flex-shrink: 0;
923
- }
924
-
925
- /* Past-conversations history panel (over the chat, like the confirm dialog). */
926
- .cf-history {
927
- width: min(340px, 90%);
928
- max-height: 70%;
929
- display: flex;
930
- flex-direction: column;
1241
+ padding: 6px 14px 5px;
931
1242
  background: var(--cf-bg);
932
- border-radius: 14px;
933
- box-shadow: var(--cf-shadow);
934
- overflow: hidden;
1243
+ border-top: 1px solid var(--cf-border);
935
1244
  }
936
- .cf-history__head {
937
- display: flex;
1245
+ .cf-action-trigger {
1246
+ display: grid;
1247
+ grid-template-columns: 28px minmax(0, 1fr) 16px;
938
1248
  align-items: center;
939
- justify-content: space-between;
940
- padding: 12px 14px;
941
- font-size: 14px;
942
- font-weight: 700;
943
- color: var(--cf-text);
944
- border-bottom: 1px solid var(--cf-border);
945
- }
946
- .cf-history__list { overflow-y: auto; padding: 6px; }
947
- .cf-history__item {
948
- display: flex;
949
- flex-direction: column;
950
- gap: 2px;
1249
+ gap: 8px;
951
1250
  width: 100%;
1251
+ min-height: 40px;
1252
+ border: 1px solid color-mix(in oklab, var(--cf-border) 86%, var(--cf-accent));
1253
+ border-radius: 14px;
1254
+ padding: 6px 9px;
1255
+ background:
1256
+ radial-gradient(circle at 15% 0%, color-mix(in oklab, var(--cf-accent) 15%, transparent), transparent 40%),
1257
+ color-mix(in oklab, var(--cf-bg-soft) 78%, transparent);
1258
+ color: var(--cf-text);
952
1259
  text-align: left;
953
- padding: 9px 10px;
954
- border-radius: 9px;
955
1260
  cursor: pointer;
956
- transition: background 0.15s ease;
1261
+ box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
957
1262
  }
958
- .cf-history__item:hover { background: var(--cf-surface); }
959
- .cf-history__item.is-active { background: var(--cf-surface); }
960
- .cf-history__title { font-size: 13px; color: var(--cf-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
961
- .cf-history__meta { font-size: 11px; color: var(--cf-muted); }
962
-
963
- /* Ended-conversation bar โ€” replaces the composer once the chat is closed. */
964
- .cf-ended {
965
- display: flex;
966
- flex-direction: column;
967
- align-items: center;
968
- gap: 10px;
969
- padding: 14px 16px 16px;
970
- flex-shrink: 0;
971
- text-align: center;
1263
+ .cf-action-trigger:hover {
1264
+ border-color: color-mix(in oklab, var(--cf-accent) 46%, var(--cf-border));
972
1265
  }
973
- .cf-ended__text { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--cf-muted); }
974
- .cf-csat { display: inline-flex; align-items: center; gap: 8px; }
975
- .cf-csat__q { font-size: 12.5px; color: var(--cf-muted); }
976
- .cf-csat__btn {
1266
+ .cf-action-trigger > svg {
1267
+ width: 14px;
1268
+ height: 14px;
1269
+ color: var(--cf-muted);
1270
+ }
1271
+ .cf-action-trigger__icon {
977
1272
  display: inline-flex;
978
1273
  align-items: center;
979
1274
  justify-content: center;
980
- width: 30px;
981
- height: 30px;
982
- border-radius: 8px;
1275
+ width: 28px;
1276
+ height: 28px;
1277
+ border-radius: 10px;
1278
+ background: color-mix(in oklab, var(--cf-accent) 15%, transparent);
1279
+ color: var(--cf-accent);
1280
+ }
1281
+ .cf-action-trigger__icon svg { width: 14px; height: 14px; }
1282
+ .cf-action-trigger__copy {
1283
+ display: grid;
1284
+ gap: 1px;
1285
+ min-width: 0;
1286
+ }
1287
+ .cf-action-trigger__copy strong {
1288
+ font-size: 12px;
1289
+ line-height: 1.1;
1290
+ }
1291
+ .cf-action-trigger__copy small {
1292
+ overflow: hidden;
983
1293
  color: var(--cf-muted);
984
- cursor: pointer;
985
- transition: background 0.15s ease, color 0.15s ease;
1294
+ font-size: 10.5px;
1295
+ line-height: 1.2;
1296
+ text-overflow: ellipsis;
1297
+ white-space: nowrap;
986
1298
  }
987
- .cf-csat__btn:hover { background: var(--cf-surface); color: var(--cf-accent); }
988
- .cf-csat__btn svg { width: 16px; height: 16px; }
989
- .cf-ended__btn {
990
- font-size: 13px;
991
- font-weight: 600;
992
- color: var(--cf-accent-ink);
993
- background: var(--cf-accent);
994
- border: none;
1299
+ .cf-action-drawer {
1300
+ border: 1px solid color-mix(in oklab, var(--cf-border) 86%, var(--cf-accent));
1301
+ border-radius: 18px 18px 12px 12px;
1302
+ padding: 7px;
1303
+ background:
1304
+ radial-gradient(circle at 18% 0%, color-mix(in oklab, var(--cf-accent) 16%, transparent), transparent 38%),
1305
+ color-mix(in oklab, var(--cf-bg) 94%, #ffffff);
1306
+ box-shadow: 0 -10px 34px rgba(15, 23, 42, 0.14);
1307
+ animation: cf-drawer-up 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
1308
+ }
1309
+ .cf-action-drawer__handle {
1310
+ width: 36px;
1311
+ height: 3px;
1312
+ margin: 0 auto 6px;
995
1313
  border-radius: 999px;
996
- padding: 9px 18px;
997
- cursor: pointer;
998
- transition: opacity 0.15s ease;
1314
+ background: color-mix(in oklab, var(--cf-muted) 42%, transparent);
999
1315
  }
1000
- .cf-ended__btn:hover { opacity: 0.9; }
1001
- .cf-ended__btn:focus-visible { outline: 2px solid var(--cf-accent); outline-offset: 2px; }
1002
-
1003
- /* "โ†“ New messages" pill โ€” shown when a reply streams in while scrolled up. */
1004
- .cf-newmsg {
1005
- /* Sticky inside the scroll body: pins to the bottom of the visible thread,
1006
- just above the composer (never overlapping it). Horizontal centering via
1007
- align-self so it doesn't fight the entrance animation's transform. */
1008
- position: sticky;
1009
- bottom: 10px;
1010
- align-self: center;
1011
- z-index: 3;
1012
- pointer-events: auto;
1316
+ .cf-action-drawer__head {
1317
+ display: flex;
1318
+ align-items: center;
1319
+ justify-content: space-between;
1320
+ gap: 10px;
1321
+ padding: 0 3px 6px;
1322
+ color: var(--cf-text);
1323
+ }
1324
+ .cf-action-drawer__head strong {
1325
+ display: block;
1326
+ font-size: 13px;
1327
+ line-height: 1.2;
1328
+ }
1329
+ .cf-action-drawer__eyebrow {
1330
+ display: block;
1331
+ margin-bottom: 2px;
1332
+ font-size: 9px;
1333
+ font-weight: 800;
1334
+ letter-spacing: 0.16em;
1335
+ text-transform: uppercase;
1336
+ color: var(--cf-muted);
1337
+ }
1338
+ .cf-action-drawer__close {
1013
1339
  display: inline-flex;
1014
1340
  align-items: center;
1015
- gap: 6px;
1016
- font-size: 12.5px;
1017
- font-weight: 600;
1018
- color: var(--cf-accent-ink);
1019
- background: linear-gradient(135deg, var(--cf-accent, #2f7f55) 0%, var(--cf-accent-2, #2f7de8) 160%);
1341
+ justify-content: center;
1342
+ width: 28px;
1343
+ height: 28px;
1344
+ border: 1px solid var(--cf-border);
1020
1345
  border-radius: 999px;
1021
- padding: 7px 14px;
1022
- box-shadow: var(--cf-shadow);
1023
- animation: cf-msg-in 0.2s ease both;
1346
+ background: var(--cf-bg-soft);
1347
+ color: var(--cf-muted);
1348
+ cursor: pointer;
1024
1349
  }
1025
- .cf-newmsg svg { width: 14px; height: 14px; }
1026
-
1027
- /* ---------- Clear-chat confirm dialog (in-widget, replaces window.confirm) ---------- */
1028
- .cf-confirm {
1029
- position: absolute;
1030
- inset: 0;
1031
- z-index: 6;
1032
- pointer-events: auto;
1350
+ .cf-action-drawer__close svg { width: 14px; height: 14px; }
1351
+ .cf-action-drawer__grid {
1033
1352
  display: grid;
1034
- place-items: center;
1035
- padding: 22px;
1036
- background: color-mix(in oklab, var(--cf-bg) 62%, transparent);
1037
- backdrop-filter: blur(2px);
1038
- animation: cf-fade-in 0.14s ease both;
1353
+ gap: 6px;
1039
1354
  }
1040
- .cf-confirm__card {
1355
+ .cf-action-card {
1356
+ display: grid;
1357
+ grid-template-columns: 30px minmax(0, 1fr) 14px;
1358
+ align-items: center;
1359
+ gap: 8px;
1041
1360
  width: 100%;
1042
- max-width: 300px;
1043
- background: var(--cf-bg);
1044
1361
  border: 1px solid var(--cf-border);
1045
- border-radius: 16px;
1046
- box-shadow: var(--cf-shadow);
1047
- padding: 18px;
1048
- text-align: center;
1049
- animation: cf-msg-in 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
1362
+ border-radius: 14px;
1363
+ padding: 7px 8px;
1364
+ background: color-mix(in oklab, var(--cf-bg-soft) 72%, transparent);
1365
+ color: var(--cf-text);
1366
+ text-align: left;
1367
+ cursor: pointer;
1368
+ transition:
1369
+ transform 0.16s ease,
1370
+ border-color 0.16s ease,
1371
+ background 0.16s ease;
1372
+ }
1373
+ .cf-action-card:hover {
1374
+ border-color: color-mix(in oklab, var(--cf-accent) 44%, var(--cf-border));
1375
+ background: color-mix(in oklab, var(--cf-accent) 9%, var(--cf-bg-soft));
1376
+ }
1377
+ .cf-action-card:active { transform: translateY(1px); }
1378
+ .cf-action-card > svg {
1379
+ width: 13px;
1380
+ height: 13px;
1381
+ color: var(--cf-muted);
1382
+ transform: rotate(-90deg);
1050
1383
  }
1051
- .cf-confirm__title { font-size: 15px; font-weight: 700; color: var(--cf-text); }
1052
- .cf-confirm__body { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--cf-muted); }
1053
- .cf-confirm__actions { margin-top: 16px; display: flex; gap: 8px; justify-content: center; }
1054
- .cf-confirm__btn {
1055
- padding: 9px 16px;
1384
+ .cf-action-card__icon {
1385
+ display: inline-flex;
1386
+ align-items: center;
1387
+ justify-content: center;
1388
+ width: 30px;
1389
+ height: 30px;
1056
1390
  border-radius: 10px;
1057
- font-size: 13.5px;
1058
- font-weight: 600;
1059
- transition: transform 0.1s ease, opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
1391
+ background: color-mix(in oklab, var(--cf-accent) 14%, transparent);
1392
+ color: var(--cf-accent);
1060
1393
  }
1061
- .cf-confirm__btn:active { transform: scale(0.97); }
1062
- .cf-confirm__btn:focus-visible { outline: 2px solid var(--cf-accent-2); outline-offset: 2px; }
1063
- .cf-confirm__btn--cancel { background: var(--cf-surface); color: var(--cf-text); border: 1px solid var(--cf-border); }
1064
- .cf-confirm__btn--cancel:hover { border-color: var(--cf-accent); }
1065
- .cf-confirm__btn--danger { background: #f25767; color: #fff; }
1066
- .cf-confirm__btn--danger:hover { opacity: 0.9; }
1067
-
1068
- /* Visually-hidden live region (announces the final answer only). */
1069
- .cf-sr-live {
1070
- position: absolute;
1071
- width: 1px;
1072
- height: 1px;
1073
- padding: 0;
1074
- margin: -1px;
1394
+ .cf-action-card__icon svg { width: 14px; height: 14px; }
1395
+ .cf-action-card__copy {
1396
+ display: grid;
1397
+ gap: 2px;
1398
+ min-width: 0;
1399
+ }
1400
+ .cf-action-card__copy strong {
1401
+ font-size: 12px;
1402
+ line-height: 1.2;
1403
+ }
1404
+ .cf-action-card__copy small {
1075
1405
  overflow: hidden;
1076
- clip: rect(0 0 0 0);
1406
+ color: var(--cf-muted);
1407
+ font-size: 10.5px;
1408
+ line-height: 1.25;
1409
+ text-overflow: ellipsis;
1077
1410
  white-space: nowrap;
1411
+ }
1412
+ .cf-action-drawer__note {
1413
+ margin: 6px 3px 0;
1414
+ color: var(--cf-muted);
1415
+ font-size: 10px;
1416
+ line-height: 1.25;
1417
+ }
1418
+ .cf-action-drawer .cf-form,
1419
+ .cf-action-drawer .cf-booking {
1420
+ max-width: none;
1421
+ margin: 0;
1078
1422
  border: 0;
1423
+ background: transparent;
1424
+ box-shadow: none;
1425
+ }
1426
+ .cf-footer-actions .cf-actions {
1427
+ display: grid;
1428
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1429
+ gap: 7px;
1430
+ }
1431
+ .cf-footer-actions .cf-action {
1432
+ justify-content: center;
1433
+ min-width: 0;
1434
+ gap: 5px;
1435
+ min-height: 32px;
1436
+ border-radius: 11px;
1437
+ padding: 6px 8px;
1438
+ font-size: 12px;
1439
+ line-height: 1.15;
1440
+ font-weight: 650;
1441
+ }
1442
+ .cf-footer-actions .cf-action svg {
1443
+ width: 13px;
1444
+ height: 13px;
1445
+ }
1446
+ .cf-footer-actions .cf-form,
1447
+ .cf-footer-actions .cf-booking {
1448
+ max-width: none;
1079
1449
  }
1080
1450
 
1081
- /* ---------- Attachments ---------- */
1082
- .cf-file-input { display: none; }
1083
- .cf-iconbtn:disabled { opacity: 0.4; cursor: default; }
1084
- .cf-attach-row { padding: 0 4px 8px; }
1085
- .cf-attach-status { font-size: 12px; color: var(--cf-muted); }
1086
- .cf-attach-status--err { color: #f25767; }
1087
- .cf-attach-chip {
1451
+ @keyframes cf-drawer-up {
1452
+ from {
1453
+ opacity: 0;
1454
+ transform: translateY(14px) scale(0.98);
1455
+ }
1456
+ to {
1457
+ opacity: 1;
1458
+ transform: translateY(0) scale(1);
1459
+ }
1460
+ }
1461
+
1462
+ /* ---------- Assistant card module ---------- */
1463
+ .cf-assistant-card {
1464
+ display: flex;
1465
+ flex-direction: column;
1466
+ gap: 12px;
1467
+ margin: 0 2px 4px;
1468
+ animation: cf-msg-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
1469
+ }
1470
+ .cf-assistant-card--pinned {
1471
+ flex-shrink: 0;
1472
+ gap: 0;
1473
+ margin: 0;
1474
+ padding: 8px 14px 10px;
1475
+ border-bottom: 1px solid var(--cf-border);
1476
+ background: var(--cf-bg);
1477
+ }
1478
+ .cf-assistant-card--compact {
1479
+ align-items: flex-start;
1480
+ padding-top: 10px;
1481
+ padding-bottom: 12px;
1482
+ }
1483
+ .cf-assistant-card__compact-speak {
1484
+ position: relative;
1485
+ isolation: isolate;
1088
1486
  display: inline-flex;
1089
1487
  align-items: center;
1090
- gap: 6px;
1488
+ gap: 8px;
1091
1489
  max-width: 100%;
1092
- padding: 5px 6px 5px 10px;
1490
+ min-height: 44px;
1491
+ padding: 5px 15px 5px 6px;
1093
1492
  border-radius: 999px;
1094
- background: var(--cf-surface-2);
1095
- border: 1px solid var(--cf-border);
1493
+ background:
1494
+ linear-gradient(180deg, color-mix(in oklab, var(--cf-accent) 13%, var(--cf-surface)), color-mix(in oklab, var(--cf-bg) 92%, var(--cf-surface))),
1495
+ var(--cf-bg);
1496
+ border: 1px solid color-mix(in oklab, var(--cf-accent) 58%, var(--cf-border));
1096
1497
  color: var(--cf-text);
1097
- font-size: 12px;
1498
+ box-shadow:
1499
+ inset 0 1px 0 color-mix(in oklab, #fff 13%, transparent),
1500
+ 0 13px 30px -22px color-mix(in oklab, var(--cf-accent) 60%, #000);
1501
+ font-size: 12.25px;
1502
+ font-weight: 750;
1503
+ line-height: 1;
1504
+ transition: border-color 0.15s ease, transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
1505
+ overflow: hidden;
1098
1506
  }
1099
- .cf-attach-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1100
- .cf-attach-chip svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--cf-muted); }
1101
- .cf-attach-x { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--cf-muted); flex-shrink: 0; }
1102
- .cf-attach-x:hover { background: var(--cf-surface); color: var(--cf-text); }
1103
- .cf-attach-x svg { width: 11px; height: 11px; }
1104
-
1105
- /* ---------- Mobile: full-screen panel ---------- */
1106
- @media (max-width: 480px) {
1107
- .cf-panel {
1108
- bottom: 0;
1109
- right: 0;
1110
- width: 100vw;
1111
- max-width: 100vw;
1112
- height: 100dvh;
1113
- max-height: 100dvh;
1114
- border-radius: 0;
1115
- }
1116
- .cf-launcher { bottom: 16px; right: 16px; }
1507
+ .cf-assistant-card__compact-speak::before {
1508
+ content: '';
1509
+ position: absolute;
1510
+ inset: 1px;
1511
+ z-index: -1;
1512
+ border-radius: inherit;
1513
+ background:
1514
+ radial-gradient(circle at 20% 10%, color-mix(in oklab, var(--cf-accent) 28%, transparent), transparent 42%),
1515
+ radial-gradient(circle at 85% 100%, color-mix(in oklab, var(--cf-accent-2) 18%, transparent), transparent 38%);
1516
+ opacity: 0.76;
1517
+ pointer-events: none;
1117
1518
  }
1118
-
1119
- /* ---------- Keyframes ---------- */
1120
- @keyframes cf-pop {
1121
- from { transform: scale(0); opacity: 0; }
1122
- to { transform: scale(1); opacity: 1; }
1519
+ .cf-assistant-card__compact-speak:hover {
1520
+ border-color: color-mix(in oklab, var(--cf-accent) 82%, var(--cf-border));
1521
+ box-shadow:
1522
+ inset 0 1px 0 color-mix(in oklab, #fff 15%, transparent),
1523
+ 0 16px 34px -22px color-mix(in oklab, var(--cf-accent) 76%, #000);
1524
+ }
1525
+ .cf-assistant-card__compact-speak:active { transform: scale(0.98); }
1526
+ .cf-assistant-card__compact-speak:focus-visible {
1527
+ outline: 2px solid var(--cf-accent-2);
1528
+ outline-offset: 2px;
1529
+ }
1530
+ .cf-assistant-card__compact-mic {
1531
+ width: 24px;
1532
+ height: 24px;
1533
+ margin-left: -14px;
1534
+ border-radius: 999px;
1535
+ display: inline-flex;
1536
+ align-items: center;
1537
+ justify-content: center;
1538
+ flex-shrink: 0;
1539
+ color: var(--cf-accent);
1540
+ background: color-mix(in oklab, var(--cf-bg) 90%, transparent);
1541
+ border: 1px solid color-mix(in oklab, var(--cf-accent) 48%, var(--cf-border));
1542
+ box-shadow: 0 7px 18px -12px rgba(0, 0, 0, 0.75);
1123
1543
  }
1124
- @keyframes cf-badge-pop {
1125
- from { transform: scale(0); }
1126
- to { transform: scale(1); }
1544
+ .cf-assistant-card__compact-mic svg {
1545
+ width: 13px;
1546
+ height: 13px;
1547
+ color: var(--cf-accent);
1548
+ flex-shrink: 0;
1127
1549
  }
1128
- @keyframes cf-msg-in {
1129
- from { opacity: 0; transform: translateY(8px); }
1130
- to { opacity: 1; transform: none; }
1550
+ .cf-assistant-card__compact-mic:first-child {
1551
+ margin-left: 0;
1131
1552
  }
1132
- @keyframes cf-fade-in {
1133
- from { opacity: 0; }
1134
- to { opacity: 1; }
1553
+ .cf-assistant-card__compact-label {
1554
+ min-width: 0;
1555
+ overflow: hidden;
1556
+ text-overflow: ellipsis;
1557
+ white-space: nowrap;
1558
+ letter-spacing: 0.01em;
1135
1559
  }
1136
- @keyframes cf-typing {
1137
- 0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
1138
- 40% { opacity: 1; transform: translateY(-4px); }
1560
+ .cf-assistant-card__compact-avatar {
1561
+ width: 34px;
1562
+ height: 34px;
1563
+ border-radius: 999px;
1564
+ display: grid;
1565
+ place-items: center;
1566
+ flex-shrink: 0;
1567
+ overflow: hidden;
1568
+ color: #fff;
1569
+ background: linear-gradient(135deg, var(--cf-avatar-a, var(--cf-accent)), var(--cf-avatar-b, var(--cf-accent-2)));
1570
+ border: 1px solid color-mix(in oklab, #fff 24%, transparent);
1571
+ box-shadow:
1572
+ 0 0 0 3px color-mix(in oklab, var(--cf-accent) 16%, transparent),
1573
+ inset 0 1px 0 color-mix(in oklab, #fff 18%, transparent);
1574
+ font-size: 11px;
1575
+ font-weight: 800;
1139
1576
  }
1140
- @keyframes cf-pulse {
1141
- 0%, 100% { opacity: 1; }
1142
- 50% { opacity: 0.4; }
1577
+ .cf-assistant-card__compact-avatar img {
1578
+ width: 100%;
1579
+ height: 100%;
1580
+ object-fit: cover;
1143
1581
  }
1144
-
1145
- @media (prefers-reduced-motion: reduce) {
1146
- .cf-root *, .cf-root *::before, .cf-root *::after {
1147
- animation-duration: 0.01ms !important;
1148
- animation-iteration-count: 1 !important;
1149
- transition-duration: 0.01ms !important;
1150
- scroll-behavior: auto !important;
1582
+ .cf-assistant-card--pinned .cf-assistant-card__stage {
1583
+ height: 132px;
1584
+ min-height: 0;
1585
+ border-radius: 13px;
1586
+ }
1587
+ /* The stage sizes/positions the card's video area; .cf-assistant-card__media
1588
+ inside it stays overflow: hidden for the rounded image/video corners,
1589
+ while interactive controls sit as a stage sibling so their popovers
1590
+ aren't clipped by it. */
1591
+ .cf-assistant-card__stage {
1592
+ position: relative;
1593
+ border-radius: 12px;
1594
+ aspect-ratio: 16 / 9;
1595
+ }
1596
+ .cf-assistant-card__voice-only {
1597
+ position: relative;
1598
+ display: flex;
1599
+ align-items: center;
1600
+ justify-content: center;
1601
+ width: 100%;
1602
+ min-height: 44px;
1603
+ align-self: stretch;
1604
+ }
1605
+ .cf-assistant-card__media {
1606
+ position: absolute;
1607
+ inset: 0;
1608
+ overflow: hidden;
1609
+ border-radius: inherit;
1610
+ background: var(--cf-surface);
1611
+ border: 1px solid var(--cf-border);
1612
+ }
1613
+ .cf-assistant-card__stage--local {
1614
+ isolation: isolate;
1615
+ overflow: hidden;
1616
+ background:
1617
+ radial-gradient(circle at 30% 18%, color-mix(in oklab, var(--cf-accent) 18%, transparent), transparent 36%),
1618
+ linear-gradient(145deg, color-mix(in oklab, var(--cf-surface) 72%, var(--cf-bg)), var(--cf-bg));
1619
+ border: 1px solid color-mix(in oklab, var(--cf-border) 82%, var(--cf-accent));
1620
+ box-shadow:
1621
+ inset 0 1px 0 color-mix(in oklab, #fff 9%, transparent),
1622
+ 0 22px 44px -34px color-mix(in oklab, var(--cf-accent) 46%, #000);
1623
+ }
1624
+ .cf-assistant-card__stage--local.is-live {
1625
+ height: 188px;
1626
+ aspect-ratio: auto;
1627
+ }
1628
+ .cf-assistant-card--pinned .cf-assistant-card__stage--local.is-live {
1629
+ height: 154px;
1630
+ }
1631
+ .cf-assistant-card__stage--local.is-speaking {
1632
+ box-shadow:
1633
+ inset 0 1px 0 color-mix(in oklab, #fff 11%, transparent),
1634
+ 0 20px 54px -28px color-mix(in oklab, var(--cf-accent) 72%, #000);
1635
+ }
1636
+ .cf-assistant-card__stage--local.is-listening {
1637
+ border-color: color-mix(in oklab, var(--cf-accent) 62%, var(--cf-border));
1638
+ }
1639
+ .cf-assistant-card__stage--local.is-muted {
1640
+ filter: saturate(0.72);
1641
+ }
1642
+ .cf-assistant-card__stage--local .cf-assistant-card__media {
1643
+ z-index: 1;
1644
+ border: 0;
1645
+ background:
1646
+ radial-gradient(circle at 50% 42%, color-mix(in oklab, var(--cf-accent) 18%, transparent), transparent 38%),
1647
+ color-mix(in oklab, var(--cf-bg) 92%, var(--cf-surface));
1648
+ }
1649
+ .cf-assistant-card__media--uploaded::after {
1650
+ content: '';
1651
+ position: absolute;
1652
+ inset: 0;
1653
+ pointer-events: none;
1654
+ background:
1655
+ radial-gradient(circle at 50% 50%, transparent 28%, rgba(2, 6, 23, 0.08) 62%, rgba(2, 6, 23, 0.34) 100%),
1656
+ linear-gradient(180deg, transparent 52%, rgba(2, 6, 23, 0.26));
1657
+ }
1658
+ .cf-assistant-card__media img,
1659
+ .cf-assistant-card__media video {
1660
+ width: 100%;
1661
+ height: 100%;
1662
+ display: block;
1663
+ object-fit: cover;
1664
+ }
1665
+ .cf-avatar-aura {
1666
+ position: absolute;
1667
+ left: 50%;
1668
+ top: 50%;
1669
+ width: 104px;
1670
+ height: 104px;
1671
+ border-radius: 999px;
1672
+ transform: translate(-50%, -50%) scale(0.88);
1673
+ border: 1px solid color-mix(in oklab, var(--cf-accent) 42%, transparent);
1674
+ opacity: 0;
1675
+ pointer-events: none;
1676
+ z-index: 3;
1677
+ }
1678
+ .cf-avatar-aura--two {
1679
+ width: 142px;
1680
+ height: 142px;
1681
+ }
1682
+ .cf-assistant-card__stage--local.is-speaking .cf-avatar-aura--one {
1683
+ animation: cf-avatar-breathe 1.35s ease-in-out infinite;
1684
+ }
1685
+ .cf-assistant-card__stage--local.is-speaking .cf-avatar-aura--two {
1686
+ animation: cf-avatar-breathe 1.35s ease-in-out infinite 0.32s;
1687
+ }
1688
+ .cf-avatar-listen-ring {
1689
+ position: absolute;
1690
+ left: 50%;
1691
+ top: 50%;
1692
+ width: calc(112px + (var(--cf-listen, 0.2) * 42px));
1693
+ height: calc(112px + (var(--cf-listen, 0.2) * 42px));
1694
+ border-radius: 999px;
1695
+ transform: translate(-50%, -50%);
1696
+ border: 2px solid color-mix(in oklab, var(--cf-accent) 58%, transparent);
1697
+ box-shadow: 0 0 calc(14px + (var(--cf-listen, 0.2) * 24px)) color-mix(in oklab, var(--cf-accent) 34%, transparent);
1698
+ opacity: 0;
1699
+ pointer-events: none;
1700
+ z-index: 4;
1701
+ }
1702
+ .cf-assistant-card__stage--local.is-listening .cf-avatar-listen-ring {
1703
+ opacity: calc(0.36 + (var(--cf-listen, 0.2) * 0.42));
1704
+ }
1705
+ .cf-avatar-wave {
1706
+ position: absolute;
1707
+ left: 50%;
1708
+ bottom: 46px;
1709
+ z-index: 6;
1710
+ display: inline-flex;
1711
+ align-items: center;
1712
+ justify-content: center;
1713
+ gap: 4px;
1714
+ min-width: 58px;
1715
+ height: 25px;
1716
+ padding: 5px 8px;
1717
+ border-radius: 999px;
1718
+ transform: translateX(-50%) translateY(8px);
1719
+ background: color-mix(in oklab, var(--cf-bg) 82%, transparent);
1720
+ border: 1px solid color-mix(in oklab, var(--cf-accent) 36%, transparent);
1721
+ opacity: 0;
1722
+ pointer-events: none;
1723
+ backdrop-filter: blur(10px);
1724
+ }
1725
+ .cf-avatar-wave span {
1726
+ width: 4px;
1727
+ height: 8px;
1728
+ border-radius: 999px;
1729
+ background: color-mix(in oklab, var(--cf-accent) 88%, #fff);
1730
+ transform-origin: center;
1731
+ }
1732
+ .cf-assistant-card__stage--local.is-speaking .cf-avatar-wave {
1733
+ opacity: 1;
1734
+ transform: translateX(-50%) translateY(0);
1735
+ }
1736
+ .cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span {
1737
+ animation: cf-avatar-wave 0.58s ease-in-out infinite;
1738
+ }
1739
+ .cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span:nth-child(2) { animation-delay: 0.1s; }
1740
+ .cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span:nth-child(3) { animation-delay: 0.2s; }
1741
+ .cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span:nth-child(4) { animation-delay: 0.3s; }
1742
+ .cf-assistant-card__stage--local.is-thinking .cf-assistant-card__media::before {
1743
+ content: '';
1744
+ position: absolute;
1745
+ inset: -35%;
1746
+ z-index: 5;
1747
+ pointer-events: none;
1748
+ background: linear-gradient(115deg, transparent 42%, color-mix(in oklab, var(--cf-accent) 20%, transparent) 50%, transparent 58%);
1749
+ animation: cf-avatar-thinking 1.45s ease-in-out infinite;
1750
+ }
1751
+ .cf-assistant-card__avatar-stage {
1752
+ position: absolute;
1753
+ inset: 0;
1754
+ display: grid;
1755
+ place-items: center;
1756
+ --cf-avatar-a: var(--cf-accent);
1757
+ --cf-avatar-b: color-mix(in oklab, var(--cf-accent) 70%, #0f1f2e);
1758
+ --cf-avatar-glow: color-mix(in oklab, var(--cf-accent) 38%, transparent);
1759
+ background:
1760
+ radial-gradient(circle at 35% 30%, var(--cf-avatar-glow), transparent 32%),
1761
+ linear-gradient(145deg, color-mix(in oklab, var(--cf-avatar-a) 18%, var(--cf-bg)), var(--cf-surface-2));
1762
+ }
1763
+ .cf-assistant-card__face {
1764
+ position: relative;
1765
+ width: 128px;
1766
+ height: 128px;
1767
+ border-radius: 999px;
1768
+ display: grid;
1769
+ place-items: center;
1770
+ color: #fff;
1771
+ background: linear-gradient(145deg, var(--cf-avatar-a), var(--cf-avatar-b));
1772
+ box-shadow: 0 22px 44px -28px rgba(0, 0, 0, 0.75);
1773
+ z-index: 2;
1774
+ }
1775
+ .cf-assistant-card__stage--local.is-speaking .cf-assistant-card__face {
1776
+ animation: cf-avatar-nod 1.6s ease-in-out infinite;
1777
+ }
1778
+ .cf-assistant-card__stage--local.is-listening .cf-assistant-card__face {
1779
+ box-shadow:
1780
+ 0 22px 44px -28px rgba(0, 0, 0, 0.75),
1781
+ 0 0 0 calc(5px + (var(--cf-listen, 0.2) * 6px)) color-mix(in oklab, var(--cf-accent) 16%, transparent);
1782
+ }
1783
+ .cf-assistant-card--pinned .cf-assistant-card__face {
1784
+ width: 72px;
1785
+ height: 72px;
1786
+ }
1787
+ .cf-avatar-preset--support-guide {
1788
+ --cf-avatar-a: #10b981;
1789
+ --cf-avatar-b: #0f766e;
1790
+ --cf-avatar-glow: rgba(16, 185, 129, 0.34);
1791
+ }
1792
+ .cf-avatar-preset--sales-host {
1793
+ --cf-avatar-a: #3b82f6;
1794
+ --cf-avatar-b: #4338ca;
1795
+ --cf-avatar-glow: rgba(59, 130, 246, 0.34);
1796
+ }
1797
+ .cf-avatar-preset--calm-advisor {
1798
+ --cf-avatar-a: #64748b;
1799
+ --cf-avatar-b: #0f172a;
1800
+ --cf-avatar-glow: rgba(100, 116, 139, 0.34);
1801
+ }
1802
+ .cf-avatar-preset--technical-guide {
1803
+ --cf-avatar-a: #06b6d4;
1804
+ --cf-avatar-b: #1d4ed8;
1805
+ --cf-avatar-glow: rgba(6, 182, 212, 0.34);
1806
+ }
1807
+ .cf-avatar-preset--school-desk {
1808
+ --cf-avatar-a: #8b5cf6;
1809
+ --cf-avatar-b: #6d28d9;
1810
+ --cf-avatar-glow: rgba(139, 92, 246, 0.34);
1811
+ }
1812
+ .cf-avatar-preset--front-office {
1813
+ --cf-avatar-a: #f59e0b;
1814
+ --cf-avatar-b: #c2410c;
1815
+ --cf-avatar-glow: rgba(245, 158, 11, 0.34);
1816
+ }
1817
+ .cf-assistant-card__initials {
1818
+ transform: translateY(-12px);
1819
+ font-size: 34px;
1820
+ font-weight: 800;
1821
+ }
1822
+ .cf-assistant-card--pinned .cf-assistant-card__initials {
1823
+ transform: translateY(-6px);
1824
+ font-size: 19px;
1825
+ }
1826
+ .cf-assistant-card__eye {
1827
+ position: absolute;
1828
+ top: 58px;
1829
+ width: 8px;
1830
+ height: 8px;
1831
+ border-radius: 999px;
1832
+ background: rgba(255, 255, 255, 0.9);
1833
+ }
1834
+ .cf-assistant-card__eye--left { left: 42px; }
1835
+ .cf-assistant-card__eye--right { right: 42px; }
1836
+ .cf-assistant-card--pinned .cf-assistant-card__eye {
1837
+ top: 33px;
1838
+ width: 5px;
1839
+ height: 5px;
1840
+ }
1841
+ .cf-assistant-card--pinned .cf-assistant-card__eye--left { left: 23px; }
1842
+ .cf-assistant-card--pinned .cf-assistant-card__eye--right { right: 23px; }
1843
+ .cf-assistant-card__mouth {
1844
+ position: absolute;
1845
+ left: 50%;
1846
+ bottom: 31px;
1847
+ width: 34px;
1848
+ height: 6px;
1849
+ transform: translateX(-50%);
1850
+ border-radius: 999px;
1851
+ background: rgba(255, 255, 255, 0.9);
1852
+ }
1853
+ .cf-assistant-card--pinned .cf-assistant-card__mouth {
1854
+ bottom: 18px;
1855
+ width: 20px;
1856
+ height: 4px;
1857
+ }
1858
+ .cf-assistant-card.is-speaking .cf-assistant-card__mouth {
1859
+ animation: cf-mouth-talk 0.24s ease-in-out infinite alternate;
1860
+ }
1861
+ .cf-assistant-card__stage--local.is-speaking .cf-assistant-card__mouth {
1862
+ animation: cf-mouth-talk 0.24s ease-in-out infinite alternate;
1863
+ }
1864
+ .cf-assistant-card__mouth--overlay {
1865
+ z-index: 6;
1866
+ bottom: 39px;
1867
+ width: 42px;
1868
+ height: 7px;
1869
+ opacity: 0;
1870
+ background: color-mix(in oklab, #fff 90%, var(--cf-accent));
1871
+ box-shadow:
1872
+ 0 0 0 4px rgba(2, 6, 23, 0.22),
1873
+ 0 10px 22px -10px rgba(0, 0, 0, 0.85);
1874
+ }
1875
+ .cf-assistant-card__stage--local.is-speaking .cf-assistant-card__mouth--overlay {
1876
+ opacity: 1;
1877
+ }
1878
+ .cf-assistant-card--pinned .cf-assistant-card__mouth--overlay {
1879
+ bottom: 42px;
1880
+ }
1881
+ @keyframes cf-mouth-talk {
1882
+ from { height: 5px; width: 28px; border-radius: 999px; }
1883
+ to { height: 20px; width: 22px; border-radius: 45% 45% 55% 55%; }
1884
+ }
1885
+ @keyframes cf-avatar-breathe {
1886
+ 0%, 100% { opacity: 0.16; transform: translate(-50%, -50%) scale(0.82); }
1887
+ 50% { opacity: 0.58; transform: translate(-50%, -50%) scale(1.12); }
1888
+ }
1889
+ @keyframes cf-avatar-wave {
1890
+ 0%, 100% { transform: scaleY(0.62); opacity: 0.72; }
1891
+ 50% { transform: scaleY(1.85); opacity: 1; }
1892
+ }
1893
+ @keyframes cf-avatar-thinking {
1894
+ 0% { transform: translateX(-18%); opacity: 0; }
1895
+ 38% { opacity: 1; }
1896
+ 100% { transform: translateX(18%); opacity: 0; }
1897
+ }
1898
+ @keyframes cf-avatar-nod {
1899
+ 0%, 100% { transform: translateY(0) scale(1); }
1900
+ 45% { transform: translateY(-2px) scale(1.012); }
1901
+ }
1902
+ .cf-assistant-card__speak {
1903
+ position: absolute;
1904
+ left: 50%;
1905
+ bottom: 12px;
1906
+ transform: translateX(-50%);
1907
+ display: inline-flex;
1908
+ align-items: center;
1909
+ gap: 7px;
1910
+ max-width: calc(100% - 24px);
1911
+ padding: 8px 12px;
1912
+ border-radius: 999px;
1913
+ background: color-mix(in oklab, var(--cf-bg) 92%, transparent);
1914
+ color: var(--cf-accent);
1915
+ box-shadow: 0 10px 22px -14px rgba(15, 30, 42, 0.6);
1916
+ font-size: 12.5px;
1917
+ font-weight: 700;
1918
+ white-space: nowrap;
1919
+ }
1920
+ .cf-assistant-card--pinned .cf-assistant-card__speak {
1921
+ padding: 6px 10px;
1922
+ font-size: 11.5px;
1923
+ }
1924
+ .cf-assistant-card__speak svg { width: 15px; height: 15px; }
1925
+ .cf-assistant-card__voice-only .cf-assistant-card__speak,
1926
+ .cf-assistant-card__voice-only .cf-call-controls {
1927
+ position: static;
1928
+ transform: none;
1929
+ max-width: 100%;
1930
+ }
1931
+ .cf-assistant-card--connecting {
1932
+ min-height: 100%;
1933
+ display: grid;
1934
+ place-items: center;
1935
+ align-content: center;
1936
+ gap: 18px;
1937
+ padding: 34px 24px 42px;
1938
+ text-align: center;
1939
+ border-top: 1px solid var(--cf-border);
1940
+ background:
1941
+ radial-gradient(circle at 50% 38%, color-mix(in oklab, var(--cf-accent) 16%, transparent), transparent 36%),
1942
+ linear-gradient(180deg, color-mix(in oklab, var(--cf-surface) 72%, var(--cf-bg)), var(--cf-bg));
1943
+ }
1944
+ .cf-assistant-card__connecting-avatar {
1945
+ position: relative;
1946
+ width: 118px;
1947
+ height: 118px;
1948
+ display: grid;
1949
+ place-items: center;
1950
+ }
1951
+ .cf-assistant-card__connecting-avatar img,
1952
+ .cf-assistant-card__connecting-face {
1953
+ width: 92px;
1954
+ height: 92px;
1955
+ border-radius: 999px;
1956
+ display: grid;
1957
+ place-items: center;
1958
+ object-fit: cover;
1959
+ color: #fff;
1960
+ font-size: 28px;
1961
+ font-weight: 850;
1962
+ letter-spacing: -0.04em;
1963
+ background: linear-gradient(145deg, var(--cf-accent), var(--cf-accent-2));
1964
+ border: 1px solid color-mix(in oklab, #fff 30%, transparent);
1965
+ box-shadow:
1966
+ 0 22px 48px -24px color-mix(in oklab, var(--cf-accent) 60%, #000),
1967
+ 0 0 0 8px color-mix(in oklab, var(--cf-accent) 10%, transparent);
1968
+ z-index: 2;
1969
+ }
1970
+ .cf-assistant-card__connecting-copy {
1971
+ display: grid;
1972
+ gap: 6px;
1973
+ }
1974
+ .cf-assistant-card__connecting-eyebrow {
1975
+ color: var(--cf-muted);
1976
+ font-size: 11px;
1977
+ font-weight: 800;
1978
+ letter-spacing: 0.12em;
1979
+ text-transform: uppercase;
1980
+ }
1981
+ .cf-assistant-card__connecting-copy strong {
1982
+ color: var(--cf-text);
1983
+ font-size: 18px;
1984
+ line-height: 1.25;
1985
+ }
1986
+ .cf-assistant-card--connecting .cf-call-ripple {
1987
+ inset: -18px;
1988
+ border-radius: 999px;
1989
+ }
1990
+ .cf-assistant-card--connecting .cf-call-ripple span {
1991
+ width: 92px;
1992
+ height: 92px;
1993
+ }
1994
+
1995
+ /* ---------- Call "working" ripple ----------
1996
+ Concentric rings pulsing out from the avatar's center while the call is
1997
+ connecting / transcribing / waiting for the reply โ€” the classic "ringing
1998
+ call" cue, so busy moments read as live activity instead of a freeze. */
1999
+ .cf-call-ripple {
2000
+ position: absolute;
2001
+ inset: 0;
2002
+ display: grid;
2003
+ place-items: center;
2004
+ pointer-events: none;
2005
+ overflow: hidden;
2006
+ border-radius: inherit;
2007
+ }
2008
+ .cf-call-ripple span {
2009
+ position: absolute;
2010
+ width: 74px;
2011
+ height: 74px;
2012
+ border-radius: 999px;
2013
+ border: 2px solid var(--cf-accent);
2014
+ opacity: 0;
2015
+ animation: cf-call-ripple 1.8s ease-out infinite;
2016
+ }
2017
+ .cf-call-ripple span:nth-child(2) { animation-delay: 0.6s; }
2018
+ .cf-call-ripple span:nth-child(3) { animation-delay: 1.2s; }
2019
+ @keyframes cf-call-ripple {
2020
+ 0% { transform: scale(0.9); opacity: 0.55; }
2021
+ 100% { transform: scale(2.6); opacity: 0; }
2022
+ }
2023
+ @media (prefers-reduced-motion: reduce) {
2024
+ .cf-call-ripple span { animation: none; opacity: 0.25; transform: scale(1.4); }
2025
+ .cf-call-ripple span:nth-child(2), .cf-call-ripple span:nth-child(3) { display: none; }
2026
+ }
2027
+
2028
+ /* ---------- In-call controls (mic / audio picker / expand / minimize / end) ---------- */
2029
+ .cf-call-controls {
2030
+ position: absolute;
2031
+ left: 50%;
2032
+ bottom: 12px;
2033
+ transform: translateX(-50%);
2034
+ display: inline-flex;
2035
+ align-items: center;
2036
+ gap: 4px;
2037
+ max-width: calc(100% - 24px);
2038
+ padding: 5px 7px;
2039
+ border-radius: 999px;
2040
+ background: color-mix(in oklab, var(--cf-bg) 94%, transparent);
2041
+ border: 1px solid color-mix(in oklab, var(--cf-border) 72%, transparent);
2042
+ box-shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.7);
2043
+ z-index: 30;
2044
+ }
2045
+ .cf-assistant-card--pinned .cf-call-controls { padding: 4px 6px; gap: 4px; }
2046
+ .cf-call-btn {
2047
+ position: relative;
2048
+ flex-shrink: 0;
2049
+ width: 30px;
2050
+ height: 30px;
2051
+ border-radius: 999px;
2052
+ display: inline-flex;
2053
+ align-items: center;
2054
+ justify-content: center;
2055
+ gap: 6px;
2056
+ color: var(--cf-text);
2057
+ background: color-mix(in oklab, var(--cf-surface) 88%, transparent);
2058
+ border: 1px solid color-mix(in oklab, var(--cf-border) 76%, transparent);
2059
+ transition: background 0.15s ease, transform 0.12s ease, color 0.15s ease;
2060
+ }
2061
+ .cf-call-btn:hover { background: color-mix(in oklab, var(--cf-accent) 10%, var(--cf-surface)); }
2062
+ .cf-call-btn:active { transform: scale(0.94); }
2063
+ .cf-call-btn svg { width: 14px; height: 14px; }
2064
+ .cf-call-btn--microphones {
2065
+ width: 24px;
2066
+ margin-left: -5px;
2067
+ border-top-left-radius: 10px;
2068
+ border-bottom-left-radius: 10px;
2069
+ }
2070
+ .cf-call-btn--microphones svg { width: 13px; height: 13px; }
2071
+ .cf-call-btn--restore svg { width: 15px; height: 15px; }
2072
+ .cf-call-btn.is-muted {
2073
+ color: #fff;
2074
+ background: var(--cf-muted);
2075
+ border-color: transparent;
2076
+ }
2077
+ /* Live-listening cue: a soft ring around the mic button that breathes with
2078
+ the mic level, instead of a separate waveform element eating up row width. */
2079
+ .cf-call-btn.is-listening::after {
2080
+ content: '';
2081
+ position: absolute;
2082
+ inset: -4px;
2083
+ border-radius: inherit;
2084
+ border: 2px solid var(--cf-accent);
2085
+ opacity: calc(0.25 + var(--cf-wave, 0.2) * 0.5);
2086
+ transform: scale(calc(1 + var(--cf-wave, 0.2) * 0.22));
2087
+ transition: transform 0.09s ease, opacity 0.09s ease;
2088
+ pointer-events: none;
2089
+ }
2090
+ /* Your voice is actually registering: the mic fills with the accent color
2091
+ and the ring flares, so "it hears me" is unmistakable at a glance. */
2092
+ .cf-call-btn.is-listening.is-hot {
2093
+ color: var(--cf-accent-ink);
2094
+ background: var(--cf-accent);
2095
+ border-color: transparent;
2096
+ }
2097
+ .cf-call-btn.is-listening.is-hot::after {
2098
+ border-width: 3px;
2099
+ opacity: calc(0.5 + var(--cf-wave, 0.2) * 0.5);
2100
+ transform: scale(calc(1.08 + var(--cf-wave, 0.2) * 0.35));
2101
+ box-shadow: 0 0 12px 2px color-mix(in oklab, var(--cf-accent) 55%, transparent);
2102
+ }
2103
+ .cf-call-btn--talk {
2104
+ color: var(--cf-accent-ink);
2105
+ background: var(--cf-accent);
2106
+ border-color: transparent;
2107
+ }
2108
+ .cf-call-btn--end {
2109
+ color: #fff;
2110
+ background: #e5484d;
2111
+ border-color: transparent;
2112
+ }
2113
+ .cf-call-btn--end:hover { background: #dc3d42; }
2114
+ /* Microphone selector popover. */
2115
+ .cf-call-more { position: static; display: inline-flex; z-index: 40; }
2116
+ .cf-call-menu {
2117
+ position: absolute;
2118
+ top: calc(100% + 8px);
2119
+ bottom: auto;
2120
+ left: 50%;
2121
+ transform: translateX(-50%);
2122
+ display: flex;
2123
+ flex-direction: column;
2124
+ gap: 2px;
2125
+ width: min(240px, calc(var(--cf-panel-w, 388px) - 72px), calc(100vw - 64px));
2126
+ min-width: 0;
2127
+ max-width: calc(100vw - 64px);
2128
+ max-height: min(300px, calc(100vh - 220px));
2129
+ overflow-y: auto;
2130
+ padding: 8px;
2131
+ border-radius: 14px;
2132
+ background: color-mix(in oklab, var(--cf-bg) 98%, #000);
2133
+ border: 1px solid color-mix(in oklab, var(--cf-border) 74%, transparent);
2134
+ box-shadow: 0 18px 45px -20px rgba(0, 0, 0, 0.78);
2135
+ z-index: 60;
2136
+ }
2137
+ .cf-call-menu__label {
2138
+ margin: 8px 8px 4px;
2139
+ color: var(--cf-muted);
2140
+ font-size: 11px;
2141
+ font-weight: 700;
2142
+ text-transform: uppercase;
2143
+ letter-spacing: 0.08em;
2144
+ }
2145
+ .cf-call-menu__item {
2146
+ display: flex;
2147
+ align-items: center;
2148
+ gap: 8px;
2149
+ min-width: 0;
2150
+ padding: 8px 9px;
2151
+ border-radius: 10px;
2152
+ color: var(--cf-text);
2153
+ font-size: 12.5px;
2154
+ text-align: left;
2155
+ white-space: nowrap;
2156
+ overflow: hidden;
2157
+ }
2158
+ .cf-call-menu__item span:last-child {
2159
+ min-width: 0;
2160
+ overflow: hidden;
2161
+ text-overflow: ellipsis;
2162
+ }
2163
+ .cf-call-menu__item:hover { background: color-mix(in oklab, var(--cf-accent) 12%, var(--cf-surface)); }
2164
+ .cf-call-menu__item.is-active { color: var(--cf-accent); font-weight: 600; }
2165
+ .cf-call-menu__item svg { width: 13px; height: 13px; flex-shrink: 0; }
2166
+ .cf-call-menu__spacer { width: 13px; flex-shrink: 0; }
2167
+ /* Detached floating avatar card โ€” replaces the launcher while a call runs minimized. */
2168
+ .cf-floating-call-card {
2169
+ position: fixed;
2170
+ bottom: var(--cf-v-pad, 20px);
2171
+ right: var(--cf-h-pad, 20px);
2172
+ z-index: 1;
2173
+ pointer-events: auto;
2174
+ width: min(340px, calc(100vw - 32px));
2175
+ aspect-ratio: 16 / 9;
2176
+ overflow: hidden;
2177
+ border-radius: 14px;
2178
+ background: var(--cf-bg);
2179
+ border: 1px solid color-mix(in oklab, var(--cf-border) 74%, transparent);
2180
+ box-shadow: 0 20px 48px -20px rgba(0, 0, 0, 0.72);
2181
+ animation: cf-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
2182
+ }
2183
+ .cf-root[data-align='left'] .cf-floating-call-card { right: auto; left: var(--cf-h-pad, 20px); }
2184
+ .cf-floating-call-card__media,
2185
+ .cf-floating-call-card__shade {
2186
+ position: absolute;
2187
+ inset: 0;
2188
+ }
2189
+ .cf-floating-call-card__media img,
2190
+ .cf-floating-call-card__media video {
2191
+ width: 100%;
2192
+ height: 100%;
2193
+ object-fit: cover;
2194
+ }
2195
+ .cf-floating-call-card__shade {
2196
+ background:
2197
+ linear-gradient(to bottom, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.18)),
2198
+ radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.08), transparent 42%);
2199
+ pointer-events: none;
2200
+ }
2201
+ .cf-floating-call-card__avatar {
2202
+ position: absolute;
2203
+ inset: 0;
2204
+ display: flex;
2205
+ align-items: center;
2206
+ justify-content: center;
2207
+ color: #fff;
2208
+ background: linear-gradient(145deg, var(--cf-accent), var(--cf-accent-2));
2209
+ }
2210
+ .cf-floating-call-card.is-muted {
2211
+ filter: saturate(0.72);
2212
+ }
2213
+ .cf-floating-call-card.is-listening {
2214
+ border-color: color-mix(in oklab, var(--cf-accent) 62%, var(--cf-border));
2215
+ box-shadow:
2216
+ 0 20px 48px -20px rgba(0, 0, 0, 0.72),
2217
+ 0 0 calc(12px + (var(--cf-listen, 0.2) * 18px)) color-mix(in oklab, var(--cf-accent) 28%, transparent);
2218
+ }
2219
+ .cf-floating-call-card.is-thinking .cf-floating-call-card__shade::before {
2220
+ content: '';
2221
+ position: absolute;
2222
+ inset: -45%;
2223
+ background: linear-gradient(115deg, transparent 42%, color-mix(in oklab, var(--cf-accent) 22%, transparent) 50%, transparent 58%);
2224
+ animation: cf-avatar-thinking 1.45s ease-in-out infinite;
2225
+ }
2226
+ .cf-floating-call-card.is-speaking .cf-floating-call-card__avatar,
2227
+ .cf-floating-call-card.is-speaking .cf-floating-call-card__media img {
2228
+ animation: cf-avatar-nod 1.6s ease-in-out infinite;
2229
+ }
2230
+ .cf-floating-call-card__avatar > span:first-child {
2231
+ font-size: clamp(64px, 22vw, 118px);
2232
+ font-weight: 800;
2233
+ line-height: 1;
2234
+ }
2235
+ .cf-floating-call-card__eye,
2236
+ .cf-floating-call-card__mouth {
2237
+ position: absolute;
2238
+ background: rgba(255, 255, 255, 0.9);
2239
+ }
2240
+ .cf-floating-call-card__eye {
2241
+ top: 37%;
2242
+ width: 8px;
2243
+ height: 8px;
2244
+ border-radius: 999px;
2245
+ }
2246
+ .cf-floating-call-card__eye--left { left: 38%; }
2247
+ .cf-floating-call-card__eye--right { right: 38%; }
2248
+ .cf-floating-call-card__mouth {
2249
+ bottom: 31%;
2250
+ width: 34px;
2251
+ height: 6px;
2252
+ border-radius: 999px;
2253
+ }
2254
+ .cf-floating-call-card.is-speaking .cf-floating-call-card__mouth {
2255
+ animation: cf-mouth-talk 0.24s ease-in-out infinite alternate;
2256
+ }
2257
+ .cf-floating-call-card__controls {
2258
+ position: absolute;
2259
+ left: 50%;
2260
+ bottom: 12px;
2261
+ transform: translateX(-50%);
2262
+ display: inline-flex;
2263
+ align-items: center;
2264
+ gap: 4px;
2265
+ padding: 5px 7px;
2266
+ border-radius: 999px;
2267
+ background: color-mix(in oklab, var(--cf-bg) 92%, transparent);
2268
+ border: 1px solid color-mix(in oklab, var(--cf-border) 70%, transparent);
2269
+ box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.74);
2270
+ }
2271
+ .cf-assistant-card__copy {
2272
+ margin: 0;
2273
+ color: var(--cf-text);
2274
+ font-size: 14px;
2275
+ line-height: 1.55;
2276
+ }
2277
+ .cf-assistant-card__chips {
2278
+ display: flex;
2279
+ flex-wrap: wrap;
2280
+ gap: 7px;
2281
+ }
2282
+ .cf-assistant-card__chip {
2283
+ max-width: 100%;
2284
+ border-radius: 6px;
2285
+ padding: 7px 9px;
2286
+ background: color-mix(in oklab, var(--cf-accent) 12%, var(--cf-bg));
2287
+ color: var(--cf-accent);
2288
+ font-size: 12.5px;
2289
+ line-height: 1.2;
2290
+ }
2291
+ .cf-assistant-card__chip:hover { background: color-mix(in oklab, var(--cf-accent) 18%, var(--cf-bg)); }
2292
+ .cf-assistant-card__privacy {
2293
+ margin: -2px 0 0;
2294
+ color: var(--cf-muted);
2295
+ font-size: 10.5px;
2296
+ line-height: 1.4;
2297
+ text-align: center;
2298
+ }
2299
+ .cf-assistant-card__privacy a {
2300
+ color: var(--cf-muted);
2301
+ text-decoration: underline;
2302
+ text-underline-offset: 2px;
2303
+ }
2304
+
2305
+ /* Offline presence dot (amber instead of green). */
2306
+ .cf-header__status--offline::before { background: #e2c07e; box-shadow: 0 0 0 2px rgba(226, 192, 126, 0.3); }
2307
+
2308
+ /* Disclaimer fine-print under the composer. */
2309
+ .cf-disclaimer { padding: 0 16px 2px; font-size: 10.5px; line-height: 1.45; color: var(--cf-muted); text-align: center; }
2310
+
2311
+ /* Read-only banner shown while viewing a past conversation. */
2312
+ .cf-viewing-banner {
2313
+ padding: 7px 16px;
2314
+ font-size: 12px;
2315
+ font-weight: 600;
2316
+ text-align: center;
2317
+ color: var(--cf-muted);
2318
+ background: var(--cf-surface);
2319
+ border-bottom: 1px solid var(--cf-border);
2320
+ flex-shrink: 0;
2321
+ }
2322
+
2323
+ /* Past-conversations history panel (over the chat, like the confirm dialog). */
2324
+ .cf-history {
2325
+ width: min(340px, 90%);
2326
+ max-height: 70%;
2327
+ display: flex;
2328
+ flex-direction: column;
2329
+ background: var(--cf-bg);
2330
+ border-radius: 14px;
2331
+ box-shadow: var(--cf-shadow);
2332
+ overflow: hidden;
2333
+ }
2334
+ .cf-history__head {
2335
+ display: flex;
2336
+ align-items: center;
2337
+ justify-content: space-between;
2338
+ padding: 12px 14px;
2339
+ font-size: 14px;
2340
+ font-weight: 700;
2341
+ color: var(--cf-text);
2342
+ border-bottom: 1px solid var(--cf-border);
2343
+ }
2344
+ .cf-history__list { overflow-y: auto; padding: 6px; }
2345
+ .cf-history__item {
2346
+ display: flex;
2347
+ flex-direction: column;
2348
+ gap: 2px;
2349
+ width: 100%;
2350
+ text-align: left;
2351
+ padding: 9px 10px;
2352
+ border-radius: 9px;
2353
+ cursor: pointer;
2354
+ transition: background 0.15s ease;
2355
+ }
2356
+ .cf-history__item:hover { background: var(--cf-surface); }
2357
+ .cf-history__item.is-active { background: var(--cf-surface); }
2358
+ .cf-history__title { font-size: 13px; color: var(--cf-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
2359
+ .cf-history__meta { font-size: 11px; color: var(--cf-muted); }
2360
+
2361
+ /* Ended-conversation bar โ€” replaces the composer once the chat is closed. */
2362
+ .cf-ended {
2363
+ display: flex;
2364
+ flex-direction: column;
2365
+ align-items: center;
2366
+ gap: 10px;
2367
+ padding: 14px 16px 16px;
2368
+ flex-shrink: 0;
2369
+ text-align: center;
2370
+ }
2371
+ .cf-ended__text { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--cf-muted); }
2372
+ .cf-csat { display: inline-flex; align-items: center; gap: 8px; }
2373
+ .cf-csat__q { font-size: 12.5px; color: var(--cf-muted); }
2374
+ .cf-csat__btn {
2375
+ display: inline-flex;
2376
+ align-items: center;
2377
+ justify-content: center;
2378
+ width: 30px;
2379
+ height: 30px;
2380
+ border-radius: 8px;
2381
+ color: var(--cf-muted);
2382
+ cursor: pointer;
2383
+ transition: background 0.15s ease, color 0.15s ease;
2384
+ }
2385
+ .cf-csat__btn:hover { background: var(--cf-surface); color: var(--cf-accent); }
2386
+ .cf-csat__btn svg { width: 16px; height: 16px; }
2387
+ .cf-ended__btn {
2388
+ font-size: 13px;
2389
+ font-weight: 600;
2390
+ color: var(--cf-accent-ink);
2391
+ background: var(--cf-accent);
2392
+ border: none;
2393
+ border-radius: 999px;
2394
+ padding: 9px 18px;
2395
+ cursor: pointer;
2396
+ transition: opacity 0.15s ease;
2397
+ }
2398
+ .cf-ended__btn:hover { opacity: 0.9; }
2399
+ .cf-ended__btn:focus-visible { outline: 2px solid var(--cf-accent); outline-offset: 2px; }
2400
+
2401
+ /* "โ†“ New messages" pill โ€” shown when a reply streams in while scrolled up. */
2402
+ .cf-newmsg {
2403
+ /* Sticky inside the scroll body: pins to the bottom of the visible thread,
2404
+ just above the composer (never overlapping it). Horizontal centering via
2405
+ align-self so it doesn't fight the entrance animation's transform. */
2406
+ position: sticky;
2407
+ bottom: 10px;
2408
+ align-self: center;
2409
+ z-index: 3;
2410
+ pointer-events: auto;
2411
+ display: inline-flex;
2412
+ align-items: center;
2413
+ gap: 6px;
2414
+ font-size: 12.5px;
2415
+ font-weight: 600;
2416
+ color: var(--cf-accent-ink);
2417
+ background: linear-gradient(135deg, var(--cf-accent, #2f7f55) 0%, var(--cf-accent-2, #2f7de8) 160%);
2418
+ border-radius: 999px;
2419
+ padding: 7px 14px;
2420
+ box-shadow: var(--cf-shadow);
2421
+ animation: cf-msg-in 0.2s ease both;
2422
+ }
2423
+ .cf-newmsg svg { width: 14px; height: 14px; }
2424
+
2425
+ /* ---------- Clear-chat confirm dialog (in-widget, replaces window.confirm) ---------- */
2426
+ .cf-confirm {
2427
+ position: absolute;
2428
+ inset: 0;
2429
+ z-index: 6;
2430
+ pointer-events: auto;
2431
+ display: grid;
2432
+ place-items: center;
2433
+ padding: 22px;
2434
+ background: color-mix(in oklab, var(--cf-bg) 62%, transparent);
2435
+ backdrop-filter: blur(2px);
2436
+ animation: cf-fade-in 0.14s ease both;
2437
+ }
2438
+ .cf-confirm__card {
2439
+ width: 100%;
2440
+ max-width: 300px;
2441
+ background: var(--cf-bg);
2442
+ border: 1px solid var(--cf-border);
2443
+ border-radius: 16px;
2444
+ box-shadow: var(--cf-shadow);
2445
+ padding: 18px;
2446
+ text-align: center;
2447
+ animation: cf-msg-in 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
2448
+ }
2449
+ .cf-confirm__title { font-size: 15px; font-weight: 700; color: var(--cf-text); }
2450
+ .cf-confirm__body { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--cf-muted); }
2451
+ .cf-confirm__actions { margin-top: 16px; display: flex; gap: 8px; justify-content: center; }
2452
+ .cf-confirm__btn {
2453
+ padding: 9px 16px;
2454
+ border-radius: 10px;
2455
+ font-size: 13.5px;
2456
+ font-weight: 600;
2457
+ transition: transform 0.1s ease, opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
2458
+ }
2459
+ .cf-confirm__btn:active { transform: scale(0.97); }
2460
+ .cf-confirm__btn:focus-visible { outline: 2px solid var(--cf-accent-2); outline-offset: 2px; }
2461
+ .cf-confirm__btn--cancel { background: var(--cf-surface); color: var(--cf-text); border: 1px solid var(--cf-border); }
2462
+ .cf-confirm__btn--cancel:hover { border-color: var(--cf-accent); }
2463
+ .cf-confirm__btn--danger { background: #f25767; color: #fff; }
2464
+ .cf-confirm__btn--danger:hover { opacity: 0.9; }
2465
+
2466
+ /* Visually-hidden live region (announces the final answer only). */
2467
+ .cf-sr-live {
2468
+ position: absolute;
2469
+ width: 1px;
2470
+ height: 1px;
2471
+ padding: 0;
2472
+ margin: -1px;
2473
+ overflow: hidden;
2474
+ clip: rect(0 0 0 0);
2475
+ white-space: nowrap;
2476
+ border: 0;
2477
+ }
2478
+
2479
+ /* ---------- Attachments ---------- */
2480
+ .cf-file-input { display: none; }
2481
+ .cf-iconbtn:disabled { opacity: 0.4; cursor: default; }
2482
+ .cf-attach-row { padding: 0 4px 8px; }
2483
+ .cf-attach-status { font-size: 12px; color: var(--cf-muted); }
2484
+ .cf-attach-status--err { color: #f25767; }
2485
+ .cf-attach-chip {
2486
+ display: inline-flex;
2487
+ align-items: center;
2488
+ gap: 6px;
2489
+ max-width: 100%;
2490
+ padding: 5px 6px 5px 10px;
2491
+ border-radius: 999px;
2492
+ background: var(--cf-surface-2);
2493
+ border: 1px solid var(--cf-border);
2494
+ color: var(--cf-text);
2495
+ font-size: 12px;
2496
+ }
2497
+ .cf-attach-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
2498
+ .cf-attach-chip svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--cf-muted); }
2499
+ .cf-attach-x { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--cf-muted); flex-shrink: 0; }
2500
+ .cf-attach-x:hover { background: var(--cf-surface); color: var(--cf-text); }
2501
+ .cf-attach-x svg { width: 11px; height: 11px; }
2502
+
2503
+ /* ---------- Mobile: full-screen panel ---------- */
2504
+ @media (max-width: 480px) {
2505
+ .cf-panel {
2506
+ bottom: 0;
2507
+ right: 0;
2508
+ width: 100vw;
2509
+ max-width: 100vw;
2510
+ height: 100dvh;
2511
+ max-height: 100dvh;
2512
+ border-radius: 0;
2513
+ }
2514
+ .cf-launcher { bottom: 16px; right: 16px; }
2515
+ }
2516
+
2517
+ /* ---------- Keyframes ---------- */
2518
+ @keyframes cf-pop {
2519
+ from { transform: scale(0); opacity: 0; }
2520
+ to { transform: scale(1); opacity: 1; }
2521
+ }
2522
+ @keyframes cf-badge-pop {
2523
+ from { transform: scale(0); }
2524
+ to { transform: scale(1); }
2525
+ }
2526
+ @keyframes cf-panel-open {
2527
+ 0% {
2528
+ opacity: 0;
2529
+ transform: translateY(24px) scale(0.93);
2530
+ filter: blur(2px);
2531
+ }
2532
+ 58% {
2533
+ opacity: 1;
2534
+ transform: translateY(-3px) scale(1.006);
2535
+ filter: blur(0);
2536
+ }
2537
+ 100% {
2538
+ opacity: 1;
2539
+ transform: translateY(0) scale(1);
2540
+ filter: blur(0);
2541
+ }
2542
+ }
2543
+ @keyframes cf-msg-in {
2544
+ from { opacity: 0; transform: translateY(8px); }
2545
+ to { opacity: 1; transform: none; }
2546
+ }
2547
+ @keyframes cf-fade-in {
2548
+ from { opacity: 0; }
2549
+ to { opacity: 1; }
2550
+ }
2551
+ @keyframes cf-typing {
2552
+ 0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
2553
+ 40% { opacity: 1; transform: translateY(-4px); }
2554
+ }
2555
+ @keyframes cf-pulse {
2556
+ 0%, 100% { opacity: 1; }
2557
+ 50% { opacity: 0.4; }
2558
+ }
2559
+
2560
+ @media (prefers-reduced-motion: reduce) {
2561
+ .cf-root *, .cf-root *::before, .cf-root *::after {
2562
+ animation-duration: 0.01ms !important;
2563
+ animation-iteration-count: 1 !important;
2564
+ transition-duration: 0.01ms !important;
2565
+ scroll-behavior: auto !important;
2566
+ }
2567
+ }
2568
+ .cf-analytics-visualization {
2569
+ box-sizing: border-box;
2570
+ width: 100%;
2571
+ max-width: 100%;
2572
+ margin-top: 8px;
2573
+ min-width: 0;
2574
+ overflow: hidden;
2575
+ border: 1px solid var(--cf-border);
2576
+ border-radius: 13px;
2577
+ background: var(--cf-surface);
2578
+ padding: 12px;
2579
+ color: var(--cf-muted);
2580
+ font-size: 11px;
2581
+ }
2582
+ .cf-analytics-visualization.is-expanded {
2583
+ display: flex;
2584
+ min-height: 100%;
2585
+ flex-direction: column;
2586
+ margin: 0;
2587
+ border: 0;
2588
+ border-radius: 0;
2589
+ background: transparent;
2590
+ padding: 0;
2591
+ }
2592
+ .cf-analytics-visualization__header {
2593
+ display: flex;
2594
+ width: 100%;
2595
+ min-width: 0;
2596
+ min-height: 32px;
2597
+ align-items: center;
2598
+ justify-content: space-between;
2599
+ gap: 10px;
2600
+ }
2601
+ .cf-analytics-visualization__header > div:first-child {
2602
+ min-width: 0;
2603
+ }
2604
+ .cf-analytics-visualization__actions {
2605
+ display: flex;
2606
+ flex: 0 0 auto;
2607
+ align-items: center;
2608
+ gap: 6px;
2609
+ }
2610
+ .cf-analytics-chart-picker {
2611
+ display: flex;
2612
+ align-items: center;
2613
+ gap: 5px;
2614
+ color: var(--cf-muted);
2615
+ font-size: 9px;
2616
+ font-weight: 700;
2617
+ }
2618
+ .cf-analytics-chart-picker select {
2619
+ max-width: 112px;
2620
+ height: 30px;
2621
+ border: 1px solid var(--cf-border);
2622
+ border-radius: 8px;
2623
+ background: var(--cf-bg);
2624
+ padding: 0 22px 0 8px;
2625
+ color: var(--cf-text);
2626
+ font: inherit;
2627
+ }
2628
+ .cf-analytics-chart-picker select:focus-visible {
2629
+ outline: 2px solid var(--cf-accent);
2630
+ outline-offset: 2px;
2631
+ }
2632
+ .cf-analytics-visualization__title {
2633
+ overflow: hidden;
2634
+ color: var(--cf-muted);
2635
+ font-size: 10px;
2636
+ font-weight: 750;
2637
+ letter-spacing: .08em;
2638
+ text-overflow: ellipsis;
2639
+ text-transform: uppercase;
2640
+ white-space: nowrap;
2641
+ }
2642
+ .cf-analytics-meta {
2643
+ display: flex;
2644
+ flex-wrap: wrap;
2645
+ align-items: center;
2646
+ gap: 3px 7px;
2647
+ margin-top: 4px;
2648
+ color: var(--cf-muted);
2649
+ font-size: 9px;
2650
+ line-height: 1.35;
2651
+ }
2652
+ .cf-analytics-meta__dot {
2653
+ display: inline-block;
2654
+ width: 5px;
2655
+ height: 5px;
2656
+ margin-right: 4px;
2657
+ border-radius: 999px;
2658
+ background: var(--cf-accent);
2659
+ }
2660
+ .cf-analytics-visualization__download {
2661
+ width: fit-content;
2662
+ border: 1px solid var(--cf-border) !important;
2663
+ border-radius: 8px;
2664
+ background: var(--cf-surface) !important;
2665
+ padding: 6px 9px;
2666
+ color: var(--cf-text) !important;
2667
+ font-size: 10px;
2668
+ font-weight: 700;
2669
+ }
2670
+ .cf-analytics-visualization__download:hover {
2671
+ border-color: var(--cf-accent) !important;
2672
+ color: var(--cf-accent) !important;
2673
+ }
2674
+ .cf-analytics-table-wrap {
2675
+ box-sizing: border-box;
2676
+ width: 100%;
2677
+ max-width: 100%;
2678
+ margin-top: 9px;
2679
+ max-height: 210px;
2680
+ overflow: auto;
2681
+ border: 1px solid var(--cf-border);
2682
+ border-radius: 9px;
2683
+ scrollbar-width: thin;
2684
+ }
2685
+ .cf-analytics-visualization.is-expanded .cf-analytics-table-wrap {
2686
+ min-height: 0;
2687
+ max-height: none;
2688
+ flex: 1;
2689
+ margin-top: 14px;
2690
+ }
2691
+ .cf-analytics-table {
2692
+ width: 100%;
2693
+ border-collapse: collapse;
2694
+ color: var(--cf-text);
2695
+ font-size: 10px;
2696
+ white-space: nowrap;
2697
+ }
2698
+ .cf-analytics-table th,
2699
+ .cf-analytics-table td {
2700
+ border-bottom: 1px solid var(--cf-border);
2701
+ padding: 8px 9px;
2702
+ text-align: left;
2703
+ }
2704
+ .cf-analytics-table th {
2705
+ position: sticky;
2706
+ top: 0;
2707
+ background: var(--cf-surface-2);
2708
+ color: var(--cf-muted);
2709
+ font-weight: 700;
2710
+ text-transform: capitalize;
2711
+ }
2712
+ .cf-analytics-table tbody tr:last-child td { border-bottom: 0; }
2713
+ .cf-analytics-table-note {
2714
+ margin: 7px 2px 0;
2715
+ color: var(--cf-muted);
2716
+ font-size: 9px;
2717
+ line-height: 1.4;
2718
+ }
2719
+ .cf-data-table {
2720
+ display: flex;
2721
+ min-width: 0;
2722
+ min-height: 0;
2723
+ flex: 1;
2724
+ flex-direction: column;
2725
+ margin-top: 10px;
2726
+ overflow: hidden;
2727
+ border: 1px solid var(--cf-border);
2728
+ border-radius: 9px;
2729
+ background: var(--cf-bg);
2730
+ }
2731
+ .cf-table-fields {
2732
+ display: flex;
2733
+ min-width: 0;
2734
+ min-height: 38px;
2735
+ align-items: center;
2736
+ gap: 6px;
2737
+ padding: 7px 8px;
2738
+ border-bottom: 1px solid var(--cf-border);
2739
+ color: var(--cf-muted);
2740
+ font-size: 9px;
2741
+ }
2742
+ .cf-table-fields > strong {
2743
+ flex: 0 0 auto;
2744
+ color: var(--cf-muted);
2745
+ font-size: 8px;
2746
+ letter-spacing: .06em;
2747
+ text-transform: uppercase;
2748
+ }
2749
+ .cf-field-list {
2750
+ display: flex;
2751
+ min-width: 0;
2752
+ gap: 5px;
2753
+ overflow: auto hidden;
2754
+ scrollbar-width: none;
2755
+ }
2756
+ .cf-field-chip {
2757
+ flex: 0 0 auto;
2758
+ padding: 4px 6px;
2759
+ border-radius: 6px;
2760
+ background: color-mix(in srgb, var(--cf-accent) 11%, var(--cf-bg));
2761
+ color: var(--cf-accent);
2762
+ font-weight: 650;
2763
+ }
2764
+ .cf-table-field-count { margin-left: auto;white-space: nowrap; }
2765
+ .cf-table-controls {
2766
+ display: grid;
2767
+ grid-template-columns: minmax(110px, 1fr) auto;
2768
+ gap: 6px;
2769
+ padding: 7px 8px 5px;
2770
+ }
2771
+ .cf-table-search {
2772
+ display: flex;
2773
+ min-width: 0;
2774
+ align-items: center;
2775
+ gap: 5px;
2776
+ padding: 0 7px;
2777
+ border: 1px solid var(--cf-border);
2778
+ border-radius: 7px;
2779
+ background: var(--cf-bg);
2780
+ color: var(--cf-muted);
2781
+ }
2782
+ .cf-table-search input {
2783
+ width: 100%;
2784
+ min-width: 0;
2785
+ height: 28px;
2786
+ border: 0;
2787
+ outline: 0;
2788
+ background: transparent;
2789
+ color: var(--cf-text);
2790
+ font: 500 9px/1 var(--cf-font);
2791
+ }
2792
+ .cf-table-modes {
2793
+ display: inline-flex;
2794
+ padding: 2px;
2795
+ border: 1px solid var(--cf-border);
2796
+ border-radius: 8px;
2797
+ background: var(--cf-surface);
2798
+ }
2799
+ .cf-segment {
2800
+ min-height: 26px;
2801
+ border-radius: 6px;
2802
+ padding: 0 7px !important;
2803
+ color: var(--cf-muted) !important;
2804
+ font-size: 9px;
2805
+ font-weight: 650;
2806
+ }
2807
+ .cf-segment.is-active { background: var(--cf-accent) !important;color: var(--cf-accent-ink) !important; }
2808
+ .cf-table-column-bar { display: flex;align-items: center;padding: 0 8px 7px; }
2809
+ .cf-column-picker { position: relative; }
2810
+ .cf-column-picker > summary {
2811
+ min-height: 27px;
2812
+ padding: 6px 8px;
2813
+ border: 1px solid var(--cf-border);
2814
+ border-radius: 7px;
2815
+ cursor: pointer;
2816
+ list-style: none;
2817
+ color: var(--cf-text);
2818
+ font-size: 9px;
2819
+ font-weight: 650;
2820
+ }
2821
+ .cf-column-picker > summary::-webkit-details-marker { display: none; }
2822
+ .cf-column-menu {
2823
+ position: absolute;
2824
+ z-index: 5;
2825
+ top: calc(100% + 4px);
2826
+ left: 0;
2827
+ display: grid;
2828
+ min-width: 160px;
2829
+ gap: 6px;
2830
+ padding: 9px;
2831
+ border: 1px solid var(--cf-border);
2832
+ border-radius: 8px;
2833
+ background: var(--cf-bg);
2834
+ box-shadow: 0 10px 24px rgba(15,30,42,.16);
2835
+ }
2836
+ .cf-column-menu label { display: flex;align-items: center;gap: 7px;color: var(--cf-text);font-size: 9px; }
2837
+ .cf-table-wrap {
2838
+ position: relative;
2839
+ min-height: 0;
2840
+ max-height: 210px;
2841
+ overflow: auto;
2842
+ border-top: 1px solid var(--cf-border);
2843
+ scrollbar-width: thin;
2844
+ }
2845
+ .cf-analytics-visualization.is-expanded .cf-table-wrap { max-height: none;flex: 1; }
2846
+ .cf-table { width: 100%;border-collapse: separate;border-spacing: 0;color: var(--cf-text);font-size: 10px; }
2847
+ .cf-table th { position: sticky;top: 0;z-index: 1;background: var(--cf-surface);color: var(--cf-muted);font-size: 9px;font-weight: 720;text-align: left; }
2848
+ .cf-table th,.cf-table td { padding: 8px 9px;border-bottom: 1px solid var(--cf-border);white-space: nowrap; }
2849
+ .cf-table .cf-select-cell { width: 28px;padding-right: 3px;text-align: center; }
2850
+ .cf-table input[type="checkbox"],.cf-column-menu input[type="checkbox"] { width: 13px;height: 13px;accent-color: var(--cf-accent); }
2851
+ .cf-table-sort { display: flex !important;width: 100%;align-items: center;gap: 5px;color: inherit !important;font: inherit;text-align: left; }
2852
+ .cf-sort-direction { color: var(--cf-muted);font-size: 10px; }
2853
+ .cf-table.is-matrix tbody td:not(.cf-select-cell) { background: color-mix(in srgb,var(--cf-accent) 7%,var(--cf-bg)); }
2854
+ .cf-table tbody tr:hover,.cf-table tbody tr.is-selected { background: color-mix(in srgb,var(--cf-accent) 10%,var(--cf-bg)); }
2855
+ .cf-table tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--cf-accent); }
2856
+ .cf-show-more { position: sticky;left: 50%;bottom: 6px;transform: translateX(-50%);margin: 8px auto;padding: 6px 9px !important;border: 1px solid var(--cf-border) !important;border-radius: 7px;background: var(--cf-bg) !important;font-size: 9px;font-weight: 650; }
2857
+ .cf-table-summary { display: flex;align-items: center;justify-content: space-between;gap: 8px;padding: 7px 9px;color: var(--cf-muted);font-size: 8px; }
2858
+ .cf-visually-hidden { position: absolute;width: 1px;height: 1px;overflow: hidden;clip: rect(0 0 0 0); }
2859
+ @media (max-width: 430px) {
2860
+ .cf-table-modes { display: none; }
2861
+ .cf-table-controls { grid-template-columns: 1fr; }
2862
+ .cf-table-summary span:last-child { display: none; }
2863
+ }
2864
+ .cf-analytics-visualization__expand,
2865
+ .cf-analytics-visualization__close {
2866
+ display: grid;
2867
+ width: 30px;
2868
+ height: 30px;
2869
+ flex: 0 0 auto;
2870
+ place-items: center;
2871
+ border: 1px solid var(--cf-border) !important;
2872
+ border-radius: 9px;
2873
+ background: var(--cf-bg) !important;
2874
+ color: var(--cf-text) !important;
2875
+ }
2876
+ .cf-analytics-visualization__expand:hover,
2877
+ .cf-analytics-visualization__close:hover { background: var(--cf-surface-2) !important; }
2878
+ .cf-analytics-visualization__expand:focus-visible,
2879
+ .cf-analytics-visualization__close:focus-visible {
2880
+ outline: 2px solid var(--cf-accent);
2881
+ outline-offset: 2px;
2882
+ }
2883
+ .cf-analytics-visualization__expand svg,
2884
+ .cf-analytics-visualization__close svg { width: 15px; height: 15px; }
2885
+ .cf-analytics-visualization__kpi {
2886
+ padding: 8px 0 6px;
2887
+ color: var(--cf-text);
2888
+ font-size: 30px;
2889
+ font-weight: 750;
2890
+ letter-spacing: -.035em;
2891
+ }
2892
+ .cf-analytics-kpi {
2893
+ padding: 9px 0 5px;
2894
+ }
2895
+ .cf-analytics-kpi__label {
2896
+ color: var(--cf-muted);
2897
+ font-size: 9px;
2898
+ font-weight: 700;
2899
+ letter-spacing: .06em;
2900
+ text-transform: uppercase;
2901
+ }
2902
+ .cf-analytics-kpi__value {
2903
+ margin-top: 5px;
2904
+ color: var(--cf-text);
2905
+ font-size: 30px;
2906
+ font-weight: 750;
2907
+ letter-spacing: -.035em;
2908
+ line-height: 1;
2909
+ }
2910
+ .cf-analytics-kpi__detail {
2911
+ margin-top: 8px;
2912
+ color: var(--cf-muted);
2913
+ font-size: 10px;
2914
+ line-height: 1.5;
2915
+ }
2916
+ .cf-analytics-empty {
2917
+ margin-top: 8px;
2918
+ border: 1px dashed var(--cf-border);
2919
+ border-radius: 11px;
2920
+ padding: 18px 14px;
2921
+ color: var(--cf-text);
2922
+ text-align: center;
2923
+ }
2924
+ .cf-analytics-empty p { margin: 0; }
2925
+ .cf-analytics-empty p + p {
2926
+ margin-top: 4px;
2927
+ color: var(--cf-muted);
2928
+ font-size: 10px;
2929
+ }
2930
+ .cf-analytics-echart {
2931
+ position: relative;
2932
+ width: 100%;
2933
+ height: 196px;
2934
+ min-width: 0;
2935
+ }
2936
+ .cf-analytics-visualization.is-expanded .cf-analytics-echart {
2937
+ height: auto;
2938
+ min-height: 310px;
2939
+ flex: 1;
2940
+ }
2941
+ .cf-analytics-echart canvas:focus-visible {
2942
+ outline: 2px solid var(--cf-accent);
2943
+ outline-offset: -2px;
2944
+ }
2945
+ .cf-analytics-echart__fallback {
2946
+ display: grid;
2947
+ height: 100%;
2948
+ place-items: center;
2949
+ border: 1px dashed var(--cf-border);
2950
+ border-radius: 9px;
2951
+ padding: 16px;
2952
+ color: var(--cf-muted);
2953
+ text-align: center;
2954
+ line-height: 1.5;
2955
+ }
2956
+ .cf-analytics-zoom {
2957
+ display: flex;
2958
+ min-width: 0;
2959
+ align-items: center;
2960
+ justify-content: space-between;
2961
+ gap: 8px;
2962
+ margin-top: 4px;
2963
+ border-top: 1px solid var(--cf-border);
2964
+ padding-top: 8px;
2965
+ }
2966
+ .cf-analytics-zoom__range {
2967
+ min-width: 0;
2968
+ overflow: hidden;
2969
+ color: var(--cf-muted);
2970
+ font-size: 10px;
2971
+ font-weight: 650;
2972
+ line-height: 1.3;
2973
+ text-overflow: ellipsis;
2974
+ white-space: nowrap;
2975
+ }
2976
+ .cf-analytics-zoom__controls {
2977
+ display: inline-flex;
2978
+ flex: 0 0 auto;
2979
+ align-items: center;
2980
+ overflow: hidden;
2981
+ border: 1px solid var(--cf-border);
2982
+ border-radius: 9px;
2983
+ background: var(--cf-bg);
2984
+ }
2985
+ .cf-analytics-zoom__controls button {
2986
+ display: grid;
2987
+ min-width: 40px;
2988
+ height: 40px;
2989
+ place-items: center;
2990
+ border: 0 !important;
2991
+ border-radius: 0;
2992
+ background: transparent !important;
2993
+ color: var(--cf-text) !important;
2994
+ font: inherit;
2995
+ font-size: 16px;
2996
+ font-weight: 700;
2997
+ line-height: 1;
2998
+ }
2999
+ .cf-analytics-zoom__controls button + button { border-left: 1px solid var(--cf-border) !important; }
3000
+ .cf-analytics-zoom__controls button:hover:not(:disabled) { background: var(--cf-surface-2) !important; }
3001
+ .cf-analytics-zoom__controls button:focus-visible {
3002
+ position: relative;
3003
+ z-index: 1;
3004
+ outline: 2px solid var(--cf-accent);
3005
+ outline-offset: -2px;
3006
+ }
3007
+ .cf-analytics-zoom__controls button:disabled { cursor: not-allowed; opacity: .38; }
3008
+ .cf-analytics-zoom__controls .cf-analytics-zoom__reset {
3009
+ min-width: 56px;
3010
+ padding: 0 10px;
3011
+ font-size: 10px;
3012
+ font-weight: 700;
3013
+ }
3014
+ .cf-analytics-chart__summary {
3015
+ margin: 2px 0 0;
3016
+ color: var(--cf-muted);
3017
+ font-size: 11px;
3018
+ line-height: 1.45;
3019
+ }
3020
+ .cf-analytics-focus {
3021
+ height: 100%;
3022
+ min-height: 0;
3023
+ overflow: auto;
3024
+ background: var(--cf-bg);
3025
+ padding: 18px;
3026
+ }
3027
+ @media (min-width: 640px) {
3028
+ .cf-panel.cf-panel--analytics-focus {
3029
+ grid-template-columns: minmax(0, 1fr);
3030
+ grid-template-rows: auto minmax(0, 1fr);
3031
+ grid-template-areas: 'header' 'video';
3032
+ }
3033
+ .cf-panel--analytics-focus .cf-panel__video { height: 100%; }
3034
+ .cf-panel--analytics-focus .cf-panel__chat { display: none; }
3035
+ }
3036
+ .cf-analytics-explanation {
3037
+ margin-top: 10px;
3038
+ overflow: hidden;
3039
+ border: 1px solid var(--cf-border);
3040
+ border-radius: 12px;
3041
+ background: var(--cf-surface);
3042
+ color: var(--cf-text);
3043
+ font-size: 12px;
3044
+ line-height: 1.55;
3045
+ }
3046
+ .cf-analytics-explanation h3,
3047
+ .cf-analytics-explanation h4,
3048
+ .cf-analytics-explanation p { margin: 0; }
3049
+ .cf-analytics-explanation__lead {
3050
+ border-bottom: 1px solid var(--cf-border);
3051
+ padding: 12px;
3052
+ }
3053
+ .cf-analytics-explanation__lead-meta {
3054
+ display: flex;
3055
+ flex-wrap: wrap;
3056
+ align-items: center;
3057
+ gap: 5px 8px;
3058
+ }
3059
+ .cf-analytics-explanation__eyebrow {
3060
+ color: var(--cf-accent);
3061
+ font-size: 9px;
3062
+ font-weight: 750;
3063
+ letter-spacing: .1em;
3064
+ text-transform: uppercase;
3065
+ }
3066
+ .cf-analytics-explanation__provenance {
3067
+ display: inline-flex;
3068
+ align-items: center;
3069
+ gap: 5px;
3070
+ color: var(--cf-muted);
3071
+ font-size: 9px;
3072
+ font-weight: 650;
3073
+ }
3074
+ .cf-analytics-explanation__provenance-dot {
3075
+ width: 5px;
3076
+ height: 5px;
3077
+ border-radius: 999px;
3078
+ background: var(--cf-accent);
3079
+ }
3080
+ .cf-analytics-explanation__headline {
3081
+ margin-top: 8px !important;
3082
+ color: var(--cf-text);
3083
+ font-size: 15px;
3084
+ font-weight: 750;
3085
+ letter-spacing: -.012em;
3086
+ line-height: 1.45;
3087
+ }
3088
+ .cf-analytics-explanation__summary {
3089
+ margin-top: 5px !important;
3090
+ color: var(--cf-muted);
3091
+ font-size: 12px;
3092
+ line-height: 1.6;
3093
+ }
3094
+ .cf-analytics-explanation__body {
3095
+ display: grid;
3096
+ gap: 14px;
3097
+ padding: 12px;
3098
+ }
3099
+ .cf-analytics-explanation__status { color: var(--cf-muted); }
3100
+ .cf-analytics-explanation__error {
3101
+ border-radius: 8px;
3102
+ background: color-mix(in srgb, #d97706 10%, var(--cf-surface));
3103
+ padding: 9px 10px;
3104
+ color: var(--cf-text);
3105
+ }
3106
+ .cf-analytics-explanation__heading {
3107
+ color: var(--cf-text);
3108
+ font-size: 12px;
3109
+ font-weight: 750;
3110
+ line-height: 1.45;
3111
+ }
3112
+ .cf-analytics-explanation__evidence {
3113
+ display: grid;
3114
+ gap: 7px;
3115
+ margin: 8px 0 0;
3116
+ padding: 0;
3117
+ list-style: none;
3118
+ color: var(--cf-muted);
3119
+ }
3120
+ .cf-analytics-explanation__evidence-item {
3121
+ display: flex;
3122
+ gap: 8px;
3123
+ align-items: flex-start;
3124
+ }
3125
+ .cf-analytics-explanation__evidence-bullet {
3126
+ width: 5px;
3127
+ height: 5px;
3128
+ flex: 0 0 auto;
3129
+ margin-top: 7px;
3130
+ border-radius: 999px;
3131
+ background: var(--cf-accent);
3132
+ }
3133
+ .cf-analytics-explanation__meaning {
3134
+ border-left: 2px solid var(--cf-accent);
3135
+ border-radius: 0 8px 8px 0;
3136
+ background: color-mix(in srgb, var(--cf-accent) 7%, var(--cf-surface));
3137
+ padding: 10px 11px;
3138
+ }
3139
+ .cf-analytics-explanation__paragraph {
3140
+ margin-top: 5px !important;
3141
+ color: var(--cf-muted);
3142
+ }
3143
+ .cf-analytics-explanation__section-heading,
3144
+ .cf-analytics-explanation__outlook-header {
3145
+ display: flex;
3146
+ flex-wrap: wrap;
3147
+ align-items: baseline;
3148
+ justify-content: space-between;
3149
+ gap: 4px 8px;
3150
+ }
3151
+ .cf-analytics-explanation__hint,
3152
+ .cf-analytics-explanation__outlook-badge {
3153
+ color: var(--cf-muted);
3154
+ font-size: 9px;
3155
+ font-weight: 650;
3156
+ }
3157
+ .cf-analytics-explanation__outlook-badge {
3158
+ color: var(--cf-accent);
3159
+ letter-spacing: .06em;
3160
+ text-transform: uppercase;
3161
+ }
3162
+ .cf-analytics-explanation__drivers,
3163
+ .cf-analytics-explanation__recommendations {
3164
+ display: grid;
3165
+ gap: 7px;
3166
+ margin-top: 8px;
3167
+ }
3168
+ .cf-analytics-explanation__driver {
3169
+ border-radius: 8px;
3170
+ background: var(--cf-bg);
3171
+ padding: 9px 10px;
3172
+ }
3173
+ .cf-analytics-explanation__driver-title,
3174
+ .cf-analytics-explanation__recommendation-title {
3175
+ color: var(--cf-text);
3176
+ font-weight: 750;
3177
+ }
3178
+ .cf-analytics-explanation__driver-body,
3179
+ .cf-analytics-explanation__recommendation-body {
3180
+ margin-top: 3px !important;
3181
+ color: var(--cf-muted);
3182
+ font-size: 11px;
3183
+ }
3184
+ .cf-analytics-explanation__driver-label { color: var(--cf-text); font-weight: 700; }
3185
+ .cf-analytics-explanation__recommendation {
3186
+ display: grid;
3187
+ grid-template-columns: 22px minmax(0, 1fr);
3188
+ gap: 8px;
3189
+ border-radius: 8px;
3190
+ background: var(--cf-bg);
3191
+ padding: 9px 10px;
3192
+ }
3193
+ .cf-analytics-explanation__recommendation-index {
3194
+ display: grid;
3195
+ width: 22px;
3196
+ height: 22px;
3197
+ place-items: center;
3198
+ border-radius: 999px;
3199
+ background: color-mix(in srgb, var(--cf-accent) 12%, var(--cf-surface));
3200
+ color: var(--cf-accent);
3201
+ font-size: 10px;
3202
+ font-weight: 750;
3203
+ }
3204
+ .cf-analytics-explanation__outlook {
3205
+ border-radius: 8px;
3206
+ background: var(--cf-bg);
3207
+ padding: 10px 11px;
3208
+ }
3209
+ .cf-analytics-explanation__follow-up {
3210
+ border-top: 1px solid var(--cf-border);
3211
+ padding-top: 12px;
3212
+ }
3213
+ .cf-analytics-explanation__questions {
3214
+ display: grid;
3215
+ gap: 6px;
3216
+ margin-top: 8px;
3217
+ }
3218
+ .cf-analytics-explanation__question {
3219
+ width: 100%;
3220
+ border: 1px solid var(--cf-border);
3221
+ border-radius: 8px;
3222
+ background: var(--cf-bg);
3223
+ padding: 8px 9px;
3224
+ color: var(--cf-text);
3225
+ font: inherit;
3226
+ text-align: left;
3227
+ cursor: pointer;
3228
+ }
3229
+ .cf-analytics-explanation__question:hover {
3230
+ border-color: color-mix(in srgb, var(--cf-accent) 45%, var(--cf-border));
3231
+ background: color-mix(in srgb, var(--cf-accent) 6%, var(--cf-bg));
3232
+ }
3233
+ .cf-analytics-explanation__question:focus-visible,
3234
+ .cf-analytics-explanation__limits-summary:focus-visible {
3235
+ outline: 2px solid var(--cf-accent);
3236
+ outline-offset: 2px;
3237
+ }
3238
+ .cf-analytics-explanation__limits {
3239
+ border-top: 1px solid var(--cf-border);
3240
+ padding-top: 10px;
3241
+ }
3242
+ .cf-analytics-explanation__limits-summary {
3243
+ cursor: pointer;
3244
+ color: var(--cf-text);
3245
+ font-weight: 700;
3246
+ }
3247
+ .cf-analytics-explanation__limits-list {
3248
+ margin: 8px 0 0;
3249
+ padding-left: 17px;
3250
+ color: var(--cf-muted);
3251
+ }
3252
+ .cf-analytics-explanation__source {
3253
+ border-top: 1px solid var(--cf-border);
3254
+ margin: 0;
3255
+ padding: 9px 12px;
3256
+ color: var(--cf-muted);
3257
+ font-size: 10px;
3258
+ }
3259
+
3260
+ @media (max-width: 639px) {
3261
+ .cf-panel.cf-panel--analytics-focus {
3262
+ inset: 12px;
3263
+ width: auto;
3264
+ height: auto;
3265
+ min-height: 0;
3266
+ max-width: none;
3267
+ max-height: none;
3268
+ grid-template-rows: auto minmax(0, 1fr);
3269
+ grid-template-areas: 'header' 'video';
3270
+ transform-origin: center;
1151
3271
  }
3272
+ .cf-panel--analytics-focus .cf-panel__video { height: 100%; }
3273
+ .cf-panel--analytics-focus .cf-panel__chat { display: none; }
3274
+ .cf-analytics-focus { padding: 14px; }
3275
+ .cf-analytics-visualization.is-expanded .cf-analytics-echart { min-height: 260px; }
1152
3276
  }
1153
- `;function ct(e){"@babel/helpers - typeof";return ct=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ct(e)}function lt(e,t){if(ct(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ct(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ut(e){var t=lt(e,`string`);return ct(t)==`symbol`?t:t+``}function dt(e,t,n){return(t=ut(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ft=`centrinfo-widget`;var pt=class extends HTMLElement{constructor(...e){super(...e),dt(this,`controls`,null)}mountWith(t){let r=ot(t),i=this.shadowRoot??this.attachShadow({mode:`open`});if(`adoptedStyleSheets`in Document.prototype&&typeof CSSStyleSheet<`u`){let e=new CSSStyleSheet;e.replaceSync(st),i.adoptedStyleSheets=[e]}else{let e=document.createElement(`style`);e.textContent=st,i.appendChild(e)}(0,e.render)((0,n.jsx)(it,{transport:r.demo?new h:r.preview?new x(new a(r.apiBaseUrl,r.token,r.gifApiKey),r.strings):new a(r.apiBaseUrl,r.token,r.gifApiKey),config:r,bindControls:e=>this.controls=e}),i)}open(){this.controls?.open()}close(){this.controls?.close()}toggle(){this.controls?.toggle()}identify(e){this.controls?.identify(e)}clear(){this.controls?.startNew()}shutdown(){this.controls?.shutdown()}unmount(){this.shadowRoot&&(0,e.render)(null,this.shadowRoot)}};typeof customElements<`u`&&!customElements.get(ft)&&customElements.define(ft,pt);const mt=e=>{if(typeof document>`u`)throw Error(`[centrinfo-widget] createWidget must run in a browser.`);let t=document.createElement(ft);return t.style.pointerEvents=`none`,t.style.position=`fixed`,t.style.inset=`0`,t.style.width=`0`,t.style.height=`0`,document.body.appendChild(t),t.mountWith(e),{open:()=>t.open(),close:()=>t.close(),toggle:()=>t.toggle(),show:()=>t.open(),hide:()=>t.close(),identify:e=>t.identify(e),update:e=>t.identify(e),clear:()=>t.clear(),shutdown:()=>t.shutdown(),logout:()=>t.shutdown(),destroy:()=>{t.unmount(),t.remove()}}};let ht=null;const gt=e=>(ht?.destroy(),ht=mt(e),ht),_t={init:gt,createWidget:mt};exports.Centrinfo=_t,exports.createWidget=mt,exports.init=gt;
3277
+ `;function U(e){"@babel/helpers - typeof";return U=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},U(e)}function W(e,t){if(U(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(U(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function G(e){var t=W(e,`string`);return U(t)==`symbol`?t:t+``}function Ct(e,t,n){return(t=G(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const wt=`centrinfo-widget`;var K=class extends HTMLElement{constructor(...e){super(...e),Ct(this,`controls`,null)}mountWith(n){let i=e.t(n),a=this.shadowRoot??this.attachShadow({mode:`open`});if(this.style.zIndex=String(i.zIndex),`adoptedStyleSheets`in Document.prototype&&typeof CSSStyleSheet<`u`){let e=new CSSStyleSheet;e.replaceSync(St),a.adoptedStyleSheets=[e]}else{let e=document.createElement(`style`);e.textContent=St,a.appendChild(e)}(0,t.render)((0,r.jsx)(xt,{transport:i.demo?new e.v:i.preview?new e._(new e.y(i.apiBaseUrl,i.token,i.gifApiKey,i.analyticsContextToken,{agentName:i.agentName,agentAvatarUrl:i.agentAvatarUrl},i.identityToken,i.getIdentityToken,i.chatSurface),i.strings):new e.y(i.apiBaseUrl,i.token,i.gifApiKey,i.analyticsContextToken,{agentName:i.agentName,agentAvatarUrl:i.agentAvatarUrl},i.identityToken,i.getIdentityToken,i.chatSurface),config:i,bindControls:e=>this.controls=e}),a)}open(){this.controls?.open()}close(){this.controls?.close()}toggle(){this.controls?.toggle()}identify(e){this.controls?.identify(e)}clear(){this.controls?.startNew()}shutdown(){this.controls?.shutdown()}unmount(){this.shadowRoot&&(0,t.render)(null,this.shadowRoot)}};typeof customElements<`u`&&!customElements.get(wt)&&customElements.define(wt,K);const Tt=(e,t=document.body)=>{if(typeof document>`u`)throw Error(`[centrinfo-widget] createWidget must run in a browser.`);let n=document.createElement(wt);return n.style.pointerEvents=`none`,n.style.position=`fixed`,n.style.inset=`0`,n.style.width=`0`,n.style.height=`0`,t.appendChild(n),n.mountWith(e),{open:()=>n.open(),close:()=>n.close(),toggle:()=>n.toggle(),show:()=>n.open(),hide:()=>n.close(),identify:e=>n.identify(e),update:e=>n.identify(e),clear:()=>n.clear(),shutdown:()=>n.shutdown(),logout:()=>n.shutdown(),destroy:()=>{n.unmount(),n.remove()}}},Et=e=>Tt(e);let Dt=null;const Ot=e=>{Dt?.destroy();let t=Et(e);return Dt=t,t},kt={init:Ot,createWidget:Et};exports.Centrinfo=kt,exports.createWidget=Et,exports.init=Ot;