@botuyo/chat-widget-standalone 1.0.43 → 1.0.44

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botuyo/chat-widget-standalone",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
4
4
  "type": "module",
5
5
  "description": "BotUyo Chat Widget - Standalone CDN version with React/TypeScript support",
6
6
  "main": "dist/botuyo-chat.umd.js",
@@ -1,12 +0,0 @@
1
- import{jsxs as r,jsx as e,Fragment as a}from"react/jsx-runtime";import{memo as t,useState as l,useRef as o,useMemo as n,useCallback as i}from"react";import{g as s,c,R as d,L as u,P as h,a as m,C as f}from"./chunk-chat-ui-BNRuIw2B.js";const p=t(function({url:t,isBot:p,primaryColor:y}){const[x,N]=l(!1),[g,w]=l(0),[b,v]=l(0),[C,k]=l(!0),[j,M]=l(null),P=o(null),S=n(()=>s({primaryColor:y}),[y]),E=i(()=>{j||(x?P.current?.pause():P.current?.play().catch(r=>{console.error("[AudioPlayer] Play error:",r),M("Error al reproducir")}),N(!x))},[x,j]),T=i(()=>{w(P.current?.duration||0)},[]),$=i(()=>{k(!1),M(null)},[]),A=i(()=>{console.error("[AudioPlayer] Failed to load audio:",t),k(!1),M("No se pudo cargar")},[t]),L=i(()=>{k(!0),M(null),P.current&&P.current.load()},[]);/* @__PURE__ */
2
- return r("div",{className:c("flex items-center gap-3 py-1 min-w-[200px]",p?"text-foreground":"text-primary-foreground"),children:[
3
- /* @__PURE__ */e("audio",{ref:P,src:t,preload:"metadata",onLoadedMetadata:T,onCanPlayThrough:$,onTimeUpdate:()=>v(P.current?.currentTime||0),onEnded:()=>N(!1),onError:A}),
4
- /* @__PURE__ */e("button",j?{onClick:L,className:"w-8 h-8 rounded-full flex items-center justify-center shrink-0 bg-red-500/20 text-red-500 hover:bg-red-500/30 transition-colors",title:"Reintentar",children:/* @__PURE__ */e(d,{className:"w-4 h-4"})}:{onClick:E,disabled:C,className:"w-8 h-8 rounded-full flex items-center justify-center shrink-0 transition-opacity",style:{backgroundColor:p?S:"hsl(var(--card))",color:p?"white":S,opacity:C?.6:1},children:C?/* @__PURE__ */e(u,{className:"w-4 h-4 animate-spin"}):x?/* @__PURE__ */e(h,{className:"w-4 h-4 fill-current"}):/* @__PURE__ */e(m,{className:"w-4 h-4 fill-current ml-0.5"})}),
5
- /* @__PURE__ */e("div",{className:"flex-1 space-y-1",children:j?/* @__PURE__ */r("div",{className:"flex items-center gap-1.5 text-red-500",children:[
6
- /* @__PURE__ */e(f,{className:"w-3 h-3"}),
7
- /* @__PURE__ */e("span",{className:"text-[9px] font-bold",children:j})]}):/* @__PURE__ */r(a,{children:[
8
- /* @__PURE__ */e("div",{className:"relative h-1 w-full bg-current/20 rounded-full overflow-hidden",children:/* @__PURE__ */e("div",{className:"absolute h-full bg-current rounded-full transition-all",style:{width:`${b/g*100||0}%`}})}),
9
- /* @__PURE__ */r("div",{className:"flex justify-between text-[9px] font-bold opacity-60",children:[
10
- /* @__PURE__ */r("span",{children:[Math.floor(b/60),":",Math.floor(b%60).toString().padStart(2,"0")]}),
11
- /* @__PURE__ */e("span",{children:C?"--:--":`${Math.floor(g/60)}:${Math.floor(g%60).toString().padStart(2,"0")}`})]})]})})]})});export{p as AudioPlayer};
12
- //# sourceMappingURL=chunk-audio-BI6-EeUY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chunk-audio-BI6-EeUY.js","sources":["../src/chat-widget/components/AudioPlayer.tsx"],"sourcesContent":["'use client'\r\n\r\nimport { useState, useRef, useMemo, memo, useCallback } from 'react'\r\nimport { Play, Pause, Loader2, AlertCircle, RotateCw } from './Icons'\r\nimport { cn } from '@/lib/utils'\r\nimport { getPrimaryColor } from '../utils/theme'\r\n\r\ninterface AudioPlayerProps {\r\n url: string\r\n isBot: boolean\r\n primaryColor?: string\r\n}\r\n\r\nexport type { AudioPlayerProps }\r\n\r\nexport const AudioPlayer = memo(function AudioPlayer({\r\n url,\r\n isBot,\r\n primaryColor,\r\n}: AudioPlayerProps) {\r\n const [isPlaying, setIsPlaying] = useState(false)\r\n const [duration, setDuration] = useState(0)\r\n const [currentTime, setCurrentTime] = useState(0)\r\n const [isLoading, setIsLoading] = useState(true)\r\n const [error, setError] = useState<string | null>(null)\r\n const audioRef = useRef<HTMLAudioElement>(null)\r\n\r\n const brandColor = useMemo(() => getPrimaryColor({ primaryColor }), [primaryColor])\r\n\r\n const togglePlay = useCallback(() => {\r\n if (error) return\r\n if (isPlaying) audioRef.current?.pause()\r\n else audioRef.current?.play().catch((e) => {\r\n console.error('[AudioPlayer] Play error:', e)\r\n setError('Error al reproducir')\r\n })\r\n setIsPlaying(!isPlaying)\r\n }, [isPlaying, error])\r\n\r\n const handleLoadedMetadata = useCallback(() => {\r\n setDuration(audioRef.current?.duration || 0)\r\n }, [])\r\n\r\n const handleCanPlayThrough = useCallback(() => {\r\n setIsLoading(false)\r\n setError(null)\r\n }, [])\r\n\r\n const handleError = useCallback(() => {\r\n console.error('[AudioPlayer] Failed to load audio:', url)\r\n setIsLoading(false)\r\n setError('No se pudo cargar')\r\n }, [url])\r\n\r\n const handleRetry = useCallback(() => {\r\n setIsLoading(true)\r\n setError(null)\r\n if (audioRef.current) {\r\n audioRef.current.load()\r\n }\r\n }, [])\r\n\r\n return (\r\n <div\r\n className={cn(\r\n 'flex items-center gap-3 py-1 min-w-[200px]',\r\n isBot ? 'text-foreground' : 'text-primary-foreground'\r\n )}\r\n >\r\n <audio\r\n ref={audioRef}\r\n src={url}\r\n preload=\"metadata\"\r\n onLoadedMetadata={handleLoadedMetadata}\r\n onCanPlayThrough={handleCanPlayThrough}\r\n onTimeUpdate={() => setCurrentTime(audioRef.current?.currentTime || 0)}\r\n onEnded={() => setIsPlaying(false)}\r\n onError={handleError}\r\n />\r\n \r\n {error ? (\r\n // Error state - show retry button\r\n <button\r\n onClick={handleRetry}\r\n className=\"w-8 h-8 rounded-full flex items-center justify-center shrink-0 bg-red-500/20 text-red-500 hover:bg-red-500/30 transition-colors\"\r\n title=\"Reintentar\"\r\n >\r\n <RotateCw className=\"w-4 h-4\" />\r\n </button>\r\n ) : (\r\n // Normal play/pause button\r\n <button\r\n onClick={togglePlay}\r\n disabled={isLoading}\r\n className=\"w-8 h-8 rounded-full flex items-center justify-center shrink-0 transition-opacity\"\r\n style={{\r\n backgroundColor: isBot ? brandColor : 'hsl(var(--card))',\r\n color: isBot ? 'white' : brandColor,\r\n opacity: isLoading ? 0.6 : 1,\r\n }}\r\n >\r\n {isLoading ? (\r\n <Loader2 className=\"w-4 h-4 animate-spin\" />\r\n ) : isPlaying ? (\r\n <Pause className=\"w-4 h-4 fill-current\" />\r\n ) : (\r\n <Play className=\"w-4 h-4 fill-current ml-0.5\" />\r\n )}\r\n </button>\r\n )}\r\n \r\n <div className=\"flex-1 space-y-1\">\r\n {error ? (\r\n <div className=\"flex items-center gap-1.5 text-red-500\">\r\n <AlertCircle className=\"w-3 h-3\" />\r\n <span className=\"text-[9px] font-bold\">{error}</span>\r\n </div>\r\n ) : (\r\n <>\r\n <div className=\"relative h-1 w-full bg-current/20 rounded-full overflow-hidden\">\r\n <div\r\n className=\"absolute h-full bg-current rounded-full transition-all\"\r\n style={{ width: `${(currentTime / duration) * 100 || 0}%` }}\r\n />\r\n </div>\r\n <div className=\"flex justify-between text-[9px] font-bold opacity-60\">\r\n <span>\r\n {Math.floor(currentTime / 60)}:\r\n {Math.floor(currentTime % 60)\r\n .toString()\r\n .padStart(2, '0')}\r\n </span>\r\n <span>\r\n {isLoading ? '--:--' : `${Math.floor(duration / 60)}:${Math.floor(duration % 60).toString().padStart(2, '0')}`}\r\n </span>\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n )\r\n})\r\n"],"names":["AudioPlayer","memo","url","isBot","primaryColor","isPlaying","setIsPlaying","useState","duration","setDuration","currentTime","setCurrentTime","isLoading","setIsLoading","error","setError","audioRef","useRef","brandColor","useMemo","getPrimaryColor","togglePlay","useCallback","current","pause","play","catch","e","console","handleLoadedMetadata","handleCanPlayThrough","handleError","handleRetry","load","jsxs","className","cn","children","jsx","ref","src","preload","onLoadedMetadata","onCanPlayThrough","onTimeUpdate","onEnded","onError","onClick","title","RotateCw","disabled","style","backgroundColor","color","opacity","Loader2","Pause","Play","AlertCircle","Fragment","width","Math","floor","toString","padStart"],"mappings":"0OAeO,MAAMA,EAAcC,EAAK,UAAqBC,IACnDA,EAAAC,MACAA,EAAAC,aACAA,IAEA,MAAOC,EAAWC,GAAgBC,GAAS,IACpCC,EAAUC,GAAeF,EAAS,IAClCG,EAAaC,GAAkBJ,EAAS,IACxCK,EAAWC,GAAgBN,GAAS,IACpCO,EAAOC,GAAYR,EAAwB,MAC5CS,EAAWC,EAAyB,MAEpCC,EAAaC,EAAQ,IAAMC,EAAgB,CAAEhB,iBAAiB,CAACA,IAE/DiB,EAAaC,EAAY,KACzBR,IACAT,EAAWW,EAASO,SAASC,UACnBD,SAASE,OAAOC,MAAOC,IACnCC,QAAQd,MAAM,4BAA6Ba,GAC3CZ,EAAS,yBAEXT,GAAcD,KACb,CAACA,EAAWS,IAETe,EAAuBP,EAAY,KACvCb,EAAYO,EAASO,SAASf,UAAY,IACzC,IAEGsB,EAAuBR,EAAY,KACvCT,GAAa,GACbE,EAAS,OACR,IAEGgB,EAAcT,EAAY,KAC9BM,QAAQd,MAAM,sCAAuCZ,GACrDW,GAAa,GACbE,EAAS,sBACR,CAACb,IAEE8B,EAAcV,EAAY,KAC9BT,GAAa,GACbE,EAAS,MACLC,EAASO,SACXP,EAASO,QAAQU,QAElB;AAEH,OACEC,EAAC,MAAA,CACCC,UAAWC,EACT,6CACAjC,EAAQ,kBAAoB,2BAG9BkC,SAAA;eAAAC,EAAC,QAAA,CACCC,IAAKvB,EACLwB,IAAKtC,EACLuC,QAAQ,WACRC,iBAAkBb,EAClBc,iBAAkBb,EAClBc,aAAc,IAAMjC,EAAeK,EAASO,SAASb,aAAe,GACpEmC,QAAS,IAAMvC,GAAa,GAC5BwC,QAASf;eAKTO,EAAC,SAFFxB,EAEE,CACCiC,QAASf,EACTG,UAAU,kIACVa,MAAM,aAENX,wBAAAC,EAACW,EAAA,CAASd,UAAU,aAIrB,CACCY,QAAS1B,EACT6B,SAAUtC,EACVuB,UAAU,oFACVgB,MAAO,CACLC,gBAAiBjD,EAAQe,EAAa,mBACtCmC,MAAOlD,EAAQ,QAAUe,EACzBoC,QAAS1C,EAAY,GAAM,GAG5ByB,SAAAzB,iBACC0B,EAACiB,EAAA,CAAQpB,UAAU,yBACjB9B,iBACFiC,EAACkB,EAAA,CAAMrB,UAAU,0CAEhBsB,EAAA,CAAKtB,UAAU;eAKtBG,EAAC,OAAIH,UAAU,mBACZE,0BACCH,EAAC,MAAA,CAAIC,UAAU,yCACbE,SAAA;eAAAC,EAACoB,EAAA,CAAYvB,UAAU;iBACtB,OAAA,CAAKA,UAAU,uBAAwBE,SAAAvB,sBAG1CoB,EAAAyB,EAAA,CACEtB,SAAA;eAAAC,EAAC,MAAA,CAAIH,UAAU,iEACbE,wBAAAC,EAAC,MAAA,CACCH,UAAU,yDACVgB,MAAO,CAAES,MAAO,GAAIlD,EAAcF,EAAY,KAAO;eAGzD0B,EAAC,MAAA,CAAIC,UAAU,uDACbE,SAAA;eAAAH,EAAC,OAAA,CACEG,SAAA,CAAAwB,KAAKC,MAAMpD,EAAc,IAAI,IAC7BmD,KAAKC,MAAMpD,EAAc,IACvBqD,WACAC,SAAS,EAAG;eAEjB1B,EAAC,QACED,SAAAzB,EAAY,QAAU,GAAGiD,KAAKC,MAAMtD,EAAW,OAAOqD,KAAKC,MAAMtD,EAAW,IAAIuD,WAAWC,SAAS,EAAG,mBAQxH"}
@@ -1,134 +0,0 @@
1
- import*as e from"react";import t,{createContext as r,useState as n,useEffect as o,useContext as a,useCallback as s,forwardRef as i,createElement as l,useMemo as c,memo as d,Suspense as u,lazy as h,useRef as m,Component as p}from"react";import{jsx as g,jsxs as f,Fragment as b}from"react/jsx-runtime";import{flushSync as x}from"react-dom";import{M as v,r as y,a as w}from"./chunk-markdown-QS0MJc8h.js";const k={es:{online:"En línea",offline:"Desconectado",connecting:"Conectando...",con_amor_paseo_libre:"Con ❤️ por BotUyo",preview:"Vista previa",fotos:"Fotos",ubicacion:"Ubicación",input_placeholder:"Escribe un mensaje...",send:"Enviar",attach_photo:"Adjuntar foto",attach_location:"Compartir ubicación",recording:"Grabando...",rate_limit_exceeded:"Has enviado demasiados mensajes. Espera un momento.",connection_error:"Error de conexión",file_too_large:"Archivo demasiado grande",invalid_file:"Tipo de archivo no válido",extracted:{assistant:"Asistente",anterior:"Anterior",siguiente:"Siguiente",cerrar:"Cerrar",cerrar_chat:"Cerrar chat",abrir_chat:"Abrir chat",ver_ubicacion:"Ver ubicación"},accessibility:{closeChat:"Cerrar ventana de chat",closeChatHint:"Presiona Escape para cerrar",chatMessages:"Mensajes del chat",messageHistory:"Historial de mensajes",dialogDescription:"Ventana de chat con {{botName}}. Presiona Escape para cerrar. Usa Ctrl+Enter para enviar mensajes.",sendMessage:"Enviar mensaje",sendMessageHint:"Presiona Enter o Ctrl+Enter para enviar",typeMessage:"Escribe tu mensaje aquí",botMessage:"Mensaje del asistente",userMessage:"Tu mensaje",messageFrom:"Mensaje de {{sender}}",messageTime:"Enviado {{time}}",newMessage:"Nuevo mensaje recibido"}},en:{online:"Online",offline:"Offline",connecting:"Connecting...",con_amor_paseo_libre:"With ❤️ by BotUyo",preview:"Preview",fotos:"Photos",ubicacion:"Location",input_placeholder:"Type a message...",send:"Send",attach_photo:"Attach photo",attach_location:"Share location",recording:"Recording...",rate_limit_exceeded:"You have sent too many messages. Please wait.",connection_error:"Connection error",file_too_large:"File too large",invalid_file:"Invalid file type",extracted:{assistant:"Assistant",anterior:"Previous",siguiente:"Next",cerrar:"Close",cerrar_chat:"Close chat",abrir_chat:"Open chat",ver_ubicacion:"View location"},accessibility:{closeChat:"Close chat window",closeChatHint:"Press Escape to close",chatMessages:"Chat messages",messageHistory:"Message history",dialogDescription:"Chat window with {{botName}}. Press Escape to close. Use Ctrl+Enter to send messages.",sendMessage:"Send message",sendMessageHint:"Press Enter or Ctrl+Enter to send",typeMessage:"Type your message here",botMessage:"Assistant message",userMessage:"Your message",messageFrom:"Message from {{sender}}",messageTime:"Sent {{time}}",newMessage:"New message received"}},pt:{online:"Online",offline:"Desconectado",connecting:"Conectando...",con_amor_paseo_libre:"Com ❤️ por BotUyo",preview:"Visualizar",fotos:"Fotos",ubicacion:"Localização",input_placeholder:"Digite uma mensagem...",send:"Enviar",attach_photo:"Anexar foto",attach_location:"Compartilhar localização",recording:"Gravando...",rate_limit_exceeded:"Você enviou muitas mensagens. Aguarde um momento.",connection_error:"Erro de conexão",file_too_large:"Arquivo muito grande",invalid_file:"Tipo de arquivo inválido",extracted:{assistant:"Assistente",anterior:"Anterior",siguiente:"Próximo",cerrar:"Fechar",cerrar_chat:"Fechar chat",abrir_chat:"Abrir chat",ver_ubicacion:"Ver localização"},accessibility:{closeChat:"Fechar janela de chat",closeChatHint:"Pressione Escape para fechar",chatMessages:"Mensagens do chat",messageHistory:"Histórico de mensagens",dialogDescription:"Janela de chat com {{botName}}. Pressione Escape para fechar. Use Ctrl+Enter para enviar mensagens.",sendMessage:"Enviar mensagem",sendMessageHint:"Pressione Enter ou Ctrl+Enter para enviar",typeMessage:"Digite sua mensagem aqui",botMessage:"Mensagem do assistente",userMessage:"Sua mensagem",messageFrom:"Mensagem de {{sender}}",messageTime:"Enviado {{time}}",newMessage:"Nova mensagem recebida"}},fr:{online:"En ligne",offline:"Déconnecté",connecting:"Connexion...",con_amor_paseo_libre:"Avec ❤️ par BotUyo",preview:"Aperçu",fotos:"Photos",ubicacion:"Emplacement",input_placeholder:"Tapez un message...",send:"Envoyer",attach_photo:"Joindre une photo",attach_location:"Partager la localisation",recording:"Enregistrement...",rate_limit_exceeded:"Vous avez envoyé trop de messages. Veuillez patienter.",connection_error:"Erreur de connexion",file_too_large:"Fichier trop volumineux",invalid_file:"Type de fichier invalide",extracted:{assistant:"Assistant",anterior:"Précédent",siguiente:"Suivant",cerrar:"Fermer",cerrar_chat:"Fermer le chat",abrir_chat:"Ouvrir le chat",ver_ubicacion:"Voir l'emplacement"},accessibility:{closeChat:"Fermer la fenêtre de chat",closeChatHint:"Appuyez sur Échap pour fermer",chatMessages:"Messages du chat",messageHistory:"Historique des messages",dialogDescription:"Fenêtre de chat avec {{botName}}. Appuyez sur Échap pour fermer. Utilisez Ctrl+Entrée pour envoyer des messages.",sendMessage:"Envoyer un message",sendMessageHint:"Appuyez sur Entrée ou Ctrl+Entrée pour envoyer",typeMessage:"Tapez votre message ici",botMessage:"Message de l'assistant",userMessage:"Votre message",messageFrom:"Message de {{sender}}",messageTime:"Envoyé {{time}}",newMessage:"Nouveau message reçu"}}};function C(){if("undefined"==typeof navigator)return"es";const e=navigator.language.split("-")[0];return k[e]?e:"es"}const N={locale:C(),setLocale:()=>{}},M=r(N),z="botuyo-chat-locale";function S({children:e,defaultLocale:t}){const[r,a]=n(()=>{if(t)return t;if("undefined"!=typeof window){const e=localStorage.getItem(z);if(e)return e}return C()});return o(()=>{if("undefined"==typeof window||t)return;const e=()=>{localStorage.getItem(z)||a(C())};return window.addEventListener("languagechange",e),()=>window.removeEventListener("languagechange",e)},[t]),/* @__PURE__ */g(M.Provider,{value:{locale:r,setLocale:e=>{["es","en","pt","fr"].includes(e)?(a(e),"undefined"!=typeof window&&localStorage.setItem(z,e)):console.warn(`[BotUyo] Locale "${e}" no es soportado. Manteniendo "${r}"`)}},children:e})}function E(){return a(M)??N}function j(e){const{locale:t,setLocale:r}=E();return{t:s(r=>{var n,o;return(n=k[t],(o=e?`${e}.${r}`:r).split(".").reduce((e,t)=>e?.[t],n)||o)||r},[t,e]),setLocale:r,currentLocale:t}}const A=(...e)=>e.filter((e,t,r)=>Boolean(e)&&r.indexOf(e)===t).join(" ");var _={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const I=i(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:a,iconNode:s,...i},c)=>l("svg",{ref:c,..._,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:A("lucide",o),...i},[...s.map(([e,t])=>l(e,t)),...Array.isArray(a)?a:[a]])),F=(e,t)=>{const r=i(({className:r,...n},o)=>{return l(I,{ref:o,iconNode:t,className:A(`lucide-${a=e,a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...n});var a});return r.displayName=`${e}`,r},$=F("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),L=F("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),T=F("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),O=F("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),D=F("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),U=F("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),W=F("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),P=F("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),R=F("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]),B=F("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),V=F("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),H=F("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),q=F("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),G=F("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]),K=F("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]),Z=F("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]),Y=F("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]),J=F("PhoneOff",[["path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91",key:"z86iuo"}],["line",{x1:"22",x2:"2",y1:"2",y2:"22",key:"11kh81"}]]),X=F("Phone",[["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.72 12.84 12.84 0 0 0 .7 2.81 2 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-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]),Q=F("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]),ee=F("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),te=F("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),re=F("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]),ne=F("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),oe=F("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),ae=F("Volume2",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}],["path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",key:"1kegas"}]]),se=F("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ie=F("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function le(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=le(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}const ce=(e=/* @__PURE__ */new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),de="-",ue=[],he=e=>{const t=ge(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return pe(e);const r=e.split(de),n=""===r[0]&&r.length>1?1:0;return me(r,n,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=n[e],o=r[e];return t?o?((e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r})(o,t):t:o||ue}return r[e]||ue}}},me=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const n=e[t],o=r.nextPart.get(n);if(o){const r=me(e,t+1,o);if(r)return r}const a=r.validators;if(null===a)return;const s=0===t?e.join(de):e.slice(t).join(de),i=a.length;for(let l=0;l<i;l++){const e=a[l];if(e.validator(s))return e.classGroupId}},pe=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?"arbitrary.."+n:void 0})(),ge=e=>{const{theme:t,classGroups:r}=e;return fe(r,t)},fe=(e,t)=>{const r=ce();for(const n in e){const o=e[n];be(o,r,n,t)}return r},be=(e,t,r,n)=>{const o=e.length;for(let a=0;a<o;a++){const o=e[a];xe(o,t,r,n)}},xe=(e,t,r,n)=>{"string"!=typeof e?"function"!=typeof e?we(e,t,r,n):ye(e,t,r,n):ve(e,t,r)},ve=(e,t,r)=>{(""===e?t:ke(t,e)).classGroupId=r},ye=(e,t,r,n)=>{Ce(e)?be(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},we=(e,t,r,n)=>{const o=Object.entries(e),a=o.length;for(let s=0;s<a;s++){const[e,a]=o[s];be(a,ke(t,e),r,n)}},ke=(e,t)=>{let r=e;const n=t.split(de),o=n.length;for(let a=0;a<o;a++){const e=n[a];let t=r.nextPart.get(e);t||(t=ce(),r.nextPart.set(e,t)),r=t}return r},Ce=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,Ne=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=/* @__PURE__ */Object.create(null),n=/* @__PURE__ */Object.create(null);const o=(o,a)=>{r[o]=a,t++,t>e&&(t=0,n=r,r=/* @__PURE__ */Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(o(e,t),t):void 0},set(e,t){e in r?r[e]=t:o(e,t)}}},Me=[],ze=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Se=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,o=0,a=0;const s=e.length;for(let d=0;d<s;d++){const s=e[d];if(0===n&&0===o){if(":"===s){t.push(e.slice(a,d)),a=d+1;continue}if("/"===s){r=d;continue}}"["===s?n++:"]"===s?n--:"("===s?o++:")"===s&&o--}const i=0===t.length?e:e.slice(a);let l=i,c=!1;return i.endsWith("!")?(l=i.slice(0,-1),c=!0):i.startsWith("!")&&(l=i.slice(1),c=!0),ze(t,c,l,r&&r>a?r-a:void 0)};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):ze(Me,!1,t,void 0,!0)}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},Ee=e=>{const t=/* @__PURE__ */new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let n=[];for(let o=0;o<e.length;o++){const a=e[o],s="["===a[0],i=t.has(a);s||i?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(a)):n.push(a)}return n.length>0&&(n.sort(),r.push(...n)),r}},je=/\s+/,Ae=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ae(e[n]))&&(r&&(r+=" "),r+=t);return r},_e=[],Ie=e=>{const t=t=>t[e]||_e;return t.isThemeGetter=!0,t},Fe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$e=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Le=/^\d+\/\d+$/,Te=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Oe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,De=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ue=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,We=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pe=e=>Le.test(e),Re=e=>!!e&&!Number.isNaN(Number(e)),Be=e=>!!e&&Number.isInteger(Number(e)),Ve=e=>e.endsWith("%")&&Re(e.slice(0,-1)),He=e=>Te.test(e),qe=()=>!0,Ge=e=>Oe.test(e)&&!De.test(e),Ke=()=>!1,Ze=e=>Ue.test(e),Ye=e=>We.test(e),Je=e=>!Qe(e)&&!at(e),Xe=e=>ht(e,ft,Ke),Qe=e=>Fe.test(e),et=e=>ht(e,bt,Ge),tt=e=>ht(e,xt,Re),rt=e=>ht(e,pt,Ke),nt=e=>ht(e,gt,Ye),ot=e=>ht(e,yt,Ze),at=e=>$e.test(e),st=e=>mt(e,bt),it=e=>mt(e,vt),lt=e=>mt(e,pt),ct=e=>mt(e,ft),dt=e=>mt(e,gt),ut=e=>mt(e,yt,!0),ht=(e,t,r)=>{const n=Fe.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},mt=(e,t,r=!1)=>{const n=$e.exec(e);return!!n&&(n[1]?t(n[1]):r)},pt=e=>"position"===e||"percentage"===e,gt=e=>"image"===e||"url"===e,ft=e=>"length"===e||"size"===e||"bg-size"===e,bt=e=>"length"===e,xt=e=>"number"===e,vt=e=>"family-name"===e,yt=e=>"shadow"===e,wt=/* @__PURE__ */((e,...t)=>{let r,n,o,a;const s=e=>{const t=n(e);if(t)return t;const a=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:a}=t,s=[],i=e.trim().split(je);let l="";for(let c=i.length-1;c>=0;c-=1){const e=i[c],{isExternal:t,modifiers:d,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:m}=r(e);if(t){l=e+(l.length>0?" "+l:l);continue}let p=!!m,g=n(p?h.substring(0,m):h);if(!g){if(!p){l=e+(l.length>0?" "+l:l);continue}if(g=n(h),!g){l=e+(l.length>0?" "+l:l);continue}p=!1}const f=0===d.length?"":1===d.length?d[0]:a(d).join(":"),b=u?f+"!":f,x=b+g;if(s.indexOf(x)>-1)continue;s.push(x);const v=o(g,p);for(let r=0;r<v.length;++r){const e=v[r];s.push(b+e)}l=e+(l.length>0?" "+l:l)}return l})(e,r);return o(e,a),a};return a=i=>{const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:Ne(e.cacheSize),parseClassName:Se(e),sortModifiers:Ee(e),...he(e)}))(l),n=r.cache.get,o=r.cache.set,a=s,s(i)},(...e)=>a(((...e)=>{let t,r,n=0,o="";for(;n<e.length;)(t=e[n++])&&(r=Ae(t))&&(o&&(o+=" "),o+=r);return o})(...e))})(()=>{const e=Ie("color"),t=Ie("font"),r=Ie("text"),n=Ie("font-weight"),o=Ie("tracking"),a=Ie("leading"),s=Ie("breakpoint"),i=Ie("container"),l=Ie("spacing"),c=Ie("radius"),d=Ie("shadow"),u=Ie("inset-shadow"),h=Ie("text-shadow"),m=Ie("drop-shadow"),p=Ie("blur"),g=Ie("perspective"),f=Ie("aspect"),b=Ie("ease"),x=Ie("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",at,Qe],y=()=>[at,Qe,l],w=()=>[Pe,"full","auto",...y()],k=()=>[Be,"none","subgrid",at,Qe],C=()=>["auto",{span:["full",Be,at,Qe]},Be,at,Qe],N=()=>[Be,"auto",at,Qe],M=()=>["auto","min","max","fr",at,Qe],z=()=>["auto",...y()],S=()=>[Pe,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...y()],E=()=>[e,at,Qe],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",lt,rt,{position:[at,Qe]}],A=()=>["auto","cover","contain",ct,Xe,{size:[at,Qe]}],_=()=>[Ve,st,et],I=()=>["","none","full",c,at,Qe],F=()=>["",Re,st,et],$=()=>[Re,Ve,lt,rt],L=()=>["","none",p,at,Qe],T=()=>["none",Re,at,Qe],O=()=>["none",Re,at,Qe],D=()=>[Re,at,Qe],U=()=>[Pe,"full",...y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[He],breakpoint:[He],color:[qe],container:[He],"drop-shadow":[He],ease:["in","out","in-out"],font:[Je],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[He],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[He],shadow:[He],spacing:["px",Re],text:[He],"text-shadow":[He],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Pe,Qe,at,f]}],container:["container"],columns:[{columns:[Re,Qe,at,i]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[Be,"auto",at,Qe]}],basis:[{basis:[Pe,"full","auto",i,...y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Re,Pe,"auto","initial","none",Qe]}],grow:[{grow:["",Re,at,Qe]}],shrink:[{shrink:["",Re,at,Qe]}],order:[{order:[Be,"first","last","none",at,Qe]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:C()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:C()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:y()}],"gap-x":[{"gap-x":y()}],"gap-y":[{"gap-y":y()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:y()}],px:[{px:y()}],py:[{py:y()}],ps:[{ps:y()}],pe:[{pe:y()}],pt:[{pt:y()}],pr:[{pr:y()}],pb:[{pb:y()}],pl:[{pl:y()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":y()}],"space-y-reverse":["space-y-reverse"],size:[{size:S()}],w:[{w:[i,"screen",...S()]}],"min-w":[{"min-w":[i,"screen","none",...S()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[s]},...S()]}],h:[{h:["screen","lh",...S()]}],"min-h":[{"min-h":["screen","lh","none",...S()]}],"max-h":[{"max-h":["screen","lh",...S()]}],"font-size":[{text:["base",r,st,et]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,at,tt]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ve,Qe]}],"font-family":[{font:[it,Qe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,at,Qe]}],"line-clamp":[{"line-clamp":[Re,"none",at,tt]}],leading:[{leading:[a,...y()]}],"list-image":[{"list-image":["none",at,Qe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",at,Qe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Re,"from-font","auto",at,et]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[Re,"auto",at,Qe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",at,Qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",at,Qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Be,at,Qe],radial:["",at,Qe],conic:[Be,at,Qe]},dt,nt]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:_()}],"gradient-via-pos":[{via:_()}],"gradient-to-pos":[{to:_()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":F()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Re,at,Qe]}],"outline-w":[{outline:["",Re,st,et]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",d,ut,ot]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",u,ut,ot]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[Re,et]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",h,ut,ot]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[Re,at,Qe]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Re]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[at,Qe]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Re]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",at,Qe]}],filter:[{filter:["","none",at,Qe]}],blur:[{blur:L()}],brightness:[{brightness:[Re,at,Qe]}],contrast:[{contrast:[Re,at,Qe]}],"drop-shadow":[{"drop-shadow":["","none",m,ut,ot]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",Re,at,Qe]}],"hue-rotate":[{"hue-rotate":[Re,at,Qe]}],invert:[{invert:["",Re,at,Qe]}],saturate:[{saturate:[Re,at,Qe]}],sepia:[{sepia:["",Re,at,Qe]}],"backdrop-filter":[{"backdrop-filter":["","none",at,Qe]}],"backdrop-blur":[{"backdrop-blur":L()}],"backdrop-brightness":[{"backdrop-brightness":[Re,at,Qe]}],"backdrop-contrast":[{"backdrop-contrast":[Re,at,Qe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Re,at,Qe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Re,at,Qe]}],"backdrop-invert":[{"backdrop-invert":["",Re,at,Qe]}],"backdrop-opacity":[{"backdrop-opacity":[Re,at,Qe]}],"backdrop-saturate":[{"backdrop-saturate":[Re,at,Qe]}],"backdrop-sepia":[{"backdrop-sepia":["",Re,at,Qe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":y()}],"border-spacing-x":[{"border-spacing-x":y()}],"border-spacing-y":[{"border-spacing-y":y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",at,Qe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Re,"initial",at,Qe]}],ease:[{ease:["linear","initial",b,at,Qe]}],delay:[{delay:[Re,at,Qe]}],animate:[{animate:["none",x,at,Qe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,at,Qe]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:T()}],"rotate-x":[{"rotate-x":T()}],"rotate-y":[{"rotate-y":T()}],"rotate-z":[{"rotate-z":T()}],scale:[{scale:O()}],"scale-x":[{"scale-x":O()}],"scale-y":[{"scale-y":O()}],"scale-z":[{"scale-z":O()}],"scale-3d":["scale-3d"],skew:[{skew:D()}],"skew-x":[{"skew-x":D()}],"skew-y":[{"skew-y":D()}],transform:[{transform:[at,Qe,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:U()}],"translate-x":[{"translate-x":U()}],"translate-y":[{"translate-y":U()}],"translate-z":[{"translate-z":U()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",at,Qe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":y()}],"scroll-mx":[{"scroll-mx":y()}],"scroll-my":[{"scroll-my":y()}],"scroll-ms":[{"scroll-ms":y()}],"scroll-me":[{"scroll-me":y()}],"scroll-mt":[{"scroll-mt":y()}],"scroll-mr":[{"scroll-mr":y()}],"scroll-mb":[{"scroll-mb":y()}],"scroll-ml":[{"scroll-ml":y()}],"scroll-p":[{"scroll-p":y()}],"scroll-px":[{"scroll-px":y()}],"scroll-py":[{"scroll-py":y()}],"scroll-ps":[{"scroll-ps":y()}],"scroll-pe":[{"scroll-pe":y()}],"scroll-pt":[{"scroll-pt":y()}],"scroll-pr":[{"scroll-pr":y()}],"scroll-pb":[{"scroll-pb":y()}],"scroll-pl":[{"scroll-pl":y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",at,Qe]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[Re,st,et,tt]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function kt(...e){return wt(function(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=le(e))&&(n&&(n+=" "),n+=t);return n}(e))}const Ct={background:"0 0% 100%",foreground:"240 10% 3.9%",card:"0 0% 100%",cardForeground:"240 10% 3.9%",primary:"160 84% 39%",primaryForeground:"0 0% 100%",muted:"240 4.8% 95.9%",mutedForeground:"240 3.8% 46.1%",border:"240 5.9% 90%",destructive:"0 84.2% 60.2%",radius:"0.5rem",spacing1:"0.25rem",spacing2:"0.5rem",spacing3:"0.75rem",spacing4:"1rem",spacing5:"0.75rem",spacing6:"1.5rem",spacing8:"2rem"},Nt="hsl(160, 84%, 39%)";function Mt(e,t){const r={...Ct,...t?.cssVariables||{},...e?.cssVariables||{}};return{primaryColor:e?.primaryColor||t?.primaryColor||Nt,botName:e?.botName||t?.botName||"BotUyo",logoUrl:e?.logoUrl||t?.logoUrl||"",position:e?.position||t?.position||"bottom-right",welcomeMessage:e?.welcomeMessage||t?.welcomeMessage||"¡Hola! ¿En qué puedo ayudarte?",inputPlaceholder:e?.inputPlaceholder||t?.inputPlaceholder||"Escribe un mensaje...",cssVariables:r,isHidden:e?.isHidden??t?.isHidden??!1}}function zt(e){return e.primaryColor||Nt}const St={enabled:!0,messageEntry:"spring",typingIndicator:"wave",buttonEffects:!0,smoothScroll:!0,speedMultiplier:1,staggerDelay:50,windowTransitions:!0,launcherPulse:!0},Et={glassmorphism:!0,gradients:!0,softShadows:!0,glowEffects:!0,particles:!1,soundEffects:!1,hapticFeedback:!0,shimmerLoading:!0,hoverLift:!0},jt=r(St),At=r(Et);function _t({children:e,animations:t,effects:r}){const n=c(()=>({...St,...t}),[t]),o=c(()=>({...Et,...r}),[r]);/* @__PURE__ */
2
- return g(jt.Provider,{value:n,children:/* @__PURE__ */g(At.Provider,{value:o,children:e})})}function It(){return a(jt)}function Ft(){const e=a(At);return{getGlassClass:()=>e.glassmorphism?"backdrop-blur-md bg-white/80 dark:bg-black/80":"",getShadowClass:()=>e.softShadows?"shadow-soft-xl":"shadow-md",getGlowClass:()=>e.glowEffects?"hover:shadow-primary/20":"",getHoverLiftClass:()=>e.hoverLift?"hover:-translate-y-1 hover:shadow-lg transition-all":"",getGradientClass:()=>e.gradients?"bg-gradient-to-br from-primary/10 to-transparent":"",getShimmerClass:()=>e.shimmerLoading?"animate-shimmer":"animate-pulse",triggerHaptic:()=>{e.hapticFeedback&&"vibrate"in navigator&&navigator.vibrate(10)},playSound:t=>{e.soundEffects&&console.log(`[Sound] ${t}`)},triggerParticles:t=>{e.particles&&console.log("[Particles] triggered on",t)}}}function $t(){return"undefined"!=typeof window&&!!window.DEBUG}const Lt={log:(e,...t)=>{$t()&&console.log(`[BotUyo] ${e}`,...t)},warn:(e,...t)=>{$t()&&console.warn(`[BotUyo] ${e}`,...t)},error:(e,...t)=>{console.error(`[BotUyo] ${e}`,...t)},debug:(e,...t)=>{$t()},info:(e,...t)=>{$t()&&console.info(`[BotUyo] ${e}`,...t)}},Tt=`data:image/svg+xml,${encodeURIComponent('\n<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">\n <defs>\n <linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">\n <stop offset="0%" style="stop-color:#10b981"/>\n <stop offset="100%" style="stop-color:#059669"/>\n </linearGradient>\n </defs>\n <circle cx="32" cy="32" r="32" fill="url(#bg)"/>\n <rect x="16" y="20" width="32" height="24" rx="4" fill="white"/>\n <circle cx="24" cy="30" r="3" fill="#10b981"/>\n <circle cx="40" cy="30" r="3" fill="#10b981"/>\n <rect x="22" y="36" width="20" height="3" rx="1.5" fill="#10b981"/>\n <rect x="28" y="12" width="8" height="8" rx="2" fill="white"/>\n</svg>\n')}`,Ot=function(){const e=Math.floor(1200),t=2*e,r=44+t,n=new ArrayBuffer(r),o=new DataView(n);Dt(o,0,"RIFF"),o.setUint32(4,r-8,!0),Dt(o,8,"WAVE"),Dt(o,12,"fmt "),o.setUint32(16,16,!0),o.setUint16(20,1,!0),o.setUint16(22,1,!0),o.setUint32(24,8e3,!0),o.setUint32(28,16e3,!0),o.setUint16(32,2,!0),o.setUint16(34,16,!0),Dt(o,36,"data"),o.setUint32(40,t,!0);for(let i=0;i<e;i++){const t=i/8e3,r=1-i/e,n=Math.sin(2*Math.PI*880*t)*r*.5*32767;o.setInt16(44+2*i,n,!0)}const a=new Uint8Array(n);let s="";for(let i=0;i<a.length;i++)s+=String.fromCharCode(a[i]);return`data:audio/wav;base64,${btoa(s)}`}();function Dt(e,t,r){for(let n=0;n<r.length;n++)e.setUint8(t+n,r.charCodeAt(n))}function Ut(e,t,r){let n,o=r.initialDeps??[],a=!0;function s(){var s,i,l;let c;r.key&&(null==(s=r.debug)?void 0:s.call(r))&&(c=Date.now());const d=e();if(d.length===o.length&&!d.some((e,t)=>o[t]!==e))return n;let u;if(o=d,r.key&&(null==(i=r.debug)?void 0:i.call(r))&&(u=Date.now()),n=t(...d),r.key&&(null==(l=r.debug)?void 0:l.call(r))){const e=Math.round(100*(Date.now()-c))/100,t=Math.round(100*(Date.now()-u))/100,n=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*n,120))}deg 100% 31%);`,null==r?void 0:r.key)}return!(null==r?void 0:r.onChange)||a&&r.skipInitialOnChange||r.onChange(n),a=!1,n}return s.updateDeps=e=>{o=e},s}function Wt(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const Pt=(e,t,r)=>{let n;return function(...o){e.clearTimeout(n),n=e.setTimeout(()=>t.apply(this,o),r)}},Rt=e=>{const{offsetWidth:t,offsetHeight:r}=e;return{width:t,height:r}},Bt=e=>e,Vt=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let o=t;o<=r;o++)n.push(o);return n},Ht=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;const o=e=>{const{width:r,height:n}=e;t({width:Math.round(r),height:Math.round(n)})};if(o(Rt(r)),!n.ResizeObserver)return()=>{};const a=new n.ResizeObserver(t=>{const n=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void o({width:t.inlineSize,height:t.blockSize})}o(Rt(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(n):n()});return a.observe(r,{box:"border-box"}),()=>{a.unobserve(r)}},qt={passive:!0},Gt="undefined"==typeof window||"onscrollend"in window,Kt=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;let o=0;const a=e.options.useScrollendEvent&&Gt?()=>{}:Pt(n,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=n=>()=>{const{horizontal:s,isRtl:i}=e.options;o=s?r.scrollLeft*(i?-1:1):r.scrollTop,a(),t(o,n)},i=s(!0),l=s(!1);r.addEventListener("scroll",i,qt);const c=e.options.useScrollendEvent&&Gt;return c&&r.addEventListener("scrollend",l,qt),()=>{r.removeEventListener("scroll",i),c&&r.removeEventListener("scrollend",l)}},Zt=(e,t,r)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return Math.round(e[r.options.horizontal?"inlineSize":"blockSize"])}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},Yt=(e,{adjustments:t=0,behavior:r},n)=>{var o,a;const s=e+t;null==(a=null==(o=n.scrollElement)?void 0:o.scrollTo)||a.call(o,{[n.options.horizontal?"left":"top"]:s,behavior:r})};class Jt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=/* @__PURE__ */new Map,this.laneAssignments=/* @__PURE__ */new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=/* @__PURE__ */new Map,this.observer=/* @__PURE__ */(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{const t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var r;null==(r=t())||r.disconnect(),e=null},observe:e=>{var r;return null==(r=t())?void 0:r.observe(e,{box:"border-box"})},unobserve:e=>{var r;return null==(r=t())?void 0:r.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,r])=>{void 0===r&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Bt,rangeExtractor:Vt,onChange:()=>{},measureElement:Zt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,r;null==(r=(t=this.options).onChange)||r.call(t,this,e)},this.maybeNotify=Ut(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{const r=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map;for(let o=t-1;o>=0;o--){const t=e[o];if(r.has(t.lane))continue;const a=n.get(t.lane);if(null==a||t.end>a.end?n.set(t.lane,t):t.end<a.end&&r.set(t.lane,!0),r.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=Ut(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,r,n,o,a)=>(void 0!==this.prevLanes&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:r,getItemKey:n,enabled:o,lanes:a}),{key:!1}),this.getMeasurements=Ut(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:r,getItemKey:n,enabled:o,lanes:a},s)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const d of this.laneAssignments.keys())d>=e&&this.laneAssignments.delete(d);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));const i=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);const l=this.measurementsCache.slice(0,i),c=new Array(a).fill(void 0);for(let d=0;d<i;d++){const e=l[d];e&&(c[e.lane]=d)}for(let d=i;d<e;d++){const e=n(d),o=this.laneAssignments.get(d);let a,i;if(void 0!==o&&this.options.lanes>1){a=o;const e=c[a],n=void 0!==e?l[e]:void 0;i=n?n.end+this.options.gap:t+r}else{const e=1===this.options.lanes?l[d-1]:this.getFurthestMeasurement(l,d);i=e?e.end+this.options.gap:t+r,a=e?e.lane:d%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(d,a)}const u=s.get(e),h="number"==typeof u?u:this.options.estimateSize(d),m=i+h;l[d]={index:d,start:i,size:h,end:m,key:e,lane:a},c[a]=d}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Ut(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,r,n)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:r,lanes:n}){const o=e.length-1;if(e.length<=n)return{startIndex:0,endIndex:o};let a=Xt(0,o,t=>e[t].start,r),s=a;if(1===n)for(;s<o&&e[s].end<r+t;)s++;else if(n>1){const i=Array(n).fill(0);for(;s<o&&i.some(e=>e<r+t);){const t=e[s];i[t.lane]=t.end,s++}const l=Array(n).fill(r+t);for(;a>=0&&l.some(e=>e>=r);){const t=e[a];l[t.lane]=t.start,a--}a=Math.max(0,a-a%n),s=Math.min(o,s+(n-1-s%n))}return{startIndex:a,endIndex:s}}({measurements:e,outerSize:t,scrollOffset:r,lanes:n}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ut(()=>{let e=null,t=null;const r=this.calculateRange();return r&&(e=r.startIndex,t=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,r,n,o)=>null===n||null===o?[]:e({startIndex:n,endIndex:o,overscan:t,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,r=e.getAttribute(t);return r?parseInt(r,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const r=this.indexFromElement(e),n=this.measurementsCache[r];if(!n)return;const o=n.key,a=this.elementsCache.get(o);a!==e&&(a&&this.observer.unobserve(a),this.observer.observe(e),this.elementsCache.set(o,e)),e.isConnected&&this.resizeItem(r,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{const r=this.measurementsCache[e];if(!r)return;const n=t-(this.itemSizeCache.get(r.key)??r.size);0!==n&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(r,n,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))})},this.getVirtualItems=Ut(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{const r=[];for(let n=0,o=e.length;n<o;n++){const o=t[e[n]];r.push(o)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return Wt(t[Xt(0,t.length-1,e=>Wt(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,r=0)=>{if(!this.scrollElement)return 0;const n=this.getSize(),o=this.getScrollOffset();"auto"===t&&(t=e>=o+n?"end":"start"),"center"===t?e+=(r-n)/2:"end"===t&&(e-=n);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const r=this.measurementsCache[e];if(!r)return;const n=this.getSize(),o=this.getScrollOffset();if("auto"===t)if(r.end>=o+n-this.options.scrollPaddingEnd)t="end";else{if(!(r.start<=o+this.options.scrollPaddingStart))return[o,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];const a="end"===t?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,r.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t="start",behavior:r}={})=>{"smooth"===r&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:r})},this.scrollToIndex=(e,{align:t="auto",behavior:r}={})=>{"smooth"===r&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1)),this.currentScrollToIndex=e;let n=0;const o=t=>{if(!this.targetWindow)return;const n=this.getOffsetForIndex(e,t);if(!n)return void console.warn("Failed to get offset for index:",e);const[o,s]=n;this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const t=()=>{if(this.currentScrollToIndex!==e)return;const t=this.getScrollOffset(),r=this.getOffsetForIndex(e,s);var n,o;r?(n=r[0],o=t,Math.abs(n-o)<1.01||a(s)):console.warn("Failed to get offset for index:",e)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(t):t()})},a=t=>{this.targetWindow&&this.currentScrollToIndex===e&&(n++,n<10?this.targetWindow.requestAnimationFrame(()=>o(t)):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};o(t)},this.scrollBy=(e,{behavior:t}={})=>{"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let r;if(0===t.length)r=this.options.paddingStart;else if(1===this.options.lanes)r=(null==(e=t[t.length-1])?void 0:e.end)??0;else{const e=Array(this.options.lanes).fill(null);let n=t.length-1;for(;n>=0&&e.some(e=>null===e);){const r=t[n];null===e[r.lane]&&(e[r.lane]=r.end),n--}r=Math.max(...e.filter(e=>null!==e))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:r})=>{this.options.scrollToFn(e,{behavior:r,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=/* @__PURE__ */new Map,this.laneAssignments=/* @__PURE__ */new Map,this.notify(!1)},this.setOptions(e)}}const Xt=(e,t,r,n)=>{for(;e<=t;){const o=(e+t)/2|0,a=r(o);if(a<n)e=o+1;else{if(!(a>n))return o;t=o-1}}return e>0?e-1:0},Qt="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;const er=h(()=>import("./chunk-audio-BI6-EeUY.js").then(e=>({default:e.AudioPlayer}))),tr=h(()=>import("./chunk-gallery-Bz3WiOp4.js").then(e=>({default:e.Gallery}))),rr=d(function({message:e,primaryColor:t,botAvatar:r,botName:n="BotUyo",avatars:o,isFirst:s=!0,isLast:i=!0,index:l=0}){const{t:d}=j("extracted"),h="user"===e.sender,m="system"===e.type||"system"===e.sender,p=!h&&!m,x=zt({primaryColor:t}),k=function(){const e=a(jt);return e.enabled&&"none"!==e.messageEntry?{slide:"animate-message-slide",fade:"animate-message-fade",scale:"animate-message-scale",spring:"animate-message-spring"}[e.messageEntry]||"animate-message-spring":""}(),C=c(()=>{if(h)return null;if("text"===e.type){const t=e;if(t.emotion&&o?.[t.emotion])return o[t.emotion]}return r},[e,o,r,h]),N=({href:e,children:t})=>{if(!e)return null;const r=String(t).toLowerCase(),n=r.includes("reservar")||r.includes("ver")||r.includes("pagar");return e.includes("maps.google")||e.includes("goo.gl")||e.includes("google.com/maps")?/* @__PURE__ */g("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"block my-2 no-underline group",children:/* @__PURE__ */f("span",{className:"flex items-center gap-3 p-3 border rounded-xl shadow-sm group-hover:border-primary/30 transition-all",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"},children:[
3
- /* @__PURE__ */g("span",{className:"flex-shrink-0 p-2 rounded-full",style:{backgroundColor:`${x}1a`,color:x},children:/* @__PURE__ */g(q,{size:16,strokeWidth:2.5})}),
4
- /* @__PURE__ */g("span",{className:"flex flex-col min-w-0 flex-1 text-[11px] font-bold text-foreground leading-tight uppercase tracking-tight",children:d("ver_ubicacion")}),
5
- /* @__PURE__ */g(W,{size:12,className:"text-muted-foreground/40 group-hover:text-primary"})]})}):n?/* @__PURE__ */f("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 px-5 py-2.5 mt-2 text-[11px] font-black w-full sm:w-auto rounded-xl shadow-md uppercase tracking-widest transition-transform active:scale-95 text-white",style:{backgroundColor:x},children:[t," ",
6
- /* @__PURE__ */g($,{size:14})]}):/* @__PURE__ */g("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"font-bold underline decoration-primary/30 hover:decoration-primary transition-all",style:{color:h?"inherit":x},children:t})},M=({src:e,alt:t})=>e?/* @__PURE__ */g(u,{fallback:/* @__PURE__ */g("div",{className:"my-3 animate-pulse",children:/* @__PURE__ */g("div",{className:"w-full h-48 bg-muted rounded-xl"})}),children:/* @__PURE__ */g(tr,{images:[{src:e,alt:t}],radius:"rounded-xl"})}):null;return m?/* @__PURE__ */g("div",{className:"flex justify-center my-4 animate-in fade-in zoom-in-95 w-full",children:/* @__PURE__ */g("span",{className:"px-3 py-1 border rounded-full text-[9px] font-black uppercase tracking-widest",style:{backgroundColor:"hsl(var(--muted))",borderColor:"hsl(var(--border))",color:"hsl(var(--muted-foreground))"},children:e.content})}):/* @__PURE__ */f("div",{className:kt("flex w-full mb-0.5 group",k,h?"justify-end":"justify-start gap-3",s&&"mt-3",i&&"mb-3"),style:{animationDelay:50*l+"ms"},children:[!h&&/* @__PURE__ */g("div",{className:"w-9 shrink-0 flex flex-col justify-end pb-1",children:/* @__PURE__ */g("div",i?{className:"h-9 w-9 rounded-full overflow-hidden border shadow-sm",style:{borderColor:"hsl(var(--border))",backgroundColor:"hsl(var(--background))"},children:C?/* @__PURE__ */g("img",{src:C,alt:n,className:"h-full w-full object-cover"}):/* @__PURE__ */g("div",{className:"h-full w-full flex items-center justify-center text-white text-[10px] font-black uppercase",style:{backgroundColor:x},children:n.charAt(0)})}:{className:"w-9"})}),
7
- /* @__PURE__ */f("div",{className:kt("max-w-[85%] shadow-sm transition-all duration-300 relative",h?"text-primary-foreground":"border",h?kt("rounded-[18px]",s&&"rounded-tr-[4px]",!i&&"rounded-br-[4px]",!s&&!i&&"rounded-r-[4px]"):kt("rounded-[18px]",s&&"rounded-tl-[4px]",!i&&"rounded-bl-[4px]",!s&&!i&&"rounded-l-[4px]")),style:h?{padding:"var(--spacing-4) var(--spacing-5)",backgroundColor:x,boxShadow:i?`0 8px 20px -6px ${x}33`:"none"}:{padding:"var(--spacing-4) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border) / 0.6)",color:"hsl(var(--foreground))"},children:[(()=>{switch(e.type){case"audio":/* @__PURE__ */
8
- return g(u,{fallback:/* @__PURE__ */f("div",{className:"flex items-center gap-3 py-1 min-w-[200px] animate-pulse",children:[
9
- /* @__PURE__ */g("div",{className:"w-8 h-8 rounded-full bg-muted"}),
10
- /* @__PURE__ */g("div",{className:"flex-1 space-y-1",children:/* @__PURE__ */g("div",{className:"h-1 w-full bg-muted rounded-full"})})]}),children:/* @__PURE__ */g(er,{url:e.content,isBot:p,primaryColor:t})});case"image":{const t=e;/* @__PURE__ */
11
- return g(u,{fallback:/* @__PURE__ */g("div",{className:"my-3 animate-pulse",children:/* @__PURE__ */g("div",{className:"w-full h-48 bg-muted rounded-xl"})}),children:/* @__PURE__ */g(tr,{images:[{src:t.imageUrl||t.content,alt:t.altText||"Imagen"}],radius:"rounded-xl"})})}case"location":{const t=e;/* @__PURE__ */
12
- return g(N,{href:`https://www.google.com/maps/search/?api=1&query=${t.latitude},${t.longitude}`,children:"Ver ubicación"})}case"file":{const t=e,r=t.fileName?.split(".").pop()?.toLowerCase()||"",n=t.fileSize?`${(t.fileSize/1024/1024).toFixed(2)} MB`:"";/* @__PURE__ */
13
- return f("a",{href:t.fileUrl,download:t.fileName,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 border rounded-xl transition-all hover:scale-[1.02] group",style:{backgroundColor:h?"rgba(255,255,255,0.1)":"hsl(var(--muted))",borderColor:h?"rgba(255,255,255,0.2)":"hsl(var(--border))"},children:[
14
- /* @__PURE__ */g("div",{className:"flex items-center justify-center w-10 h-10 rounded-lg shrink-0",style:{backgroundColor:h?"rgba(255,255,255,0.2)":`${x}1a`,color:h?"white":x},children:/* @__PURE__ */g(P,{size:20,strokeWidth:2.5})}),
15
- /* @__PURE__ */f("div",{className:"flex-1 min-w-0",children:[
16
- /* @__PURE__ */g("p",{className:"text-sm font-bold truncate",children:t.fileName}),n&&/* @__PURE__ */f("p",{className:"text-xs opacity-60 mt-0.5",children:[r?.toUpperCase()," • ",n]})]}),
17
- /* @__PURE__ */g(U,{size:18,className:"shrink-0 opacity-60 group-hover:opacity-100 transition-opacity"})]})}default:{const t=e.content||"",r=/!\[([^\]]*)\]\(([^)]+)\)/g,n=[];let o;for(;null!==(o=r.exec(t));)n.push({src:o[2],alt:o[1]||"Foto"});const a=n.length>1?t.replace(/!\[[^\]]*\]\([^)]+\)/g,"").replace(/---\s*\n?\s*---/g,"").trim():t;/* @__PURE__ */
18
- return f(b,{children:[n.length>1&&/* @__PURE__ */g(u,{fallback:/* @__PURE__ */g("div",{className:"my-3 animate-pulse",children:/* @__PURE__ */g("div",{className:"w-full h-48 bg-muted rounded-xl"})}),children:/* @__PURE__ */g(tr,{images:n,radius:"rounded-xl"})}),a&&/* @__PURE__ */g("div",{className:kt("prose prose-sm max-w-none break-words leading-relaxed dark:prose-invert",h?"text-primary-foreground prose-p:text-white":"text-foreground"),children:/* @__PURE__ */g(v,{remarkPlugins:[w],rehypePlugins:[[y,{tagNames:["p","a","img","strong","em","ul","ol","li","br","span"],attributes:{a:["href","target","rel"],img:["src","alt"],span:["className"]},protocols:{a:{href:["http","https","mailto","tel"]},img:{src:["http","https","data"]}}}]],components:{a:N,img:M,p:({children:e})=>/* @__PURE__ */g("p",{className:"mb-0 last:mb-0",children:e})},children:a})})]})}}})(),i&&/* @__PURE__ */f("div",{className:kt("flex items-center gap-1 mt-1.5 opacity-50 select-none text-[9px]",h?"justify-end":"justify-start"),children:[
19
- /* @__PURE__ */g("span",{className:"font-bold tabular-nums uppercase tracking-tighter",children:(e=>{const t=new Date(e);return isNaN(t.getTime())?"":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})})(e.timestamp)}),h&&/* @__PURE__ */g(L,{className:"h-2.5 w-2.5"})]})]})]})},(e,t)=>e.message.id===t.message.id&&e.message.timestamp===t.message.timestamp&&e.primaryColor===t.primaryColor&&e.botAvatar===t.botAvatar&&e.botName===t.botName&&e.isFirst===t.isFirst&&e.isLast===t.isLast&&JSON.stringify(e.styles)===JSON.stringify(t.styles)),nr=d(function(){/* @__PURE__ */
20
- return g("div",{style:{display:"flex",alignItems:"center",alignSelf:"flex-start",maxWidth:"85%",animation:"message-fade 0.2s ease-out forwards"},children:/* @__PURE__ */g("div",{style:{backgroundColor:"hsl(var(--card, 0 0% 100%))",border:"1px solid hsl(var(--border, 0 0% 90%))",borderRadius:"18px",borderTopLeftRadius:"4px",padding:"14px 20px",boxShadow:"0 1px 3px rgba(0,0,0,0.06)"},children:/* @__PURE__ */g("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[0,1,2].map(e=>/* @__PURE__ */g("span",{className:"animate-typing-dots",style:{display:"inline-block",height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"hsl(var(--primary, 250 84% 54%) / 0.6)",animationDelay:200*e+"ms"}},e))})})})});function or(e,t){const r=e.getTime()-t.getTime();return Math.floor(r/1e3/60)}function ar(e){return new Intl.DateTimeFormat("es-ES",{hour:"2-digit",minute:"2-digit"}).format(e)}const sr=d(function({messages:r,isTyping:a,welcomeMessage:s="¡Hola! ¿En qué puedo ayudarte?",primaryColor:i,logoUrl:l,botName:c="BotUyo",bubbleStyles:d,avatars:u}){const h=m(null),p=m(null),[b,v]=n(!1),[y,w]=n(!1),k=zt({primaryColor:i}),C=r.length>100,N=(M={count:r.length,getScrollElement:()=>p.current,estimateSize:()=>80,overscan:5,enabled:C},function({useFlushSync:t=!0,...r}){const n=e.useReducer(()=>({}),{})[1],o={...r,onChange:(e,o)=>{var a;t&&o?x(n):n(),null==(a=r.onChange)||a.call(r,e,o)}},[a]=e.useState(()=>new Jt(o));return a.setOptions(o),Qt(()=>a._didMount(),[]),Qt(()=>a._willUpdate()),a}({observeElementRect:Ht,observeElementOffset:Kt,scrollToFn:Yt,...M}));var M;o(()=>{v(!0)},[]),o(()=>{if(b&&(r.length>0||a)){const e=setTimeout(()=>{C?N.scrollToIndex(r.length-1,{align:"end",behavior:r.length<=1?"auto":"smooth"}):h.current?.scrollIntoView({behavior:r.length<=1?"auto":"smooth",block:"end"})},100);return()=>clearTimeout(e)}},[r.length,a,b,C,N]);const z=e=>{const t=new Date(e);return isNaN(t.getTime())?"":function(e){return function(e){const t=/* @__PURE__ */new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}(e)?`Hoy, ${ar(e)}`:function(e){const t=/* @__PURE__ */new Date;return t.setDate(t.getDate()-1),e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}(e)?`Ayer, ${ar(e)}`:function(e){return new Intl.DateTimeFormat("es-ES",{day:"numeric",month:"long",hour:"2-digit",minute:"2-digit"}).format(e)}(e)}(t)};return b?/* @__PURE__ */f("div",C?{ref:p,className:"flex-1 overflow-y-auto scroll-smooth bg-background/50 scrollbar-none",style:{padding:"var(--spacing-5)"},children:[
21
- /* @__PURE__ */g("div",{style:{height:`${N.getTotalSize()}px`,width:"100%",position:"relative"},children:N.getVirtualItems().map(e=>{const t=r[e.index],n=e.index,o=r[n-1],a=r[n+1],s=o&&or(new Date(t.timestamp),new Date(o.timestamp))>15,h=o&&o.sender===t.sender&&or(new Date(t.timestamp),new Date(o.timestamp))<5&&!s,m=a&&a.sender===t.sender&&or(new Date(a.timestamp),new Date(t.timestamp))<5;/* @__PURE__ */
22
- return f("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${e.start}px)`},children:[s&&/* @__PURE__ */g("div",{className:"flex justify-center my-8 animate-in fade-in zoom-in-95",children:/* @__PURE__ */g("span",{className:"px-4 py-1.5 bg-muted/40 backdrop-blur-md rounded-full text-[10px] font-black text-muted-foreground uppercase tracking-[0.2em] border border-border/50 shadow-sm",children:z(t.timestamp)})}),
23
- /* @__PURE__ */g(rr,{message:t,primaryColor:i,botAvatar:l,botName:c,styles:d,avatars:u,isFirst:!h,isLast:!m})]},e.key)})}),a&&/* @__PURE__ */f("div",{className:"flex items-end gap-3 mt-4 mb-2 animate-in fade-in slide-in-from-left-4 duration-500",children:[
24
- /* @__PURE__ */g("div",{className:"w-8 h-8 rounded-xl bg-muted/60 border border-border/50 flex items-center justify-center shrink-0 shadow-soft-sm",children:/* @__PURE__ */f("div",{className:"flex gap-[2px]",children:[
25
- /* @__PURE__ */g("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.3s]"}),
26
- /* @__PURE__ */g("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.15s]"}),
27
- /* @__PURE__ */g("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce"})]})}),
28
- /* @__PURE__ */g(nr,{})]})]}:{ref:p,className:"flex-1 overflow-y-auto scroll-smooth p-4 bg-background/50 scrollbar-none",children:[
29
- /* @__PURE__ */f("div",{className:"min-h-full flex flex-col justify-end",children:[0===r.length&&/* @__PURE__ */f("div",{className:"flex-1 flex flex-col items-center justify-center py-16 text-center animate-in fade-in zoom-in-95 duration-1000",children:[
30
- /* @__PURE__ */f("div",{className:"relative h-24 w-24 mb-6",children:[
31
- /* @__PURE__ */g("div",{className:"absolute inset-0 bg-primary/20 rounded-full animate-pulse blur-2xl"}),
32
- /* @__PURE__ */g("div",{className:"relative h-full w-full rounded-[28px] border-2 border-primary/20 overflow-hidden bg-card shadow-soft-2xl transition-transform hover:scale-105 duration-500",children:y?/* @__PURE__ */g("div",{className:"h-full w-full flex items-center justify-center text-3xl",style:{backgroundColor:k},children:"👋"}):l?/* @__PURE__ */g("img",{src:l,className:"object-cover h-full w-full",alt:c,onError:()=>w(!0)}):/* @__PURE__ */g("div",{className:"h-full w-full flex items-center justify-center text-3xl",style:{backgroundColor:k},children:"👋"})})]}),
33
- /* @__PURE__ */f("div",{className:"space-y-2",children:[
34
- /* @__PURE__ */g("h3",{className:"font-black text-xl text-foreground uppercase tracking-tighter italic",children:c}),
35
- /* @__PURE__ */f("p",{className:"text-[12px] font-bold text-muted-foreground italic px-10 leading-relaxed opacity-60",children:['"',s,'"']})]})]}),
36
- /* @__PURE__ */g("div",{className:"flex flex-col",style:{gap:"var(--spacing-3)"},children:r.map((e,n)=>{const o=r[n-1],a=r[n+1],s=o&&or(new Date(e.timestamp),new Date(o.timestamp))>15,h=o&&o.sender===e.sender&&or(new Date(e.timestamp),new Date(o.timestamp))<5&&!s,m=a&&a.sender===e.sender&&or(new Date(a.timestamp),new Date(e.timestamp))<5;/* @__PURE__ */
37
- return f(t.Fragment,{children:[s&&/* @__PURE__ */g("div",{className:"flex justify-center my-8 animate-in fade-in zoom-in-95",children:/* @__PURE__ */g("span",{className:"px-4 py-1.5 bg-muted/40 backdrop-blur-md rounded-full text-[10px] font-black text-muted-foreground uppercase tracking-[0.2em] border border-border/50 shadow-sm",children:z(e.timestamp)})}),
38
- /* @__PURE__ */g(rr,{message:e,primaryColor:i,botAvatar:l,botName:c,styles:d,avatars:u,isFirst:!h,isLast:!m})]},e.id||`msg-${n}`)})}),
39
- /* @__PURE__ */g("div",{ref:h,className:"h-6 shrink-0"})]}),a&&/* @__PURE__ */f("div",{className:"flex items-end gap-3 mt-4 mb-2 animate-in fade-in slide-in-from-left-4 duration-500",children:[
40
- /* @__PURE__ */g("div",{className:"w-8 h-8 rounded-xl bg-muted/60 border border-border/50 flex items-center justify-center shrink-0 shadow-soft-sm",children:/* @__PURE__ */f("div",{className:"flex gap-[2px]",children:[
41
- /* @__PURE__ */g("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.3s]"}),
42
- /* @__PURE__ */g("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.15s]"}),
43
- /* @__PURE__ */g("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce"})]})}),
44
- /* @__PURE__ */g(nr,{})]})]}):/* @__PURE__ */g("div",{className:"flex-1 bg-background"})},(e,t)=>{if(e.messages.length!==t.messages.length)return!1;if(e.isTyping!==t.isTyping)return!1;if(e.primaryColor!==t.primaryColor)return!1;if(e.botName!==t.botName)return!1;if(e.logoUrl!==t.logoUrl)return!1;const r=e.messages[e.messages.length-1],n=t.messages[t.messages.length-1];return r?.id===n?.id}),ir={"image/jpeg":[255,216,255],"image/png":[137,80,78,71,13,10,26,10],"image/webp":[82,73,70,70],"image/gif":[71,73,70,56],"audio/mpeg":[255,251],"audio/wav":[82,73,70,70],"audio/webm":[26,69,223,163],"audio/ogg":[79,103,103,83]};async function lr(e,t={}){const{maxSizeMB:r=10,allowedExtensions:n,checkMagicBytes:o=!0}=t;if(!function(e,t=10){const r=1024*t*1024;return e.size<=r}(e,r))return{valid:!1,error:`El archivo es demasiado grande. Máximo ${r}MB`};if(n&&!function(e,t){const r=e.name.split(".").pop()?.toLowerCase();return!!r&&t.includes(r)}(e,n))return{valid:!1,error:`Extensión no permitida. Solo: ${n.join(", ")}`};if(o){const t=await async function(e){try{const t=ir[e.type];if(!t)return!0;const r=await e.slice(0,12).arrayBuffer(),n=new Uint8Array(r);return t.every((e,t)=>n[t]===e)}catch(t){return console.error("File validation error:",t),!1}}(e);if(!t)return{valid:!1,error:"El archivo está corrupto o no es del tipo indicado"}}return{valid:!0}}const cr=1e3,dr={enableImages:!0,enableAudio:!0,enableFiles:!0,enableLocation:!0,allowedFileTypes:["jpg","jpeg","png","webp","gif","pdf","doc","docx","txt","zip"],maxFileSizeMB:10};function ur({isConnected:e,placeholder:t="Escribe un mensaje...",primaryColor:r,mediaConfig:o,onSendMessage:a,onSendAttachment:s,onSendLocation:i,onVoiceCall:l}){const{t:d}=j(),[u,h]=n(""),[p,x]=n(!1),[v,y]=n(!1),[w,k]=n(0),[C,N]=n(null),[M,z]=n(!1),[S,E]=n(!1),A=m(null),_=m(null),I=m(null),F=m(null),$=m([]),L=m(null),T=zt({primaryColor:r}),O=c(()=>({...dr,...o}),[o]),D=c(()=>O.enableImages||O.enableAudio||O.enableFiles||O.enableLocation,[O]),U=()=>{const t=u.trim();C?(s?.(C.file,C.type),N(null),h("")):t&&e&&(a(t),h("")),A.current&&(A.current.style.height="40px",requestAnimationFrame(()=>A.current?.focus()))},W=async e=>{const t=e.target.files?.[0];if(!t)return;x(!1);const r=await lr(t,{maxSizeMB:O.maxFileSizeMB||10,allowedExtensions:O.allowedFileTypes||["jpg","jpeg","png","webp","gif","pdf","doc","docx","txt","zip"],checkMagicBytes:!0});if(r.valid)if(t.type.startsWith("image/")&&O.enableImages){z(!0);try{const{default:e}=await import("./browser-image-compression-CsxM8KJN.js"),r={maxSizeMB:.8,maxWidthOrHeight:1200,useWebWorker:!0},n=await e(t,r);N({type:"image",file:n,previewUrl:URL.createObjectURL(n)})}catch(n){Lt.error("Image compression failed:",n),N({type:"image",file:t,previewUrl:URL.createObjectURL(t)})}finally{z(!1)}}else N({type:"file",file:t,previewUrl:""});else alert(r.error||"Archivo no válido")},R=async e=>{if(F.current&&(e||(F.current.onstop=null),F.current.stop(),F.current.stream.getTracks().forEach(e=>e.stop())),L.current&&clearInterval(L.current),y(!1),k(0),e&&$.current.length>0){const e=new Blob($.current,{type:"audio/webm"}),t=new File([e],`audio-${Date.now()}.webm`,{type:"audio/webm"}),r=await lr(t,{maxSizeMB:10});if(!r.valid)return Lt.error("Audio validation failed:",r.error),alert(r.error),void($.current=[]);s?.(t,"audio"),$.current=[]}};/* @__PURE__ */
45
- return f("div",{className:"relative",children:[(C||M)&&/* @__PURE__ */g("div",{className:"absolute bottom-full left-0 mb-2 p-2 rounded-2xl border shadow-soft-2xl animate-in slide-in-from-bottom-2 z-50",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"},children:/* @__PURE__ */g("div",{className:"relative w-16 h-16",children:M?/* @__PURE__ */g("div",{className:"w-full h-full flex flex-col items-center justify-center bg-muted rounded-xl",children:/* @__PURE__ */g(H,{className:"animate-spin text-primary h-5 w-5"})}):/* @__PURE__ */f(b,"image"===C?.type?{children:[
46
- /* @__PURE__ */g("img",{src:C?.previewUrl,className:"w-full h-full object-cover rounded-xl border",alt:d("preview")}),
47
- /* @__PURE__ */g("button",{onClick:()=>N(null),className:"absolute -top-1.5 -right-1.5 bg-destructive text-white rounded-full p-1 shadow-md hover:scale-105",children:/* @__PURE__ */g(se,{size:10,strokeWidth:3})})]}:{children:[
48
- /* @__PURE__ */f("div",{className:"w-full h-full flex flex-col items-center justify-center bg-muted rounded-xl border",children:[
49
- /* @__PURE__ */g(P,{className:"text-primary h-6 w-6"}),
50
- /* @__PURE__ */g("span",{className:"text-[8px] mt-1 font-bold truncate max-w-[60px]",children:C?.file.name})]}),
51
- /* @__PURE__ */g("button",{onClick:()=>N(null),className:"absolute -top-1.5 -right-1.5 bg-destructive text-white rounded-full p-1 shadow-md hover:scale-105",children:/* @__PURE__ */g(se,{size:10,strokeWidth:3})})]})})}),
52
- /* @__PURE__ */g("input",{type:"file",accept:"image/*",className:"hidden",ref:I,onChange:W}),
53
- /* @__PURE__ */g("input",{type:"file",accept:O.allowedFileTypes?.map(e=>`.${e}`).join(","),className:"hidden",ref:_,onChange:W}),
54
- /* @__PURE__ */f("div",{className:"flex items-center max-w-full",style:{gap:"var(--spacing-3)"},children:[D&&s&&/* @__PURE__ */f("div",{className:"relative shrink-0",children:[p&&/* @__PURE__ */f("div",{className:"absolute bottom-full left-0 flex flex-col animate-in fade-in slide-in-from-bottom-2 duration-300 z-[60]",style:{marginBottom:"var(--spacing-2)",gap:"var(--spacing-2)"},children:[O.enableImages&&/* @__PURE__ */f("button",{onClick:()=>I.current?.click(),className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[
55
- /* @__PURE__ */g(B,{size:18,className:"text-blue-500"})," ",d("fotos")]}),O.enableFiles&&/* @__PURE__ */f("button",{onClick:()=>_.current?.click(),className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[
56
- /* @__PURE__ */g(P,{size:18,className:"text-purple-500"})," Archivos"]}),O.enableLocation&&i&&/* @__PURE__ */f("button",{onClick:()=>{E(!0),navigator.geolocation.getCurrentPosition(e=>{i?.({latitude:e.coords.latitude,longitude:e.coords.longitude}),E(!1),x(!1)},()=>E(!1))},className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[S?/* @__PURE__ */g(H,{size:18,className:"animate-spin"}):/* @__PURE__ */g(q,{size:18,className:"text-emerald-500"})," ",d("ubicacion")]}),O.enableVoice&&l&&/* @__PURE__ */f("button",{onClick:()=>{l?.(),x(!1)},className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[
57
- /* @__PURE__ */g(X,{size:18,className:"text-amber-500"})," Llamar"]})]}),
58
- /* @__PURE__ */g("button",{onClick:()=>x(!p),className:kt("h-10 w-10 rounded-full flex items-center justify-center transition-all shadow-sm z-10",p?"bg-muted text-foreground rotate-45":"bg-muted/50 text-muted-foreground hover:bg-muted"),children:/* @__PURE__ */g(ee,{size:22,strokeWidth:2.5})})]}),
59
- /* @__PURE__ */g("div",{className:kt("flex-1 relative flex items-center min-w-0 rounded-[24px] border px-4 transition-all shadow-inner",v?"h-[44px]":"min-h-[40px] max-h-[120px]"),style:{backgroundColor:v?"hsl(var(--destructive) / 0.05)":"hsl(var(--muted))",borderColor:v?"hsl(var(--destructive))":"hsl(var(--border))"},children:/* @__PURE__ */f("div",v?{className:"flex items-center w-full animate-in zoom-in-95",style:{gap:"var(--spacing-4)"},children:[
60
- /* @__PURE__ */g("button",{onClick:()=>R(!1),className:"text-destructive/50 hover:text-destructive",children:/* @__PURE__ */g(oe,{size:18})}),
61
- /* @__PURE__ */f("div",{className:"flex-1 flex items-center",style:{gap:"var(--spacing-2)"},children:[
62
- /* @__PURE__ */g("div",{className:"flex gap-[3px]",children:[1,2,3,4].map(e=>/* @__PURE__ */g("span",{className:"w-[3px] h-3 bg-destructive/60 rounded-full animate-pulse",style:{animationDelay:.15*e+"s"}},e))}),
63
- /* @__PURE__ */f("span",{className:"text-destructive font-black text-[11px] tabular-nums",children:[Math.floor(w/60),":",(w%60).toString().padStart(2,"0")]})]}),
64
- /* @__PURE__ */g("button",{onClick:()=>R(!0),className:"w-7 h-7 rounded-full bg-destructive flex items-center justify-center text-white shadow-lg",children:/* @__PURE__ */g(re,{size:12,fill:"currentColor"})})]}:{className:"w-full relative flex items-center",children:[
65
- /* @__PURE__ */g("textarea",{ref:A,rows:1,value:u,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey?"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),U()):(e.preventDefault(),U())},onChange:e=>{const t=e.target.value.slice(0,cr);h(t),A.current&&(A.current.style.height="40px",A.current.style.height=`${Math.min(A.current.scrollHeight,120)}px`)},onFocus:()=>x(!1),placeholder:t,"aria-label":d("accessibility.typeMessage"),"aria-describedby":"send-message-hint","aria-invalid":u.length>cr,disabled:!e,className:"w-full bg-transparent text-sm py-2.5 outline-none resize-none overflow-hidden leading-tight pr-8 scrollbar-none disabled:opacity-50",style:{scrollbarWidth:"none",msOverflowStyle:"none",color:"hsl(var(--foreground))"}}),
66
- /* @__PURE__ */g("span",{id:"send-message-hint",className:"sr-only",children:d("accessibility.sendMessageHint")}),u.length>800&&/* @__PURE__ */g("span",{className:kt("absolute right-0 text-[9px] font-bold tabular-nums",u.length>=cr?"text-destructive":"text-muted-foreground/40"),children:cr-u.length})]})}),!v&&/* @__PURE__ */g(b,{children:u.trim()||C?/* @__PURE__ */g("button",{onClick:U,disabled:!e||M&&!!C,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:T},children:/* @__PURE__ */g(re,{size:18,className:"text-white ml-0.5 fill-current"})}):O.enableAudio&&s?/* @__PURE__ */g("button",{onClick:async()=>{if(e)try{const e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e);F.current=t,$.current=[],t.ondataavailable=e=>$.current.push(e.data),t.onstop=()=>{const e=new File([new Blob($.current)],"voice.webm",{type:"audio/webm"});s?.(e,"audio")},t.start(),y(!0),L.current=setInterval(()=>k(e=>e+1),1e3)}catch{alert("Micrófono denegado o no disponible")}},disabled:!e,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:T},children:/* @__PURE__ */g(Z,{size:20,strokeWidth:2.5,className:"text-white"})}):/* @__PURE__ */g("button",{onClick:U,disabled:!e,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:T},children:/* @__PURE__ */g(re,{size:18,className:"text-white ml-0.5 fill-current"})})})]})]})}function hr(e,t){let r=0,n=null;return function(...o){const a=Date.now(),s=a-r,i=()=>{r=a,e(...o)};s>=t?(n&&(clearTimeout(n),n=null),i()):n||(n=setTimeout(()=>{i(),n=null},t-s))}}function mr(e=640){const[t,r]=n(()=>"undefined"!=typeof window&&window.innerWidth<e);return o(()=>{const t=hr(()=>{r(window.innerWidth<e)},250);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e]),t}const pr="24px",gr=h(()=>import("./Avatar3D-B2RkgErq.js")),fr={happy:"😊",wink:"😉",thinking:"🤔",sad:"😢",excited:"🤩",love:"❤️",laugh:"😄",surprised:"😲",angry:"😠",confused:"😕",sorry:"😔",default:"💬"},br={idle:"Llamada de voz",connecting:"Conectando...",listening:"Escuchando...",thinking:"Pensando...",speaking:"Hablando..."},xr={tagNames:["p","a","strong","em","ul","ol","li","br","span","code"],attributes:{a:["href","target","rel"],span:["className"],code:["className"]},protocols:{a:{href:["http","https","mailto","tel"]}}},vr=24e3;class yr extends p{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){console.warn("[Avatar3D] Three.js failed, falling back to 2D orb:",e.message),this.props.onError()}render(){return this.state.hasError?null:this.props.children}}function wr({avatars:e,logoUrl:t,avatar3dUrl:r,emotion:o,callState:a,audioLevel:s,config:i}){const l=e&&Object.keys(e).length>0,d=!!t,[h,m]=n(!1),p=c(()=>l||d?l?e[o||"default"]||e.default||t||Tt:t||Tt:null,[l,d,e,o,t]),b="listening"===a||"speaking"===a,x="speaking"===a?i.speakingColor:"thinking"===a?i.thinkingColor:"listening"===a?i.listeningColor:"#ffffff20",v="speaking"===a?i.speakingScale:"thinking"===a?i.thinkingScale:1,y=i.orbSize;/* @__PURE__ */
67
- return f("div",r&&!h?{className:"relative flex flex-col items-center gap-4",children:[
68
- /* @__PURE__ */g(yr,{onError:()=>m(!0),children:/* @__PURE__ */g(u,{fallback:/* @__PURE__ */g("div",{className:"rounded-full flex items-center justify-center animate-pulse",style:{width:`${i.orbSize}px`,height:`${i.orbSize}px`,background:`radial-gradient(circle at 35% 35%, ${i.speakingColor}40, ${i.speakingColor}10 60%, transparent 80%)`,boxShadow:`0 0 30px ${i.speakingColor}15`}}),children:/* @__PURE__ */g(gr,{modelUrl:r,emotion:o,callState:a,audioLevel:s,primaryColor:i.speakingColor,size:i.orbSize})})}),i.showWaveform&&/* @__PURE__ */g(kr,{isActive:"listening"===a||"speaking"===a,audioLevel:s,color:"speaking"===a?i.speakingColor:"thinking"===a?i.thinkingColor:i.listeningColor})]}:p?{className:"relative flex flex-col items-center gap-4",children:[
69
- /* @__PURE__ */f("div",{className:kt("relative rounded-full flex items-center justify-center","transition-all duration-500 ease-out"),style:{width:`${y}px`,height:`${y}px`,boxShadow:b?`0 0 0 4px ${x}40, 0 0 30px ${x}30, 0 0 60px ${x}15`:`0 0 0 2px ${x}20`,transform:`scale(${v})`},children:[
70
- /* @__PURE__ */g("img",{src:p,alt:"Bot avatar",className:kt("h-full w-full rounded-full object-cover","transition-all duration-300","thinking"===a&&"opacity-80"),style:{boxShadow:"listening"===a?`0 0 0 2px ${i.listeningColor}80`:"speaking"===a?`0 0 0 2px ${i.speakingColor}80`:"none"}}),i.showEmotionLabel&&o&&/* @__PURE__ */f("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 px-2 py-0.5 rounded-full bg-black/70 backdrop-blur-sm text-[10px] font-bold text-white whitespace-nowrap",children:[i.showEmojis&&(i.emotionEmojis[o]||"💬")," ",o]})]}),i.showWaveform&&/* @__PURE__ */g(kr,{isActive:b,audioLevel:s,color:x})]}:{className:"relative flex flex-col items-center gap-6",children:[
71
- /* @__PURE__ */f("div",{className:"relative",style:{width:`${y+48}px`,height:`${y+48}px`},children:[
72
- /* @__PURE__ */g("div",{className:"absolute inset-0 rounded-full",style:{border:`1.5px solid ${x}20`,animation:b?"spin 8s linear infinite":"none"}}),
73
- /* @__PURE__ */g("div",{className:"absolute rounded-full",style:{inset:"12px",border:`1px solid ${x}15`,animation:b?"spin 12s linear infinite reverse":"none"}}),
74
- /* @__PURE__ */g("div",{className:"absolute rounded-full flex items-center justify-center",style:{inset:"24px",background:`radial-gradient(circle at 35% 35%, ${x}40, ${x}10 60%, transparent 80%)`,boxShadow:b?`0 0 60px ${x}35, 0 0 120px ${x}15, inset 0 0 40px ${x}10`:`0 0 30px ${x}15`,transform:`scale(${v})`,transition:"all 0.5s cubic-bezier(0.4, 0, 0.2, 1)"},children:/* @__PURE__ */g("div",{className:"rounded-full",style:{width:.35*y+"px",height:.35*y+"px",background:`radial-gradient(circle, ${x}90, ${x}40)`,boxShadow:`0 0 20px ${x}60`,animation:b?"pulse 2s ease-in-out infinite":"none"}})}),b&&[0,1,2].map(e=>/* @__PURE__ */g("div",{className:"absolute rounded-full",style:{width:"4px",height:"4px",backgroundColor:x,opacity:.6,top:"50%",left:"50%",transform:`rotate(${120*e+Date.now()/20%360}deg) translateX(${(y+48)/2}px)`,animation:`spin ${6+2*e}s linear infinite`,boxShadow:`0 0 6px ${x}`}},e))]}),i.showWaveform&&/* @__PURE__ */g(kr,{isActive:b,audioLevel:s,color:x})]})}function kr({isActive:e,audioLevel:t,color:r}){/* @__PURE__ */
75
- return g("div",{className:"flex items-center gap-[3px] h-10",children:Array.from({length:12}).map((n,o)=>{const a=Math.abs(o-5.5)/5.5,s=e?Math.max(4,40*t*(1-.5*a)*(.5+.5*Math.sin(Date.now()/100+.8*o))):4;/* @__PURE__ */
76
- return g("div",{className:"rounded-full transition-all duration-100",style:{width:"3px",height:`${s}px`,backgroundColor:r,opacity:e?.7-.3*a:.2}},o)})})}function Cr({isOpen:e,onClose:t,primaryColor:r="#10b981",getSocket:a,avatars:i,logoUrl:l,avatar3dUrl:d,voiceConfig:u,onAddMessage:h}){const p=c(()=>function(e,t="#10b981"){return{backgroundColor:e?.backgroundColor??"#0a0a0a",listeningColor:e?.listeningColor??"#10b981",speakingColor:e?.speakingColor??t,thinkingColor:e?.thinkingColor??"#a855f7",showEmojis:e?.showEmojis??!0,showEmotionLabel:e?.showEmotionLabel??!0,showWaveform:e?.showWaveform??!0,showBadge:e?.showBadge??!1,badgeText:e?.badgeText??"",emotionEmojis:{...fr,...e?.emotionEmojis},statusLabels:{...br,...e?.statusLabels},orbSize:e?.orbSize??128,speakingScale:e?.speakingScale??1.08,thinkingScale:e?.thinkingScale??.95,avatar3dUrl:e?.avatar3dUrl}}(u,r),[u,r]),[x,k]=n("idle"),[C,N]=n(0),[M,z]=n(!1),[S,E]=n(0),[j,A]=n(null),[_,I]=n([]),[F,$]=n(!1),[L,T]=n(""),[O,D]=n(!1),U=m(null),W=m(null),P=m(null),R=m(null),B=m(null),H=m(0),q=m(!1),G=m(null),Y=m(null),X=m(()=>{}),Q=m(null),ee=m(0),te=m(null),ne=m([]),oe=m(!1),se=m(0),ie=m([]),le=s(e=>`${Math.floor(e/60)}:${(e%60).toString().padStart(2,"0")}`,[]),ce=s(()=>{if(0===ne.current.length)return;te.current&&"closed"!==te.current.state||(te.current=new AudioContext({sampleRate:vr}));const e=te.current;oe.current=!0,k("speaking");const t=e.currentTime;for(se.current<t&&(se.current=t);ne.current.length>0;){const t=ne.current.shift(),r=e.createBuffer(1,t.length,vr);r.getChannelData(0).set(t);const n=e.createBufferSource();n.buffer=r,n.connect(e.destination),n.start(se.current),ie.current.push(n),n.onended=()=>{ie.current=ie.current.filter(e=>e!==n),0===ie.current.length&&0===ne.current.length&&(oe.current=!1,k(e=>"speaking"===e?"listening":e))},se.current+=t.length/vr}},[]),de=m({}),ue=s(()=>{const e=a?.();if(!e||q.current)return;const t=()=>{k("listening")},r=e=>{if(!e?.data)return;const t=function(e){const t=atob(e),r=new Uint8Array(t.length);for(let a=0;a<t.length;a++)r[a]=t.charCodeAt(a);const n=new Int16Array(r.buffer),o=new Float32Array(n.length);for(let a=0;a<n.length;a++)o[a]=n[a]/32768;return o}(e.data);ne.current.push(t),ce(),be()},n=()=>{ie.current.forEach(e=>{try{e.stop()}catch{}}),ie.current=[],ne.current.length=0,se.current=0,oe.current=!1,k("listening")},o=()=>{},s=e=>{console.error("[VoiceCall] Voice error:",e)},i=e=>{e?.emotion&&(A(e.emotion),setTimeout(()=>A(t=>t===e.emotion?null:t),4e3))},l=e=>{e?.text&&(be(),I(t=>{if(t.length>0&&"user"===t[t.length-1].role){const r=[...t],n=r[r.length-1].text,o=n.length>0&&!n.endsWith(" ")&&!e.text.startsWith(" ");return r[r.length-1]={...r[r.length-1],text:n+(o?" ":"")+e.text},r}return[...t,{role:"user",text:e.text}]}))},c=e=>{e?.text&&(be(),I(t=>{if(t.length>0&&"bot"===t[t.length-1].role){const r=[...t],n=r[r.length-1].text,o=n.length>0&&!n.endsWith(" ")&&!e.text.startsWith(" ");return r[r.length-1]={...r[r.length-1],text:n+(o?" ":"")+e.text},r}return[...t,{role:"bot",text:e.text}]}))},d=()=>{k("thinking"),be()};de.current={voiceReady:t,voiceAudioChunk:r,voiceInterrupted:n,voiceTurnComplete:o,voiceError:s,voiceEmotion:i,voiceUserTranscript:l,voiceModelTranscript:c,voiceModelThinking:d},e.on("voice_ready",t),e.on("voice_audio_chunk",r),e.on("voice_interrupted",n),e.on("voice_turn_complete",o),e.on("voice_error",s),e.on("voice_emotion",i),e.on("voice_user_transcript",l),e.on("voice_model_transcript",c),e.on("voice_model_thinking",d),e.on("voice_timeout",()=>{X.current()}),q.current=!0},[a,ce]),he=s(()=>{const e=a?.();if(!e||!q.current)return;const t=de.current;t.voiceReady&&e.off("voice_ready",t.voiceReady),t.voiceAudioChunk&&e.off("voice_audio_chunk",t.voiceAudioChunk),t.voiceInterrupted&&e.off("voice_interrupted",t.voiceInterrupted),t.voiceTurnComplete&&e.off("voice_turn_complete",t.voiceTurnComplete),t.voiceError&&e.off("voice_error",t.voiceError),t.voiceEmotion&&e.off("voice_emotion",t.voiceEmotion),t.voiceUserTranscript&&e.off("voice_user_transcript",t.voiceUserTranscript),t.voiceModelTranscript&&e.off("voice_model_transcript",t.voiceModelTranscript),t.voiceModelThinking&&e.off("voice_model_thinking",t.voiceModelThinking),e.off("voice_timeout"),de.current={},q.current=!1},[a]),me=s(async()=>{const e=a?.();if(!e)return;const t=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:16e3,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});P.current=t;const r=new AudioContext({sampleRate:16e3});R.current=r;const n=r.createMediaStreamSource(t),o=r.createAnalyser();if(o.fftSize=256,n.connect(o),W.current=o,!G.current){const e=new Blob(["\nclass VoicePCMProcessor extends AudioWorkletProcessor {\n constructor() {\n super();\n this.buffer = new Float32Array(1600); // 100ms at 16kHz\n this.bufferIndex = 0;\n }\n process(inputs) {\n const input = inputs[0]?.[0];\n if (!input) return true;\n for (let i = 0; i < input.length; i++) {\n this.buffer[this.bufferIndex++] = input[i];\n if (this.bufferIndex >= 1600) {\n // Convert Float32 → Int16 PCM\n const int16 = new Int16Array(1600);\n for (let j = 0; j < 1600; j++) {\n const s = Math.max(-1, Math.min(1, this.buffer[j]));\n int16[j] = s < 0 ? s * 0x8000 : s * 0x7FFF;\n }\n this.port.postMessage(int16.buffer, [int16.buffer]);\n this.buffer = new Float32Array(1600);\n this.bufferIndex = 0;\n }\n }\n return true;\n }\n}\nregisterProcessor('voice-pcm-processor', VoicePCMProcessor);\n"],{type:"application/javascript"});G.current=URL.createObjectURL(e)}await r.audioWorklet.addModule(G.current);const s=new AudioWorkletNode(r,"voice-pcm-processor");B.current=s,s.port.onmessage=t=>{if(e.connected&&!M){const r=function(e){const t=new Uint8Array(e);let r="";for(let n=0;n<t.byteLength;n++)r+=String.fromCharCode(t[n]);return btoa(r)}(t.data);e.emit("voice_audio_chunk",{data:r})}},n.connect(s);const i=()=>{if(!W.current)return;const e=new Uint8Array(W.current.frequencyBinCount);W.current.getByteFrequencyData(e);const t=e.reduce((e,t)=>e+t,0)/e.length;E(t/255),H.current=requestAnimationFrame(i)};i()},[a,M]),pe=s(()=>{cancelAnimationFrame(H.current),B.current?.disconnect(),B.current=null,P.current?.getTracks().forEach(e=>e.stop()),P.current=null,R.current?.close(),R.current=null,W.current=null,E(0)},[]),ge=s(async()=>{const e=a?.();if(e?.connected){k("connecting"),N(0),I([]),A(null),ne.current=[],ue();try{await me()}catch(t){return console.error("[VoiceCall] Mic error:",t),void k("idle")}e.emit("voice_start",{language:"es-AR",voice:"Kore"}),U.current=setInterval(()=>{N(e=>e+1)},1e3),xe()}else console.error("[VoiceCall] Socket not connected")},[a,ue,me]),fe=s(()=>{pe(),ie.current.forEach(e=>{try{e.stop()}catch{}}),ie.current=[],ne.current=[],se.current=0,oe.current=!1,te.current?.close(),te.current=null,U.current&&(clearInterval(U.current),U.current=null),Q.current&&(clearInterval(Q.current),Q.current=null);const e=a?.();e?.connected&&e.emit("voice_stop"),h&&_.length>0&&_.forEach(e=>{h({sender:"user"===e.role?"user":"bot",content:e.text})}),he(),k("idle"),E(0),N(0),z(!1),I([]),D(!1),t()},[a,pe,he,t,h,_]);o(()=>{X.current=fe},[fe]);const be=s(()=>{ee.current=0,D(!1)},[]),xe=s(()=>{ee.current=0,Q.current&&clearInterval(Q.current),Q.current=setInterval(()=>{ee.current+=1;const e=ee.current;e>=90&&e<120&&D(!0),e>=120&&X.current()},1e3)},[]),ve=s(()=>{z(e=>!e)},[]),ye=s(()=>{const e=L.trim();if(!e)return;const t=a?.();t?.connected&&(t.emit("voice_text_input",{text:e}),T(""),$(!1))},[L,a]);if(o(()=>{e&&"idle"===x&&ge()},[e]),o(()=>()=>{pe(),U.current&&clearInterval(U.current),he()},[]),!e)return null;const we="speaking"===x?p.speakingColor:"thinking"===x?p.thinkingColor:"listening"===x?p.listeningColor:r;/* @__PURE__ */
77
- return f("div",{className:kt("absolute inset-0 z-50 flex flex-col overflow-hidden","animate-in fade-in duration-300"),style:{backgroundColor:"#0a0a0f",borderRadius:"inherit"},children:[
78
- /* @__PURE__ */f("div",{className:"absolute inset-0 pointer-events-none",style:{overflow:"hidden"},children:[
79
- /* @__PURE__ */g("div",{className:"absolute rounded-full",style:{width:"300px",height:"300px",top:"-80px",right:"-60px",background:`radial-gradient(circle, ${we}18 0%, transparent 70%)`,transition:"background 1.5s ease",filter:"blur(40px)"}}),
80
- /* @__PURE__ */g("div",{className:"absolute rounded-full",style:{width:"250px",height:"250px",bottom:"-40px",left:"-50px",background:`radial-gradient(circle, ${p.thinkingColor}12 0%, transparent 70%)`,filter:"blur(50px)"}}),
81
- /* @__PURE__ */g("div",{className:"absolute rounded-full",style:{width:"200px",height:"200px",top:"40%",left:"50%",transform:"translateX(-50%)",background:`radial-gradient(circle, ${we}10 0%, transparent 70%)`,transition:"background 1.5s ease",filter:"blur(60px)"}})]}),
82
- /* @__PURE__ */f("div",{className:"relative flex items-center justify-between",style:{background:"rgba(255,255,255,0.03)",borderBottom:"1px solid rgba(255,255,255,0.06)",padding:"16px 24px",paddingTop:"20px"},children:[
83
- /* @__PURE__ */f("div",{className:"flex items-center gap-3",children:[
84
- /* @__PURE__ */g("div",{className:"relative",children:/* @__PURE__ */g("div",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:we,boxShadow:`0 0 8px ${we}80`,animation:"idle"!==x?"pulse 2s ease-in-out infinite":"none"}})}),
85
- /* @__PURE__ */g("span",{style:{color:"rgba(255,255,255,0.8)",fontSize:"13px",fontWeight:500,letterSpacing:"-0.01em"},children:p.statusLabels[x]||x})]}),
86
- /* @__PURE__ */f("div",{className:"flex items-center gap-3",children:[p.showEmotionLabel&&j&&/* @__PURE__ */f("span",{style:{fontSize:"11px",padding:"2px 10px",borderRadius:"20px",background:`${we}15`,border:`1px solid ${we}25`,color:we,fontWeight:600},children:[p.showEmojis&&(p.emotionEmojis[j]||"💬")," ",j]}),
87
- /* @__PURE__ */g("span",{style:{fontSize:"13px",fontFamily:"ui-monospace, monospace",color:"rgba(255,255,255,0.4)",fontVariantNumeric:"tabular-nums"},children:le(C)}),O&&(()=>{const e=120-ee.current,t=e<=15;/* @__PURE__ */
88
- return f("span",{style:{fontSize:"10px",padding:"2px 8px",borderRadius:"12px",backgroundColor:t?"rgba(239,68,68,0.2)":"rgba(245,158,11,0.15)",color:t?"#ef4444":"#f59e0b",fontWeight:700,fontVariantNumeric:"tabular-nums",animation:t?"pulse 1s ease-in-out infinite":"none"},children:["⏸ Inactivo — ",e>0?e:0,"s"]})})()]})]}),p.showBadge&&p.badgeText&&/* @__PURE__ */g("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0"},children:/* @__PURE__ */g("span",{style:{padding:"4px 14px",borderRadius:"20px",fontSize:"11px",fontWeight:700,background:`linear-gradient(135deg, ${r}, ${p.thinkingColor})`,color:"white"},children:p.badgeText})}),
89
- /* @__PURE__ */g("div",{className:"relative flex-1 overflow-y-auto px-5 py-4",style:{scrollbarWidth:"none"},children:/* @__PURE__ */f("div",{className:"flex flex-col items-center justify-start h-full gap-4",children:[
90
- /* @__PURE__ */g(wr,{avatars:i,logoUrl:l,avatar3dUrl:d||p.avatar3dUrl,emotion:j,callState:x,audioLevel:S,config:p}),_.length>0&&/* @__PURE__ */f("div",{style:{display:"flex",flexDirection:"column",gap:"8px",width:"100%"},children:[_.slice(-2).map((e,t)=>/* @__PURE__ */g("div",{style:{maxWidth:"85%",padding:"10px 14px",borderRadius:"user"===e.role?"16px 16px 4px 16px":"16px 16px 16px 4px",fontSize:"13.5px",lineHeight:1.5,color:"white",marginLeft:"user"===e.role?"auto":"0",marginRight:"user"===e.role?"0":"auto",backgroundColor:"user"===e.role?"rgba(255,255,255,0.08)":`${r}25`,backdropFilter:"blur(8px)",border:"user"===e.role?"1px solid rgba(255,255,255,0.08)":`1px solid ${r}20`},children:/* @__PURE__ */g(v,{remarkPlugins:[w],rehypePlugins:[[y,xr]],components:{p:({children:e})=>/* @__PURE__ */g("p",{style:{margin:0},children:e}),a:({href:e,children:t})=>/* @__PURE__ */g("a",{href:e,target:"_blank",rel:"noopener noreferrer",style:{color:r,textDecoration:"underline"},children:t}),strong:({children:e})=>/* @__PURE__ */g("strong",{style:{fontWeight:600},children:e}),em:({children:e})=>/* @__PURE__ */g("em",{children:e}),ul:({children:e})=>/* @__PURE__ */g("ul",{style:{margin:"4px 0",paddingLeft:"18px"},children:e}),ol:({children:e})=>/* @__PURE__ */g("ol",{style:{margin:"4px 0",paddingLeft:"18px"},children:e}),li:({children:e})=>/* @__PURE__ */g("li",{style:{marginBottom:"2px"},children:e}),code:({children:e})=>/* @__PURE__ */g("code",{style:{background:"rgba(255,255,255,0.1)",padding:"0 4px",borderRadius:"3px",fontSize:"12px"},children:e})},children:e.text})},t)),
91
- /* @__PURE__ */g("div",{ref:Y})]})]})}),
92
- /* @__PURE__ */g("div",{style:{textAlign:"center",paddingBottom:"12px"},children:/* @__PURE__ */g("span",{style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 16px",borderRadius:"20px",fontSize:"11px",fontWeight:500,color:"rgba(255,255,255,0.35)",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)",letterSpacing:"0.02em"},children:M?/* @__PURE__ */f(b,{children:[
93
- /* @__PURE__ */g(K,{style:{width:"12px",height:"12px"}})," Micrófono silenciado"]}):"thinking"===x?"Procesando...":"speaking"===x?/* @__PURE__ */f(b,{children:[
94
- /* @__PURE__ */g(ae,{style:{width:"12px",height:"12px"}})," Respuesta de voz"]}):"Habla cuando quieras"})}),
95
- /* @__PURE__ */f("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"20px",paddingBottom:"28px",paddingTop:"8px"},children:[
96
- /* @__PURE__ */g("button",{onClick:ve,style:{width:"52px",height:"52px",borderRadius:"50%",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",backgroundColor:M?"rgba(239,68,68,0.15)":"rgba(255,255,255,0.08)",color:M?"#f87171":"rgba(255,255,255,0.7)",backdropFilter:"blur(12px)",border:"1px solid "+(M?"rgba(239,68,68,0.2)":"rgba(255,255,255,0.08)")},"aria-label":M?"Activar micrófono":"Silenciar micrófono",children:/* @__PURE__ */g(M?K:Z,{style:{width:"22px",height:"22px"}})}),
97
- /* @__PURE__ */g("button",{onClick:fe,style:{width:"64px",height:"64px",borderRadius:"50%",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",boxShadow:"0 4px 24px rgba(239,68,68,0.4), 0 0 0 4px rgba(239,68,68,0.1)",transition:"all 0.2s"},"aria-label":"Finalizar llamada",children:/* @__PURE__ */g(J,{style:{width:"26px",height:"26px"}})}),
98
- /* @__PURE__ */g("div",{style:{width:"52px",height:"52px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"speaking"===x?`${p.listeningColor}15`:"rgba(255,255,255,0.08)",color:"speaking"===x?p.listeningColor:"rgba(255,255,255,0.5)",border:"1px solid "+("speaking"===x?`${p.listeningColor}25`:"rgba(255,255,255,0.08)"),transition:"all 0.3s"},children:/* @__PURE__ */g(ae,{style:{width:"22px",height:"22px"}})}),
99
- /* @__PURE__ */g("button",{onClick:()=>$(e=>!e),style:{width:"52px",height:"52px",borderRadius:"50%",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",backgroundColor:F?`${r}20`:"rgba(255,255,255,0.08)",color:F?r:"rgba(255,255,255,0.5)",border:"1px solid "+(F?`${r}30`:"rgba(255,255,255,0.08)")},"aria-label":"Escribir texto",children:/* @__PURE__ */g(V,{style:{width:"20px",height:"20px"}})})]}),F&&/* @__PURE__ */f("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 20px 20px"},children:[
100
- /* @__PURE__ */g("input",{type:"text",value:L,onChange:e=>T(e.target.value),onKeyDown:e=>"Enter"===e.key&&ye(),placeholder:"Escribí email, teléfono, etc.",autoFocus:!0,style:{flex:1,padding:"10px 14px",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.12)",background:"rgba(255,255,255,0.06)",color:"white",fontSize:"13px",outline:"none",backdropFilter:"blur(8px)"}}),
101
- /* @__PURE__ */g("button",{onClick:ye,disabled:!L.trim(),style:{width:"40px",height:"40px",borderRadius:"50%",border:"none",cursor:L.trim()?"pointer":"default",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:L.trim()?r:"rgba(255,255,255,0.06)",color:L.trim()?"white":"rgba(255,255,255,0.2)",transition:"all 0.2s"},"aria-label":"Enviar texto",children:/* @__PURE__ */g(re,{style:{width:"16px",height:"16px"}})})]}),
102
- /* @__PURE__ */g("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n @keyframes pulse {\n 0%, 100% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.7; transform: scale(0.95); }\n }\n "})]})}function Nr({isOpen:e,isConnected:t,isTyping:r,messages:a,botName:i="BotUyo",logoUrl:l,welcomeMessage:c,inputPlaceholder:d,primaryColor:u,mediaConfig:h,onClose:p,onSendMessage:x,bubbleStyles:v,avatars:y,onSendAttachment:w,onSendLocation:k,getSocket:C,onAddVoiceMessage:N,avatar3dUrl:M,theme:z}){const[S,E]=n(!1),[A,_]=n(!1),[I,F]=n(!1),{t:$}=j(),L=mr(),T=zt({primaryColor:u}),O=function({isOpen:e,height:t,bottom:r}){const a=mr(),[i,l]=n({}),c=s(()=>{if(a){const e=()=>{window.visualViewport?l({height:`${window.visualViewport.height}px`,width:"100%",top:`${window.visualViewport.offsetTop}px`,left:"0px",bottom:"auto",right:"auto",transform:"none"}):l({height:"100dvh",width:"100%",top:"0px",left:"0px"})};return e(),window.visualViewport?.addEventListener("resize",e),window.visualViewport?.addEventListener("scroll",e),()=>{window.visualViewport?.removeEventListener("resize",e),window.visualViewport?.removeEventListener("scroll",e)}}{const e=parseFloat(r||pr)||24,n=window.innerHeight-64-e;if(t){const e=parseFloat(t)||700,o=Math.min(e,n);l({height:`${o}px`,maxHeight:`${n}px`,bottom:r||pr})}else{const e=Math.min(700,Math.max(500,n));l({height:`${e}px`,maxHeight:`${n}px`,bottom:r||pr})}}},[a,t,r]);return o(()=>{if(!e)return;const t=c();return window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c),t&&t()}},[e,c]),i}({isOpen:e,height:z?.height,bottom:z?.bottom}),D=function({enabled:e,returnFocusRef:t,onEscape:r}){const n=m(null),a=m(null);return o(()=>{if(!e)return;a.current=document.activeElement;const o=t?.current,s=n.current;if(!s)return;const i=setTimeout(()=>{const e=s.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');e.length>0?e[0].focus():s.focus()},100),l=e=>{if(s)if("Escape"!==e.key){if("Tab"===e.key){const t=s.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0===t.length)return;const r=t[0],n=t[t.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),n.focus()):e.shiftKey||document.activeElement!==n||(e.preventDefault(),r.focus())}}else r?.()};return document.addEventListener("keydown",l),()=>{clearTimeout(i),document.removeEventListener("keydown",l);const e=o||a.current;e&&"function"==typeof e.focus&&e.focus()}},[e,r,t]),n}({enabled:e,onEscape:p});if(o(()=>{if(e)return L&&(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"),()=>{document.body.style.overflow="",document.body.style.position="",document.body.style.width=""}},[e,L]),!e)return null;const U="bottom-left"===z?.position;/* @__PURE__ */
103
- return f(b,{children:[
104
- /* @__PURE__ */g("div",{id:"chat-window-description",className:"sr-only",children:$("accessibility.dialogDescription")}),
105
- /* @__PURE__ */f("div",{ref:D,role:"dialog","aria-modal":"true","aria-labelledby":"chat-window-title","aria-describedby":"chat-window-description",tabIndex:-1,className:kt("flex flex-col overflow-hidden transition-all duration-500 ease-[cubic-bezier(0.16,1,0.3,1)]","text-foreground z-[9999]",!L&&["fixed",U?"left-6":"right-6","w-[350px] min-w-[350px] max-w-[350px]","rounded-[32px] border shadow-soft-2xl","animate-in fade-in zoom-in-95","slide-in-from-bottom-10"],L&&["fixed inset-0 w-full"]),style:{...O,backgroundColor:"hsl(var(--background))",borderColor:"hsl(var(--border))",color:"hsl(var(--foreground))"},children:[
106
- /* @__PURE__ */g("header",{className:"relative shrink-0 border-b z-20",style:{padding:"var(--spacing-5)",backgroundColor:"hsl(var(--background) / 0.9)",borderColor:"hsl(var(--border))",backdropFilter:"blur(24px)"},children:/* @__PURE__ */f("div",{className:"flex items-center justify-between",children:[
107
- /* @__PURE__ */f("div",{className:"flex items-center gap-3",children:[
108
- /* @__PURE__ */f("div",{className:"relative",children:[
109
- /* @__PURE__ */g("div",{className:"h-10 w-10 rounded-2xl overflow-hidden bg-primary/10 border-2 border-background shadow-soft-sm",children:S?/* @__PURE__ */g("div",{className:"h-full w-full flex items-center justify-center bg-muted text-muted-foreground",children:/* @__PURE__ */g("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})}):/* @__PURE__ */g("img",{src:l||Tt,alt:i,className:"h-full w-full object-cover",onError:()=>E(!0)})}),
110
- /* @__PURE__ */g("div",{className:kt("absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full border-2 border-background",t?"bg-emerald-500":"bg-amber-500 animate-pulse")})]}),
111
- /* @__PURE__ */f("div",{className:"flex flex-col",children:[
112
- /* @__PURE__ */f("div",{className:"flex items-center gap-1",children:[
113
- /* @__PURE__ */g("span",{id:"chat-window-title",className:"font-black text-xs uppercase tracking-tight text-foreground",children:i}),
114
- /* @__PURE__ */g(ne,{className:"h-3 w-3 text-primary fill-primary/10"})]}),
115
- /* @__PURE__ */f("div",{id:"chat-window-description",className:"flex items-center gap-1.5 mt-0.5",children:[
116
- /* @__PURE__ */g("span",{className:"flex h-1 w-1 rounded-full bg-emerald-500"}),
117
- /* @__PURE__ */g("span",{className:"text-[9px] font-black text-muted-foreground uppercase tracking-[0.1em]",children:$(t?"online":"offline")})]})]})]}),
118
- /* @__PURE__ */f("div",{className:"flex items-center gap-2",children:[h?.enableVoice&&/* @__PURE__ */f("div",{className:"relative",children:[
119
- /* @__PURE__ */g("button",{onClick:()=>F(!I),"aria-label":"Iniciar llamada de voz",title:"Llamar",className:"h-8 w-8 flex items-center justify-center rounded-full bg-emerald-500/10 hover:bg-emerald-500/20 text-emerald-600 transition-all active:scale-90 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2",children:/* @__PURE__ */g(X,{className:"h-4 w-4","aria-hidden":"true"})}),I&&/* @__PURE__ */f("div",{className:"absolute top-full right-0 mt-2 rounded-2xl border shadow-soft-2xl animate-in fade-in zoom-in-95 duration-200 z-50",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",padding:"var(--spacing-4)",minWidth:"180px"},children:[
120
- /* @__PURE__ */g("p",{className:"text-xs font-bold text-center",style:{color:"hsl(var(--foreground))",marginBottom:"var(--spacing-3)"},children:$("call_confirm")||"¿Iniciar llamada de voz?"}),
121
- /* @__PURE__ */f("div",{className:"flex items-center justify-center",style:{gap:"var(--spacing-2)"},children:[
122
- /* @__PURE__ */g("button",{onClick:()=>F(!1),className:"h-8 rounded-xl text-[10px] font-black uppercase tracking-wider transition-all active:scale-95",style:{padding:"0 var(--spacing-4)",backgroundColor:"hsl(var(--muted))",color:"hsl(var(--muted-foreground))"},children:$("cancel")||"Cancelar"}),
123
- /* @__PURE__ */g("button",{onClick:()=>{F(!1),_(!0)},className:"h-8 rounded-xl text-[10px] font-black uppercase tracking-wider text-white transition-all active:scale-95 shadow-md",style:{padding:"0 var(--spacing-4)",backgroundColor:"#10b981"},children:$("call")||"Llamar"})]})]})]}),
124
- /* @__PURE__ */g("button",{onClick:p,"aria-label":$("accessibility.closeChat"),title:"Esc",className:"h-8 w-8 flex items-center justify-center rounded-full bg-muted/60 hover:bg-muted text-foreground transition-all active:scale-90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",children:/* @__PURE__ */g(se,{className:"h-4 w-4","aria-hidden":"true"})})]})]})}),
125
- /* @__PURE__ */f("main",{role:"region","aria-label":$("accessibility.chatMessages"),className:"flex-1 min-h-0 relative flex flex-col",style:{padding:"var(--spacing-5)",backgroundColor:"hsl(var(--muted))"},children:[
126
- /* @__PURE__ */g(sr,{messages:a,isTyping:r,welcomeMessage:c,primaryColor:u,logoUrl:l,botName:i,bubbleStyles:v,avatars:y}),
127
- /* @__PURE__ */g("div",{className:"absolute top-0 left-0 right-0 h-6 bg-gradient-to-b from-background/10 to-transparent pointer-events-none"})]}),
128
- /* @__PURE__ */f("footer",{className:"border-t",style:{paddingTop:"var(--spacing-5)",paddingLeft:"var(--spacing-5)",paddingRight:"var(--spacing-5)",paddingBottom:L?"max(var(--spacing-3), env(safe-area-inset-bottom))":"var(--spacing-3)",backgroundColor:"hsl(var(--background))",borderColor:"hsl(var(--border))"},children:[
129
- /* @__PURE__ */g(ur,{isConnected:t,placeholder:d,primaryColor:T,mediaConfig:h,onSendMessage:x,onSendAttachment:w,onSendLocation:k,onVoiceCall:h?.enableVoice?()=>_(!0):void 0}),
130
- /* @__PURE__ */f("div",{className:"flex items-center justify-center gap-1 opacity-25 select-none",style:{marginTop:"var(--spacing-2)",paddingBottom:"var(--spacing-1)"},children:[
131
- /* @__PURE__ */g(R,{className:"h-2 w-2 text-primary fill-primary"}),
132
- /* @__PURE__ */g("span",{className:"text-[7px] font-bold uppercase tracking-[0.2em]",children:$("con_amor_paseo_libre")})]})]}),
133
- /* @__PURE__ */g(Cr,{isOpen:A,onClose:()=>_(!1),primaryColor:T,avatars:y,logoUrl:l,avatar3dUrl:M,getSocket:C,onAddMessage:N})]})]})}export{D as C,Tt as D,H as L,G as M,Y as P,te as R,se as X,ie as Z,Q as a,T as b,kt as c,O as d,It as e,Ft as f,zt as g,Ot as h,S as i,_t as j,mr as k,Lt as l,Mt as m,Nr as n,E as o,hr as t,j as u};
134
- //# sourceMappingURL=chunk-chat-ui-BNRuIw2B.js.map