client-chat-widget
Version:
Widget de chat embebible (React + SignalR) con theming por CSS tokens y montaje dinámico.
28 lines (26 loc) • 318 kB
JavaScript
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.gtc-chat-root:root,:root{--chat-primary: var(--chat-color-primary, #3b82f6);--chat-primary-hover: var(--chat-color-primary-accent, #2563eb);--chat-secondary: var(--chat-color-text-muted, #94a3b8);--chat-success: var(--chat-color-success, #16a34a);--chat-danger: var(--chat-color-danger, #f87171);--chat-warning: var(--chat-color-warning, #fbbf24);--chat-bg: var(--chat-color-bg, #ffffff);--chat-bg-light: var(--chat-color-bg-soft, #fdfefe);--chat-bg-border: var(--chat-color-border, #e5e7eb);--chat-text: var(--chat-color-text, #1e293b);--chat-text-light: var(--chat-color-text-muted, #64748b);--chat-radius: var(--chat-radius, 14px);--chat-shadow: var(--chat-shadow, 0 6px 18px rgba(0, 0, 0, .08));--chat-transition: var(--chat-transition, all .2s ease);--chat-font: var(--chat-font-family, system-ui, sans-serif)}.gtc-chat-root .chat-widget-window,.gtc-chat-root .chat-widget-window *{box-sizing:border-box;font-family:var(--chat-font);-webkit-font-smoothing:antialiased}.gtc-chat-root .chat-fab{position:fixed;bottom:24px;right:24px;width:56px;height:56px;background:var(--chat-primary);border:none;border-radius:50%;display:flex;align-items:center;justify-content:center;box-shadow:var(--chat-shadow);transition:var(--chat-transition);cursor:pointer;z-index:1000}.gtc-chat-root .chat-fab:hover{background:var(--chat-primary-hover);transform:translateY(-2px)}.gtc-chat-root .chat-fab .unread-badge{position:absolute;top:-6px;right:-6px;background:var(--chat-danger);color:#fff;border-radius:12px;min-width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:.75rem;font-weight:600;border:2px solid white}.gtc-chat-root .chat-widget-window{position:fixed;bottom:90px;right:20px;width:360px;height:500px;background:var(--chat-bg);-webkit-backdrop-filter:saturate(140%) blur(6px);backdrop-filter:saturate(140%) blur(6px);border-radius:var(--chat-radius);box-shadow:var(--chat-shadow);display:flex;flex-direction:column;overflow:hidden;z-index:999;animation:slideUp .3s ease;border:1px solid var(--chat-bg-border)}.gtc-chat-root .chat-widget-window.minimized{height:60px}.gtc-chat-root .chat-widget-window.maximized{width:400px;height:600px}.gtc-chat-root .chat-header{background:linear-gradient(135deg,var(--chat-primary),var(--chat-primary-hover));color:#fff;padding:16px;display:flex;align-items:center;justify-content:space-between;border-radius:var(--chat-radius) var(--chat-radius) 0 0}.gtc-chat-root .chat-header-info{flex:1;min-width:0}.gtc-chat-root .chat-title{font-weight:600;font-size:1rem;margin:0 0 2px;line-height:1.3}.gtc-chat-root .chat-status{display:flex;align-items:center;gap:8px;font-size:.875rem;opacity:.9}.gtc-chat-root .status-indicator{width:8px;height:8px;background:var(--chat-success);border-radius:50%;animation:pulse 2s infinite}.gtc-chat-root .status-indicator.offline{background:var(--chat-secondary);animation:none}.gtc-chat-root .chat-header-actions{display:flex;gap:4px}.gtc-chat-root .header-btn,.gtc-chat-root .close-btn{background:#ffffff1a;border:none;color:#fff;border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:var(--chat-transition)}.gtc-chat-root .header-btn:hover,.gtc-chat-root .close-btn:hover{background:#fff3}.gtc-chat-root .close-btn:hover{background:var(--chat-danger)}.gtc-chat-root .chat-messages{flex:1;padding:16px;background:var(--chat-bg-light);overflow-y:auto;scroll-behavior:smooth}.gtc-chat-root .chat-messages::-webkit-scrollbar{width:6px}.gtc-chat-root .chat-messages::-webkit-scrollbar-thumb{background:var(--chat-secondary);border-radius:3px}.gtc-chat-root .empty-chat{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--chat-text-light);text-align:center;padding:24px}.gtc-chat-root .message-bubble{margin-bottom:16px;animation:fadeIn .3s ease}.gtc-chat-root .message-bubble.client{display:flex;flex-direction:column;align-items:flex-end}.gtc-chat-root .message-bubble.agent,.gtc-chat-root .message-bubble.system{display:flex;flex-direction:column;align-items:flex-start}.gtc-chat-root .message-content{max-width:80%;padding:12px 16px;border-radius:18px;word-wrap:break-word;line-height:1.4;box-shadow:var(--chat-shadow)}.gtc-chat-root .message-bubble.client .message-content{background:var(--chat-primary);color:#fff;border-bottom-right-radius:4px}.gtc-chat-root .message-bubble.agent .message-content{background:#fff;color:var(--chat-text);border:1px solid var(--chat-bg-border);border-bottom-left-radius:4px}.gtc-chat-root .message-bubble.system .message-content{background:var(--chat-warning);color:var(--chat-text);border-radius:8px;font-size:.875rem;max-width:100%;text-align:center;font-style:italic}.gtc-chat-root .message-time{font-size:.75rem;color:var(--chat-text-light);margin-top:4px;opacity:.8}.gtc-chat-root .chat-input{padding:16px;background:#fff;border-top:1px solid var(--chat-bg-light);border-radius:0 0 var(--chat-radius) var(--chat-radius)}.gtc-chat-root .chat-input-area{display:flex;align-items:flex-end;gap:8px;background:var(--chat-bg-light);border-radius:var(--chat-radius);padding:8px 12px;border:2px solid transparent;transition:var(--chat-transition);min-height:48px}.gtc-chat-root .chat-input-area:focus-within{border-color:var(--chat-primary);background:#fff}.gtc-chat-root .emoji-picker-wrapper{position:absolute;bottom:64px;right:8px;z-index:1200;animation:fadeIn .18s ease}.gtc-chat-root .emoji-picker-container{box-shadow:var(--chat-shadow);border:1px solid var(--chat-bg-border);border-radius:12px;overflow:hidden;-webkit-backdrop-filter:blur(6px) saturate(140%);backdrop-filter:blur(6px) saturate(140%)}.gtc-chat-root .emoji-btn:focus-visible,.gtc-chat-root .file-upload-btn:focus-visible,.gtc-chat-root .send-btn:focus-visible{box-shadow:var(--chat-focus-ring, 0 0 0 3px rgba(59,130,246,.45));outline:none}.gtc-chat-root .chat-input-area.disabled{background:var(--chat-bg-border);opacity:.7;flex-direction:column;padding:20px;text-align:center;gap:12px}.gtc-chat-root .message-input{flex:1;border:none;outline:none;background:transparent;font-size:.875rem;color:var(--chat-text);padding:8px 0;resize:none;max-height:120px;min-height:20px;line-height:1.4}.gtc-chat-root .message-input::placeholder{color:var(--chat-text-light)}.gtc-chat-root .chat-input-actions{display:flex;align-items:flex-end;gap:4px}.gtc-chat-root .input-btn,.gtc-chat-root .file-upload-btn{border:none;background:transparent;color:var(--chat-text-light);cursor:pointer;transition:var(--chat-transition);display:flex;align-items:center;justify-content:center;border-radius:50%;padding:8px;width:36px;height:36px}.gtc-chat-root .input-btn:hover,.gtc-chat-root .file-upload-btn:hover{background:#0000000d;color:var(--chat-primary)}.gtc-chat-root .send-btn{background:var(--chat-primary);color:#fff;margin-left:4px}.gtc-chat-root .send-btn:hover:not(:disabled){background:var(--chat-primary-hover)}.gtc-chat-root .send-btn:disabled{background:var(--chat-secondary);cursor:not-allowed;opacity:.6}.gtc-chat-root input[type=file]{display:none}.gtc-chat-root .message-attachments{margin-top:8px}.gtc-chat-root .attachment{margin-bottom:8px;border-radius:8px;overflow:hidden}.gtc-chat-root .attachment-image{max-width:200px;max-height:150px;border-radius:8px;cursor:pointer;transition:var(--chat-transition);border:1px solid var(--chat-bg-border);object-fit:cover}.gtc-chat-root .attachment-image:hover{transform:scale(1.02)}.gtc-chat-root .attachment-file{display:flex;align-items:center;gap:8px;padding:8px 12px;background:#ffffff80;border-radius:8px;border:1px solid var(--chat-bg-border);cursor:pointer;transition:var(--chat-transition)}.gtc-chat-root .attachment-file:hover{background:#fffc}.gtc-chat-root .file-name{font-size:.875rem;color:var(--chat-text);font-weight:500}.gtc-chat-root .file-size{font-size:.75rem;color:var(--chat-text-light);margin-left:auto}.gtc-chat-root .file-preview{position:relative;margin-bottom:8px;border-radius:8px;overflow:hidden;border:1px solid var(--chat-bg-light);background:#fff}.gtc-chat-root .file-preview img{width:100%;max-height:120px;object-fit:cover}.gtc-chat-root .file-info{display:flex;align-items:center;gap:8px;padding:12px;background:var(--chat-bg-light)}.gtc-chat-root .file-info-text{flex:1;min-width:0}.gtc-chat-root .file-info-name{font-size:.875rem;font-weight:500;color:var(--chat-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gtc-chat-root .file-info-size{font-size:.75rem;color:var(--chat-text-light)}.gtc-chat-root .cancel-btn{position:absolute;top:8px;right:8px;background:#0009;color:#fff;border:none;border-radius:50%;width:24px;height:24px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:var(--chat-transition)}.gtc-chat-root .cancel-btn:hover{background:#000c}.gtc-chat-root .chat-closed-notice{color:var(--chat-text-light);font-size:.875rem;display:flex;align-items:center;gap:8px;margin-bottom:12px;font-style:italic}.gtc-chat-root .start-new-chat-btn{background:var(--chat-primary);color:#fff;border:none;padding:12px 24px;border-radius:20px;font-size:.875rem;font-weight:500;cursor:pointer;transition:var(--chat-transition);display:flex;align-items:center;gap:8px;box-shadow:var(--chat-shadow)}.gtc-chat-root .start-new-chat-btn:hover{background:var(--chat-primary-hover)}.gtc-chat-root .image-modal{position:fixed;top:0;left:0;right:0;bottom:0;background:#000000e6;display:flex;align-items:center;justify-content:center;z-index:1001;animation:fadeIn .3s ease;padding:20px}.gtc-chat-root .image-modal-content{position:relative;max-width:90%;max-height:90%;display:flex;flex-direction:column;align-items:center}.gtc-chat-root .image-modal img{max-width:100%;max-height:80vh;border-radius:var(--chat-radius);box-shadow:0 20px 40px #00000080;object-fit:contain}.gtc-chat-root .image-modal-controls{position:absolute;top:20px;right:20px}.gtc-chat-root .image-modal-close{background:#000000b3;border:none;color:#fff;border-radius:50%;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:var(--chat-transition)}.gtc-chat-root .image-modal-close:hover{background:var(--chat-danger)}.gtc-chat-root .image-modal-info{margin-top:16px;padding:12px 20px;background:#000000b3;border-radius:var(--chat-radius);color:#fff;font-size:.875rem;text-align:center}.gtc-chat-root .typing-indicator{display:flex;align-items:center;gap:4px;padding:12px 16px;background:#fff;border-radius:18px 18px 18px 4px;margin-bottom:16px;border:1px solid var(--chat-bg-border)}.gtc-chat-root .typing-dot{width:6px;height:6px;background:var(--chat-secondary);border-radius:50%;animation:typing 1.4s infinite ease-in-out}.gtc-chat-root .typing-dot:nth-child(2){animation-delay:.2s}.gtc-chat-root .typing-dot:nth-child(3){animation-delay:.4s}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes slideUp{0%{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes pulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.05);opacity:.8}}@keyframes typing{0%,60%,to{opacity:.3}30%{opacity:1}}@media (max-width: 480px){.gtc-chat-root .chat-widget-window{width:calc(100vw - 40px);height:calc(100vh - 120px);bottom:10px;right:20px;left:20px}.gtc-chat-root .chat-fab{bottom:16px;right:16px;width:52px;height:52px}.gtc-chat-root .message-content{max-width:90%}.gtc-chat-root .image-modal{padding:16px}.gtc-chat-root .image-modal-close{width:36px;height:36px}}.gtc-chat-root .chat-fab:focus-visible,.gtc-chat-root .input-btn:focus-visible,.gtc-chat-root .file-upload-btn:focus-visible,.gtc-chat-root .send-btn:focus-visible,.gtc-chat-root .close-btn:focus-visible,.gtc-chat-root .header-btn:focus-visible,.gtc-chat-root .start-new-chat-btn:focus-visible{outline:3px solid color-mix(in srgb,var(--chat-primary) 60%,white);outline-offset:2px}@media (prefers-color-scheme: dark){:root{--chat-bg: #1f2937;--chat-bg-light: #273548;--chat-bg-border: #334155;--chat-text: #f1f5f9;--chat-text-light: #94a3b8;--chat-shadow: 0 4px 12px rgba(0,0,0,.6)}.chat-widget-window,.chat-input{background:var(--chat-bg)}.chat-input-area{background:var(--chat-bg-light)}.message-bubble.agent .message-content{background:var(--chat-bg);border-color:var(--chat-bg-border)}.message-bubble.system .message-content{background:var(--chat-warning)}.attachment-file{background:var(--chat-bg-light)}.attachment-file:hover,.file-preview{background:var(--chat-bg)}.file-info{background:var(--chat-bg-light)}}:root{--chat-color-primary: #3b82f6;--chat-color-primary-accent: #2563eb;--chat-color-bg: #ffffff;--chat-color-bg-soft: #f5f7fa;--chat-color-border: #e2e8f0;--chat-color-text: #1e293b;--chat-color-text-muted: #64748b;--chat-color-danger: #ef4444;--chat-color-warning: #fbbf24;--chat-color-success: #16a34a;--chat-shadow-sm: 0 2px 4px -1px rgba(0,0,0,.06), 0 1px 3px -1px rgba(0,0,0,.1);--chat-shadow: 0 6px 18px rgba(0,0,0,.08);--chat-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif;--chat-font-size-xs: .6875rem;--chat-font-size-sm: .75rem;--chat-font-size: .875rem;--chat-font-size-md: .9375rem;--chat-font-size-lg: 1rem;--chat-space-1: 2px;--chat-space-2: 4px;--chat-space-3: 6px;--chat-space-4: 8px;--chat-space-5: 10px;--chat-space-6: 12px;--chat-space-8: 16px;--chat-space-10: 20px;--chat-space-12: 24px;--chat-radius-sm: 4px;--chat-radius: 14px;--chat-transition: .2s cubic-bezier(.4,0,.2,1);--chat-focus-ring: 0 0 0 3px color-mix(in srgb, var(--chat-color-primary) 55%, white)}.gtc-chat-root[data-theme=dark]{--chat-color-bg: #1f2937;--chat-color-bg-soft: #273548;--chat-color-border: #334155;--chat-color-text: #f1f5f9;--chat-color-text-muted: #94a3b8;--chat-shadow: 0 4px 12px rgba(0,0,0,.6)}')),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
(function(jf,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react"),require("@microsoft/signalr"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@microsoft/signalr","react-dom"],t):(jf=typeof globalThis<"u"?globalThis:jf||self,t(jf.ClientChatWidget={},jf.React,jf.signalR,jf.ReactDOM))})(this,(function(jf,t,z0,A0){"use strict";var Ke=typeof document<"u"?document.currentScript:null;function P0(f){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(f){for(const a in f)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(f,a);Object.defineProperty(e,a,n.get?n:{enumerable:!0,get:()=>f[a]})}}return e.default=f,Object.freeze(e)}const Q0=P0(z0);var me={exports:{}},qf={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var xa;function Y0(){if(xa)return qf;xa=1;var f=t,e=Symbol.for("react.element"),a=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,r={key:!0,ref:!0,__self:!0,__source:!0};function u(d,c,g){var s,w={},L=null,j=null;g!==void 0&&(L=""+g),c.key!==void 0&&(L=""+c.key),c.ref!==void 0&&(j=c.ref);for(s in c)n.call(c,s)&&!r.hasOwnProperty(s)&&(w[s]=c[s]);if(d&&d.defaultProps)for(s in c=d.defaultProps,c)w[s]===void 0&&(w[s]=c[s]);return{$$typeof:e,type:d,key:L,ref:j,props:w,_owner:i.current}}return qf.Fragment=a,qf.jsx=u,qf.jsxs=u,qf}var _f={};/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var za;function J0(){return za||(za=1,process.env.NODE_ENV!=="production"&&(function(){var f=t,e=Symbol.for("react.element"),a=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),d=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),s=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),j=Symbol.for("react.offscreen"),I=Symbol.iterator,T="@@iterator";function Q(o){if(o===null||typeof o!="object")return null;var M=I&&o[I]||o[T];return typeof M=="function"?M:null}var J=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(o){{for(var M=arguments.length,b=new Array(M>1?M-1:0),m=1;m<M;m++)b[m-1]=arguments[m];V("error",o,b)}}function V(o,M,b){{var m=J.ReactDebugCurrentFrame,x=m.getStackAddendum();x!==""&&(M+="%s",b=b.concat([x]));var P=b.map(function(S){return String(S)});P.unshift("Warning: "+M),Function.prototype.apply.call(console[o],console,P)}}var $=!1,q=!1,_=!1,Pf=!1,Ff=!1,wf;wf=Symbol.for("react.module.reference");function Vf(o){return!!(typeof o=="string"||typeof o=="function"||o===n||o===r||Ff||o===i||o===g||o===s||Pf||o===j||$||q||_||typeof o=="object"&&o!==null&&(o.$$typeof===L||o.$$typeof===w||o.$$typeof===u||o.$$typeof===d||o.$$typeof===c||o.$$typeof===wf||o.getModuleId!==void 0))}function Sa(o,M,b){var m=o.displayName;if(m)return m;var x=M.displayName||M.name||"";return x!==""?b+"("+x+")":b}function Sf(o){return o.displayName||"Context"}function hf(o){if(o==null)return null;if(typeof o.tag=="number"&&h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case n:return"Fragment";case a:return"Portal";case r:return"Profiler";case i:return"StrictMode";case g:return"Suspense";case s:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case d:var M=o;return Sf(M)+".Consumer";case u:var b=o;return Sf(b._context)+".Provider";case c:return Sa(o,o.render,"ForwardRef");case w:var m=o.displayName||null;return m!==null?m:hf(o.type)||"Memo";case L:{var x=o,P=x._payload,S=x._init;try{return hf(S(P))}catch{return null}}}return null}var Lf=Object.assign,B=0,Re,Kf,Ze,Le,He,We,Fe;function z(){}z.__reactDisabledLog=!0;function N(){{if(B===0){Re=console.log,Kf=console.info,Ze=console.warn,Le=console.error,He=console.group,We=console.groupCollapsed,Fe=console.groupEnd;var o={configurable:!0,enumerable:!0,value:z,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}B++}}function D(){{if(B--,B===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Lf({},o,{value:Re}),info:Lf({},o,{value:Kf}),warn:Lf({},o,{value:Ze}),error:Lf({},o,{value:Le}),group:Lf({},o,{value:He}),groupCollapsed:Lf({},o,{value:We}),groupEnd:Lf({},o,{value:Fe})})}B<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var E=J.ReactCurrentDispatcher,k;function H(o,M,b){{if(k===void 0)try{throw Error()}catch(x){var m=x.stack.trim().match(/\n( *(at )?)/);k=m&&m[1]||""}return`
`+k+o}}var rf=!1,K;{var bf=typeof WeakMap=="function"?WeakMap:Map;K=new bf}function A(o,M){if(!o||rf)return"";{var b=K.get(o);if(b!==void 0)return b}var m;rf=!0;var x=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var P;P=E.current,E.current=null,N();try{if(M){var S=function(){throw Error()};if(Object.defineProperty(S.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(S,[])}catch(pf){m=pf}Reflect.construct(o,[],S)}else{try{S.call()}catch(pf){m=pf}o.call(S.prototype)}}else{try{throw Error()}catch(pf){m=pf}o()}}catch(pf){if(pf&&m&&typeof pf.stack=="string"){for(var v=pf.stack.split(`
`),ff=m.stack.split(`
`),G=v.length-1,Z=ff.length-1;G>=1&&Z>=0&&v[G]!==ff[Z];)Z--;for(;G>=1&&Z>=0;G--,Z--)if(v[G]!==ff[Z]){if(G!==1||Z!==1)do if(G--,Z--,Z<0||v[G]!==ff[Z]){var lf=`
`+v[G].replace(" at new "," at ");return o.displayName&&lf.includes("<anonymous>")&&(lf=lf.replace("<anonymous>",o.displayName)),typeof o=="function"&&K.set(o,lf),lf}while(G>=1&&Z>=0);break}}}finally{rf=!1,E.current=P,D(),Error.prepareStackTrace=x}var $f=o?o.displayName||o.name:"",E0=$f?H($f):"";return typeof o=="function"&&K.set(o,E0),E0}function Cf(o,M,b){return A(o,!1)}function yf(o){var M=o.prototype;return!!(M&&M.isReactComponent)}function W(o,M,b){if(o==null)return"";if(typeof o=="function")return A(o,yf(o));if(typeof o=="string")return H(o);switch(o){case g:return H("Suspense");case s:return H("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case c:return Cf(o.render);case w:return W(o.type,M,b);case L:{var m=o,x=m._payload,P=m._init;try{return W(P(x),M,b)}catch{}}}return""}var tf=Object.prototype.hasOwnProperty,of={},ef=J.ReactDebugCurrentFrame;function Df(o){if(o){var M=o._owner,b=W(o.type,o._source,M?M.type:null);ef.setExtraStackFrame(b)}else ef.setExtraStackFrame(null)}function be(o,M,b,m,x){{var P=Function.call.bind(tf);for(var S in o)if(P(o,S)){var v=void 0;try{if(typeof o[S]!="function"){var ff=Error((m||"React class")+": "+b+" type `"+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[S]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ff.name="Invariant Violation",ff}v=o[S](M,S,m,b,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(G){v=G}v&&!(v instanceof Error)&&(Df(x),h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",m||"React class",b,S,typeof v),Df(null)),v instanceof Error&&!(v.message in of)&&(of[v.message]=!0,Df(x),h("Failed %s type: %s",b,v.message),Df(null))}}}var je=Array.isArray;function Qf(o){return je(o)}function It(o){{var M=typeof Symbol=="function"&&Symbol.toStringTag,b=M&&o[Symbol.toStringTag]||o.constructor.name||"Object";return b}}function Nt(o){try{return C0(o),!1}catch{return!0}}function C0(o){return""+o}function y0(o){if(Nt(o))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",It(o)),C0(o)}var h0=J.ReactCurrentOwner,kt={key:!0,ref:!0,__self:!0,__source:!0},p0,v0;function St(o){if(tf.call(o,"ref")){var M=Object.getOwnPropertyDescriptor(o,"ref").get;if(M&&M.isReactWarning)return!1}return o.ref!==void 0}function Dt(o){if(tf.call(o,"key")){var M=Object.getOwnPropertyDescriptor(o,"key").get;if(M&&M.isReactWarning)return!1}return o.key!==void 0}function Tt(o,M){typeof o.ref=="string"&&h0.current}function Et(o,M){{var b=function(){p0||(p0=!0,h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",M))};b.isReactWarning=!0,Object.defineProperty(o,"key",{get:b,configurable:!0})}}function xt(o,M){{var b=function(){v0||(v0=!0,h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",M))};b.isReactWarning=!0,Object.defineProperty(o,"ref",{get:b,configurable:!0})}}var zt=function(o,M,b,m,x,P,S){var v={$$typeof:e,type:o,key:M,ref:b,props:S,_owner:P};return v._store={},Object.defineProperty(v._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(v,"_self",{configurable:!1,enumerable:!1,writable:!1,value:m}),Object.defineProperty(v,"_source",{configurable:!1,enumerable:!1,writable:!1,value:x}),Object.freeze&&(Object.freeze(v.props),Object.freeze(v)),v};function At(o,M,b,m,x){{var P,S={},v=null,ff=null;b!==void 0&&(y0(b),v=""+b),Dt(M)&&(y0(M.key),v=""+M.key),St(M)&&(ff=M.ref,Tt(M,x));for(P in M)tf.call(M,P)&&!kt.hasOwnProperty(P)&&(S[P]=M[P]);if(o&&o.defaultProps){var G=o.defaultProps;for(P in G)S[P]===void 0&&(S[P]=G[P])}if(v||ff){var Z=typeof o=="function"?o.displayName||o.name||"Unknown":o;v&&Et(S,Z),ff&&xt(S,Z)}return zt(o,v,ff,x,m,h0.current,S)}}var Da=J.ReactCurrentOwner,I0=J.ReactDebugCurrentFrame;function Xf(o){if(o){var M=o._owner,b=W(o.type,o._source,M?M.type:null);I0.setExtraStackFrame(b)}else I0.setExtraStackFrame(null)}var Ta;Ta=!1;function Ea(o){return typeof o=="object"&&o!==null&&o.$$typeof===e}function N0(){{if(Da.current){var o=hf(Da.current.type);if(o)return`
Check the render method of \``+o+"`."}return""}}function Pt(o){return""}var k0={};function Qt(o){{var M=N0();if(!M){var b=typeof o=="string"?o:o.displayName||o.name;b&&(M=`
Check the top-level render call using <`+b+">.")}return M}}function S0(o,M){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var b=Qt(M);if(k0[b])return;k0[b]=!0;var m="";o&&o._owner&&o._owner!==Da.current&&(m=" It was passed a child from "+hf(o._owner.type)+"."),Xf(o),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',b,m),Xf(null)}}function D0(o,M){{if(typeof o!="object")return;if(Qf(o))for(var b=0;b<o.length;b++){var m=o[b];Ea(m)&&S0(m,M)}else if(Ea(o))o._store&&(o._store.validated=!0);else if(o){var x=Q(o);if(typeof x=="function"&&x!==o.entries)for(var P=x.call(o),S;!(S=P.next()).done;)Ea(S.value)&&S0(S.value,M)}}}function Yt(o){{var M=o.type;if(M==null||typeof M=="string")return;var b;if(typeof M=="function")b=M.propTypes;else if(typeof M=="object"&&(M.$$typeof===c||M.$$typeof===w))b=M.propTypes;else return;if(b){var m=hf(M);be(b,o.props,"prop",m,o)}else if(M.PropTypes!==void 0&&!Ta){Ta=!0;var x=hf(M);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",x||"Unknown")}typeof M.getDefaultProps=="function"&&!M.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Jt(o){{for(var M=Object.keys(o.props),b=0;b<M.length;b++){var m=M[b];if(m!=="children"&&m!=="key"){Xf(o),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",m),Xf(null);break}}o.ref!==null&&(Xf(o),h("Invalid attribute `ref` supplied to `React.Fragment`."),Xf(null))}}function T0(o,M,b,m,x,P){{var S=Vf(o);if(!S){var v="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(v+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ff=Pt();ff?v+=ff:v+=N0();var G;o===null?G="null":Qf(o)?G="array":o!==void 0&&o.$$typeof===e?(G="<"+(hf(o.type)||"Unknown")+" />",v=" Did you accidentally export a JSX literal instead of a component?"):G=typeof o,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",G,v)}var Z=At(o,M,b,x,P);if(Z==null)return Z;if(S){var lf=M.children;if(lf!==void 0)if(m)if(Qf(lf)){for(var $f=0;$f<lf.length;$f++)D0(lf[$f],o);Object.freeze&&Object.freeze(lf)}else h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else D0(lf,o)}return o===n?Jt(Z):Yt(Z),Z}}function Ot(o,M,b){return T0(o,M,b,!0)}function Ut(o,M,b){return T0(o,M,b,!1)}var Bt=Ut,Gt=Ot;_f.Fragment=n,_f.jsx=Bt,_f.jsxs=Gt})()),_f}var Aa;function O0(){return Aa||(Aa=1,process.env.NODE_ENV==="production"?me.exports=Y0():me.exports=J0()),me.exports}var l=O0();const Xe={},Ce=f=>f?f.replace(/\/$/,""):typeof window<"u"&&window.CHAT_API_BASE?window.CHAT_API_BASE.replace(/\/$/,""):typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Ke&&Ke.tagName.toUpperCase()==="SCRIPT"&&Ke.src||new URL("client-chat-widget.umd.cjs",document.baseURI).href}<"u"&&(Xe!=null&&Xe.VITE_CHAT_API_BASE)?(void 0).replace(/\/$/,""):"https://borrador-n453.onrender.com/api",U0=async(f,e,a,n)=>{const i=Ce(n);try{const r=await fetch(`${i}/chat/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:f,systemCode:e,clientName:a??""})});if(!r.ok){const d=await r.text();return{status:r.status,error:d||`HTTP ${r.status}`}}const u=await r.json();return{status:200,id:String(u.id)}}catch(r){return{status:0,error:(r==null?void 0:r.message)||"Network error"}}};let mf=null;function B0(){return typeof window<"u"&&window.CHAT_API_BASE||void 0||"https://borrador-n453.onrender.com/api"}function G0(){const f=typeof window<"u"&&window.CHAT_SIGNALR_BASE||void 0,e=B0();return(f||e.replace(/\/api$/,"")).replace(/\/$/,"")}function R0(f){return`${G0()}/hubs/chat?chatSessionId=${encodeURIComponent(f)}`}const Z0=async(f,e,a=null)=>{if(mf)return;const n=R0(f);console.log("[signalr] Conectando a",n),mf=new Q0.HubConnectionBuilder().withUrl(n).withAutomaticReconnect().build(),mf.on("ReceiveMessage",(i,r,u,d,c)=>{console.log("📩 Mensaje recibido:",{sessionId:i,sender:r,content:u,timestamp:d,attachments:c}),e(i,r,u,d,c)}),mf.on("ChatClosed",(i,r,u)=>{console.log("🔒 Chat cerrado por soporte:",{sessionId:i,message:r,timestamp:u}),a&&a(i,r,u)});try{await mf.start(),console.log("[signalr] Conectado")}catch(i){console.error("[signalr] Error iniciando conexión",i);try{await mf.stop()}catch{}throw mf=null,i}},H0=async()=>{if(mf){try{await mf.stop()}catch(f){console.warn("[signalr] Error al detener",f)}mf=null}},W0=({onClick:f,isOpen:e,unreadCount:a=0,isLoading:n=!1,showTooltip:i=!0,isPulsing:r=!0})=>e?null:l.jsxs("button",{className:`chat-fab ${a>0?"has-notification":""} ${r?"pulse":""} ${n?"loading":""}`,onClick:f,"aria-label":"Abrir chat en vivo",title:"Chat en Vivo",disabled:n,children:[i&&l.jsx("span",{className:"chat-fab-tooltip"}),a>0&&l.jsx("span",{className:"unread-badge",children:a>99?"99+":a}),l.jsx("div",{className:"chat-fab-icon",children:l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),l.jsx("circle",{cx:"9",cy:"10",r:"0.5",fill:"currentColor",children:l.jsx("animate",{attributeName:"opacity",values:"0.5;1;0.5",dur:"1.5s",repeatCount:"indefinite",begin:"0s"})}),l.jsx("circle",{cx:"12",cy:"10",r:"0.5",fill:"currentColor",children:l.jsx("animate",{attributeName:"opacity",values:"0.5;1;0.5",dur:"1.5s",repeatCount:"indefinite",begin:"0.3s"})}),l.jsx("circle",{cx:"15",cy:"10",r:"0.5",fill:"currentColor",children:l.jsx("animate",{attributeName:"opacity",values:"0.5;1;0.5",dur:"1.5s",repeatCount:"indefinite",begin:"0.6s"})})]})})]}),F0=({onClose:f,title:e="Soporte Técnico",status:a="En línea"})=>l.jsxs("div",{className:"chat-header",children:[l.jsxs("div",{className:"chat-header-info",children:[l.jsx("span",{className:"chat-title",children:e}),l.jsxs("span",{className:"chat-status",children:[l.jsx("span",{className:"status-indicator"}),a]})]}),l.jsx("button",{className:"close-btn",onClick:f,"aria-label":"Cerrar chat",type:"button",children:l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),V0=({message:f,onImageClick:e,formatDateTime:a})=>{var r;const n=f.sender==="client",i=f.sender==="system";return console.log("🟡 MessageBubble renderizando:",{sender:f.sender,content:f.content,attachments:f.attachments,attachmentsLength:((r=f.attachments)==null?void 0:r.length)||0}),l.jsxs("div",{className:`message-bubble ${n?"client":i?"system":"agent"}`,children:[l.jsxs("div",{className:"message-content",children:[f.content&&l.jsx("p",{children:f.content}),f.attachments&&f.attachments.length>0&&l.jsx("div",{className:"message-attachments",children:f.attachments.map((u,d)=>(console.log("🖼️ Procesando attachment en MessageBubble:",{fileName:u.fileName,fileType:u.fileType,filePath:u.filePath,isImage:u.fileType&&u.fileType.startsWith("image/")}),l.jsx("div",{className:"attachment",children:u.fileType&&u.fileType.startsWith("image/")?l.jsx("img",{src:u.filePath,alt:u.fileName,className:"attachment-image",onClick:()=>e(u.filePath),onLoad:()=>console.log("✅ Imagen cargada:",u.filePath),onError:()=>console.log("❌ Error cargando imagen:",u.filePath)}):l.jsxs("div",{className:"attachment-file",children:[l.jsx("span",{className:"file-icon",children:"📄"}),l.jsx("span",{className:"file-name",children:u.fileName})]})},d)))})]}),l.jsx("div",{className:"message-time",children:a(f.sentAt)})]})},K0=({messages:f,onImageClick:e,formatDateTime:a})=>{const n=t.useRef(null);return t.useEffect(()=>{var i;(i=n.current)==null||i.scrollIntoView({behavior:"smooth"})},[f]),l.jsxs("div",{className:"chat-messages","aria-live":"polite","aria-relevant":"additions text",children:[f.length===0&&l.jsxs("div",{className:"empty-chat",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),l.jsx("p",{children:"Envía tu primer mensaje"})]}),f.map((i,r)=>l.jsx(V0,{message:i,onImageClick:e,formatDateTime:a},`${i.id}-${r}`)),l.jsx("div",{ref:n})]})},X0=({selectedFile:f,previewUrl:e,onCancel:a})=>f?l.jsxs("div",{className:"file-preview",children:[e?l.jsx("img",{src:e,alt:"Previsualización"}):l.jsxs("div",{className:"file-info",children:[l.jsxs("svg",{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",children:[l.jsx("path",{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"}),l.jsx("polyline",{points:"13 2 13 9 20 9"})]}),l.jsx("span",{children:f.name})]}),l.jsx("button",{className:"cancel-btn",onClick:a,"aria-label":"Cancelar archivo",type:"button",children:l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}):null;function $e(f){return[].concat(f)}function qe(f){return f.startsWith(":")}function Pa(f){return ye(f)&&(f==="*"||f.length>1&&":>~.+*".includes(f.slice(0,1))||Oa(f))}function Qa(f,e){return(ye(e)||typeof e=="number")&&!Ja(f)&&!qe(f)&&!Ya(f)}function Ya(f){return f.startsWith("@media")}function $0(f){return f==="."}function Ja(f){return f==="--"}function ye(f){return f+""===f}function Oa(f){return ye(f)&&(f.startsWith("&")||qe(f))}function he(f,e=""){return f.filter(Boolean).join(e)}function Ua(f,e){let a=0;if(e.length===0)return a.toString();for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);a=(a<<5)-a+i,a=a&a}return`${f??"cl"}_${a.toString(36)}`}function q0(f,e){return f==="content"?`"${e}"`:e}function _0(f){return f.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Ba(f,e){return`${f}:${e}`}function f1(f){return f?`.${f}`:""}function e1(f,e){return f?`${f}
${e}`:e}var Ga=class x0{constructor(e,a,n,i){this.sheet=e,this.property=a,this.value=n,this.selector=i,this.property=a,this.value=n,this.joined=Ba(a,n);const r=this.selector.preconditions.concat(this.selector.postconditions);this.hash=this.selector.hasConditions?this.selector.scopeClassName:Ua(this.sheet.name,this.joined),this.key=he([this.joined,r,this.hash])}toString(){let e=_e(this.selector.preconditions,{right:this.hash});return e=_e(this.selector.postconditions,{left:e}),`${e} {${x0.genRule(this.property,this.value)}}`}static genRule(e,a){const n=_0(e);return Ba(n,q0(e,a))+";"}};function _e(f,{left:e="",right:a=""}={}){const n=f.reduce((i,r)=>qe(r)?i+r:Oa(r)?i+r.slice(1):he([i,r]," "),e);return he([n,f1(a)]," ")}var a1=class Ve{constructor(e,a=null,{preconditions:n,postconditions:i}={}){this.sheet=e,this.preconditions=[],this.scopeClassName=null,this.scopeName=null,this.postconditions=[],this.preconditions=n?$e(n):[],this.postconditions=i?$e(i):[],this.setScope(a)}setScope(e){return e?(this.scopeClassName||(this.scopeName=e,this.scopeClassName=Ua(this.sheet.name,e+this.sheet.count)),this):this}get hasConditions(){return this.preconditions.length>0||this.postconditions.length>0}addScope(e){return new Ve(this.sheet,e,{preconditions:this.preconditions,postconditions:this.postconditions})}addPrecondition(e){return new Ve(this.sheet,this.scopeClassName,{postconditions:this.postconditions,preconditions:this.preconditions.concat(e)})}addPostcondition(e){return new Ve(this.sheet,this.scopeClassName,{preconditions:this.preconditions,postconditions:this.postconditions.concat(e)})}createRule(e,a){return new Ga(this.sheet,e,a,this)}},n1=class{constructor(f,e){this.name=f,this.rootNode=e,this.storedStyles={},this.storedClasses={},this.style="",this.count=0,this.id=`flairup-${f}`,this.styleTag=this.createStyleTag()}getStyle(){return this.style}append(f){this.style=e1(this.style,f)}apply(){this.count++,this.styleTag&&(this.styleTag.innerHTML=this.style)}isApplied(){return!!this.styleTag}createStyleTag(){if(typeof document>"u"||this.isApplied()||this.rootNode===null)return this.styleTag;const f=document.createElement("style");return f.type="text/css",f.id=this.id,(this.rootNode??document.head).appendChild(f),f}addRule(f){const e=this.storedClasses[f.key];return ye(e)?e:(this.storedClasses[f.key]=f.hash,this.storedStyles[f.hash]=[f.property,f.value],this.append(f.toString()),f.hash)}};function fa(f,e){for(const a in f)e(a.trim(),f[a])}function p(...f){const e=f.reduce((a,n)=>(n instanceof Set?a.push(...n):typeof n=="string"?a.push(n):Array.isArray(n)?a.push(p(...n)):typeof n=="object"&&Object.entries(n).forEach(([i,r])=>{r&&a.push(i)}),a),[]);return he(e," ").trim()}function i1(f,e){const a=new n1(f,e);return{create:n,getStyle:a.getStyle.bind(a),isApplied:a.isApplied.bind(a)};function n(i){const r={};return Ra(a,i,new a1(a)).forEach(([d,c,g])=>{pe(a,c,g).forEach(s=>{u(d,s)})}),a.apply(),r;function u(d,c){r[d]=r[d]??new Set,r[d].add(c)}}}function Ra(f,e,a){const n=[];return fa(e,(i,r)=>{if(Pa(i))return Ra(f,r,a.addPrecondition(i)).forEach(u=>n.push(u));n.push([i,e[i],a.addScope(i)])}),n}function pe(f,e,a){const n=new Set;return fa(e,(i,r)=>{let u=[];if(Pa(i))u=pe(f,r,a.addPostcondition(i));else if($0(i))u=$e(r);else if(Ya(i))u=t1(f,r,i,a);else if(Ja(i))u=r1(f,r,a);else if(Qa(i,r)){const d=a.createRule(i,r);f.addRule(d),n.add(d.hash)}return Za(u,n)}),n}function Za(f,e){return f.forEach(a=>e.add(a)),e}function r1(f,e,a){const n=new Set,i=[];if(fa(e,(r,u)=>{if(Qa(r,u)){i.push(Ga.genRule(r,u));return}const d=pe(f,u??{},a);Za(d,n)}),!a.scopeClassName)return n;if(i.length){const r=i.join(" ");f.append(`${_e(a.preconditions,{right:a.scopeClassName})} {${r}}`)}return n.add(a.scopeClassName),n}function t1(f,e,a,n){f.append(a+" {");const i=pe(f,e,n);return f.append("}"),i}function O(){return O=Object.assign?Object.assign.bind():function(f){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(f[n]=a[n])}return f},O.apply(this,arguments)}function o1(f,e){f.prototype=Object.create(e.prototype),f.prototype.constructor=f,ea(f,e)}function ea(f,e){return ea=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ea(f,e)}function Ha(f,e){if(f==null)return{};var a={},n=Object.keys(f),i,r;for(r=0;r<n.length;r++)i=n[r],!(e.indexOf(i)>=0)&&(a[i]=f[i]);return a}function u1(f,e){if(f){if(typeof f=="string")return Wa(f,e);var a=Object.prototype.toString.call(f).slice(8,-1);if(a==="Object"&&f.constructor&&(a=f.constructor.name),a==="Map"||a==="Set")return Array.from(f);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Wa(f,e)}}function Wa(f,e){(e==null||e>f.length)&&(e=f.length);for(var a=0,n=new Array(e);a<e;a++)n[a]=f[a];return n}function d1(f,e){var a=typeof Symbol<"u"&&f[Symbol.iterator]||f["@@iterator"];if(a)return(a=a.call(f)).next.bind(a);if(Array.isArray(f)||(a=u1(f))||e){a&&(f=a);var n=0;return function(){return n>=f.length?{done:!0}:{done:!1,value:f[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var C;(function(f){f.hiddenOnSearch="epr-hidden-on-search",f.searchActive="epr-search-active",f.hidden="epr-hidden",f.visible="epr-visible",f.active="epr-active",f.emoji="epr-emoji",f.category="epr-emoji-category",f.label="epr-emoji-category-label",f.categoryContent="epr-emoji-category-content",f.emojiHasVariations="epr-emoji-has-variations",f.scrollBody="epr-body",f.emojiList="epr-emoji-list",f.external="__EmojiPicker__",f.emojiPicker="EmojiPickerReact",f.open="epr-open",f.vertical="epr-vertical",f.horizontal="epr-horizontal",f.variationPicker="epr-emoji-variation-picker",f.darkTheme="epr-dark-theme",f.autoTheme="epr-auto-theme"})(C||(C={}));function F(){for(var f=arguments.length,e=new Array(f),a=0;a<f;a++)e[a]=arguments[a];return e.map(function(n){return"."+n}).join("")}var Y=i1("epr",null),ve={display:"none",opacity:"0",pointerEvents:"none",visibility:"hidden",overflow:"hidden"},aa=Y.create({hidden:O({".":C.hidden},ve)}),c1=t.memo(function(){return t.createElement("style",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:Y.getStyle()}})}),Tf=Y.create({".epr-main":{":has(input:not(:placeholder-shown))":{categoryBtn:{":hover":{opacity:"1",backgroundPositionY:"var(--epr-category-navigation-button-size)"}},hiddenOnSearch:O({".":C.hiddenOnSearch},ve)},":has(input:placeholder-shown)":{visibleOnSearchOnly:ve}},hiddenOnReactions:{transition:"all 0.5s ease-in-out"},".epr-reactions":{hiddenOnReactions:{height:"0px",width:"0px",opacity:"0",pointerEvents:"none",overflow:"hidden"}},".EmojiPickerReact:not(.epr-search-active)":{categoryBtn:{":hover":{opacity:"1",backgroundPositionY:"var(--epr-category-navigation-button-size)"},"&.epr-active":{opacity:"1",backgroundPositionY:"var(--epr-category-navigation-button-size)"}},visibleOnSearchOnly:O({".":"epr-visible-on-search-only"},ve)}});function vf(f,e){var a,n;return{".epr-dark-theme":(a={},a[f]=e,a),".epr-auto-theme":(n={},n[f]={"@media (prefers-color-scheme: dark)":e},n)}}function Fa(f,e){var a,n,i=(a=f.customEmojis)!=null?a:[],r=(n=e.customEmojis)!=null?n:[];return f.open===e.open&&f.emojiVersion===e.emojiVersion&&f.reactionsDefaultOpen===e.reactionsDefaultOpen&&f.searchPlaceHolder===e.searchPlaceHolder&&f.searchPlaceholder===e.searchPlaceholder&&f.defaultSkinTone===e.defaultSkinTone&&f.skinTonesDisabled===e.skinTonesDisabled&&f.autoFocusSearch===e.autoFocusSearch&&f.emojiStyle===e.emojiStyle&&f.theme===e.theme&&f.suggestedEmojisMode===e.suggestedEmojisMode&&f.lazyLoadEmojis===e.lazyLoadEmojis&&f.className===e.className&&f.height===e.height&&f.width===e.width&&f.style===e.style&&f.searchDisabled===e.searchDisabled&&f.skinTonePickerLocation===e.skinTonePickerLocation&&i.length===r.length}var s1=["1f44d","2764-fe0f","1f603","1f622","1f64f","1f44e","1f621"],fe;(function(f){f.RECENT="recent",f.FREQUENT="frequent"})(fe||(fe={}));var af;(function(f){f.NATIVE="native",f.APPLE="apple",f.TWITTER="twitter",f.GOOGLE="google",f.FACEBOOK="facebook"})(af||(af={}));var Yf;(function(f){f.DARK="dark",f.LIGHT="light",f.AUTO="auto"})(Yf||(Yf={}));var gf;(function(f){f.NEUTRAL="neutral",f.LIGHT="1f3fb",f.MEDIUM_LIGHT="1f3fc",f.MEDIUM="1f3fd",f.MEDIUM_DARK="1f3fe",f.DARK="1f3ff"})(gf||(gf={}));var y;(function(f){f.SUGGESTED="suggested",f.CUSTOM="custom",f.SMILEYS_PEOPLE="smileys_people",f.ANIMALS_NATURE="animals_nature",f.FOOD_DRINK="food_drink",f.TRAVEL_PLACES="travel_places",f.ACTIVITIES="activities",f.OBJECTS="objects",f.SYMBOLS="symbols",f.FLAGS="flags"})(y||(y={}));var Jf;(function(f){f.SEARCH="SEARCH",f.PREVIEW="PREVIEW"})(Jf||(Jf={}));var uf,l1=[y.SUGGESTED,y.CUSTOM,y.SMILEYS_PEOPLE,y.ANIMALS_NATURE,y.FOOD_DRINK,y.TRAVEL_PLACES,y.ACTIVITIES,y.OBJECTS,y.SYMBOLS,y.FLAGS],g1={name:"Recently Used",category:y.SUGGESTED},Va=(uf={},uf[y.SUGGESTED]={category:y.SUGGESTED,name:"Frequently Used"},uf[y.CUSTOM]={category:y.CUSTOM,name:"Custom Emojis"},uf[y.SMILEYS_PEOPLE]={category:y.SMILEYS_PEOPLE,name:"Smileys & People"},uf[y.ANIMALS_NATURE]={category:y.ANIMALS_NATURE,name:"Animals & Nature"},uf[y.FOOD_DRINK]={category:y.FOOD_DRINK,name:"Food & Drink"},uf[y.TRAVEL_PLACES]={category:y.TRAVEL_PLACES,name:"Travel & Places"},uf[y.ACTIVITIES]={category:y.ACTIVITIES,name:"Activities"},uf[y.OBJECTS]={category:y.OBJECTS,name:"Objects"},uf[y.SYMBOLS]={category:y.SYMBOLS,name:"Symbols"},uf[y.FLAGS]={category:y.FLAGS,name:"Flags"},uf);function Ka(f){return l1.map(function(e){return O({},Va[e],f&&f[e]&&f[e])})}function na(f){return f.category}function Xa(f){return f.name}function M1(f,e){var a;f===void 0&&(f=[]),e===void 0&&(e={});var n={};e.suggestionMode===fe.RECENT&&(n[y.SUGGESTED]=g1);var i=Ka(n);return(a=f)!=null&&a.length?f.map(function(r){return typeof r=="string"?$a(r,n[r]):O({},$a(r.category,n[r.category]),r)}):i}function $a(f,e){return e===void 0&&(e={}),Object.assign(Va[f],e)}var w1="https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/",L1="https://cdn.jsdelivr.net/npm/emoji-datasource-facebook/img/facebook/64/",b1="https://cdn.jsdelivr.net/npm/emoji-datasource-twitter/img/twitter/64/",j1="https://cdn.jsdelivr.net/npm/emoji-datasource-google/img/google/64/";function m1(f){switch(f){case af.TWITTER:return b1;case af.GOOGLE:return j1;case af.FACEBOOK:return L1;case af.APPLE:default:return w1}}var C1=[],y1=[{n:["grinning","grinning face"],u:"1f600",a:"1.0"},{n:["smiley","smiling face with open mouth"],u:"1f603",a:"0.6"},{n:["smile","smiling face with open mouth and smiling eyes"],u:"1f604",a:"0.6"},{n:["grin","grinning face with smiling eyes"],u:"1f601",a:"0.6"},{n:["laughing","satisfied","smiling face with open mouth and tightly-closed eyes"],u:"1f606",a:"0.6"},{n:["sweat smile","smiling face with open mouth and cold sweat"],u:"1f605",a:"0.6"},{n:["rolling on the floor laughing"],u:"1f923",a:"3.0"},{n:["joy","face with tears of joy"],u:"1f602",a:"0.6"},{n:["slightly smiling face"],u:"1f642",a:"1.0"},{n:["upside-down face","upside down face"],u:"1f643",a:"1.0"},{n:["melting face"],u:"1fae0",a:"14.0"},{n:["wink","winking face"],u:"1f609",a:"0.6"},{n:["blush","smiling face with smiling eyes"],u:"1f60a",a:"0.6"},{n:["innocent","smiling face with halo"],u:"1f607",a:"1.0"},{n:["smiling face with 3 hearts","smiling face with smiling eyes and three hearts"],u:"1f970",a:"11.0"},{n:["heart eyes","smiling face with heart-shaped eyes"],u:"1f60d",a:"0.6"},{n:["star-struck","grinning face with star eyes"],u:"1f929",a:"5.0"},{n:["kissing heart","face throwing a kiss"],u:"1f618",a:"0.6"},{n:["kissing","kissing face"],u:"1f617",a:"1.0"},{n:["relaxed","white smiling face"],u:"263a-fe0f",a:"0.6"},{n:["kissing closed eyes","kissing face with closed eyes"],u:"1f61a",a:"0.6"},{n:["kissing smiling eyes","kissing face with smiling eyes"],u:"1f619",a:"1.0"},{n:["smiling face with tear"],u:"1f972",a:"13.0"},{n:["yum","face savouring delicious food"],u:"1f60b",a:"0.6"},{n:["stuck out tongue","face with stuck-out tongue"],u:"1f61b",a:"1.0"},{n:["stuck out tongue winking eye","face with stuck-out tongue and winking eye"],u:"1f61c",a:"0.6"},{n:["zany face","grinning face with one large and one small eye"],u:"1f92a",a:"5.0"},{n:["stuck out tongue closed eyes","face with stuck-out tongue and tightly-closed eyes"],u:"1f61d",a:"0.6"},{n:["money-mouth face","money mouth face"],u:"1f911",a:"1.0"},{n:["hugging face"],u:"1f917",a:"1.0"},{n:["face with hand over mouth","smiling face with smiling eyes and hand covering mouth"],u:"1f92d",a:"5.0"},{n:["face with open eyes and hand over mouth"],u:"1fae2",a:"14.0"},{n:["face with peeking eye"],u:"1fae3",a:"14.0"},{n:["shushing face","face with finger covering closed lips"],u:"1f92b",a:"5.0"},{n:["thinking face"],u:"1f914",a:"1.0"},{n:["saluting face"],u:"1fae1",a:"14.0"},{n:["zipper-mouth face","zipper mouth face"],u:"1f910",a:"1.0"},{n:["face with raised eyebrow","face with one eyebrow raised"],u:"1f928",a:"5.0"},{n:["neutral face"],u:"1f610",a:"0.7"},{n:["expressionless","expressionless face"],u:"1f611",a:"1.0"},{n:["no mouth","face without mouth"],u:"1f636",a:"1.0"},{n:["dotted line face"],u:"1fae5",a:"14.0"},{n:["face in clouds"],u:"1f636-200d-1f32b-fe0f",a:"13.1"},{n:["smirk","smirking face"],u:"1f60f",a:"0.6"},{n:["unamused","unamused face"],u:"1f612",a:"0.6"},{n:["face with rolling eyes"],u:"1f644",a:"1.0"},{n:["grimacing","grimacing face"],u:"1f62c",a:"1.0"},{n:["face exhaling"],u:"1f62e-200d-1f4a8",a:"13.1"},{n:["lying face"],u:"1f925",a:"3.0"},{n:["shaking face"],u:"1fae8",a:"15.0"},{n:["head shaking horizontally"],u:"1f642-200d-2194-fe0f",a:"15.1"},{n:["head shaking vertically"],u:"1f642-200d-2195-fe0f",a:"15.1"},{n:["relieved","relieved face"],u:"1f60c",a:"0.6"},{n:["pensive","pensive face"],u:"1f614",a:"0.6"},{n:["sleepy","sleepy face"],u:"1f62a",a:"0.6"},{n:["drooling face"],u:"1f924",a:"3.0"},{n:["sleeping","sleeping face"],u:"1f634",a:"1.0"},{n:["mask","face with medical mask"],u:"1f637",a:"0.6"},{n:["face with thermometer"],u:"1f912",a:"1.0"},{n:["face with head-bandage","face with head bandage"],u:"1f915",a:"1.0"},{n:["nauseated face"],u:"1f922",a:"3.0"},{n:["face vomiting","face with open mouth vomiting"],u:"1f92e",a:"5.0"},{n:["sneezing face"],u:"1f927",a:"3.0"}