@accurix/centrinfo-widget 1.0.0 โ 1.0.1
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/README.md +62 -9
- package/dist/cdn/centrinfo-widget.js +2153 -225
- package/dist/cdn/manifest.json +6 -6
- package/dist/config-CCkOySUT.mjs +29 -0
- package/dist/config-CzrfVSPp.cjs +35 -0
- package/dist/index.cjs +2118 -218
- package/dist/index.d.cts +3 -291
- package/dist/index.d.mts +2 -293
- package/dist/index.d.ts +2 -293
- package/dist/index.mjs +2118 -218
- package/dist/runtime.cjs +1 -0
- package/dist/runtime.d.cts +245 -0
- package/dist/runtime.d.mts +245 -0
- package/dist/runtime.mjs +1 -0
- package/dist/types-DQWp12Cg.d.mts +661 -0
- package/dist/types-rfkc-TtX.d.cts +658 -0
- package/package.json +33 -17
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import{createContext as e,render as t}from"preact";import{useCallback as n,useContext as r,useEffect as i,useMemo as a,useRef as o,useState as s}from"preact/hooks";import{Fragment as c,jsx as l,jsxs as u}from"preact/jsx-runtime";var d=class extends Error{constructor(e,t){super(t),this.status=e,this.name=`ApiError`}};const f=()=>({agentName:`Assistant`,greeting:`Hi! ๐ How can I help you today?`,allowVoiceInput:!1,availableActions:[]});var p=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=h(t)??`request failed (${e.status})`;throw new d(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 f();let t=await this.json(e);return{...f(),...t}}catch{return f()}}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):g(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:v(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(m(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 m=(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},h=e=>{let t=e?.message;if(Array.isArray(t))return t.join(`, `);if(typeof t==`string`)return t},g=async(e,t)=>{let n=e.getReader(),r=new TextDecoder,i={answer:``,sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1,requestedContactFields:[],conversationEnded:!1},a=``;for(;;){let{done:e,value:o}=await n.read();if(e)break;a+=r.decode(o,{stream:!0});let s;for(;(s=a.indexOf(`
|
|
2
|
-
|
|
3
|
-
`))!==-1;){let e=a.slice(0,s);a=a.slice(s+2);let n=_(e);if(n){if(n.event===`error`)throw new d(502,n.data?.message??`stream error`);if(n.event===`chunk`&&typeof n.data?.text==`string`)i.answer+=n.data.text,t.onChunk(n.data.text);else if(n.event===`final`&&n.data)i.sources=n.data.sources??[],i.suggestedReplies=n.data.suggestedReplies??[],i.availableActions=n.data.availableActions??[],i.handoffOffered=!!n.data.handoffOffered,i.requestedContactFields=v(n.data.requestedContactFields),i.conversationEnded=!!n.data.conversationEnded;else if(n.event===`done`)return i}}}return i},_=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}}},v=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],y=e=>new Promise(t=>setTimeout(t,e)),b={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?`]},x=[{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}}],S={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 C=class{async bootstrap(){return await y(180),b}async stream(e,t,n){await y(550);let r=x.find(t=>t.match.test(e)),i=r?r.result:S,a=i.answer.split(/(\s+)/);for(let e of a){if(n.signal?.aborted)break;n.onChunk(e),await y(18+Math.min(40,e.length*6))}return{...i,availableActions:b.availableActions}}async action(e,t){return await y(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 y(700),`How do I track a shipment?`}async extract(e,t,n){return await y(600),`[Attached file${n?`: ${n}`:``}] Invoice #4821 โ 3 pallets, Rotterdam โ Lagos, ETA 12 days.`}async identify(e,t){await y(50)}async endConversation(e){await y(50)}async sendFeedback(){await y(50)}async demoSlots(e,t){return await y(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 y(280);let t=e.trim().toLowerCase(),n=t?D.filter(e=>e.alt.includes(t)||e.tags.some(e=>e.includes(t)||t.includes(e))):D;return(n.length>0?n:D).map(e=>({id:e.id,url:E(e.emoji,e.anim),preview:E(e.emoji,e.anim),alt:e.alt}))}};const w=`<animateTransform attributeName='transform' attributeType='XML' type='translate' values='0 0;0 -16;0 0' dur='0.7s' repeatCount='indefinite'/>`,T=`<animateTransform attributeName='transform' attributeType='XML' type='rotate' values='-14 64 110;14 64 110;-14 64 110' dur='0.9s' repeatCount='indefinite'/>`,E=(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)}`},D=[{id:`g1`,emoji:`๐`,alt:`thumbs up`,tags:[`thumbs`,`yes`,`ok`,`great`,`good`],anim:w},{id:`g2`,emoji:`๐`,alt:`celebrate`,tags:[`party`,`yay`,`congrats`,`celebrate`],anim:T},{id:`g3`,emoji:`๐`,alt:`wave hello`,tags:[`hi`,`hello`,`hey`,`wave`,`bye`],anim:T},{id:`g4`,emoji:`โค๏ธ`,alt:`heart`,tags:[`love`,`thanks`,`heart`],anim:w},{id:`g5`,emoji:`๐ค`,alt:`thinking`,tags:[`hmm`,`think`,`thinking`],anim:T},{id:`g6`,emoji:`๐`,alt:`laughing`,tags:[`lol`,`funny`,`haha`,`laugh`],anim:w},{id:`g7`,emoji:`๐ฅ`,alt:`fire`,tags:[`fire`,`hot`,`lit`,`awesome`],anim:w},{id:`g8`,emoji:`๐`,alt:`rocket`,tags:[`rocket`,`launch`,`fast`,`go`],anim:T}],O=e=>new Promise(t=>setTimeout(t,e));var k=class{constructor(e,t){this.real=e,this.strings=t}bootstrap(){return this.real.bootstrap()}async stream(e,t,n){await O(300);for(let e of this.strings.previewReply.split(/(\s+)/)){if(n.signal?.aborted)break;n.onChunk(e),await O(16)}return{answer:this.strings.previewReply,sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1}}async action(){return await O(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 A=[{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(`.`)}],j={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`}]}},M={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`},N=(e,t)=>e.replace(/\{(\w+)\}/g,(e,n)=>t[n]??``),ee=e=>e?{...M,...e}:M,te=e(M),ne=te.Provider,P=()=>r(te),F=(e,t)=>l(`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}),re=e=>l(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,...e,children:l(`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`})}),ie=e=>F(l(`path`,{d:`m6 9 6 6 6-6`}),e),I=e=>F(u(c,{children:[l(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),l(`path`,{d:`M22 2 11 13`})]}),e),L=e=>F(u(c,{children:[l(`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`}),l(`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`}),l(`line`,{x1:`12`,y1:`19`,x2:`12`,y2:`22`})]}),e),R=e=>F(u(c,{children:[l(`path`,{d:`M15 3h6v6`}),l(`path`,{d:`M10 14 21 3`}),l(`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`})]}),e),z=e=>F(u(c,{children:[l(`rect`,{x:`3`,y:`4`,width:`18`,height:`18`,rx:`2`}),l(`line`,{x1:`16`,y1:`2`,x2:`16`,y2:`6`}),l(`line`,{x1:`8`,y1:`2`,x2:`8`,y2:`6`}),l(`line`,{x1:`3`,y1:`10`,x2:`21`,y2:`10`})]}),e),B=e=>F(u(c,{children:[l(`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}),l(`path`,{d:`m22 7-10 5L2 7`})]}),e),V=e=>F(l(`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),H=e=>F(u(c,{children:[l(`circle`,{cx:`12`,cy:`12`,r:`9`}),l(`path`,{d:`M8.5 14.5a4 4 0 0 0 7 0`}),l(`line`,{x1:`9`,y1:`9.5`,x2:`9.01`,y2:`9.5`}),l(`line`,{x1:`15`,y1:`9.5`,x2:`15.01`,y2:`9.5`})]}),e),ae=e=>F(u(c,{children:[l(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),l(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]}),e),oe=e=>F(u(c,{children:[l(`path`,{d:`M11 5 6 9H2v6h4l5 4z`}),l(`path`,{d:`M15.5 8.5a5 5 0 0 1 0 7`}),l(`path`,{d:`M19 5a9 9 0 0 1 0 14`})]}),e),se=e=>F(u(c,{children:[l(`path`,{d:`M11 5 6 9H2v6h4l5 4z`}),l(`line`,{x1:`22`,y1:`9`,x2:`16`,y2:`15`}),l(`line`,{x1:`16`,y1:`9`,x2:`22`,y2:`15`})]}),e),ce=e=>F(l(`path`,{d:`M20 6 9 17l-5-5`}),e),le=e=>F(u(c,{children:[l(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`}),l(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),e),ue=e=>F(u(c,{children:[l(`path`,{d:`M1 4v6h6`}),l(`path`,{d:`M3.51 15a9 9 0 1 0 2.13-9.36L1 10`})]}),e),de=e=>F(l(`rect`,{x:`6`,y:`6`,width:`12`,height:`12`,rx:`2`}),e),U=e=>F(l(`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),fe=e=>F(u(c,{children:[l(`path`,{d:`M18.36 6.64a9 9 0 1 1-12.73 0`}),l(`line`,{x1:`12`,y1:`2`,x2:`12`,y2:`12`})]}),e),pe=e=>F(u(c,{children:[l(`circle`,{cx:`12`,cy:`12`,r:`9`}),l(`path`,{d:`M12 7v5l3 2`})]}),e),me=e=>F(u(c,{children:[l(`path`,{d:`M7 10v12`}),l(`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),he=e=>F(u(c,{children:[l(`path`,{d:`M17 14V2`}),l(`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),ge=e=>F(u(c,{children:[l(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),l(`path`,{d:`m19 12-7 7-7-7`})]}),e),_e=/(`[^`]+`)|(\*\*[^*]+\*\*)|(\[[^\]]+\]\(https?:\/\/[^\s)]+\))|(https?:\/\/[^\s)]+)/g,W=e=>{let t=[],n=0,r=0,i;for(_e.lastIndex=0;(i=_e.exec(e))!==null;){i.index>n&&t.push(e.slice(n,i.index));let a=i[0];if(a.startsWith("`"))t.push(l(`code`,{class:`cf-md-code`,children:a.slice(1,-1)},r++));else if(a.startsWith(`**`))t.push(l(`strong`,{children:a.slice(2,-2)},r++));else if(a.startsWith(`[`)){let e=/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/.exec(a),n=e?e[1]:a,i=e?e[2]:`#`;t.push(l(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer nofollow`,children:n},r++))}else t.push(l(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer nofollow`,children:a},r++));n=i.index+a.length}return n<e.length&&t.push(e.slice(n)),t},ve=/^(```|#{1,6}\s|\s*[-*]\s|\s*\d+\.\s)/,ye=e=>{let t=e.replace(/\r\n/g,`
|
|
6
|
-
`).split(`
|
|
7
|
-
`),n=[],r=0,i=0;for(;i<t.length;){let e=t[i];if(e.trim().startsWith("```")){let e=[];for(i++;i<t.length&&!t[i].trim().startsWith("```");)e.push(t[i]),i++;i++,n.push(l(`pre`,{class:`cf-md-pre`,children:l(`code`,{children:e.join(`
|
|
8
|
-
`)})},r++));continue}if(e.trim()===``){i++;continue}let a=/^(#{1,6})\s+(.*)$/.exec(e);if(a){n.push(l(`div`,{class:`cf-md-h`,children:W(a[2])},r++)),i++;continue}if(/^\s*[-*]\s+/.test(e)){let e=[];for(;i<t.length&&/^\s*[-*]\s+/.test(t[i]);)e.push(l(`li`,{children:W(t[i].replace(/^\s*[-*]\s+/,``))},e.length)),i++;n.push(l(`ul`,{class:`cf-md-list`,children:e},r++));continue}if(/^\s*\d+\.\s+/.test(e)){let e=[];for(;i<t.length&&/^\s*\d+\.\s+/.test(t[i]);)e.push(l(`li`,{children:W(t[i].replace(/^\s*\d+\.\s+/,``))},e.length)),i++;n.push(l(`ol`,{class:`cf-md-list`,children:e},r++));continue}let o=[e];for(i++;i<t.length&&t[i].trim()!==``&&!ve.test(t[i]);)o.push(t[i]),i++;n.push(l(`p`,{children:W(o.join(` `))},r++))}return n},G=()=>{let e=o(null);return i(()=>{let t=requestAnimationFrame(()=>e.current?.scrollIntoView({block:`end`}));return()=>cancelAnimationFrame(t)},[]),e},K=e=>e.trim().split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()??``).join(``)||`๐ค`,be=({persona:e,small:t})=>{let n=t?`cf-msg__avatar`:`cf-header__avatar`;return e?.agentAvatarUrl?l(`span`,{class:n,children:l(`img`,{src:e.agentAvatarUrl,alt:``})}):l(`span`,{class:n,children:e?K(e.agentName):`ยท`})},q=()=>{let e=P();return u(`div`,{class:`cf-msg__bubble cf-typing`,"aria-label":e.assistantTyping,children:[l(`span`,{class:`cf-typing__dot`}),l(`span`,{class:`cf-typing__dot`}),l(`span`,{class:`cf-typing__dot`})]})},xe=({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 r=n.slice(0,3),i=n.length-r.length;return u(`div`,{class:`cf-sources`,children:[r.map((e,t)=>e.url?u(`a`,{class:`cf-source`,href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,title:e.title||e.url,children:[l(R,{}),l(`span`,{children:e.title||e.url})]},t):u(`span`,{class:`cf-source`,title:e.title,children:[l(R,{}),l(`span`,{children:e.title})]},t)),i>0&&u(`span`,{class:`cf-source cf-source--more`,children:[`+`,i,` more`]})]})},Se=({replies:e,onPick:t})=>e&&e.length>0?l(`div`,{class:`cf-chips`,children:e.map((e,n)=>l(`button`,{type:`button`,class:`cf-chip`,onClick:()=>t(e),children:e},n))}):null,Ce={public_book_demo:{type:`book-demo`,label:`Book a demo`,Icon:z},public_submit_inquiry:{type:`inquiry`,label:`Leave a message`,Icon:B},public_request_callback:{type:`request-callback`,label:`Request a callback`,Icon:V},public_subscribe_newsletter:{type:`subscribe-newsletter`,label:`Subscribe`,Icon:B}},we=({field:e,value:t,onInput:n})=>{let r=e.placeholder??e.label,i={class:`cf-form__input`,placeholder:e.required?`${r} *`:r,value:t,"aria-label":e.label,onInput:e=>n(e.target.value)};return e.kind===`textarea`?l(`textarea`,{rows:2,...i}):l(`input`,{type:e.kind,...i})},Te=({spec:e,visitor:t,onSubmit:n,onCancel:r})=>{let i=P(),a=G(),[o,c]=s(()=>{let n={};for(let r of e.fields)r.identity&&t[r.identity]&&(n[r.key]=t[r.identity]);return n}),[d,f]=s(`idle`),[p,m]=s(``),h=e=>!!(e.identity&&t[e.identity]?.trim()),g=e.fields.filter(e=>!h(e)),_=g.every(e=>!e.required||(o[e.key]?.trim()??``)!==``),v=t.email||t.name||``;return d===`done`?u(`div`,{class:`cf-form cf-form--done`,children:[l(ce,{}),l(`span`,{children:p})]}):u(`div`,{class:`cf-form`,ref:a,children:[l(`div`,{class:`cf-form__title`,children:e.title}),g.length===0&&v&&u(`div`,{class:`cf-form__as`,children:[`as `,v]}),g.map(e=>l(we,{field:e,value:o[e.key]??``,onInput:t=>c(n=>({...n,[e.key]:t}))},e.key)),d===`error`&&l(`div`,{class:`cf-form__err`,children:i.formError}),u(`div`,{class:`cf-form__actions`,children:[r&&l(`button`,{type:`button`,class:`cf-form__cancel`,onClick:r,children:`Cancel`}),l(`button`,{type:`button`,class:`cf-form__submit`,disabled:!_||d===`submitting`,onClick:async()=>{if(!_||d===`submitting`)return;f(`submitting`);let t={},r={};for(let n of e.fields){let e=o[n.key]?.trim();e&&(t[n.key]=e,n.identity&&(r[n.identity]=e))}try{m((await n(t,r)).note||i.formThanks),f(`done`)}catch{f(`error`)}},children:d===`submitting`?i.sending:e.submit})]})]})},J=e=>String(e).padStart(2,`0`),Ee=()=>{let e=[];for(let t=9;t<=17;t++)e.push(`${J(t)}:00`),e.push(`${J(t)}:30`);return e},De=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})},Y=(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}`}},X=(e,t)=>{let[n,r]=t.split(`:`).map(Number);return new Date(e.getFullYear(),e.getMonth(),e.getDate(),n??0,r??0)},Oe=({visitor:e,onSubmit:t,onCancel:n,onDemoSlots:r,scheduler:o})=>{let d=P(),f=G(),p=a(()=>De(14),[]),m=a(()=>Ee(),[]),[h,g]=s(a(()=>{let e=Date.now();for(let t=0;t<p.length;t++)if(m.some(n=>X(p[t],n).getTime()>e))return t;return 0},[p,m])),[_,v]=s(null),[y,b]=s(e.name??``),[x,S]=s(e.email??``),[C,w]=s(`idle`),[T,E]=s(``),[D,O]=s(``),[k,A]=s(``),M=o?.connected&&o.mode===`link`,ee=async()=>{if(C===`submitting`||!e.email?.trim()&&!x.trim())return;w(`submitting`),O(``);let n={};x.trim()&&(n.email=x.trim()),y.trim()&&(n.name=y.trim());try{let e=await t({...x.trim()?{visitorEmail:x.trim()}:{},...y.trim()?{visitorName:y.trim()}:{}},n),r=e.booking?.schedulingLink||o?.bookingLink||``;if(!r){w(`error`);return}try{window.open(r,`_blank`,`noopener,noreferrer`)}catch{}A(r),E(e.note||d.bookingLinkOpened),w(`done`)}catch{w(`error`)}},[te,ne]=s(new Set),[F,re]=s([]),[ie,I]=s(0),[L,z]=s(!1);i(()=>{if(!r)return;let e=!0,t=new Date,n=new Date;return n.setDate(n.getDate()+15),r(t.toISOString(),n.toISOString()).then(t=>{e&&(ne(new Set(t.taken.map(e=>Date.parse(e)).filter(e=>!Number.isNaN(e)))),re(t.busy.map(e=>[Date.parse(e.start),Date.parse(e.end)]).filter(([e,t])=>!Number.isNaN(e)&&!Number.isNaN(t))))}).catch(()=>{}),()=>{e=!1}},[r,ie]);let B=!!e.email?.trim(),V=!!_&&(B||x.trim()!==``),H=e.email||e.name||``,ae=e=>te.has(X(p[h],e).getTime()),oe=e=>X(p[h],e).getTime()<=Date.now(),se=e=>{let t=X(p[h],e).getTime(),n=t+18e5;return F.some(([e,r])=>t<r&&n>e)},le=async()=>{if(!V||C===`submitting`||!_)return;w(`submitting`),z(!1),O(``);let e=X(p[h],_),n=Y(p[h],_),r={};x.trim()&&(r.email=x.trim()),y.trim()&&(r.name=y.trim());try{let i=await t({preferredAt:n,slotAt:e.toISOString(),...x.trim()?{visitorEmail:x.trim()}:{},...y.trim()?{visitorName:y.trim()}:{}},r);i.booking?.confirmed?(E(i.note||N(d.bookingConfirmed,{when:n})),A(i.booking.meetingUrl||i.booking.eventLink||``)):E(i.note||N(d.bookingRequested,{when:n})),w(`done`)}catch(t){if(t?.status===409)ne(t=>new Set(t).add(e.getTime())),v(null),z(!0),I(e=>e+1),w(`idle`);else{let e=t?.message;O(e&&e.length<120?e:``),w(`error`)}}};return C===`done`?u(`div`,{class:`cf-form cf-form--done`,children:[l(ce,{}),l(`span`,{children:T}),k&&u(`a`,{class:`cf-booking__link`,href:k,target:`_blank`,rel:`noopener noreferrer`,children:[M?d.bookingOpenScheduler:d.bookingMeetingLink,` `,l(R,{})]})]}):M?u(`div`,{class:`cf-form cf-booking`,ref:f,children:[l(`div`,{class:`cf-form__title`,children:j[`book-demo`].title}),l(`div`,{class:`cf-booking__hint`,children:N(d.bookingViaProvider,{provider:o?.label??`the scheduler`})}),B?H?u(`div`,{class:`cf-form__as`,children:[`as `,H]}):null:u(c,{children:[l(`input`,{class:`cf-form__input`,type:`text`,placeholder:d.handoffName,value:y,"aria-label":d.handoffName,onInput:e=>b(e.target.value)}),l(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${d.handoffEmail} *`,value:x,"aria-label":d.handoffEmail,onInput:e=>S(e.target.value)})]}),C===`error`&&l(`div`,{class:`cf-form__err`,children:D||d.formError}),u(`div`,{class:`cf-form__actions`,children:[n&&l(`button`,{type:`button`,class:`cf-form__cancel`,onClick:n,children:d.cancel}),l(`button`,{type:`button`,class:`cf-form__submit`,disabled:C===`submitting`||!B&&x.trim()===``,onClick:ee,children:C===`submitting`?d.sending:d.bookingOpenScheduler})]})]}):u(`div`,{class:`cf-form cf-booking`,ref:f,children:[l(`div`,{class:`cf-form__title`,children:j[`book-demo`].title}),u(`div`,{class:`cf-booking__hint`,children:[d.bookingPickTime,` ยท `,l(`span`,{class:`cf-booking__dur`,children:d.bookingDuration})]}),l(`div`,{class:`cf-booking__dates`,role:`tablist`,"aria-label":`Pick a day`,children:p.map((e,t)=>u(`button`,{type:`button`,role:`tab`,"aria-selected":t===h,class:`cf-booking__date ${t===h?`is-selected`:``}`,onClick:()=>{g(t),v(null)},children:[l(`span`,{class:`cf-booking__dow`,children:e.toLocaleDateString(void 0,{weekday:`short`})}),l(`span`,{class:`cf-booking__dom`,children:e.getDate()})]},t))}),l(`div`,{class:`cf-booking__slots`,role:`listbox`,"aria-label":`Pick a time`,children:m.map(e=>{let t=oe(e),n=se(e),r=ae(e),i=r||t||n;return l(`button`,{type:`button`,role:`option`,"aria-selected":_===e,disabled:i,title:t?`Earlier today`:n?`Busy on the calendar`:r?`Already booked`:void 0,class:`cf-booking__slot ${_===e?`is-selected`:``} ${i?`is-taken`:``}`,onClick:()=>v(e),children:e},e)})}),L&&l(`div`,{class:`cf-form__err`,children:d.bookingSlotTaken}),B?H?u(`div`,{class:`cf-form__as`,children:[`as `,H]}):null:u(c,{children:[l(`input`,{class:`cf-form__input`,type:`text`,placeholder:d.handoffName,value:y,"aria-label":d.handoffName,onInput:e=>b(e.target.value)}),l(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${d.handoffEmail} *`,value:x,"aria-label":d.handoffEmail,onInput:e=>S(e.target.value)})]}),C===`error`&&l(`div`,{class:`cf-form__err`,children:D||d.formError}),u(`div`,{class:`cf-form__actions`,children:[n&&l(`button`,{type:`button`,class:`cf-form__cancel`,onClick:n,children:d.cancel}),l(`button`,{type:`button`,class:`cf-form__submit`,disabled:!V||C===`submitting`,onClick:le,children:C===`submitting`?d.sending:j[`book-demo`].submit})]})]})},ke=({actions:e,visitor:t,onSubmitForm:n,onDemoSlots:r,scheduler:i,exclude:a=[]})=>{let[o,c]=s(null),d=(e??[]).map(e=>Ce[e]).filter(e=>!!e&&!a.includes(e.type));return d.length===0?null:o===`book-demo`?l(Oe,{visitor:t,onCancel:()=>c(null),onSubmit:(e,t)=>n(`book-demo`,e,t),onDemoSlots:r,scheduler:i}):o?l(Te,{spec:j[o],visitor:t,onCancel:()=>c(null),onSubmit:(e,t)=>n(o,e,t)}):l(`div`,{class:`cf-actions`,children:d.map(({type:e,label:t,Icon:n})=>u(`button`,{type:`button`,class:`cf-action`,onClick:()=>c(e),children:[l(n,{}),t]},e))})},Ae=({hasEmail:e,visitor:t,question:n,onSubmitForm:r})=>{let i=P(),[a,o]=s(!1),[c,d]=s(!1),[f,p]=s(t.name??``),[m,h]=s(t.email??``);if(e)return null;if(a){let e=t.email||m;return u(`div`,{class:`cf-handoff cf-handoff--done`,children:[l(ce,{}),l(`span`,{children:N(i.handoffShared,{email:e})})]})}let g=async()=>{if(!(!m.trim()||c)){d(!0);try{await r(`inquiry`,{visitorEmail:m.trim(),...f.trim()?{visitorName:f.trim()}:{},message:n||`I had a question the assistant couldnโt answer.`,subject:`Help request from chat`},{email:m.trim(),name:f.trim()||void 0}),o(!0)}catch{d(!1)}}};return u(`div`,{class:`cf-handoff`,children:[l(`div`,{class:`cf-handoff__title`,children:i.handoffTitle}),l(`input`,{class:`cf-form__input`,type:`text`,placeholder:i.handoffName,value:f,"aria-label":i.handoffName,onInput:e=>p(e.target.value)}),l(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${i.handoffEmail} *`,value:m,"aria-label":i.handoffEmail,onInput:e=>h(e.target.value)}),l(`button`,{type:`button`,class:`cf-form__submit`,disabled:!m.trim()||c,onClick:g,children:c?i.sending:i.handoffNotify})]})},je=({text:e})=>{let t=P(),[n,r]=s(!1);return u(`button`,{type:`button`,class:`cf-tool`,onClick:async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)}catch{}},"aria-label":t.copy,children:[l(n?ce:le,{}),n?t.copied:t.copy]})},Me=({items:e,onPick:t})=>e.length===0?null:l(`div`,{class:`cf-starters`,children:e.map((e,n)=>l(`button`,{type:`button`,class:`cf-starter`,onClick:()=>t(e),children:e},n))}),Ne=({msg:e,onRate:t})=>{let n=P(),[r,i]=s(!1),[a,o]=s(``),c=e.feedback,d=()=>{t(e.id,`up`),i(!1)},f=()=>{t(e.id,`down`),i(!0)},p=()=>{t(e.id,`down`,a.trim()),i(!1)};return u(`div`,{class:`cf-feedback`,children:[u(`div`,{class:`cf-feedback__row`,children:[l(`button`,{type:`button`,class:`cf-feedback__btn ${c===`up`?`is-active`:``}`,"aria-label":n.feedbackHelpful,"aria-pressed":c===`up`,onClick:d,children:l(me,{})}),l(`button`,{type:`button`,class:`cf-feedback__btn ${c===`down`?`is-active`:``}`,"aria-label":n.feedbackNotHelpful,"aria-pressed":c===`down`,onClick:f,children:l(he,{})}),c&&!r&&l(`span`,{class:`cf-feedback__thanks`,children:n.feedbackThanks})]}),r&&c===`down`&&u(`div`,{class:`cf-feedback__comment`,children:[l(`textarea`,{class:`cf-feedback__input`,rows:2,placeholder:n.feedbackCommentPlaceholder,value:a,onInput:e=>o(e.target.value)}),l(`button`,{type:`button`,class:`cf-feedback__send`,onClick:p,children:n.feedbackSend})]})]})},Pe=({msg:e,persona:t,isLast:n,visitor:r,hasEmail:i,lastQuestion:a,showActions:o,onPickReply:s,onSubmitForm:d,onDemoSlots:f,onRetry:p,ratable:m,onRate:h})=>{let g=P(),_=e.role===`user`,v=e.requestedContactFields?.includes(`email`)===!0,y=n&&!_&&!!(e.handoffOffered||v),b=y&&!i?[`inquiry`]:[],x=!e.pending&&!e.streaming;return u(`div`,{class:`cf-msg cf-msg--${_?`user`:`agent`}`,children:[!_&&l(be,{persona:t,small:!0}),u(`div`,{class:`cf-msg__col`,children:[e.pending&&e.content===``?l(q,{}):e.imageUrl?u(`div`,{class:`cf-msg__bubble cf-msg__bubble--media`,children:[l(`img`,{class:`cf-msg__media`,src:e.imageUrl,alt:`GIF`}),e.content&&l(`span`,{class:`cf-msg__caption`,children:e.content})]}):u(`div`,{class:`cf-msg__bubble`,children:[_?e.content:ye(e.content),e.streaming&&l(`span`,{class:`cf-caret`,"aria-hidden":`true`})]}),_&&e.attachmentName&&u(`div`,{class:`cf-attach-chip`,title:e.attachmentName,children:[l(U,{}),l(`span`,{children:e.attachmentName})]}),!_&&u(c,{children:[x&&(e.error||e.content)&&l(`div`,{class:`cf-msg__tools`,children:e.error?u(`button`,{type:`button`,class:`cf-tool`,onClick:()=>p(e.id,e.retryText??``),children:[l(ue,{}),g.retry]}):l(je,{text:e.content})}),x&&m&&!e.error&&e.content&&l(Ne,{msg:e,onRate:h}),l(xe,{msg:e}),n&&l(Se,{replies:e.suggestedReplies,onPick:s}),y&&l(Ae,{hasEmail:i,visitor:r,question:a,onSubmitForm:d}),o&&l(ke,{actions:e.availableActions,visitor:r,onSubmitForm:d,onDemoSlots:f,scheduler:t?.scheduler,exclude:b})]})]})]})},Fe=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).split(`,`)[1]??``),r.onerror=n,r.readAsDataURL(e)}),Ie=({onPick:e})=>l(`div`,{class:`cf-picker cf-emoji`,children:A.map(t=>u(`div`,{class:`cf-emoji__group`,children:[l(`div`,{class:`cf-emoji__label`,children:t.name}),l(`div`,{class:`cf-emoji__grid`,children:t.emojis.map((t,n)=>l(`button`,{type:`button`,class:`cf-emoji__btn`,onClick:()=>e(t),"aria-label":t,children:t},n))})]},t.name))}),Le=({onSearch:e,onPick:t})=>{let n=P(),[r,a]=s(``),[o,c]=s([]),[d,f]=s(!0);return i(()=>{let t=!0;f(!0);let n=setTimeout(()=>{e(r).then(e=>t&&(c(e),f(!1))).catch(()=>t&&(c([]),f(!1)))},300);return()=>{t=!1,clearTimeout(n)}},[r,e]),u(`div`,{class:`cf-picker cf-gif`,children:[l(`input`,{class:`cf-gif__search`,placeholder:n.searchGifs,value:r,"aria-label":n.searchGifs,onInput:e=>a(e.target.value)}),l(`div`,{class:`cf-gif__grid`,children:d?l(`div`,{class:`cf-gif__hint`,children:n.searchingGifs}):o.length===0?l(`div`,{class:`cf-gif__hint`,children:n.noGifs}):o.map(e=>l(`button`,{type:`button`,class:`cf-gif__item`,onClick:()=>t(e.url),"aria-label":e.alt,children:l(`img`,{src:e.preview,alt:e.alt,loading:`lazy`})},e.id))}),l(`div`,{class:`cf-gif__powered`,children:`via Tenor`})]})},Re=({onSend:e,onSendGif:t,disabled:n,allowVoice:r,onTranscribe:a,gifEnabled:d,onSearchGifs:f,allowAttach:p,onExtract:m})=>{let h=P(),[g,_]=s(``),[v,y]=s(!1),[b,x]=s(`none`),[S,C]=s(null),[w,T]=s(!1),[E,D]=s(``),O=o(null),k=o(null),A=o(null),j=o(null),M=o([]);i(()=>{let e=O.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,110)}px`)},[g]),i(()=>{if(b===`none`)return;let e=e=>{k.current&&!e.composedPath().includes(k.current)&&x(`none`)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[b]);let N=e=>x(t=>t===e?`none`:e),ee=e=>{let t=O.current;if(!t){_(t=>t+e);return}let n=t.selectionStart??g.length,r=t.selectionEnd??g.length;_(g.slice(0,n)+e+g.slice(r)),requestAnimationFrame(()=>{t.focus();let r=n+e.length;t.setSelectionRange(r,r)})},te=e=>{x(`none`),t(e)},ne=async e=>{let t=e.target,n=t.files?.[0];if(t.value=``,n){if(D(``),n.size>8388608){D(h.attachTooLarge);return}T(!0);try{let e=await m(await Fe(n),n.type||`application/octet-stream`,n.name);if(!e){D(h.attachFailed);return}C({name:n.name,text:e})}catch{D(h.attachFailed)}finally{T(!1)}}},F=(!!g.trim()||!!S)&&!n&&!w,re=()=>{F&&(e(g,S?{attachmentName:S.name,attachmentText:S.text}:void 0),_(``),C(null),D(``))},ie=e=>{e.key===`Enter`&&!e.shiftKey?(e.preventDefault(),re()):e.key===`Escape`&&b!==`none`&&(e.preventDefault(),e.stopPropagation(),x(`none`))},R=async()=>{if(v){j.current?.stop();return}try{let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e);M.current=[],t.ondataavailable=e=>e.data.size>0&&M.current.push(e.data),t.onstop=async()=>{e.getTracks().forEach(e=>e.stop()),y(!1);let n=new Blob(M.current,{type:t.mimeType||`audio/webm`});try{let e=await a(await Fe(n),n.type);e&&_(t=>t?`${t} ${e}`:e)}catch{}},j.current=t,t.start(),y(!0)}catch{let e=await a(``,`audio/webm`).catch(()=>``);e&&_(t=>t?`${t} ${e}`:e)}};return u(`div`,{class:`cf-composer`,ref:k,children:[b===`emoji`&&l(Ie,{onPick:ee}),b===`gif`&&l(Le,{onSearch:f,onPick:te}),(S||w||E)&&l(`div`,{class:`cf-attach-row`,children:w?l(`span`,{class:`cf-attach-status`,children:h.attaching}):E?l(`span`,{class:`cf-attach-status cf-attach-status--err`,children:E}):S&&u(`span`,{class:`cf-attach-chip`,title:S.name,children:[l(U,{}),l(`span`,{children:S.name}),l(`button`,{type:`button`,class:`cf-attach-x`,"aria-label":`Remove attachment`,onClick:()=>C(null),children:l(ae,{})})]})}),u(`div`,{class:`cf-composer__field`,children:[l(`button`,{type:`button`,class:`cf-iconbtn ${b===`emoji`?`is-active`:``}`,"aria-label":h.emoji,"aria-pressed":b===`emoji`,onClick:()=>N(`emoji`),children:l(b===`emoji`?ae:H,{})}),d&&l(`button`,{type:`button`,class:`cf-iconbtn cf-gifbtn ${b===`gif`?`is-active`:``}`,"aria-label":h.gifs,"aria-pressed":b===`gif`,onClick:()=>N(`gif`),children:l(`span`,{class:`cf-gif-label`,children:`GIF`})}),p&&u(c,{children:[l(`input`,{ref:A,type:`file`,class:`cf-file-input`,accept:`image/png,image/jpeg,image/webp,image/gif,application/pdf`,onChange:ne,tabIndex:-1,"aria-hidden":`true`}),l(`button`,{type:`button`,class:`cf-iconbtn`,"aria-label":h.attachFile,disabled:w,onClick:()=>A.current?.click(),children:l(U,{})})]}),l(`textarea`,{ref:O,class:`cf-textarea`,rows:1,placeholder:h.composerPlaceholder,value:g,"aria-label":h.composerPlaceholder,disabled:n,onInput:e=>_(e.target.value),onKeyDown:ie}),r&&l(`button`,{type:`button`,class:`cf-iconbtn cf-mic ${v?`is-recording`:``}`,"aria-label":v?h.stopRecording:h.recordVoice,"aria-pressed":v,onClick:R,children:l(L,{})}),l(`button`,{type:`button`,class:`cf-send`,"aria-label":h.send,disabled:!F,onClick:re,children:l(I,{})})]})]})};let ze=!0,Z=null;const Be=e=>{ze=e},Ve=()=>{let e=typeof window<`u`?window.AudioContext??window.webkitAudioContext:void 0;if(!e)return null;if(!Z)try{Z=new e}catch{return null}return Z.state===`suspended`&&Z.resume(),Z},He=(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)},Ue=e=>{if(!ze)return;let t=Ve();if(!t)return;let n=t.currentTime;try{e===`open`?(He(t,523,n,.12,`sine`,.05),He(t,784,n+.08,.16,`sine`,.05)):e===`send`?He(t,660,n,.08,`triangle`,.04):e===`receive`&&(He(t,880,n,.1,`sine`,.045),He(t,1175,n+.09,.14,`sine`,.045))}catch{}},Q=()=>typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.round(Math.random()*1e9)}`,$=e=>{try{return e===`none`?null:e===`session`?sessionStorage:localStorage}catch{return null}},We=e=>`centrinfo:session:${e.slice(0,12)}`,Ge=e=>`centrinfo:visitor:${e.slice(0,12)}`,Ke=(e,t)=>`centrinfo:chat:${e.slice(0,12)}:${t}`,qe=e=>`centrinfo:history:${e.slice(0,12)}`,Je=720*60*60*1e3,Ye=(e,t)=>{try{return JSON.parse(e?.getItem(Ge(t))||`{}`)}catch{return{}}},Xe=(e,t)=>{if(!e)return Q();try{let n=We(t),r=e.getItem(n);if(r)return r;let i=Q();return e.setItem(n,i),i}catch{return Q()}},Ze=(e,t,n)=>{if(!e)return{};try{let r=e.getItem(Ke(t,n));return r?JSON.parse(r):{}}catch{return{}}},Qe=(e,t,n)=>{let{ts:r,messages:i}=Ze(e,t,n);return!Array.isArray(i)||typeof r==`number`&&Date.now()-r>Je?[]:i},$e=(e,t,n)=>{let{ts:r,messages:i,ended:a}=Ze(e,t,n);return!Array.isArray(i)||i.length===0||typeof r==`number`&&Date.now()-r>Je?!1:a===!0||typeof r==`number`&&Date.now()-r>864e5},et=(e,t,n,r,i)=>{if(e)try{let a=r.filter(e=>!e.pending).slice(-50);if(a.length===0)return;e.setItem(Ke(t,n),JSON.stringify({ts:Date.now(),messages:a,ended:i}))}catch{}},tt=(e,t)=>{if(!e)return[];try{let n=e.getItem(qe(t)),r=n?JSON.parse(n):[];return Array.isArray(r)?r:[]}catch{return[]}},nt=(e,t,n)=>{if(e)try{e.setItem(qe(t),JSON.stringify(n.slice(0,20)))}catch{}},rt=(e,t)=>{if(e)try{let n=`centrinfo:chat:${t.slice(0,12)}:`,r=new Set([We(t),Ge(t),qe(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{}},it=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`},at=(e,t)=>{let r=o($(t.persistence)).current,a=o(Xe(r,t.token)),c=o(null),[l,u]=s(null),[d,f]=s(()=>Qe(r,t.token,a.current)),[p,m]=s(!1),[h,g]=s(()=>$e(r,t.token,a.current)),[_,v]=s(()=>Ye(r,t.token)),[y,b]=s(()=>tt(r,t.token)),[x,S]=s(null),[C,w]=s([]),T=o(_);i(()=>{T.current=_},[_]);let E=n(()=>{c.current?.abort(),rt(r,t.token);let e=Q();a.current=e;try{r?.setItem(We(t.token),e)}catch{}S(null),w([]),g(!1),b([]),v({}),f(l?[{id:Q(),role:`assistant`,content:l.greeting,availableActions:l.availableActions}]:[])},[r,t.token,l]),D=n(e=>{try{r?.setItem(Ge(t.token),JSON.stringify(e))}catch{}},[r,t.token]),O=n(t=>{let n=(t.email??``).trim().toLowerCase(),r=(T.current.email??``).trim().toLowerCase();n&&r&&n!==r&&E();let i={};t.email?.trim()&&(i.email=t.email.trim()),t.phone?.trim()&&(i.phone=t.phone.trim());let o=[t.firstName,t.lastName].filter(e=>!!e?.trim()).join(` `).trim()||t.name?.trim()||``;o&&(i.name=o),Object.keys(i).length>0&&v(e=>{let t={...i,...e};return D(t),t}),e.identify(a.current,t).catch(()=>{})},[e,D,E]);i(()=>{let n=!0;return e.bootstrap().then(e=>{n&&(u(e),f(t=>t.length>0?t:[{id:Q(),role:`assistant`,content:e.greeting,availableActions:e.availableActions}]))}),t.user&&O(t.user),()=>{n=!1}},[]),i(()=>{et(r,t.token,a.current,d,h)},[d,h,r,t.token]),i(()=>{d.some(e=>e.role===`user`)&&b(e=>{let n=a.current,i=[{sessionId:n,ts:Date.now(),title:it(d),ended:h},...e.filter(e=>e.sessionId!==n)];return nt(r,t.token,i),i.slice(0,20)})},[d,h,r,t.token]);let k=n((e,t)=>{f(n=>n.map(n=>n.id===e?{...n,...t}:n))},[]),A=n((n,r)=>{m(!0);let i=new AbortController;c.current=i,e.stream(n,a.current,{signal:i.signal,onChunk:e=>f(t=>t.map(t=>t.id===r?{...t,content:t.content+e,pending:!1,streaming:!0}:t))}).then(e=>{f(n=>n.map(n=>n.id===r?{...n,content:e.answer||n.content||t.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}:n)),Ue(`receive`),t.onMessage?.({role:`assistant`,content:e.answer}),e.handoffOffered&&t.onHandoff?.(),e.conversationEnded&&g(!0)}).catch(e=>{if(i.signal.aborted){k(r,{pending:!1,streaming:!1});return}k(r,{content:e?.status===429?t.strings.errorRateLimit:t.strings.errorGeneric,pending:!1,streaming:!1,error:!0,retryText:n})}).finally(()=>{m(!1),c.current=null})},[e,t,k]),j=n((e,n={})=>{let r=e.trim(),{imageUrl:i,attachmentName:a,attachmentText:o}=n;if(!r&&!i&&!o||p||h)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},l=Q();f(e=>[...e,c,{id:l,role:`assistant`,content:``,pending:!0}]),Ue(`send`),t.onMessage?.({role:`user`,content:s}),A(s,l)},[p,h,t,A]),M=n(()=>c.current?.abort(),[]),N=n((e,t)=>{p||h||!t||(k(e,{content:``,pending:!0,streaming:!1,error:!1}),Ue(`send`),A(t,e))},[p,h,k,A]),ee=n((t,n,r)=>{k(t,{feedback:n});let i=d.findIndex(e=>e.id===t),o=i>=0?d[i]?.content:void 0,s;for(let e=i-1;e>=0;e--)if(d[e]?.role===`user`){s=d[e]?.content;break}e.sendFeedback({sessionId:a.current,messageId:t,rating:n,comment:r,question:s,answer:o}).catch(()=>{})},[e,k,d]),te=n(async(n,r,i={})=>{t.onAction?.(n);let o=await e.action(n,{sessionId:a.current,...r}),s={};return i.name?.trim()&&(s.name=i.name.trim()),i.email?.trim()&&(s.email=i.email.trim()),i.phone?.trim()&&(s.phone=i.phone.trim()),Object.keys(s).length>0&&(v(e=>{let t={...e,...s};return D(t),t}),s.email&&n!==`contact`&&e.action(`contact`,{sessionId:a.current,...s}).catch(()=>{})),Ue(`receive`),o},[e,t,D]),ne=n(e=>{let t=e.trim();t&&f(e=>e.some(e=>e.role===`assistant`&&e.content===t)?e:[...e,{id:Q(),role:`assistant`,content:t}])},[]),P=n((t,n)=>{e.sendFeedback({sessionId:a.current,messageId:`__csat__`,rating:t,comment:n}).catch(()=>{})},[e]),F=n((t,n)=>e.transcribe(t,n),[e]),re=n((t,n,r)=>e.extract(t,n,r),[e]),ie=n(t=>e.searchGifs(t),[e]),I=n((t,n)=>e.demoSlots(t,n),[e]),L=n(e=>j(``,{imageUrl:e}),[j]),R=t.demo||!!t.gifApiKey,z=n(()=>{c.current?.abort(),g(!0),e.endConversation(a.current).catch(()=>{})},[e]),B=n(()=>{c.current?.abort();let e=Q();a.current=e;try{r?.setItem(We(t.token),e)}catch{}S(null),w([]),g(!1),f(l?[{id:Q(),role:`assistant`,content:l.greeting,availableActions:l.availableActions}]:[])},[r,t.token,l]),V=n(e=>{if(e===a.current){S(null);return}w(Qe(r,t.token,e)),S(e)},[r,t.token]),H=n(()=>{S(null),w([])},[]);return{persona:l,messages:d,sending:p,visitor:_,starters:t.starters.length>0?t.starters:l?.starterQuestions??[],hasEmail:!!_.email,send:j,sendGif:L,stop:M,retry:N,rateMessage:ee,injectAssistant:ne,submitCsat:P,submitForm:te,transcribe:F,extract:re,searchGifs:ie,demoSlots:I,gifEnabled:R,identify:O,ended:h,endConversation:z,startNew:B,history:y,viewingSessionId:x,viewMessages:C,openConversation:V,closeHistoryView:H,shutdown:E}},ot=e=>{let[t,n]=s(`light`);return i(()=>{if(e!==`auto`||typeof matchMedia>`u`)return;let t=matchMedia(`(prefers-color-scheme: dark)`),r=()=>n(t.matches?`dark`:`light`);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),e===`auto`?t:e},st=({transport:e,config:t,bindControls:r})=>{let a=t.strings,{persona:c,messages:d,sending:f,visitor:p,hasEmail:m,starters:h,send:g,sendGif:_,stop:v,retry:y,rateMessage:b,injectAssistant:x,submitCsat:S,submitForm:C,transcribe:w,extract:T,searchGifs:E,demoSlots:D,gifEnabled:O,identify:k,ended:A,endConversation:j,startNew:M,history:N,viewingSessionId:ee,viewMessages:te,openConversation:P,closeHistoryView:F,shutdown:I}=at(e,t),[L,R]=s(t.openByDefault),[z,B]=s(0),[V,H]=s(()=>{try{return localStorage.getItem(`centrinfo:muted`)===`1`}catch{return!1}}),ae=ot(t.theme);i(()=>{Be(t.sound&&!V)},[t.sound,V]);let ce=n(()=>{H(e=>{let t=!e;try{localStorage.setItem(`centrinfo:muted`,t?`1`:`0`)}catch{}return t})},[]),le=o(null),ue=o(null),U=o(null),_e=o(0),[W,ve]=s(!0),[ye,G]=s(!1),[K,q]=s(!1),xe=o(null),[Se,Ce]=s(!1),[we,Te]=s(!1),J=!!ee,Ee=J?te:d,De=n(()=>{R(!0),B(0),Ue(`open`),t.onOpen?.(),t.onShow?.()},[t]),Y=n(()=>{R(!1),t.onClose?.(),t.onHide?.(),ue.current?.focus()},[t]),X=n(()=>L?Y():De(),[L,De,Y]),Oe=n(()=>q(!0),[]),ke=n(()=>{j(),q(!1)},[j]),Ae=n(()=>{M(),G(!1),ve(!0)},[M]);i(()=>{K&&xe.current?.focus()},[K]),i(()=>{r({open:De,close:Y,toggle:X,identify:k,startNew:M,endConversation:j,shutdown:I})},[r,De,Y,X,k,M,j,I]),i(()=>{let e=d.filter(e=>e.role===`assistant`&&!e.pending).length;if(L){_e.current=e;return}e>_e.current&&B(e-_e.current)},[d,L]),i(()=>{t.onUnreadChange?.(z)},[z,t]),i(()=>{let e=t.sessionDurationMinutes;if(!e||e<=0)return;let n=setTimeout(()=>I(),e*60*1e3);return()=>clearTimeout(n)},[t.sessionDurationMinutes,d,L,I]),i(()=>{let e=t.customLauncherSelector;if(!e||typeof document>`u`)return;let n=[];try{n=Array.from(document.querySelectorAll(e))}catch{return}let r=e=>{e.preventDefault(),X()};return n.forEach(e=>e.addEventListener(`click`,r)),()=>n.forEach(e=>e.removeEventListener(`click`,r))},[t.customLauncherSelector,X]);let je=o(!1);i(()=>{let e=t.proactiveMessage?.trim();if(!e||je.current)return;let n=t.proactiveOnPaths??[],r=typeof location<`u`?location.pathname:``;if(n.length>0&&!n.some(e=>r.includes(e)))return;let i=`centrinfo:proactive:${t.token.slice(0,12)}`;try{if(sessionStorage.getItem(i)===`1`)return}catch{}let a=setTimeout(()=>{if(!(L||A||d.some(e=>e.role===`user`))){je.current=!0;try{sessionStorage.setItem(i,`1`)}catch{}x(e),De()}},Math.max(0,t.proactiveDelaySeconds)*1e3);return()=>clearTimeout(a)},[t.proactiveMessage]),i(()=>{let e=U.current;!L||!e||(d[d.length-1]?.role===`user`||W?(e.scrollTop=e.scrollHeight,G(!1)):G(!0))},[d,L,f,W]);let Ne=n(()=>{let e=U.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<80;ve(t),t&&G(!1)},[]),Fe=n(()=>{let e=U.current;e&&(e.scrollTop=e.scrollHeight),G(!1),ve(!0)},[]),[Ie,Le]=s(``),ze=o(!1);i(()=>{if(ze.current&&!f){let e=[...d].reverse().find(e=>e.role===`assistant`&&!e.streaming&&!e.pending&&e.content);e&&Le(e.content)}ze.current=f},[f,d]),i(()=>{if(!L)return;let e=le.current;K||e?.querySelector(`.cf-textarea`)?.focus();let t=t=>{if(t.key===`Escape`){if(t.preventDefault(),K){q(!1);return}Y();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,Y,K]),i(()=>{let e=le.current;e&&(L?e.removeAttribute(`inert`):e.setAttribute(`inert`,``))},[L]);let Z=t.accentColor??c?.accentColor,Ve={zIndex:t.zIndex,"--cf-h-pad":`${t.horizontalPadding}px`,"--cf-v-pad":`${t.verticalPadding}px`,...Z?{"--cf-accent":Z,"--cf-accent-2":`color-mix(in oklab, ${Z} 76%, #14141f)`}:{}},He=e=>g(e),Q=[...d].reverse().find(e=>e.role===`user`&&e.content.trim())?.content??``,$=d.some(e=>e.role===`user`),We=!$&&!!(c?.agentDescription||c?.welcomeSubtitle);return l(ne,{value:a,children:u(`div`,{class:`cf-root`,"data-theme":ae,"data-align":t.alignment,style:Ve,children:[u(`div`,{ref:le,class:`cf-panel ${L?`is-open`:``}`,role:`dialog`,"aria-modal":`false`,"aria-label":`Chat with ${c?.agentName??`us`}`,"aria-hidden":!L,children:[u(`div`,{class:`cf-header`,children:[l(be,{persona:c}),u(`div`,{class:`cf-header__meta`,children:[l(`div`,{class:`cf-header__name`,children:c?.agentName??`Chat`}),l(`div`,{class:`cf-header__status ${c?.offline?`cf-header__status--offline`:``}`,children:l(`span`,{class:`cf-header__status-text`,children:c?.offline?a.statusOffline:a.statusOnline})})]}),u(`div`,{class:`cf-header__actions`,children:[N.length>0&&l(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":a.pastConversations,title:a.pastConversations,"aria-pressed":Se,onClick:()=>Ce(e=>!e),children:l(pe,{})}),$&&!A&&!J&&l(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":a.endChat,title:a.endChat,onClick:Oe,children:l(fe,{})}),t.sound&&l(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":V?a.unmuteSounds:a.muteSounds,"aria-pressed":V,onClick:ce,children:l(V?se:oe,{})}),l(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":a.closeChat,onClick:Y,children:l(ie,{})})]})]}),t.preview&&l(`div`,{class:`cf-preview-banner`,children:a.previewBanner}),J&&l(`div`,{class:`cf-viewing-banner`,children:a.viewingPast}),u(`div`,{class:`cf-body`,ref:U,role:`log`,onScroll:Ne,children:[We&&!J&&u(`div`,{class:`cf-welcome`,children:[c?.agentDescription&&l(`p`,{class:`cf-welcome__desc`,children:c.agentDescription}),c?.welcomeSubtitle&&l(`p`,{class:`cf-welcome__sub`,children:c.welcomeSubtitle})]}),Ee.map((e,t)=>l(Pe,{msg:e,persona:c,isLast:!J&&t===Ee.length-1,visitor:p,hasEmail:m,lastQuestion:Q,showActions:!J&&t===Ee.length-1&&(!$||!!e.handoffOffered),onPickReply:He,onSubmitForm:C,onDemoSlots:D,onRetry:y,ratable:!J&&Ee.slice(0,t).some(e=>e.role===`user`),onRate:b},e.id)),!$&&!J&&l(Me,{items:h,onPick:g}),ye&&u(`button`,{type:`button`,class:`cf-newmsg`,onClick:Fe,children:[l(ge,{}),a.newMessages]})]}),l(`div`,{class:`cf-sr-live`,"aria-live":`polite`,"aria-atomic":`true`,children:Ie}),f&&!A&&!J&&l(`div`,{class:`cf-stopbar`,children:u(`button`,{type:`button`,class:`cf-stop`,onClick:v,children:[l(de,{}),a.stop]})}),J?l(`div`,{class:`cf-ended`,children:l(`button`,{type:`button`,class:`cf-ended__btn`,onClick:F,children:a.backToChat})}):A?u(`div`,{class:`cf-ended`,children:[l(`p`,{class:`cf-ended__text`,children:a.conversationEnded}),t.csat&&$?we?l(`p`,{class:`cf-ended__text`,children:a.feedbackThanks}):u(`div`,{class:`cf-csat`,children:[l(`span`,{class:`cf-csat__q`,children:a.csatPrompt}),l(`button`,{type:`button`,class:`cf-csat__btn`,"aria-label":a.feedbackHelpful,onClick:()=>{S(`up`),Te(!0)},children:l(me,{})}),l(`button`,{type:`button`,class:`cf-csat__btn`,"aria-label":a.feedbackNotHelpful,onClick:()=>{S(`down`),Te(!0)},children:l(he,{})})]}):null,l(`button`,{type:`button`,class:`cf-ended__btn`,onClick:Ae,children:a.startNewChat})]}):l(Re,{onSend:g,onSendGif:_,disabled:f,allowVoice:!!c?.allowVoiceInput,onTranscribe:w,gifEnabled:O,onSearchGifs:E,allowAttach:t.attachments,onExtract:T}),!A&&c?.disclaimerText&&l(`div`,{class:`cf-disclaimer`,children:c.disclaimerText}),u(`div`,{class:`cf-footer`,children:[a.poweredBy,` `,l(`a`,{href:`https://accurix.tech/centrinfo`,target:`_blank`,rel:`noopener noreferrer`,children:`Centrinfo`})]}),K&&l(`div`,{class:`cf-confirm`,onClick:()=>q(!1),children:u(`div`,{class:`cf-confirm__card`,role:`alertdialog`,"aria-modal":`true`,"aria-label":a.endChatConfirm,onClick:e=>e.stopPropagation(),children:[l(`div`,{class:`cf-confirm__title`,children:a.endChatConfirm}),l(`div`,{class:`cf-confirm__body`,children:a.endChatConfirmBody}),u(`div`,{class:`cf-confirm__actions`,children:[l(`button`,{ref:xe,type:`button`,class:`cf-confirm__btn cf-confirm__btn--cancel`,onClick:()=>q(!1),children:a.cancel}),l(`button`,{type:`button`,class:`cf-confirm__btn cf-confirm__btn--danger`,onClick:ke,children:a.endConfirmCta})]})]})}),Se&&l(`div`,{class:`cf-confirm`,onClick:()=>Ce(!1),children:u(`div`,{class:`cf-history`,role:`dialog`,"aria-modal":`true`,"aria-label":a.pastConversations,onClick:e=>e.stopPropagation(),children:[u(`div`,{class:`cf-history__head`,children:[l(`span`,{children:a.pastConversations}),l(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":a.closeChat,onClick:()=>Ce(!1),children:l(ie,{})})]}),l(`div`,{class:`cf-history__list`,children:N.map(e=>u(`button`,{type:`button`,class:`cf-history__item ${e.sessionId===ee?`is-active`:``}`,onClick:()=>{P(e.sessionId),Ce(!1)},children:[l(`span`,{class:`cf-history__title`,children:e.title}),u(`span`,{class:`cf-history__meta`,children:[new Date(e.ts).toLocaleDateString(void 0,{month:`short`,day:`numeric`}),e.ended?` ยท ${a.historyEnded}`:``]})]},e.sessionId))})]})})]}),!t.hideDefaultLauncher&&u(`button`,{ref:ue,type:`button`,class:`cf-launcher`,"aria-label":L?a.closeChat:a.openChat,"aria-expanded":L,onClick:X,children:[t.launcherIcon?l(`img`,{class:`cf-launcher__img`,src:t.launcherIcon,alt:``}):l(re,{}),!L&&z>0&&l(`span`,{class:`cf-launcher__badge`,children:z})]})]})})},ct=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:ee(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}},lt=`
|
|
1
|
+
import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h}from"./config-CCkOySUT.mjs";import{render as g}from"preact";import{useCallback as _,useEffect as v,useMemo as y,useRef as b,useState as x}from"preact/hooks";import{Fragment as S,jsx as C,jsxs as w}from"preact/jsx-runtime";const T=[`audio/webm;codecs=opus`,`audio/webm`,`audio/ogg;codecs=opus`,`audio/ogg`],E=e=>{let t=globalThis.MediaRecorder;if(typeof t?.isTypeSupported==`function`){for(let n of T)if(t.isTypeSupported(n))try{return new t(e,{mimeType:n})}catch{}}return new t(e)},D=e=>{if(!(!e||e.state!==`recording`)){try{e.requestData()}catch{}e.stop()}},O=[{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(`.`)}],ee={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`}]}},k=(e,t)=>C(`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}),A=e=>C(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,...e,children:C(`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`})}),j=e=>k(C(`path`,{d:`m6 9 6 6 6-6`}),e),te=e=>k(w(S,{children:[C(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),C(`path`,{d:`M22 2 11 13`})]}),e),ne=e=>k(w(S,{children:[C(`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`}),C(`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`}),C(`line`,{x1:`12`,y1:`19`,x2:`12`,y2:`22`})]}),e),M=e=>k(w(S,{children:[C(`path`,{d:`M9 9v1a3 3 0 0 0 4.24 2.73`}),C(`path`,{d:`M15 5.5V5a3 3 0 0 0-5.94-.6`}),C(`path`,{d:`M19 10v2a7 7 0 0 1-9.9 6.36`}),C(`path`,{d:`M5 10v2a6.98 6.98 0 0 0 1.11 3.79`}),C(`line`,{x1:`12`,y1:`19`,x2:`12`,y2:`22`}),C(`line`,{x1:`2`,y1:`2`,x2:`22`,y2:`22`})]}),e),re=e=>k(w(S,{children:[C(`path`,{d:`M15 3h6v6`}),C(`path`,{d:`M10 14 21 3`}),C(`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`})]}),e),ie=e=>k(w(S,{children:[C(`rect`,{x:`3`,y:`4`,width:`18`,height:`18`,rx:`2`}),C(`line`,{x1:`16`,y1:`2`,x2:`16`,y2:`6`}),C(`line`,{x1:`8`,y1:`2`,x2:`8`,y2:`6`}),C(`line`,{x1:`3`,y1:`10`,x2:`21`,y2:`10`})]}),e),N=e=>k(w(S,{children:[C(`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}),C(`path`,{d:`m22 7-10 5L2 7`})]}),e),ae=e=>k(C(`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),oe=e=>k(w(S,{children:[C(`circle`,{cx:`12`,cy:`12`,r:`9`}),C(`path`,{d:`M8.5 14.5a4 4 0 0 0 7 0`}),C(`line`,{x1:`9`,y1:`9.5`,x2:`9.01`,y2:`9.5`}),C(`line`,{x1:`15`,y1:`9.5`,x2:`15.01`,y2:`9.5`})]}),e),P=e=>k(w(S,{children:[C(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),C(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]}),e),se=e=>k(w(S,{children:[C(`path`,{d:`M11 5 6 9H2v6h4l5 4z`}),C(`path`,{d:`M15.5 8.5a5 5 0 0 1 0 7`}),C(`path`,{d:`M19 5a9 9 0 0 1 0 14`})]}),e),ce=e=>k(w(S,{children:[C(`path`,{d:`M11 5 6 9H2v6h4l5 4z`}),C(`line`,{x1:`22`,y1:`9`,x2:`16`,y2:`15`}),C(`line`,{x1:`16`,y1:`9`,x2:`22`,y2:`15`})]}),e),F=e=>k(C(`path`,{d:`M20 6 9 17l-5-5`}),e),le=e=>k(w(S,{children:[C(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`}),C(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),e),I=e=>k(w(S,{children:[C(`path`,{d:`M1 4v6h6`}),C(`path`,{d:`M3.51 15a9 9 0 1 0 2.13-9.36L1 10`})]}),e),ue=e=>k(C(`rect`,{x:`6`,y:`6`,width:`12`,height:`12`,rx:`2`}),e),de=e=>k(C(`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),fe=e=>k(w(S,{children:[C(`path`,{d:`M18.36 6.64a9 9 0 1 1-12.73 0`}),C(`line`,{x1:`12`,y1:`2`,x2:`12`,y2:`12`})]}),e),pe=e=>k(w(S,{children:[C(`circle`,{cx:`12`,cy:`12`,r:`9`}),C(`path`,{d:`M12 7v5l3 2`})]}),e),me=e=>k(w(S,{children:[C(`path`,{d:`M7 10v12`}),C(`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),L=e=>k(w(S,{children:[C(`path`,{d:`M17 14V2`}),C(`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),he=e=>k(w(S,{children:[C(`path`,{d:`M15 3h6v6`}),C(`path`,{d:`M9 21H3v-6`}),C(`path`,{d:`M21 3l-7 7`}),C(`path`,{d:`M3 21l7-7`})]}),e),ge=e=>k(w(S,{children:[C(`path`,{d:`M9 3v6H3`}),C(`path`,{d:`M15 21v-6h6`}),C(`path`,{d:`M9 9 2 2`}),C(`path`,{d:`M15 15l7 7`})]}),e),_e=e=>k(w(S,{children:[C(`rect`,{x:`3`,y:`4`,width:`18`,height:`14`,rx:`2`}),C(`rect`,{x:`11`,y:`11`,width:`8`,height:`6`,rx:`1`,fill:`currentColor`,stroke:`none`})]}),e),ve=e=>k(w(S,{children:[C(`rect`,{x:`4`,y:`5`,width:`16`,height:`14`,rx:`2`}),C(`path`,{d:`M12 15V9`}),C(`path`,{d:`m8.5 12.5 3.5-3.5 3.5 3.5`})]}),e),ye=e=>k(w(S,{children:[C(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),C(`path`,{d:`m19 12-7 7-7-7`})]}),e),R=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)}`},be=e=>e?.name?.trim()?e.version?`${e.name.trim()} ยท v${e.version}`:e.name.trim():``,xe=({model:e,answeredAt:t,reportingPeriod:n,filters:r=[],rowCount:i})=>{let a=be(e);return w(`div`,{class:`cf-analytics-meta`,"data-testid":`analytics-result-meta`,"aria-label":`Result details`,children:[a?C(`span`,{class:`cf-analytics-meta__model`,children:a}):null,w(`span`,{children:[C(`span`,{"aria-hidden":`true`,class:`cf-analytics-meta__dot`}),R(t)]}),n?.label?C(`span`,{children:n.label}):null,typeof i==`number`?w(`span`,{children:[i,` `,i===1?`row`:`rows`]}):null,r.length>0?w(`span`,{children:[r.length,` applied `,r.length===1?`filter`:`filters`]}):null]})},Se=({label:e,value:t,detail:n})=>w(`section`,{class:`cf-analytics-kpi`,"aria-label":e,"data-testid":`analytics-kpi`,children:[C(`div`,{class:`cf-analytics-kpi__label`,children:e}),C(`div`,{class:`cf-analytics-kpi__value`,children:t}),n?C(`div`,{class:`cf-analytics-kpi__detail`,children:n}):null]}),Ce=({title:e=`No matching data`,description:t=`No approved records matched this question.`})=>w(`section`,{class:`cf-analytics-empty`,role:`status`,"data-testid":`analytics-empty-state`,children:[C(`p`,{children:e}),C(`p`,{children:t})]}),we=({explanation:e,onFollowUp:t,showLead:n=!1,maxFollowUps:r=3})=>w(`section`,{class:`cf-analytics-explanation`,"data-testid":`inline-analytics-explanation`,"aria-label":`Analysis and supporting evidence`,children:[n?w(`div`,{class:`cf-analytics-explanation__lead`,"data-testid":`analytics-explanation-lead`,children:[w(`div`,{class:`cf-analytics-explanation__lead-meta`,children:[C(`span`,{class:`cf-analytics-explanation__eyebrow`,children:`Answer from your data`}),w(`span`,{class:`cf-analytics-explanation__provenance`,children:[C(`span`,{"aria-hidden":`true`,class:`cf-analytics-explanation__provenance-dot`}),e.source===`ai_grounded`?`AI-assisted ยท evidence checked`:`Based on current values`]})]}),C(`h3`,{class:`cf-analytics-explanation__headline`,children:e.headline}),C(`p`,{class:`cf-analytics-explanation__summary`,children:e.summary})]}):null,w(`div`,{class:`cf-analytics-explanation__body`,children:[(e.evidence?.length??0)>0?w(`section`,{class:`cf-analytics-explanation__section`,children:[C(`h4`,{class:`cf-analytics-explanation__heading`,children:`What the numbers show`}),C(`ul`,{class:`cf-analytics-explanation__evidence`,children:e.evidence?.slice(0,4).map(e=>w(`li`,{class:`cf-analytics-explanation__evidence-item`,children:[C(`span`,{"aria-hidden":`true`,class:`cf-analytics-explanation__evidence-bullet`}),C(`span`,{children:e})]},e))})]}):null,e.businessMeaning?w(`section`,{class:`cf-analytics-explanation__meaning`,children:[C(`h4`,{class:`cf-analytics-explanation__heading`,children:`Why this may matter`}),C(`p`,{class:`cf-analytics-explanation__paragraph`,children:e.businessMeaning})]}):null,(e.possibleDrivers?.length??0)>0?w(`section`,{class:`cf-analytics-explanation__section`,children:[w(`div`,{class:`cf-analytics-explanation__section-heading`,children:[C(`h4`,{class:`cf-analytics-explanation__heading`,children:`Possibilities worth checking`}),C(`span`,{class:`cf-analytics-explanation__hint`,children:`These are not proven causes`})]}),C(`div`,{class:`cf-analytics-explanation__drivers`,children:e.possibleDrivers?.slice(0,2).map(e=>w(`article`,{class:`cf-analytics-explanation__driver`,children:[C(`p`,{class:`cf-analytics-explanation__driver-title`,children:e.hypothesis}),w(`p`,{class:`cf-analytics-explanation__driver-body`,children:[C(`span`,{class:`cf-analytics-explanation__driver-label`,children:`How to check:`}),` `,e.howToCheck]})]},`${e.hypothesis}-${e.howToCheck}`))})]}):null,(e.recommendations?.length??0)>0?w(`section`,{class:`cf-analytics-explanation__section`,children:[C(`h4`,{class:`cf-analytics-explanation__heading`,children:`Useful next steps`}),C(`div`,{class:`cf-analytics-explanation__recommendations`,children:e.recommendations?.slice(0,3).map((e,t)=>w(`article`,{class:`cf-analytics-explanation__recommendation`,children:[C(`span`,{class:`cf-analytics-explanation__recommendation-index`,children:t+1}),w(`div`,{children:[C(`p`,{class:`cf-analytics-explanation__recommendation-title`,children:e.action}),C(`p`,{class:`cf-analytics-explanation__recommendation-body`,children:e.why}),e.successMetric?w(`p`,{class:`cf-analytics-explanation__recommendation-body`,children:[C(`span`,{class:`cf-analytics-explanation__driver-label`,children:`Watch:`}),` `,e.successMetric]}):null]})]},`${e.action}-${e.why}`))})]}):null,e.forecast?w(`section`,{class:`cf-analytics-explanation__outlook`,children:[w(`div`,{class:`cf-analytics-explanation__outlook-header`,children:[C(`h4`,{class:`cf-analytics-explanation__heading`,children:`Outlook`}),C(`span`,{class:`cf-analytics-explanation__outlook-badge`,children:`Validated estimate`})]}),C(`p`,{class:`cf-analytics-explanation__paragraph`,children:e.forecast.text}),e.forecast.limitations?C(`p`,{class:`cf-analytics-explanation__recommendation-body`,children:e.forecast.limitations}):null]}):null,t&&(e.followUps?.length??0)>0?w(`section`,{class:`cf-analytics-explanation__section cf-analytics-explanation__follow-up`,children:[C(`h4`,{class:`cf-analytics-explanation__heading`,children:`Ask a follow-up`}),C(`div`,{class:`cf-analytics-explanation__questions`,children:e.followUps?.slice(0,r).map(e=>C(`button`,{type:`button`,class:`cf-analytics-explanation__question`,onClick:()=>t(e),children:e},e))})]}):null,(e.limitations?.length??0)>0?w(`details`,{class:`cf-analytics-explanation__limits`,children:[C(`summary`,{class:`cf-analytics-explanation__limits-summary`,children:`Important limits`}),C(`ul`,{class:`cf-analytics-explanation__limits-list`,children:e.limitations?.map(e=>C(`li`,{children:e},e))})]}):null]}),C(`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.`})]}),Te=()=>{let e=b(null);return v(()=>{let t=requestAnimationFrame(()=>e.current?.scrollIntoView({block:`end`}));return()=>cancelAnimationFrame(t)},[]),e},Ee=e=>e.trim().split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()??``).join(``)||`๐ค`,De=e=>{let t=e?.avatarId?.trim().toLowerCase().replace(/[^a-z0-9-]/g,`-`);return t?` cf-avatar-preset--${t}`:``},Oe={"support-guide":`SG`,"sales-host":`SH`,"calm-advisor":`CA`,"technical-guide":`TG`,"school-desk":`SD`,"front-office":`FO`},z=e=>{let t=e?.avatarId?.trim().toLowerCase();return t&&Oe[t]||(e?Ee(e.agentName):`ยท`)},ke=({persona:e,small:t,hideWhenMissing:n})=>{let r=t?`cf-msg__avatar`:`cf-header__avatar`,i=e?.agentAvatarUrl?.trim();return i?C(`span`,{class:r,children:C(`img`,{src:i,alt:``})}):n?null:C(`span`,{class:`${r}${De(e)}`,children:z(e)})},Ae=()=>{let e=n();return w(`div`,{class:`cf-msg__bubble cf-typing`,"aria-label":e.assistantTyping,children:[C(`span`,{class:`cf-typing__label`,children:`Thinking`}),C(`span`,{class:`cf-typing__dot`}),C(`span`,{class:`cf-typing__dot`}),C(`span`,{class:`cf-typing__dot`})]})},je=({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 r=n.slice(0,3),i=n.length-r.length;return w(`div`,{class:`cf-sources`,children:[r.map((e,t)=>e.url?w(`a`,{class:`cf-source`,href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,title:e.title||e.url,children:[C(re,{}),C(`span`,{children:e.title||e.url})]},t):w(`span`,{class:`cf-source`,title:e.title,children:[C(re,{}),C(`span`,{children:e.title})]},t)),i>0&&w(`span`,{class:`cf-source cf-source--more`,children:[`+`,i,` more`]})]})},B=({replies:e,onPick:t})=>e&&e.length>0?C(`div`,{class:`cf-chips`,children:e.map((e,n)=>C(`button`,{type:`button`,class:`cf-chip`,onClick:()=>t(e),children:e},n))}):null,Me=({persona:e,starters:t,onPick:n,onFocusComposer:r,speaking:i,voiceState:a=`idle`,replyPending:o=!1,pinned:s=!1,muted:c=!1,onToggleMute:l,onEndCall:u,onTalkNow:d,showTalkNow:f=!1,micLevel:p=0,theaterMode:m=!1,onToggleTheater:h,onMinimize:g,audioDevices:_=[],selectedAudioDeviceId:v=``,onSelectAudioDevice:y,connectingOnly:b=!1})=>{if(!e||!(e.talkbackMode===`avatar`||e.widgetModule===`assistant`||e.allowVoiceInput))return null;let x=e.agentAvatarUrl?.trim()||``,T=e.assistantMediaUrl?.trim()||x,E=e.assistantMediaKind===`video`&&!!T,D=t.slice(0,3),O=a!==`idle`,ee=a===`idle`?`Speak with ${e.agentName}`:`End voice chat`,k=s&&!O&&!i,A=a===`connecting`||a===`processing`||O&&o,j=[`cf-assistant-card__stage`,`cf-assistant-card__stage--local`,O?`is-live`:``,A?`is-thinking`:``,a===`listening`&&!c?`is-listening`:``,i||a===`speaking`?`is-speaking`:``,c?`is-muted`:``].filter(Boolean).join(` `),te=a===`listening`&&!c?{"--cf-listen":String(Math.max(.18,Math.min(1,p*8)))}:void 0,M=A&&w(`span`,{class:`cf-call-ripple`,"aria-hidden":`true`,children:[C(`span`,{}),C(`span`,{}),C(`span`,{})]});if(b)return w(`div`,{class:`cf-assistant-card cf-assistant-card--connecting`,"aria-live":`polite`,children:[w(`div`,{class:`cf-assistant-card__connecting-avatar`,children:[x?C(`img`,{src:x,alt:``}):C(`span`,{class:`cf-assistant-card__connecting-face${De(e)}`,children:z(e)}),M]}),w(`div`,{class:`cf-assistant-card__connecting-copy`,children:[C(`span`,{class:`cf-assistant-card__connecting-eyebrow`,children:e.agentName}),C(`strong`,{children:`Connecting with the AIโฆ`})]})]});let re=O&&u&&C($e,{voiceState:a,muted:c,onToggleMute:l??(()=>{}),onEndCall:u,onTalkNow:d??(()=>{}),showTalkNow:f,micLevel:p,theaterMode:m,onToggleTheater:h??(()=>{}),onMinimize:g??(()=>{}),audioDevices:_,selectedAudioDeviceId:v,onSelectAudioDevice:y??(()=>{})});return k?C(`div`,{class:`cf-assistant-card cf-assistant-card--pinned cf-assistant-card--compact`,children:w(`button`,{type:`button`,class:`cf-assistant-card__compact-speak`,onClick:r,children:[x?C(`span`,{class:`cf-assistant-card__compact-avatar`,children:C(`img`,{src:x,alt:``})}):null,C(`span`,{class:`cf-assistant-card__compact-mic`,"aria-hidden":`true`,children:C(ne,{})}),C(`span`,{class:`cf-assistant-card__compact-label`,children:ee})]})}):w(`div`,{class:`cf-assistant-card ${s?`cf-assistant-card--pinned`:``} ${i?`is-speaking`:``}`,children:[(T||e.allowVoiceInput)&&w(`div`,{class:j,style:te,children:[w(`div`,{class:`cf-assistant-card__media ${T?`cf-assistant-card__media--uploaded`:`cf-assistant-card__media--generated`}${De(e)}`,children:[E?C(`video`,{src:T,muted:!0,loop:!0,playsInline:!0,autoPlay:!0}):T?C(`img`,{src:T,alt:``}):C(`div`,{class:`cf-assistant-card__avatar-stage${De(e)}`,children:w(`div`,{class:`cf-assistant-card__face`,children:[C(`span`,{class:`cf-assistant-card__initials`,children:z(e)}),C(`span`,{class:`cf-assistant-card__eye cf-assistant-card__eye--left`}),C(`span`,{class:`cf-assistant-card__eye cf-assistant-card__eye--right`}),C(`span`,{class:`cf-assistant-card__mouth`})]})}),T&&!E&&C(`span`,{class:`cf-assistant-card__mouth cf-assistant-card__mouth--overlay`}),C(`span`,{class:`cf-avatar-aura cf-avatar-aura--one`,"aria-hidden":`true`}),C(`span`,{class:`cf-avatar-aura cf-avatar-aura--two`,"aria-hidden":`true`}),C(`span`,{class:`cf-avatar-listen-ring`,"aria-hidden":`true`}),w(`span`,{class:`cf-avatar-wave`,"aria-hidden":`true`,children:[C(`span`,{}),C(`span`,{}),C(`span`,{}),C(`span`,{})]})]}),M,e.allowVoiceInput&&(re||w(`button`,{type:`button`,class:`cf-assistant-card__speak`,onClick:r,children:[C(ne,{}),ee]}))]}),!s&&w(S,{children:[e.agentDescription?C(`p`,{class:`cf-assistant-card__copy`,children:e.agentDescription}):C(`p`,{class:`cf-assistant-card__copy`,children:e.greeting}),D.length>0&&C(`div`,{class:`cf-assistant-card__chips`,children:D.map(e=>C(`button`,{type:`button`,class:`cf-assistant-card__chip`,onClick:()=>n(e),children:e},e))}),e.disclaimerText||e.assistantPrivacyUrl?w(`p`,{class:`cf-assistant-card__privacy`,children:[e.disclaimerText||`This chat may be recorded for quality and support.`,e.assistantPrivacyUrl?w(S,{children:[` `,C(`a`,{href:e.assistantPrivacyUrl,target:`_blank`,rel:`noopener noreferrer nofollow`,children:`Privacy Policy`})]}):null]}):null]})]})},V={public_book_demo:{type:`book-demo`,label:`Book a demo`,description:`Pick a time or request a demo from the team.`,Icon:ie},public_submit_inquiry:{type:`inquiry`,label:`Leave a message`,description:`Send your question and contact details.`,Icon:N},public_request_callback:{type:`request-callback`,label:`Request a callback`,description:`Share your phone number and best time to call.`,Icon:ae},public_subscribe_newsletter:{type:`subscribe-newsletter`,label:`Subscribe`,description:`Get product updates and useful announcements.`,Icon:N}},H=({field:e,value:t,onInput:n})=>{let r=e.placeholder??e.label,i={class:`cf-form__input`,placeholder:e.required?`${r} *`:r,value:t,"aria-label":e.label,onInput:e=>n(e.target.value)};return e.kind===`textarea`?C(`textarea`,{rows:2,...i}):C(`input`,{type:e.kind,...i})},Ne=({spec:e,visitor:t,onSubmit:r,onCancel:i})=>{let a=n(),o=Te(),[s,c]=x(()=>{let n={};for(let r of e.fields)r.identity&&t[r.identity]&&(n[r.key]=t[r.identity]);return n}),[l,u]=x(`idle`),[d,f]=x(``),p=e=>!!(e.identity&&t[e.identity]?.trim()),m=e.fields.filter(e=>!p(e)),h=m.every(e=>!e.required||(s[e.key]?.trim()??``)!==``),g=t.email||t.name||``;return l===`done`?w(`div`,{class:`cf-form cf-form--done`,children:[C(F,{}),C(`span`,{children:d})]}):w(`div`,{class:`cf-form`,ref:o,children:[C(`div`,{class:`cf-form__title`,children:e.title}),m.length===0&&g&&w(`div`,{class:`cf-form__as`,children:[`as `,g]}),m.map(e=>C(H,{field:e,value:s[e.key]??``,onInput:t=>c(n=>({...n,[e.key]:t}))},e.key)),l===`error`&&C(`div`,{class:`cf-form__err`,children:a.formError}),w(`div`,{class:`cf-form__actions`,children:[i&&C(`button`,{type:`button`,class:`cf-form__cancel`,onClick:i,children:`Cancel`}),C(`button`,{type:`button`,class:`cf-form__submit`,disabled:!h||l===`submitting`,onClick:async()=>{if(!h||l===`submitting`)return;u(`submitting`);let t={},n={};for(let r of e.fields){let e=s[r.key]?.trim();e&&(t[r.key]=e,r.identity&&(n[r.identity]=e))}try{f((await r(t,n)).note||a.formThanks),u(`done`)}catch{u(`error`)}},children:l===`submitting`?a.sending:e.submit})]})]})},U=e=>String(e).padStart(2,`0`),Pe=()=>{let e=[];for(let t=9;t<=17;t++)e.push(`${U(t)}:00`),e.push(`${U(t)}:30`);return e},Fe=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})},Ie=(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}`}},W=(e,t)=>{let[n,r]=t.split(`:`).map(Number);return new Date(e.getFullYear(),e.getMonth(),e.getDate(),n??0,r??0)},Le=({visitor:e,onSubmit:t,onCancel:r,onDemoSlots:i,scheduler:a})=>{let o=n(),s=Te(),c=y(()=>Fe(14),[]),l=y(()=>Pe(),[]),[u,d]=x(y(()=>{let e=Date.now();for(let t=0;t<c.length;t++)if(l.some(n=>W(c[t],n).getTime()>e))return t;return 0},[c,l])),[f,p]=x(null),[h,g]=x(e.name??``),[_,b]=x(e.email??``),[T,E]=x(`idle`),[D,O]=x(``),[k,A]=x(``),[j,te]=x(``),ne=a?.connected&&a.mode===`link`,M=async()=>{if(T===`submitting`||!e.name?.trim()&&!h.trim()||!e.email?.trim()&&!_.trim())return;E(`submitting`),A(``);let n={};_.trim()&&(n.email=_.trim()),h.trim()&&(n.name=h.trim());try{let e=await t({..._.trim()?{visitorEmail:_.trim()}:{},...h.trim()?{visitorName:h.trim()}:{}},n),r=e.booking?.schedulingLink||a?.bookingLink||``;if(!r){E(`error`);return}try{window.open(r,`_blank`,`noopener,noreferrer`)}catch{}te(r),O(e.note||o.bookingLinkOpened),E(`done`)}catch{E(`error`)}},[ie,N]=x(new Set),[ae,oe]=x([]),[P,se]=x(0),[ce,le]=x(!1);v(()=>{if(!i)return;let e=!0,t=new Date,n=new Date;return n.setDate(n.getDate()+15),i(t.toISOString(),n.toISOString()).then(t=>{e&&(N(new Set(t.taken.map(e=>Date.parse(e)).filter(e=>!Number.isNaN(e)))),oe(t.busy.map(e=>[Date.parse(e.start),Date.parse(e.end)]).filter(([e,t])=>!Number.isNaN(e)&&!Number.isNaN(t))))}).catch(()=>{}),()=>{e=!1}},[i,P]);let I=!!e.email?.trim(),ue=!!e.name?.trim(),de=!!f&&(ue||h.trim()!==``)&&(I||_.trim()!==``),fe=e.email||e.name||``,pe=e=>ie.has(W(c[u],e).getTime()),me=e=>W(c[u],e).getTime()<=Date.now(),L=e=>{let t=W(c[u],e).getTime(),n=t+18e5;return ae.some(([e,r])=>t<r&&n>e)},he=async()=>{if(!de||T===`submitting`||!f)return;E(`submitting`),le(!1),A(``);let e=W(c[u],f),n=Ie(c[u],f),r={};_.trim()&&(r.email=_.trim()),h.trim()&&(r.name=h.trim());try{let i=await t({preferredAt:n,slotAt:e.toISOString(),..._.trim()?{visitorEmail:_.trim()}:{},...h.trim()?{visitorName:h.trim()}:{}},r);i.booking?.confirmed?(O(i.note||m(o.bookingConfirmed,{when:n})),te(i.booking.meetingUrl||i.booking.eventLink||``)):O(i.note||m(o.bookingRequested,{when:n})),E(`done`)}catch(t){if(t?.status===409)N(t=>new Set(t).add(e.getTime())),p(null),le(!0),se(e=>e+1),E(`idle`);else{let e=t?.message;A(e&&e.length<120?e:``),E(`error`)}}};return T===`done`?w(`div`,{class:`cf-form cf-form--done`,children:[C(F,{}),C(`span`,{children:D}),j&&w(`a`,{class:`cf-booking__link`,href:j,target:`_blank`,rel:`noopener noreferrer`,children:[ne?o.bookingOpenScheduler:o.bookingMeetingLink,` `,C(re,{})]})]}):ne?w(`div`,{class:`cf-form cf-booking`,ref:s,children:[C(`div`,{class:`cf-form__title`,children:ee[`book-demo`].title}),C(`div`,{class:`cf-booking__hint`,children:m(o.bookingViaProvider,{provider:a?.label??`the scheduler`})}),I?fe?w(`div`,{class:`cf-form__as`,children:[`as `,fe]}):null:w(S,{children:[!e.name?.trim()&&C(`input`,{class:`cf-form__input`,type:`text`,placeholder:`${o.handoffName} *`,value:h,"aria-label":o.handoffName,onInput:e=>g(e.target.value)}),C(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${o.handoffEmail} *`,value:_,"aria-label":o.handoffEmail,onInput:e=>b(e.target.value)})]}),T===`error`&&C(`div`,{class:`cf-form__err`,children:k||o.formError}),w(`div`,{class:`cf-form__actions`,children:[r&&C(`button`,{type:`button`,class:`cf-form__cancel`,onClick:r,children:o.cancel}),C(`button`,{type:`button`,class:`cf-form__submit`,disabled:T===`submitting`||!e.name?.trim()&&h.trim()===``||!I&&_.trim()===``,onClick:M,children:T===`submitting`?o.sending:o.bookingOpenScheduler})]})]}):w(`div`,{class:`cf-form cf-booking`,ref:s,children:[C(`div`,{class:`cf-form__title`,children:ee[`book-demo`].title}),w(`div`,{class:`cf-booking__hint`,children:[o.bookingPickTime,` ยท `,C(`span`,{class:`cf-booking__dur`,children:o.bookingDuration})]}),C(`div`,{class:`cf-booking__dates`,role:`tablist`,"aria-label":`Pick a day`,children:c.map((e,t)=>w(`button`,{type:`button`,role:`tab`,"aria-selected":t===u,class:`cf-booking__date ${t===u?`is-selected`:``}`,onClick:()=>{d(t),p(null)},children:[C(`span`,{class:`cf-booking__dow`,children:e.toLocaleDateString(void 0,{weekday:`short`})}),C(`span`,{class:`cf-booking__dom`,children:e.getDate()})]},t))}),C(`div`,{class:`cf-booking__slots`,role:`listbox`,"aria-label":`Pick a time`,children:l.map(e=>{let t=me(e),n=L(e),r=pe(e),i=r||t||n;return C(`button`,{type:`button`,role:`option`,"aria-selected":f===e,disabled:i,title:t?`Earlier today`:n?`Busy on the calendar`:r?`Already booked`:void 0,class:`cf-booking__slot ${f===e?`is-selected`:``} ${i?`is-taken`:``}`,onClick:()=>p(e),children:e},e)})}),ce&&C(`div`,{class:`cf-form__err`,children:o.bookingSlotTaken}),fe?w(`div`,{class:`cf-form__as`,children:[`as `,fe]}):null,!ue&&C(`input`,{class:`cf-form__input`,type:`text`,placeholder:`${o.handoffName} *`,value:h,"aria-label":o.handoffName,onInput:e=>g(e.target.value)}),!I&&C(S,{children:C(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${o.handoffEmail} *`,value:_,"aria-label":o.handoffEmail,onInput:e=>b(e.target.value)})}),T===`error`&&C(`div`,{class:`cf-form__err`,children:k||o.formError}),w(`div`,{class:`cf-form__actions`,children:[r&&C(`button`,{type:`button`,class:`cf-form__cancel`,onClick:r,children:o.cancel}),C(`button`,{type:`button`,class:`cf-form__submit`,disabled:!de||T===`submitting`,onClick:he,children:T===`submitting`?o.sending:ee[`book-demo`].submit})]})]})},Re=({actions:e,visitor:t,onSubmitForm:n,onDemoSlots:r,scheduler:i,exclude:a=[]})=>{let[o,s]=x(null),[c,l]=x(!1),u=(e??[]).map(e=>V[e]).filter(e=>!!e&&!a.includes(e.type));if(u.length===0)return null;let d=()=>{s(null),l(!1)},f=()=>s(null);if(o===`book-demo`)return w(`div`,{class:`cf-action-drawer is-open`,role:`dialog`,"aria-label":`Book a demo`,children:[C(`div`,{class:`cf-action-drawer__handle`,"aria-hidden":`true`}),w(`div`,{class:`cf-action-drawer__head`,children:[w(`div`,{children:[C(`span`,{class:`cf-action-drawer__eyebrow`,children:`Contact options`}),C(`strong`,{children:`Book a demo`})]}),C(`button`,{type:`button`,class:`cf-action-drawer__close`,onClick:f,children:C(P,{})})]}),C(Le,{visitor:t,onCancel:f,onSubmit:(e,t)=>n(`book-demo`,e,t),onDemoSlots:r,scheduler:i})]});if(o){let e=u.find(e=>e.type===o);return w(`div`,{class:`cf-action-drawer is-open`,role:`dialog`,"aria-label":e?.label??`Contact`,children:[C(`div`,{class:`cf-action-drawer__handle`,"aria-hidden":`true`}),w(`div`,{class:`cf-action-drawer__head`,children:[w(`div`,{children:[C(`span`,{class:`cf-action-drawer__eyebrow`,children:`Contact options`}),C(`strong`,{children:e?.label??ee[o].title})]}),C(`button`,{type:`button`,class:`cf-action-drawer__close`,onClick:f,children:C(P,{})})]}),C(Ne,{spec:ee[o],visitor:t,onCancel:f,onSubmit:(e,t)=>n(o,e,t)})]})}return c?w(`div`,{class:`cf-action-drawer cf-action-drawer--menu`,children:[C(`div`,{class:`cf-action-drawer__handle`,"aria-hidden":`true`}),w(`div`,{class:`cf-action-drawer__head`,children:[w(`div`,{children:[C(`span`,{class:`cf-action-drawer__eyebrow`,children:`Need help?`}),C(`strong`,{children:`Choose what you want to do`})]}),C(`button`,{type:`button`,class:`cf-action-drawer__close`,onClick:d,children:C(P,{})})]}),C(`div`,{class:`cf-action-drawer__grid`,children:u.map(({type:e,label:t,description:n,Icon:r})=>w(`button`,{type:`button`,class:`cf-action-card`,onClick:()=>s(e),children:[C(`span`,{class:`cf-action-card__icon`,children:C(r,{})}),w(`span`,{class:`cf-action-card__copy`,children:[C(`strong`,{children:t}),C(`small`,{children:n})]}),C(j,{})]},e))}),C(`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.`})]}):w(`button`,{type:`button`,class:`cf-action-trigger`,onClick:()=>l(!0),children:[C(`span`,{class:`cf-action-trigger__icon`,children:C(N,{})}),w(`span`,{class:`cf-action-trigger__copy`,children:[C(`strong`,{children:`Contact options`}),C(`small`,{children:`Demo, message, callback`})]}),C(j,{})]})},ze=({hasEmail:e,visitor:t,question:r,onSubmitForm:i})=>{let a=n(),[o,s]=x(!1),[c,l]=x(!1),[u,d]=x(t.name??``),[f,p]=x(t.email??``);if(e)return w(`div`,{class:`cf-handoff cf-handoff--done`,children:[C(F,{}),C(`span`,{children:`Weโve alerted the team. If someone is available, they can continue here.`})]});if(o){let e=t.email||f;return w(`div`,{class:`cf-handoff cf-handoff--done`,children:[C(F,{}),C(`span`,{children:m(a.handoffShared,{email:e})})]})}let h=async()=>{if(!(!f.trim()||c)){l(!0);try{await i(`inquiry`,{visitorEmail:f.trim(),...u.trim()?{visitorName:u.trim()}:{},message:r||`I had a question the assistant couldnโt answer.`,subject:`Help request from chat`},{email:f.trim(),name:u.trim()||void 0}),s(!0)}catch{l(!1)}}};return w(`div`,{class:`cf-handoff`,children:[C(`div`,{class:`cf-handoff__title`,children:a.handoffTitle}),C(`input`,{class:`cf-form__input`,type:`text`,placeholder:a.handoffName,value:u,"aria-label":a.handoffName,onInput:e=>d(e.target.value)}),C(`input`,{class:`cf-form__input`,type:`email`,placeholder:`${a.handoffEmail} *`,value:f,"aria-label":a.handoffEmail,onInput:e=>p(e.target.value)}),C(`button`,{type:`button`,class:`cf-form__submit`,disabled:!f.trim()||c,onClick:h,children:c?a.sending:a.handoffNotify})]})},Be=({text:e})=>{let t=n(),[r,i]=x(!1);return w(`button`,{type:`button`,class:`cf-tool`,onClick:async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch{}},"aria-label":t.copy,children:[C(r?F:le,{}),r?t.copied:t.copy]})},Ve=({items:e,onPick:t})=>e.length===0?null:C(`div`,{class:`cf-starters`,children:e.map((e,n)=>C(`button`,{type:`button`,class:`cf-starter`,onClick:()=>t(e),children:e},n))}),He=({items:e})=>{let t=e.filter(e=>e.label.trim()&&e.url.trim()).slice(0,4);return t.length===0?null:C(`div`,{class:`cf-featured-links`,children:t.map((e,t)=>w(`a`,{class:`cf-featured-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,title:e.label,children:[C(re,{}),C(`span`,{children:e.label})]},`${e.url}-${t}`))})},Ue=({msg:e,onRate:t})=>{let r=n(),[i,a]=x(!1),[o,s]=x(``),c=e.feedback,l=()=>{t(e.id,`up`),a(!1)},u=()=>{t(e.id,`down`),a(!0)},d=()=>{t(e.id,`down`,o.trim()),a(!1)};return w(`div`,{class:`cf-feedback`,children:[w(`div`,{class:`cf-feedback__row`,children:[C(`button`,{type:`button`,class:`cf-feedback__btn ${c===`up`?`is-active`:``}`,"aria-label":r.feedbackHelpful,"aria-pressed":c===`up`,onClick:l,children:C(me,{})}),C(`button`,{type:`button`,class:`cf-feedback__btn ${c===`down`?`is-active`:``}`,"aria-label":r.feedbackNotHelpful,"aria-pressed":c===`down`,onClick:u,children:C(L,{})}),c&&!i&&C(`span`,{class:`cf-feedback__thanks`,children:r.feedbackThanks})]}),i&&c===`down`&&w(`div`,{class:`cf-feedback__comment`,children:[C(`textarea`,{class:`cf-feedback__input`,rows:2,placeholder:r.feedbackCommentPlaceholder,value:o,onInput:e=>s(e.target.value)}),C(`button`,{type:`button`,class:`cf-feedback__send`,onClick:d,children:r.feedbackSend})]})]})},We=({msg:e,persona:r,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=n(),_=e.role===`user`,v=e.role===`system`,y=e.requestedContactFields?.includes(`email`)===!0,b=i&&!_&&!v&&!!(e.handoffOffered||y),x=b&&!o?[`inquiry`]:[],T=!e.pending&&!e.streaming;return v?C(`div`,{class:`cf-msg cf-msg--system`,children:w(`div`,{class:`cf-system-event`,children:[C(`div`,{class:`cf-system-event__mark`,children:C(ke,{persona:r,small:!0})}),C(`div`,{class:`cf-system-event__text`,children:e.content}),e.createdAt&&C(`div`,{class:`cf-system-event__time`,children:new Date(e.createdAt).toLocaleString(void 0,{day:`2-digit`,month:`short`,year:`numeric`,hour:`numeric`,minute:`2-digit`})})]})}):w(`div`,{class:`cf-msg cf-msg--${_?`user`:`agent`}`,children:[!_&&C(ke,{persona:r,small:!0}),w(`div`,{class:`cf-msg__col`,children:[e.pending&&e.content===``?C(Ae,{}):e.imageUrl?w(`div`,{class:`cf-msg__bubble cf-msg__bubble--media`,children:[C(`img`,{class:`cf-msg__media`,src:e.imageUrl,alt:`GIF`}),e.content&&C(`span`,{class:`cf-msg__caption`,children:e.content})]}):w(`div`,{class:`cf-msg__bubble`,children:[_?e.content:t(e.content),e.streaming&&C(`span`,{class:`cf-caret`,"aria-hidden":`true`})]}),!_&&e.visualization?C(Ge,{visualization:e.visualization,onExpand:h?()=>h(e.id):void 0,expandControlId:e.id}):null,!_&&e.visualization?.explanation?C(we,{explanation:e.visualization.explanation,onFollowUp:l,showLead:!e.content.toLocaleLowerCase().includes(e.visualization.explanation.headline.toLocaleLowerCase())}):null,_&&e.attachmentName&&w(`div`,{class:`cf-attach-chip`,title:e.attachmentName,children:[C(de,{}),C(`span`,{children:e.attachmentName})]}),!_&&w(S,{children:[T&&(e.error||e.content)&&C(`div`,{class:`cf-msg__tools`,children:e.error?w(`button`,{type:`button`,class:`cf-tool`,onClick:()=>f(e.id,e.retryText??``),children:[C(I,{}),g.retry]}):C(Be,{text:e.content})}),T&&p&&!e.error&&e.content&&C(Ue,{msg:e,onRate:m}),C(je,{msg:e}),i&&C(B,{replies:e.suggestedReplies,onPick:l}),b&&C(ze,{hasEmail:o,visitor:a,question:s,onSubmitForm:u}),c&&C(Re,{actions:e.availableActions,visitor:a,onSubmitForm:u,onDemoSlots:d,scheduler:r?.scheduler,exclude:x})]})]})]})},Ge=({visualization:e,expanded:t=!1,onExpand:n,onClose:r,expandControlId:a})=>{let o=y(()=>f(e),[e]),s=e.rows??[],u=e.columns??[];if(s.length===0)return C(Ce,{});let d=C(xe,{model:e.model,answeredAt:e.freshness?.answeredAt,reportingPeriod:e.reportingPeriod,filters:e.appliedFilters,rowCount:e.rowCount??s.length});if(e.presentation===`table`||!e.presentation&&e.type===`table`)return!e.tableAvailable||u.length===0?null:w(`div`,{class:`cf-analytics-visualization${t?` is-expanded`:``}`,children:[w(`div`,{class:`cf-analytics-visualization__header`,children:[w(`div`,{children:[C(`div`,{class:`cf-analytics-visualization__title`,children:e.title?.trim()||`Result details`}),d]}),w(`div`,{class:`cf-analytics-visualization__actions`,children:[e.downloadAvailable?C(`button`,{type:`button`,class:`cf-analytics-visualization__download`,onClick:()=>Ke(u,s),children:`Download`}):null,t&&r?C(`button`,{type:`button`,class:`cf-analytics-visualization__close`,"aria-label":`Restore assistant view`,onClick:r,children:C(P,{})}):n&&e.expandable!==!1?C(`button`,{type:`button`,class:`cf-analytics-visualization__expand`,"aria-label":`Expand table`,"data-visualization-message":a,onClick:n,children:C(he,{})}):null]})]}),C(c,{rows:s,columns:u,maxRows:5,expanded:t,classNames:{wrap:`cf-analytics-table-wrap`,table:`cf-analytics-table`,note:`cf-analytics-table-note`}})]});let p=e.chartRecommendation?.valueFields?.[0]??e.valueFields?.[0]??e.value??u[1];if(e.presentation===`kpi`||!e.presentation&&e.type===`kpi`){let n=s[0]?.[p??u[0]??``],i=typeof n==`number`?n:Number(n),a=e.columnMetadata?.find(e=>e.key===p),o=Number.isFinite(i)?l(i,a,e):String(n??`No value`);return w(`div`,{class:`cf-analytics-visualization${t?` is-expanded`:``}`,children:[w(`div`,{class:`cf-analytics-visualization__header`,children:[w(`div`,{children:[C(`div`,{class:`cf-analytics-visualization__title`,children:`Live metric`}),d]}),t&&r?C(`button`,{type:`button`,class:`cf-analytics-visualization__close`,"aria-label":`Restore assistant view`,onClick:r,children:C(P,{})}):null]}),C(Se,{label:a?.label??p??`Current value`,value:o,detail:e.explanation?.summary})]})}return o?w(`div`,{class:`cf-analytics-visualization${t?` is-expanded`:``}`,children:[w(`div`,{class:`cf-analytics-visualization__header`,children:[w(`div`,{children:[C(`div`,{class:`cf-analytics-visualization__title`,children:o.title}),d]}),t&&r?C(`button`,{type:`button`,class:`cf-analytics-visualization__close`,"aria-label":`Restore assistant view`,onClick:r,children:C(P,{})}):n&&e.expandable!==!1?C(`button`,{type:`button`,class:`cf-analytics-visualization__expand`,"aria-label":`Expand chart`,"data-visualization-message":a,onClick:n,children:C(he,{})}):null]}),C(i,{model:o,expanded:t}),C(`p`,{class:`cf-analytics-chart__summary`,children:o.summary}),e.downloadAvailable?C(`button`,{type:`button`,class:`cf-analytics-visualization__download`,onClick:()=>Ke(u,s),children:`Download this data`}):null]}):null},Ke=(e,t)=>{if(typeof document>`u`||e.length===0)return;let n=r(t,e),i=URL.createObjectURL(new Blob([n],{type:`text/csv;charset=utf-8`})),a=document.createElement(`a`);a.href=i,a.download=`analytics-result.csv`,a.click(),URL.revokeObjectURL(i)},qe=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).split(`,`)[1]??``),r.onerror=n,r.readAsDataURL(e)}),Je=({onPick:e})=>C(`div`,{class:`cf-picker cf-emoji`,children:O.map(t=>w(`div`,{class:`cf-emoji__group`,children:[C(`div`,{class:`cf-emoji__label`,children:t.name}),C(`div`,{class:`cf-emoji__grid`,children:t.emojis.map((t,n)=>C(`button`,{type:`button`,class:`cf-emoji__btn`,onClick:()=>e(t),"aria-label":t,children:t},n))})]},t.name))}),Ye=({onSearch:e,onPick:t})=>{let r=n(),[i,a]=x(``),[o,s]=x([]),[c,l]=x(!0);return v(()=>{let t=!0;l(!0);let n=setTimeout(()=>{e(i).then(e=>t&&(s(e),l(!1))).catch(()=>t&&(s([]),l(!1)))},300);return()=>{t=!1,clearTimeout(n)}},[i,e]),w(`div`,{class:`cf-picker cf-gif`,children:[C(`input`,{class:`cf-gif__search`,placeholder:r.searchGifs,value:i,"aria-label":r.searchGifs,onInput:e=>a(e.target.value)}),C(`div`,{class:`cf-gif__grid`,children:c?C(`div`,{class:`cf-gif__hint`,children:r.searchingGifs}):o.length===0?C(`div`,{class:`cf-gif__hint`,children:r.noGifs}):o.map(e=>C(`button`,{type:`button`,class:`cf-gif__item`,onClick:()=>t(e.url),"aria-label":e.alt,children:C(`img`,{src:e.preview,alt:e.alt,loading:`lazy`})},e.id))}),C(`div`,{class:`cf-gif__powered`,children:`via Tenor`})]})},Xe=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``}},Ze=({muted:e,listening:t,micLevel:n,onToggleMute:r})=>C(`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:r,style:t?{"--cf-wave":String(Math.max(.2,Math.min(1,n*6)))}:void 0,children:C(e?M:ne,{})}),Qe=({audioDevices:e,selectedAudioDeviceId:t,onSelectAudioDevice:n})=>{let[r,i]=x(!1),a=b(null);v(()=>{if(!r)return;let e=e=>{a.current&&!e.composedPath().includes(a.current)&&i(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[r]);let o=[{deviceId:``,label:`Default microphone`},...e];return w(`div`,{class:`cf-call-more`,ref:a,children:[C(`button`,{type:`button`,class:`cf-call-btn cf-call-btn--microphones`,"aria-label":`Choose microphone`,"aria-expanded":r,onClick:()=>i(e=>!e),children:C(j,{})}),r&&w(`div`,{class:`cf-call-menu`,role:`menu`,children:[C(`div`,{class:`cf-call-menu__label`,children:`Microphone`}),o.map(e=>w(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.deviceId===t,class:`cf-call-menu__item ${e.deviceId===t?`is-active`:``}`,onClick:()=>{n(e.deviceId),i(!1)},children:[e.deviceId===t?C(F,{}):C(`span`,{class:`cf-call-menu__spacer`}),C(`span`,{children:e.label})]},e.deviceId))]})]})},$e=({voiceState:e,muted:t,onToggleMute:n,onEndCall:r,onTalkNow:i,showTalkNow:a,micLevel:o,theaterMode:s,onToggleTheater:c,onMinimize:l,audioDevices:u,selectedAudioDeviceId:d,onSelectAudioDevice:f})=>w(`div`,{class:`cf-call-controls`,children:[C(Ze,{muted:t,listening:e===`listening`&&!t,micLevel:o,onToggleMute:n}),C(Qe,{audioDevices:u,selectedAudioDeviceId:d,onSelectAudioDevice:f}),a&&C(`button`,{type:`button`,class:`cf-call-btn cf-call-btn--talk`,"aria-label":`Talk now`,onClick:i,children:C(ne,{})}),C(`button`,{type:`button`,class:`cf-call-btn`,"aria-label":s?`Exit expanded view`:`Expand view`,"aria-pressed":s,onClick:c,children:C(s?ge:he,{})}),C(`button`,{type:`button`,class:`cf-call-btn`,"aria-label":`Minimize voice chat`,onClick:l,children:C(_e,{})}),C(`button`,{type:`button`,class:`cf-call-btn cf-call-btn--end`,"aria-label":`End voice chat`,onClick:r,children:C(fe,{})})]}),et=({persona:e,voiceState:t,muted:n,onToggleMute:r,onEndCall:i,micLevel:a,onExpand:o})=>{let s=e=>e.stopPropagation(),c=e?.assistantMediaUrl?.trim()||e?.agentAvatarUrl?.trim()||``,l=e?.assistantMediaKind===`video`&&!!c,u=e?.agentName||`Assistant`;return w(`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,a*8)))}:void 0,role:`button`,tabIndex:0,"aria-label":`Reopen voice chat with ${u}`,onClick:o,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())},children:[C(`div`,{class:`cf-floating-call-card__media`,"aria-hidden":`true`,children:c?l?C(`video`,{src:c,muted:!0,loop:!0,playsInline:!0,autoPlay:!0}):C(`img`,{src:c,alt:``}):w(`div`,{class:`cf-floating-call-card__avatar${De(e)}`,children:[C(`span`,{children:z(e)}),C(`span`,{class:`cf-floating-call-card__eye cf-floating-call-card__eye--left`}),C(`span`,{class:`cf-floating-call-card__eye cf-floating-call-card__eye--right`}),C(`span`,{class:`cf-floating-call-card__mouth`})]})}),C(`div`,{class:`cf-floating-call-card__shade`,"aria-hidden":`true`}),w(`div`,{class:`cf-floating-call-card__controls`,onClick:s,onKeyDown:s,role:`presentation`,children:[C(Ze,{muted:n,listening:t===`listening`&&!n,micLevel:a,onToggleMute:r}),C(`button`,{type:`button`,class:`cf-call-btn cf-call-btn--restore`,"aria-label":`Restore voice chat`,onClick:e=>{s(e),o()},children:C(ve,{})}),C(`button`,{type:`button`,class:`cf-call-btn cf-call-btn--end`,"aria-label":`End voice chat`,onClick:e=>{s(e),i()},children:C(fe,{})})]})]})},tt=({onSend:e,onSendGif:t,onTyping:r,disabled:i,allowVoice:a,onTranscribe:o,gifEnabled:s,onSearchGifs:c,allowAttach:l,onExtract:u,voiceStartSignal:d=0,onVoiceStateChange:f})=>{let p=n(),[m,h]=x(``),[g,_]=x(!1),[y,T]=x(!1),[O,ee]=x(`idle`),[k,A]=x(`none`),[j,M]=x(null),[re,ie]=x(!1),[N,ae]=x(``),se=b(null),ce=b(null),F=b(null),le=b(null),I=b([]),ue=b(void 0),fe=b(null),pe=b(void 0),me=b(0),L=e=>{ee(e),f?.(e)},he=()=>{ue.current&&window.clearTimeout(ue.current),ue.current=void 0,pe.current&&cancelAnimationFrame(pe.current),pe.current=void 0,fe.current?.close().catch(()=>void 0),fe.current=null};v(()=>{let e=se.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,110)}px`)},[m]),v(()=>{if(k===`none`)return;let e=e=>{ce.current&&!e.composedPath().includes(ce.current)&&A(`none`)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[k]);let ge=e=>A(t=>t===e?`none`:e),_e=e=>{let t=se.current;if(!t){h(t=>t+e);return}let n=t.selectionStart??m.length,r=t.selectionEnd??m.length;h(m.slice(0,n)+e+m.slice(r)),requestAnimationFrame(()=>{t.focus();let r=n+e.length;t.setSelectionRange(r,r)})},ve=e=>{A(`none`),t(e)},ye=async e=>{let t=e.target,n=t.files?.[0];if(t.value=``,n){if(ae(``),n.size>8388608){ae(p.attachTooLarge);return}ie(!0);try{let e=await u(await qe(n),n.type||`application/octet-stream`,n.name);if(!e){ae(p.attachFailed);return}M({name:n.name,text:e})}catch{ae(p.attachFailed)}finally{ie(!1)}}},R=(!!m.trim()||!!j)&&!i&&!re&&!y,be=()=>{R&&(e(m,j?{attachmentName:j.name,attachmentText:j.text}:void 0),r?.(!1),h(``),M(null),ae(``))},xe=t=>{let n=t.trim();if(!n||i){L(`misunderstood`),window.setTimeout(()=>L(`idle`),2500);return}let a=m.trim();e(a?`${a} ${n}`:n),r?.(!1),h(``),M(null),ae(``),L(`idle`)},Se=e=>{e.key===`Enter`&&!e.shiftKey?(e.preventDefault(),be()):e.key===`Escape`&&k!==`none`&&(e.preventDefault(),e.stopPropagation(),A(`none`))},Ce=async()=>{if(g){D(le.current);return}try{L(`connecting`);let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=E(e);I.current=[],me.current=0;try{let t=window.AudioContext??window.webkitAudioContext;if(t){let n=new t;fe.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}me.current=Math.max(me.current,Math.sqrt(e/a.length)),pe.current=requestAnimationFrame(o)};o()}}catch{}t.ondataavailable=e=>e.data.size>0&&I.current.push(e.data),t.onstop=async()=>{he(),e.getTracks().forEach(e=>e.stop()),_(!1);let n=new Blob(I.current,{type:t.mimeType||`audio/webm`});if(n.size===0||n.size<900||me.current<.006){L(`noise`),window.setTimeout(()=>L(`idle`),3200);return}T(!0),L(`processing`);try{let e=await qe(n);if(!e.trim()){L(`noise`),window.setTimeout(()=>L(`idle`),3200);return}let t=typeof navigator<`u`&&(navigator.languages?.[0]||navigator.language)||void 0;xe(await o(e,n.type,t))}catch{L(`misunderstood`),window.setTimeout(()=>L(`idle`),3e3)}finally{T(!1)}},le.current=t,t.start(250),_(!0),L(`listening`),ue.current=window.setTimeout(()=>{D(le.current)},12e3)}catch{L(`denied`),window.setTimeout(()=>L(`idle`),3500)}};return v(()=>{!d||!a||i||g||y||Ce()},[d]),v(()=>()=>he(),[]),w(`div`,{class:`cf-composer`,ref:ce,children:[k===`emoji`&&C(Je,{onPick:_e}),k===`gif`&&C(Ye,{onSearch:c,onPick:ve}),(j||re||N)&&C(`div`,{class:`cf-attach-row`,children:re?C(`span`,{class:`cf-attach-status`,children:p.attaching}):N?C(`span`,{class:`cf-attach-status cf-attach-status--err`,children:N}):j&&w(`span`,{class:`cf-attach-chip`,title:j.name,children:[C(de,{}),C(`span`,{children:j.name}),C(`button`,{type:`button`,class:`cf-attach-x`,"aria-label":`Remove attachment`,onClick:()=>M(null),children:C(P,{})})]})}),O!==`idle`&&w(`div`,{class:`cf-voice-state`,"aria-live":`polite`,children:[C(`span`,{class:`cf-voice-state__dot ${g?`is-live`:``}`}),Xe(O)]}),w(`div`,{class:`cf-composer__field`,children:[C(`button`,{type:`button`,class:`cf-iconbtn ${k===`emoji`?`is-active`:``}`,"aria-label":p.emoji,"aria-pressed":k===`emoji`,onClick:()=>ge(`emoji`),children:C(k===`emoji`?P:oe,{})}),s&&C(`button`,{type:`button`,class:`cf-iconbtn cf-gifbtn ${k===`gif`?`is-active`:``}`,"aria-label":p.gifs,"aria-pressed":k===`gif`,onClick:()=>ge(`gif`),children:C(`span`,{class:`cf-gif-label`,children:`GIF`})}),l&&w(S,{children:[C(`input`,{ref:F,type:`file`,class:`cf-file-input`,accept:`image/png,image/jpeg,image/webp,image/gif,application/pdf`,onChange:ye,tabIndex:-1,"aria-hidden":`true`}),C(`button`,{type:`button`,class:`cf-iconbtn`,"aria-label":p.attachFile,disabled:re,onClick:()=>F.current?.click(),children:C(de,{})})]}),C(`textarea`,{ref:se,class:`cf-textarea`,rows:1,placeholder:p.composerPlaceholder,value:m,"aria-label":p.composerPlaceholder,disabled:i,onInput:e=>{let t=e.target.value;h(t),r?.(!!t.trim())},onKeyDown:Se}),a&&C(`button`,{type:`button`,class:`cf-iconbtn cf-mic ${g?`is-recording`:``}`,"aria-label":g?p.stopRecording:p.recordVoice,"aria-pressed":g,disabled:y||i,onClick:Ce,children:C(ne,{})}),C(`button`,{type:`button`,class:`cf-send`,"aria-label":p.send,disabled:!R,onClick:be,children:C(te,{})})]})]})},nt=({name:e,greeting:t})=>w(`section`,{class:`cf-empty-welcome`,"aria-label":`${e} welcome`,children:[C(`span`,{class:`cf-empty-welcome__eyebrow`,children:`Ready when you are`}),C(`h2`,{children:e}),t?C(`p`,{children:t}):C(`p`,{children:`Ask a question, leave a message, or book a demo.`})]}),rt=e=>{let[t,n]=x(`light`);return v(()=>{if(e!==`auto`||typeof matchMedia>`u`)return;let t=matchMedia(`(prefers-color-scheme: dark)`),r=()=>n(t.matches?`dark`:`light`);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),e===`auto`?t:e},it=1e4,at=.0022,ot=1600,st=6e4,ct=e=>e.replace(/\[[^\]]{0,60}\]/g,` `).replace(/\(([^)]{0,60})\)/g,(e,t)=>lt.has(t.trim().toLowerCase().replace(/[.!?,โฆ]+$/,``).replace(/\s+/g,` `))?` `:e).replace(/\*[^*]{0,60}\*/g,` `).replace(/\s+/g,` `).trim(),lt=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(`.`)),ut=e=>{let t=e.trim().toLowerCase().replace(/[()[\]*]/g,` `).replace(/[.!?,โฆ]+$/,``).replace(/\s+/g,` `).trim();return!t||/^(?:sh+\s*)+$/.test(t)?!0:lt.has(t)},dt=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},ft={end:`end the call`,mute:`mute your microphone`,minimize:`minimize the chat`,expand:`expand the view`,shrink:`exit the expanded view`},pt=e=>e.trim().toLowerCase().replace(/[^\p{L}\p{N}\s']/gu,` `).replace(/\s+/g,` `).trim(),mt=[{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/}],ht=/^(?:yes|yeah|yep|yup|sure|correct|confirm|affirmative|go ahead|do it|please do|ok(?:ay)?)\b/,gt=/^(?:no|nope|nah|cancel|never ?mind|don'?t|stop)\b/,_t=/^(?:end|close|stop|finish|hang ?up|quit|exit|bye|good ?bye)\b/,vt=e=>{let t=pt(e);if(!t)return null;for(let{action:e,re:n}of mt)if(n.test(t)){let n=t.split(` `).length;return{action:e,confident:e===`end`?n<=10:n<=6}}return null},yt=e=>`I didn't catch yes or no. Say yes to ${ft[e]}, or no to keep talking.`,bt=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`}.`,xt=e=>{let t=pt(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)},St=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)}),Ct=(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))}}},wt=e=>({...e?{deviceId:{exact:e}}:{},echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}),Tt=({transport:e,config:t,bindControls:n})=>{let r=t.strings,[i,a]=x(t.openByDefault),{persona:o,messages:c,sending:l,assistantSpeaking:f,visitor:m,hasEmail:h,liveMode:g,assignedAgentName:y,agentTypingName:T,starters:O,featuredLinks:ee,send:k,sendGif:te,notifyTyping:ne,stop:M,retry:re,rateMessage:ie,injectAssistant:N,appendUserDraft:ae,patchMessage:oe,removeMessage:P,submitCsat:F,submitForm:le,transcribe:I,extract:de,searchGifs:he,demoSlots:ge,gifEnabled:_e,identify:ve,ended:R,endConversation:be,startNew:xe,history:Se,viewingSessionId:Ce,viewMessages:we,openConversation:Te,closeHistoryView:Ee,shutdown:De,stopSpeaking:Oe,speakAssistantText:z}=u(e,t,i),[Ae,je]=x(0),[B,V]=x(`idle`),[H,Ne]=x(!1),[U,Pe]=x(!1),[Fe,Ie]=x(0),[W,Le]=x(!1),[ze,Be]=x(null),[Ue,Ke]=x([]),[qe,Je]=x(``),[Ye,Xe]=x(()=>{try{return localStorage.getItem(`centrinfo:muted`)===`1`}catch{return!1}}),Ze=rt(t.theme),Qe=c.some(e=>e.role===`assistant`&&(e.pending||e.streaming)),$e=l||Qe||f,lt=o?.soundEnabled??!0;v(()=>{s(t.sound&<&&!Ye)},[t.sound,lt,Ye]);let mt=_(()=>{Xe(e=>{let t=!e;try{localStorage.setItem(`centrinfo:muted`,t?`1`:`0`)}catch{}return t})},[]),Tt=b(null),Et=b(null),Dt=b(null),Ot=b(0),G=b(!1),K=b(!1),q=b(!1),kt=b(0),At=b(!1),J=b(null),jt=b(null),Mt=b([]),Nt=b(void 0),Pt=b(void 0),Ft=b(null),It=b(0),Lt=b(0),Rt=b(!1),zt=b(0),Bt=b(null),Vt=b(null),Ht=b(0),Ut=b(null),Wt=b([]),Gt=b(0),Kt=b(0),qt=b(0),Jt=b(null),Yt=b(!1),Xt=b(null),Y=b(``),Zt=b(()=>{}),Qt=b(``),$t=b(l),en=b(f),tn=b($e),nn=b(B),rn=b(0);v(()=>{$t.current=l},[l]),v(()=>{en.current=f},[f]),v(()=>{tn.current=$e},[$e]),v(()=>{nn.current=B},[B]);let[an,on]=x(!0),[sn,cn]=x(!1),ln=b(0),[un,dn]=x(!1),fn=b(null),[pn,mn]=x(!1),[hn,gn]=x(!1),X=!!Ce,_n=X?we:c,vn=_n.find(e=>e.id===ze&&e.visualization)?.visualization;v(()=>{!ze||vn||(Be(null),Le(!1))},[vn,ze]);let yn=_(()=>{a(!0),je(0),p(`open`),t.onOpen?.(),t.onShow?.()},[t]),bn=_(()=>{a(!1),Le(!1),Be(null),t.onClose?.(),t.onHide?.(),Et.current?.focus()},[t]),xn=_(()=>i?bn():yn(),[i,yn,bn]),Sn=_(()=>dn(!0),[]),Cn=_(()=>{be(),dn(!1)},[be]),wn=_(()=>{xe(),cn(!1),on(!0)},[xe]);v(()=>{un&&fn.current?.focus()},[un]),v(()=>{n({open:yn,close:bn,toggle:xn,identify:ve,startNew:xe,endConversation:be,shutdown:De})},[n,yn,bn,xn,ve,xe,be,De]),v(()=>{let e=c.filter(e=>e.role===`assistant`&&!e.pending).length;if(i){Ot.current=e;return}e>Ot.current&&je(e-Ot.current)},[c,i]),v(()=>{t.onUnreadChange?.(Ae)},[Ae,t]),v(()=>{let e=t.sessionDurationMinutes;if(!e||e<=0)return;let n=setTimeout(()=>De(),e*60*1e3);return()=>clearTimeout(n)},[t.sessionDurationMinutes,c,i,De]),v(()=>{let e=t.customLauncherSelector;if(!e||typeof document>`u`)return;let n=[];try{n=Array.from(document.querySelectorAll(e))}catch{return}let r=e=>{e.preventDefault(),xn()};return n.forEach(e=>e.addEventListener(`click`,r)),()=>n.forEach(e=>e.removeEventListener(`click`,r))},[t.customLauncherSelector,xn]);let Tn=b(!1);v(()=>{let e=t.proactiveMessage?.trim();if(!e||Tn.current)return;let n=t.proactiveOnPaths??[],r=typeof location<`u`?location.pathname:``;if(n.length>0&&!n.some(e=>r.includes(e)))return;let a=`centrinfo:proactive:${t.token.slice(0,12)}`;try{if(sessionStorage.getItem(a)===`1`)return}catch{}let o=setTimeout(()=>{if(!(i||R||c.some(e=>e.role===`user`))){Tn.current=!0;try{sessionStorage.setItem(a,`1`)}catch{}N(e),yn()}},Math.max(0,t.proactiveDelaySeconds)*1e3);return()=>clearTimeout(o)},[t.proactiveMessage]),v(()=>{let e=Dt.current;if(!i||!e)return;let t=c[c.length-1],n=Date.now()<ln.current;t?.role===`user`||an||n?(requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight}),cn(!1),n&&on(!0)):cn(!0)},[c,i,l,an]);let En=_(()=>{let e=Dt.current;if(!e)return;if(G.current&&!X){on(!0),cn(!1);return}let t=e.scrollHeight-e.scrollTop-e.clientHeight<80;on(t),t&&cn(!1)},[X]),Dn=_(()=>{let e=Dt.current;e&&(e.scrollTop=e.scrollHeight),cn(!1),on(!0)},[]),On=_(()=>{ln.current=Date.now()+3e3,requestAnimationFrame(Dn)},[Dn]);v(()=>{if(!i||X||!H||B===`connecting`)return;ln.current=Date.now()+6e4,Dn();let e=requestAnimationFrame(()=>{Dn(),requestAnimationFrame(Dn)}),t=[80,180,360].map(e=>window.setTimeout(Dn,e));return()=>{cancelAnimationFrame(e),t.forEach(e=>window.clearTimeout(e))}},[f,c,i,Dn,l,H,X,B]);let kn=_(()=>{Tt.current?.querySelector(`.cf-textarea`)?.focus()},[]),An=_(()=>{Nt.current&&window.clearTimeout(Nt.current),Nt.current=void 0,Pt.current&&window.clearTimeout(Pt.current),Pt.current=void 0,Ft.current?.stop(),Ft.current=null,Ie(0)},[]),Z=_(()=>{Vt.current?.stop(),Vt.current=null,D(Ut.current),Bt.current?.getTracks().forEach(e=>e.stop()),Bt.current=null,Ht.current=0,Kt.current=0},[]),jn=_(()=>{An(),jt.current?.getTracks().forEach(e=>e.stop()),jt.current=null},[An]),Q=_(()=>{G.current=!1,q.current=!1,K.current=!1,At.current=!1,Jt.current=null,Yt.current=!1,Xt.current=null,Y.current=``,Ne(!1),Pe(!1),Le(!1),Be(null),Z(),Oe();let e=J.current;e?.state===`recording`?D(e):(jn(),V(`idle`))},[Z,Oe,jn]),Mn=_(()=>{W&&Be(null),Le(!W)},[W]),Nn=_(e=>{Be(e),Le(!0)},[]),Pn=_(()=>{let e=ze;Be(null),Le(!1),window.requestAnimationFrame(()=>{Array.from(Tt.current?.querySelectorAll(`[data-visualization-message]`)??[]).find(t=>t.dataset.visualizationMessage===e)?.focus()})},[ze]),Fn=_(()=>{Be(null),Le(!1)},[]),In=_((e,t)=>{if(Date.now()-kt.current>=st){V(`timeout`),Pt.current=window.setTimeout(()=>Q(),2400);return}V(e),Pt.current=window.setTimeout(()=>{G.current&&!K.current&&!en.current&&t()},1400)},[Q]),Ln=_((e,t,n)=>{Date.now()-kt.current<st&&!K.current&&(q.current=!0,z(t)),In(e,n)},[In,z]),Rn=_((e,t)=>{On(),kt.current=Date.now(),q.current=!0,t&&oe(t,{content:e,pending:!0,streaming:!1});let n=()=>{if(G.current){if($t.current){window.setTimeout(n,80);return}t&&Xt.current===t&&(Xt.current=null),k(e,{forceVoicePlayback:!0,userMessageId:t})}};n()},[On,oe,k]),zn=_(async(e,t,n,r=`normal`,i)=>{let a=null,s=e=>a||(On(),a=Xt.current||ae(e),Xt.current=a,oe(a,{content:Y.current||e,pending:!0,streaming:!1}),a),c=()=>{a&&(Xt.current===a&&(Xt.current=null),Y.current=``,P(a),a=null)},l=()=>{Y.current=``,V(`listening`),window.setTimeout(()=>{G.current&&!K.current&&!$t.current&&!J.current&&n()},120)},u=e.size===0,d=e.size<350&&t<.001;if(u||d){if(r===`barge`){l();return}let e=Jt.current;Ln(`noise`,e?yt(e):bt(o),n),Y.current=``;return}V(`processing`);let f=++rn.current,p=s(`Listening...`);try{let t=typeof navigator<`u`&&(navigator.languages?.[0]||navigator.language)||void 0;oe(p,{content:Y.current?`${Y.current} ...`:`Transcribing...`,pending:!0});let a=await St(e);if(!a.trim()){if(c(),r===`barge`){l();return}Ln(`noise`,Jt.current?yt(Jt.current):bt(o),n);return}let s=ct(await I(a,e.type,t,i));if(f!==rn.current){c();return}let u=[Y.current,s].map(e=>e.trim()).filter(Boolean).join(` `).replace(/\s+/g,` `).trim();if(!u||ut(u)||dt(u)){if(c(),r===`barge`){l();return}let e=Jt.current;Ln(`misunderstood`,e?yt(e):bt(o),n);return}let d=Jt.current;if(d){let e=pt(u);if(ht.test(e)||d===`end`&&_t.test(e)){c(),Jt.current=null,Zt.current(d);return}if(gt.test(e)){c(),Jt.current=null;let e=`Okay, never mind โ what would you like to know?`;N(e),q.current=!0,V(`speaking`),z(e);return}c();let t=yt(d);N(t),q.current=!0,V(`speaking`),z(t);return}let m=vt(u);if(m){if(c(),kt.current=Date.now(),m.confident){Zt.current(m.action);return}Jt.current=m.action;let e=`Just to confirm โ you want me to ${ft[m.action]}? Please say yes or no.`;N(e),q.current=!0,V(`speaking`),z(e);return}if(oe(p,{content:u,pending:!0}),xt(u)){Y.current=u,V(`listening`),n();return}Y.current=``,Rn(u,p)}catch(e){if(c(),r===`barge`){l();return}Ln(`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)}},[ae,On,Ln,N,oe,o,P,Rn,z,I]),$=_(async()=>{if(!(!G.current||K.current)&&!(!o?.allowVoiceInput||R||X)&&!$t.current&&!J.current){Z(),q.current=!1;try{V(`connecting`);let e=await navigator.mediaDevices.getUserMedia({audio:wt(Qt.current)});if(!G.current||K.current){e.getTracks().forEach(e=>e.stop());return}navigator.mediaDevices.enumerateDevices().then(e=>{Ke(e.filter(e=>e.kind===`audioinput`).map((e,t)=>({deviceId:e.deviceId,label:e.label||`Microphone ${t+1}`})))}).catch(()=>{});let t=E(e);J.current=t,jt.current=e,Mt.current=[],It.current=0,Rt.current=!1,zt.current=0;let n=performance.now();Ft.current=Ct(e,(e,r)=>{if(It.current=Math.max(It.current,e),e>=.0038)Rt.current=!0,zt.current=0;else if(Rt.current&&e<=at){zt.current||(zt.current=r);let e=r-zt.current,i=r-n;if(e>=ot&&i>=550&&t.state===`recording`){D(t);return}}else zt.current=0;r-Lt.current>90&&(Lt.current=r,Ie(e))}),t.ondataavailable=e=>{e.data.size>0&&Mt.current.push(e.data)},t.onstop=async()=>{if(jn(),J.current=null,At.current){At.current=!1,G.current&&!K.current?(V(`idle`),$()):V(G.current&&K.current?`muted`:`idle`);return}if(!G.current){V(`idle`);return}await zn(new Blob(Mt.current,{type:t.mimeType||`audio/webm`}),It.current,$,`normal`,Math.max(0,(performance.now()-n)/1e3))},t.start(250),V(`listening`),Nt.current=window.setTimeout(()=>{D(J.current)},it)}catch{V(`denied`),Pt.current=window.setTimeout(()=>Q(),3500)}}},[R,Q,zn,o,o?.allowVoiceInput,Z,jn,X]),Bn=_(()=>{if(G.current){Q();return}kn(),!(!o?.allowVoiceInput||$t.current||R||X)&&(kt.current=Date.now(),q.current=!1,K.current=!1,G.current=!0,Pe(!1),Ne(!0),V(`connecting`),$())},[R,Q,kn,o,o?.allowVoiceInput,$,X]),Vn=_(()=>{Pe(e=>{let t=!e;if(K.current=t,t){let e=J.current;e?.state===`recording`?(At.current=!0,D(e)):(jn(),V(`muted`))}else G.current&&!R&&!X&&(V(`idle`),$());return t})},[R,$,jn,X]),Hn=_((e,t)=>{N(e),t&&(q.current=!0),V(`speaking`),z(e)},[N,z]),Un=_(e=>{switch(kt.current=Date.now(),e){case`end`:q.current=!1,Yt.current=!0,Hn(`Okay โ ending our call now. Goodbye!`,!1),window.setTimeout(()=>{Yt.current&&(Yt.current=!1,Q())},2e3);break;case`mute`:{K.current||Vn();let e=`Muted. Tap the mic button when you want me to listen again.`;N(e),z(e);break}case`minimize`:bn(),Hn(`Minimized โ I'm still listening. Tap the call pill to bring the chat back.`,!0);break;case`expand`:Le(!0),Hn(`Sure โ expanding the view.`,!0);break;case`shrink`:Be(null),Le(!1),Hn(`Okay โ back to the smaller view.`,!0);break}},[bn,Q,N,z,Hn,Vn]);v(()=>{Zt.current=Un},[Un]);let Wn=b(!1);v(()=>{Wn.current&&!f&&Yt.current&&(Yt.current=!1,Q()),Wn.current=f},[f,Q]);let Gn=_(e=>{Qt.current=e,Je(e);let t=J.current;t?.state===`recording`&&(At.current=!0,D(t))},[]),Kn=_(()=>{if(!(!G.current||K.current)){if(Z(),M(),Oe(),kt.current=Date.now(),V(`listening`),$t.current){let e=()=>{if(!(!G.current||K.current)){if($t.current){window.setTimeout(e,70);return}q.current=!1,$()}};window.setTimeout(e,70);return}q.current=!1,$()}},[$,M,Z,Oe]),qn=_(async()=>{if(!(Bt.current||Vt.current)&&!(!G.current||K.current))try{let e=await navigator.mediaDevices.getUserMedia({audio:wt(Qt.current)});if(!G.current||K.current||J.current||Bt.current||!tn.current&&nn.current!==`processing`){e.getTracks().forEach(e=>e.stop());return}Bt.current=e,Ht.current=0,Kt.current=0,qt.current=0;let t=()=>{if(Ut.current)return;M(),Oe(),rn.current+=1,kt.current=Date.now(),q.current=!1,V(`listening`);let t=E(e);Ut.current=t,Wt.current=[],Gt.current=performance.now(),Kt.current=0,t.ondataavailable=e=>{e.data.size>0&&Wt.current.push(e.data)},t.onstop=async()=>{let e=Wt.current,n=qt.current,r=t.mimeType||`audio/webm`;Ut.current=null,Wt.current=[],Z(),G.current&&await zn(new Blob(e,{type:r}),n,$,`barge`,Math.max(0,(performance.now()-Gt.current)/1e3))},t.start(250)};Vt.current=Ct(e,(e,n)=>{if(qt.current=Math.max(qt.current,e),n-Lt.current>90&&(Lt.current=n,Ie(e)),e>=.009)Ht.current||(Ht.current=n),n-Ht.current>=280&&t(),Kt.current=0;else if(Ut.current&&e<=at){Kt.current||(Kt.current=n);let e=n-Kt.current,t=n-Gt.current;e>=ot&&t>=550&&Ut.current.state===`recording`&&D(Ut.current)}else Ut.current&&n-Gt.current>=it&&Ut.current.state===`recording`?D(Ut.current):(Ht.current=0,Kt.current=0)}),Vt.current||Z()}catch{}},[zn,$,M,Z,Oe]);v(()=>{if(!(H&&!U&&!R&&!X&&($e||B===`processing`))){Z();return}let e=window.setTimeout(()=>void qn(),250);return()=>window.clearTimeout(e)},[$e,R,qn,Z,H,U,B,X]);let Jn=H&&!U&&(l||f||B===`processing`);v(()=>{!H||U||f&&V(`speaking`)},[f,H,U]),v(()=>{if(!H||U||!q.current||l||f||![`processing`,`speaking`,`noise`,`misunderstood`].includes(B))return;let e=window.setTimeout(()=>{!G.current||K.current||$t.current||(q.current=!1,$())},700);return()=>window.clearTimeout(e)},[f,l,$,H,U,B]),v(()=>()=>Q(),[Q]);let[Yn,Xn]=x(``),Zn=b(!1);v(()=>{if(Zn.current&&!l){let e=[...c].reverse().find(e=>e.role===`assistant`&&!e.streaming&&!e.pending&&e.content);e&&Xn(e.content)}Zn.current=l},[l,c]),v(()=>{if(!i)return;let e=Tt.current;un||e?.querySelector(`.cf-textarea`)?.focus();let t=t=>{if(t.key===`Escape`){if(t.preventDefault(),un){dn(!1);return}bn();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)},[i,bn,un]),v(()=>{let e=Tt.current;e&&(i?e.removeAttribute(`inert`):e.setAttribute(`inert`,``))},[i]);let Qn=t.accentColor??o?.accentColor,$n={zIndex:t.zIndex,"--cf-h-pad":`${t.horizontalPadding}px`,"--cf-v-pad":`${t.verticalPadding}px`,...Qn?{"--cf-accent":Qn,"--cf-accent-2":`color-mix(in oklab, ${Qn} 76%, #14141f)`}:{}},er=e=>k(e),tr=[...c].reverse().find(e=>e.role===`user`&&e.content.trim())?.content??``,nr=c.some(e=>e.role===`user`),rr=o?.talkbackMode===`avatar`||o?.widgetModule===`assistant`||!!o?.allowVoiceInput,ir=!X&&rr&&!nr?_n.filter((e,t)=>!(t===0&&e.role===`assistant`)):_n,ar=g===`human`&&y?y:o?.agentName??`Chat`,or=g===`human`?`Live support`:g===`queued`?`Waiting for the team`:o?.offline?r.statusOffline:r.statusOnline,sr=!R&&!X?o?.availableActions:void 0,cr=H&&B===`connecting`&&!X;return C(d,{value:r,children:w(`div`,{class:`cf-root`,"data-theme":Ze,"data-align":t.alignment,"data-display":`floating`,style:$n,children:[W&&i&&C(`div`,{class:`cf-theater-backdrop`,onClick:Fn}),w(`div`,{ref:Tt,class:`cf-panel ${i?`is-open`:``} ${H?`cf-panel--call`:``} ${cr?`cf-panel--voice-connecting`:``} ${W&&i?`cf-panel--theater`:``} ${vn?`cf-panel--analytics-focus`:``}`,role:`dialog`,"aria-modal":`false`,"aria-label":`Chat with ${o?.agentName??`us`}`,"aria-hidden":!i,children:[w(`div`,{class:`cf-header`,children:[C(ke,{persona:o,hideWhenMissing:!0}),w(`div`,{class:`cf-header__meta`,children:[C(`div`,{class:`cf-header__name`,children:ar}),C(`div`,{class:`cf-header__status ${g===`ai`&&o?.offline?`cf-header__status--offline`:``}`,children:C(`span`,{class:`cf-header__status-text`,children:or})})]}),w(`div`,{class:`cf-header__actions`,children:[Se.length>0&&C(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":r.pastConversations,title:r.pastConversations,"aria-pressed":pn,onClick:()=>mn(e=>!e),children:C(pe,{})}),nr&&!R&&!X&&C(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":r.endChat,title:r.endChat,onClick:Sn,children:C(fe,{})}),t.sound&<&&C(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":Ye?r.unmuteSounds:r.muteSounds,"aria-pressed":Ye,onClick:mt,children:C(Ye?ce:se,{})}),C(`button`,{type:`button`,class:`cf-header__btn cf-header__close`,"aria-label":r.closeChat,onClick:bn,children:C(j,{})})]})]}),C(`div`,{class:`cf-panel__video`,children:vn?C(`div`,{class:`cf-analytics-focus`,role:`region`,"aria-label":`Expanded analytics result`,children:C(Ge,{visualization:vn,expanded:!0,onClose:Pn})}):!X&&rr?C(Me,{persona:o,starters:[],onPick:k,onFocusComposer:Bn,speaking:Qe||f,voiceState:B,replyPending:H&&l&&!f,pinned:!0,muted:U,onToggleMute:Vn,onEndCall:Q,onTalkNow:Kn,showTalkNow:Jn,micLevel:Fe,theaterMode:W,onToggleTheater:Mn,onMinimize:bn,audioDevices:Ue,selectedAudioDeviceId:qe,onSelectAudioDevice:Gn,connectingOnly:cr}):null}),!cr&&w(`div`,{class:`cf-panel__chat`,children:[t.preview&&C(`div`,{class:`cf-preview-banner`,children:r.previewBanner}),X&&C(`div`,{class:`cf-viewing-banner`,children:r.viewingPast}),w(`div`,{class:`cf-body`,ref:Dt,role:`log`,onScroll:En,children:[ir.map((e,t)=>C(We,{msg:e,persona:o,isLast:!X&&t===ir.length-1,visitor:m,hasEmail:h,lastQuestion:tr,showActions:!X&&t===ir.length-1&&!!e.handoffOffered,onPickReply:er,onSubmitForm:le,onDemoSlots:ge,onRetry:re,ratable:!X&&ir.slice(0,t).some(e=>e.role===`user`),onRate:ie,onExpandVisualization:X?void 0:Nn},e.id)),!nr&&!X&&w(S,{children:[ir.length===0&&C(nt,{name:o?.agentName??`Assistant`,greeting:o?.greeting}),C(Ve,{items:O,onPick:k}),C(He,{items:ee})]}),sn&&w(`button`,{type:`button`,class:`cf-newmsg`,onClick:Dn,children:[C(ye,{}),r.newMessages]})]}),C(`div`,{class:`cf-sr-live`,"aria-live":`polite`,"aria-atomic":`true`,children:Yn}),l&&!R&&!X&&C(`div`,{class:`cf-stopbar`,children:w(`button`,{type:`button`,class:`cf-stop`,onClick:M,children:[C(ue,{}),r.stop]})}),X?C(`div`,{class:`cf-ended`,children:C(`button`,{type:`button`,class:`cf-ended__btn`,onClick:Ee,children:r.backToChat})}):R?w(`div`,{class:`cf-ended`,children:[C(`p`,{class:`cf-ended__text`,children:r.conversationEnded}),t.csat&&nr?hn?C(`p`,{class:`cf-ended__text`,children:r.feedbackThanks}):w(`div`,{class:`cf-csat`,children:[C(`span`,{class:`cf-csat__q`,children:r.csatPrompt}),C(`button`,{type:`button`,class:`cf-csat__btn`,"aria-label":r.feedbackHelpful,onClick:()=>{F(`up`),gn(!0)},children:C(me,{})}),C(`button`,{type:`button`,class:`cf-csat__btn`,"aria-label":r.feedbackNotHelpful,onClick:()=>{F(`down`),gn(!0)},children:C(L,{})})]}):null,C(`button`,{type:`button`,class:`cf-ended__btn`,onClick:wn,children:r.startNewChat})]}):w(S,{children:[T?w(`div`,{class:`cf-live-typing`,"aria-live":`polite`,children:[T,` is typingโฆ`]}):null,sr&&sr.length>0&&C(`div`,{class:`cf-footer-actions`,children:C(Re,{actions:sr,visitor:m,onSubmitForm:le,onDemoSlots:ge,scheduler:o?.scheduler})}),C(tt,{onSend:k,onSendGif:te,onTyping:ne,disabled:l,allowVoice:!!o?.allowVoiceInput,onTranscribe:I,gifEnabled:_e,onSearchGifs:he,allowAttach:t.attachments,onExtract:de})]}),!R&&o?.disclaimerText&&C(`div`,{class:`cf-disclaimer`,children:o.disclaimerText}),w(`div`,{class:`cf-footer`,children:[r.poweredBy,` `,C(`a`,{href:`https://accurix.tech/centrinfo`,target:`_blank`,rel:`noopener noreferrer`,children:`Centrinfo`})]})]}),un&&C(`div`,{class:`cf-confirm`,onClick:()=>dn(!1),children:w(`div`,{class:`cf-confirm__card`,role:`alertdialog`,"aria-modal":`true`,"aria-label":r.endChatConfirm,onClick:e=>e.stopPropagation(),children:[C(`div`,{class:`cf-confirm__title`,children:r.endChatConfirm}),C(`div`,{class:`cf-confirm__body`,children:r.endChatConfirmBody}),w(`div`,{class:`cf-confirm__actions`,children:[C(`button`,{ref:fn,type:`button`,class:`cf-confirm__btn cf-confirm__btn--cancel`,onClick:()=>dn(!1),children:r.cancel}),C(`button`,{type:`button`,class:`cf-confirm__btn cf-confirm__btn--danger`,onClick:Cn,children:r.endConfirmCta})]})]})}),pn&&C(`div`,{class:`cf-confirm`,onClick:()=>mn(!1),children:w(`div`,{class:`cf-history`,role:`dialog`,"aria-modal":`true`,"aria-label":r.pastConversations,onClick:e=>e.stopPropagation(),children:[w(`div`,{class:`cf-history__head`,children:[C(`span`,{children:r.pastConversations}),C(`button`,{type:`button`,class:`cf-header__btn`,"aria-label":r.closeChat,onClick:()=>mn(!1),children:C(j,{})})]}),C(`div`,{class:`cf-history__list`,children:Se.map(e=>w(`button`,{type:`button`,class:`cf-history__item ${e.sessionId===Ce?`is-active`:``}`,onClick:()=>{Te(e.sessionId),mn(!1)},children:[C(`span`,{class:`cf-history__title`,children:e.title}),w(`span`,{class:`cf-history__meta`,children:[new Date(e.ts).toLocaleDateString(void 0,{month:`short`,day:`numeric`}),e.ended?` ยท ${r.historyEnded}`:``]})]},e.sessionId))})]})})]}),H&&!i?C(et,{persona:o,voiceState:B,muted:U,onToggleMute:Vn,onEndCall:Q,micLevel:Fe,onExpand:yn}):W&&i?null:!t.hideDefaultLauncher&&w(`button`,{ref:Et,type:`button`,class:`cf-launcher`,"aria-label":i?r.closeChat:r.openChat,"aria-expanded":i,onClick:xn,children:[t.launcherIcon?C(`img`,{class:`cf-launcher__img`,src:t.launcherIcon,alt:``}):C(A,{}),!i&&Ae>0&&C(`span`,{class:`cf-launcher__badge`,children:Ae})]})]})})},Et=`
|
|
9
2
|
:host {
|
|
10
3
|
all: initial;
|
|
11
4
|
}
|
|
@@ -27,8 +20,8 @@ import{createContext as e,render as t}from"preact";import{useCallback as n,useCo
|
|
|
27
20
|
bottom: 0;
|
|
28
21
|
right: 0;
|
|
29
22
|
font-family: var(--cf-font);
|
|
30
|
-
font-size:
|
|
31
|
-
line-height: 1.
|
|
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 @@ import{createContext as e,render as t}from"preact";import{useCallback as n,useCo
|
|
|
135
128
|
z-index: 2;
|
|
136
129
|
width: 384px;
|
|
137
130
|
max-width: calc(100vw - 32px);
|
|
138
|
-
height:
|
|
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
|
-
|
|
144
|
-
|
|
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(
|
|
146
|
+
transform: translateY(22px) scale(0.94);
|
|
149
147
|
pointer-events: none;
|
|
150
|
-
transition: opacity 0.
|
|
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 @@ import{createContext as e,render as t}from"preact";import{useCallback as n,useCo
|
|
|
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 @@ import{createContext as e,render as t}from"preact";import{useCallback as n,useCo
|
|
|
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:
|
|
390
|
+
padding: 12px 14px 8px;
|
|
285
391
|
display: flex;
|
|
286
392
|
flex-direction: column;
|
|
287
393
|
gap: 12px;
|
|
@@ -295,6 +401,38 @@ import{createContext as e,render as t}from"preact";import{useCallback as n,useCo
|
|
|
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 @@ import{createContext as e,render as t}from"preact";import{useCallback as n,useCo
|
|
|
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 @@ import{createContext as e,render as t}from"preact";import{useCallback as n,useCo
|
|
|
327
469
|
words like "Hello" never split mid-word. */
|
|
328
470
|
overflow-wrap: break-word;
|
|
329
471
|
white-space: pre-wrap;
|
|
330
|
-
font-size:
|
|
472
|
+
font-size: 13.5px;
|
|
331
473
|
}
|
|
332
474
|
.cf-msg--agent .cf-msg__bubble {
|
|
333
475
|
background: var(--cf-surface);
|
|
@@ -348,6 +490,39 @@ import{createContext as e,render as t}from"preact";import{useCallback as n,useCo
|
|
|
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(220px, 86%);
|
|
495
|
+
display: grid;
|
|
496
|
+
justify-items: center;
|
|
497
|
+
gap: 6px;
|
|
498
|
+
text-align: center;
|
|
499
|
+
color: var(--cf-muted);
|
|
500
|
+
}
|
|
501
|
+
.cf-system-event__mark {
|
|
502
|
+
width: 40px;
|
|
503
|
+
height: 40px;
|
|
504
|
+
border-radius: 999px;
|
|
505
|
+
display: grid;
|
|
506
|
+
place-items: center;
|
|
507
|
+
border: 1px solid color-mix(in srgb, var(--cf-accent, #2f7f55) 38%, transparent);
|
|
508
|
+
background: color-mix(in srgb, var(--cf-accent, #2f7f55) 8%, transparent);
|
|
509
|
+
}
|
|
510
|
+
.cf-system-event__mark .cf-msg__avatar {
|
|
511
|
+
align-self: center;
|
|
512
|
+
width: 28px;
|
|
513
|
+
height: 28px;
|
|
514
|
+
}
|
|
515
|
+
.cf-system-event__text {
|
|
516
|
+
font-size: 14px;
|
|
517
|
+
font-weight: 700;
|
|
518
|
+
line-height: 1.25;
|
|
519
|
+
color: var(--cf-text);
|
|
520
|
+
}
|
|
521
|
+
.cf-system-event__time {
|
|
522
|
+
font-size: 12px;
|
|
523
|
+
line-height: 1.2;
|
|
524
|
+
color: var(--cf-muted);
|
|
525
|
+
}
|
|
351
526
|
|
|
352
527
|
/* ---------- Markdown in answers ---------- */
|
|
353
528
|
.cf-msg__bubble .cf-md-h { font-weight: 700; font-size: 14.5px; margin: 4px 0 2px; }
|
|
@@ -456,20 +631,85 @@ import{createContext as e,render as t}from"preact";import{useCallback as n,useCo
|
|
|
456
631
|
.cf-feedback__send:hover { opacity: 0.9; }
|
|
457
632
|
|
|
458
633
|
/* conversation starters */
|
|
459
|
-
.cf-starters {
|
|
634
|
+
.cf-starters {
|
|
635
|
+
display: flex;
|
|
636
|
+
flex-direction: column;
|
|
637
|
+
align-items: flex-start;
|
|
638
|
+
min-width: 0;
|
|
639
|
+
gap: 8px;
|
|
640
|
+
margin: 2px 0 4px 34px;
|
|
641
|
+
}
|
|
460
642
|
.cf-starter {
|
|
461
|
-
|
|
643
|
+
max-width: 100%;
|
|
644
|
+
padding: 8px 12px;
|
|
462
645
|
border-radius: 14px;
|
|
463
646
|
border: 1px solid var(--cf-border);
|
|
464
647
|
background: var(--cf-bg);
|
|
465
648
|
color: var(--cf-text);
|
|
466
|
-
font-size:
|
|
649
|
+
font-size: 12.8px;
|
|
467
650
|
font-weight: 500;
|
|
468
651
|
text-align: left;
|
|
652
|
+
overflow-wrap: anywhere;
|
|
469
653
|
transition: border-color 0.15s ease, transform 0.1s ease;
|
|
470
654
|
}
|
|
471
655
|
.cf-starter:hover { border-color: var(--cf-accent); }
|
|
472
656
|
.cf-starter:active { transform: scale(0.98); }
|
|
657
|
+
.cf-starter:focus-visible {
|
|
658
|
+
outline: 2px solid var(--cf-accent-2);
|
|
659
|
+
outline-offset: 2px;
|
|
660
|
+
}
|
|
661
|
+
.cf-featured-links {
|
|
662
|
+
display: flex;
|
|
663
|
+
flex-wrap: wrap;
|
|
664
|
+
align-items: flex-start;
|
|
665
|
+
min-width: 0;
|
|
666
|
+
gap: 8px;
|
|
667
|
+
margin: 2px 0 4px;
|
|
668
|
+
}
|
|
669
|
+
.cf-featured-link {
|
|
670
|
+
flex: 0 1 auto;
|
|
671
|
+
min-width: 0;
|
|
672
|
+
max-width: 100%;
|
|
673
|
+
display: inline-flex;
|
|
674
|
+
align-items: center;
|
|
675
|
+
gap: 7px;
|
|
676
|
+
min-width: 0;
|
|
677
|
+
min-height: 34px;
|
|
678
|
+
padding: 7px 11px;
|
|
679
|
+
border-radius: 999px;
|
|
680
|
+
border: 1px solid color-mix(in srgb, var(--cf-accent) 55%, var(--cf-border));
|
|
681
|
+
background: color-mix(in srgb, var(--cf-accent) 10%, var(--cf-bg));
|
|
682
|
+
color: var(--cf-text);
|
|
683
|
+
font-size: 13px;
|
|
684
|
+
font-weight: 500;
|
|
685
|
+
text-decoration: none;
|
|
686
|
+
transition: border-color 0.15s ease, background-color 0.15s ease;
|
|
687
|
+
}
|
|
688
|
+
.cf-featured-link svg {
|
|
689
|
+
width: 14px;
|
|
690
|
+
height: 14px;
|
|
691
|
+
flex: 0 0 14px;
|
|
692
|
+
}
|
|
693
|
+
.cf-featured-link svg {
|
|
694
|
+
width: 14px;
|
|
695
|
+
height: 14px;
|
|
696
|
+
flex: 0 0 14px;
|
|
697
|
+
color: var(--cf-accent);
|
|
698
|
+
}
|
|
699
|
+
.cf-featured-link span {
|
|
700
|
+
min-width: 0;
|
|
701
|
+
overflow: hidden;
|
|
702
|
+
text-overflow: ellipsis;
|
|
703
|
+
white-space: nowrap;
|
|
704
|
+
}
|
|
705
|
+
.cf-featured-link:hover {
|
|
706
|
+
border-color: var(--cf-accent);
|
|
707
|
+
background: color-mix(in srgb, var(--cf-accent) 16%, var(--cf-bg));
|
|
708
|
+
}
|
|
709
|
+
.cf-featured-link:focus-visible {
|
|
710
|
+
outline: 2px solid var(--cf-accent-2);
|
|
711
|
+
outline-offset: 2px;
|
|
712
|
+
}
|
|
473
713
|
|
|
474
714
|
/* stop generating */
|
|
475
715
|
.cf-stopbar { display: flex; justify-content: center; padding: 6px 0 2px; flex-shrink: 0; }
|
|
@@ -493,12 +733,20 @@ import{createContext as e,render as t}from"preact";import{useCallback as n,useCo
|
|
|
493
733
|
/* typing */
|
|
494
734
|
.cf-typing {
|
|
495
735
|
display: inline-flex;
|
|
736
|
+
align-items: center;
|
|
496
737
|
gap: 4px;
|
|
497
|
-
padding: 13px
|
|
738
|
+
padding: 10px 13px;
|
|
739
|
+
min-width: 98px;
|
|
740
|
+
}
|
|
741
|
+
.cf-typing__label {
|
|
742
|
+
margin-right: 3px;
|
|
743
|
+
color: var(--cf-muted);
|
|
744
|
+
font-size: 12px;
|
|
745
|
+
font-weight: 650;
|
|
498
746
|
}
|
|
499
747
|
.cf-typing__dot {
|
|
500
|
-
width:
|
|
501
|
-
height:
|
|
748
|
+
width: 5px;
|
|
749
|
+
height: 5px;
|
|
502
750
|
border-radius: 50%;
|
|
503
751
|
background: var(--cf-muted);
|
|
504
752
|
animation: cf-typing 1.1s infinite ease-in-out;
|
|
@@ -565,7 +813,7 @@ import{createContext as e,render as t}from"preact";import{useCallback as n,useCo
|
|
|
565
813
|
background: var(--cf-surface);
|
|
566
814
|
border: 1px solid var(--cf-border);
|
|
567
815
|
color: var(--cf-text);
|
|
568
|
-
font-size:
|
|
816
|
+
font-size: 12.8px;
|
|
569
817
|
font-weight: 600;
|
|
570
818
|
transition: border-color 0.15s ease, transform 0.1s ease;
|
|
571
819
|
}
|
|
@@ -756,6 +1004,13 @@ import{createContext as e,render as t}from"preact";import{useCallback as n,useCo
|
|
|
756
1004
|
border-top: 1px solid var(--cf-border);
|
|
757
1005
|
background: var(--cf-bg);
|
|
758
1006
|
}
|
|
1007
|
+
.cf-live-typing {
|
|
1008
|
+
flex-shrink: 0;
|
|
1009
|
+
padding: 8px 14px 0;
|
|
1010
|
+
color: var(--cf-muted);
|
|
1011
|
+
font-size: 12px;
|
|
1012
|
+
background: var(--cf-bg);
|
|
1013
|
+
}
|
|
759
1014
|
.cf-composer__field {
|
|
760
1015
|
display: flex;
|
|
761
1016
|
align-items: flex-end;
|
|
@@ -767,6 +1022,23 @@ import{createContext as e,render as t}from"preact";import{useCallback as n,useCo
|
|
|
767
1022
|
transition: border-color 0.15s ease;
|
|
768
1023
|
}
|
|
769
1024
|
.cf-composer__field:focus-within { border-color: var(--cf-accent); }
|
|
1025
|
+
.cf-voice-state {
|
|
1026
|
+
display: inline-flex;
|
|
1027
|
+
align-items: center;
|
|
1028
|
+
gap: 8px;
|
|
1029
|
+
margin: 0 0 8px 2px;
|
|
1030
|
+
color: var(--cf-muted);
|
|
1031
|
+
font-size: 12.5px;
|
|
1032
|
+
}
|
|
1033
|
+
.cf-voice-state__dot {
|
|
1034
|
+
width: 8px;
|
|
1035
|
+
height: 8px;
|
|
1036
|
+
border-radius: 999px;
|
|
1037
|
+
background: var(--cf-accent);
|
|
1038
|
+
}
|
|
1039
|
+
.cf-voice-state__dot.is-live {
|
|
1040
|
+
animation: cf-pulse 1s infinite;
|
|
1041
|
+
}
|
|
770
1042
|
.cf-textarea {
|
|
771
1043
|
flex: 1;
|
|
772
1044
|
border: none;
|
|
@@ -899,106 +1171,1168 @@ import{createContext as e,render as t}from"preact";import{useCallback as n,useCo
|
|
|
899
1171
|
.cf-footer a { color: var(--cf-muted); text-decoration: none; font-weight: 600; }
|
|
900
1172
|
.cf-footer a:hover { color: var(--cf-accent); }
|
|
901
1173
|
|
|
902
|
-
/* ----------
|
|
903
|
-
.cf-
|
|
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);
|
|
1174
|
+
/* ---------- Footer lead actions ---------- */
|
|
1175
|
+
.cf-footer-actions {
|
|
922
1176
|
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;
|
|
1177
|
+
padding: 6px 14px 5px;
|
|
931
1178
|
background: var(--cf-bg);
|
|
932
|
-
border-
|
|
933
|
-
box-shadow: var(--cf-shadow);
|
|
934
|
-
overflow: hidden;
|
|
1179
|
+
border-top: 1px solid var(--cf-border);
|
|
935
1180
|
}
|
|
936
|
-
.cf-
|
|
937
|
-
display:
|
|
1181
|
+
.cf-action-trigger {
|
|
1182
|
+
display: grid;
|
|
1183
|
+
grid-template-columns: 28px minmax(0, 1fr) 16px;
|
|
938
1184
|
align-items: center;
|
|
939
|
-
|
|
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;
|
|
1185
|
+
gap: 8px;
|
|
951
1186
|
width: 100%;
|
|
1187
|
+
min-height: 40px;
|
|
1188
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 86%, var(--cf-accent));
|
|
1189
|
+
border-radius: 14px;
|
|
1190
|
+
padding: 6px 9px;
|
|
1191
|
+
background:
|
|
1192
|
+
radial-gradient(circle at 15% 0%, color-mix(in oklab, var(--cf-accent) 15%, transparent), transparent 40%),
|
|
1193
|
+
color-mix(in oklab, var(--cf-bg-soft) 78%, transparent);
|
|
1194
|
+
color: var(--cf-text);
|
|
952
1195
|
text-align: left;
|
|
953
|
-
padding: 9px 10px;
|
|
954
|
-
border-radius: 9px;
|
|
955
1196
|
cursor: pointer;
|
|
956
|
-
|
|
1197
|
+
box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
|
|
957
1198
|
}
|
|
958
|
-
.cf-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
.cf-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
1199
|
+
.cf-action-trigger:hover {
|
|
1200
|
+
border-color: color-mix(in oklab, var(--cf-accent) 46%, var(--cf-border));
|
|
1201
|
+
}
|
|
1202
|
+
.cf-action-trigger > svg {
|
|
1203
|
+
width: 14px;
|
|
1204
|
+
height: 14px;
|
|
1205
|
+
color: var(--cf-muted);
|
|
1206
|
+
}
|
|
1207
|
+
.cf-action-trigger__icon {
|
|
1208
|
+
display: inline-flex;
|
|
1209
|
+
align-items: center;
|
|
1210
|
+
justify-content: center;
|
|
1211
|
+
width: 28px;
|
|
1212
|
+
height: 28px;
|
|
1213
|
+
border-radius: 10px;
|
|
1214
|
+
background: color-mix(in oklab, var(--cf-accent) 15%, transparent);
|
|
1215
|
+
color: var(--cf-accent);
|
|
1216
|
+
}
|
|
1217
|
+
.cf-action-trigger__icon svg { width: 14px; height: 14px; }
|
|
1218
|
+
.cf-action-trigger__copy {
|
|
1219
|
+
display: grid;
|
|
1220
|
+
gap: 1px;
|
|
1221
|
+
min-width: 0;
|
|
1222
|
+
}
|
|
1223
|
+
.cf-action-trigger__copy strong {
|
|
1224
|
+
font-size: 12px;
|
|
1225
|
+
line-height: 1.1;
|
|
1226
|
+
}
|
|
1227
|
+
.cf-action-trigger__copy small {
|
|
1228
|
+
overflow: hidden;
|
|
1229
|
+
color: var(--cf-muted);
|
|
1230
|
+
font-size: 10.5px;
|
|
1231
|
+
line-height: 1.2;
|
|
1232
|
+
text-overflow: ellipsis;
|
|
1233
|
+
white-space: nowrap;
|
|
1234
|
+
}
|
|
1235
|
+
.cf-action-drawer {
|
|
1236
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 86%, var(--cf-accent));
|
|
1237
|
+
border-radius: 18px 18px 12px 12px;
|
|
1238
|
+
padding: 7px;
|
|
1239
|
+
background:
|
|
1240
|
+
radial-gradient(circle at 18% 0%, color-mix(in oklab, var(--cf-accent) 16%, transparent), transparent 38%),
|
|
1241
|
+
color-mix(in oklab, var(--cf-bg) 94%, #ffffff);
|
|
1242
|
+
box-shadow: 0 -10px 34px rgba(15, 23, 42, 0.14);
|
|
1243
|
+
animation: cf-drawer-up 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
1244
|
+
}
|
|
1245
|
+
.cf-action-drawer__handle {
|
|
1246
|
+
width: 36px;
|
|
1247
|
+
height: 3px;
|
|
1248
|
+
margin: 0 auto 6px;
|
|
1249
|
+
border-radius: 999px;
|
|
1250
|
+
background: color-mix(in oklab, var(--cf-muted) 42%, transparent);
|
|
1251
|
+
}
|
|
1252
|
+
.cf-action-drawer__head {
|
|
965
1253
|
display: flex;
|
|
966
|
-
flex-direction: column;
|
|
967
1254
|
align-items: center;
|
|
1255
|
+
justify-content: space-between;
|
|
968
1256
|
gap: 10px;
|
|
969
|
-
padding:
|
|
970
|
-
|
|
971
|
-
text-align: center;
|
|
1257
|
+
padding: 0 3px 6px;
|
|
1258
|
+
color: var(--cf-text);
|
|
972
1259
|
}
|
|
973
|
-
.cf-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1260
|
+
.cf-action-drawer__head strong {
|
|
1261
|
+
display: block;
|
|
1262
|
+
font-size: 13px;
|
|
1263
|
+
line-height: 1.2;
|
|
1264
|
+
}
|
|
1265
|
+
.cf-action-drawer__eyebrow {
|
|
1266
|
+
display: block;
|
|
1267
|
+
margin-bottom: 2px;
|
|
1268
|
+
font-size: 9px;
|
|
1269
|
+
font-weight: 800;
|
|
1270
|
+
letter-spacing: 0.16em;
|
|
1271
|
+
text-transform: uppercase;
|
|
1272
|
+
color: var(--cf-muted);
|
|
1273
|
+
}
|
|
1274
|
+
.cf-action-drawer__close {
|
|
977
1275
|
display: inline-flex;
|
|
978
1276
|
align-items: center;
|
|
979
1277
|
justify-content: center;
|
|
980
|
-
width:
|
|
981
|
-
height:
|
|
982
|
-
border
|
|
1278
|
+
width: 28px;
|
|
1279
|
+
height: 28px;
|
|
1280
|
+
border: 1px solid var(--cf-border);
|
|
1281
|
+
border-radius: 999px;
|
|
1282
|
+
background: var(--cf-bg-soft);
|
|
983
1283
|
color: var(--cf-muted);
|
|
984
1284
|
cursor: pointer;
|
|
985
|
-
transition: background 0.15s ease, color 0.15s ease;
|
|
986
1285
|
}
|
|
987
|
-
.cf-
|
|
988
|
-
.cf-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
1286
|
+
.cf-action-drawer__close svg { width: 14px; height: 14px; }
|
|
1287
|
+
.cf-action-drawer__grid {
|
|
1288
|
+
display: grid;
|
|
1289
|
+
gap: 6px;
|
|
1290
|
+
}
|
|
1291
|
+
.cf-action-card {
|
|
1292
|
+
display: grid;
|
|
1293
|
+
grid-template-columns: 30px minmax(0, 1fr) 14px;
|
|
1294
|
+
align-items: center;
|
|
1295
|
+
gap: 8px;
|
|
1296
|
+
width: 100%;
|
|
1297
|
+
border: 1px solid var(--cf-border);
|
|
1298
|
+
border-radius: 14px;
|
|
1299
|
+
padding: 7px 8px;
|
|
1300
|
+
background: color-mix(in oklab, var(--cf-bg-soft) 72%, transparent);
|
|
1301
|
+
color: var(--cf-text);
|
|
1302
|
+
text-align: left;
|
|
997
1303
|
cursor: pointer;
|
|
998
|
-
transition:
|
|
1304
|
+
transition:
|
|
1305
|
+
transform 0.16s ease,
|
|
1306
|
+
border-color 0.16s ease,
|
|
1307
|
+
background 0.16s ease;
|
|
1308
|
+
}
|
|
1309
|
+
.cf-action-card:hover {
|
|
1310
|
+
border-color: color-mix(in oklab, var(--cf-accent) 44%, var(--cf-border));
|
|
1311
|
+
background: color-mix(in oklab, var(--cf-accent) 9%, var(--cf-bg-soft));
|
|
1312
|
+
}
|
|
1313
|
+
.cf-action-card:active { transform: translateY(1px); }
|
|
1314
|
+
.cf-action-card > svg {
|
|
1315
|
+
width: 13px;
|
|
1316
|
+
height: 13px;
|
|
1317
|
+
color: var(--cf-muted);
|
|
1318
|
+
transform: rotate(-90deg);
|
|
999
1319
|
}
|
|
1000
|
-
.cf-
|
|
1001
|
-
|
|
1320
|
+
.cf-action-card__icon {
|
|
1321
|
+
display: inline-flex;
|
|
1322
|
+
align-items: center;
|
|
1323
|
+
justify-content: center;
|
|
1324
|
+
width: 30px;
|
|
1325
|
+
height: 30px;
|
|
1326
|
+
border-radius: 10px;
|
|
1327
|
+
background: color-mix(in oklab, var(--cf-accent) 14%, transparent);
|
|
1328
|
+
color: var(--cf-accent);
|
|
1329
|
+
}
|
|
1330
|
+
.cf-action-card__icon svg { width: 14px; height: 14px; }
|
|
1331
|
+
.cf-action-card__copy {
|
|
1332
|
+
display: grid;
|
|
1333
|
+
gap: 2px;
|
|
1334
|
+
min-width: 0;
|
|
1335
|
+
}
|
|
1336
|
+
.cf-action-card__copy strong {
|
|
1337
|
+
font-size: 12px;
|
|
1338
|
+
line-height: 1.2;
|
|
1339
|
+
}
|
|
1340
|
+
.cf-action-card__copy small {
|
|
1341
|
+
overflow: hidden;
|
|
1342
|
+
color: var(--cf-muted);
|
|
1343
|
+
font-size: 10.5px;
|
|
1344
|
+
line-height: 1.25;
|
|
1345
|
+
text-overflow: ellipsis;
|
|
1346
|
+
white-space: nowrap;
|
|
1347
|
+
}
|
|
1348
|
+
.cf-action-drawer__note {
|
|
1349
|
+
margin: 6px 3px 0;
|
|
1350
|
+
color: var(--cf-muted);
|
|
1351
|
+
font-size: 10px;
|
|
1352
|
+
line-height: 1.25;
|
|
1353
|
+
}
|
|
1354
|
+
.cf-action-drawer .cf-form,
|
|
1355
|
+
.cf-action-drawer .cf-booking {
|
|
1356
|
+
max-width: none;
|
|
1357
|
+
margin: 0;
|
|
1358
|
+
border: 0;
|
|
1359
|
+
background: transparent;
|
|
1360
|
+
box-shadow: none;
|
|
1361
|
+
}
|
|
1362
|
+
.cf-footer-actions .cf-actions {
|
|
1363
|
+
display: grid;
|
|
1364
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1365
|
+
gap: 7px;
|
|
1366
|
+
}
|
|
1367
|
+
.cf-footer-actions .cf-action {
|
|
1368
|
+
justify-content: center;
|
|
1369
|
+
min-width: 0;
|
|
1370
|
+
gap: 5px;
|
|
1371
|
+
min-height: 32px;
|
|
1372
|
+
border-radius: 11px;
|
|
1373
|
+
padding: 6px 8px;
|
|
1374
|
+
font-size: 12px;
|
|
1375
|
+
line-height: 1.15;
|
|
1376
|
+
font-weight: 650;
|
|
1377
|
+
}
|
|
1378
|
+
.cf-footer-actions .cf-action svg {
|
|
1379
|
+
width: 13px;
|
|
1380
|
+
height: 13px;
|
|
1381
|
+
}
|
|
1382
|
+
.cf-footer-actions .cf-form,
|
|
1383
|
+
.cf-footer-actions .cf-booking {
|
|
1384
|
+
max-width: none;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
@keyframes cf-drawer-up {
|
|
1388
|
+
from {
|
|
1389
|
+
opacity: 0;
|
|
1390
|
+
transform: translateY(14px) scale(0.98);
|
|
1391
|
+
}
|
|
1392
|
+
to {
|
|
1393
|
+
opacity: 1;
|
|
1394
|
+
transform: translateY(0) scale(1);
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
/* ---------- Assistant card module ---------- */
|
|
1399
|
+
.cf-assistant-card {
|
|
1400
|
+
display: flex;
|
|
1401
|
+
flex-direction: column;
|
|
1402
|
+
gap: 12px;
|
|
1403
|
+
margin: 0 2px 4px;
|
|
1404
|
+
animation: cf-msg-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
1405
|
+
}
|
|
1406
|
+
.cf-assistant-card--pinned {
|
|
1407
|
+
flex-shrink: 0;
|
|
1408
|
+
gap: 0;
|
|
1409
|
+
margin: 0;
|
|
1410
|
+
padding: 8px 14px 10px;
|
|
1411
|
+
border-bottom: 1px solid var(--cf-border);
|
|
1412
|
+
background: var(--cf-bg);
|
|
1413
|
+
}
|
|
1414
|
+
.cf-assistant-card--compact {
|
|
1415
|
+
align-items: flex-start;
|
|
1416
|
+
padding-top: 10px;
|
|
1417
|
+
padding-bottom: 12px;
|
|
1418
|
+
}
|
|
1419
|
+
.cf-assistant-card__compact-speak {
|
|
1420
|
+
position: relative;
|
|
1421
|
+
isolation: isolate;
|
|
1422
|
+
display: inline-flex;
|
|
1423
|
+
align-items: center;
|
|
1424
|
+
gap: 8px;
|
|
1425
|
+
max-width: 100%;
|
|
1426
|
+
min-height: 44px;
|
|
1427
|
+
padding: 5px 15px 5px 6px;
|
|
1428
|
+
border-radius: 999px;
|
|
1429
|
+
background:
|
|
1430
|
+
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))),
|
|
1431
|
+
var(--cf-bg);
|
|
1432
|
+
border: 1px solid color-mix(in oklab, var(--cf-accent) 58%, var(--cf-border));
|
|
1433
|
+
color: var(--cf-text);
|
|
1434
|
+
box-shadow:
|
|
1435
|
+
inset 0 1px 0 color-mix(in oklab, #fff 13%, transparent),
|
|
1436
|
+
0 13px 30px -22px color-mix(in oklab, var(--cf-accent) 60%, #000);
|
|
1437
|
+
font-size: 12.25px;
|
|
1438
|
+
font-weight: 750;
|
|
1439
|
+
line-height: 1;
|
|
1440
|
+
transition: border-color 0.15s ease, transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
|
|
1441
|
+
overflow: hidden;
|
|
1442
|
+
}
|
|
1443
|
+
.cf-assistant-card__compact-speak::before {
|
|
1444
|
+
content: '';
|
|
1445
|
+
position: absolute;
|
|
1446
|
+
inset: 1px;
|
|
1447
|
+
z-index: -1;
|
|
1448
|
+
border-radius: inherit;
|
|
1449
|
+
background:
|
|
1450
|
+
radial-gradient(circle at 20% 10%, color-mix(in oklab, var(--cf-accent) 28%, transparent), transparent 42%),
|
|
1451
|
+
radial-gradient(circle at 85% 100%, color-mix(in oklab, var(--cf-accent-2) 18%, transparent), transparent 38%);
|
|
1452
|
+
opacity: 0.76;
|
|
1453
|
+
pointer-events: none;
|
|
1454
|
+
}
|
|
1455
|
+
.cf-assistant-card__compact-speak:hover {
|
|
1456
|
+
border-color: color-mix(in oklab, var(--cf-accent) 82%, var(--cf-border));
|
|
1457
|
+
box-shadow:
|
|
1458
|
+
inset 0 1px 0 color-mix(in oklab, #fff 15%, transparent),
|
|
1459
|
+
0 16px 34px -22px color-mix(in oklab, var(--cf-accent) 76%, #000);
|
|
1460
|
+
}
|
|
1461
|
+
.cf-assistant-card__compact-speak:active { transform: scale(0.98); }
|
|
1462
|
+
.cf-assistant-card__compact-speak:focus-visible {
|
|
1463
|
+
outline: 2px solid var(--cf-accent-2);
|
|
1464
|
+
outline-offset: 2px;
|
|
1465
|
+
}
|
|
1466
|
+
.cf-assistant-card__compact-mic {
|
|
1467
|
+
width: 24px;
|
|
1468
|
+
height: 24px;
|
|
1469
|
+
margin-left: -14px;
|
|
1470
|
+
border-radius: 999px;
|
|
1471
|
+
display: inline-flex;
|
|
1472
|
+
align-items: center;
|
|
1473
|
+
justify-content: center;
|
|
1474
|
+
flex-shrink: 0;
|
|
1475
|
+
color: var(--cf-accent);
|
|
1476
|
+
background: color-mix(in oklab, var(--cf-bg) 90%, transparent);
|
|
1477
|
+
border: 1px solid color-mix(in oklab, var(--cf-accent) 48%, var(--cf-border));
|
|
1478
|
+
box-shadow: 0 7px 18px -12px rgba(0, 0, 0, 0.75);
|
|
1479
|
+
}
|
|
1480
|
+
.cf-assistant-card__compact-mic svg {
|
|
1481
|
+
width: 13px;
|
|
1482
|
+
height: 13px;
|
|
1483
|
+
color: var(--cf-accent);
|
|
1484
|
+
flex-shrink: 0;
|
|
1485
|
+
}
|
|
1486
|
+
.cf-assistant-card__compact-mic:first-child {
|
|
1487
|
+
margin-left: 0;
|
|
1488
|
+
}
|
|
1489
|
+
.cf-assistant-card__compact-label {
|
|
1490
|
+
min-width: 0;
|
|
1491
|
+
overflow: hidden;
|
|
1492
|
+
text-overflow: ellipsis;
|
|
1493
|
+
white-space: nowrap;
|
|
1494
|
+
letter-spacing: 0.01em;
|
|
1495
|
+
}
|
|
1496
|
+
.cf-assistant-card__compact-avatar {
|
|
1497
|
+
width: 34px;
|
|
1498
|
+
height: 34px;
|
|
1499
|
+
border-radius: 999px;
|
|
1500
|
+
display: grid;
|
|
1501
|
+
place-items: center;
|
|
1502
|
+
flex-shrink: 0;
|
|
1503
|
+
overflow: hidden;
|
|
1504
|
+
color: #fff;
|
|
1505
|
+
background: linear-gradient(135deg, var(--cf-avatar-a, var(--cf-accent)), var(--cf-avatar-b, var(--cf-accent-2)));
|
|
1506
|
+
border: 1px solid color-mix(in oklab, #fff 24%, transparent);
|
|
1507
|
+
box-shadow:
|
|
1508
|
+
0 0 0 3px color-mix(in oklab, var(--cf-accent) 16%, transparent),
|
|
1509
|
+
inset 0 1px 0 color-mix(in oklab, #fff 18%, transparent);
|
|
1510
|
+
font-size: 11px;
|
|
1511
|
+
font-weight: 800;
|
|
1512
|
+
}
|
|
1513
|
+
.cf-assistant-card__compact-avatar img {
|
|
1514
|
+
width: 100%;
|
|
1515
|
+
height: 100%;
|
|
1516
|
+
object-fit: cover;
|
|
1517
|
+
}
|
|
1518
|
+
.cf-assistant-card--pinned .cf-assistant-card__stage {
|
|
1519
|
+
height: 132px;
|
|
1520
|
+
min-height: 0;
|
|
1521
|
+
border-radius: 13px;
|
|
1522
|
+
}
|
|
1523
|
+
/* The stage sizes/positions the card's video area; .cf-assistant-card__media
|
|
1524
|
+
inside it stays overflow: hidden for the rounded image/video corners,
|
|
1525
|
+
while interactive controls sit as a stage sibling so their popovers
|
|
1526
|
+
aren't clipped by it. */
|
|
1527
|
+
.cf-assistant-card__stage {
|
|
1528
|
+
position: relative;
|
|
1529
|
+
border-radius: 12px;
|
|
1530
|
+
aspect-ratio: 16 / 9;
|
|
1531
|
+
}
|
|
1532
|
+
.cf-assistant-card__voice-only {
|
|
1533
|
+
position: relative;
|
|
1534
|
+
display: flex;
|
|
1535
|
+
align-items: center;
|
|
1536
|
+
justify-content: center;
|
|
1537
|
+
width: 100%;
|
|
1538
|
+
min-height: 44px;
|
|
1539
|
+
align-self: stretch;
|
|
1540
|
+
}
|
|
1541
|
+
.cf-assistant-card__media {
|
|
1542
|
+
position: absolute;
|
|
1543
|
+
inset: 0;
|
|
1544
|
+
overflow: hidden;
|
|
1545
|
+
border-radius: inherit;
|
|
1546
|
+
background: var(--cf-surface);
|
|
1547
|
+
border: 1px solid var(--cf-border);
|
|
1548
|
+
}
|
|
1549
|
+
.cf-assistant-card__stage--local {
|
|
1550
|
+
isolation: isolate;
|
|
1551
|
+
overflow: hidden;
|
|
1552
|
+
background:
|
|
1553
|
+
radial-gradient(circle at 30% 18%, color-mix(in oklab, var(--cf-accent) 18%, transparent), transparent 36%),
|
|
1554
|
+
linear-gradient(145deg, color-mix(in oklab, var(--cf-surface) 72%, var(--cf-bg)), var(--cf-bg));
|
|
1555
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 82%, var(--cf-accent));
|
|
1556
|
+
box-shadow:
|
|
1557
|
+
inset 0 1px 0 color-mix(in oklab, #fff 9%, transparent),
|
|
1558
|
+
0 22px 44px -34px color-mix(in oklab, var(--cf-accent) 46%, #000);
|
|
1559
|
+
}
|
|
1560
|
+
.cf-assistant-card__stage--local.is-live {
|
|
1561
|
+
height: 188px;
|
|
1562
|
+
aspect-ratio: auto;
|
|
1563
|
+
}
|
|
1564
|
+
.cf-assistant-card--pinned .cf-assistant-card__stage--local.is-live {
|
|
1565
|
+
height: 154px;
|
|
1566
|
+
}
|
|
1567
|
+
.cf-assistant-card__stage--local.is-speaking {
|
|
1568
|
+
box-shadow:
|
|
1569
|
+
inset 0 1px 0 color-mix(in oklab, #fff 11%, transparent),
|
|
1570
|
+
0 20px 54px -28px color-mix(in oklab, var(--cf-accent) 72%, #000);
|
|
1571
|
+
}
|
|
1572
|
+
.cf-assistant-card__stage--local.is-listening {
|
|
1573
|
+
border-color: color-mix(in oklab, var(--cf-accent) 62%, var(--cf-border));
|
|
1574
|
+
}
|
|
1575
|
+
.cf-assistant-card__stage--local.is-muted {
|
|
1576
|
+
filter: saturate(0.72);
|
|
1577
|
+
}
|
|
1578
|
+
.cf-assistant-card__stage--local .cf-assistant-card__media {
|
|
1579
|
+
z-index: 1;
|
|
1580
|
+
border: 0;
|
|
1581
|
+
background:
|
|
1582
|
+
radial-gradient(circle at 50% 42%, color-mix(in oklab, var(--cf-accent) 18%, transparent), transparent 38%),
|
|
1583
|
+
color-mix(in oklab, var(--cf-bg) 92%, var(--cf-surface));
|
|
1584
|
+
}
|
|
1585
|
+
.cf-assistant-card__media--uploaded::after {
|
|
1586
|
+
content: '';
|
|
1587
|
+
position: absolute;
|
|
1588
|
+
inset: 0;
|
|
1589
|
+
pointer-events: none;
|
|
1590
|
+
background:
|
|
1591
|
+
radial-gradient(circle at 50% 50%, transparent 28%, rgba(2, 6, 23, 0.08) 62%, rgba(2, 6, 23, 0.34) 100%),
|
|
1592
|
+
linear-gradient(180deg, transparent 52%, rgba(2, 6, 23, 0.26));
|
|
1593
|
+
}
|
|
1594
|
+
.cf-assistant-card__media img,
|
|
1595
|
+
.cf-assistant-card__media video {
|
|
1596
|
+
width: 100%;
|
|
1597
|
+
height: 100%;
|
|
1598
|
+
display: block;
|
|
1599
|
+
object-fit: cover;
|
|
1600
|
+
}
|
|
1601
|
+
.cf-avatar-aura {
|
|
1602
|
+
position: absolute;
|
|
1603
|
+
left: 50%;
|
|
1604
|
+
top: 50%;
|
|
1605
|
+
width: 104px;
|
|
1606
|
+
height: 104px;
|
|
1607
|
+
border-radius: 999px;
|
|
1608
|
+
transform: translate(-50%, -50%) scale(0.88);
|
|
1609
|
+
border: 1px solid color-mix(in oklab, var(--cf-accent) 42%, transparent);
|
|
1610
|
+
opacity: 0;
|
|
1611
|
+
pointer-events: none;
|
|
1612
|
+
z-index: 3;
|
|
1613
|
+
}
|
|
1614
|
+
.cf-avatar-aura--two {
|
|
1615
|
+
width: 142px;
|
|
1616
|
+
height: 142px;
|
|
1617
|
+
}
|
|
1618
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-aura--one {
|
|
1619
|
+
animation: cf-avatar-breathe 1.35s ease-in-out infinite;
|
|
1620
|
+
}
|
|
1621
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-aura--two {
|
|
1622
|
+
animation: cf-avatar-breathe 1.35s ease-in-out infinite 0.32s;
|
|
1623
|
+
}
|
|
1624
|
+
.cf-avatar-listen-ring {
|
|
1625
|
+
position: absolute;
|
|
1626
|
+
left: 50%;
|
|
1627
|
+
top: 50%;
|
|
1628
|
+
width: calc(112px + (var(--cf-listen, 0.2) * 42px));
|
|
1629
|
+
height: calc(112px + (var(--cf-listen, 0.2) * 42px));
|
|
1630
|
+
border-radius: 999px;
|
|
1631
|
+
transform: translate(-50%, -50%);
|
|
1632
|
+
border: 2px solid color-mix(in oklab, var(--cf-accent) 58%, transparent);
|
|
1633
|
+
box-shadow: 0 0 calc(14px + (var(--cf-listen, 0.2) * 24px)) color-mix(in oklab, var(--cf-accent) 34%, transparent);
|
|
1634
|
+
opacity: 0;
|
|
1635
|
+
pointer-events: none;
|
|
1636
|
+
z-index: 4;
|
|
1637
|
+
}
|
|
1638
|
+
.cf-assistant-card__stage--local.is-listening .cf-avatar-listen-ring {
|
|
1639
|
+
opacity: calc(0.36 + (var(--cf-listen, 0.2) * 0.42));
|
|
1640
|
+
}
|
|
1641
|
+
.cf-avatar-wave {
|
|
1642
|
+
position: absolute;
|
|
1643
|
+
left: 50%;
|
|
1644
|
+
bottom: 46px;
|
|
1645
|
+
z-index: 6;
|
|
1646
|
+
display: inline-flex;
|
|
1647
|
+
align-items: center;
|
|
1648
|
+
justify-content: center;
|
|
1649
|
+
gap: 4px;
|
|
1650
|
+
min-width: 58px;
|
|
1651
|
+
height: 25px;
|
|
1652
|
+
padding: 5px 8px;
|
|
1653
|
+
border-radius: 999px;
|
|
1654
|
+
transform: translateX(-50%) translateY(8px);
|
|
1655
|
+
background: color-mix(in oklab, var(--cf-bg) 82%, transparent);
|
|
1656
|
+
border: 1px solid color-mix(in oklab, var(--cf-accent) 36%, transparent);
|
|
1657
|
+
opacity: 0;
|
|
1658
|
+
pointer-events: none;
|
|
1659
|
+
backdrop-filter: blur(10px);
|
|
1660
|
+
}
|
|
1661
|
+
.cf-avatar-wave span {
|
|
1662
|
+
width: 4px;
|
|
1663
|
+
height: 8px;
|
|
1664
|
+
border-radius: 999px;
|
|
1665
|
+
background: color-mix(in oklab, var(--cf-accent) 88%, #fff);
|
|
1666
|
+
transform-origin: center;
|
|
1667
|
+
}
|
|
1668
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-wave {
|
|
1669
|
+
opacity: 1;
|
|
1670
|
+
transform: translateX(-50%) translateY(0);
|
|
1671
|
+
}
|
|
1672
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span {
|
|
1673
|
+
animation: cf-avatar-wave 0.58s ease-in-out infinite;
|
|
1674
|
+
}
|
|
1675
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span:nth-child(2) { animation-delay: 0.1s; }
|
|
1676
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span:nth-child(3) { animation-delay: 0.2s; }
|
|
1677
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span:nth-child(4) { animation-delay: 0.3s; }
|
|
1678
|
+
.cf-assistant-card__stage--local.is-thinking .cf-assistant-card__media::before {
|
|
1679
|
+
content: '';
|
|
1680
|
+
position: absolute;
|
|
1681
|
+
inset: -35%;
|
|
1682
|
+
z-index: 5;
|
|
1683
|
+
pointer-events: none;
|
|
1684
|
+
background: linear-gradient(115deg, transparent 42%, color-mix(in oklab, var(--cf-accent) 20%, transparent) 50%, transparent 58%);
|
|
1685
|
+
animation: cf-avatar-thinking 1.45s ease-in-out infinite;
|
|
1686
|
+
}
|
|
1687
|
+
.cf-assistant-card__avatar-stage {
|
|
1688
|
+
position: absolute;
|
|
1689
|
+
inset: 0;
|
|
1690
|
+
display: grid;
|
|
1691
|
+
place-items: center;
|
|
1692
|
+
--cf-avatar-a: var(--cf-accent);
|
|
1693
|
+
--cf-avatar-b: color-mix(in oklab, var(--cf-accent) 70%, #0f1f2e);
|
|
1694
|
+
--cf-avatar-glow: color-mix(in oklab, var(--cf-accent) 38%, transparent);
|
|
1695
|
+
background:
|
|
1696
|
+
radial-gradient(circle at 35% 30%, var(--cf-avatar-glow), transparent 32%),
|
|
1697
|
+
linear-gradient(145deg, color-mix(in oklab, var(--cf-avatar-a) 18%, var(--cf-bg)), var(--cf-surface-2));
|
|
1698
|
+
}
|
|
1699
|
+
.cf-assistant-card__face {
|
|
1700
|
+
position: relative;
|
|
1701
|
+
width: 128px;
|
|
1702
|
+
height: 128px;
|
|
1703
|
+
border-radius: 999px;
|
|
1704
|
+
display: grid;
|
|
1705
|
+
place-items: center;
|
|
1706
|
+
color: #fff;
|
|
1707
|
+
background: linear-gradient(145deg, var(--cf-avatar-a), var(--cf-avatar-b));
|
|
1708
|
+
box-shadow: 0 22px 44px -28px rgba(0, 0, 0, 0.75);
|
|
1709
|
+
z-index: 2;
|
|
1710
|
+
}
|
|
1711
|
+
.cf-assistant-card__stage--local.is-speaking .cf-assistant-card__face {
|
|
1712
|
+
animation: cf-avatar-nod 1.6s ease-in-out infinite;
|
|
1713
|
+
}
|
|
1714
|
+
.cf-assistant-card__stage--local.is-listening .cf-assistant-card__face {
|
|
1715
|
+
box-shadow:
|
|
1716
|
+
0 22px 44px -28px rgba(0, 0, 0, 0.75),
|
|
1717
|
+
0 0 0 calc(5px + (var(--cf-listen, 0.2) * 6px)) color-mix(in oklab, var(--cf-accent) 16%, transparent);
|
|
1718
|
+
}
|
|
1719
|
+
.cf-assistant-card--pinned .cf-assistant-card__face {
|
|
1720
|
+
width: 72px;
|
|
1721
|
+
height: 72px;
|
|
1722
|
+
}
|
|
1723
|
+
.cf-avatar-preset--support-guide {
|
|
1724
|
+
--cf-avatar-a: #10b981;
|
|
1725
|
+
--cf-avatar-b: #0f766e;
|
|
1726
|
+
--cf-avatar-glow: rgba(16, 185, 129, 0.34);
|
|
1727
|
+
}
|
|
1728
|
+
.cf-avatar-preset--sales-host {
|
|
1729
|
+
--cf-avatar-a: #3b82f6;
|
|
1730
|
+
--cf-avatar-b: #4338ca;
|
|
1731
|
+
--cf-avatar-glow: rgba(59, 130, 246, 0.34);
|
|
1732
|
+
}
|
|
1733
|
+
.cf-avatar-preset--calm-advisor {
|
|
1734
|
+
--cf-avatar-a: #64748b;
|
|
1735
|
+
--cf-avatar-b: #0f172a;
|
|
1736
|
+
--cf-avatar-glow: rgba(100, 116, 139, 0.34);
|
|
1737
|
+
}
|
|
1738
|
+
.cf-avatar-preset--technical-guide {
|
|
1739
|
+
--cf-avatar-a: #06b6d4;
|
|
1740
|
+
--cf-avatar-b: #1d4ed8;
|
|
1741
|
+
--cf-avatar-glow: rgba(6, 182, 212, 0.34);
|
|
1742
|
+
}
|
|
1743
|
+
.cf-avatar-preset--school-desk {
|
|
1744
|
+
--cf-avatar-a: #8b5cf6;
|
|
1745
|
+
--cf-avatar-b: #6d28d9;
|
|
1746
|
+
--cf-avatar-glow: rgba(139, 92, 246, 0.34);
|
|
1747
|
+
}
|
|
1748
|
+
.cf-avatar-preset--front-office {
|
|
1749
|
+
--cf-avatar-a: #f59e0b;
|
|
1750
|
+
--cf-avatar-b: #c2410c;
|
|
1751
|
+
--cf-avatar-glow: rgba(245, 158, 11, 0.34);
|
|
1752
|
+
}
|
|
1753
|
+
.cf-assistant-card__initials {
|
|
1754
|
+
transform: translateY(-12px);
|
|
1755
|
+
font-size: 34px;
|
|
1756
|
+
font-weight: 800;
|
|
1757
|
+
}
|
|
1758
|
+
.cf-assistant-card--pinned .cf-assistant-card__initials {
|
|
1759
|
+
transform: translateY(-6px);
|
|
1760
|
+
font-size: 19px;
|
|
1761
|
+
}
|
|
1762
|
+
.cf-assistant-card__eye {
|
|
1763
|
+
position: absolute;
|
|
1764
|
+
top: 58px;
|
|
1765
|
+
width: 8px;
|
|
1766
|
+
height: 8px;
|
|
1767
|
+
border-radius: 999px;
|
|
1768
|
+
background: rgba(255, 255, 255, 0.9);
|
|
1769
|
+
}
|
|
1770
|
+
.cf-assistant-card__eye--left { left: 42px; }
|
|
1771
|
+
.cf-assistant-card__eye--right { right: 42px; }
|
|
1772
|
+
.cf-assistant-card--pinned .cf-assistant-card__eye {
|
|
1773
|
+
top: 33px;
|
|
1774
|
+
width: 5px;
|
|
1775
|
+
height: 5px;
|
|
1776
|
+
}
|
|
1777
|
+
.cf-assistant-card--pinned .cf-assistant-card__eye--left { left: 23px; }
|
|
1778
|
+
.cf-assistant-card--pinned .cf-assistant-card__eye--right { right: 23px; }
|
|
1779
|
+
.cf-assistant-card__mouth {
|
|
1780
|
+
position: absolute;
|
|
1781
|
+
left: 50%;
|
|
1782
|
+
bottom: 31px;
|
|
1783
|
+
width: 34px;
|
|
1784
|
+
height: 6px;
|
|
1785
|
+
transform: translateX(-50%);
|
|
1786
|
+
border-radius: 999px;
|
|
1787
|
+
background: rgba(255, 255, 255, 0.9);
|
|
1788
|
+
}
|
|
1789
|
+
.cf-assistant-card--pinned .cf-assistant-card__mouth {
|
|
1790
|
+
bottom: 18px;
|
|
1791
|
+
width: 20px;
|
|
1792
|
+
height: 4px;
|
|
1793
|
+
}
|
|
1794
|
+
.cf-assistant-card.is-speaking .cf-assistant-card__mouth {
|
|
1795
|
+
animation: cf-mouth-talk 0.24s ease-in-out infinite alternate;
|
|
1796
|
+
}
|
|
1797
|
+
.cf-assistant-card__stage--local.is-speaking .cf-assistant-card__mouth {
|
|
1798
|
+
animation: cf-mouth-talk 0.24s ease-in-out infinite alternate;
|
|
1799
|
+
}
|
|
1800
|
+
.cf-assistant-card__mouth--overlay {
|
|
1801
|
+
z-index: 6;
|
|
1802
|
+
bottom: 39px;
|
|
1803
|
+
width: 42px;
|
|
1804
|
+
height: 7px;
|
|
1805
|
+
opacity: 0;
|
|
1806
|
+
background: color-mix(in oklab, #fff 90%, var(--cf-accent));
|
|
1807
|
+
box-shadow:
|
|
1808
|
+
0 0 0 4px rgba(2, 6, 23, 0.22),
|
|
1809
|
+
0 10px 22px -10px rgba(0, 0, 0, 0.85);
|
|
1810
|
+
}
|
|
1811
|
+
.cf-assistant-card__stage--local.is-speaking .cf-assistant-card__mouth--overlay {
|
|
1812
|
+
opacity: 1;
|
|
1813
|
+
}
|
|
1814
|
+
.cf-assistant-card--pinned .cf-assistant-card__mouth--overlay {
|
|
1815
|
+
bottom: 42px;
|
|
1816
|
+
}
|
|
1817
|
+
@keyframes cf-mouth-talk {
|
|
1818
|
+
from { height: 5px; width: 28px; border-radius: 999px; }
|
|
1819
|
+
to { height: 20px; width: 22px; border-radius: 45% 45% 55% 55%; }
|
|
1820
|
+
}
|
|
1821
|
+
@keyframes cf-avatar-breathe {
|
|
1822
|
+
0%, 100% { opacity: 0.16; transform: translate(-50%, -50%) scale(0.82); }
|
|
1823
|
+
50% { opacity: 0.58; transform: translate(-50%, -50%) scale(1.12); }
|
|
1824
|
+
}
|
|
1825
|
+
@keyframes cf-avatar-wave {
|
|
1826
|
+
0%, 100% { transform: scaleY(0.62); opacity: 0.72; }
|
|
1827
|
+
50% { transform: scaleY(1.85); opacity: 1; }
|
|
1828
|
+
}
|
|
1829
|
+
@keyframes cf-avatar-thinking {
|
|
1830
|
+
0% { transform: translateX(-18%); opacity: 0; }
|
|
1831
|
+
38% { opacity: 1; }
|
|
1832
|
+
100% { transform: translateX(18%); opacity: 0; }
|
|
1833
|
+
}
|
|
1834
|
+
@keyframes cf-avatar-nod {
|
|
1835
|
+
0%, 100% { transform: translateY(0) scale(1); }
|
|
1836
|
+
45% { transform: translateY(-2px) scale(1.012); }
|
|
1837
|
+
}
|
|
1838
|
+
.cf-assistant-card__speak {
|
|
1839
|
+
position: absolute;
|
|
1840
|
+
left: 50%;
|
|
1841
|
+
bottom: 12px;
|
|
1842
|
+
transform: translateX(-50%);
|
|
1843
|
+
display: inline-flex;
|
|
1844
|
+
align-items: center;
|
|
1845
|
+
gap: 7px;
|
|
1846
|
+
max-width: calc(100% - 24px);
|
|
1847
|
+
padding: 8px 12px;
|
|
1848
|
+
border-radius: 999px;
|
|
1849
|
+
background: color-mix(in oklab, var(--cf-bg) 92%, transparent);
|
|
1850
|
+
color: var(--cf-accent);
|
|
1851
|
+
box-shadow: 0 10px 22px -14px rgba(15, 30, 42, 0.6);
|
|
1852
|
+
font-size: 12.5px;
|
|
1853
|
+
font-weight: 700;
|
|
1854
|
+
white-space: nowrap;
|
|
1855
|
+
}
|
|
1856
|
+
.cf-assistant-card--pinned .cf-assistant-card__speak {
|
|
1857
|
+
padding: 6px 10px;
|
|
1858
|
+
font-size: 11.5px;
|
|
1859
|
+
}
|
|
1860
|
+
.cf-assistant-card__speak svg { width: 15px; height: 15px; }
|
|
1861
|
+
.cf-assistant-card__voice-only .cf-assistant-card__speak,
|
|
1862
|
+
.cf-assistant-card__voice-only .cf-call-controls {
|
|
1863
|
+
position: static;
|
|
1864
|
+
transform: none;
|
|
1865
|
+
max-width: 100%;
|
|
1866
|
+
}
|
|
1867
|
+
.cf-assistant-card--connecting {
|
|
1868
|
+
min-height: 100%;
|
|
1869
|
+
display: grid;
|
|
1870
|
+
place-items: center;
|
|
1871
|
+
align-content: center;
|
|
1872
|
+
gap: 18px;
|
|
1873
|
+
padding: 34px 24px 42px;
|
|
1874
|
+
text-align: center;
|
|
1875
|
+
border-top: 1px solid var(--cf-border);
|
|
1876
|
+
background:
|
|
1877
|
+
radial-gradient(circle at 50% 38%, color-mix(in oklab, var(--cf-accent) 16%, transparent), transparent 36%),
|
|
1878
|
+
linear-gradient(180deg, color-mix(in oklab, var(--cf-surface) 72%, var(--cf-bg)), var(--cf-bg));
|
|
1879
|
+
}
|
|
1880
|
+
.cf-assistant-card__connecting-avatar {
|
|
1881
|
+
position: relative;
|
|
1882
|
+
width: 118px;
|
|
1883
|
+
height: 118px;
|
|
1884
|
+
display: grid;
|
|
1885
|
+
place-items: center;
|
|
1886
|
+
}
|
|
1887
|
+
.cf-assistant-card__connecting-avatar img,
|
|
1888
|
+
.cf-assistant-card__connecting-face {
|
|
1889
|
+
width: 92px;
|
|
1890
|
+
height: 92px;
|
|
1891
|
+
border-radius: 999px;
|
|
1892
|
+
display: grid;
|
|
1893
|
+
place-items: center;
|
|
1894
|
+
object-fit: cover;
|
|
1895
|
+
color: #fff;
|
|
1896
|
+
font-size: 28px;
|
|
1897
|
+
font-weight: 850;
|
|
1898
|
+
letter-spacing: -0.04em;
|
|
1899
|
+
background: linear-gradient(145deg, var(--cf-accent), var(--cf-accent-2));
|
|
1900
|
+
border: 1px solid color-mix(in oklab, #fff 30%, transparent);
|
|
1901
|
+
box-shadow:
|
|
1902
|
+
0 22px 48px -24px color-mix(in oklab, var(--cf-accent) 60%, #000),
|
|
1903
|
+
0 0 0 8px color-mix(in oklab, var(--cf-accent) 10%, transparent);
|
|
1904
|
+
z-index: 2;
|
|
1905
|
+
}
|
|
1906
|
+
.cf-assistant-card__connecting-copy {
|
|
1907
|
+
display: grid;
|
|
1908
|
+
gap: 6px;
|
|
1909
|
+
}
|
|
1910
|
+
.cf-assistant-card__connecting-eyebrow {
|
|
1911
|
+
color: var(--cf-muted);
|
|
1912
|
+
font-size: 11px;
|
|
1913
|
+
font-weight: 800;
|
|
1914
|
+
letter-spacing: 0.12em;
|
|
1915
|
+
text-transform: uppercase;
|
|
1916
|
+
}
|
|
1917
|
+
.cf-assistant-card__connecting-copy strong {
|
|
1918
|
+
color: var(--cf-text);
|
|
1919
|
+
font-size: 18px;
|
|
1920
|
+
line-height: 1.25;
|
|
1921
|
+
}
|
|
1922
|
+
.cf-assistant-card--connecting .cf-call-ripple {
|
|
1923
|
+
inset: -18px;
|
|
1924
|
+
border-radius: 999px;
|
|
1925
|
+
}
|
|
1926
|
+
.cf-assistant-card--connecting .cf-call-ripple span {
|
|
1927
|
+
width: 92px;
|
|
1928
|
+
height: 92px;
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
/* ---------- Call "working" ripple ----------
|
|
1932
|
+
Concentric rings pulsing out from the avatar's center while the call is
|
|
1933
|
+
connecting / transcribing / waiting for the reply โ the classic "ringing
|
|
1934
|
+
call" cue, so busy moments read as live activity instead of a freeze. */
|
|
1935
|
+
.cf-call-ripple {
|
|
1936
|
+
position: absolute;
|
|
1937
|
+
inset: 0;
|
|
1938
|
+
display: grid;
|
|
1939
|
+
place-items: center;
|
|
1940
|
+
pointer-events: none;
|
|
1941
|
+
overflow: hidden;
|
|
1942
|
+
border-radius: inherit;
|
|
1943
|
+
}
|
|
1944
|
+
.cf-call-ripple span {
|
|
1945
|
+
position: absolute;
|
|
1946
|
+
width: 74px;
|
|
1947
|
+
height: 74px;
|
|
1948
|
+
border-radius: 999px;
|
|
1949
|
+
border: 2px solid var(--cf-accent);
|
|
1950
|
+
opacity: 0;
|
|
1951
|
+
animation: cf-call-ripple 1.8s ease-out infinite;
|
|
1952
|
+
}
|
|
1953
|
+
.cf-call-ripple span:nth-child(2) { animation-delay: 0.6s; }
|
|
1954
|
+
.cf-call-ripple span:nth-child(3) { animation-delay: 1.2s; }
|
|
1955
|
+
@keyframes cf-call-ripple {
|
|
1956
|
+
0% { transform: scale(0.9); opacity: 0.55; }
|
|
1957
|
+
100% { transform: scale(2.6); opacity: 0; }
|
|
1958
|
+
}
|
|
1959
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1960
|
+
.cf-call-ripple span { animation: none; opacity: 0.25; transform: scale(1.4); }
|
|
1961
|
+
.cf-call-ripple span:nth-child(2), .cf-call-ripple span:nth-child(3) { display: none; }
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
/* ---------- In-call controls (mic / audio picker / expand / minimize / end) ---------- */
|
|
1965
|
+
.cf-call-controls {
|
|
1966
|
+
position: absolute;
|
|
1967
|
+
left: 50%;
|
|
1968
|
+
bottom: 12px;
|
|
1969
|
+
transform: translateX(-50%);
|
|
1970
|
+
display: inline-flex;
|
|
1971
|
+
align-items: center;
|
|
1972
|
+
gap: 4px;
|
|
1973
|
+
max-width: calc(100% - 24px);
|
|
1974
|
+
padding: 5px 7px;
|
|
1975
|
+
border-radius: 999px;
|
|
1976
|
+
background: color-mix(in oklab, var(--cf-bg) 94%, transparent);
|
|
1977
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 72%, transparent);
|
|
1978
|
+
box-shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.7);
|
|
1979
|
+
z-index: 30;
|
|
1980
|
+
}
|
|
1981
|
+
.cf-assistant-card--pinned .cf-call-controls { padding: 4px 6px; gap: 4px; }
|
|
1982
|
+
.cf-call-btn {
|
|
1983
|
+
position: relative;
|
|
1984
|
+
flex-shrink: 0;
|
|
1985
|
+
width: 30px;
|
|
1986
|
+
height: 30px;
|
|
1987
|
+
border-radius: 999px;
|
|
1988
|
+
display: inline-flex;
|
|
1989
|
+
align-items: center;
|
|
1990
|
+
justify-content: center;
|
|
1991
|
+
gap: 6px;
|
|
1992
|
+
color: var(--cf-text);
|
|
1993
|
+
background: color-mix(in oklab, var(--cf-surface) 88%, transparent);
|
|
1994
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 76%, transparent);
|
|
1995
|
+
transition: background 0.15s ease, transform 0.12s ease, color 0.15s ease;
|
|
1996
|
+
}
|
|
1997
|
+
.cf-call-btn:hover { background: color-mix(in oklab, var(--cf-accent) 10%, var(--cf-surface)); }
|
|
1998
|
+
.cf-call-btn:active { transform: scale(0.94); }
|
|
1999
|
+
.cf-call-btn svg { width: 14px; height: 14px; }
|
|
2000
|
+
.cf-call-btn--microphones {
|
|
2001
|
+
width: 24px;
|
|
2002
|
+
margin-left: -5px;
|
|
2003
|
+
border-top-left-radius: 10px;
|
|
2004
|
+
border-bottom-left-radius: 10px;
|
|
2005
|
+
}
|
|
2006
|
+
.cf-call-btn--microphones svg { width: 13px; height: 13px; }
|
|
2007
|
+
.cf-call-btn--restore svg { width: 15px; height: 15px; }
|
|
2008
|
+
.cf-call-btn.is-muted {
|
|
2009
|
+
color: #fff;
|
|
2010
|
+
background: var(--cf-muted);
|
|
2011
|
+
border-color: transparent;
|
|
2012
|
+
}
|
|
2013
|
+
/* Live-listening cue: a soft ring around the mic button that breathes with
|
|
2014
|
+
the mic level, instead of a separate waveform element eating up row width. */
|
|
2015
|
+
.cf-call-btn.is-listening::after {
|
|
2016
|
+
content: '';
|
|
2017
|
+
position: absolute;
|
|
2018
|
+
inset: -4px;
|
|
2019
|
+
border-radius: inherit;
|
|
2020
|
+
border: 2px solid var(--cf-accent);
|
|
2021
|
+
opacity: calc(0.25 + var(--cf-wave, 0.2) * 0.5);
|
|
2022
|
+
transform: scale(calc(1 + var(--cf-wave, 0.2) * 0.22));
|
|
2023
|
+
transition: transform 0.09s ease, opacity 0.09s ease;
|
|
2024
|
+
pointer-events: none;
|
|
2025
|
+
}
|
|
2026
|
+
/* Your voice is actually registering: the mic fills with the accent color
|
|
2027
|
+
and the ring flares, so "it hears me" is unmistakable at a glance. */
|
|
2028
|
+
.cf-call-btn.is-listening.is-hot {
|
|
2029
|
+
color: var(--cf-accent-ink);
|
|
2030
|
+
background: var(--cf-accent);
|
|
2031
|
+
border-color: transparent;
|
|
2032
|
+
}
|
|
2033
|
+
.cf-call-btn.is-listening.is-hot::after {
|
|
2034
|
+
border-width: 3px;
|
|
2035
|
+
opacity: calc(0.5 + var(--cf-wave, 0.2) * 0.5);
|
|
2036
|
+
transform: scale(calc(1.08 + var(--cf-wave, 0.2) * 0.35));
|
|
2037
|
+
box-shadow: 0 0 12px 2px color-mix(in oklab, var(--cf-accent) 55%, transparent);
|
|
2038
|
+
}
|
|
2039
|
+
.cf-call-btn--talk {
|
|
2040
|
+
color: var(--cf-accent-ink);
|
|
2041
|
+
background: var(--cf-accent);
|
|
2042
|
+
border-color: transparent;
|
|
2043
|
+
}
|
|
2044
|
+
.cf-call-btn--end {
|
|
2045
|
+
color: #fff;
|
|
2046
|
+
background: #e5484d;
|
|
2047
|
+
border-color: transparent;
|
|
2048
|
+
}
|
|
2049
|
+
.cf-call-btn--end:hover { background: #dc3d42; }
|
|
2050
|
+
/* Microphone selector popover. */
|
|
2051
|
+
.cf-call-more { position: static; display: inline-flex; z-index: 40; }
|
|
2052
|
+
.cf-call-menu {
|
|
2053
|
+
position: absolute;
|
|
2054
|
+
top: calc(100% + 8px);
|
|
2055
|
+
bottom: auto;
|
|
2056
|
+
left: 50%;
|
|
2057
|
+
transform: translateX(-50%);
|
|
2058
|
+
display: flex;
|
|
2059
|
+
flex-direction: column;
|
|
2060
|
+
gap: 2px;
|
|
2061
|
+
width: min(240px, calc(var(--cf-panel-w, 388px) - 72px), calc(100vw - 64px));
|
|
2062
|
+
min-width: 0;
|
|
2063
|
+
max-width: calc(100vw - 64px);
|
|
2064
|
+
max-height: min(300px, calc(100vh - 220px));
|
|
2065
|
+
overflow-y: auto;
|
|
2066
|
+
padding: 8px;
|
|
2067
|
+
border-radius: 14px;
|
|
2068
|
+
background: color-mix(in oklab, var(--cf-bg) 98%, #000);
|
|
2069
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 74%, transparent);
|
|
2070
|
+
box-shadow: 0 18px 45px -20px rgba(0, 0, 0, 0.78);
|
|
2071
|
+
z-index: 60;
|
|
2072
|
+
}
|
|
2073
|
+
.cf-call-menu__label {
|
|
2074
|
+
margin: 8px 8px 4px;
|
|
2075
|
+
color: var(--cf-muted);
|
|
2076
|
+
font-size: 11px;
|
|
2077
|
+
font-weight: 700;
|
|
2078
|
+
text-transform: uppercase;
|
|
2079
|
+
letter-spacing: 0.08em;
|
|
2080
|
+
}
|
|
2081
|
+
.cf-call-menu__item {
|
|
2082
|
+
display: flex;
|
|
2083
|
+
align-items: center;
|
|
2084
|
+
gap: 8px;
|
|
2085
|
+
min-width: 0;
|
|
2086
|
+
padding: 8px 9px;
|
|
2087
|
+
border-radius: 10px;
|
|
2088
|
+
color: var(--cf-text);
|
|
2089
|
+
font-size: 12.5px;
|
|
2090
|
+
text-align: left;
|
|
2091
|
+
white-space: nowrap;
|
|
2092
|
+
overflow: hidden;
|
|
2093
|
+
}
|
|
2094
|
+
.cf-call-menu__item span:last-child {
|
|
2095
|
+
min-width: 0;
|
|
2096
|
+
overflow: hidden;
|
|
2097
|
+
text-overflow: ellipsis;
|
|
2098
|
+
}
|
|
2099
|
+
.cf-call-menu__item:hover { background: color-mix(in oklab, var(--cf-accent) 12%, var(--cf-surface)); }
|
|
2100
|
+
.cf-call-menu__item.is-active { color: var(--cf-accent); font-weight: 600; }
|
|
2101
|
+
.cf-call-menu__item svg { width: 13px; height: 13px; flex-shrink: 0; }
|
|
2102
|
+
.cf-call-menu__spacer { width: 13px; flex-shrink: 0; }
|
|
2103
|
+
/* Detached floating avatar card โ replaces the launcher while a call runs minimized. */
|
|
2104
|
+
.cf-floating-call-card {
|
|
2105
|
+
position: fixed;
|
|
2106
|
+
bottom: var(--cf-v-pad, 20px);
|
|
2107
|
+
right: var(--cf-h-pad, 20px);
|
|
2108
|
+
z-index: 1;
|
|
2109
|
+
pointer-events: auto;
|
|
2110
|
+
width: min(340px, calc(100vw - 32px));
|
|
2111
|
+
aspect-ratio: 16 / 9;
|
|
2112
|
+
overflow: hidden;
|
|
2113
|
+
border-radius: 14px;
|
|
2114
|
+
background: var(--cf-bg);
|
|
2115
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 74%, transparent);
|
|
2116
|
+
box-shadow: 0 20px 48px -20px rgba(0, 0, 0, 0.72);
|
|
2117
|
+
animation: cf-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
|
|
2118
|
+
}
|
|
2119
|
+
.cf-root[data-align='left'] .cf-floating-call-card { right: auto; left: var(--cf-h-pad, 20px); }
|
|
2120
|
+
.cf-floating-call-card__media,
|
|
2121
|
+
.cf-floating-call-card__shade {
|
|
2122
|
+
position: absolute;
|
|
2123
|
+
inset: 0;
|
|
2124
|
+
}
|
|
2125
|
+
.cf-floating-call-card__media img,
|
|
2126
|
+
.cf-floating-call-card__media video {
|
|
2127
|
+
width: 100%;
|
|
2128
|
+
height: 100%;
|
|
2129
|
+
object-fit: cover;
|
|
2130
|
+
}
|
|
2131
|
+
.cf-floating-call-card__shade {
|
|
2132
|
+
background:
|
|
2133
|
+
linear-gradient(to bottom, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.18)),
|
|
2134
|
+
radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.08), transparent 42%);
|
|
2135
|
+
pointer-events: none;
|
|
2136
|
+
}
|
|
2137
|
+
.cf-floating-call-card__avatar {
|
|
2138
|
+
position: absolute;
|
|
2139
|
+
inset: 0;
|
|
2140
|
+
display: flex;
|
|
2141
|
+
align-items: center;
|
|
2142
|
+
justify-content: center;
|
|
2143
|
+
color: #fff;
|
|
2144
|
+
background: linear-gradient(145deg, var(--cf-accent), var(--cf-accent-2));
|
|
2145
|
+
}
|
|
2146
|
+
.cf-floating-call-card.is-muted {
|
|
2147
|
+
filter: saturate(0.72);
|
|
2148
|
+
}
|
|
2149
|
+
.cf-floating-call-card.is-listening {
|
|
2150
|
+
border-color: color-mix(in oklab, var(--cf-accent) 62%, var(--cf-border));
|
|
2151
|
+
box-shadow:
|
|
2152
|
+
0 20px 48px -20px rgba(0, 0, 0, 0.72),
|
|
2153
|
+
0 0 calc(12px + (var(--cf-listen, 0.2) * 18px)) color-mix(in oklab, var(--cf-accent) 28%, transparent);
|
|
2154
|
+
}
|
|
2155
|
+
.cf-floating-call-card.is-thinking .cf-floating-call-card__shade::before {
|
|
2156
|
+
content: '';
|
|
2157
|
+
position: absolute;
|
|
2158
|
+
inset: -45%;
|
|
2159
|
+
background: linear-gradient(115deg, transparent 42%, color-mix(in oklab, var(--cf-accent) 22%, transparent) 50%, transparent 58%);
|
|
2160
|
+
animation: cf-avatar-thinking 1.45s ease-in-out infinite;
|
|
2161
|
+
}
|
|
2162
|
+
.cf-floating-call-card.is-speaking .cf-floating-call-card__avatar,
|
|
2163
|
+
.cf-floating-call-card.is-speaking .cf-floating-call-card__media img {
|
|
2164
|
+
animation: cf-avatar-nod 1.6s ease-in-out infinite;
|
|
2165
|
+
}
|
|
2166
|
+
.cf-floating-call-card__avatar > span:first-child {
|
|
2167
|
+
font-size: clamp(64px, 22vw, 118px);
|
|
2168
|
+
font-weight: 800;
|
|
2169
|
+
line-height: 1;
|
|
2170
|
+
}
|
|
2171
|
+
.cf-floating-call-card__eye,
|
|
2172
|
+
.cf-floating-call-card__mouth {
|
|
2173
|
+
position: absolute;
|
|
2174
|
+
background: rgba(255, 255, 255, 0.9);
|
|
2175
|
+
}
|
|
2176
|
+
.cf-floating-call-card__eye {
|
|
2177
|
+
top: 37%;
|
|
2178
|
+
width: 8px;
|
|
2179
|
+
height: 8px;
|
|
2180
|
+
border-radius: 999px;
|
|
2181
|
+
}
|
|
2182
|
+
.cf-floating-call-card__eye--left { left: 38%; }
|
|
2183
|
+
.cf-floating-call-card__eye--right { right: 38%; }
|
|
2184
|
+
.cf-floating-call-card__mouth {
|
|
2185
|
+
bottom: 31%;
|
|
2186
|
+
width: 34px;
|
|
2187
|
+
height: 6px;
|
|
2188
|
+
border-radius: 999px;
|
|
2189
|
+
}
|
|
2190
|
+
.cf-floating-call-card.is-speaking .cf-floating-call-card__mouth {
|
|
2191
|
+
animation: cf-mouth-talk 0.24s ease-in-out infinite alternate;
|
|
2192
|
+
}
|
|
2193
|
+
.cf-floating-call-card__controls {
|
|
2194
|
+
position: absolute;
|
|
2195
|
+
left: 50%;
|
|
2196
|
+
bottom: 12px;
|
|
2197
|
+
transform: translateX(-50%);
|
|
2198
|
+
display: inline-flex;
|
|
2199
|
+
align-items: center;
|
|
2200
|
+
gap: 4px;
|
|
2201
|
+
padding: 5px 7px;
|
|
2202
|
+
border-radius: 999px;
|
|
2203
|
+
background: color-mix(in oklab, var(--cf-bg) 92%, transparent);
|
|
2204
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 70%, transparent);
|
|
2205
|
+
box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.74);
|
|
2206
|
+
}
|
|
2207
|
+
.cf-assistant-card__copy {
|
|
2208
|
+
margin: 0;
|
|
2209
|
+
color: var(--cf-text);
|
|
2210
|
+
font-size: 14px;
|
|
2211
|
+
line-height: 1.55;
|
|
2212
|
+
}
|
|
2213
|
+
.cf-assistant-card__chips {
|
|
2214
|
+
display: flex;
|
|
2215
|
+
flex-wrap: wrap;
|
|
2216
|
+
gap: 7px;
|
|
2217
|
+
}
|
|
2218
|
+
.cf-assistant-card__chip {
|
|
2219
|
+
max-width: 100%;
|
|
2220
|
+
border-radius: 6px;
|
|
2221
|
+
padding: 7px 9px;
|
|
2222
|
+
background: color-mix(in oklab, var(--cf-accent) 12%, var(--cf-bg));
|
|
2223
|
+
color: var(--cf-accent);
|
|
2224
|
+
font-size: 12.5px;
|
|
2225
|
+
line-height: 1.2;
|
|
2226
|
+
}
|
|
2227
|
+
.cf-assistant-card__chip:hover { background: color-mix(in oklab, var(--cf-accent) 18%, var(--cf-bg)); }
|
|
2228
|
+
.cf-assistant-card__privacy {
|
|
2229
|
+
margin: -2px 0 0;
|
|
2230
|
+
color: var(--cf-muted);
|
|
2231
|
+
font-size: 10.5px;
|
|
2232
|
+
line-height: 1.4;
|
|
2233
|
+
text-align: center;
|
|
2234
|
+
}
|
|
2235
|
+
.cf-assistant-card__privacy a {
|
|
2236
|
+
color: var(--cf-muted);
|
|
2237
|
+
text-decoration: underline;
|
|
2238
|
+
text-underline-offset: 2px;
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
/* Offline presence dot (amber instead of green). */
|
|
2242
|
+
.cf-header__status--offline::before { background: #e2c07e; box-shadow: 0 0 0 2px rgba(226, 192, 126, 0.3); }
|
|
2243
|
+
|
|
2244
|
+
/* Disclaimer fine-print under the composer. */
|
|
2245
|
+
.cf-disclaimer { padding: 0 16px 2px; font-size: 10.5px; line-height: 1.45; color: var(--cf-muted); text-align: center; }
|
|
2246
|
+
|
|
2247
|
+
/* Read-only banner shown while viewing a past conversation. */
|
|
2248
|
+
.cf-viewing-banner {
|
|
2249
|
+
padding: 7px 16px;
|
|
2250
|
+
font-size: 12px;
|
|
2251
|
+
font-weight: 600;
|
|
2252
|
+
text-align: center;
|
|
2253
|
+
color: var(--cf-muted);
|
|
2254
|
+
background: var(--cf-surface);
|
|
2255
|
+
border-bottom: 1px solid var(--cf-border);
|
|
2256
|
+
flex-shrink: 0;
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
/* Past-conversations history panel (over the chat, like the confirm dialog). */
|
|
2260
|
+
.cf-history {
|
|
2261
|
+
width: min(340px, 90%);
|
|
2262
|
+
max-height: 70%;
|
|
2263
|
+
display: flex;
|
|
2264
|
+
flex-direction: column;
|
|
2265
|
+
background: var(--cf-bg);
|
|
2266
|
+
border-radius: 14px;
|
|
2267
|
+
box-shadow: var(--cf-shadow);
|
|
2268
|
+
overflow: hidden;
|
|
2269
|
+
}
|
|
2270
|
+
.cf-history__head {
|
|
2271
|
+
display: flex;
|
|
2272
|
+
align-items: center;
|
|
2273
|
+
justify-content: space-between;
|
|
2274
|
+
padding: 12px 14px;
|
|
2275
|
+
font-size: 14px;
|
|
2276
|
+
font-weight: 700;
|
|
2277
|
+
color: var(--cf-text);
|
|
2278
|
+
border-bottom: 1px solid var(--cf-border);
|
|
2279
|
+
}
|
|
2280
|
+
.cf-history__list { overflow-y: auto; padding: 6px; }
|
|
2281
|
+
.cf-history__item {
|
|
2282
|
+
display: flex;
|
|
2283
|
+
flex-direction: column;
|
|
2284
|
+
gap: 2px;
|
|
2285
|
+
width: 100%;
|
|
2286
|
+
text-align: left;
|
|
2287
|
+
padding: 9px 10px;
|
|
2288
|
+
border-radius: 9px;
|
|
2289
|
+
cursor: pointer;
|
|
2290
|
+
transition: background 0.15s ease;
|
|
2291
|
+
}
|
|
2292
|
+
.cf-history__item:hover { background: var(--cf-surface); }
|
|
2293
|
+
.cf-history__item.is-active { background: var(--cf-surface); }
|
|
2294
|
+
.cf-history__title { font-size: 13px; color: var(--cf-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
2295
|
+
.cf-history__meta { font-size: 11px; color: var(--cf-muted); }
|
|
2296
|
+
|
|
2297
|
+
/* Ended-conversation bar โ replaces the composer once the chat is closed. */
|
|
2298
|
+
.cf-ended {
|
|
2299
|
+
display: flex;
|
|
2300
|
+
flex-direction: column;
|
|
2301
|
+
align-items: center;
|
|
2302
|
+
gap: 10px;
|
|
2303
|
+
padding: 14px 16px 16px;
|
|
2304
|
+
flex-shrink: 0;
|
|
2305
|
+
text-align: center;
|
|
2306
|
+
}
|
|
2307
|
+
.cf-ended__text { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--cf-muted); }
|
|
2308
|
+
.cf-csat { display: inline-flex; align-items: center; gap: 8px; }
|
|
2309
|
+
.cf-csat__q { font-size: 12.5px; color: var(--cf-muted); }
|
|
2310
|
+
.cf-csat__btn {
|
|
2311
|
+
display: inline-flex;
|
|
2312
|
+
align-items: center;
|
|
2313
|
+
justify-content: center;
|
|
2314
|
+
width: 30px;
|
|
2315
|
+
height: 30px;
|
|
2316
|
+
border-radius: 8px;
|
|
2317
|
+
color: var(--cf-muted);
|
|
2318
|
+
cursor: pointer;
|
|
2319
|
+
transition: background 0.15s ease, color 0.15s ease;
|
|
2320
|
+
}
|
|
2321
|
+
.cf-csat__btn:hover { background: var(--cf-surface); color: var(--cf-accent); }
|
|
2322
|
+
.cf-csat__btn svg { width: 16px; height: 16px; }
|
|
2323
|
+
.cf-ended__btn {
|
|
2324
|
+
font-size: 13px;
|
|
2325
|
+
font-weight: 600;
|
|
2326
|
+
color: var(--cf-accent-ink);
|
|
2327
|
+
background: var(--cf-accent);
|
|
2328
|
+
border: none;
|
|
2329
|
+
border-radius: 999px;
|
|
2330
|
+
padding: 9px 18px;
|
|
2331
|
+
cursor: pointer;
|
|
2332
|
+
transition: opacity 0.15s ease;
|
|
2333
|
+
}
|
|
2334
|
+
.cf-ended__btn:hover { opacity: 0.9; }
|
|
2335
|
+
.cf-ended__btn:focus-visible { outline: 2px solid var(--cf-accent); outline-offset: 2px; }
|
|
1002
2336
|
|
|
1003
2337
|
/* "โ New messages" pill โ shown when a reply streams in while scrolled up. */
|
|
1004
2338
|
.cf-newmsg {
|
|
@@ -1012,142 +2346,708 @@ import{createContext as e,render as t}from"preact";import{useCallback as n,useCo
|
|
|
1012
2346
|
pointer-events: auto;
|
|
1013
2347
|
display: inline-flex;
|
|
1014
2348
|
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%);
|
|
1020
|
-
border-radius: 999px;
|
|
1021
|
-
padding: 7px 14px;
|
|
1022
|
-
box-shadow: var(--cf-shadow);
|
|
1023
|
-
animation: cf-msg-in 0.2s ease both;
|
|
2349
|
+
gap: 6px;
|
|
2350
|
+
font-size: 12.5px;
|
|
2351
|
+
font-weight: 600;
|
|
2352
|
+
color: var(--cf-accent-ink);
|
|
2353
|
+
background: linear-gradient(135deg, var(--cf-accent, #2f7f55) 0%, var(--cf-accent-2, #2f7de8) 160%);
|
|
2354
|
+
border-radius: 999px;
|
|
2355
|
+
padding: 7px 14px;
|
|
2356
|
+
box-shadow: var(--cf-shadow);
|
|
2357
|
+
animation: cf-msg-in 0.2s ease both;
|
|
2358
|
+
}
|
|
2359
|
+
.cf-newmsg svg { width: 14px; height: 14px; }
|
|
2360
|
+
|
|
2361
|
+
/* ---------- Clear-chat confirm dialog (in-widget, replaces window.confirm) ---------- */
|
|
2362
|
+
.cf-confirm {
|
|
2363
|
+
position: absolute;
|
|
2364
|
+
inset: 0;
|
|
2365
|
+
z-index: 6;
|
|
2366
|
+
pointer-events: auto;
|
|
2367
|
+
display: grid;
|
|
2368
|
+
place-items: center;
|
|
2369
|
+
padding: 22px;
|
|
2370
|
+
background: color-mix(in oklab, var(--cf-bg) 62%, transparent);
|
|
2371
|
+
backdrop-filter: blur(2px);
|
|
2372
|
+
animation: cf-fade-in 0.14s ease both;
|
|
2373
|
+
}
|
|
2374
|
+
.cf-confirm__card {
|
|
2375
|
+
width: 100%;
|
|
2376
|
+
max-width: 300px;
|
|
2377
|
+
background: var(--cf-bg);
|
|
2378
|
+
border: 1px solid var(--cf-border);
|
|
2379
|
+
border-radius: 16px;
|
|
2380
|
+
box-shadow: var(--cf-shadow);
|
|
2381
|
+
padding: 18px;
|
|
2382
|
+
text-align: center;
|
|
2383
|
+
animation: cf-msg-in 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
2384
|
+
}
|
|
2385
|
+
.cf-confirm__title { font-size: 15px; font-weight: 700; color: var(--cf-text); }
|
|
2386
|
+
.cf-confirm__body { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--cf-muted); }
|
|
2387
|
+
.cf-confirm__actions { margin-top: 16px; display: flex; gap: 8px; justify-content: center; }
|
|
2388
|
+
.cf-confirm__btn {
|
|
2389
|
+
padding: 9px 16px;
|
|
2390
|
+
border-radius: 10px;
|
|
2391
|
+
font-size: 13.5px;
|
|
2392
|
+
font-weight: 600;
|
|
2393
|
+
transition: transform 0.1s ease, opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
|
|
2394
|
+
}
|
|
2395
|
+
.cf-confirm__btn:active { transform: scale(0.97); }
|
|
2396
|
+
.cf-confirm__btn:focus-visible { outline: 2px solid var(--cf-accent-2); outline-offset: 2px; }
|
|
2397
|
+
.cf-confirm__btn--cancel { background: var(--cf-surface); color: var(--cf-text); border: 1px solid var(--cf-border); }
|
|
2398
|
+
.cf-confirm__btn--cancel:hover { border-color: var(--cf-accent); }
|
|
2399
|
+
.cf-confirm__btn--danger { background: #f25767; color: #fff; }
|
|
2400
|
+
.cf-confirm__btn--danger:hover { opacity: 0.9; }
|
|
2401
|
+
|
|
2402
|
+
/* Visually-hidden live region (announces the final answer only). */
|
|
2403
|
+
.cf-sr-live {
|
|
2404
|
+
position: absolute;
|
|
2405
|
+
width: 1px;
|
|
2406
|
+
height: 1px;
|
|
2407
|
+
padding: 0;
|
|
2408
|
+
margin: -1px;
|
|
2409
|
+
overflow: hidden;
|
|
2410
|
+
clip: rect(0 0 0 0);
|
|
2411
|
+
white-space: nowrap;
|
|
2412
|
+
border: 0;
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2415
|
+
/* ---------- Attachments ---------- */
|
|
2416
|
+
.cf-file-input { display: none; }
|
|
2417
|
+
.cf-iconbtn:disabled { opacity: 0.4; cursor: default; }
|
|
2418
|
+
.cf-attach-row { padding: 0 4px 8px; }
|
|
2419
|
+
.cf-attach-status { font-size: 12px; color: var(--cf-muted); }
|
|
2420
|
+
.cf-attach-status--err { color: #f25767; }
|
|
2421
|
+
.cf-attach-chip {
|
|
2422
|
+
display: inline-flex;
|
|
2423
|
+
align-items: center;
|
|
2424
|
+
gap: 6px;
|
|
2425
|
+
max-width: 100%;
|
|
2426
|
+
padding: 5px 6px 5px 10px;
|
|
2427
|
+
border-radius: 999px;
|
|
2428
|
+
background: var(--cf-surface-2);
|
|
2429
|
+
border: 1px solid var(--cf-border);
|
|
2430
|
+
color: var(--cf-text);
|
|
2431
|
+
font-size: 12px;
|
|
2432
|
+
}
|
|
2433
|
+
.cf-attach-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2434
|
+
.cf-attach-chip svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--cf-muted); }
|
|
2435
|
+
.cf-attach-x { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--cf-muted); flex-shrink: 0; }
|
|
2436
|
+
.cf-attach-x:hover { background: var(--cf-surface); color: var(--cf-text); }
|
|
2437
|
+
.cf-attach-x svg { width: 11px; height: 11px; }
|
|
2438
|
+
|
|
2439
|
+
/* ---------- Mobile: full-screen panel ---------- */
|
|
2440
|
+
@media (max-width: 480px) {
|
|
2441
|
+
.cf-panel {
|
|
2442
|
+
bottom: 0;
|
|
2443
|
+
right: 0;
|
|
2444
|
+
width: 100vw;
|
|
2445
|
+
max-width: 100vw;
|
|
2446
|
+
height: 100dvh;
|
|
2447
|
+
max-height: 100dvh;
|
|
2448
|
+
border-radius: 0;
|
|
2449
|
+
}
|
|
2450
|
+
.cf-launcher { bottom: 16px; right: 16px; }
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
/* ---------- Keyframes ---------- */
|
|
2454
|
+
@keyframes cf-pop {
|
|
2455
|
+
from { transform: scale(0); opacity: 0; }
|
|
2456
|
+
to { transform: scale(1); opacity: 1; }
|
|
2457
|
+
}
|
|
2458
|
+
@keyframes cf-badge-pop {
|
|
2459
|
+
from { transform: scale(0); }
|
|
2460
|
+
to { transform: scale(1); }
|
|
2461
|
+
}
|
|
2462
|
+
@keyframes cf-panel-open {
|
|
2463
|
+
0% {
|
|
2464
|
+
opacity: 0;
|
|
2465
|
+
transform: translateY(24px) scale(0.93);
|
|
2466
|
+
filter: blur(2px);
|
|
2467
|
+
}
|
|
2468
|
+
58% {
|
|
2469
|
+
opacity: 1;
|
|
2470
|
+
transform: translateY(-3px) scale(1.006);
|
|
2471
|
+
filter: blur(0);
|
|
2472
|
+
}
|
|
2473
|
+
100% {
|
|
2474
|
+
opacity: 1;
|
|
2475
|
+
transform: translateY(0) scale(1);
|
|
2476
|
+
filter: blur(0);
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2479
|
+
@keyframes cf-msg-in {
|
|
2480
|
+
from { opacity: 0; transform: translateY(8px); }
|
|
2481
|
+
to { opacity: 1; transform: none; }
|
|
2482
|
+
}
|
|
2483
|
+
@keyframes cf-fade-in {
|
|
2484
|
+
from { opacity: 0; }
|
|
2485
|
+
to { opacity: 1; }
|
|
2486
|
+
}
|
|
2487
|
+
@keyframes cf-typing {
|
|
2488
|
+
0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
|
|
2489
|
+
40% { opacity: 1; transform: translateY(-4px); }
|
|
2490
|
+
}
|
|
2491
|
+
@keyframes cf-pulse {
|
|
2492
|
+
0%, 100% { opacity: 1; }
|
|
2493
|
+
50% { opacity: 0.4; }
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2497
|
+
.cf-root *, .cf-root *::before, .cf-root *::after {
|
|
2498
|
+
animation-duration: 0.01ms !important;
|
|
2499
|
+
animation-iteration-count: 1 !important;
|
|
2500
|
+
transition-duration: 0.01ms !important;
|
|
2501
|
+
scroll-behavior: auto !important;
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
.cf-analytics-visualization {
|
|
2505
|
+
box-sizing: border-box;
|
|
2506
|
+
width: 100%;
|
|
2507
|
+
max-width: 100%;
|
|
2508
|
+
margin-top: 8px;
|
|
2509
|
+
min-width: 0;
|
|
2510
|
+
overflow: hidden;
|
|
2511
|
+
border: 1px solid var(--cf-border);
|
|
2512
|
+
border-radius: 13px;
|
|
2513
|
+
background: var(--cf-surface);
|
|
2514
|
+
padding: 12px;
|
|
2515
|
+
color: var(--cf-muted);
|
|
2516
|
+
font-size: 11px;
|
|
2517
|
+
}
|
|
2518
|
+
.cf-analytics-visualization.is-expanded {
|
|
2519
|
+
display: flex;
|
|
2520
|
+
min-height: 100%;
|
|
2521
|
+
flex-direction: column;
|
|
2522
|
+
margin: 0;
|
|
2523
|
+
border: 0;
|
|
2524
|
+
border-radius: 0;
|
|
2525
|
+
background: transparent;
|
|
2526
|
+
padding: 0;
|
|
2527
|
+
}
|
|
2528
|
+
.cf-analytics-visualization__header {
|
|
2529
|
+
display: flex;
|
|
2530
|
+
width: 100%;
|
|
2531
|
+
min-width: 0;
|
|
2532
|
+
min-height: 32px;
|
|
2533
|
+
align-items: center;
|
|
2534
|
+
justify-content: space-between;
|
|
2535
|
+
gap: 10px;
|
|
2536
|
+
}
|
|
2537
|
+
.cf-analytics-visualization__header > div:first-child {
|
|
2538
|
+
min-width: 0;
|
|
2539
|
+
}
|
|
2540
|
+
.cf-analytics-visualization__actions {
|
|
2541
|
+
display: flex;
|
|
2542
|
+
flex: 0 0 auto;
|
|
2543
|
+
align-items: center;
|
|
2544
|
+
gap: 6px;
|
|
2545
|
+
}
|
|
2546
|
+
.cf-analytics-visualization__title {
|
|
2547
|
+
overflow: hidden;
|
|
2548
|
+
color: var(--cf-muted);
|
|
2549
|
+
font-size: 10px;
|
|
2550
|
+
font-weight: 750;
|
|
2551
|
+
letter-spacing: .08em;
|
|
2552
|
+
text-overflow: ellipsis;
|
|
2553
|
+
text-transform: uppercase;
|
|
2554
|
+
white-space: nowrap;
|
|
2555
|
+
}
|
|
2556
|
+
.cf-analytics-meta {
|
|
2557
|
+
display: flex;
|
|
2558
|
+
flex-wrap: wrap;
|
|
2559
|
+
align-items: center;
|
|
2560
|
+
gap: 3px 7px;
|
|
2561
|
+
margin-top: 4px;
|
|
2562
|
+
color: var(--cf-muted);
|
|
2563
|
+
font-size: 9px;
|
|
2564
|
+
line-height: 1.35;
|
|
2565
|
+
}
|
|
2566
|
+
.cf-analytics-meta__model {
|
|
2567
|
+
border-radius: 999px;
|
|
2568
|
+
background: color-mix(in srgb, var(--cf-accent) 12%, transparent);
|
|
2569
|
+
padding: 2px 6px;
|
|
2570
|
+
color: var(--cf-accent);
|
|
2571
|
+
font-weight: 700;
|
|
2572
|
+
}
|
|
2573
|
+
.cf-analytics-meta__dot {
|
|
2574
|
+
display: inline-block;
|
|
2575
|
+
width: 5px;
|
|
2576
|
+
height: 5px;
|
|
2577
|
+
margin-right: 4px;
|
|
2578
|
+
border-radius: 999px;
|
|
2579
|
+
background: var(--cf-accent);
|
|
2580
|
+
}
|
|
2581
|
+
.cf-analytics-visualization__download {
|
|
2582
|
+
width: fit-content;
|
|
2583
|
+
border: 1px solid var(--cf-border) !important;
|
|
2584
|
+
border-radius: 8px;
|
|
2585
|
+
background: var(--cf-surface) !important;
|
|
2586
|
+
padding: 6px 9px;
|
|
2587
|
+
color: var(--cf-text) !important;
|
|
2588
|
+
font-size: 10px;
|
|
2589
|
+
font-weight: 700;
|
|
2590
|
+
}
|
|
2591
|
+
.cf-analytics-visualization__download:hover {
|
|
2592
|
+
border-color: var(--cf-accent) !important;
|
|
2593
|
+
color: var(--cf-accent) !important;
|
|
2594
|
+
}
|
|
2595
|
+
.cf-analytics-table-wrap {
|
|
2596
|
+
box-sizing: border-box;
|
|
2597
|
+
width: 100%;
|
|
2598
|
+
max-width: 100%;
|
|
2599
|
+
margin-top: 9px;
|
|
2600
|
+
max-height: 210px;
|
|
2601
|
+
overflow: auto;
|
|
2602
|
+
border: 1px solid var(--cf-border);
|
|
2603
|
+
border-radius: 9px;
|
|
2604
|
+
scrollbar-width: thin;
|
|
2605
|
+
}
|
|
2606
|
+
.cf-analytics-visualization.is-expanded .cf-analytics-table-wrap {
|
|
2607
|
+
min-height: 0;
|
|
2608
|
+
max-height: none;
|
|
2609
|
+
flex: 1;
|
|
2610
|
+
margin-top: 14px;
|
|
2611
|
+
}
|
|
2612
|
+
.cf-analytics-table {
|
|
2613
|
+
width: 100%;
|
|
2614
|
+
border-collapse: collapse;
|
|
2615
|
+
color: var(--cf-text);
|
|
2616
|
+
font-size: 10px;
|
|
2617
|
+
white-space: nowrap;
|
|
2618
|
+
}
|
|
2619
|
+
.cf-analytics-table th,
|
|
2620
|
+
.cf-analytics-table td {
|
|
2621
|
+
border-bottom: 1px solid var(--cf-border);
|
|
2622
|
+
padding: 8px 9px;
|
|
2623
|
+
text-align: left;
|
|
2624
|
+
}
|
|
2625
|
+
.cf-analytics-table th {
|
|
2626
|
+
position: sticky;
|
|
2627
|
+
top: 0;
|
|
2628
|
+
background: var(--cf-surface-2);
|
|
2629
|
+
color: var(--cf-muted);
|
|
2630
|
+
font-weight: 700;
|
|
2631
|
+
text-transform: capitalize;
|
|
2632
|
+
}
|
|
2633
|
+
.cf-analytics-table tbody tr:last-child td { border-bottom: 0; }
|
|
2634
|
+
.cf-analytics-table-note {
|
|
2635
|
+
margin: 7px 2px 0;
|
|
2636
|
+
color: var(--cf-muted);
|
|
2637
|
+
font-size: 9px;
|
|
2638
|
+
line-height: 1.4;
|
|
2639
|
+
}
|
|
2640
|
+
.cf-analytics-visualization__expand,
|
|
2641
|
+
.cf-analytics-visualization__close {
|
|
2642
|
+
display: grid;
|
|
2643
|
+
width: 30px;
|
|
2644
|
+
height: 30px;
|
|
2645
|
+
flex: 0 0 auto;
|
|
2646
|
+
place-items: center;
|
|
2647
|
+
border: 1px solid var(--cf-border) !important;
|
|
2648
|
+
border-radius: 9px;
|
|
2649
|
+
background: var(--cf-bg) !important;
|
|
2650
|
+
color: var(--cf-text) !important;
|
|
2651
|
+
}
|
|
2652
|
+
.cf-analytics-visualization__expand:hover,
|
|
2653
|
+
.cf-analytics-visualization__close:hover { background: var(--cf-surface-2) !important; }
|
|
2654
|
+
.cf-analytics-visualization__expand:focus-visible,
|
|
2655
|
+
.cf-analytics-visualization__close:focus-visible {
|
|
2656
|
+
outline: 2px solid var(--cf-accent);
|
|
2657
|
+
outline-offset: 2px;
|
|
2658
|
+
}
|
|
2659
|
+
.cf-analytics-visualization__expand svg,
|
|
2660
|
+
.cf-analytics-visualization__close svg { width: 15px; height: 15px; }
|
|
2661
|
+
.cf-analytics-visualization__kpi {
|
|
2662
|
+
padding: 8px 0 6px;
|
|
2663
|
+
color: var(--cf-text);
|
|
2664
|
+
font-size: 30px;
|
|
2665
|
+
font-weight: 750;
|
|
2666
|
+
letter-spacing: -.035em;
|
|
2667
|
+
}
|
|
2668
|
+
.cf-analytics-kpi {
|
|
2669
|
+
padding: 9px 0 5px;
|
|
2670
|
+
}
|
|
2671
|
+
.cf-analytics-kpi__label {
|
|
2672
|
+
color: var(--cf-muted);
|
|
2673
|
+
font-size: 9px;
|
|
2674
|
+
font-weight: 700;
|
|
2675
|
+
letter-spacing: .06em;
|
|
2676
|
+
text-transform: uppercase;
|
|
2677
|
+
}
|
|
2678
|
+
.cf-analytics-kpi__value {
|
|
2679
|
+
margin-top: 5px;
|
|
2680
|
+
color: var(--cf-text);
|
|
2681
|
+
font-size: 30px;
|
|
2682
|
+
font-weight: 750;
|
|
2683
|
+
letter-spacing: -.035em;
|
|
2684
|
+
line-height: 1;
|
|
2685
|
+
}
|
|
2686
|
+
.cf-analytics-kpi__detail {
|
|
2687
|
+
margin-top: 8px;
|
|
2688
|
+
color: var(--cf-muted);
|
|
2689
|
+
font-size: 10px;
|
|
2690
|
+
line-height: 1.5;
|
|
2691
|
+
}
|
|
2692
|
+
.cf-analytics-empty {
|
|
2693
|
+
margin-top: 8px;
|
|
2694
|
+
border: 1px dashed var(--cf-border);
|
|
2695
|
+
border-radius: 11px;
|
|
2696
|
+
padding: 18px 14px;
|
|
2697
|
+
color: var(--cf-text);
|
|
2698
|
+
text-align: center;
|
|
2699
|
+
}
|
|
2700
|
+
.cf-analytics-empty p { margin: 0; }
|
|
2701
|
+
.cf-analytics-empty p + p {
|
|
2702
|
+
margin-top: 4px;
|
|
2703
|
+
color: var(--cf-muted);
|
|
2704
|
+
font-size: 10px;
|
|
2705
|
+
}
|
|
2706
|
+
.cf-analytics-echart {
|
|
2707
|
+
position: relative;
|
|
2708
|
+
width: 100%;
|
|
2709
|
+
height: 196px;
|
|
2710
|
+
min-width: 0;
|
|
2711
|
+
}
|
|
2712
|
+
.cf-analytics-visualization.is-expanded .cf-analytics-echart {
|
|
2713
|
+
height: auto;
|
|
2714
|
+
min-height: 310px;
|
|
2715
|
+
flex: 1;
|
|
2716
|
+
}
|
|
2717
|
+
.cf-analytics-echart canvas:focus-visible {
|
|
2718
|
+
outline: 2px solid var(--cf-accent);
|
|
2719
|
+
outline-offset: -2px;
|
|
2720
|
+
}
|
|
2721
|
+
.cf-analytics-echart__fallback {
|
|
2722
|
+
display: grid;
|
|
2723
|
+
height: 100%;
|
|
2724
|
+
place-items: center;
|
|
2725
|
+
border: 1px dashed var(--cf-border);
|
|
2726
|
+
border-radius: 9px;
|
|
2727
|
+
padding: 16px;
|
|
2728
|
+
color: var(--cf-muted);
|
|
2729
|
+
text-align: center;
|
|
2730
|
+
line-height: 1.5;
|
|
2731
|
+
}
|
|
2732
|
+
.cf-analytics-zoom {
|
|
2733
|
+
display: flex;
|
|
2734
|
+
min-width: 0;
|
|
2735
|
+
align-items: center;
|
|
2736
|
+
justify-content: space-between;
|
|
2737
|
+
gap: 8px;
|
|
2738
|
+
margin-top: 4px;
|
|
2739
|
+
border-top: 1px solid var(--cf-border);
|
|
2740
|
+
padding-top: 8px;
|
|
2741
|
+
}
|
|
2742
|
+
.cf-analytics-zoom__range {
|
|
2743
|
+
min-width: 0;
|
|
2744
|
+
overflow: hidden;
|
|
2745
|
+
color: var(--cf-muted);
|
|
2746
|
+
font-size: 10px;
|
|
2747
|
+
font-weight: 650;
|
|
2748
|
+
line-height: 1.3;
|
|
2749
|
+
text-overflow: ellipsis;
|
|
2750
|
+
white-space: nowrap;
|
|
2751
|
+
}
|
|
2752
|
+
.cf-analytics-zoom__controls {
|
|
2753
|
+
display: inline-flex;
|
|
2754
|
+
flex: 0 0 auto;
|
|
2755
|
+
align-items: center;
|
|
2756
|
+
overflow: hidden;
|
|
2757
|
+
border: 1px solid var(--cf-border);
|
|
2758
|
+
border-radius: 9px;
|
|
2759
|
+
background: var(--cf-bg);
|
|
1024
2760
|
}
|
|
1025
|
-
.cf-
|
|
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;
|
|
2761
|
+
.cf-analytics-zoom__controls button {
|
|
1033
2762
|
display: grid;
|
|
2763
|
+
min-width: 40px;
|
|
2764
|
+
height: 40px;
|
|
1034
2765
|
place-items: center;
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
2766
|
+
border: 0 !important;
|
|
2767
|
+
border-radius: 0;
|
|
2768
|
+
background: transparent !important;
|
|
2769
|
+
color: var(--cf-text) !important;
|
|
2770
|
+
font: inherit;
|
|
2771
|
+
font-size: 16px;
|
|
2772
|
+
font-weight: 700;
|
|
2773
|
+
line-height: 1;
|
|
1039
2774
|
}
|
|
1040
|
-
.cf-
|
|
1041
|
-
|
|
1042
|
-
|
|
2775
|
+
.cf-analytics-zoom__controls button + button { border-left: 1px solid var(--cf-border) !important; }
|
|
2776
|
+
.cf-analytics-zoom__controls button:hover:not(:disabled) { background: var(--cf-surface-2) !important; }
|
|
2777
|
+
.cf-analytics-zoom__controls button:focus-visible {
|
|
2778
|
+
position: relative;
|
|
2779
|
+
z-index: 1;
|
|
2780
|
+
outline: 2px solid var(--cf-accent);
|
|
2781
|
+
outline-offset: -2px;
|
|
2782
|
+
}
|
|
2783
|
+
.cf-analytics-zoom__controls button:disabled { cursor: not-allowed; opacity: .38; }
|
|
2784
|
+
.cf-analytics-zoom__controls .cf-analytics-zoom__reset {
|
|
2785
|
+
min-width: 56px;
|
|
2786
|
+
padding: 0 10px;
|
|
2787
|
+
font-size: 10px;
|
|
2788
|
+
font-weight: 700;
|
|
2789
|
+
}
|
|
2790
|
+
.cf-analytics-chart__summary {
|
|
2791
|
+
margin: 2px 0 0;
|
|
2792
|
+
color: var(--cf-muted);
|
|
2793
|
+
font-size: 11px;
|
|
2794
|
+
line-height: 1.45;
|
|
2795
|
+
}
|
|
2796
|
+
.cf-analytics-focus {
|
|
2797
|
+
height: 100%;
|
|
2798
|
+
min-height: 0;
|
|
2799
|
+
overflow: auto;
|
|
1043
2800
|
background: var(--cf-bg);
|
|
1044
|
-
border: 1px solid var(--cf-border);
|
|
1045
|
-
border-radius: 16px;
|
|
1046
|
-
box-shadow: var(--cf-shadow);
|
|
1047
2801
|
padding: 18px;
|
|
1048
|
-
text-align: center;
|
|
1049
|
-
animation: cf-msg-in 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
1050
2802
|
}
|
|
1051
|
-
|
|
1052
|
-
.cf-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
transition: transform 0.1s ease, opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
|
|
2803
|
+
@media (min-width: 640px) {
|
|
2804
|
+
.cf-panel.cf-panel--analytics-focus {
|
|
2805
|
+
grid-template-columns: minmax(0, 1fr);
|
|
2806
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
2807
|
+
grid-template-areas: 'header' 'video';
|
|
2808
|
+
}
|
|
2809
|
+
.cf-panel--analytics-focus .cf-panel__video { height: 100%; }
|
|
2810
|
+
.cf-panel--analytics-focus .cf-panel__chat { display: none; }
|
|
1060
2811
|
}
|
|
1061
|
-
.cf-
|
|
1062
|
-
|
|
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;
|
|
2812
|
+
.cf-analytics-explanation {
|
|
2813
|
+
margin-top: 10px;
|
|
1075
2814
|
overflow: hidden;
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
2815
|
+
border: 1px solid var(--cf-border);
|
|
2816
|
+
border-radius: 12px;
|
|
2817
|
+
background: var(--cf-surface);
|
|
2818
|
+
color: var(--cf-text);
|
|
2819
|
+
font-size: 12px;
|
|
2820
|
+
line-height: 1.55;
|
|
1079
2821
|
}
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
.cf-
|
|
1083
|
-
.cf-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
.cf-
|
|
2822
|
+
.cf-analytics-explanation h3,
|
|
2823
|
+
.cf-analytics-explanation h4,
|
|
2824
|
+
.cf-analytics-explanation p { margin: 0; }
|
|
2825
|
+
.cf-analytics-explanation__lead {
|
|
2826
|
+
border-bottom: 1px solid var(--cf-border);
|
|
2827
|
+
padding: 12px;
|
|
2828
|
+
}
|
|
2829
|
+
.cf-analytics-explanation__lead-meta {
|
|
2830
|
+
display: flex;
|
|
2831
|
+
flex-wrap: wrap;
|
|
2832
|
+
align-items: center;
|
|
2833
|
+
gap: 5px 8px;
|
|
2834
|
+
}
|
|
2835
|
+
.cf-analytics-explanation__eyebrow {
|
|
2836
|
+
color: var(--cf-accent);
|
|
2837
|
+
font-size: 9px;
|
|
2838
|
+
font-weight: 750;
|
|
2839
|
+
letter-spacing: .1em;
|
|
2840
|
+
text-transform: uppercase;
|
|
2841
|
+
}
|
|
2842
|
+
.cf-analytics-explanation__provenance {
|
|
1088
2843
|
display: inline-flex;
|
|
1089
2844
|
align-items: center;
|
|
1090
|
-
gap:
|
|
1091
|
-
|
|
1092
|
-
|
|
2845
|
+
gap: 5px;
|
|
2846
|
+
color: var(--cf-muted);
|
|
2847
|
+
font-size: 9px;
|
|
2848
|
+
font-weight: 650;
|
|
2849
|
+
}
|
|
2850
|
+
.cf-analytics-explanation__provenance-dot {
|
|
2851
|
+
width: 5px;
|
|
2852
|
+
height: 5px;
|
|
1093
2853
|
border-radius: 999px;
|
|
1094
|
-
background: var(--cf-
|
|
1095
|
-
|
|
2854
|
+
background: var(--cf-accent);
|
|
2855
|
+
}
|
|
2856
|
+
.cf-analytics-explanation__headline {
|
|
2857
|
+
margin-top: 8px !important;
|
|
2858
|
+
color: var(--cf-text);
|
|
2859
|
+
font-size: 15px;
|
|
2860
|
+
font-weight: 750;
|
|
2861
|
+
letter-spacing: -.012em;
|
|
2862
|
+
line-height: 1.45;
|
|
2863
|
+
}
|
|
2864
|
+
.cf-analytics-explanation__summary {
|
|
2865
|
+
margin-top: 5px !important;
|
|
2866
|
+
color: var(--cf-muted);
|
|
2867
|
+
font-size: 12px;
|
|
2868
|
+
line-height: 1.6;
|
|
2869
|
+
}
|
|
2870
|
+
.cf-analytics-explanation__body {
|
|
2871
|
+
display: grid;
|
|
2872
|
+
gap: 14px;
|
|
2873
|
+
padding: 12px;
|
|
2874
|
+
}
|
|
2875
|
+
.cf-analytics-explanation__status { color: var(--cf-muted); }
|
|
2876
|
+
.cf-analytics-explanation__error {
|
|
2877
|
+
border-radius: 8px;
|
|
2878
|
+
background: color-mix(in srgb, #d97706 10%, var(--cf-surface));
|
|
2879
|
+
padding: 9px 10px;
|
|
2880
|
+
color: var(--cf-text);
|
|
2881
|
+
}
|
|
2882
|
+
.cf-analytics-explanation__heading {
|
|
1096
2883
|
color: var(--cf-text);
|
|
1097
2884
|
font-size: 12px;
|
|
2885
|
+
font-weight: 750;
|
|
2886
|
+
line-height: 1.45;
|
|
1098
2887
|
}
|
|
1099
|
-
.cf-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
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; }
|
|
2888
|
+
.cf-analytics-explanation__evidence {
|
|
2889
|
+
display: grid;
|
|
2890
|
+
gap: 7px;
|
|
2891
|
+
margin: 8px 0 0;
|
|
2892
|
+
padding: 0;
|
|
2893
|
+
list-style: none;
|
|
2894
|
+
color: var(--cf-muted);
|
|
1117
2895
|
}
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
to { transform: scale(1); opacity: 1; }
|
|
2896
|
+
.cf-analytics-explanation__evidence-item {
|
|
2897
|
+
display: flex;
|
|
2898
|
+
gap: 8px;
|
|
2899
|
+
align-items: flex-start;
|
|
1123
2900
|
}
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
2901
|
+
.cf-analytics-explanation__evidence-bullet {
|
|
2902
|
+
width: 5px;
|
|
2903
|
+
height: 5px;
|
|
2904
|
+
flex: 0 0 auto;
|
|
2905
|
+
margin-top: 7px;
|
|
2906
|
+
border-radius: 999px;
|
|
2907
|
+
background: var(--cf-accent);
|
|
1127
2908
|
}
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
2909
|
+
.cf-analytics-explanation__meaning {
|
|
2910
|
+
border-left: 2px solid var(--cf-accent);
|
|
2911
|
+
border-radius: 0 8px 8px 0;
|
|
2912
|
+
background: color-mix(in srgb, var(--cf-accent) 7%, var(--cf-surface));
|
|
2913
|
+
padding: 10px 11px;
|
|
1131
2914
|
}
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
2915
|
+
.cf-analytics-explanation__paragraph {
|
|
2916
|
+
margin-top: 5px !important;
|
|
2917
|
+
color: var(--cf-muted);
|
|
1135
2918
|
}
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
2919
|
+
.cf-analytics-explanation__section-heading,
|
|
2920
|
+
.cf-analytics-explanation__outlook-header {
|
|
2921
|
+
display: flex;
|
|
2922
|
+
flex-wrap: wrap;
|
|
2923
|
+
align-items: baseline;
|
|
2924
|
+
justify-content: space-between;
|
|
2925
|
+
gap: 4px 8px;
|
|
1139
2926
|
}
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
2927
|
+
.cf-analytics-explanation__hint,
|
|
2928
|
+
.cf-analytics-explanation__outlook-badge {
|
|
2929
|
+
color: var(--cf-muted);
|
|
2930
|
+
font-size: 9px;
|
|
2931
|
+
font-weight: 650;
|
|
2932
|
+
}
|
|
2933
|
+
.cf-analytics-explanation__outlook-badge {
|
|
2934
|
+
color: var(--cf-accent);
|
|
2935
|
+
letter-spacing: .06em;
|
|
2936
|
+
text-transform: uppercase;
|
|
2937
|
+
}
|
|
2938
|
+
.cf-analytics-explanation__drivers,
|
|
2939
|
+
.cf-analytics-explanation__recommendations {
|
|
2940
|
+
display: grid;
|
|
2941
|
+
gap: 7px;
|
|
2942
|
+
margin-top: 8px;
|
|
2943
|
+
}
|
|
2944
|
+
.cf-analytics-explanation__driver {
|
|
2945
|
+
border-radius: 8px;
|
|
2946
|
+
background: var(--cf-bg);
|
|
2947
|
+
padding: 9px 10px;
|
|
2948
|
+
}
|
|
2949
|
+
.cf-analytics-explanation__driver-title,
|
|
2950
|
+
.cf-analytics-explanation__recommendation-title {
|
|
2951
|
+
color: var(--cf-text);
|
|
2952
|
+
font-weight: 750;
|
|
2953
|
+
}
|
|
2954
|
+
.cf-analytics-explanation__driver-body,
|
|
2955
|
+
.cf-analytics-explanation__recommendation-body {
|
|
2956
|
+
margin-top: 3px !important;
|
|
2957
|
+
color: var(--cf-muted);
|
|
2958
|
+
font-size: 11px;
|
|
2959
|
+
}
|
|
2960
|
+
.cf-analytics-explanation__driver-label { color: var(--cf-text); font-weight: 700; }
|
|
2961
|
+
.cf-analytics-explanation__recommendation {
|
|
2962
|
+
display: grid;
|
|
2963
|
+
grid-template-columns: 22px minmax(0, 1fr);
|
|
2964
|
+
gap: 8px;
|
|
2965
|
+
border-radius: 8px;
|
|
2966
|
+
background: var(--cf-bg);
|
|
2967
|
+
padding: 9px 10px;
|
|
2968
|
+
}
|
|
2969
|
+
.cf-analytics-explanation__recommendation-index {
|
|
2970
|
+
display: grid;
|
|
2971
|
+
width: 22px;
|
|
2972
|
+
height: 22px;
|
|
2973
|
+
place-items: center;
|
|
2974
|
+
border-radius: 999px;
|
|
2975
|
+
background: color-mix(in srgb, var(--cf-accent) 12%, var(--cf-surface));
|
|
2976
|
+
color: var(--cf-accent);
|
|
2977
|
+
font-size: 10px;
|
|
2978
|
+
font-weight: 750;
|
|
2979
|
+
}
|
|
2980
|
+
.cf-analytics-explanation__outlook {
|
|
2981
|
+
border-radius: 8px;
|
|
2982
|
+
background: var(--cf-bg);
|
|
2983
|
+
padding: 10px 11px;
|
|
2984
|
+
}
|
|
2985
|
+
.cf-analytics-explanation__follow-up {
|
|
2986
|
+
border-top: 1px solid var(--cf-border);
|
|
2987
|
+
padding-top: 12px;
|
|
2988
|
+
}
|
|
2989
|
+
.cf-analytics-explanation__questions {
|
|
2990
|
+
display: grid;
|
|
2991
|
+
gap: 6px;
|
|
2992
|
+
margin-top: 8px;
|
|
2993
|
+
}
|
|
2994
|
+
.cf-analytics-explanation__question {
|
|
2995
|
+
width: 100%;
|
|
2996
|
+
border: 1px solid var(--cf-border);
|
|
2997
|
+
border-radius: 8px;
|
|
2998
|
+
background: var(--cf-bg);
|
|
2999
|
+
padding: 8px 9px;
|
|
3000
|
+
color: var(--cf-text);
|
|
3001
|
+
font: inherit;
|
|
3002
|
+
text-align: left;
|
|
3003
|
+
cursor: pointer;
|
|
3004
|
+
}
|
|
3005
|
+
.cf-analytics-explanation__question:hover {
|
|
3006
|
+
border-color: color-mix(in srgb, var(--cf-accent) 45%, var(--cf-border));
|
|
3007
|
+
background: color-mix(in srgb, var(--cf-accent) 6%, var(--cf-bg));
|
|
3008
|
+
}
|
|
3009
|
+
.cf-analytics-explanation__question:focus-visible,
|
|
3010
|
+
.cf-analytics-explanation__limits-summary:focus-visible {
|
|
3011
|
+
outline: 2px solid var(--cf-accent);
|
|
3012
|
+
outline-offset: 2px;
|
|
3013
|
+
}
|
|
3014
|
+
.cf-analytics-explanation__limits {
|
|
3015
|
+
border-top: 1px solid var(--cf-border);
|
|
3016
|
+
padding-top: 10px;
|
|
3017
|
+
}
|
|
3018
|
+
.cf-analytics-explanation__limits-summary {
|
|
3019
|
+
cursor: pointer;
|
|
3020
|
+
color: var(--cf-text);
|
|
3021
|
+
font-weight: 700;
|
|
3022
|
+
}
|
|
3023
|
+
.cf-analytics-explanation__limits-list {
|
|
3024
|
+
margin: 8px 0 0;
|
|
3025
|
+
padding-left: 17px;
|
|
3026
|
+
color: var(--cf-muted);
|
|
3027
|
+
}
|
|
3028
|
+
.cf-analytics-explanation__source {
|
|
3029
|
+
border-top: 1px solid var(--cf-border);
|
|
3030
|
+
margin: 0;
|
|
3031
|
+
padding: 9px 12px;
|
|
3032
|
+
color: var(--cf-muted);
|
|
3033
|
+
font-size: 10px;
|
|
1143
3034
|
}
|
|
1144
3035
|
|
|
1145
|
-
@media (
|
|
1146
|
-
.cf-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
3036
|
+
@media (max-width: 639px) {
|
|
3037
|
+
.cf-panel.cf-panel--analytics-focus {
|
|
3038
|
+
inset: 12px;
|
|
3039
|
+
width: auto;
|
|
3040
|
+
height: auto;
|
|
3041
|
+
min-height: 0;
|
|
3042
|
+
max-width: none;
|
|
3043
|
+
max-height: none;
|
|
3044
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
3045
|
+
grid-template-areas: 'header' 'video';
|
|
3046
|
+
transform-origin: center;
|
|
1151
3047
|
}
|
|
3048
|
+
.cf-panel--analytics-focus .cf-panel__video { height: 100%; }
|
|
3049
|
+
.cf-panel--analytics-focus .cf-panel__chat { display: none; }
|
|
3050
|
+
.cf-analytics-focus { padding: 14px; }
|
|
3051
|
+
.cf-analytics-visualization.is-expanded .cf-analytics-echart { min-height: 260px; }
|
|
1152
3052
|
}
|
|
1153
|
-
`;function
|
|
3053
|
+
`;function Dt(e){"@babel/helpers - typeof";return Dt=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},Dt(e)}function Ot(e,t){if(Dt(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Dt(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function G(e){var t=Ot(e,`string`);return Dt(t)==`symbol`?t:t+``}function K(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 q=`centrinfo-widget`;var kt=class extends HTMLElement{constructor(...e){super(...e),K(this,`controls`,null)}mountWith(t){let n=h(t),r=this.shadowRoot??this.attachShadow({mode:`open`});if(`adoptedStyleSheets`in Document.prototype&&typeof CSSStyleSheet<`u`){let e=new CSSStyleSheet;e.replaceSync(Et),r.adoptedStyleSheets=[e]}else{let e=document.createElement(`style`);e.textContent=Et,r.appendChild(e)}g(C(Tt,{transport:n.demo?new a:n.preview?new o(new e(n.apiBaseUrl,n.token,n.gifApiKey,n.analyticsContextToken,{agentName:n.agentName,agentAvatarUrl:n.agentAvatarUrl},n.identityToken,n.getIdentityToken),n.strings):new e(n.apiBaseUrl,n.token,n.gifApiKey,n.analyticsContextToken,{agentName:n.agentName,agentAvatarUrl:n.agentAvatarUrl},n.identityToken,n.getIdentityToken),config:n,bindControls:e=>this.controls=e}),r)}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&&g(null,this.shadowRoot)}};typeof customElements<`u`&&!customElements.get(q)&&customElements.define(q,kt);const At=(e,t=document.body)=>{if(typeof document>`u`)throw Error(`[centrinfo-widget] createWidget must run in a browser.`);let n=document.createElement(q);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()}}},J=e=>At(e);let jt=null;const Mt=e=>{jt?.destroy();let t=J(e);return jt=t,t},Nt={init:Mt,createWidget:J};export{Nt as Centrinfo,J as createWidget,Mt as init};
|