@horneross/embeds 1.0.257 → 1.0.258

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -379,7 +379,7 @@ Error message: ${y0e(r)}`,cause:r}),this[A0e]=!0,this.value=t}static isInstance(
379
379
  height: 100%;
380
380
  min-height: 0;
381
381
  }
382
- `}),(0,gd.jsx)(LS,{...o,...s?{agentIconUrl:s}:{},emptyComponent:(0,gd.jsx)(ybe,{agentIconUrl:s,agentName:r?.displayName??void 0,agentDescription:r?.initialMessage??void 0,helpLinks:r?.helpLinks??void 0,primaryColor:r?.primaryColor??void 0})})]})})},xbe=qKe;c();var Np=E(W());var Ku=E(q()),wbe=(0,Np.memo)(({messages:e,delay:t=1e3,shouldAnimate:r=!0})=>{let[a,n]=(0,Np.useState)(0),[o,i]=(0,Np.useState)({});(0,Np.useEffect)(()=>{if(!r){n(e.length);return}if(e.length===0){n(0);return}n(0);let l=setTimeout(()=>{n(1)},500);return()=>clearTimeout(l)},[e,r]),(0,Np.useEffect)(()=>{if(!r||a>=e.length)return;let l=setTimeout(()=>{n(u=>Math.min(u+1,e.length))},t);return()=>clearTimeout(l)},[a,e.length,t,r]);let s=l=>{i(u=>({...u,[l]:!0}))};return(0,Ku.jsx)(q1,{spacing:2,className:"p-2",children:(0,Ku.jsx)(ir,{children:e.slice(0,a).map((l,u)=>(0,Ku.jsx)(we.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},children:(0,Ku.jsxs)(q1,{direction:"row",spacing:2,align:"start",children:[l.iconUrl&&(0,Ku.jsx)($u,{className:"size-8 mt-1 bg-[#E5E5E5] dark:bg-[#404040]",children:o[u]?(0,Ku.jsx)("span",{className:"text-xs font-semibold uppercase text-black dark:text-white",children:l.from==="agent"?"A":l.from?.[0]?.toUpperCase()||"H"}):(0,Ku.jsx)(Hu,{src:l.iconUrl,alt:"Agent avatar",onError:()=>s(u)})}),(0,Ku.jsx)("div",{className:V("rounded-2xl px-4 py-3 max-w-[80%] text-sm",l.from==="agent"?"bg-white dark:bg-white text-black dark:text-black border border-gray-200":"bg-primary text-white"),children:l.message})]})},u))})})});wbe.displayName="InitialMessagesRenderer";var Sbe=wbe;c();var Cbe=E(W()),GKe=e=>(0,Cbe.useReducer)((r,a)=>({...r,...a}),{...e}),kbe=GKe;c();var Tbe=E(W()),AR=we(Tbe.default.forwardRef(function({children:t},r){return t?.({ref:r})}));c();var q9=E(q()),WKe=e=>{let{startNewChat:t,messages:r}=Ov(),{className:a,alwaysShow:n,...o}=e;return!n&&(!Array.isArray(r)||r.length<2)?null:(0,q9.jsx)("button",{onClick:()=>t(),className:co("p-1.5 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 transition-colors rounded-md flex items-center justify-center",a),title:"Nuevo Chat",...o,children:(0,q9.jsx)(Wd,{className:"w-3.5 h-3.5",strokeWidth:2.5})})},RR=WKe;var Je=E(q()),YKe={theme:"light",primaryColor:"#000000",position:"right",initialMessages:[]},W2r=wl(),ZKe=e=>{let[t,r]=(0,Wa.useState)(!1),[a,n]=(0,Wa.useState)([]),[o,i]=(0,Wa.useState)(!1),s=(0,Wa.useRef)(null),l=(0,Wa.useRef)(!1);return(0,Wa.useEffect)(()=>{let u=d=>{s.current&&!s.current.contains(d.target)&&r(!1)};if(t)return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[t]),(0,Wa.useEffect)(()=>{if(t&&!o&&!l.current){let u=e.visitorId||null;if(!u&&typeof window<"u"&&(u=localStorage.getItem("visitorId")),!u||!e.agentId)return;l.current=!0,i(!0);let f=`${wl()}/api/v2/agent/${e.agentId}/conversations?visitorId=${u}`;fetch(f).then(p=>p.json()).then(p=>{n(p.conversations||[]),i(!1)}).catch(p=>{console.error("[Bubble] Failed to load conversations:",p),n([]),i(!1)})}},[t,o,e.agentId,e.visitorId]),(0,Je.jsxs)("div",{className:"relative flex flex-col w-full h-full max-h-full overflow-visible",children:[(0,Je.jsx)("div",{className:"sticky top-0 w-full z-10 bg-white dark:bg-[#171717]",children:(0,Je.jsxs)("div",{className:"flex flex-row px-2.5 py-2 items-center gap-2",children:[(0,Je.jsxs)($u,{style:{width:"36px",height:"36px",minWidth:"36px",minHeight:"36px",flexShrink:0,backgroundColor:"#E5E5E5"},children:[(0,Je.jsx)(Hu,{src:e?.imageUrl,style:{width:"36px",height:"36px",objectFit:"contain"}}),(0,Je.jsx)(ip,{style:{fontSize:"14px",fontWeight:600,textTransform:"uppercase",color:"#000000"},children:e.config?.displayName?.[0]||"H"})]}),!e.hasMessages&&(0,Je.jsx)("span",{style:{fontSize:"14px",fontWeight:600,color:"#000000"},children:"New chat"}),e.hasMessages&&(0,Je.jsx)(Je.Fragment,{children:(0,Je.jsxs)("div",{ref:s,style:{position:"relative"},children:[(0,Je.jsxs)("div",{role:"button",tabIndex:0,onMouseDown:u=>{u.preventDefault(),u.stopPropagation()},onClick:u=>{u.preventDefault(),u.stopPropagation(),r(!t)},onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),u.stopPropagation(),r(!t))},onMouseEnter:u=>{u.currentTarget.style.backgroundColor="rgba(229, 231, 235, 1)"},onMouseLeave:u=>{u.currentTarget.style.backgroundColor="rgba(243, 244, 246, 1)"},style:{display:"flex",alignItems:"center",gap:"8px",textAlign:"left",height:"32px",padding:"0 12px",borderRadius:"8px",cursor:"pointer",userSelect:"none",backgroundColor:"rgba(243, 244, 246, 1)",border:"1px solid rgba(229, 231, 235, 1)",transition:"background-color 0.15s ease"},children:[(0,Je.jsx)("span",{style:{fontSize:"14px",fontWeight:500,color:"#000000",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"160px"},children:e.config?.displayName||"Assistant"}),(0,Je.jsx)(er,{style:{width:"16px",height:"16px",color:"#6b7280",flexShrink:0,transition:"transform 0.2s ease",transform:t?"rotate(180deg)":"rotate(0deg)"},strokeWidth:2})]}),(0,Je.jsx)(ir,{children:t&&(0,Je.jsx)(AR,{initial:{opacity:0,y:-10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.95},transition:{duration:.15},children:({ref:u})=>{let d=a.length>0,f=o,p={position:"absolute",left:0,top:"100%",marginTop:"4px",width:"256px",backgroundColor:"#ffffff",border:"1px solid rgba(229, 231, 235, 1)",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1)",overflow:"hidden",zIndex:50};if(f)return(0,Je.jsx)("div",{ref:u,style:p,children:(0,Je.jsx)("div",{style:{padding:"16px",textAlign:"center"},children:(0,Je.jsx)("p",{style:{fontSize:"12px",color:"#6b7280"},children:"Cargando conversaciones..."})})});if(!d)return(0,Je.jsx)("div",{ref:u,style:p,children:(0,Je.jsx)("div",{style:{padding:"16px",textAlign:"center"},children:(0,Je.jsx)("p",{style:{fontSize:"12px",color:"#6b7280"},children:"No hay conversaciones previas"})})});let m=new Date,g=new Date(m.getFullYear(),m.getMonth(),m.getDate()),b=new Date(g);b.setDate(b.getDate()-1);let x=new Date(g);x.setDate(x.getDate()-7);let v={today:a.filter(I=>new Date(I.updatedAt)>=g),yesterday:a.filter(I=>{let A=new Date(I.updatedAt);return A>=b&&A<g}),thisWeek:a.filter(I=>{let A=new Date(I.updatedAt);return A>=x&&A<b}),older:a.filter(I=>new Date(I.updatedAt)<x)},y={padding:"8px 12px"},w={fontSize:"10px",fontWeight:600,textTransform:"uppercase",color:"#6b7280"},S={width:"100%",padding:"8px 12px",textAlign:"left",fontSize:"12px",backgroundColor:"transparent",border:"none",cursor:"pointer",transition:"background-color 0.15s ease"},k={color:"#111827",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",margin:0},T=I=>(0,Je.jsx)("button",{type:"button",onClick:A=>{A.preventDefault(),A.stopPropagation(),e.onLoadConversation?.(I.id),r(!1)},onMouseDown:A=>{A.preventDefault(),A.stopPropagation()},onMouseEnter:A=>{A.currentTarget.style.backgroundColor="rgba(243, 244, 246, 1)"},onMouseLeave:A=>{A.currentTarget.style.backgroundColor="transparent"},style:S,children:(0,Je.jsx)("p",{style:k,children:I.title||"Nueva conversaci\xF3n"})},I.id);return(0,Je.jsx)("div",{ref:u,style:p,children:(0,Je.jsxs)("div",{style:{maxHeight:"256px",overflowY:"auto"},children:[v.today.length>0&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("div",{style:y,children:(0,Je.jsx)("p",{style:w,children:"Hoy"})}),(0,Je.jsx)("div",{style:{padding:"4px 0"},children:v.today.map(T)})]}),v.yesterday.length>0&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("div",{style:y,children:(0,Je.jsx)("p",{style:w,children:"Ayer"})}),(0,Je.jsx)("div",{style:{padding:"4px 0"},children:v.yesterday.map(T)})]}),v.thisWeek.length>0&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("div",{style:y,children:(0,Je.jsx)("p",{style:w,children:"Esta semana"})}),(0,Je.jsx)("div",{style:{padding:"4px 0"},children:v.thisWeek.map(T)})]}),v.older.length>0&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("div",{style:y,children:(0,Je.jsx)("p",{style:w,children:"M\xE1s antiguas"})}),(0,Je.jsx)("div",{style:{padding:"4px 0"},children:v.older.map(T)})]})]})})}})})]})}),(0,Je.jsx)("div",{className:"flex-1 min-w-0"}),(0,Je.jsxs)("div",{className:"flex flex-row items-center gap-1",children:[e.hasMessages&&(0,Je.jsx)(RR,{alwaysShow:!0}),e.handleClose&&(0,Je.jsx)("button",{type:"button",onClick:e.handleClose,className:"p-1.5 hover:bg-gray-100 dark:hover:bg-white/5 rounded-md text-gray-700 dark:text-gray-300 transition-colors flex items-center justify-center",title:"Minimizar",children:(0,Je.jsx)(Bh,{className:"h-3.5 w-3.5",strokeWidth:2.5})})]})]})}),(0,Je.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden relative",children:e.children})]})},KKe=({...e})=>{let t=e.interfaceConfig||YKe,r=e?.interfaceConfig?.iconUrl||e?.agentIconUrl||"/images/chatbubble-default-icon.png",a=(0,Wa.useRef)(null),[n,o]=(0,Wa.useState)(!1),[i,s]=kbe({isOpen:!!e.isOpen,hasOpenOnce:!1,showInitialMessage:!1,visitorEmail:"",showLeadFormAfterMessageId:""});(0,Wa.useEffect)(()=>{if(r){let p=new Image;p.onload=()=>o(!0),p.src=r}},[r]),(0,Wa.useEffect)(()=>{s({isOpen:!!e.isOpen})},[e.isOpen]);let l=(0,Wa.useMemo)(()=>(t.initialMessages||[]).map(m=>m?.trim?.()).filter(m=>!!m),[t?.initialMessages]);(0,Wa.useEffect)(()=>{let p=null;return l?.length>0&&!t?.isInitMessagePopupDisabled&&(p=setTimeout(()=>{s({showInitialMessage:!0})},5e3)),()=>{p&&clearTimeout(p)}},[l?.length,t?.isInitMessagePopupDisabled]);let u=(0,Wa.useCallback)(()=>{s({isOpen:!1})},[]),d=(0,Wa.useMemo)(()=>(0,Je.jsxs)($u,{className:"bg-transparent",style:{width:"48px",height:"48px",minWidth:"48px",minHeight:"48px",...t?.bubbleIconStyle},children:[(0,Je.jsx)(Hu,{src:r,style:{width:"48px",height:"48px",maxWidth:"48px",maxHeight:"48px"}}),(0,Je.jsx)(ip,{className:"text-sm font-semibold uppercase",children:t?.displayName?.[0]||"H"})]}),[r,t?.bubbleIconStyle,t?.displayName]),f=Wa.default.useMemo(()=>p=>(0,Je.jsx)(ZKe,{...p,handleClose:u,imageUrl:r,config:t,agentId:e.agentId,visitorId:e.visitorId,onLoadConversation:e.onLoadConversation}),[t,r,u,e.agentId,e.visitorId,e.onLoadConversation]);return e?.isLoadingAgent?null:(0,Je.jsxs)(Je.Fragment,{children:[l?.length>0&&i.showInitialMessage&&!i.hasOpenOnce&&(0,Je.jsxs)("div",{ref:a,className:co("horneross-init-messages fixed bottom-[72px] flex flex-col gap-2 max-w-[90%] sm:max-w-[500px]",t?.position==="left"?"left-4":"right-4"),style:{zIndex:9999999999-1},children:[(0,Je.jsx)(Rr,{variant:"outline",size:"sm",className:co("absolute z-[2] -top-2 p-1 min-w-0 h-auto rounded-full -translate-y-full","bg-white dark:bg-[#171717]","border-gray-300 dark:border-white/20","hover:bg-gray-100 dark:hover:bg-white/10","text-black dark:text-white",t?.position==="left"&&"right-0",t?.position==="right"&&"right-0"),onClick:()=>s({showInitialMessage:!1}),children:(0,Je.jsx)(ua,{className:"h-3 w-3"})}),(0,Je.jsx)(Sbe,{messages:l.map(p=>({iconUrl:r,from:"agent",message:p,approvals:[]}))})]}),(0,Je.jsx)(AR,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:i.isOpen?1:0,scale:i.isOpen?1:.95,y:i.isOpen?0:10},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2,ease:[.4,0,.2,1]},children:({ref:p})=>(0,Je.jsx)(c2,{ref:p,className:co("flex-col box-border p-0 gap-0 overflow-hidden","border border-gray-300 dark:border-white/20","bg-white dark:bg-[#171717]",i.isOpen?"flex":"hidden",!i.isOpen&&"pointer-events-none"),style:{zIndex:9999999999,position:"fixed",bottom:"72px",left:t?.position==="left"?"16px":"auto",right:t?.position==="left"?"auto":"16px",width:"380px",height:"560px",maxHeight:"560px",borderRadius:"16px"},children:(0,Je.jsx)("div",{className:"relative flex flex-col h-full w-full flex-1 p-0 overflow-hidden",children:(0,Je.jsx)(xbe,{...e,chatBoxProps:{...e.chatBoxProps,isOpen:i.isOpen},agentIconUrl:r,interfaceConfig:t,layout:f})})})}),(0,Je.jsx)("div",{className:"horneross-widget",style:{zIndex:9999999999,position:"fixed",bottom:"16px",left:t?.position==="left"?"16px":"auto",right:t?.position==="left"?"auto":"16px",height:"48px"},children:(0,Je.jsx)(AR,{initial:"visible",animate:"visible",variants:{visible:{y:0,opacity:1,scale:1,transition:{when:"beforeChildren",staggerChildren:.3}},hidden:{y:100,opacity:0,scale:.8,transition:{when:"afterChildren"}}},children:({ref:p})=>(0,Je.jsxs)(Rr,{ref:p,variant:"default",className:co("horneross-launcher relative flex shrink-0 p-0 overflow-hidden","transition-all duration-300 ease-out","hover:opacity-90","active:scale-95"),style:{backgroundColor:t?.primaryColor||"#000000",width:"48px",height:"48px",minWidth:"48px",minHeight:"48px",borderRadius:"9999px",...t?.bubbleButtonStyle},onClick:()=>s({isOpen:!i.isOpen,...i.isOpen?{}:{hasOpenOnce:!0}}),children:[(0,Je.jsx)("div",{style:{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",opacity:i.isOpen?1:0,transform:i.isOpen?"rotate(0deg)":"rotate(-180deg)",transition:"opacity 0.3s ease, transform 0.3s ease",pointerEvents:i.isOpen?"auto":"none"},children:(0,Je.jsx)(Bh,{style:{width:"20px",height:"20px"}})}),(0,Je.jsx)("div",{style:{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",opacity:i.isOpen?0:1,transform:i.isOpen?"rotate(180deg)":"rotate(0deg)",transition:"opacity 0.3s ease, transform 0.3s ease",pointerEvents:i.isOpen?"none":"auto"},children:d})]})})})]})},Ebe=KKe;c();var im=E(W()),e1e=E(Qwe());c();var Od=E(q()),CQe={"phone-number":"phoneNumber","user-id":"userId","first-name":"firstName","last-name":"lastName",email:"email","visitor-id":"visitorId"},kQe="https://cdn.jsdelivr.net/npm/@horneross/embeds@latest",TQe=({children:e,container:t})=>((0,im.useEffect)(()=>{let r=()=>{document.documentElement.classList.contains("dark")?t.classList.add("dark"):t.classList.remove("dark")};r();let a=new MutationObserver(r);return a.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>a.disconnect()},[t]),(0,Od.jsx)(Od.Fragment,{children:e})),EQe=({name:e,widget:t,type:r})=>class extends HTMLElement{cssProvider=kQe+`/dist/${r}/index.css`;root;shadowRootElement;instanceId;setIsOpen;isOpen;onEnd;destroy(){this.innerHTML="",this.instanceId&&(window[this.instanceId]=null)}constructor(n){super(),this.instanceId=n?.instanceId,this.onEnd=n?.onEnd;let o=this.attachShadow({mode:"open"}),i=document.createElement("link");i.setAttribute("rel","preconnect"),i.setAttribute("href","https://fonts.googleapis.com");let s=document.createElement("link");s.setAttribute("rel","preconnect"),s.setAttribute("href","https://fonts.gstatic.com"),s.setAttribute("crossorigin","");let l=document.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("href","https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght@8..144,100..1000&display=swap");let u=document.createElement("link");u.setAttribute("rel","stylesheet"),u.setAttribute("type","text/css"),u.setAttribute("href",this.cssProvider),this.shadowRootElement=document.createElement("div"),this.shadowRootElement.className="light",o.appendChild(i),o.appendChild(s),o.appendChild(l),o.appendChild(u),o.appendChild(this.shadowRootElement),this.root=(0,e1e.createRoot)(this.shadowRootElement)}open(){this.setIsOpen?.(!0)}close(){this.setIsOpen?.(!1)}toggle(){this.setIsOpen?.(!this.isOpen)}createNewConversation(){this.dispatchEvent(new Event("CREATE_NEW_CONVERSATION",{bubbles:!0,composed:!0}))}updateConfig(n){n&&this.setAttribute("interface",JSON.stringify(n)),this.root.render((0,Od.jsx)(this.Component,{isOpen:this.isOpen,onEnd:this.onEnd}))}Component=n=>{let[o,i]=(0,im.useState)(!1);this.setIsOpen=i,this.isOpen=o;let s=Object.entries(CQe).reduce((f,[p,m])=>{let g=this.getAttribute(p);return g&&p!=="visitor-id"&&(f[m]=g),f},{}),l=this.getAttribute("visitor-id")||void 0,u=this.getAttribute("context"),d={};try{d=JSON.parse(this.getAttribute("interface"))}catch{}return(0,Od.jsx)(im.StrictMode,{children:(0,Od.jsx)(TQe,{container:this.shadowRootElement,children:(0,Od.jsx)("div",{className:"bg-transparent",children:im.default.createElement(t,{...n,isOpen:o,onEnd:this.onEnd,initConfig:d,context:u,agentId:this.getAttribute("agent-id")||"",formId:this.getAttribute("form-id")||"",contact:s,visitorId:l,styles:this.getAttribute("styles")?JSON.parse(this.getAttribute("styles")):{},onAgentLoaded:f=>{let p=f?.interfaceConfig?.customCSS;if(p){let m=document.createElement("style");m.innerHTML=p,this.shadowRootElement.appendChild(m)}}})})})})};connectedCallback(){this.root.render((0,Od.jsx)(this.Component,{isOpen:this.isOpen,onEnd:this.onEnd}))}},oN=EQe;var n1e=E(q()),t1e="horneross-chatbox-bubble",r1e=oN({type:"chatbox",widget:e=>(0,n1e.jsx)(_R,{...e,className:co("horneross-widget",e.className),children:Ebe}),name:t1e});customElements.define(t1e,r1e);var a1e=r1e;var IQe=async e=>{if(typeof window<"u"&&!window?.ChatboxBubble){let t=document?.currentScript?.src,r=document?.currentScript?.id,a=e.agentId||r;!a&&t&&(a=new URL(t).searchParams.get("agentId")||r||e.agentId),OC(e);let n=new a1e({instanceId:"ChatBoxBubble"});FC({element:n,...e}),window.ChatboxBubble=n,document?.body?.prepend(n)}return window?.ChatboxBubble},o1e=IQe;c();c();c();var hl=E(q()),_Qe="https://app.horneross.com/images/chatbubble-default-horneross.svg",AQe=e=>{let{query:t}=$y({id:e.agentId});return(0,hl.jsxs)("div",{className:co("relative w-full h-full flex flex-col",e.className),children:[(0,hl.jsx)("div",{className:"flex-shrink-0 px-2 pt-2 pb-2",children:(0,hl.jsxs)("div",{className:"px-2 py-1 flex items-center border border-gray-700 max-w-[700px] mx-auto bg-[#161618] rounded-lg",children:[(0,hl.jsx)("div",{className:"w-8 h-8 mr-2 rounded-full border border-gray-600 flex items-center justify-center overflow-hidden",children:t?.data?.iconUrl?(0,hl.jsx)("img",{src:t?.data?.iconUrl||_Qe,alt:"Agent",className:"w-full h-full object-cover"}):(0,hl.jsx)(lc,{className:"w-4 h-4 text-gray-400"})}),(0,hl.jsx)("h3",{className:"text-white font-medium text-lg font-['Bricolage_Grotesque']",children:e?.config?.displayName||t?.data?.name}),(0,hl.jsx)("div",{className:"ml-auto flex items-center",children:(0,hl.jsx)(RR,{variant:"plain"})})]})}),(0,hl.jsx)("div",{className:"flex-1 flex flex-col min-h-0",children:e.children})]})},i1e=AQe;var s1e=E(q()),hh="horneross-chatbox-standard",RQe=oN({type:"chatbox",widget:e=>(0,s1e.jsx)(_R,{layout:i1e,...e,className:co("horneross-widget",e.className)}),name:hh}),TH=RQe;var PQe=e=>{customElements.get(hh)||customElements.define(hh,TH),OC(e);let t="ChatBoxStandard_"+(e.id||""),r=new TH({instanceId:t}),a=e.id?document.querySelector(`${hh}[id="${e.id}"]`):document.querySelector(hh);if(!a)throw new Error(`<${hh}> element${`${e.id?` with ID ${e.id}`:""}`} not found.`);if(!window[t]){let n={...e.styles,...Array.from(a.style).reduce((o,i)=>(o[i]=a?.style.getPropertyValue(i),o),{})};FC({element:r,...e,styles:n}),window[t]=r,a.replaceWith(r)}return window[t]},l1e=PQe;var NQe={initBubble:o1e,initStandard:l1e},XAr=NQe;export{XAr as default};
382
+ `}),(0,gd.jsx)(LS,{...o,...s?{agentIconUrl:s}:{},emptyComponent:(0,gd.jsx)(ybe,{agentIconUrl:s,agentName:r?.displayName??void 0,agentDescription:r?.initialMessage??void 0,helpLinks:r?.helpLinks??void 0,primaryColor:r?.primaryColor??void 0})})]})})},xbe=qKe;c();var Np=E(W());var Ku=E(q()),wbe=(0,Np.memo)(({messages:e,delay:t=1e3,shouldAnimate:r=!0})=>{let[a,n]=(0,Np.useState)(0),[o,i]=(0,Np.useState)({});(0,Np.useEffect)(()=>{if(!r){n(e.length);return}if(e.length===0){n(0);return}n(0);let l=setTimeout(()=>{n(1)},500);return()=>clearTimeout(l)},[e,r]),(0,Np.useEffect)(()=>{if(!r||a>=e.length)return;let l=setTimeout(()=>{n(u=>Math.min(u+1,e.length))},t);return()=>clearTimeout(l)},[a,e.length,t,r]);let s=l=>{i(u=>({...u,[l]:!0}))};return(0,Ku.jsx)(q1,{spacing:2,className:"p-2",children:(0,Ku.jsx)(ir,{children:e.slice(0,a).map((l,u)=>(0,Ku.jsx)(we.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},children:(0,Ku.jsxs)(q1,{direction:"row",spacing:2,align:"start",children:[l.iconUrl&&(0,Ku.jsx)($u,{className:"size-8 mt-1 bg-[#E5E5E5] dark:bg-[#404040]",children:o[u]?(0,Ku.jsx)("span",{className:"text-xs font-semibold uppercase text-black dark:text-white",children:l.from==="agent"?"A":l.from?.[0]?.toUpperCase()||"H"}):(0,Ku.jsx)(Hu,{src:l.iconUrl,alt:"Agent avatar",onError:()=>s(u)})}),(0,Ku.jsx)("div",{className:V("rounded-2xl px-4 py-3 max-w-[80%] text-sm",l.from==="agent"?"bg-white dark:bg-white text-black dark:text-black border border-gray-200":"bg-primary text-white"),children:l.message})]})},u))})})});wbe.displayName="InitialMessagesRenderer";var Sbe=wbe;c();var Cbe=E(W()),GKe=e=>(0,Cbe.useReducer)((r,a)=>({...r,...a}),{...e}),kbe=GKe;c();var Tbe=E(W()),AR=we(Tbe.default.forwardRef(function({children:t},r){return t?.({ref:r})}));c();var q9=E(q()),WKe=e=>{let{startNewChat:t,messages:r}=Ov(),{className:a,alwaysShow:n,...o}=e;return!n&&(!Array.isArray(r)||r.length<2)?null:(0,q9.jsx)("button",{onClick:()=>t(),className:co("p-1.5 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 transition-colors rounded-md flex items-center justify-center",a),title:"Nuevo Chat",...o,children:(0,q9.jsx)(Wd,{className:"w-3.5 h-3.5",strokeWidth:2.5})})},RR=WKe;var Je=E(q()),YKe={theme:"light",primaryColor:"#000000",position:"right",initialMessages:[]},W2r=wl(),ZKe=e=>{let[t,r]=(0,Wa.useState)(!1),[a,n]=(0,Wa.useState)([]),[o,i]=(0,Wa.useState)(!1),s=(0,Wa.useRef)(null),l=(0,Wa.useRef)(!1);return(0,Wa.useEffect)(()=>{let u=d=>{s.current&&!s.current.contains(d.target)&&r(!1)};if(t)return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[t]),(0,Wa.useEffect)(()=>{if(t&&!o&&!l.current){let u=e.visitorId||null;if(!u&&typeof window<"u"&&(u=localStorage.getItem("visitorId")),!u||!e.agentId)return;l.current=!0,i(!0);let f=`${wl()}/api/v2/agent/${e.agentId}/conversations?visitorId=${u}`;fetch(f).then(p=>p.json()).then(p=>{n(p.conversations||[]),i(!1)}).catch(p=>{console.error("[Bubble] Failed to load conversations:",p),n([]),i(!1)})}},[t,o,e.agentId,e.visitorId]),(0,Je.jsxs)("div",{className:"relative flex flex-col w-full h-full max-h-full overflow-visible",children:[(0,Je.jsx)("div",{className:"sticky top-0 w-full z-10 bg-white dark:bg-[#171717]",children:(0,Je.jsxs)("div",{className:"flex flex-row px-2.5 py-2 items-center gap-2",children:[!e.hasMessages&&(0,Je.jsx)("span",{style:{fontSize:"14px",fontWeight:600,color:"#000000"},children:"New chat"}),e.hasMessages&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)($u,{style:{width:"36px",height:"36px",minWidth:"36px",minHeight:"36px",flexShrink:0,backgroundColor:"#E5E5E5"},children:[(0,Je.jsx)(Hu,{src:e?.imageUrl,style:{width:"36px",height:"36px",objectFit:"contain"}}),(0,Je.jsx)(ip,{style:{fontSize:"14px",fontWeight:600,textTransform:"uppercase",color:"#000000"},children:e.config?.displayName?.[0]||"H"})]}),(0,Je.jsxs)("div",{ref:s,style:{position:"relative"},children:[(0,Je.jsxs)("div",{role:"button",tabIndex:0,onMouseDown:u=>{u.preventDefault(),u.stopPropagation()},onClick:u=>{u.preventDefault(),u.stopPropagation(),r(!t)},onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),u.stopPropagation(),r(!t))},onMouseEnter:u=>{u.currentTarget.style.backgroundColor="rgba(229, 231, 235, 1)"},onMouseLeave:u=>{u.currentTarget.style.backgroundColor="rgba(243, 244, 246, 1)"},style:{display:"flex",alignItems:"center",gap:"8px",textAlign:"left",height:"32px",padding:"0 12px",borderRadius:"8px",cursor:"pointer",userSelect:"none",backgroundColor:"rgba(243, 244, 246, 1)",border:"1px solid rgba(229, 231, 235, 1)",transition:"background-color 0.15s ease"},children:[(0,Je.jsx)("span",{style:{fontSize:"14px",fontWeight:500,color:"#000000",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"160px"},children:e.config?.displayName||"Assistant"}),(0,Je.jsx)(er,{style:{width:"16px",height:"16px",color:"#6b7280",flexShrink:0,transition:"transform 0.2s ease",transform:t?"rotate(180deg)":"rotate(0deg)"},strokeWidth:2})]}),(0,Je.jsx)(ir,{children:t&&(0,Je.jsx)(AR,{initial:{opacity:0,y:-10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.95},transition:{duration:.15},children:({ref:u})=>{let d=a.length>0,f=o,p={position:"absolute",left:0,top:"100%",marginTop:"4px",width:"256px",backgroundColor:"#ffffff",border:"1px solid rgba(229, 231, 235, 1)",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1)",overflow:"hidden",zIndex:50};if(f)return(0,Je.jsx)("div",{ref:u,style:p,children:(0,Je.jsx)("div",{style:{padding:"16px",textAlign:"center"},children:(0,Je.jsx)("p",{style:{fontSize:"12px",color:"#6b7280"},children:"Cargando conversaciones..."})})});if(!d)return(0,Je.jsx)("div",{ref:u,style:p,children:(0,Je.jsx)("div",{style:{padding:"16px",textAlign:"center"},children:(0,Je.jsx)("p",{style:{fontSize:"12px",color:"#6b7280"},children:"No hay conversaciones previas"})})});let m=new Date,g=new Date(m.getFullYear(),m.getMonth(),m.getDate()),b=new Date(g);b.setDate(b.getDate()-1);let x=new Date(g);x.setDate(x.getDate()-7);let v={today:a.filter(I=>new Date(I.updatedAt)>=g),yesterday:a.filter(I=>{let A=new Date(I.updatedAt);return A>=b&&A<g}),thisWeek:a.filter(I=>{let A=new Date(I.updatedAt);return A>=x&&A<b}),older:a.filter(I=>new Date(I.updatedAt)<x)},y={padding:"8px 12px"},w={fontSize:"10px",fontWeight:600,textTransform:"uppercase",color:"#6b7280"},S={width:"100%",padding:"8px 12px",textAlign:"left",fontSize:"12px",backgroundColor:"transparent",border:"none",cursor:"pointer",transition:"background-color 0.15s ease"},k={color:"#111827",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",margin:0},T=I=>(0,Je.jsx)("button",{type:"button",onClick:A=>{A.preventDefault(),A.stopPropagation(),e.onLoadConversation?.(I.id),r(!1)},onMouseDown:A=>{A.preventDefault(),A.stopPropagation()},onMouseEnter:A=>{A.currentTarget.style.backgroundColor="rgba(243, 244, 246, 1)"},onMouseLeave:A=>{A.currentTarget.style.backgroundColor="transparent"},style:S,children:(0,Je.jsx)("p",{style:k,children:I.title||"Nueva conversaci\xF3n"})},I.id);return(0,Je.jsx)("div",{ref:u,style:p,children:(0,Je.jsxs)("div",{style:{maxHeight:"256px",overflowY:"auto"},children:[v.today.length>0&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("div",{style:y,children:(0,Je.jsx)("p",{style:w,children:"Hoy"})}),(0,Je.jsx)("div",{style:{padding:"4px 0"},children:v.today.map(T)})]}),v.yesterday.length>0&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("div",{style:y,children:(0,Je.jsx)("p",{style:w,children:"Ayer"})}),(0,Je.jsx)("div",{style:{padding:"4px 0"},children:v.yesterday.map(T)})]}),v.thisWeek.length>0&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("div",{style:y,children:(0,Je.jsx)("p",{style:w,children:"Esta semana"})}),(0,Je.jsx)("div",{style:{padding:"4px 0"},children:v.thisWeek.map(T)})]}),v.older.length>0&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("div",{style:y,children:(0,Je.jsx)("p",{style:w,children:"M\xE1s antiguas"})}),(0,Je.jsx)("div",{style:{padding:"4px 0"},children:v.older.map(T)})]})]})})}})})]})]}),(0,Je.jsx)("div",{className:"flex-1 min-w-0"}),(0,Je.jsxs)("div",{className:"flex flex-row items-center gap-1",children:[e.hasMessages&&(0,Je.jsx)(RR,{alwaysShow:!0}),e.handleClose&&(0,Je.jsx)("button",{type:"button",onClick:e.handleClose,className:"p-1.5 hover:bg-gray-100 dark:hover:bg-white/5 rounded-md text-gray-700 dark:text-gray-300 transition-colors flex items-center justify-center",title:"Minimizar",children:(0,Je.jsx)(Bh,{className:"h-3.5 w-3.5",strokeWidth:2.5})})]})]})}),(0,Je.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden relative",children:e.children})]})},KKe=({...e})=>{let t=e.interfaceConfig||YKe,r=e?.interfaceConfig?.iconUrl||e?.agentIconUrl||"/images/chatbubble-default-icon.png",a=(0,Wa.useRef)(null),[n,o]=(0,Wa.useState)(!1),[i,s]=kbe({isOpen:!!e.isOpen,hasOpenOnce:!1,showInitialMessage:!1,visitorEmail:"",showLeadFormAfterMessageId:""});(0,Wa.useEffect)(()=>{if(r){let p=new Image;p.onload=()=>o(!0),p.src=r}},[r]),(0,Wa.useEffect)(()=>{s({isOpen:!!e.isOpen})},[e.isOpen]);let l=(0,Wa.useMemo)(()=>(t.initialMessages||[]).map(m=>m?.trim?.()).filter(m=>!!m),[t?.initialMessages]);(0,Wa.useEffect)(()=>{let p=null;return l?.length>0&&!t?.isInitMessagePopupDisabled&&(p=setTimeout(()=>{s({showInitialMessage:!0})},5e3)),()=>{p&&clearTimeout(p)}},[l?.length,t?.isInitMessagePopupDisabled]);let u=(0,Wa.useCallback)(()=>{s({isOpen:!1})},[]),d=(0,Wa.useMemo)(()=>(0,Je.jsxs)($u,{className:"bg-transparent",style:{width:"48px",height:"48px",minWidth:"48px",minHeight:"48px",...t?.bubbleIconStyle},children:[(0,Je.jsx)(Hu,{src:r,style:{width:"48px",height:"48px",maxWidth:"48px",maxHeight:"48px"}}),(0,Je.jsx)(ip,{className:"text-sm font-semibold uppercase",children:t?.displayName?.[0]||"H"})]}),[r,t?.bubbleIconStyle,t?.displayName]),f=Wa.default.useMemo(()=>p=>(0,Je.jsx)(ZKe,{...p,handleClose:u,imageUrl:r,config:t,agentId:e.agentId,visitorId:e.visitorId,onLoadConversation:e.onLoadConversation}),[t,r,u,e.agentId,e.visitorId,e.onLoadConversation]);return e?.isLoadingAgent?null:(0,Je.jsxs)(Je.Fragment,{children:[l?.length>0&&i.showInitialMessage&&!i.hasOpenOnce&&(0,Je.jsxs)("div",{ref:a,className:co("horneross-init-messages fixed bottom-[72px] flex flex-col gap-2 max-w-[90%] sm:max-w-[500px]",t?.position==="left"?"left-4":"right-4"),style:{zIndex:9999999999-1},children:[(0,Je.jsx)(Rr,{variant:"outline",size:"sm",className:co("absolute z-[2] -top-2 p-1 min-w-0 h-auto rounded-full -translate-y-full","bg-white dark:bg-[#171717]","border-gray-300 dark:border-white/20","hover:bg-gray-100 dark:hover:bg-white/10","text-black dark:text-white",t?.position==="left"&&"right-0",t?.position==="right"&&"right-0"),onClick:()=>s({showInitialMessage:!1}),children:(0,Je.jsx)(ua,{className:"h-3 w-3"})}),(0,Je.jsx)(Sbe,{messages:l.map(p=>({iconUrl:r,from:"agent",message:p,approvals:[]}))})]}),(0,Je.jsx)(AR,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:i.isOpen?1:0,scale:i.isOpen?1:.95,y:i.isOpen?0:10},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2,ease:[.4,0,.2,1]},children:({ref:p})=>(0,Je.jsx)(c2,{ref:p,className:co("flex-col box-border p-0 gap-0 overflow-hidden","border border-gray-300 dark:border-white/20","bg-white dark:bg-[#171717]",i.isOpen?"flex":"hidden",!i.isOpen&&"pointer-events-none"),style:{zIndex:9999999999,position:"fixed",bottom:"72px",left:t?.position==="left"?"16px":"auto",right:t?.position==="left"?"auto":"16px",width:"380px",height:"560px",maxHeight:"560px",borderRadius:"16px"},children:(0,Je.jsx)("div",{className:"relative flex flex-col h-full w-full flex-1 p-0 overflow-hidden",children:(0,Je.jsx)(xbe,{...e,chatBoxProps:{...e.chatBoxProps,isOpen:i.isOpen},agentIconUrl:r,interfaceConfig:t,layout:f})})})}),(0,Je.jsx)("div",{className:"horneross-widget",style:{zIndex:9999999999,position:"fixed",bottom:"16px",left:t?.position==="left"?"16px":"auto",right:t?.position==="left"?"auto":"16px",height:"48px"},children:(0,Je.jsx)(AR,{initial:"visible",animate:"visible",variants:{visible:{y:0,opacity:1,scale:1,transition:{when:"beforeChildren",staggerChildren:.3}},hidden:{y:100,opacity:0,scale:.8,transition:{when:"afterChildren"}}},children:({ref:p})=>(0,Je.jsxs)(Rr,{ref:p,variant:"default",className:co("horneross-launcher relative flex shrink-0 p-0 overflow-hidden","transition-all duration-300 ease-out","hover:opacity-90","active:scale-95"),style:{backgroundColor:t?.primaryColor||"#000000",width:"48px",height:"48px",minWidth:"48px",minHeight:"48px",borderRadius:"9999px",...t?.bubbleButtonStyle},onClick:()=>s({isOpen:!i.isOpen,...i.isOpen?{}:{hasOpenOnce:!0}}),children:[(0,Je.jsx)("div",{style:{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",opacity:i.isOpen?1:0,transform:i.isOpen?"rotate(0deg)":"rotate(-180deg)",transition:"opacity 0.3s ease, transform 0.3s ease",pointerEvents:i.isOpen?"auto":"none"},children:(0,Je.jsx)(Bh,{style:{width:"20px",height:"20px"}})}),(0,Je.jsx)("div",{style:{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",opacity:i.isOpen?0:1,transform:i.isOpen?"rotate(180deg)":"rotate(0deg)",transition:"opacity 0.3s ease, transform 0.3s ease",pointerEvents:i.isOpen?"none":"auto"},children:d})]})})})]})},Ebe=KKe;c();var im=E(W()),e1e=E(Qwe());c();var Od=E(q()),CQe={"phone-number":"phoneNumber","user-id":"userId","first-name":"firstName","last-name":"lastName",email:"email","visitor-id":"visitorId"},kQe="https://cdn.jsdelivr.net/npm/@horneross/embeds@latest",TQe=({children:e,container:t})=>((0,im.useEffect)(()=>{let r=()=>{document.documentElement.classList.contains("dark")?t.classList.add("dark"):t.classList.remove("dark")};r();let a=new MutationObserver(r);return a.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>a.disconnect()},[t]),(0,Od.jsx)(Od.Fragment,{children:e})),EQe=({name:e,widget:t,type:r})=>class extends HTMLElement{cssProvider=kQe+`/dist/${r}/index.css`;root;shadowRootElement;instanceId;setIsOpen;isOpen;onEnd;destroy(){this.innerHTML="",this.instanceId&&(window[this.instanceId]=null)}constructor(n){super(),this.instanceId=n?.instanceId,this.onEnd=n?.onEnd;let o=this.attachShadow({mode:"open"}),i=document.createElement("link");i.setAttribute("rel","preconnect"),i.setAttribute("href","https://fonts.googleapis.com");let s=document.createElement("link");s.setAttribute("rel","preconnect"),s.setAttribute("href","https://fonts.gstatic.com"),s.setAttribute("crossorigin","");let l=document.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("href","https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght@8..144,100..1000&display=swap");let u=document.createElement("link");u.setAttribute("rel","stylesheet"),u.setAttribute("type","text/css"),u.setAttribute("href",this.cssProvider),this.shadowRootElement=document.createElement("div"),this.shadowRootElement.className="light",o.appendChild(i),o.appendChild(s),o.appendChild(l),o.appendChild(u),o.appendChild(this.shadowRootElement),this.root=(0,e1e.createRoot)(this.shadowRootElement)}open(){this.setIsOpen?.(!0)}close(){this.setIsOpen?.(!1)}toggle(){this.setIsOpen?.(!this.isOpen)}createNewConversation(){this.dispatchEvent(new Event("CREATE_NEW_CONVERSATION",{bubbles:!0,composed:!0}))}updateConfig(n){n&&this.setAttribute("interface",JSON.stringify(n)),this.root.render((0,Od.jsx)(this.Component,{isOpen:this.isOpen,onEnd:this.onEnd}))}Component=n=>{let[o,i]=(0,im.useState)(!1);this.setIsOpen=i,this.isOpen=o;let s=Object.entries(CQe).reduce((f,[p,m])=>{let g=this.getAttribute(p);return g&&p!=="visitor-id"&&(f[m]=g),f},{}),l=this.getAttribute("visitor-id")||void 0,u=this.getAttribute("context"),d={};try{d=JSON.parse(this.getAttribute("interface"))}catch{}return(0,Od.jsx)(im.StrictMode,{children:(0,Od.jsx)(TQe,{container:this.shadowRootElement,children:(0,Od.jsx)("div",{className:"bg-transparent",children:im.default.createElement(t,{...n,isOpen:o,onEnd:this.onEnd,initConfig:d,context:u,agentId:this.getAttribute("agent-id")||"",formId:this.getAttribute("form-id")||"",contact:s,visitorId:l,styles:this.getAttribute("styles")?JSON.parse(this.getAttribute("styles")):{},onAgentLoaded:f=>{let p=f?.interfaceConfig?.customCSS;if(p){let m=document.createElement("style");m.innerHTML=p,this.shadowRootElement.appendChild(m)}}})})})})};connectedCallback(){this.root.render((0,Od.jsx)(this.Component,{isOpen:this.isOpen,onEnd:this.onEnd}))}},oN=EQe;var n1e=E(q()),t1e="horneross-chatbox-bubble",r1e=oN({type:"chatbox",widget:e=>(0,n1e.jsx)(_R,{...e,className:co("horneross-widget",e.className),children:Ebe}),name:t1e});customElements.define(t1e,r1e);var a1e=r1e;var IQe=async e=>{if(typeof window<"u"&&!window?.ChatboxBubble){let t=document?.currentScript?.src,r=document?.currentScript?.id,a=e.agentId||r;!a&&t&&(a=new URL(t).searchParams.get("agentId")||r||e.agentId),OC(e);let n=new a1e({instanceId:"ChatBoxBubble"});FC({element:n,...e}),window.ChatboxBubble=n,document?.body?.prepend(n)}return window?.ChatboxBubble},o1e=IQe;c();c();c();var hl=E(q()),_Qe="https://app.horneross.com/images/chatbubble-default-horneross.svg",AQe=e=>{let{query:t}=$y({id:e.agentId});return(0,hl.jsxs)("div",{className:co("relative w-full h-full flex flex-col",e.className),children:[(0,hl.jsx)("div",{className:"flex-shrink-0 px-2 pt-2 pb-2",children:(0,hl.jsxs)("div",{className:"px-2 py-1 flex items-center border border-gray-700 max-w-[700px] mx-auto bg-[#161618] rounded-lg",children:[(0,hl.jsx)("div",{className:"w-8 h-8 mr-2 rounded-full border border-gray-600 flex items-center justify-center overflow-hidden",children:t?.data?.iconUrl?(0,hl.jsx)("img",{src:t?.data?.iconUrl||_Qe,alt:"Agent",className:"w-full h-full object-cover"}):(0,hl.jsx)(lc,{className:"w-4 h-4 text-gray-400"})}),(0,hl.jsx)("h3",{className:"text-white font-medium text-lg font-['Bricolage_Grotesque']",children:e?.config?.displayName||t?.data?.name}),(0,hl.jsx)("div",{className:"ml-auto flex items-center",children:(0,hl.jsx)(RR,{variant:"plain"})})]})}),(0,hl.jsx)("div",{className:"flex-1 flex flex-col min-h-0",children:e.children})]})},i1e=AQe;var s1e=E(q()),hh="horneross-chatbox-standard",RQe=oN({type:"chatbox",widget:e=>(0,s1e.jsx)(_R,{layout:i1e,...e,className:co("horneross-widget",e.className)}),name:hh}),TH=RQe;var PQe=e=>{customElements.get(hh)||customElements.define(hh,TH),OC(e);let t="ChatBoxStandard_"+(e.id||""),r=new TH({instanceId:t}),a=e.id?document.querySelector(`${hh}[id="${e.id}"]`):document.querySelector(hh);if(!a)throw new Error(`<${hh}> element${`${e.id?` with ID ${e.id}`:""}`} not found.`);if(!window[t]){let n={...e.styles,...Array.from(a.style).reduce((o,i)=>(o[i]=a?.style.getPropertyValue(i),o),{})};FC({element:r,...e,styles:n}),window[t]=r,a.replaceWith(r)}return window[t]},l1e=PQe;var NQe={initBubble:o1e,initStandard:l1e},XAr=NQe;export{XAr as default};
383
383
  /*! Bundled license information:
384
384
 
385
385
  react/cjs/react.production.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@horneross/embeds",
3
- "version": "1.0.257",
3
+ "version": "1.0.258",
4
4
  "description": "hornerossEmbeds",
5
5
  "main": "dist/chatbox/index.js",
6
6
  "scripts": {