UNPKG

hifenix-chatbot

Version:

Proyecto para la integración de la ventana flotante del chatbot, realizado en Vanilla JS puro para garantizar la integración con cualquier lenguaje.

746 lines (701 loc) 122 kB
!function(t,e){t&&!t.getElementById("livereloadscript")&&((e=t.createElement("script")).async=1,e.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",e.id="livereloadscript",t.getElementsByTagName("head")[0].appendChild(e))}(self.document),function(){"use strict";const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),i=new WeakMap;class n{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=i.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(s,t))}return t}toString(){return this.cssText}}const o=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1]),t[0]);return new n(i,t,s)},r=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new n("string"==typeof t?t:t+"",void 0,s))(e)})(t):t,{is:a,defineProperty:c,getOwnPropertyDescriptor:h,getOwnPropertyNames:l,getOwnPropertySymbols:p,getPrototypeOf:d}=Object,u=globalThis,f=u.trustedTypes,g=f?f.emptyScript:"",m=u.reactiveElementPolyfillSupport,y=(t,e)=>t,v={toAttribute(t,e){switch(e){case Boolean:t=t?g:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},C=(t,e)=>!a(t,e),b={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:C};Symbol.metadata??=Symbol("metadata"),u.litPropertyMetadata??=new WeakMap;class _ extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=b){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&c(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=h(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){const o=i?.call(this);n.call(this,e),this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const t=d(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const t=this.properties,e=[...l(t),...p(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const s=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((s,i)=>{if(e)s.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of i){const i=document.createElement("style"),n=t.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=e.cssText,s.appendChild(i)}})(s,this.constructor.elementStyles),s}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(void 0!==i&&!0===s.reflect){const n=(void 0!==s.converter?.toAttribute?s.converter:v).toAttribute(e,s.type);this._$Em=t,null==n?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=s.getPropertyOptions(i),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:v;this._$Em=i,this[i]=n.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??C)(this[t],e))return;this.P(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t)!0!==s.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],s)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[y("elementProperties")]=new Map,_[y("finalized")]=new Map,m?.({ReactiveElement:_}),(u.reactiveElementVersions??=[]).push("2.0.4");const x=globalThis,w=x.trustedTypes,k=w?w.createPolicy("lit-html",{createHTML:t=>t}):void 0,E="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,D="?"+A,$=`<${D}>`,S=document,B=()=>S.createComment(""),T=t=>null===t||"object"!=typeof t&&"function"!=typeof t,F=Array.isArray,O="[ \t\n\f\r]",M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,R=/-->/g,L=/>/g,N=RegExp(`>|${O}(?:([^\\s"'>=/]+)(${O}*=${O}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),P=/'/g,H=/"/g,U=/^(?:script|style|textarea|title)$/i,j=(t=>(e,...s)=>({_$litType$:t,strings:e,values:s}))(1),I=Symbol.for("lit-noChange"),z=Symbol.for("lit-nothing"),q=new WeakMap,V=S.createTreeWalker(S,129);function W(t,e){if(!F(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==k?k.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,i=[];let n,o=2===e?"<svg>":3===e?"<math>":"",r=M;for(let e=0;e<s;e++){const s=t[e];let a,c,h=-1,l=0;for(;l<s.length&&(r.lastIndex=l,c=r.exec(s),null!==c);)l=r.lastIndex,r===M?"!--"===c[1]?r=R:void 0!==c[1]?r=L:void 0!==c[2]?(U.test(c[2])&&(n=RegExp("</"+c[2],"g")),r=N):void 0!==c[3]&&(r=N):r===N?">"===c[0]?(r=n??M,h=-1):void 0===c[1]?h=-2:(h=r.lastIndex-c[2].length,a=c[1],r=void 0===c[3]?N:'"'===c[3]?H:P):r===H||r===P?r=N:r===R||r===L?r=M:(r=N,n=void 0);const p=r===N&&t[e+1].startsWith("/>")?" ":"";o+=r===M?s+$:h>=0?(i.push(a),s.slice(0,h)+E+s.slice(h)+A+p):s+A+(-2===h?e:p)}return[W(t,o+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class Z{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,o=0;const r=t.length-1,a=this.parts,[c,h]=Y(t,e);if(this.el=Z.createElement(c,s),V.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=V.nextNode())&&a.length<r;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(E)){const e=h[o++],s=i.getAttribute(t).split(A),r=/([.?@])?(.*)/.exec(e);a.push({type:1,index:n,name:r[2],strings:s,ctor:"."===r[1]?X:"?"===r[1]?tt:"@"===r[1]?et:Q}),i.removeAttribute(t)}else t.startsWith(A)&&(a.push({type:6,index:n}),i.removeAttribute(t));if(U.test(i.tagName)){const t=i.textContent.split(A),e=t.length-1;if(e>0){i.textContent=w?w.emptyScript:"";for(let s=0;s<e;s++)i.append(t[s],B()),V.nextNode(),a.push({type:2,index:++n});i.append(t[e],B())}}}else if(8===i.nodeType)if(i.data===D)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=i.data.indexOf(A,t+1));)a.push({type:7,index:n}),t+=A.length-1}n++}}static createElement(t,e){const s=S.createElement("template");return s.innerHTML=t,s}}function K(t,e,s=t,i){if(e===I)return e;let n=void 0!==i?s._$Co?.[i]:s._$Cl;const o=T(e)?void 0:e._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),void 0===o?n=void 0:(n=new o(t),n._$AT(t,s,i)),void 0!==i?(s._$Co??=[])[i]=n:s._$Cl=n),void 0!==n&&(e=K(t,n._$AS(t,e.values),n,i)),e}class J{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??S).importNode(e,!0);V.currentNode=i;let n=V.nextNode(),o=0,r=0,a=s[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new G(n,n.nextSibling,this,t):1===a.type?e=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(e=new st(n,this,t)),this._$AV.push(e),a=s[++r]}o!==a?.index&&(n=V.nextNode(),o++)}return V.currentNode=S,i}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class G{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=z,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=K(this,t,e),T(t)?t===z||null==t||""===t?(this._$AH!==z&&this._$AR(),this._$AH=z):t!==this._$AH&&t!==I&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>F(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==z&&T(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=Z.createElement(W(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new J(i,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=q.get(t.strings);return void 0===e&&q.set(t.strings,e=new Z(t)),e}k(t){F(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new G(this.O(B()),this.O(B()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class Q{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=z,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=z}_$AI(t,e=this,s,i){const n=this.strings;let o=!1;if(void 0===n)t=K(this,t,e,0),o=!T(t)||t!==this._$AH&&t!==I,o&&(this._$AH=t);else{const i=t;let r,a;for(t=n[0],r=0;r<n.length-1;r++)a=K(this,i[s+r],e,r),a===I&&(a=this._$AH[r]),o||=!T(a)||a!==this._$AH[r],a===z?t=z:t!==z&&(t+=(a??"")+n[r+1]),this._$AH[r]=a}o&&!i&&this.j(t)}j(t){t===z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class X extends Q{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===z?void 0:t}}class tt extends Q{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==z)}}class et extends Q{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=K(this,t,e,0)??z)===I)return;const s=this._$AH,i=t===z&&s!==z||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==z&&(s===z||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class st{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){K(this,t)}}const it=x.litHtmlPolyfillSupport;it?.(Z,G),(x.litHtmlVersions??=[]).push("3.2.1");class nt extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{const i=s?.renderBefore??e;let n=i._$litPart$;if(void 0===n){const t=s?.renderBefore??null;i._$litPart$=n=new G(e.insertBefore(B(),t),t,void 0,s??{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return I}}nt._$litElement$=!0,nt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:nt});const ot=globalThis.litElementPolyfillSupport;ot?.({LitElement:nt}),(globalThis.litElementVersions??=[]).push("4.1.1");const rt=o` :host { display: block; position: fixed; bottom: -600px; /* Comienza fuera de la pantalla */ right: 64px; width: min(100%, 416px); height: calc(100vh - 20px); /* Ajusta dinámicamente el alto a la pantalla */ max-height: 620px; /* Asegura que no exceda los 600px en pantallas grandes */ z-index: 9999; box-sizing: border-box; animation: slide-up 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; /* Animación más suave */ /* Adaptación para pantallas más pequeñas */ @media screen and (max-width: 500px) { padding-left: 10px; padding-right: 10px; right: 0px; border-radius: 8px; } } .layout-container { width: 100%; height: 100%; border-radius: 18px; background: #fff; box-shadow: 1px 3px 20px 0px rgba(0, 0, 0, 0.2); display: flex; flex-direction: column; overflow: hidden; } .header-container { width: 100%; height: 138px; max-width: 416px; max-height: 138px; flex-shrink: 0; background: var(--Fondo_sidebar, #fafafa); box-sizing: border-box; border-radius: 18px 18px 0px 0px; /* Bordes superiores redondeados */ } .main-chat-container { width: 100%; height: 422px; max-width: 416px; max-height: 422px; background: #fff; /* Fondo blanco */ overflow-y: auto; /* Habilita scroll si el contenido excede */ box-sizing: border-box; } .footer-container { box-sizing: border-box; width: 100%; height: 60px; max-width: 416px; max-height: 60px; flex-shrink: 0; background: var(--Fondo_sidebar, #fafafa); } /* Definición de la animación */ @keyframes slide-up { 0% { bottom: -600px; /* Fuera de la pantalla */ opacity: 0; /* Invisible */ } 100% { bottom: calc(5vh); /* Posición final */ opacity: 1; /* Totalmente visible */ } } `;customElements.define("layout-component",class extends nt{static styles=rt;render(){return j` <div class="layout-container"> <!-- Header --> <div class="header-container"> <slot name="header"></slot> </div> <!-- Main Chat --> <div class="main-chat-container"> <slot name="main-chat"></slot> </div> <!-- Footer --> <div class="footer-container"> <slot name="footer"></slot> </div> </div> `}});const at=o` .main-chat-layout { width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; /* Evita desbordes */ box-sizing: border-box; } .message-body-container { max-width: 100%; height: 361px; max-height: 361px; box-sizing: border-box; overflow-y: auto; /* Habilita scroll si el contenido excede */ background: #fff; /* Fondo blanco */ scrollbar-width: thin; /* Scroll fino en Firefox */ scrollbar-color: rgba(0, 0, 0, 0.2) transparent; /* Colores en Firefox */ } .input-message-container { max-width: 416px; height: 61px; max-height: 61px; flex-shrink: 0; background: #fff; /* Fondo blanco */ border-top: 0.5px solid var(--Gray-5, #E0E0E0); border-bottom: 0.5px solid var(--Gray-5, #E0E0E0); box-sizing: border-box; }`,ct=o` .message-container { display: flex; width: 100%; align-items: center; background: #FFF; } .messages-body-container{ box-sizing: border-box; display:flex; flex-direction: column; gap: 22px; margin: 18px; max-width: 416px; height: auto; background: #FFF; } .assistant { justify-content: start; } .user{ justify-content: end; }`,ht=o` .message-wrapper { position: relative; display: inline-block; /* así no ocupa todo el ancho */ } .arrow_out_img { position: absolute; top: 5px; right: 5px; width: 17x; /* Ajusta el tamaño según necesidad */ height: 17px; background: transparent; /* Opcional: fondo blanco para que resalte */ border-radius: 50%; /* Opcional: redondear */ padding: 3px; /* Opcional: dar espacio interior */ transition: transform 0.2s ease-in-out; /* Suaviza la animación */ } .image-container { position: relative; width: fit-content; /* Ajusta al tamaño de la imagen */ height: fit-content; /* Ajusta al tamaño de la imagen */ max-width: 220px; max-height: 140px; margin: 12px auto; cursor: pointer; } .image-container:hover .arrow_out_img { transform: scale(1.12); /* Aumenta el tamaño un 20% */ } .image-message { width: auto; height: auto; max-width: 220px; max-height: 140px; object-fit: cover; /* Ajusta la imagen manteniendo el tamaño especificado */ border-radius: 10px; } .message { margin: 0px; text-align: start; padding: 20px; max-width: 342px; width: auto; font-family: Manrope, sans-serif; font-size: 16px; font-style: normal; font-weight: 500; line-height: 22px; box-sizing: border-box; word-wrap: break-word; /* Rompe palabras largas */ overflow-wrap: break-word; /* Asegura que las palabras se dividan */ } .assistant { background: #f5f5f5; border-radius: 0px 10px 10px 10px; color: var(--Black_text, #1e1e1e); } .user { background: var(--Azul_chatbot, #1446ff); color: #fff; border-radius: 10px 0px 10px 10px; } /* Botón de copiar */ .copy-button { position: absolute; top: 10px; left: 100%; margin-left: 8px; /* Espacio a la derecha de la burbuja */ background: transparent; border: none; cursor: pointer; width: 24px; height: 24px; opacity: 0.7; transition: opacity 0.2s; padding: 0; } .copy-button:hover { opacity: 1; } .copy-button img { width: 100%; height: 100%; } /* Tooltip */ .copied-tooltip { position: absolute; top: -28px; right: 0; background-color: #333; color: #fff; padding: 5px 8px; font-size: 12px; border-radius: 4px; white-space: nowrap; animation: fade-in-out 2s forwards; pointer-events: none; } @keyframes fade-in-out { 0% { opacity: 0; transform: translateY(-5px); } 15% { opacity: 1; transform: translateY(0); } 85% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-5px); } } /* Loader */ .loader { display: block; width: 5px; height: 5px; border-radius: 50%; background-color: #1446ff; box-shadow: 8px 0 #1446ff, -8px 0 #1446ff; position: relative; animation: flash 0.5s ease-out infinite alternate; } @keyframes flash { 0% { background-color: #c8d4ff; box-shadow: 8px 0 #c8d4ff, -8px 0 #1446ff; } 50% { background-color: #1446ff; box-shadow: 8px 0 #c8d4ff, -8px 0 #c8d4ff; } 100% { background-color: #c8d4ff; box-shadow: 8px 0 #1446ff, -8px 0 #c8d4ff; } } `;const lt=2;class pt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}class dt extends pt{constructor(t){if(super(t),this.it=z,t.type!==lt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===z||null==t)return this._t=void 0,this.it=t;if(t===I)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}dt.directiveName="unsafeHTML",dt.resultType=1;const ut=(t=>(...e)=>({_$litDirective$:t,values:e}))(dt),ft=o` .image-focus { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center; background: rgba(0, 0, 0, 0.7); /* Fondo oscuro semitransparente */ backdrop-filter: blur(5px); /* Efecto de desenfoque ligero */ z-index: 1000; } .image-focus img { width: auto; height: auto; max-width: 85vw; max-height: 85vh; object-fit: contain; border-radius: 10px; box-shadow: 2px 3px 22px rgba(255, 255, 255, 0.2); /* Sombra sutil */ opacity: 0; transform: scale(0.9); animation: fadeIn 0.3s ease-in-out forwards; } /* Botón de cierre mejorado */ .close-image { position: absolute; top: 20px; right: 20px; background: var( --Azul_chatbot, #1446ff ); ; border: none; color: white; font-size: 18px; font-weight: bold; padding: 8px 14px; border-radius: 50%; cursor: pointer; transition: background 0.3s ease-in-out; } .close-image:hover { background: rgba(255, 255, 255, 0.6); } /* Animación de entrada */ @keyframes fadeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } } @media (max-width: 768px) { .close-image { padding: 7px 12px; } } `;class gt extends nt{static properties={image:{type:String},imageFocus:{type:Boolean}};static styles=ft;constructor(){super(),this.image="",this.imageFocus=!1}_handleClickOutside(t){t.target.classList.contains("image-focus")&&this.dispatchEvent(new CustomEvent("close-image",{bubbles:!0,composed:!0}))}render(){return j` <div class="image-focus" @click=${this._handleClickOutside}> <button class="close-image" @click=${()=>this.dispatchEvent(new CustomEvent("close-image",{bubbles:!0,composed:!0}))}> x </button> <img src=${this.image} @click=${t=>t.stopPropagation()} /> </div> `}}customElements.define("image-component",gt);class mt extends nt{static properties={images:{type:String},message:{type:String},userType:{type:String},loading:{type:Boolean},showCopied:{type:Boolean,state:!0},imageFocus:{type:Boolean,state:!0}};static styles=ht;constructor(){super(),this.image="",this.message="",this.userType="",this.loading=!1,this.showCopied=!1,this.imageFocus=!1}_renderMessageWithBreaks(){if(!this.message)return j``;const t=this.message.split(/!?\[.*?\]\((.*?)\)/g).map((t=>{const e=t?.includes("amazonaws.com"),s=!!t?.includes("https://")||!!t?.includes("http://");if(e)return j` <div @click=${()=>this.onFocusImage(t)} class="image-container"> <img src=${"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%221.5%22%20stroke%3D%22blue%22%20class%3D%22size-6%22%3E%20%20%3Cpath%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20d%3D%22M3.75%203.75v4.5m0-4.5h4.5m-4.5%200L9%209M3.75%2020.25v-4.5m0%204.5h4.5m-4.5%200L9%2015M20.25%203.75h-4.5m4.5%200v4.5m0-4.5L15%209m5.25%2011.25h-4.5m4.5%200v-4.5m0%204.5L15%2015%22%20%2F%3E%3C%2Fsvg%3E"} class="arrow_out_img" alt="ver imagen ampliada del producto" /> <img src=${t} class="image-message" alt="previsualización del producto" /> </div> `;if(s)return j` <a href=${t} target="_blank" rel="noopener noreferrer">${t}</a> `;const i=t.trim().replace(/\n/g,"<br>");return j`${ut(i)}`})).filter(Boolean);return j`${t}`}async _copyToClipboard(){const t=this.message;if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(t),void this._showCopiedTooltip()}catch(t){console.warn("Error usando navigator.clipboard:",t)}const e=document.createElement("textarea");e.value=t,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.select();try{document.execCommand("copy"),this._showCopiedTooltip()}catch(t){console.error("Error copiando con execCommand:",t)}document.body.removeChild(e)}_showCopiedTooltip(){this.showCopied=!0,setTimeout((()=>{this.showCopied=!1}),2e3)}onFocusImage(t){this.image=t,this.imageFocus=!0}closeImage(){this.image="",this.imageFocus=!1}render(){const t="assistant"===this.userType&&!this.loading;return j` <div class="message-wrapper"> <!-- Burbuja de mensaje --> <p class="message ${this.userType}"> ${this.loading?j`<span class="loader"></span>`:this._renderMessageWithBreaks()} </p> <!-- Botón y tooltip, solo si es assistant y no loading --> ${t?j` <button class="copy-button" @click=${this._copyToClipboard} title="Copiar texto" > <img src=${"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%221.5%22%20stroke%3D%22currentColor%22%20class%3D%22size-6%22%3E%20%20%3Cpath%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20d%3D%22M15.666%203.888A2.25%202.25%200%200%200%2013.5%202.25h-3c-1.03%200-1.9.693-2.166%201.638m7.332%200c.055.194.084.4.084.612v0a.75.75%200%200%201-.75.75H9a.75.75%200%200%201-.75-.75v0c0-.212.03-.418.084-.612m7.332%200c.646.049%201.288.11%201.927.184%201.1.128%201.907%201.077%201.907%202.185V19.5a2.25%202.25%200%200%201-2.25%202.25H6.75A2.25%202.25%200%200%201%204.5%2019.5V6.257c0-1.108.806-2.057%201.907-2.185a48.208%2048.208%200%200%201%201.927-.184%22%20%2F%3E%3C%2Fsvg%3E"} alt="Copiar" /> </button> ${this.showCopied?j`<div class="copied-tooltip">Mensaje copiado</div>`:null} `:null} ${this.imageFocus?j` <image-component .imageFocus=${this.imageFocus} .image=${this.image?this.image:""} @close-image=${this.closeImage} > </image-component> `:""} </div> `}}customElements.define("message-component",mt);customElements.define("messages-body-component",class extends nt{static properties={messages:{type:Array}};static styles=ct;constructor(){super(),this.messages=[]}render(){const t=this.messages||[];return j` <div class="messages-body-container"> ${t[0]&&t.map((t=>j` <div class="message-container ${t?.userType}"> <message-component .images=${t?.images} .userType=${t?.userType} .message=${t?.text} .loading=${t?.loading}> </message-component> </div> `))} </div> `}});const yt=o` .input-message-container { display: flex; justify-content: center; align-items: center; max-width: 100%; height: 100%; box-sizing: border-box; } .input-message { box-sizing: border-box; padding: 18px 6px 18px 24px; border: 0px; width: 100%; color: black; font-family: Manrope; font-size: 16px; font-style: normal; font-weight: 500; line-height: 22px; outline: none; transition: border-color 0.3s, box-shadow 0.3s; } .input-message:focus { border: 0.5px solid var(--Azul_chatbot, #1446ff); /* Cambia el borde */ background-color: white; /* Cambia el fondo */ } .button-send { cursor: pointer; display: flex; justify-content: center; align-items: center; border: 0px; margin: 6px 18px; border-radius: 100%; width: 50px; height: 50px; max-width: 50px; max-height: 50px; flex-shrink: 0; background-color: var(--Azul_chatbot, #1446ff); box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.1); user-select: none; /* Bloquea selección de texto */ -webkit-user-select: none; /* Para compatibilidad Safari iOS */ } .icon-send { position: relative; left: 2px; width: 22px; height: 19px; max-width: 22px; max-height: 19px; user-select: none; /* Bloquea selección de texto */ -webkit-user-select: none; /* Para compatibilidad Safari iOS */ } `;customElements.define("input-message-component",class extends nt{static properties={message:{type:String,state:!0},submit:{type:Function}};static styles=yt;constructor(){super(),this.message="",this.submit=async()=>{}}_handleInputChange(t){this.message=t.target.value}async _handleSubmit(){if(this.submit&&"function"==typeof this.submit&&this.message.trim().length>0)try{const t=this.message;this.message="",await this.submit(t)}catch(t){console.error("Problemas al comunicarse con el chat-bot: ",t?.message)}}_handleKeyPress(t){"Enter"===t.key&&this._handleSubmit()}render(){return j` <div class="input-message-container"> <input type="text" class="input-message" .value=${this.message} @input=${this._handleInputChange} @keypress=${this._handleKeyPress} placeholder="Escribe tu mensaje..." /> <button @click=${this._handleSubmit} class="button-send" aria-label="Enviar mensaje" title="Enviar mensaje" .disabled=${!this.message} > <img class="icon-send" src=${"data:image/svg+xml,%3Csvg%20width%3D%2223%22%20height%3D%2220%22%20viewBox%3D%220%200%2023%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cmask%20id%3D%22mask0_1023_4570%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2223%22%20height%3D%2221%22%3E%3Crect%20x%3D%220.441406%22%20y%3D%220.705887%22%20width%3D%2222.0588%22%20height%3D%2219.3015%22%20fill%3D%22%23D9D9D9%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_1023_4570%29%22%3E%3Cpath%20d%3D%22M2.1875%2019.3458C1.77114%2019.5121%201.37603%2019.4767%201.00218%2019.2396C0.628332%2019.0025%200.441406%2018.6571%200.441406%2018.2035V12.3838L9.98598%2010.0773L0.441406%207.77073V1.95099C0.441406%201.49741%200.628332%201.15205%201.00218%200.914914C1.37603%200.677782%201.77114%200.642398%202.1875%200.808758L21.429%208.92124C21.9416%209.15078%2022.198%209.53693%2022.198%2010.0797C22.198%2010.6224%2021.9416%2011.0069%2021.429%2011.2333L2.1875%2019.3458Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"} alt="Icono de enviar" /> </button> </div> `}});class vt extends nt{static styles=at;static properties={messages:{type:Array},onSendMessage:{type:Function},isDragging:{type:Boolean},startY:{type:Number},scrollTopStart:{type:Number}};constructor(){super(),this.messages=[],this.onSendMessage=t=>{console.log("Mensaje enviado:",t)},this.isDragging=!1,this.startY=0,this.scrollTopStart=0}_scrollToBottom(){const t=this.renderRoot.querySelector(".message-body-container");t&&requestAnimationFrame((()=>{t.scrollTo({top:t.scrollHeight,behavior:"smooth"})}))}updated(t){t.has("messages")&&this._scrollToBottom()}_onMouseDown(t){this.isDragging=!0,this.startY=t.clientY;const e=this.renderRoot.querySelector(".message-body-container");this.scrollTopStart=e.scrollTop,t.preventDefault()}_onMouseMove(t){if(!this.isDragging)return;const e=this.renderRoot.querySelector(".message-body-container"),s=t.clientY-this.startY;e.scrollTop=this.scrollTopStart-s}_onMouseUp(){this.isDragging=!1}render(){return j` <div class="main-chat-layout"> <!-- Message Body --> <div class="message-body-container" > <messages-body-component .messages=${this.messages} ></messages-body-component> </div> <!-- Input Message --> <div class="input-message-container"> <input-message-component .submit=${this.onSendMessage} ></input-message-component> </div> </div> `}}customElements.define("main-chat-layout",vt);const Ct=o` .header-container { padding: 20px; /* Espaciado interno */ display: flex; /* Habilita el modelo de caja flexible */ align-items: center; /* Alinea elementos verticalmente al centro */ justify-content: start; /* Alinea elementos horizontalmente al inicio */ position: relative; /* Necesario si se posicionarán elementos hijos con valores absolutos */ width: 100%; /* Ancho por defecto: ocupa todo el espacio disponible */ height: 100%; /* Altura fija */ gap: 15px; /* Espaciado entre elementos flexibles */ background: var( --Azul_chatbot, #1446ff ); /* Fondo con variable o valor de color */ box-sizing: border-box; user-select: none; /* Bloquea selección de texto */ -webkit-user-select: none; /* Para compatibilidad Safari iOS */ } .header-title { margin: 0px; color: var(--Fondo_sidebar, #fafafa); font-family: Montserrat; font-size: 20.23px; font-style: normal; font-weight: 300; line-height: normal; } .header-title-span { font-weight: 700; } .header-sub-title { color: var(--Fondo_sidebar, #fafafa); margin: 0px; font-family: Manrope; font-size: 16px; font-style: normal; font-weight: 500; line-height: 22px; } .container-text { display: flex; flex-direction: column; justify-content: center; gap: 2.64px; } .icon-container { width: 78px; height: 78px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background-color: #e7e7e7; /* Fondo gris para el ícono */ border-radius: 50%; /* Hacerlo circular */ } /* Posición del botón para cerrar el chat (ArrowDown) */ .header-button-position { position: absolute; top: 10px; right: 10px; } /* Botón de refresh, lo puedes reubicar o ajustar según tus necesidades */ .header-button-refresh { position: absolute; top: 10px; right: 50px; /* Ajusta para que no se superponga con el arrow_down */ } .geni-title-img { width: 180px; /* Ajusta el tamaño que desees */ height: auto; /* Mantiene proporción */ object-fit: contain; /* O cover, si fuera un background-like */ } `;var bt="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20version%3D%221.1%22%20viewBox%3D%220%200%202048%201602%22%20width%3D%22533%22%20height%3D%22417%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20transform%3D%22translate%28370%2C2%29%22%20d%3D%22m0%200h20l16%205%2014%209%208%208%208%2013%205%2016v19l-4%2014-7%2013-6%207-10%208-14%207-10%203-1%20302%2013%203%2015%208%2011%209%209%209%2010%2014%2010%2018%201%203%204-1%2011-8%2015-9%2025-14%2021-10%2026-10%2031-10%2036-8%2028-4%2034-2h661l31%202%2031%204%2031%207%2027%208%2029%2011%2020%209%2025%2013%2015%209%206%204%2010-16%208-10%209-10%2010-8%2016-8%2011-3%201-48v-255l-8-1-11-5-10-6-10-10-8-13-5-17v-16l3-12%208-16%204-5h2l2-4%209-7%2012-6%2011-3h20l16%205%2010%206%2010%209%207%209%206%2013%202%208v21l-3%2011-7%2014-9%2010-11%208-11%205-10%203-1%20302%2010%202%2016%208%2011%208%206%205%2011%2014%209%2014%209%2019%206%2018%206%2026%202%2018v41l-3%2022-6%2024-4%2012v7l11%2028%207%2021%207%2028%206%2033%203%2028%202%2060%2025%207%2019%208%2023%2012%2013%209%2013%2010%2011%209%2015%2014%2015%2015%209%2011%2010%2011%2012%2016%2013%2018%2012%2019%209%2015%2012%2022%2012%2023%2013%2029%2012%2031%209%2025%2010%2034%208%2033%207%2038%205%2037%204%2049v17l-3%2035-4%2028-6%2031-8%2026-6%2015-10%2021-7%2011-8%2011-11%2012-10%2010-14%2010-16%208-18%206-11%202h-26l-25-5-21-7-16-8-16-9-13-9-16-12-12-11-8-7-15-15-7-8-12-14-14-18-14-20-12-19-13-22-10-18-10-22-4%201-8%208-7%208-9%209-8%207-8%208-28%2022-24%2016-20%2012-15%208-26%2012-36%2013-29%208-25%205-31%204-34%202h-647l-27-1-36-4-31-6-31-9-28-10-20-9-16-8-17-9-19-12-16-11-13-10-11-9-14-12-10-10-8-7-9-10-2-1-2%207-10%2019-12%2021-13%2021-13%2019-14%2019-11%2013-9%2011-11%2011-7%208-13%2012-8%207-17%2013-12%208-15%209-23%2011-20%206-22%204h-25l-15-3-17-6-15-8-13-10-8-7-7-8-10-12-9-14-10-19-8-21-7-23-6-29-4-26-3-28v-45l5-44%205-35%206-31%2010-40%2011-35%2011-29%2013-31%2012-25%2013-25%2012-21%2014-22%2011-15%2012-16%2011-13%209-11%2028-28%2011-9%2015-12%2012-8%2014-8%2016-8%2015-6%2013-4h3v-43l2-32%204-28%206-29%209-31%205-15%201-7-6-12-9-24-5-21-3-18-1-10v-35l4-28%205-20%207-19%209-19%2012-17%2011-12%2010-8%2016-8%2012-3v-303l-8-1-11-5-10-6-12-12-7-14-4-16v-12l3-14%208-16%209-10%208-6%2014-7z%22%20fill%3D%22%23010101%22%2F%3E%3Cpath%20transform%3D%22translate%28694%2C419%29%22%20d%3D%22m0%200h33l1%201v247l-1%201-47%201-25%202-20%204-27%209-17%208-14%208-16%2011-11%209-16%2015-7%208-10%2013-7%2011-8%2014-10%2021-8%2025-4%2021-1%209-1%2027v23l1%2023%204%2025%206%2021%208%2020%2011%2021%2010%2015%2011%2014%207%207%204%205%208%207%2015%2012%2013%209%2016%209%2020%209%2018%206%2023%205%2016%202%2014%201%20301%201%20379-1%2025-2%2020-4%2024-7%2021-9%2015-8%2013-9%2013-10%2014-12%2012-13%2012-16%2012-20%2010-21%209-27%204-20%202-22v-47l-3-30-5-22-9-24-11-22-11-17-10-13-11-12-11-11-17-13-16-10-15-8-25-10-17-5-24-4-15-1-58-1-1-1v-247l1-1h31l38%202%2030%204%2028%206%2027%208%2028%2010%2027%2012%2026%2014%2020%2013%2016%2011%2014%2011%2014%2012%2012%2011%2025%2025%209%2011%2013%2016%2013%2019%2010%2015%2018%2034%2013%2029%2012%2036%207%2028%205%2029%203%2031v317l-2%2026-5%2033-7%2029-9%2029-10%2025-14%2029-13%2023-14%2021-12%2016-11%2014-14%2015-7%208h-2l-1%203-8%207-9%209-11%209-12%2010-18%2013-21%2013-19%2011-24%2012-25%2010-31%2010-28%207-28%205-28%203-24%201h-637l-36-1-29-3-31-6-27-7-30-10-23-10-25-12-22-13-15-10-14-10-15-12-11-9-9-9-8-7-15-15-9-11-8-9-13-17-9-13-13-21-14-25-9-20-9-23-9-28-7-29-4-21-3-26-1-15-1-35v-43l1-237%203-31%205-28%208-33%2011-32%2013-30%2012-22%2011-19%208-12%2014-19%2013-16%2013-15%208-9h2l1-3%208-7%2014-13%2011-9%2017-13%2023-15%2015-9%2029-15%2021-9%2031-11%2034-9%2036-6%2020-2z%22%20fill%3D%22%23FDFDFD%22%2F%3E%3Cpath%20transform%3D%22translate%28734%2C420%29%22%20d%3D%22m0%200h571l1%20246-1%202h-571l-1-1v-246z%22%20fill%3D%22%23FDFDFD%22%2F%3E%3Cpath%20transform%3D%22translate%281756%2C930%29%22%20d%3D%22m0%200%209%206%2015%2013%2013%2012%2016%2016%209%2011%208%209%2015%2020%2011%2015%2011%2017%207%2011%206%2011%206%2010%206%2012%209%2017%2014%2032%207%2019%2013%2036%209%2030%2010%2044%206%2034%203%2023%203%2045v38l-3%2036-5%2030-4%2017-4%2014-7%2021-12%2025-12%2017-12%2014-8%207-6%207-11-1-17-4-17-6-16-8-16-9-13-9-16-12-12-11-8-7-15-15-7-8-12-14-14-18-14-20-12-19-13-22-10-18-10-22-3-2%206-8%2011-13%2011-15%207-10%2012-20%2014-27%2010-22%209-24%208-27%207-30%204-24%202-21%201-20z%22%20fill%3D%22%23808080%22%2F%3E%3Cpath%20transform%3D%22translate%28280%2C937%29%22%20d%3D%22m0%200h2l1%2044%201%20128%201%2026%203%2026%204%2022%207%2029%2010%2032%208%2020%2011%2024%2015%2027%208%2013%207%2011%209%2012%2011%2014%2012%2014%201%202h-2l-2%207-10%2019-12%2021-13%2021-13%2019-14%2019-11%2013-9%2011-11%2011-7%208-13%2012-8%207-17%2013-12%208-15%209-23%2011-20%206-15%203h-6l-7-8-11-11-13-17-9-15-10-22-9-27-6-24-5-34-2-26v-45l3-38%205-39%206-32%207-30%208-28%2011-32%2012-31%209-20%2012-25%2014-26%2016-26%2015-22%2014-19%2012-14%209-11%2011-11%207-8%2015-14z%22%20fill%3D%22%23808080%22%2F%3E%3Cpath%20transform%3D%22translate%281340%2C738%29%22%20d%3D%22m0%200h14l19%202%2020%205%2021%209%2018%2011%2011%209%2010%209%2011%2013%2011%2017%208%2017%206%2018%204%2022v30l-3%2018-5%2017-10%2021-12%2018-12%2014-12%2011-14%2010-21%2011-21%207-14%203-9%201h-27l-22-4-21-7-19-10-11-7-14-12-11-11-12-17-8-14-5-11-7-24-2-12-1-22%202-19%206-24%207-17%208-14%2011-15%209-10%207-7%2018-13%2018-10%2015-6%2019-5z%22%20fill%3D%22%23074ACB%22%2F%3E%3Cpath%20transform%3D%22translate%28697%2C738%29%22%20d%3D%22m0%200h14l20%202%2019%205%2015%206%2020%2011%2013%2010%2010%209%207%207%2012%2016%2010%2018%207%2018%205%2021%201%208v33l-3%2017-5%2017-9%2019-10%2015-7%209-9%2010-7%207-13%2010-19%2011-18%207-18%205-14%202h-28l-22-4-20-7-16-8-14-9-10-8-10-9-7-8-10-14-9-16-7-17-5-19-2-15v-25l3-19%205-17%209-21%2010-16%209-11%203-4h2l2-4h2v-2l14-11%2015-10%2016-8%2016-6%2021-4z%22%20fill%3D%22%23074ACB%22%2F%3E%3Cpath%20transform%3D%22translate%281756%2C869%29%22%20d%3D%22m0%200%208%201%2020%206%2021%209%2014%208%2015%2010%2012%209%2014%2012%2016%2015%209%209%207%208%2011%2013%2013%2017%2013%2018%2010%2015%2013%2022%209%2016%2010%2019%2011%2023%2013%2032%2013%2036%206%2019%2010%2038%207%2035%205%2031%203%2028%201%2014v65l-3%2031-4%2023-8%2032-10%2027-10%2019-11%2016-9%2011-6%207-11%209-10%207-10%206-16%206-19%204-11%201v-3l7-8%2010-12%2010-15%2012-23%209-25%205-17%205-24%205-37%201-14v-49l-2-29-4-34-6-36-6-28-9-33-12-36-14-36-12-27-13-26-11-20-14-23-12-18-14-19-10-13-13-15-11-12-11-11-8-7-13-11-15-11-1-8v-35z%22%20fill%3D%22%23FCFCFC%22%2F%3E%3Cpath%20transform%3D%22translate%28278%2C871%29%22%20d%3D%22m0%200h4l1%2017v27l-1%2015-5%205-15%2013-13%2012-10%2010-7%208-13%2015-14%2019-13%2018-12%2019-14%2024-12%2023-8%2016-11%2025-13%2033-12%2036-7%2024-9%2039-7%2043-4%2035-1%2011-1%2024v22l2%2030%205%2036%205%2024%208%2026%206%2015%208%2016%209%2015%209%2012%2012%2014%201%203h-9l-18-3-15-5-16-9-14-11-7-6-7-8-8-10-10-15-8-16-8-19-7-23-7-34-3-24-2-30v-36l3-42%204-30%209-47%208-32%2011-35%2015-40%2011-25%2012-25%2012-23%208-13%2010-17%2011-16%2013-18%2011-14%2011-13%2014-15%2014-14%208-7%2016-13%2017-12%2018-10%2021-9z%22%20fill%3D%22%23FBFBFB%22%2F%3E%3Cpath%20transform%3D%22translate%28693%2C797%29%22%20d%3D%22m0%200h23l16%204%2012%205%2014%209%2013%2012%2010%2014%205%2011%205%2017%201%206v20l-4%2017-5%2012-7%2012-11%2012-8%207-13%208-15%206-13%203h-24l-16-4-14-6-13-9-9-8-10-13-8-16-5-17-1-8v-11l3-17%206-17%2010-16%2012-12%2014-10%2015-7%2011-3z%22%20fill%3D%22%23010101%22%2F%3E%3Cpath%20transform%3D%22translate%281335%2C797%29%22%20d%3D%22m0%200h23l14%203%2017%207%2013%209%2013%2013%209%2014%206%2013%204%2016%201%2016-2%2016-6%2017-8%2014-12%2014-13%2010-14%207-17%205-5%201h-23l-16-4-12-5-14-9-10-9v-2l-3-1-10-14-6-13-4-15-1-6v-19l4-18%205-12%207-11%209-10%208-8%2010-7%2016-8z%22%20fill%3D%22%23010101%22%2F%3E%3Cpath%20transform%3D%22translate%28910%2C966%29%22%20d%3D%22m0%200h230l2%201-1%2014-3%2015-6%2018-8%2015-9%2012-11%2012-10%208-19%2011-16%206-19%204-10%201h-10l-16-2-16-4-16-7-15-9-13-11-11-12-11-18-5-11-5-17-3-19v-6z%22%20fill%3D%22%23FBFBFB%22%2F%3E%3Cpath%20transform%3D%22translate%28371%2C431%29%22%20d%3D%22m0%200h18l14%204%2011%206%2010%208%208%208%2013%2018%208%2016v5l-13%2011-11%209-10%209-8%207-19%2019-9%2011-12%2014-14%2019-15%2024-10%2018-9%2017-9%2020h-3l-8-19-7-24-4-20-2-21v-23l2-22%205-24%206-20%208-18%207-12%2012-16%208-8%2010-7%2012-6z%22%20fill%3D%22%23FCFCFC%22%2F%3E%3Cpath%20transform%3D%22translate%281630%2C431%29%22%20d%3D%22m0%200h18l13%204%2012%206%2011%209%209%209%2011%2016%208%2015%207%2019%205%2017%204%2024%201%2013v30l-2%2020-4%2021-6%2021-3-1-7-16-12-22-14-21-9-12-10-13-14-17-16-17-15-14-11-9-13-11-17-12-6-5%201-4%2010-16%209-10%206-7%2011-8%2012-6z%22%20fill%3D%22%23FCFCFC%22%2F%3E%3Cpath%20transform%3D%22translate%281632%2C7%29%22%20d%3D%22m0%200h14l13%203%2010%205%2012%2010%207%2010%205%2010%202%207%201%2013-2%2012-4%2011-7%2010-10%2010-16%208-7%202-13%201-13-2-12-5-11-8-8-9-7-14-3-14%201-14%204-13%207-12%2010-10%2014-8z%22%20fill%3D%22%23FBFBFB%22%2F%3E%3Cpath%20transform%3D%22translate%28372%2C7%29%22%20d%3D%22m0%200h14l14%203%2011%206%2011%209%207%2010%205%2011%202%209v15l-3%2013-6%2011-9%2010-11%208-9%204-7%202-12%201-14-2-12-5-11-8-8-9-8-16-2-9v-13l4-16%209-14%209-9%2014-8z%22%20fill%3D%22%23FBFBFB%22%2F%3E%3Cpath%20transform%3D%22translate%281905%2C1589%29%22%20d%3D%22m0%200v3%201l19-1v1l-21%203-2-2z%22%20fill%3D%22%23808080%22%2F%3E%3C%2Fsvg%3E";const _t=o` .button-default { display: flex; justify-content: center; align-items: center; padding:0; background-color: transparent; cursor: pointer; border: 0; } .button-default:hover { border: 0; /* Quita el borde del botón */ background-color: transparent; /* H } .button-close{ width: 30px; height: 30px; } `,xt=o` .sm{ width: 19px; height: 18px; flex-shrink: 0; margin-top: 5px; } .default{ width: 30px; height: 30px; flex-shrink: 0; } .md{ width: 80px; height: 19px; } .profile{ width: 51px; height: 40px; } `;customElements.define("icon-img-component",class extends nt{static properties={icon:{type:String},description:{type:String},iconStyle:{type:String}};static styles=xt;constructor(){super(),this.icon="",this.description="",this.iconStyle=""}render(){return j` <img class=${this.iconStyle} src=${this.icon} alt="${this.description}" /> `}});class wt extends nt{static properties={icon:{type:String},styleImg:{type:String},description:{type:String},styleBtn:{type:String},callback:{type:Function},isActive:{type:Boolean}};static styles=_t;constructor(){super(),this.styleImg="",this.styleBtn="",this.icon="",this.description="",this.callback=async()=>{},this.isActive=!0}render(){return j` <button @click=${this.callback} class=${`button-default ${this.styleBtn}`} aria-label=${this.description} title=${this.description} .disabled=${!this.isActive} > <icon-img-component .iconStyle=${this.styleImg} .icon=${this.icon} .description=${`Icono de ${this.description}`} > </icon-img-component> </button> `}}customElements.define("icon-btn-component",wt);const kt=o` .modal-container { display: flex; position: absolute; top: 138px; left: 50%; transform: translateX(-50%); z-index: 9999; width: 100%; max-width: 416px; height: 187px; padding: 30px; flex-direction: column; align-items: flex-start; gap: 24px; flex-shrink: 0; border-radius: 16px; background: var(--Fondo_sidebar, #fafafa); box-shadow: 1px 3px 6px 0px rgba(0, 0, 0, 0.2); box-sizing: border-box; user-select: none; /* Bloquea selección de texto */ -webkit-user-select: none; /* Para compatibilidad Safari iOS */ } @media screen and (max-width: 500px) { .modal-container { width: 95%; } } .modal-title { align-self: stretch; color: var(--Gray-1, #333); text-align: center; font-family: Manrope; font-size: 20px; font-style: normal; font-weight: 700; line-height: 100%; /* 20px */ margin: 0; } .modal-subtitle { align-self: stretch; color: var(--Gray-3, #828282); text-align: center; font-family: Manrope; font-size: 16px; font-style: normal; font-weight: 600; line-height: 100%; /* 16px */ margin: 0; } .buttons-container { display: flex; flex-direction: row; justify-content: space-between; align-self: stretch; } .btn-cancelar { border-radius: 100px; border: 1px solid var(--Azul_chatbot, #1446ff); box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.1); display: flex; width: 150px; height: 40px; padding: 0px 16px; justify-content: center; align-items: center; gap: 8px; background: transparent; cursor: pointer; font-family: Manrope; font-size: 16px; font-weight: 600; color: var(--Azul_chatbot, #1446ff); } .btn-reiniciar { border-radius: 100px; background: var(--Azul_chatbot, #1446ff); box-shadow: 0px 2px 2px 0px rgba(0,