@botuyo/chat-widget-standalone 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/botuyo-chat.es.js +34 -1
- package/dist/botuyo-chat.es.js.map +1 -1
- package/dist/botuyo-chat.umd.js +1 -1
- package/dist/botuyo-chat.umd.js.map +1 -1
- package/dist/chunk-audio-Cx_99pbh.js +12 -0
- package/dist/{chunk-audio-C4Q6VB-1.js.map → chunk-audio-Cx_99pbh.js.map} +1 -1
- package/dist/chunk-chat-ui-DRDmUvk-.js +104 -0
- package/dist/{chunk-chat-ui-DmqgsaBa.js.map → chunk-chat-ui-DRDmUvk-.js.map} +1 -1
- package/dist/chunk-gallery-CJ48rYJy.js +24 -0
- package/dist/{chunk-gallery-Ca7lW3V4.js.map → chunk-gallery-CJ48rYJy.js.map} +1 -1
- package/dist/chunk-markdown-C7alTngS.js +2 -0
- package/dist/chunk-markdown-C7alTngS.js.map +1 -0
- package/dist/standalone.d.ts +5 -0
- package/dist/standalone.d.ts.map +1 -1
- package/dist/stats-umd.html +1 -1
- package/dist/stats.html +1 -1
- package/package.json +1 -1
- package/dist/ChatWidget-3m1RqH_c.js +0 -33
- package/dist/ChatWidget-3m1RqH_c.js.map +0 -1
- package/dist/chunk-audio-C4Q6VB-1.js +0 -13
- package/dist/chunk-chat-ui-DmqgsaBa.js +0 -104
- package/dist/chunk-gallery-Ca7lW3V4.js +0 -24
- package/dist/chunk-markdown-xGy7kpWU.js +0 -2
- package/dist/chunk-markdown-xGy7kpWU.js.map +0 -1
- package/dist/vendor-react-CtfcjTlq.js +0 -2
- package/dist/vendor-react-CtfcjTlq.js.map +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
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-DRDmUvk-.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-Cx_99pbh.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-audio-
|
|
1
|
+
{"version":3,"file":"chunk-audio-Cx_99pbh.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"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import*as e from"react";import t,{createContext as r,useContext as o,useState as n,useEffect as s,useCallback as a,forwardRef as i,createElement as l,useMemo as c,lazy as d,memo as m,Suspense as u,useRef as h}from"react";import{jsx as p,jsxs as g,Fragment as f}from"react/jsx-runtime";import{flushSync as b}from"react-dom";import{M as v,r as y,a as x}from"./chunk-markdown-C7alTngS.js";const w={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 k(){if("undefined"==typeof navigator)return"es";const e=navigator.language.split("-")[0];return w[e]?e:"es"}const C=r(void 0),N="botuyo-chat-locale";function M({children:e,defaultLocale:t}){const[r,o]=n(()=>{if(t)return t;if("undefined"!=typeof window){const e=localStorage.getItem(N);if(e)return e}return k()});return s(()=>{if("undefined"==typeof window||t)return;const e=()=>{localStorage.getItem(N)||o(k())};return window.addEventListener("languagechange",e),()=>window.removeEventListener("languagechange",e)},[t]),/* @__PURE__ */p(C.Provider,{value:{locale:r,setLocale:e=>{["es","en","pt","fr"].includes(e)?(o(e),"undefined"!=typeof window&&localStorage.setItem(N,e)):console.warn(`[BotUyo] Locale "${e}" no es soportado. Manteniendo "${r}"`)}},children:e})}function z(){const e=o(C);if(void 0===e)throw new Error("useLanguage debe usarse dentro de un LanguageProvider");return e}function E(e){const{locale:t,setLocale:r}=z();return{t:a(r=>{var o,n;return(o=w[t],(n=e?`${e}.${r}`:r).split(".").reduce((e,t)=>e?.[t],o)||n)||r},[t,e]),setLocale:r,currentLocale:t}}const S=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),j=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)};var A={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 _=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1},F=i(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:n="",children:s,iconNode:a,...i},c)=>l("svg",{ref:c,...A,width:t,height:t,stroke:e,strokeWidth:o?24*Number(r)/Number(t):r,className:S("lucide",n),...!s&&!_(i)&&{"aria-hidden":"true"},...i},[...a.map(([e,t])=>l(e,t)),...Array.isArray(s)?s:[s]])),I=(e,t)=>{const r=i(({className:r,...o},n)=>{return l(F,{ref:n,iconNode:t,className:S(`lucide-${s=j(e),s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...o});var s});return r.displayName=j(e),r},O=I("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),D=I("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),T=I("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),L=I("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),$=I("circle-alert",[["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=I("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),P=I("external-link",[["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"}]]),W=I("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]),V=I("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]),B=I("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"}]]),H=I("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),R=I("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),q=I("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]),G=I("mic-off",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]]),K=I("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]),Y=I("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]),J=I("phone-off",[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]]),Z=I("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]),Q=I("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),X=I("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),ee=I("rotate-cw",[["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"}]]),te=I("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),re=I("shield-check",[["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=I("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),ne=I("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),se=I("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ae=I("zoom-in",[["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 ie(e){var t,r,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=ie(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}const le=(e=/* @__PURE__ */new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),ce="-",de=[],me=e=>{const t=pe(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return he(e);const r=e.split(ce),o=""===r[0]&&r.length>1?1:0;return ue(r,o,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=o[e],n=r[e];return t?n?((e,t)=>{const r=new Array(e.length+t.length);for(let o=0;o<e.length;o++)r[o]=e[o];for(let o=0;o<t.length;o++)r[e.length+o]=t[o];return r})(n,t):t:n||de}return r[e]||de}}},ue=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const o=e[t],n=r.nextPart.get(o);if(n){const r=ue(e,t+1,n);if(r)return r}const s=r.validators;if(null===s)return;const a=0===t?e.join(ce):e.slice(t).join(ce),i=s.length;for(let l=0;l<i;l++){const e=s[l];if(e.validator(a))return e.classGroupId}},he=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),o=t.slice(0,r);return o?"arbitrary.."+o:void 0})(),pe=e=>{const{theme:t,classGroups:r}=e;return ge(r,t)},ge=(e,t)=>{const r=le();for(const o in e){const n=e[o];fe(n,r,o,t)}return r},fe=(e,t,r,o)=>{const n=e.length;for(let s=0;s<n;s++){const n=e[s];be(n,t,r,o)}},be=(e,t,r,o)=>{"string"!=typeof e?"function"!=typeof e?xe(e,t,r,o):ye(e,t,r,o):ve(e,t,r)},ve=(e,t,r)=>{(""===e?t:we(t,e)).classGroupId=r},ye=(e,t,r,o)=>{ke(e)?fe(e(o),t,r,o):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},xe=(e,t,r,o)=>{const n=Object.entries(e),s=n.length;for(let a=0;a<s;a++){const[e,s]=n[a];fe(s,we(t,e),r,o)}},we=(e,t)=>{let r=e;const o=t.split(ce),n=o.length;for(let s=0;s<n;s++){const e=o[s];let t=r.nextPart.get(e);t||(t=le(),r.nextPart.set(e,t)),r=t}return r},ke=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,Ce=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=/* @__PURE__ */Object.create(null),o=/* @__PURE__ */Object.create(null);const n=(n,s)=>{r[n]=s,t++,t>e&&(t=0,o=r,r=/* @__PURE__ */Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=o[e])?(n(e,t),t):void 0},set(e,t){e in r?r[e]=t:n(e,t)}}},Ne=[],Me=(e,t,r,o,n)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:o,isExternal:n}),ze=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=e=>{const t=[];let r,o=0,n=0,s=0;const a=e.length;for(let d=0;d<a;d++){const a=e[d];if(0===o&&0===n){if(":"===a){t.push(e.slice(s,d)),s=d+1;continue}if("/"===a){r=d;continue}}"["===a?o++:"]"===a?o--:"("===a?n++:")"===a&&n--}const i=0===t.length?e:e.slice(s);let l=i,c=!1;return i.endsWith("!")?(l=i.slice(0,-1),c=!0):i.startsWith("!")&&(l=i.slice(1),c=!0),Me(t,c,l,r&&r>s?r-s:void 0)};if(t){const e=t+":",r=o;o=t=>t.startsWith(e)?r(t.slice(e.length)):Me(Ne,!1,t,void 0,!0)}if(r){const e=o;o=t=>r({className:t,parseClassName:e})}return o},Ee=e=>{const t=/* @__PURE__ */new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let o=[];for(let n=0;n<e.length;n++){const s=e[n],a="["===s[0],i=t.has(s);a||i?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(s)):o.push(s)}return o.length>0&&(o.sort(),r.push(...o)),r}},Se=/\s+/,je=e=>{if("string"==typeof e)return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=je(e[o]))&&(r&&(r+=" "),r+=t);return r},Ae=[],_e=e=>{const t=t=>t[e]||Ae;return t.isThemeGetter=!0,t},Fe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ie=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Oe=/^\d+\/\d+$/,De=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Te=/\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$/,Le=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$e=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ue=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pe=e=>Oe.test(e),We=e=>!!e&&!Number.isNaN(Number(e)),Ve=e=>!!e&&Number.isInteger(Number(e)),Be=e=>e.endsWith("%")&&We(e.slice(0,-1)),He=e=>De.test(e),Re=()=>!0,qe=e=>Te.test(e)&&!Le.test(e),Ge=()=>!1,Ke=e=>$e.test(e),Ye=e=>Ue.test(e),Je=e=>!Qe(e)&&!nt(e),Ze=e=>mt(e,gt,Ge),Qe=e=>Fe.test(e),Xe=e=>mt(e,ft,qe),et=e=>mt(e,bt,We),tt=e=>mt(e,ht,Ge),rt=e=>mt(e,pt,Ye),ot=e=>mt(e,yt,Ke),nt=e=>Ie.test(e),st=e=>ut(e,ft),at=e=>ut(e,vt),it=e=>ut(e,ht),lt=e=>ut(e,gt),ct=e=>ut(e,pt),dt=e=>ut(e,yt,!0),mt=(e,t,r)=>{const o=Fe.exec(e);return!!o&&(o[1]?t(o[1]):r(o[2]))},ut=(e,t,r=!1)=>{const o=Ie.exec(e);return!!o&&(o[1]?t(o[1]):r)},ht=e=>"position"===e||"percentage"===e,pt=e=>"image"===e||"url"===e,gt=e=>"length"===e||"size"===e||"bg-size"===e,ft=e=>"length"===e,bt=e=>"number"===e,vt=e=>"family-name"===e,yt=e=>"shadow"===e,xt=/* @__PURE__ */((e,...t)=>{let r,o,n,s;const a=e=>{const t=o(e);if(t)return t;const s=((e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n,sortModifiers:s}=t,a=[],i=e.trim().split(Se);let l="";for(let c=i.length-1;c>=0;c-=1){const e=i[c],{isExternal:t,modifiers:d,hasImportantModifier:m,baseClassName:u,maybePostfixModifierPosition:h}=r(e);if(t){l=e+(l.length>0?" "+l:l);continue}let p=!!h,g=o(p?u.substring(0,h):u);if(!g){if(!p){l=e+(l.length>0?" "+l:l);continue}if(g=o(u),!g){l=e+(l.length>0?" "+l:l);continue}p=!1}const f=0===d.length?"":1===d.length?d[0]:s(d).join(":"),b=m?f+"!":f,v=b+g;if(a.indexOf(v)>-1)continue;a.push(v);const y=n(g,p);for(let r=0;r<y.length;++r){const e=y[r];a.push(b+e)}l=e+(l.length>0?" "+l:l)}return l})(e,r);return n(e,s),s};return s=i=>{const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:Ce(e.cacheSize),parseClassName:ze(e),sortModifiers:Ee(e),...me(e)}))(l),o=r.cache.get,n=r.cache.set,s=a,a(i)},(...e)=>s(((...e)=>{let t,r,o=0,n="";for(;o<e.length;)(t=e[o++])&&(r=je(t))&&(n&&(n+=" "),n+=r);return n})(...e))})(()=>{const e=_e("color"),t=_e("font"),r=_e("text"),o=_e("font-weight"),n=_e("tracking"),s=_e("leading"),a=_e("breakpoint"),i=_e("container"),l=_e("spacing"),c=_e("radius"),d=_e("shadow"),m=_e("inset-shadow"),u=_e("text-shadow"),h=_e("drop-shadow"),p=_e("blur"),g=_e("perspective"),f=_e("aspect"),b=_e("ease"),v=_e("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",nt,Qe],x=()=>[nt,Qe,l],w=()=>[Pe,"full","auto",...x()],k=()=>[Ve,"none","subgrid",nt,Qe],C=()=>["auto",{span:["full",Ve,nt,Qe]},Ve,nt,Qe],N=()=>[Ve,"auto",nt,Qe],M=()=>["auto","min","max","fr",nt,Qe],z=()=>["auto",...x()],E=()=>[Pe,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],S=()=>[e,nt,Qe],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",it,tt,{position:[nt,Qe]}],A=()=>["auto","cover","contain",lt,Ze,{size:[nt,Qe]}],_=()=>[Be,st,Xe],F=()=>["","none","full",c,nt,Qe],I=()=>["",We,st,Xe],O=()=>[We,Be,it,tt],D=()=>["","none",p,nt,Qe],T=()=>["none",We,nt,Qe],L=()=>["none",We,nt,Qe],$=()=>[We,nt,Qe],U=()=>[Pe,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[He],breakpoint:[He],color:[Re],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",We],text:[He],"text-shadow":[He],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Pe,Qe,nt,f]}],container:["container"],columns:[{columns:[We,Qe,nt,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:y()}],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:[Ve,"auto",nt,Qe]}],basis:[{basis:[Pe,"full","auto",i,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[We,Pe,"auto","initial","none",Qe]}],grow:[{grow:["",We,nt,Qe]}],shrink:[{shrink:["",We,nt,Qe]}],order:[{order:[Ve,"first","last","none",nt,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:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"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:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],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":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],w:[{w:[i,"screen",...E()]}],"min-w":[{"min-w":[i,"screen","none",...E()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...E()]}],h:[{h:["screen","lh",...E()]}],"min-h":[{"min-h":["screen","lh","none",...E()]}],"max-h":[{"max-h":["screen","lh",...E()]}],"font-size":[{text:["base",r,st,Xe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,nt,et]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Be,Qe]}],"font-family":[{font:[at,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:[n,nt,Qe]}],"line-clamp":[{"line-clamp":[We,"none",nt,et]}],leading:[{leading:[s,...x()]}],"list-image":[{"list-image":["none",nt,Qe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",nt,Qe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:S()}],"text-color":[{text:S()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[We,"from-font","auto",nt,Xe]}],"text-decoration-color":[{decoration:S()}],"underline-offset":[{"underline-offset":[We,"auto",nt,Qe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",nt,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",nt,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"]},Ve,nt,Qe],radial:["",nt,Qe],conic:[Ve,nt,Qe]},ct,rt]}],"bg-color":[{bg:S()}],"gradient-from-pos":[{from:_()}],"gradient-via-pos":[{via:_()}],"gradient-to-pos":[{to:_()}],"gradient-from":[{from:S()}],"gradient-via":[{via:S()}],"gradient-to":[{to:S()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":I()}],"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:S()}],"border-color-x":[{"border-x":S()}],"border-color-y":[{"border-y":S()}],"border-color-s":[{"border-s":S()}],"border-color-e":[{"border-e":S()}],"border-color-t":[{"border-t":S()}],"border-color-r":[{"border-r":S()}],"border-color-b":[{"border-b":S()}],"border-color-l":[{"border-l":S()}],"divide-color":[{divide:S()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[We,nt,Qe]}],"outline-w":[{outline:["",We,st,Xe]}],"outline-color":[{outline:S()}],shadow:[{shadow:["","none",d,dt,ot]}],"shadow-color":[{shadow:S()}],"inset-shadow":[{"inset-shadow":["none",m,dt,ot]}],"inset-shadow-color":[{"inset-shadow":S()}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:S()}],"ring-offset-w":[{"ring-offset":[We,Xe]}],"ring-offset-color":[{"ring-offset":S()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":S()}],"text-shadow":[{"text-shadow":["none",u,dt,ot]}],"text-shadow-color":[{"text-shadow":S()}],opacity:[{opacity:[We,nt,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":[We]}],"mask-image-linear-from-pos":[{"mask-linear-from":O()}],"mask-image-linear-to-pos":[{"mask-linear-to":O()}],"mask-image-linear-from-color":[{"mask-linear-from":S()}],"mask-image-linear-to-color":[{"mask-linear-to":S()}],"mask-image-t-from-pos":[{"mask-t-from":O()}],"mask-image-t-to-pos":[{"mask-t-to":O()}],"mask-image-t-from-color":[{"mask-t-from":S()}],"mask-image-t-to-color":[{"mask-t-to":S()}],"mask-image-r-from-pos":[{"mask-r-from":O()}],"mask-image-r-to-pos":[{"mask-r-to":O()}],"mask-image-r-from-color":[{"mask-r-from":S()}],"mask-image-r-to-color":[{"mask-r-to":S()}],"mask-image-b-from-pos":[{"mask-b-from":O()}],"mask-image-b-to-pos":[{"mask-b-to":O()}],"mask-image-b-from-color":[{"mask-b-from":S()}],"mask-image-b-to-color":[{"mask-b-to":S()}],"mask-image-l-from-pos":[{"mask-l-from":O()}],"mask-image-l-to-pos":[{"mask-l-to":O()}],"mask-image-l-from-color":[{"mask-l-from":S()}],"mask-image-l-to-color":[{"mask-l-to":S()}],"mask-image-x-from-pos":[{"mask-x-from":O()}],"mask-image-x-to-pos":[{"mask-x-to":O()}],"mask-image-x-from-color":[{"mask-x-from":S()}],"mask-image-x-to-color":[{"mask-x-to":S()}],"mask-image-y-from-pos":[{"mask-y-from":O()}],"mask-image-y-to-pos":[{"mask-y-to":O()}],"mask-image-y-from-color":[{"mask-y-from":S()}],"mask-image-y-to-color":[{"mask-y-to":S()}],"mask-image-radial":[{"mask-radial":[nt,Qe]}],"mask-image-radial-from-pos":[{"mask-radial-from":O()}],"mask-image-radial-to-pos":[{"mask-radial-to":O()}],"mask-image-radial-from-color":[{"mask-radial-from":S()}],"mask-image-radial-to-color":[{"mask-radial-to":S()}],"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":[We]}],"mask-image-conic-from-pos":[{"mask-conic-from":O()}],"mask-image-conic-to-pos":[{"mask-conic-to":O()}],"mask-image-conic-from-color":[{"mask-conic-from":S()}],"mask-image-conic-to-color":[{"mask-conic-to":S()}],"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",nt,Qe]}],filter:[{filter:["","none",nt,Qe]}],blur:[{blur:D()}],brightness:[{brightness:[We,nt,Qe]}],contrast:[{contrast:[We,nt,Qe]}],"drop-shadow":[{"drop-shadow":["","none",h,dt,ot]}],"drop-shadow-color":[{"drop-shadow":S()}],grayscale:[{grayscale:["",We,nt,Qe]}],"hue-rotate":[{"hue-rotate":[We,nt,Qe]}],invert:[{invert:["",We,nt,Qe]}],saturate:[{saturate:[We,nt,Qe]}],sepia:[{sepia:["",We,nt,Qe]}],"backdrop-filter":[{"backdrop-filter":["","none",nt,Qe]}],"backdrop-blur":[{"backdrop-blur":D()}],"backdrop-brightness":[{"backdrop-brightness":[We,nt,Qe]}],"backdrop-contrast":[{"backdrop-contrast":[We,nt,Qe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",We,nt,Qe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[We,nt,Qe]}],"backdrop-invert":[{"backdrop-invert":["",We,nt,Qe]}],"backdrop-opacity":[{"backdrop-opacity":[We,nt,Qe]}],"backdrop-saturate":[{"backdrop-saturate":[We,nt,Qe]}],"backdrop-sepia":[{"backdrop-sepia":["",We,nt,Qe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",nt,Qe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[We,"initial",nt,Qe]}],ease:[{ease:["linear","initial",b,nt,Qe]}],delay:[{delay:[We,nt,Qe]}],animate:[{animate:["none",v,nt,Qe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,nt,Qe]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:T()}],"rotate-x":[{"rotate-x":T()}],"rotate-y":[{"rotate-y":T()}],"rotate-z":[{"rotate-z":T()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:$()}],"skew-x":[{"skew-x":$()}],"skew-y":[{"skew-y":$()}],transform:[{transform:[nt,Qe,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"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:S()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:S()}],"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",nt,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":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",nt,Qe]}],fill:[{fill:["none",...S()]}],"stroke-w":[{stroke:[We,st,Xe,et]}],stroke:[{stroke:["none",...S()]}],"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 wt(...e){return xt(function(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=ie(e))&&(o&&(o+=" "),o+=t);return o}(e))}const kt={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"},Ct="hsl(160, 84%, 39%)";function Nt(e,t){const r={...kt,...t?.cssVariables||{},...e?.cssVariables||{}};return{primaryColor:e?.primaryColor||t?.primaryColor||Ct,botName:e?.botName||t?.botName||"Asistente",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}}function Mt(e){return e.primaryColor||Ct}const zt={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},St=r(zt),jt=r(Et);function At({children:e,animations:t,effects:r}){const o=c(()=>({...zt,...t}),[t]),n=c(()=>({...Et,...r}),[r]);/* @__PURE__ */
|
|
2
|
+
return p(St.Provider,{value:o,children:/* @__PURE__ */p(jt.Provider,{value:n,children:e})})}function _t(){return o(St)}function Ft(){const e=o(jt);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 It(){return"undefined"!=typeof window&&!!window.DEBUG}const Ot={log:(e,...t)=>{It()&&console.log(`[BotUyo] ${e}`,...t)},warn:(e,...t)=>{It()&&console.warn(`[BotUyo] ${e}`,...t)},error:(e,...t)=>{console.error(`[BotUyo] ${e}`,...t)},debug:(e,...t)=>{It()},info:(e,...t)=>{It()&&console.info(`[BotUyo] ${e}`,...t)}},Dt=`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')}`,Tt=function(){const e=Math.floor(1200),t=2*e,r=44+t,o=new ArrayBuffer(r),n=new DataView(o);Lt(n,0,"RIFF"),n.setUint32(4,r-8,!0),Lt(n,8,"WAVE"),Lt(n,12,"fmt "),n.setUint32(16,16,!0),n.setUint16(20,1,!0),n.setUint16(22,1,!0),n.setUint32(24,8e3,!0),n.setUint32(28,16e3,!0),n.setUint16(32,2,!0),n.setUint16(34,16,!0),Lt(n,36,"data"),n.setUint32(40,t,!0);for(let i=0;i<e;i++){const t=i/8e3,r=1-i/e,o=Math.sin(2*Math.PI*880*t)*r*.5*32767;n.setInt16(44+2*i,o,!0)}const s=new Uint8Array(o);let a="";for(let i=0;i<s.length;i++)a+=String.fromCharCode(s[i]);return`data:audio/wav;base64,${btoa(a)}`}();function Lt(e,t,r){for(let o=0;o<r.length;o++)e.setUint8(t+o,r.charCodeAt(o))}function $t(e,t,r){let o,n=r.initialDeps??[],s=!0;function a(){var a,i,l;let c;r.key&&(null==(a=r.debug)?void 0:a.call(r))&&(c=Date.now());const d=e();if(d.length===n.length&&!d.some((e,t)=>n[t]!==e))return o;let m;if(n=d,r.key&&(null==(i=r.debug)?void 0:i.call(r))&&(m=Date.now()),o=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()-m))/100,o=t/16,n=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${n(t,5)} /${n(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*o,120))}deg 100% 31%);`,null==r?void 0:r.key)}return!(null==r?void 0:r.onChange)||s&&r.skipInitialOnChange||r.onChange(o),s=!1,o}return a.updateDeps=e=>{n=e},a}function Ut(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const Pt=(e,t,r)=>{let o;return function(...n){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,n),r)}},Wt=e=>{const{offsetWidth:t,offsetHeight:r}=e;return{width:t,height:r}},Vt=e=>e,Bt=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let n=t;n<=r;n++)o.push(n);return o},Ht=(e,t)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const n=e=>{const{width:r,height:o}=e;t({width:Math.round(r),height:Math.round(o)})};if(n(Wt(r)),!o.ResizeObserver)return()=>{};const s=new o.ResizeObserver(t=>{const o=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void n({width:t.inlineSize,height:t.blockSize})}n(Wt(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return s.observe(r,{box:"border-box"}),()=>{s.unobserve(r)}},Rt={passive:!0},qt="undefined"==typeof window||"onscrollend"in window,Gt=(e,t)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;let n=0;const s=e.options.useScrollendEvent&&qt?()=>{}:Pt(o,()=>{t(n,!1)},e.options.isScrollingResetDelay),a=o=>()=>{const{horizontal:a,isRtl:i}=e.options;n=a?r.scrollLeft*(i?-1:1):r.scrollTop,s(),t(n,o)},i=a(!0),l=a(!1);r.addEventListener("scroll",i,Rt);const c=e.options.useScrollendEvent&&qt;return c&&r.addEventListener("scrollend",l,Rt),()=>{r.removeEventListener("scroll",i),c&&r.removeEventListener("scrollend",l)}},Kt=(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},o)=>{var n,s;const a=e+t;null==(s=null==(n=o.scrollElement)?void 0:n.scrollTo)||s.call(n,{[o.options.horizontal?"left":"top"]:a,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:Vt,rangeExtractor:Bt,onChange:()=>{},measureElement:Kt,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=$t(()=>(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,o=/* @__PURE__ */new Map;for(let n=t-1;n>=0;n--){const t=e[n];if(r.has(t.lane))continue;const s=o.get(t.lane);if(null==s||t.end>s.end?o.set(t.lane,t):t.end<s.end&&r.set(t.lane,!0),r.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=$t(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,r,o,n,s)=>(void 0!==this.prevLanes&&this.prevLanes!==s&&(this.lanesChangedFlag=!0),this.prevLanes=s,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:r,getItemKey:o,enabled:n,lanes:s}),{key:!1}),this.getMeasurements=$t(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:r,getItemKey:o,enabled:n,lanes:s},a)=>{if(!n)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(s).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=o(d),n=this.laneAssignments.get(d);let s,i;if(void 0!==n&&this.options.lanes>1){s=n;const e=c[s],o=void 0!==e?l[e]:void 0;i=o?o.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,s=e?e.lane:d%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(d,s)}const m=a.get(e),u="number"==typeof m?m:this.options.estimateSize(d),h=i+u;l[d]={index:d,start:i,size:u,end:h,key:e,lane:s},c[s]=d}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=$t(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,r,o)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:r,lanes:o}){const n=e.length-1;if(e.length<=o)return{startIndex:0,endIndex:n};let s=Zt(0,n,t=>e[t].start,r),a=s;if(1===o)for(;a<n&&e[a].end<r+t;)a++;else if(o>1){const i=Array(o).fill(0);for(;a<n&&i.some(e=>e<r+t);){const t=e[a];i[t.lane]=t.end,a++}const l=Array(o).fill(r+t);for(;s>=0&&l.some(e=>e>=r);){const t=e[s];l[t.lane]=t.start,s--}s=Math.max(0,s-s%o),a=Math.min(n,a+(o-1-a%o))}return{startIndex:s,endIndex:a}}({measurements:e,outerSize:t,scrollOffset:r,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=$t(()=>{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,o,n)=>null===o||null===n?[]:e({startIndex:o,endIndex:n,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),o=this.measurementsCache[r];if(!o)return;const n=o.key,s=this.elementsCache.get(n);s!==e&&(s&&this.observer.unobserve(s),this.observer.observe(e),this.elementsCache.set(n,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 o=t-(this.itemSizeCache.get(r.key)??r.size);0!==o&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(r,o,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,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=$t(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{const r=[];for(let o=0,n=e.length;o<n;o++){const n=t[e[o]];r.push(n)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return Ut(t[Zt(0,t.length-1,e=>Ut(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 o=this.getSize(),n=this.getScrollOffset();"auto"===t&&(t=e>=n+o?"end":"start"),"center"===t?e+=(r-o)/2:"end"===t&&(e-=o);const s=this.getMaxScrollOffset();return Math.max(Math.min(s,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 o=this.getSize(),n=this.getScrollOffset();if("auto"===t)if(r.end>=n+o-this.options.scrollPaddingEnd)t="end";else{if(!(r.start<=n+this.options.scrollPaddingStart))return[n,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];const s="end"===t?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,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 o=0;const n=t=>{if(!this.targetWindow)return;const o=this.getOffsetForIndex(e,t);if(!o)return void console.warn("Failed to get offset for index:",e);const[n,a]=o;this._scrollToOffset(n,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const t=()=>{if(this.currentScrollToIndex!==e)return;const t=this.getScrollOffset(),r=this.getOffsetForIndex(e,a);var o,n;r?(o=r[0],n=t,Math.abs(o-n)<1.01||s(a)):console.warn("Failed to get offset for index:",e)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(t):t()})},s=t=>{this.targetWindow&&this.currentScrollToIndex===e&&(o++,o<10?this.targetWindow.requestAnimationFrame(()=>n(t)):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};n(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 o=t.length-1;for(;o>=0&&e.some(e=>null===e);){const r=t[o];null===e[r.lane]&&(e[r.lane]=r.end),o--}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 Zt=(e,t,r,o)=>{for(;e<=t;){const n=(e+t)/2|0,s=r(n);if(s<o)e=n+1;else{if(!(s>o))return n;t=n-1}}return e>0?e-1:0},Qt="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;const Xt=d(()=>import("./chunk-audio-Cx_99pbh.js").then(e=>({default:e.AudioPlayer}))),er=d(()=>import("./chunk-gallery-CJ48rYJy.js").then(e=>({default:e.Gallery}))),tr=m(function({message:e,primaryColor:t,botAvatar:r,botName:n="Mar",avatars:s,isFirst:a=!0,isLast:i=!0,index:l=0}){const{t:d}=E("extracted"),m="user"===e.sender,h="system"===e.type||"system"===e.sender,f=!m&&!h,b=Mt({primaryColor:t}),w=function(){const e=o(St);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":""}(),k=c(()=>{if(m)return null;if("text"===e.type){const t=e;if(t.emotion&&s?.[t.emotion])return s[t.emotion]}return r},[e,s,r,m]),C=({href:e,children:t})=>{if(!e)return null;const r=String(t).toLowerCase(),o=r.includes("reservar")||r.includes("ver")||r.includes("pagar");return e.includes("maps.google")||e.includes("goo.gl")?/* @__PURE__ */p("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"block my-2 no-underline group",children:/* @__PURE__ */g("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__ */p("span",{className:"flex-shrink-0 p-2 rounded-full",style:{backgroundColor:`${b}1a`,color:b},children:/* @__PURE__ */p(R,{size:16,strokeWidth:2.5})}),
|
|
4
|
+
/* @__PURE__ */p("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__ */p(P,{size:12,className:"text-muted-foreground/40 group-hover:text-primary"})]})}):o?/* @__PURE__ */g("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:b},children:[t," ",
|
|
6
|
+
/* @__PURE__ */p(O,{size:14})]}):/* @__PURE__ */p("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"font-bold underline decoration-primary/30 hover:decoration-primary transition-all",style:{color:m?"inherit":b},children:t})},N=({src:e,alt:t})=>e?/* @__PURE__ */p(u,{fallback:/* @__PURE__ */p("div",{className:"my-3 animate-pulse",children:/* @__PURE__ */p("div",{className:"w-full h-48 bg-muted rounded-xl"})}),children:/* @__PURE__ */p(er,{images:[{src:e,alt:t}],radius:"rounded-xl"})}):null;return h?/* @__PURE__ */p("div",{className:"flex justify-center my-4 animate-in fade-in zoom-in-95 w-full",children:/* @__PURE__ */p("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__ */g("div",{className:wt("flex w-full mb-0.5 group",w,m?"justify-end":"justify-start gap-3",a&&"mt-3",i&&"mb-3"),style:{animationDelay:50*l+"ms"},children:[!m&&/* @__PURE__ */p("div",{className:"w-9 shrink-0 flex flex-col justify-end pb-1",children:/* @__PURE__ */p("div",i?{className:"h-9 w-9 rounded-full overflow-hidden border shadow-sm",style:{borderColor:"hsl(var(--border))",backgroundColor:"hsl(var(--background))"},children:k?/* @__PURE__ */p("img",{src:k,alt:n,className:"h-full w-full object-cover"}):/* @__PURE__ */p("div",{className:"h-full w-full flex items-center justify-center text-white text-[10px] font-black uppercase",style:{backgroundColor:b},children:n.charAt(0)})}:{className:"w-9"})}),
|
|
7
|
+
/* @__PURE__ */g("div",{className:wt("max-w-[85%] shadow-sm transition-all duration-300 relative",m?"text-primary-foreground":"border",m?wt("rounded-[18px]",a&&"rounded-tr-[4px]",!i&&"rounded-br-[4px]",!a&&!i&&"rounded-r-[4px]"):wt("rounded-[18px]",a&&"rounded-tl-[4px]",!i&&"rounded-bl-[4px]",!a&&!i&&"rounded-l-[4px]")),style:m?{padding:"var(--spacing-4) var(--spacing-5)",backgroundColor:b,boxShadow:i?`0 8px 20px -6px ${b}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 p(u,{fallback:/* @__PURE__ */g("div",{className:"flex items-center gap-3 py-1 min-w-[200px] animate-pulse",children:[
|
|
9
|
+
/* @__PURE__ */p("div",{className:"w-8 h-8 rounded-full bg-muted"}),
|
|
10
|
+
/* @__PURE__ */p("div",{className:"flex-1 space-y-1",children:/* @__PURE__ */p("div",{className:"h-1 w-full bg-muted rounded-full"})})]}),children:/* @__PURE__ */p(Xt,{url:e.content,isBot:f,primaryColor:t})});case"image":{const t=e;/* @__PURE__ */
|
|
11
|
+
return p(u,{fallback:/* @__PURE__ */p("div",{className:"my-3 animate-pulse",children:/* @__PURE__ */p("div",{className:"w-full h-48 bg-muted rounded-xl"})}),children:/* @__PURE__ */p(er,{images:[{src:t.imageUrl||t.content,alt:t.altText||"Imagen"}],radius:"rounded-xl"})})}case"location":{const t=e;/* @__PURE__ */
|
|
12
|
+
return p(C,{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()||"",o=t.fileSize?`${(t.fileSize/1024/1024).toFixed(2)} MB`:"";/* @__PURE__ */
|
|
13
|
+
return g("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:m?"rgba(255,255,255,0.1)":"hsl(var(--muted))",borderColor:m?"rgba(255,255,255,0.2)":"hsl(var(--border))"},children:[
|
|
14
|
+
/* @__PURE__ */p("div",{className:"flex items-center justify-center w-10 h-10 rounded-lg shrink-0",style:{backgroundColor:m?"rgba(255,255,255,0.2)":`${b}1a`,color:m?"white":b},children:/* @__PURE__ */p(W,{size:20,strokeWidth:2.5})}),
|
|
15
|
+
/* @__PURE__ */g("div",{className:"flex-1 min-w-0",children:[
|
|
16
|
+
/* @__PURE__ */p("p",{className:"text-sm font-bold truncate",children:t.fileName}),o&&/* @__PURE__ */g("p",{className:"text-xs opacity-60 mt-0.5",children:[r?.toUpperCase()," • ",o]})]}),
|
|
17
|
+
/* @__PURE__ */p(U,{size:18,className:"shrink-0 opacity-60 group-hover:opacity-100 transition-opacity"})]})}default:/* @__PURE__ */
|
|
18
|
+
return p("div",{className:wt("prose prose-sm max-w-none break-words leading-relaxed dark:prose-invert",m?"text-primary-foreground prose-p:text-white":"text-foreground"),children:/* @__PURE__ */p(v,{remarkPlugins:[x],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:C,img:N,p:({children:e})=>/* @__PURE__ */p("p",{className:"mb-0 last:mb-0",children:e})},children:e.content||""})})}})(),i&&/* @__PURE__ */g("div",{className:wt("flex items-center gap-1 mt-1.5 opacity-50 select-none text-[9px]",m?"justify-end":"justify-start"),children:[
|
|
19
|
+
/* @__PURE__ */p("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)}),m&&/* @__PURE__ */p(D,{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)),rr=m(function(){/* @__PURE__ */
|
|
20
|
+
return p("div",{className:wt("flex items-center self-start animate-in fade-in duration-200","max-w-[85%] sm:max-w-[75%]"),children:/* @__PURE__ */p("div",{className:"border rounded-[18px] rounded-tl-[4px] px-4 py-3 shadow-soft-sm",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"},children:/* @__PURE__ */p("div",{className:"flex items-center gap-1.5",children:[0,1,2].map(e=>/* @__PURE__ */p("span",{className:"h-1.5 w-1.5 rounded-full animate-bounce",style:{backgroundColor:"hsl(var(--primary) / 0.4)",animationDelay:150*e+"ms",animationDuration:"800ms"}},e))})})})});function or(e,t){const r=e.getTime()-t.getTime();return Math.floor(r/1e3/60)}function nr(e){return new Intl.DateTimeFormat("es-ES",{hour:"2-digit",minute:"2-digit"}).format(e)}const sr=m(function({messages:r,isTyping:o,welcomeMessage:a="¡Hola! ¿En qué puedo ayudarte?",primaryColor:i,logoUrl:l,botName:c="Mar",bubbleStyles:d,avatars:m}){const u=h(null),f=h(null),[v,y]=n(!1),[x,w]=n(!1),k=Mt({primaryColor:i}),C=r.length>100,N=(M={count:r.length,getScrollElement:()=>f.current,estimateSize:()=>80,overscan:5,enabled:C},function({useFlushSync:t=!0,...r}){const o=e.useReducer(()=>({}),{})[1],n={...r,onChange:(e,n)=>{var s;t&&n?b(o):o(),null==(s=r.onChange)||s.call(r,e,n)}},[s]=e.useState(()=>new Jt(n));return s.setOptions(n),Qt(()=>s._didMount(),[]),Qt(()=>s._willUpdate()),s}({observeElementRect:Ht,observeElementOffset:Gt,scrollToFn:Yt,...M}));var M;s(()=>{y(!0)},[]),s(()=>{if(v&&(r.length>0||o)){const e=setTimeout(()=>{C?N.scrollToIndex(r.length-1,{align:"end",behavior:r.length<=1?"auto":"smooth"}):u.current?.scrollIntoView({behavior:r.length<=1?"auto":"smooth",block:"end"})},100);return()=>clearTimeout(e)}},[r.length,o,v,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, ${nr(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, ${nr(e)}`:function(e){return new Intl.DateTimeFormat("es-ES",{day:"numeric",month:"long",hour:"2-digit",minute:"2-digit"}).format(e)}(e)}(t)};return v?/* @__PURE__ */g("div",C?{ref:f,className:"flex-1 overflow-y-auto scroll-smooth bg-background/50 scrollbar-none",style:{padding:"var(--spacing-5)"},children:[
|
|
21
|
+
/* @__PURE__ */p("div",{style:{height:`${N.getTotalSize()}px`,width:"100%",position:"relative"},children:N.getVirtualItems().map(e=>{const t=r[e.index],o=e.index,n=r[o-1],s=r[o+1],a=n&&or(new Date(t.timestamp),new Date(n.timestamp))>15,u=n&&n.sender===t.sender&&or(new Date(t.timestamp),new Date(n.timestamp))<5&&!a,h=s&&s.sender===t.sender&&or(new Date(s.timestamp),new Date(t.timestamp))<5;/* @__PURE__ */
|
|
22
|
+
return g("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${e.start}px)`},children:[a&&/* @__PURE__ */p("div",{className:"flex justify-center my-8 animate-in fade-in zoom-in-95",children:/* @__PURE__ */p("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__ */p(tr,{message:t,primaryColor:i,botAvatar:l,botName:c,styles:d,avatars:m,isFirst:!u,isLast:!h})]},e.key)})}),o&&/* @__PURE__ */g("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__ */p("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__ */g("div",{className:"flex gap-[2px]",children:[
|
|
25
|
+
/* @__PURE__ */p("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.3s]"}),
|
|
26
|
+
/* @__PURE__ */p("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.15s]"}),
|
|
27
|
+
/* @__PURE__ */p("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce"})]})}),
|
|
28
|
+
/* @__PURE__ */p(rr,{})]})]}:{ref:f,className:"flex-1 overflow-y-auto scroll-smooth p-4 bg-background/50 scrollbar-none",children:[
|
|
29
|
+
/* @__PURE__ */g("div",{className:"min-h-full flex flex-col justify-end",children:[0===r.length&&/* @__PURE__ */g("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__ */g("div",{className:"relative h-24 w-24 mb-6",children:[
|
|
31
|
+
/* @__PURE__ */p("div",{className:"absolute inset-0 bg-primary/20 rounded-full animate-pulse blur-2xl"}),
|
|
32
|
+
/* @__PURE__ */p("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:x?/* @__PURE__ */p("div",{className:"h-full w-full flex items-center justify-center text-3xl",style:{backgroundColor:k},children:"👋"}):l?/* @__PURE__ */p("img",{src:l,className:"object-cover h-full w-full",alt:c,onError:()=>w(!0)}):/* @__PURE__ */p("div",{className:"h-full w-full flex items-center justify-center text-3xl",style:{backgroundColor:k},children:"👋"})})]}),
|
|
33
|
+
/* @__PURE__ */g("div",{className:"space-y-2",children:[
|
|
34
|
+
/* @__PURE__ */p("h3",{className:"font-black text-xl text-foreground uppercase tracking-tighter italic",children:c}),
|
|
35
|
+
/* @__PURE__ */g("p",{className:"text-[12px] font-bold text-muted-foreground italic px-10 leading-relaxed opacity-60",children:['"',a,'"']})]})]}),
|
|
36
|
+
/* @__PURE__ */p("div",{className:"flex flex-col",style:{gap:"var(--spacing-3)"},children:r.map((e,o)=>{const n=r[o-1],s=r[o+1],a=n&&or(new Date(e.timestamp),new Date(n.timestamp))>15,u=n&&n.sender===e.sender&&or(new Date(e.timestamp),new Date(n.timestamp))<5&&!a,h=s&&s.sender===e.sender&&or(new Date(s.timestamp),new Date(e.timestamp))<5;/* @__PURE__ */
|
|
37
|
+
return g(t.Fragment,{children:[a&&/* @__PURE__ */p("div",{className:"flex justify-center my-8 animate-in fade-in zoom-in-95",children:/* @__PURE__ */p("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__ */p(tr,{message:e,primaryColor:i,botAvatar:l,botName:c,styles:d,avatars:m,isFirst:!u,isLast:!h})]},e.id||`msg-${o}`)})}),
|
|
39
|
+
/* @__PURE__ */p("div",{ref:u,className:"h-6 shrink-0"})]}),o&&/* @__PURE__ */g("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__ */p("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__ */g("div",{className:"flex gap-[2px]",children:[
|
|
41
|
+
/* @__PURE__ */p("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.3s]"}),
|
|
42
|
+
/* @__PURE__ */p("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.15s]"}),
|
|
43
|
+
/* @__PURE__ */p("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce"})]})}),
|
|
44
|
+
/* @__PURE__ */p(rr,{})]})]}):/* @__PURE__ */p("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],o=t.messages[t.messages.length-1];return r?.id===o?.id}),ar={"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 ir(e,t={}){const{maxSizeMB:r=10,allowedExtensions:o,checkMagicBytes:n=!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(o&&!function(e,t){const r=e.name.split(".").pop()?.toLowerCase();return!!r&&t.includes(r)}(e,o))return{valid:!1,error:`Extensión no permitida. Solo: ${o.join(", ")}`};if(n){const t=await async function(e){try{const t=ar[e.type];if(!t)return!0;const r=await e.slice(0,12).arrayBuffer(),o=new Uint8Array(r);return t.every((e,t)=>o[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 lr=1e3,cr={enableImages:!0,enableAudio:!0,enableFiles:!0,enableLocation:!0,allowedFileTypes:["jpg","jpeg","png","webp","gif","pdf","doc","docx","txt","zip"],maxFileSizeMB:10};function dr({isConnected:e,placeholder:t="Escribe un mensaje...",primaryColor:r,mediaConfig:o,onSendMessage:s,onSendAttachment:a,onSendLocation:i,onVoiceCall:l}){const{t:d}=E(),[m,u]=n(""),[b,v]=n(!1),[y,x]=n(!1),[w,k]=n(0),[C,N]=n(null),[M,z]=n(!1),[S,j]=n(!1),A=h(null),_=h(null),F=h(null),I=h(null),O=h([]),D=h(null),T=Mt({primaryColor:r}),L=c(()=>({...cr,...o}),[o]),$=c(()=>L.enableImages||L.enableAudio||L.enableFiles||L.enableLocation,[L]),U=()=>{const t=m.trim();C?(a?.(C.file,C.type),N(null),u("")):t&&e&&(s(t),u("")),A.current&&(A.current.style.height="40px")},P=async e=>{const t=e.target.files?.[0];if(!t)return;v(!1);const r=await ir(t,{maxSizeMB:L.maxFileSizeMB||10,allowedExtensions:L.allowedFileTypes||["jpg","jpeg","png","webp","gif","pdf","doc","docx","txt","zip"],checkMagicBytes:!0});if(r.valid)if(t.type.startsWith("image/")&&L.enableImages){z(!0);try{const{default:e}=await import("./browser-image-compression-CsxM8KJN.js"),r={maxSizeMB:.8,maxWidthOrHeight:1200,useWebWorker:!0},o=await e(t,r);N({type:"image",file:o,previewUrl:URL.createObjectURL(o)})}catch(o){Ot.error("Image compression failed:",o),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")},V=async e=>{if(I.current&&(e||(I.current.onstop=null),I.current.stop(),I.current.stream.getTracks().forEach(e=>e.stop())),D.current&&clearInterval(D.current),x(!1),k(0),e&&O.current.length>0){const e=new Blob(O.current,{type:"audio/webm"}),t=new File([e],`audio-${Date.now()}.webm`,{type:"audio/webm"}),r=await ir(t,{maxSizeMB:10});if(!r.valid)return Ot.error("Audio validation failed:",r.error),alert(r.error),void(O.current=[]);a?.(t,"audio"),O.current=[]}};/* @__PURE__ */
|
|
45
|
+
return g("div",{className:"relative",children:[(C||M)&&/* @__PURE__ */p("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__ */p("div",{className:"relative w-16 h-16",children:M?/* @__PURE__ */p("div",{className:"w-full h-full flex flex-col items-center justify-center bg-muted rounded-xl",children:/* @__PURE__ */p(H,{className:"animate-spin text-primary h-5 w-5"})}):/* @__PURE__ */g(f,"image"===C?.type?{children:[
|
|
46
|
+
/* @__PURE__ */p("img",{src:C?.previewUrl,className:"w-full h-full object-cover rounded-xl border",alt:d("preview")}),
|
|
47
|
+
/* @__PURE__ */p("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__ */p(se,{size:10,strokeWidth:3})})]}:{children:[
|
|
48
|
+
/* @__PURE__ */g("div",{className:"w-full h-full flex flex-col items-center justify-center bg-muted rounded-xl border",children:[
|
|
49
|
+
/* @__PURE__ */p(W,{className:"text-primary h-6 w-6"}),
|
|
50
|
+
/* @__PURE__ */p("span",{className:"text-[8px] mt-1 font-bold truncate max-w-[60px]",children:C?.file.name})]}),
|
|
51
|
+
/* @__PURE__ */p("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__ */p(se,{size:10,strokeWidth:3})})]})})}),
|
|
52
|
+
/* @__PURE__ */p("input",{type:"file",accept:"image/*",className:"hidden",ref:F,onChange:P}),
|
|
53
|
+
/* @__PURE__ */p("input",{type:"file",accept:L.allowedFileTypes?.map(e=>`.${e}`).join(","),className:"hidden",ref:_,onChange:P}),
|
|
54
|
+
/* @__PURE__ */g("div",{className:"flex items-center max-w-full",style:{gap:"var(--spacing-3)"},children:[$&&a&&/* @__PURE__ */g("div",{className:"relative shrink-0",children:[b&&/* @__PURE__ */g("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:[L.enableImages&&/* @__PURE__ */g("button",{onClick:()=>F.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__ */p(B,{size:18,className:"text-blue-500"})," ",d("fotos")]}),L.enableFiles&&/* @__PURE__ */g("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__ */p(W,{size:18,className:"text-purple-500"})," Archivos"]}),L.enableLocation&&i&&/* @__PURE__ */g("button",{onClick:()=>{j(!0),navigator.geolocation.getCurrentPosition(e=>{i?.({latitude:e.coords.latitude,longitude:e.coords.longitude}),j(!1),v(!1)},()=>j(!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__ */p(H,{size:18,className:"animate-spin"}):/* @__PURE__ */p(R,{size:18,className:"text-emerald-500"})," ",d("ubicacion")]}),L.enableVoice&&l&&/* @__PURE__ */g("button",{onClick:()=>{l?.(),v(!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__ */p(Z,{size:18,className:"text-amber-500"})," Llamar"]})]}),
|
|
58
|
+
/* @__PURE__ */p("button",{onClick:()=>v(!b),className:wt("h-10 w-10 rounded-full flex items-center justify-center transition-all shadow-sm z-10",b?"bg-muted text-foreground rotate-45":"bg-muted/50 text-muted-foreground hover:bg-muted"),children:/* @__PURE__ */p(X,{size:22,strokeWidth:2.5})})]}),
|
|
59
|
+
/* @__PURE__ */p("div",{className:wt("flex-1 relative flex items-center min-w-0 rounded-[24px] border px-4 transition-all shadow-inner",y?"h-[44px]":"min-h-[40px] max-h-[120px]"),style:{backgroundColor:y?"hsl(var(--destructive) / 0.05)":"hsl(var(--muted))",borderColor:y?"hsl(var(--destructive))":"hsl(var(--border))"},children:/* @__PURE__ */g("div",y?{className:"flex items-center w-full animate-in zoom-in-95",style:{gap:"var(--spacing-4)"},children:[
|
|
60
|
+
/* @__PURE__ */p("button",{onClick:()=>V(!1),className:"text-destructive/50 hover:text-destructive",children:/* @__PURE__ */p(oe,{size:18})}),
|
|
61
|
+
/* @__PURE__ */g("div",{className:"flex-1 flex items-center",style:{gap:"var(--spacing-2)"},children:[
|
|
62
|
+
/* @__PURE__ */p("div",{className:"flex gap-[3px]",children:[1,2,3,4].map(e=>/* @__PURE__ */p("span",{className:"w-[3px] h-3 bg-destructive/60 rounded-full animate-pulse",style:{animationDelay:.15*e+"s"}},e))}),
|
|
63
|
+
/* @__PURE__ */g("span",{className:"text-destructive font-black text-[11px] tabular-nums",children:[Math.floor(w/60),":",(w%60).toString().padStart(2,"0")]})]}),
|
|
64
|
+
/* @__PURE__ */p("button",{onClick:()=>V(!0),className:"w-7 h-7 rounded-full bg-destructive flex items-center justify-center text-white shadow-lg",children:/* @__PURE__ */p(te,{size:12,fill:"currentColor"})})]}:{className:"w-full relative flex items-center",children:[
|
|
65
|
+
/* @__PURE__ */p("textarea",{ref:A,rows:1,value:m,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,lr);u(t),A.current&&(A.current.style.height="40px",A.current.style.height=`${Math.min(A.current.scrollHeight,120)}px`)},onFocus:()=>v(!1),placeholder:t,"aria-label":d("accessibility.typeMessage"),"aria-describedby":"send-message-hint","aria-invalid":m.length>lr,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__ */p("span",{id:"send-message-hint",className:"sr-only",children:d("accessibility.sendMessageHint")}),m.length>800&&/* @__PURE__ */p("span",{className:wt("absolute right-0 text-[9px] font-bold tabular-nums",m.length>=lr?"text-destructive":"text-muted-foreground/40"),children:lr-m.length})]})}),!y&&/* @__PURE__ */p(f,{children:m.trim()||C?/* @__PURE__ */p("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__ */p(te,{size:18,className:"text-white ml-0.5 fill-current"})}):L.enableAudio&&a?/* @__PURE__ */p("button",{onClick:async()=>{if(e)try{const e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e);I.current=t,O.current=[],t.ondataavailable=e=>O.current.push(e.data),t.onstop=()=>{const e=new File([new Blob(O.current)],"voice.webm",{type:"audio/webm"});a?.(e,"audio")},t.start(),x(!0),D.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__ */p(K,{size:20,strokeWidth:2.5,className:"text-white"})}):/* @__PURE__ */p("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__ */p(te,{size:18,className:"text-white ml-0.5 fill-current"})})})]})]})}function mr(e,t){let r=0,o=null;return function(...n){const s=Date.now(),a=s-r,i=()=>{r=s,e(...n)};a>=t?(o&&(clearTimeout(o),o=null),i()):o||(o=setTimeout(()=>{i(),o=null},t-a))}}function ur(e=640){const[t,r]=n(()=>"undefined"!=typeof window&&window.innerWidth<e);return s(()=>{const t=mr(()=>{r(window.innerWidth<e)},250);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e]),t}const hr="24px",pr=["¡Hola! Gracias por llamar. ¿En qué puedo ayudarte hoy?","Entendido. Déjame revisar esa información para ti.","Claro, puedo ayudarte con eso. ¿Necesitas algo más?","Perfecto. Tu solicitud ha sido registrada.","No hay problema. ¿Tienes alguna otra consulta?"];function gr({isOpen:e,onClose:t,primaryColor:r="#10b981"}){const[o,i]=n("idle"),[l,c]=n(0),[d,m]=n(0),[u,f]=n(null),[b,v]=n([.15,.15,.15,.15,.15,.15,.15]),[y,x]=n(""),[w,k]=n(0),[C,N]=n(!1),M=h(null),z=h(null),E=h(null),S=h(null),j=h(null),A=h(null),_=h(0),F=a(()=>{const e=pr[w%pr.length];x(e),k(e=>e+1),i("speaking"),N(!1);const t=Math.max(2500,60*e.length);A.current=setTimeout(()=>{i("listening"),x(""),_.current=0},t)},[w]),I=a(async()=>{try{i("connecting"),f(null);const e=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1}});M.current=e;const t=new(window.AudioContext||window.webkitAudioContext);z.current=t,"suspended"===t.state&&await t.resume();const r=t.createAnalyser();r.fftSize=256,r.smoothingTimeConstant=.3,E.current=r,t.createMediaStreamSource(e).connect(r);const o=new Uint8Array(r.frequencyBinCount),n=7,s=()=>{if(!E.current)return;E.current.getByteTimeDomainData(o);let e=0;for(let n=0;n<o.length;n++){const t=(o[n]-128)/128;e+=t*t}const t=Math.sqrt(e/o.length),r=Math.min(15*t,1);m(r);const a=Array.from({length:n},(e,t)=>{const o=Math.abs(t-Math.floor(n/2)),s=.05+.1*Math.random(),a=r*(1-.12*o);return Math.max(.12,Math.min(1,a+s))});v(a),S.current=requestAnimationFrame(s)};s(),j.current=setInterval(()=>{c(e=>e+1)},1e3),i("speaking"),x(pr[0]),k(1),A.current=setTimeout(()=>{i("listening"),x("")},3500)}catch(e){console.error("[VoiceCallDemo] Microphone error:",e),f("No se pudo acceder al micrófono"),i("idle")}},[]);s(()=>{"listening"===o?d>.08?(N(!0),_.current=0):C&&d<.05&&(0===_.current?_.current=Date.now():(Date.now()-_.current)/1e3>=1&&F()):_.current=0},[d,o,C,F]);const O=a(()=>{S.current&&(cancelAnimationFrame(S.current),S.current=null),j.current&&(clearInterval(j.current),j.current=null),A.current&&(clearTimeout(A.current),A.current=null),M.current&&(M.current.getTracks().forEach(e=>e.stop()),M.current=null),z.current&&(z.current.close(),z.current=null),E.current=null,m(0),c(0),v([.15,.15,.15,.15,.15,.15,.15]),i("idle"),x(""),N(!1),_.current=0},[]),D=a(()=>{if(!M.current)return;const e=M.current.getAudioTracks()[0];e&&(e.enabled=!e.enabled,i(e.enabled?"listening":"muted"))},[]),T=a(()=>{O(),t()},[O,t]);if(s(()=>(e&&"idle"===o&&I(),()=>{e||O()}),[e,o,I,O]),s(()=>()=>{O()},[O]),!e)return null;const L=Array.from({length:7},(e,t)=>{const r=(Date.now()/120+.6*t)%(2*Math.PI);return.25+.5*Math.sin(r)});/* @__PURE__ */
|
|
67
|
+
return g("div",{className:"absolute inset-0 z-50 flex flex-col items-center justify-center rounded-2xl overflow-hidden",style:{background:"hsl(var(--background) / 0.98)",backdropFilter:"blur(10px)"},children:[
|
|
68
|
+
/* @__PURE__ */g("div",{className:"absolute top-0 left-0 right-0 flex items-center justify-between p-4 border-b border-border/50",children:[
|
|
69
|
+
/* @__PURE__ */g("div",{className:"flex items-center gap-2",children:[
|
|
70
|
+
/* @__PURE__ */p(Z,{className:"h-4 w-4",style:{color:r}}),
|
|
71
|
+
/* @__PURE__ */p("span",{className:"text-sm font-medium",children:"Llamada"})]}),
|
|
72
|
+
/* @__PURE__ */p("span",{className:"text-sm font-mono text-muted-foreground",children:(e=>{const t=e%60;return`${Math.floor(e/60).toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`})(l)})]}),
|
|
73
|
+
/* @__PURE__ */g("div",{className:"flex flex-col items-center gap-5 px-4",children:[
|
|
74
|
+
/* @__PURE__ */g("div",{className:wt("h-20 w-20 rounded-full flex items-center justify-center transition-all duration-150","connecting"===o&&"animate-pulse"),style:{backgroundColor:"muted"===o?"hsl(var(--muted))":"speaking"===o?"#3b82f620":`${r}20`,boxShadow:"listening"===o?`0 0 ${15+35*d}px ${r}50`:"speaking"===o?"0 0 25px #3b82f650":"none",transform:"listening"===o?`scale(${1+.08*d})`:"scale(1)"},children:["connecting"===o&&/* @__PURE__ */p(Z,{className:"h-8 w-8 animate-bounce",style:{color:r}}),"listening"===o&&/* @__PURE__ */p(K,{className:"h-8 w-8",style:{color:r}}),"muted"===o&&/* @__PURE__ */p(G,{className:"h-8 w-8 text-muted-foreground"}),"speaking"===o&&/* @__PURE__ */p(ne,{className:"h-8 w-8 text-blue-500"})]}),("listening"===o||"muted"===o||"speaking"===o)&&/* @__PURE__ */p("div",{className:"flex items-center gap-1.5 h-12",children:("speaking"===o?L:b).map((e,t)=>/* @__PURE__ */p("div",{className:"w-2 rounded-full",style:{height:`${Math.max(5,45*e)}px`,backgroundColor:"muted"===o?"hsl(var(--muted-foreground))":"speaking"===o?"#3b82f6":r,opacity:"muted"===o?.3:.85,transition:"height 60ms ease-out"}},t))}),"speaking"===o&&y&&/* @__PURE__ */p("div",{className:"max-w-[280px] p-3 rounded-xl text-center text-sm leading-relaxed",style:{backgroundColor:"hsl(var(--muted))",color:"hsl(var(--foreground))"},children:y}),u&&/* @__PURE__ */p("p",{className:"text-sm text-red-500 text-center px-4",children:u})]}),
|
|
75
|
+
/* @__PURE__ */g("div",{className:"absolute bottom-6 flex items-center gap-4",children:[
|
|
76
|
+
/* @__PURE__ */p("button",{type:"button",onClick:D,disabled:"connecting"===o||"speaking"===o,className:wt("h-12 w-12 rounded-full flex items-center justify-center","transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-offset-2","disabled:opacity-50","muted"===o?"bg-amber-500 hover:bg-amber-600 text-white focus:ring-amber-500":"bg-muted hover:bg-muted/80 text-foreground focus:ring-primary"),"aria-label":"muted"===o?"Activar micrófono":"Silenciar",children:/* @__PURE__ */p("muted"===o?G:K,{className:"h-5 w-5"})}),
|
|
77
|
+
/* @__PURE__ */p("button",{type:"button",onClick:T,className:wt("h-14 w-14 rounded-full flex items-center justify-center","bg-red-500 hover:bg-red-600 text-white","shadow-lg transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2","active:scale-95"),"aria-label":"Terminar llamada",children:/* @__PURE__ */p(J,{className:"h-6 w-6"})})]})]})}function fr({isOpen:e,isConnected:t,isTyping:r,messages:o,botName:i="Mar",logoUrl:l,welcomeMessage:c,inputPlaceholder:d,primaryColor:m,mediaConfig:u,onClose:b,onSendMessage:v,bubbleStyles:y,avatars:x,onSendAttachment:w,onSendLocation:k,onVoiceCall:C,theme:N}){const[M,z]=n(!1),[S,j]=n(!1),{t:A}=E(),_=ur(),F=Mt({primaryColor:m}),I=function({isOpen:e,height:t,bottom:r}){const o=ur(),[i,l]=n({}),c=a(()=>{if(o){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||hr)||24,o=window.innerHeight-64-e;if(t){const e=parseFloat(t)||700,n=Math.min(e,o);l({height:`${n}px`,maxHeight:`${o}px`,bottom:r||hr})}else{const e=Math.min(700,Math.max(500,o));l({height:`${e}px`,maxHeight:`${o}px`,bottom:r||hr})}}},[o,t,r]);return s(()=>{if(!e)return;const t=c();return window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c),t&&t()}},[e,c]),i}({isOpen:e,height:N?.height,bottom:N?.bottom}),O=function({enabled:e,returnFocusRef:t,onEscape:r}){const o=h(null),n=h(null);return s(()=>{if(!e)return;n.current=document.activeElement;const s=t?.current,a=o.current;if(!a)return;const i=setTimeout(()=>{const e=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');e.length>0?e[0].focus():a.focus()},100),l=e=>{if(a)if("Escape"!==e.key){if("Tab"===e.key){const t=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0===t.length)return;const r=t[0],o=t[t.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),o.focus()):e.shiftKey||document.activeElement!==o||(e.preventDefault(),r.focus())}}else r?.()};return document.addEventListener("keydown",l),()=>{clearTimeout(i),document.removeEventListener("keydown",l);const e=s||n.current;e&&"function"==typeof e.focus&&e.focus()}},[e,r,t]),o}({enabled:e,onEscape:b});if(s(()=>{if(e)return _&&(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,_]),!e)return null;const D="bottom-left"===N?.position;/* @__PURE__ */
|
|
78
|
+
return g(f,{children:[
|
|
79
|
+
/* @__PURE__ */p("div",{id:"chat-window-description",className:"sr-only",children:A("accessibility.dialogDescription")}),
|
|
80
|
+
/* @__PURE__ */g("div",{ref:O,role:"dialog","aria-modal":"true","aria-labelledby":"chat-window-title","aria-describedby":"chat-window-description",tabIndex:-1,className:wt("flex flex-col overflow-hidden transition-all duration-500 ease-[cubic-bezier(0.16,1,0.3,1)]","text-foreground z-[9999]",!_&&["fixed",D?"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"],_&&["fixed inset-0 w-full"]),style:{...I,backgroundColor:"hsl(var(--background))",borderColor:"hsl(var(--border))",color:"hsl(var(--foreground))"},children:[
|
|
81
|
+
/* @__PURE__ */p("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__ */g("div",{className:"flex items-center justify-between",children:[
|
|
82
|
+
/* @__PURE__ */g("div",{className:"flex items-center gap-3",children:[
|
|
83
|
+
/* @__PURE__ */g("div",{className:"relative",children:[
|
|
84
|
+
/* @__PURE__ */p("div",{className:"h-10 w-10 rounded-2xl overflow-hidden bg-primary/10 border-2 border-background shadow-soft-sm",children:M?/* @__PURE__ */p("div",{className:"h-full w-full flex items-center justify-center bg-muted text-muted-foreground",children:/* @__PURE__ */p("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */p("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__ */p("img",{src:l||Dt,alt:i,className:"h-full w-full object-cover",onError:()=>z(!0)})}),
|
|
85
|
+
/* @__PURE__ */p("div",{className:wt("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")})]}),
|
|
86
|
+
/* @__PURE__ */g("div",{className:"flex flex-col",children:[
|
|
87
|
+
/* @__PURE__ */g("div",{className:"flex items-center gap-1",children:[
|
|
88
|
+
/* @__PURE__ */p("span",{id:"chat-window-title",className:"font-black text-xs uppercase tracking-tight text-foreground",children:i}),
|
|
89
|
+
/* @__PURE__ */p(re,{className:"h-3 w-3 text-primary fill-primary/10"})]}),
|
|
90
|
+
/* @__PURE__ */g("div",{id:"chat-window-description",className:"flex items-center gap-1.5 mt-0.5",children:[
|
|
91
|
+
/* @__PURE__ */p("span",{className:"flex h-1 w-1 rounded-full bg-emerald-500"}),
|
|
92
|
+
/* @__PURE__ */p("span",{className:"text-[9px] font-black text-muted-foreground uppercase tracking-[0.1em]",children:A(t?"online":"offline")})]})]})]}),
|
|
93
|
+
/* @__PURE__ */g("div",{className:"flex items-center gap-2",children:[C&&/* @__PURE__ */p("button",{onClick:()=>j(!0),"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__ */p(Z,{className:"h-4 w-4","aria-hidden":"true"})}),
|
|
94
|
+
/* @__PURE__ */p("button",{onClick:b,"aria-label":A("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__ */p(se,{className:"h-4 w-4","aria-hidden":"true"})})]})]})}),
|
|
95
|
+
/* @__PURE__ */g("main",{role:"region","aria-label":A("accessibility.chatMessages"),className:"flex-1 min-h-0 relative flex flex-col",style:{padding:"var(--spacing-5)",backgroundColor:"hsl(var(--muted))"},children:[
|
|
96
|
+
/* @__PURE__ */p(sr,{messages:o,isTyping:r,welcomeMessage:c,primaryColor:m,logoUrl:l,botName:i,bubbleStyles:y,avatars:x}),
|
|
97
|
+
/* @__PURE__ */p("div",{className:"absolute top-0 left-0 right-0 h-6 bg-gradient-to-b from-background/10 to-transparent pointer-events-none"})]}),
|
|
98
|
+
/* @__PURE__ */g("footer",{className:"border-t",style:{paddingTop:"var(--spacing-5)",paddingLeft:"var(--spacing-5)",paddingRight:"var(--spacing-5)",paddingBottom:_?"max(var(--spacing-3), env(safe-area-inset-bottom))":"var(--spacing-3)",backgroundColor:"hsl(var(--background))",borderColor:"hsl(var(--border))"},children:[
|
|
99
|
+
/* @__PURE__ */p(dr,{isConnected:t,placeholder:d,primaryColor:F,mediaConfig:u,onSendMessage:v,onSendAttachment:w,onSendLocation:k,onVoiceCall:C}),
|
|
100
|
+
/* @__PURE__ */g("div",{className:"flex items-center justify-center gap-1 opacity-25 select-none",style:{marginTop:"var(--spacing-2)",paddingBottom:"var(--spacing-1)"},children:[
|
|
101
|
+
/* @__PURE__ */p(V,{className:"h-2 w-2 text-primary fill-primary"}),
|
|
102
|
+
/* @__PURE__ */p("span",{className:"text-[7px] font-bold uppercase tracking-[0.2em]",children:A("con_amor_paseo_libre")})]})]}),
|
|
103
|
+
/* @__PURE__ */p(gr,{isOpen:S,onClose:()=>j(!1),primaryColor:F})]})]})}export{$ as C,Dt as D,H as L,q as M,Y as P,ee as R,se as X,ae as Z,Q as a,T as b,wt as c,L as d,_t as e,Ft as f,Mt as g,Tt as h,M as i,ur as j,At as k,Ot as l,Nt as m,fr as n,z as o,mr as t,E as u};
|
|
104
|
+
//# sourceMappingURL=chunk-chat-ui-DRDmUvk-.js.map
|