tybotflow-widget 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +3 -3
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -66304,7 +66304,7 @@ Options:
|
|
|
66304
66304
|
transition: "all 0.2s ease"
|
|
66305
66305
|
},
|
|
66306
66306
|
children: [
|
|
66307
|
-
g?.bot?.botId
|
|
66307
|
+
["easyspace2", "tessttt"].includes(g?.bot?.botId) && p.sender !== "user" ? /* @__PURE__ */ u.jsx(
|
|
66308
66308
|
"div",
|
|
66309
66309
|
{
|
|
66310
66310
|
className: "sm:size-9 size-7 rounded-full flex items-center justify-center flex-shrink-0 relative overflow-hidden",
|
|
@@ -67117,7 +67117,7 @@ Options:
|
|
|
67117
67117
|
]
|
|
67118
67118
|
}
|
|
67119
67119
|
),
|
|
67120
|
-
["easyspace2", "clinique", "arts-clinique", "fizzy"].includes(g.bot?.botId) ? (
|
|
67120
|
+
["easyspace2", "clinique", "arts-clinique", "fizzy", "tessttt"].includes(g.bot?.botId) ? (
|
|
67121
67121
|
// Special button for easyspace2 bot with Rihab image - Fixed bottom right position
|
|
67122
67122
|
/* @__PURE__ */ u.jsxs(
|
|
67123
67123
|
"div",
|
|
@@ -67157,7 +67157,7 @@ Options:
|
|
|
67157
67157
|
/* @__PURE__ */ u.jsx(
|
|
67158
67158
|
"img",
|
|
67159
67159
|
{
|
|
67160
|
-
src: ["clinique", "arts-clinique"].includes(g.bot?.botId) ? DcA : g.bot?.botId
|
|
67160
|
+
src: ["clinique", "arts-clinique"].includes(g.bot?.botId) ? DcA : ["easyspace2", "tessttt"].includes(g.bot?.botId) ? ecA : g.bot?.botId === "fizzy" ? acA : "",
|
|
67161
67161
|
alt: "Rihab",
|
|
67162
67162
|
className: "w-auto h-[250px] sm:h-[400px] object-contain"
|
|
67163
67163
|
}
|
package/dist/index.umd.js
CHANGED
|
@@ -707,7 +707,7 @@ Options:
|
|
|
707
707
|
box-shadow: 0 0 30px ${s};
|
|
708
708
|
}
|
|
709
709
|
}
|
|
710
|
-
`}),u.jsxs("div",{className:"fixed top-0 right-0 h-full shadow-2xl !z-[100000000]",style:{width:TA+"px",transition:"transform 0.3s cubic-bezier(0.4,0,0.2,1)",transform:kA?"translateX(0)":`translateX(${TA}px)`,background:jw},onDrop:hi,onDragOver:xw,onDragEnter:_C,onDragLeave:TQ,children:[u.jsx("div",{onMouseDown:Mg,className:"absolute left-0 top-0 h-full w-2 cursor-ew-resize z-50 bg-transparent opacity-50 transition-colors",style:{userSelect:"none"},onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent"}),$g&&u.jsx("div",{className:"absolute inset-0 bg-opacity-20 border-2 border-dashed flex items-center justify-center !z-[9999999]",style:{borderColor:s},children:u.jsxs("div",{className:"text-center ",style:{color:l},children:[u.jsx(_s,{className:"w-12 h-12 mx-auto mb-2"}),u.jsx("p",{className:"text-lg font-semibold",children:"Drop files here"})]})}),u.jsx("div",{className:"text-center py-[1px] flex flex-col items-center justify-center gap-1 backdrop-blur-sm",style:{background:s},children:u.jsxs("p",{className:"text-[11px]",style:{color:l},children:["© Powered by"," ",u.jsx("a",{href:"https://tybot.ma",target:"_blank",rel:"noopener noreferrer",className:"underline font-semibold hover:opacity-80 transition-opacity ",style:{color:l},children:"Tybot"})]})}),lE?u.jsxs("div",{className:"flex items-center justify-between px-4 py-1 sm:py-2 border-b",style:{background:zo,borderColor:U},children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"sm:size-12 size-8 flex items-center justify-center overflow-hidden rounded-full",children:u.jsx("img",{src:LB,alt:`${$B} Logo`,className:"w-full h-full"})}),u.jsx("h2",{className:"sm:text-lg text-md font-semibold",style:{color:l},children:$B})]}),u.jsxs("div",{className:"flex justify-between items-center gap-2 ml-2",children:[u.jsx("button",{className:"transition-colors p-1 rounded-full",style:{color:l},title:"Reset chat","aria-label":"Reset chat",onClick:()=>uE(!0),onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent",children:u.jsx(qBA,{className:"w-5 h-5"})}),u.jsx("button",{onClick:()=>lg(!0),className:"transition-colors p-1 rounded-full",style:{color:l},title:"Bot info","aria-label":"Bot info",onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent",children:u.jsx(dBA,{className:"w-5 h-5"})}),u.jsx("button",{onClick:()=>{Cg(!1),ZI.current=!1},className:"transition-colors p-1 rounded-full",style:{color:l},title:"Close Chat","aria-label":"Close Chat",onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent",children:u.jsx(Dw,{className:"w-5 h-5"})})]})]}):u.jsx("div",{className:"flex items-center justify-end px-6 py-3",children:u.jsx("div",{className:"flex items-center",children:u.jsx("button",{onClick:()=>{Cg(!1),ZI.current=!1},className:"transition-colors p-1 rounded-full",style:{color:g?.inputTextColor||"#FFF"},title:"Close Chat","aria-label":"Close Chat",onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent",children:u.jsx(Dw,{className:"w-5 h-5"})})})}),lE&&u.jsxs("div",{ref:A,className:"flex-1 px-2 sm:px-4 py-3 overflow-y-auto space-y-4 scroll-smooth",style:{height:"calc(100% - 160px)",scrollbarWidth:"thin",scrollbarColor:`${s} transparent`,fontSize:wA},children:[eI.map((p,LA)=>u.jsx("div",{className:"flex flex-col w-full gap-2",children:u.jsxs("div",{className:`flex ${p.sender==="agent"?"flex-col sm:flex-row":""} items-start gap-3 ${p.sender==="user"?"flex-row-reverse":""} ${DB&&BI.has(p.id)?"p-2 rounded-lg":""}`,style:{background:DB&&BI.has(p.id)?`${s}20`:"transparent",border:DB&&BI.has(p.id)?`2px solid ${s}`:"none",transition:"all 0.2s ease"},children:[g?.bot?.botId==="easyspace2"&&p.sender!=="user"?u.jsx("div",{className:"sm:size-9 size-7 rounded-full flex items-center justify-center flex-shrink-0 relative overflow-hidden",style:{background:EA},onClick:()=>DB&&PQ(p.id),children:u.jsx("img",{src:BhA,className:"w-full h-full object-cover"})}):u.jsx("div",{className:"sm:size-8 size-7 rounded-full flex items-center justify-center flex-shrink-0 relative cursor-pointer",style:{background:p.sender==="user"?AA:EA},onClick:()=>DB&&PQ(p.id),children:DB?u.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-full",style:{background:"rgba(0,0,0,0.6)"},children:u.jsx("input",{type:"checkbox",checked:BI.has(p.id),onChange:()=>PQ(p.id),className:"w-4 h-4 cursor-pointer",style:{accentColor:s},onClick:RA=>RA.stopPropagation()})}):u.jsx(u.Fragment,{children:p.sender==="user"?u.jsx(Fo,{className:"sm:size-4 size-3",style:{color:V}}):u.jsx(Dj,{className:"sm:size-4 size-3",style:{color:$}})})}),u.jsxs("div",{className:`flex flex-col flex-1 ${p.sender==="user"?"items-end":"items-start"}`,children:[p.attachments&&p.attachments.length>0&&u.jsx("div",{className:"flex flex-col items-end w-[88%] mb-2 space-y-2",children:p.attachments.map(RA=>u.jsx(UsA,{attachment:RA,formatFileSize:Vo,mainColor:s,secondaryColor:a,controlsColor:l},RA.id))}),p.content&&p.sender==="user"?u.jsx("div",{className:"px-4 py-2 backdrop-blur-sm break-words w-fit",style:{wordBreak:"break-word",overflowWrap:"break-word",borderRadius:`${m}px`,maxWidth:`${y}%`,background:N,color:oA},children:u.jsx(ww,{remarkPlugins:[ew],components:DE,children:Gw(typeof p.content=="string"?p.content:"")})}):typeof p.content=="object"?p.content.map((RA,lA)=>RA.type==="image"?u.jsx("div",{className:"mb-1 w-72",children:_i(RA)},lA):RA.type==="video"?u.jsx("div",{className:"mb-1 w-72",children:_i(RA)},lA):u.jsx("div",{className:"mb-1 px-4 py-2 backdrop-blur-sm break-words w-fit",style:{wordBreak:"break-word",overflowWrap:"break-word",borderRadius:`${m}px`,width:`${y}%`,background:f,color:X},children:_i(RA)},lA)):typeof p.content=="string"&&p.content?u.jsx("div",{className:"mb-1 px-4 py-2 backdrop-blur-sm break-words w-fit",style:{wordBreak:"break-word",overflowWrap:"break-word",borderRadius:`${m}px`,maxWidth:`${y}%`,background:f,color:X},children:u.jsx(ww,{remarkPlugins:[ew],components:DE,children:Gw(p.content)})}):null,u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"ml-1 text-[10px] sm:text-xs mt-1",style:{color:l},children:p?.timestamp?.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),u.jsx("button",{className:"ml-2 p-1 rounded-full hover:bg-opacity-10 transition-all duration-200",style:{color:bB===p.id?"#10b981":l},title:bB===p.id?"Copied!":"Copy message","aria-label":"Copy message",onClick:()=>uQ((typeof p.content=="string",p.content),p.id),onMouseEnter:RA=>RA.currentTarget.style.background=s,onMouseLeave:RA=>RA.currentTarget.style.background="transparent",children:bB===p.id?u.jsxs("span",{className:"flex gap-1 items-center",children:[u.jsx(tQ,{size:14})," Copied"]}):u.jsxs("span",{className:"flex gap-1 items-center",children:[u.jsx(mBA,{size:14})," Copier"]})}),!DB&&u.jsx("button",{className:"p-1 rounded-full hover:bg-opacity-10 transition-all duration-200",style:{color:l},title:"Share messages","aria-label":"Share messages",onClick:SQ,onMouseEnter:RA=>RA.currentTarget.style.background=s,onMouseLeave:RA=>RA.currentTarget.style.background="transparent",children:u.jsxs("span",{className:"flex gap-1 items-center",children:[u.jsx(Rj,{size:14})," Partager"]})}),p.sender==="agent"&&p.timingMetrics&&u.jsxs("div",{style:{position:"relative"},children:[u.jsx("button",{className:"p-1 rounded-full hover:bg-opacity-10 transition-all duration-200",style:{color:CI===p.id?"#a78bfa":l,transition:"color 0.2s ease"},title:"Process stats","aria-label":"Process stats",onClick:RA=>{if(CI!==p.id){const lA=RA.currentTarget.getBoundingClientRect();zI(lA.top<260?"down":"up")}AE(lA=>lA===p.id?null:p.id)},onMouseEnter:RA=>RA.currentTarget.style.background=s,onMouseLeave:RA=>RA.currentTarget.style.background="transparent",children:u.jsx("span",{className:"flex gap-1 items-center",children:u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10"}),u.jsx("polyline",{points:"12 6 12 12 16 14"})]})})}),CI===p.id&&BQ(p.timingMetrics)]})]})]})]})},p.id)),Rg&&u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("div",{className:"sm:size-8 size-7 rounded-full bg-gradient-to-r flex items-center justify-center",style:{background:EA},children:u.jsx(Dj,{className:"sm:size-4 size-3",style:{color:$}})}),u.jsx("div",{className:"px-4 py-2",style:{background:f,color:X,borderRadius:`${m}px`},children:u.jsxs("div",{className:"flex space-x-1",children:[u.jsx("div",{className:"size-1 sm:size-2 rounded-full animate-bounce",style:{background:X}}),u.jsx("div",{className:"size-1 sm:size-2 rounded-full animate-bounce",style:{background:X,animationDelay:"0.1s"}}),u.jsx("div",{className:"size-1 sm:size-2 rounded-full animate-bounce",style:{background:X,animationDelay:"0.2s"}})]})})]})]}),!lE&&u.jsxs("div",{className:"w-full h-full flex flex-col mt-20 items-center p-4 gap-4",children:[u.jsx("h4",{className:"text-sm font-bold mb-2",style:{color:l},children:"Veuillez fournir vos informations pour commencer à discuter"}),u.jsxs("form",{onSubmit:$C,className:"w-full max-w-xs flex flex-col gap-4 p-6 rounded-2xl shadow-lg",style:{background:s},children:[Q?.formFields.includes("full_name")&&u.jsx("input",{type:"text",placeholder:"Nom et prénom",value:eE,onChange:p=>zQ(p.target.value),className:"py-3 px-4 rounded-lg outline-none transition-all duration-200",style:{borderRadius:"14px",backgroundColor:l,color:R,borderColor:a}},"full_name"),Q?.formFields.includes("phone_number")&&u.jsx("input",{type:"text",placeholder:"Téléphone",value:ZQ,onChange:p=>qo(p.target.value),className:"py-3 px-4 rounded-lg outline-none transition-all duration-200",style:{borderRadius:"14px",backgroundColor:l,color:R,borderColor:a}},"phone_number"),Q?.formFields.includes("email")&&u.jsx("input",{type:"email",placeholder:"Email",value:vi,onChange:p=>ZB(p.target.value),className:"py-3 px-4 rounded-lg outline-none transition-all duration-200",style:{borderRadius:"14px",backgroundColor:l,color:R,borderColor:a}},"email"),u.jsx("button",{type:"submit",className:"py-3 rounded-lg font-bold uppercase outline-none shadow-lg transition-all duration-200",style:{background:`linear-gradient(90deg, ${s}, ${a})`,letterSpacing:"2px",borderRadius:"14px",color:l},children:"Submit"})]})]}),lE&&u.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-4 pt-0 pb-3",style:{background:`linear-gradient(to top, ${G}, transparent)`},children:DB?u.jsxs("div",{className:"flex items-center justify-between gap-3 p-4 rounded-lg",style:{background:R},children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("button",{onClick:SQ,className:"px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2",style:{background:"transparent",color:l,border:`1px solid ${l}`},onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent",children:[u.jsx(Dw,{size:16}),"Annuler"]}),u.jsxs("span",{className:"text-sm",style:{color:l},children:[BI.size," message",BI.size!==1?"s":""," sélectionné",BI.size!==1?"s":""]})]}),u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("button",{onClick:WE,className:"px-4 py-2 rounded-lg font-medium transition-all duration-200",style:{background:a,color:l},onMouseEnter:p=>p.currentTarget.style.opacity="0.9",onMouseLeave:p=>p.currentTarget.style.opacity="1",children:"Tout sélectionner"}),u.jsxs("button",{onClick:gQ,disabled:BI.size===0,className:"px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",style:{background:s,color:l},onMouseEnter:p=>!p.currentTarget.disabled&&(p.currentTarget.style.opacity="0.9"),onMouseLeave:p=>p.currentTarget.style.opacity="1",children:[u.jsx(kBA,{size:16}),"Générer PDF"]})]})]}):u.jsxs(u.Fragment,{children:[Ng.length>0&&u.jsx("div",{className:"flex flex-wrap gap-2 mb-3 p-3 bg-opacity-70 rounded-lg",style:{background:R},children:Ng.map(p=>u.jsx(lsA,{attachment:p,onRemove:()=>ti(p.id)},p.id))}),Q?.advisorCall?.enabled&&Ng.length===0&&!D&&u.jsxs("div",{className:"flex flex-col items-center mb-4",children:[u.jsxs("div",{className:"relative flex items-center w-fit px-4 py-2 rounded-full",style:{background:"rgba(0,0,0,0.45)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:[u.jsx("button",{type:"button",onClick:()=>t(!0),className:"absolute -top-1 -right-1 flex items-center justify-center w-5 h-5 rounded-full transition-all duration-200 hover:bg-white/30 active:scale-90 z-10",style:{background:"rgba(0,0,0,0.45)",color:"rgba(255,255,255,0.8)"},title:"Dismiss","aria-label":"Dismiss advisor call",children:u.jsx(Dw,{className:"w-3 h-3"})}),u.jsxs("button",{type:"button",onClick:Ao,className:"flex items-center gap-2 px-5 py-2 rounded-full text-xs shadow-lg transition-all duration-200 hover:brightness-110 active:scale-95",style:{background:v,color:J},children:[u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:u.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"})}),Q?.advisorCall?.message]})]}),u.jsx("div",{style:{width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent",borderTop:"5px solid rgba(0,0,0,0.45)"}})]}),u.jsxs("div",{className:"flex items-center w-full gap-2 relative",children:[u.jsx("div",{className:"flex-1 relative",children:u.jsxs(u.Fragment,{children:[$A!=="recording"&&$A!=="paused"?u.jsxs(u.Fragment,{children:[u.jsx("button",{id:"upload-button-toggle",type:"button",onClick:()=>{Vg||Rg||UB(p=>!p)},className:"absolute left-1 bottom-[10px] sm:bottom-3 size-8 sm:size-9 rounded-full flex items-center justify-center transition-all duration-200 z-10 hover:bg-opacity-10",style:{color:l},onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="",children:u.jsx(Rt,{className:`size-4 sm:size-5 transition-transform duration-200 ${Wg?"rotate-45":""}`})}),u.jsx("button",{type:"button",onClick:()=>{Vg||Rg||QI()},className:"absolute right-1 bottom-[10px] sm:bottom-3 size-8 sm:size-9 rounded-full flex items-center justify-center transition-all duration-200 z-10",style:{color:l},onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="",children:u.jsx(jBA,{className:"size-4 sm:size-5"})})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:()=>{qI.current=!0,iC()},className:"absolute left-1 bottom-3 w-9 h-9 hover:bg-red-100 hover:bg-opacity-50 rounded-full flex items-center justify-center text-red-500 hover:text-red-600 z-10 after:w-2 after:h-2 after:bg-red-500 after:absolute after:rounded-full after:top-1/2 after:-right-3 after:-translate-y-1/2 after:animate-bounce",children:u.jsx(WBA,{className:"w-5 h-5"})}),u.jsx("button",{type:"button",onClick:()=>{CC?(eB(!1),GA()):(eB(!0),xg())},className:"absolute right-11 bottom-3 w-9 h-9 rounded-full flex items-center justify-center transition-all duration-200 z-10",style:{color:l},children:CC?u.jsx(OBA,{className:"w-7 h-7"}):u.jsx(SBA,{className:"w-7 h-7"})}),u.jsxs("div",{className:"absolute left-16 bottom-4 flex items-center gap-4 z-10 ",style:{color:l},children:[u.jsx("p",{children:YC}),u.jsx("p",{className:`${$A==="recording"?"animate-pulse":""}`,children:$A==="recording"?"Recording...":$A==="paused"?"Paused":"Starting..."})]}),u.jsx("button",{type:"button",onClick:()=>{iC()},className:"absolute right-1 bottom-3 w-9 h-9 rounded-full flex items-center justify-center transition-all duration-200 z-10",style:{color:l,background:"green"},children:u.jsx(tQ,{className:"w-5 h-5"})})]}),Wg&&u.jsxs("div",{className:"absolute bottom-12 left-0 rounded-lg shadow-xl border border-gray-700 py-2 min-w-48 z-10",style:{background:Z},children:[u.jsxs("button",{id:"document-button",onClick:()=>ai("document"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:T},onMouseEnter:p=>p.currentTarget.style.background=W,onMouseLeave:p=>p.currentTarget.style.background="",children:[u.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-full flex items-center justify-center",children:u.jsx(QM,{className:"w-4 h-4 text-white"})}),u.jsx("span",{children:"Document"})]}),u.jsxs("button",{id:"image-button",onClick:()=>ai("image"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:T},onMouseEnter:p=>p.currentTarget.style.background=W,onMouseLeave:p=>p.currentTarget.style.background="",children:[u.jsx("div",{className:"w-8 h-8 bg-green-600 rounded-full flex items-center justify-center",children:u.jsx(xBA,{className:"w-4 h-4 text-white"})}),u.jsx("span",{children:"Photos"})]}),u.jsxs("button",{id:"video-button",onClick:()=>ai("video"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:T},onMouseEnter:p=>p.currentTarget.style.background=W,onMouseLeave:p=>p.currentTarget.style.background="",children:[u.jsx("div",{className:"w-8 h-8 bg-red-600 rounded-full flex items-center justify-center",children:u.jsx(nj,{className:"w-4 h-4 text-white"})}),u.jsx("span",{children:"Videos"})]}),u.jsxs("button",{id:"audio-button",onClick:()=>ai("audio"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:T},onMouseEnter:p=>p.currentTarget.style.background=W,onMouseLeave:p=>p.currentTarget.style.background="",children:[u.jsx("div",{className:"w-8 h-8 bg-purple-600 rounded-full flex items-center justify-center",children:u.jsx(ZR,{className:"w-4 h-4 text-white"})}),u.jsx("span",{children:"Audio"})]})]}),u.jsx("textarea",{id:"message-input",ref:nQ,className:`disabled:opacity-50 w-full pt-3 text-xs sm:text-sm sm:pt-4 px-12 resize-none min-h-10 sm:min-h-12 max-h-32 overflow-y-auto focus:outline-none backdrop-blur-sm ${$A==="recording"||$A==="paused"?"cursor-default":""}`,value:$A==="recording"||$A==="paused"?"":qg,onChange:p=>jg(p.target.value),placeholder:$A==="recording"||$A==="paused"?"":"Type your message...",rows:1,onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),xB())},style:{borderRadius:`${K}px`,background:R,color:l,scrollbarWidth:"thin",scrollbarColor:`${s} transparent`},readOnly:$A==="recording"||$A==="paused",disabled:Rg||Vg})]})}),(qg.trim()||Ng.length!==0)&&u.jsx("div",{className:"w-min",children:u.jsx("button",{onClick:()=>xB(),className:"w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200 transform hover:scale-105",style:{background:s,color:l},children:u.jsx(rj,{className:"w-5 h-5"})})})]}),u.jsx("input",{ref:B,type:"file",multiple:!0,className:"hidden",accept:"image/*",onChange:p=>p.target.files&&FQ(p.target.files,B)}),u.jsx("input",{ref:I,type:"file",multiple:!0,className:"hidden",accept:"video/*",onChange:p=>p.target.files&&FQ(p.target.files,I)}),u.jsx("input",{ref:E,type:"file",multiple:!0,className:"hidden",accept:"audio/*",onChange:p=>p.target.files&&FQ(p.target.files,E)}),u.jsx("input",{ref:C,type:"file",multiple:!0,className:"hidden",accept:".pdf,.doc,.docx,.txt,.csv,.xlsx,.ppt,.pptx,.zip,.rar",onChange:p=>p.target.files&&FQ(p.target.files,C)})]})}),Bg&&u.jsx("div",{className:"fixed inset-0 z-[998] flex items-center justify-center",style:{background:"rgba(0,0,0,0.45)",backdropFilter:"blur(4px)"},onClick:()=>lg(!1),children:u.jsxs("div",{className:"relative w-full max-w-md mx-4 p-6 rounded-2xl shadow-2xl border overflow-hidden animate-[fadeIn_0.25s_ease]",style:{background:`linear-gradient(145deg, ${G}, ${s}, ${a})`,borderRadius:`${K}px`,borderColor:s},onClick:p=>p.stopPropagation(),children:[u.jsx("button",{onClick:()=>lg(!1),className:"absolute top-3 right-3 p-1 rounded-full transition-colors","aria-label":"Close bot info",style:{color:l},onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent",children:u.jsx(Dw,{className:"w-5 h-5"})}),g?.bot?u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("div",{className:"w-16 h-16 rounded-full p-1 flex items-center justify-center shadow-md overflow-hidden",style:{background:`linear-gradient(to bottom right, ${s}, ${a})`,borderRadius:"1.5rem"},children:u.jsx("img",{src:LB,alt:`${$B} logo`||"Bot avatar",className:"w-full h-full rounded-full",style:{borderRadius:"1.5rem"}})}),u.jsx("div",{className:"min-w-0",children:u.jsx("h3",{className:"text-lg font-semibold truncate",title:$B,style:{color:l},children:$B})})]}),Q?.description&&u.jsx("div",{className:"max-h-40 overflow-y-auto pr-1 custom-scrollbar",children:u.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-line",style:{wordBreak:"break-word",color:l},children:Q.description})}),u.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",style:{color:l},children:[Array.isArray(Q?.phone_numbers)&&Q.phone_numbers.length>0&&u.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.jsxs("span",{className:"uppercase tracking-wide font-bold",style:{color:l},children:["Phone number",Q.phone_numbers.length>1?"s":""]}),u.jsx("div",{className:"flex flex-col gap-1 flex-wrap",children:Q.phone_numbers.map((p,LA)=>u.jsx("a",{href:`tel:${p}`,className:"font-medium break-all",style:{color:l},children:p},LA))})]}),Array.isArray(Q?.websites)&&Q.websites.length>0&&u.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.jsxs("span",{className:"uppercase tracking-wide font-bold",style:{color:l},children:["Website",Q.websites.length>1?"s":""]}),u.jsx("div",{className:"flex flex-col gap-1 flex-wrap",children:Q.websites.map((p,LA)=>u.jsx("a",{className:"break-all underline font-semibold",href:p,target:"_blank",rel:"noopener noreferrer",children:p},LA))})]}),Array.isArray(Q?.emails)&&Q.emails.length>0&&u.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.jsxs("span",{className:"uppercase tracking-wide font-bold",style:{color:l},children:["Email",Q.emails.length>1?"s":""]}),u.jsx("div",{className:"flex flex-col gap-1",children:Q.emails.map((p,LA)=>u.jsx("a",{href:`mailto:${p}`,className:"font-medium break-all",style:{color:l},children:p},LA))})]}),Array.isArray(Q?.channels)&&Q?.channels.length>0&&u.jsxs("div",{className:"flex flex-col gap-2 mt-3",children:[u.jsx("span",{className:"uppercase tracking-wide font-bold text-xs",style:{color:l},children:"Connect with us"}),u.jsx("div",{className:"flex items-center gap-3 flex-wrap",children:Q?.channels.map((p,LA)=>{const RA=p.channel_name?.toLowerCase()||"",{icon:lA,color:cg,hoverColor:OA}=si(RA);return u.jsx("a",{href:p.link,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center p-2.5 rounded-2xl transition-all duration-200 hover:scale-105 shadow-md",style:{background:cg,color:"#FFFFFF"},title:p.channel_name,onMouseEnter:Xg=>Xg.currentTarget.style.background=OA,onMouseLeave:Xg=>Xg.currentTarget.style.background=cg,children:lA},LA)})})]})]})]}):u.jsxs("div",{className:"text-center",style:{color:l},children:[u.jsx("p",{className:"text-sm",children:"No bot selected."}),u.jsx("button",{type:"button",onClick:()=>lg(!1),className:"mt-4 px-4 py-2 rounded-lg text-sm font-medium bg-white/10 hover:bg-white/20 text-black transition-colors",style:{borderRadius:`${K}px`},children:"Close"})]})]})}),AQ&&u.jsx("div",{className:"fixed inset-0 z-[998] flex items-center justify-center",style:{background:"rgba(0,0,0,0.45)",backdropFilter:"blur(4px)"},onClick:()=>uE(!1),children:u.jsxs("div",{className:"relative w-full max-w-md mx-4 p-6 rounded-2xl shadow-2xl border overflow-hidden animate-[fadeIn_0.25s_ease]",style:{background:`linear-gradient(145deg, ${G}, ${s}, ${a})`,borderRadius:`${K}px`,borderColor:s},onClick:p=>p.stopPropagation(),children:[u.jsx("button",{onClick:()=>uE(!1),className:"absolute top-3 right-3 p-1 rounded-full transition-colors","aria-label":"Close reset chat",style:{color:l},onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent",children:u.jsx(Dw,{className:"w-5 h-5"})}),u.jsx("h3",{className:"text-lg font-semibold mb-2 ",style:{color:l},children:"Reset Chat?"}),u.jsx("p",{className:"mb-4",style:{color:l},children:"Are you sure you want to reset the chat? This will clear all messages."}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx("button",{className:"px-4 py-2 rounded bg-white/80 text-gray-900 hover:bg-white",onClick:()=>uE(!1),children:"Cancel"}),u.jsx("button",{className:"px-4 py-2 rounded bg-red-600 text-white hover:bg-red-700",onClick:async()=>{uE(!1),await lQ()},children:"Confirm"})]})]})})]}),["easyspace2","clinique","arts-clinique","fizzy"].includes(g.bot?.botId)?u.jsxs("div",{className:`${kA?"hidden":"fixed"} select-none bottom-2 right-1 sm:right-10`,style:{zIndex:999,animation:kA?"none":"smoothFloat 3s ease-in-out infinite"},children:[!kA&&u.jsxs("div",{className:"absolute top-[70px] -left-10 sm:top-40 sm:-left-10 -translate-x-1/2 bg-white rounded-lg shadow-lg p-3 min-w-[100px] cursor-pointer",style:{animation:"slideInFromRight 0.5s ease-out"},onClick:KE,children:[u.jsx("div",{className:"flex items-center gap-2 w-full",children:u.jsx("div",{className:"flex-1",children:u.jsx("p",{className:"text-sm font-medium text-gray-900",children:u.jsx(cE,{sequence:[y4(Q?.widgetLoadBehavior)],cursor:!1,speed:50})})})}),u.jsx("div",{className:"absolute top-full right-9 border-l-[8px] border-r-[8px] border-t-[8px] border-l-transparent border-r-transparent border-t-white w-0 h-0"})]}),u.jsxs("button",{onClick:KE,className:"transform transition-transform hover:scale-95",style:{cursor:"pointer",background:"transparent",border:"none",padding:0},children:[u.jsx("img",{src:["clinique","arts-clinique"].includes(g.bot?.botId)?ghA:g.bot?.botId==="easyspace2"?AhA:g.bot?.botId==="fizzy"?EhA:"",alt:"Rihab",className:"w-auto h-[250px] sm:h-[400px] object-contain"}),zE>0&&!kA?u.jsx(u.Fragment,{children:u.jsx("audio",{src:"https://public-assets.content-platform.envatousercontent.com/3a5b6a9c-bead-4397-bc15-393c0f6edb9f/87e342b2-9863-4e6c-83af-edeb375b338d/preview.mp3",className:"hidden",autoPlay:!0})}):null]})]}):["test","asks-bot","recruteur","auditec","auditec_agent","sofradis"].includes(g.bot?.botId)||!Q.icon?u.jsxs("div",{className:`${kA?"hidden":"fixed"} select-none bottom-2 right-1 sm:right-10`,style:{zIndex:999},children:[!kA&&u.jsxs("div",{className:"absolute -left-24 top-0 -translate-x-1/2 bg-white rounded-lg shadow-lg p-3 min-w-[100px] cursor-pointer",style:{animation:"slideInFromRight 0.5s ease-out"},onClick:KE,children:[u.jsx("div",{className:"flex items-center gap-2 w-full",children:u.jsx("div",{className:"flex-1",children:u.jsx("p",{className:"text-sm font-medium text-gray-900",children:u.jsx(cE,{sequence:[y4(Q?.widgetLoadBehavior)],cursor:!1,speed:50})})})}),u.jsx("div",{className:"absolute -right-2 top-1/2 -translate-y-1/2 border-t-[8px] border-b-[8px] border-l-[8px] border-t-transparent border-b-transparent border-l-white w-0 h-0"})]}),u.jsxs("button",{onClick:KE,className:"transform transition-transform hover:scale-95 cursor-pointer bg-transparent border-0 p-0",children:[u.jsx("img",{src:g?.bot.botId==="auditec"||g?.bot.botId==="auditec_agent"?IhA:g?.bot.botId==="sofradis"?ChA:CZ,alt:"Tybot",className:`w-auto ${g?.bot.botId==="auditec"||g?.bot.botId==="auditec_agent"?"h-[130px] sm:h-[150px]":"h-[100px] sm:h-[120px]"} object-contain`}),zE>0&&!kA?u.jsx(u.Fragment,{children:u.jsx("audio",{src:"https://public-assets.content-platform.envatousercontent.com/3a5b6a9c-bead-4397-bc15-393c0f6edb9f/87e342b2-9863-4e6c-83af-edeb375b338d/preview.mp3",className:"hidden",autoPlay:!0})}):null]})]}):aA==="middle-right"?u.jsx("div",{className:"fixed top-1/2 -translate-y-1/2",style:{right:"0",transform:kA?`translateX(-${TA}px)`:"translateX(0)",transition:"transform 0.3s cubic-bezier(0.4,0,0.2,1)",zIndex:1e3},children:u.jsxs("button",{onClick:()=>{Cg(p=>!p),ZI.current=!kA,kA||ZE()},className:"px-4 py-3 shadow-lg transform",style:{background:KQ,borderTopLeftRadius:`${L}px`,borderBottomLeftRadius:`${z}px`,borderTopRightRadius:`${j}px`,borderBottomRightRadius:`${d}px`,zIndex:1e7},children:[u.jsx("img",{src:LB,alt:"Tybot logo",className:"w-7 h-7"}),zE>0&&!kA?u.jsxs(u.Fragment,{children:[u.jsx("audio",{src:"https://public-assets.content-platform.envatousercontent.com/3a5b6a9c-bead-4397-bc15-393c0f6edb9f/87e342b2-9863-4e6c-83af-edeb375b338d/preview.mp3",className:"hidden",autoPlay:!0}),u.jsx("span",{className:"absolute -top-1 -left-1 bg-red-500 text-white text-xs font-medium size-5 rounded-full flex items-center justify-center",children:zE>9?"9+":zE})]}):null]})}):u.jsxs("div",{ref:Ug,className:`${kA?"hidden":"fixed"} rounded-full select-none`,style:{left:`${zA.x}px`,top:`${zA.y}px`,zIndex:999,cursor:nA?"grabbing":"grab",animation:(zE>0||Dg)&&!kA&&!nA?"gentlePulse 2s ease-in-out infinite, smoothFloat 3s ease-in-out infinite":"none",transition:nA?"none":"all 0.2s ease-out"},children:[Dg&&!kA&&!nA&&u.jsxs("div",{className:`absolute ${aA==="bottom-right"?"bottom-[110%] right-2":aA==="bottom-left"?"bottom-16 left-0":"top-1/2 right-20 -translate-y-1/2"} bg-white rounded-lg shadow-lg p-3 min-w-[250px] cursor-pointer`,style:{animation:"slideInFromRight 0.5s ease-out"},onClick:KE,children:[u.jsx("div",{className:"flex items-center gap-2 w-full",children:u.jsx("div",{className:"flex-1",children:u.jsx("p",{className:"text-sm font-medium text-gray-900",children:u.jsx(cE,{sequence:[y4(Q?.widgetLoadBehavior)],cursor:!1,speed:50})})})}),u.jsx("div",{className:`absolute ${aA==="bottom-right"?"top-full right-6 border-l-[8px] border-r-[8px] border-t-[8px] border-l-transparent border-r-transparent":aA==="bottom-left"?"top-full right-6 border-l-[8px] border-r-[8px] border-t-[8px] border-l-transparent border-r-transparent border-t-white":"top-1/2 right-0 border-l-[8px] border-t-[8px] border-b-[8px] border-l-white border-t-transparent border-b-transparent transform translate-x-full -translate-y-1/2"} w-0 h-0`})]}),u.jsxs("button",{onClick:KE,onMouseDown:UQ,onTouchStart:dw,className:"rounded-full size-[67px] p-1 shadow-lg transform",style:{background:KQ,cursor:nA?"grabbing":"grab"},onMouseEnter:p=>!nA&&(p.currentTarget.style.transform="scale(0.95)"),onMouseLeave:p=>!nA&&(p.currentTarget.style.transform="scale(1)"),children:[u.jsx("div",{className:"size-full overflow-hidden rounded-full",children:u.jsx("img",{src:LB,alt:"Tybot logo",className:"w-full h-full"})}),zE>0&&!kA?u.jsxs(u.Fragment,{children:[u.jsx("audio",{src:"https://public-assets.content-platform.envatousercontent.com/3a5b6a9c-bead-4397-bc15-393c0f6edb9f/87e342b2-9863-4e6c-83af-edeb375b338d/preview.mp3",className:"hidden",autoPlay:!0}),u.jsx("span",{className:"absolute -top-0 -left-0 bg-red-500 text-white text-xs font-medium size-5 rounded-full flex items-center justify-center",children:zE>9?"9+":zE})]}):null]})]})]})};function RcA(g){const A="tybot-widget-container";let B=document.getElementById(A);B||(B=document.createElement("div"),B.id=A,document.body.appendChild(B));const I=B.shadowRoot??B.attachShadow({mode:"open"});if(!document.querySelector("#tybot-widget-fonts")){const o=document.createElement("link");o.rel="preconnect",o.href="https://fonts.googleapis.com";const w=document.createElement("link");w.rel="preconnect",w.href="https://fonts.gstatic.com",w.crossOrigin="";const e=document.createElement("link");e.id="tybot-widget-fonts",e.rel="stylesheet",e.href="https://fonts.googleapis.com/css2?family=Nunito:ital@0;1&display=swap",document.head.append(o),document.head.append(w),document.head.append(e)}if(!I.querySelector("#tybot-widget-style")){const o=document.createElement("style");o.id="tybot-widget-style",o.textContent=y6,I.appendChild(o)}const E=I.querySelector("#tybot-widget-root");E&&E.remove();const C=document.createElement("div");C.id="tybot-widget-root",I.appendChild(C),p6.createRoot(C).render(u.jsx(rcA,{config:g}))}/*!
|
|
710
|
+
`}),u.jsxs("div",{className:"fixed top-0 right-0 h-full shadow-2xl !z-[100000000]",style:{width:TA+"px",transition:"transform 0.3s cubic-bezier(0.4,0,0.2,1)",transform:kA?"translateX(0)":`translateX(${TA}px)`,background:jw},onDrop:hi,onDragOver:xw,onDragEnter:_C,onDragLeave:TQ,children:[u.jsx("div",{onMouseDown:Mg,className:"absolute left-0 top-0 h-full w-2 cursor-ew-resize z-50 bg-transparent opacity-50 transition-colors",style:{userSelect:"none"},onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent"}),$g&&u.jsx("div",{className:"absolute inset-0 bg-opacity-20 border-2 border-dashed flex items-center justify-center !z-[9999999]",style:{borderColor:s},children:u.jsxs("div",{className:"text-center ",style:{color:l},children:[u.jsx(_s,{className:"w-12 h-12 mx-auto mb-2"}),u.jsx("p",{className:"text-lg font-semibold",children:"Drop files here"})]})}),u.jsx("div",{className:"text-center py-[1px] flex flex-col items-center justify-center gap-1 backdrop-blur-sm",style:{background:s},children:u.jsxs("p",{className:"text-[11px]",style:{color:l},children:["© Powered by"," ",u.jsx("a",{href:"https://tybot.ma",target:"_blank",rel:"noopener noreferrer",className:"underline font-semibold hover:opacity-80 transition-opacity ",style:{color:l},children:"Tybot"})]})}),lE?u.jsxs("div",{className:"flex items-center justify-between px-4 py-1 sm:py-2 border-b",style:{background:zo,borderColor:U},children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"sm:size-12 size-8 flex items-center justify-center overflow-hidden rounded-full",children:u.jsx("img",{src:LB,alt:`${$B} Logo`,className:"w-full h-full"})}),u.jsx("h2",{className:"sm:text-lg text-md font-semibold",style:{color:l},children:$B})]}),u.jsxs("div",{className:"flex justify-between items-center gap-2 ml-2",children:[u.jsx("button",{className:"transition-colors p-1 rounded-full",style:{color:l},title:"Reset chat","aria-label":"Reset chat",onClick:()=>uE(!0),onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent",children:u.jsx(qBA,{className:"w-5 h-5"})}),u.jsx("button",{onClick:()=>lg(!0),className:"transition-colors p-1 rounded-full",style:{color:l},title:"Bot info","aria-label":"Bot info",onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent",children:u.jsx(dBA,{className:"w-5 h-5"})}),u.jsx("button",{onClick:()=>{Cg(!1),ZI.current=!1},className:"transition-colors p-1 rounded-full",style:{color:l},title:"Close Chat","aria-label":"Close Chat",onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent",children:u.jsx(Dw,{className:"w-5 h-5"})})]})]}):u.jsx("div",{className:"flex items-center justify-end px-6 py-3",children:u.jsx("div",{className:"flex items-center",children:u.jsx("button",{onClick:()=>{Cg(!1),ZI.current=!1},className:"transition-colors p-1 rounded-full",style:{color:g?.inputTextColor||"#FFF"},title:"Close Chat","aria-label":"Close Chat",onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent",children:u.jsx(Dw,{className:"w-5 h-5"})})})}),lE&&u.jsxs("div",{ref:A,className:"flex-1 px-2 sm:px-4 py-3 overflow-y-auto space-y-4 scroll-smooth",style:{height:"calc(100% - 160px)",scrollbarWidth:"thin",scrollbarColor:`${s} transparent`,fontSize:wA},children:[eI.map((p,LA)=>u.jsx("div",{className:"flex flex-col w-full gap-2",children:u.jsxs("div",{className:`flex ${p.sender==="agent"?"flex-col sm:flex-row":""} items-start gap-3 ${p.sender==="user"?"flex-row-reverse":""} ${DB&&BI.has(p.id)?"p-2 rounded-lg":""}`,style:{background:DB&&BI.has(p.id)?`${s}20`:"transparent",border:DB&&BI.has(p.id)?`2px solid ${s}`:"none",transition:"all 0.2s ease"},children:[["easyspace2","tessttt"].includes(g?.bot?.botId)&&p.sender!=="user"?u.jsx("div",{className:"sm:size-9 size-7 rounded-full flex items-center justify-center flex-shrink-0 relative overflow-hidden",style:{background:EA},onClick:()=>DB&&PQ(p.id),children:u.jsx("img",{src:BhA,className:"w-full h-full object-cover"})}):u.jsx("div",{className:"sm:size-8 size-7 rounded-full flex items-center justify-center flex-shrink-0 relative cursor-pointer",style:{background:p.sender==="user"?AA:EA},onClick:()=>DB&&PQ(p.id),children:DB?u.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-full",style:{background:"rgba(0,0,0,0.6)"},children:u.jsx("input",{type:"checkbox",checked:BI.has(p.id),onChange:()=>PQ(p.id),className:"w-4 h-4 cursor-pointer",style:{accentColor:s},onClick:RA=>RA.stopPropagation()})}):u.jsx(u.Fragment,{children:p.sender==="user"?u.jsx(Fo,{className:"sm:size-4 size-3",style:{color:V}}):u.jsx(Dj,{className:"sm:size-4 size-3",style:{color:$}})})}),u.jsxs("div",{className:`flex flex-col flex-1 ${p.sender==="user"?"items-end":"items-start"}`,children:[p.attachments&&p.attachments.length>0&&u.jsx("div",{className:"flex flex-col items-end w-[88%] mb-2 space-y-2",children:p.attachments.map(RA=>u.jsx(UsA,{attachment:RA,formatFileSize:Vo,mainColor:s,secondaryColor:a,controlsColor:l},RA.id))}),p.content&&p.sender==="user"?u.jsx("div",{className:"px-4 py-2 backdrop-blur-sm break-words w-fit",style:{wordBreak:"break-word",overflowWrap:"break-word",borderRadius:`${m}px`,maxWidth:`${y}%`,background:N,color:oA},children:u.jsx(ww,{remarkPlugins:[ew],components:DE,children:Gw(typeof p.content=="string"?p.content:"")})}):typeof p.content=="object"?p.content.map((RA,lA)=>RA.type==="image"?u.jsx("div",{className:"mb-1 w-72",children:_i(RA)},lA):RA.type==="video"?u.jsx("div",{className:"mb-1 w-72",children:_i(RA)},lA):u.jsx("div",{className:"mb-1 px-4 py-2 backdrop-blur-sm break-words w-fit",style:{wordBreak:"break-word",overflowWrap:"break-word",borderRadius:`${m}px`,width:`${y}%`,background:f,color:X},children:_i(RA)},lA)):typeof p.content=="string"&&p.content?u.jsx("div",{className:"mb-1 px-4 py-2 backdrop-blur-sm break-words w-fit",style:{wordBreak:"break-word",overflowWrap:"break-word",borderRadius:`${m}px`,maxWidth:`${y}%`,background:f,color:X},children:u.jsx(ww,{remarkPlugins:[ew],components:DE,children:Gw(p.content)})}):null,u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"ml-1 text-[10px] sm:text-xs mt-1",style:{color:l},children:p?.timestamp?.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),u.jsx("button",{className:"ml-2 p-1 rounded-full hover:bg-opacity-10 transition-all duration-200",style:{color:bB===p.id?"#10b981":l},title:bB===p.id?"Copied!":"Copy message","aria-label":"Copy message",onClick:()=>uQ((typeof p.content=="string",p.content),p.id),onMouseEnter:RA=>RA.currentTarget.style.background=s,onMouseLeave:RA=>RA.currentTarget.style.background="transparent",children:bB===p.id?u.jsxs("span",{className:"flex gap-1 items-center",children:[u.jsx(tQ,{size:14})," Copied"]}):u.jsxs("span",{className:"flex gap-1 items-center",children:[u.jsx(mBA,{size:14})," Copier"]})}),!DB&&u.jsx("button",{className:"p-1 rounded-full hover:bg-opacity-10 transition-all duration-200",style:{color:l},title:"Share messages","aria-label":"Share messages",onClick:SQ,onMouseEnter:RA=>RA.currentTarget.style.background=s,onMouseLeave:RA=>RA.currentTarget.style.background="transparent",children:u.jsxs("span",{className:"flex gap-1 items-center",children:[u.jsx(Rj,{size:14})," Partager"]})}),p.sender==="agent"&&p.timingMetrics&&u.jsxs("div",{style:{position:"relative"},children:[u.jsx("button",{className:"p-1 rounded-full hover:bg-opacity-10 transition-all duration-200",style:{color:CI===p.id?"#a78bfa":l,transition:"color 0.2s ease"},title:"Process stats","aria-label":"Process stats",onClick:RA=>{if(CI!==p.id){const lA=RA.currentTarget.getBoundingClientRect();zI(lA.top<260?"down":"up")}AE(lA=>lA===p.id?null:p.id)},onMouseEnter:RA=>RA.currentTarget.style.background=s,onMouseLeave:RA=>RA.currentTarget.style.background="transparent",children:u.jsx("span",{className:"flex gap-1 items-center",children:u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10"}),u.jsx("polyline",{points:"12 6 12 12 16 14"})]})})}),CI===p.id&&BQ(p.timingMetrics)]})]})]})]})},p.id)),Rg&&u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("div",{className:"sm:size-8 size-7 rounded-full bg-gradient-to-r flex items-center justify-center",style:{background:EA},children:u.jsx(Dj,{className:"sm:size-4 size-3",style:{color:$}})}),u.jsx("div",{className:"px-4 py-2",style:{background:f,color:X,borderRadius:`${m}px`},children:u.jsxs("div",{className:"flex space-x-1",children:[u.jsx("div",{className:"size-1 sm:size-2 rounded-full animate-bounce",style:{background:X}}),u.jsx("div",{className:"size-1 sm:size-2 rounded-full animate-bounce",style:{background:X,animationDelay:"0.1s"}}),u.jsx("div",{className:"size-1 sm:size-2 rounded-full animate-bounce",style:{background:X,animationDelay:"0.2s"}})]})})]})]}),!lE&&u.jsxs("div",{className:"w-full h-full flex flex-col mt-20 items-center p-4 gap-4",children:[u.jsx("h4",{className:"text-sm font-bold mb-2",style:{color:l},children:"Veuillez fournir vos informations pour commencer à discuter"}),u.jsxs("form",{onSubmit:$C,className:"w-full max-w-xs flex flex-col gap-4 p-6 rounded-2xl shadow-lg",style:{background:s},children:[Q?.formFields.includes("full_name")&&u.jsx("input",{type:"text",placeholder:"Nom et prénom",value:eE,onChange:p=>zQ(p.target.value),className:"py-3 px-4 rounded-lg outline-none transition-all duration-200",style:{borderRadius:"14px",backgroundColor:l,color:R,borderColor:a}},"full_name"),Q?.formFields.includes("phone_number")&&u.jsx("input",{type:"text",placeholder:"Téléphone",value:ZQ,onChange:p=>qo(p.target.value),className:"py-3 px-4 rounded-lg outline-none transition-all duration-200",style:{borderRadius:"14px",backgroundColor:l,color:R,borderColor:a}},"phone_number"),Q?.formFields.includes("email")&&u.jsx("input",{type:"email",placeholder:"Email",value:vi,onChange:p=>ZB(p.target.value),className:"py-3 px-4 rounded-lg outline-none transition-all duration-200",style:{borderRadius:"14px",backgroundColor:l,color:R,borderColor:a}},"email"),u.jsx("button",{type:"submit",className:"py-3 rounded-lg font-bold uppercase outline-none shadow-lg transition-all duration-200",style:{background:`linear-gradient(90deg, ${s}, ${a})`,letterSpacing:"2px",borderRadius:"14px",color:l},children:"Submit"})]})]}),lE&&u.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-4 pt-0 pb-3",style:{background:`linear-gradient(to top, ${G}, transparent)`},children:DB?u.jsxs("div",{className:"flex items-center justify-between gap-3 p-4 rounded-lg",style:{background:R},children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("button",{onClick:SQ,className:"px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2",style:{background:"transparent",color:l,border:`1px solid ${l}`},onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent",children:[u.jsx(Dw,{size:16}),"Annuler"]}),u.jsxs("span",{className:"text-sm",style:{color:l},children:[BI.size," message",BI.size!==1?"s":""," sélectionné",BI.size!==1?"s":""]})]}),u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("button",{onClick:WE,className:"px-4 py-2 rounded-lg font-medium transition-all duration-200",style:{background:a,color:l},onMouseEnter:p=>p.currentTarget.style.opacity="0.9",onMouseLeave:p=>p.currentTarget.style.opacity="1",children:"Tout sélectionner"}),u.jsxs("button",{onClick:gQ,disabled:BI.size===0,className:"px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",style:{background:s,color:l},onMouseEnter:p=>!p.currentTarget.disabled&&(p.currentTarget.style.opacity="0.9"),onMouseLeave:p=>p.currentTarget.style.opacity="1",children:[u.jsx(kBA,{size:16}),"Générer PDF"]})]})]}):u.jsxs(u.Fragment,{children:[Ng.length>0&&u.jsx("div",{className:"flex flex-wrap gap-2 mb-3 p-3 bg-opacity-70 rounded-lg",style:{background:R},children:Ng.map(p=>u.jsx(lsA,{attachment:p,onRemove:()=>ti(p.id)},p.id))}),Q?.advisorCall?.enabled&&Ng.length===0&&!D&&u.jsxs("div",{className:"flex flex-col items-center mb-4",children:[u.jsxs("div",{className:"relative flex items-center w-fit px-4 py-2 rounded-full",style:{background:"rgba(0,0,0,0.45)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:[u.jsx("button",{type:"button",onClick:()=>t(!0),className:"absolute -top-1 -right-1 flex items-center justify-center w-5 h-5 rounded-full transition-all duration-200 hover:bg-white/30 active:scale-90 z-10",style:{background:"rgba(0,0,0,0.45)",color:"rgba(255,255,255,0.8)"},title:"Dismiss","aria-label":"Dismiss advisor call",children:u.jsx(Dw,{className:"w-3 h-3"})}),u.jsxs("button",{type:"button",onClick:Ao,className:"flex items-center gap-2 px-5 py-2 rounded-full text-xs shadow-lg transition-all duration-200 hover:brightness-110 active:scale-95",style:{background:v,color:J},children:[u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:u.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"})}),Q?.advisorCall?.message]})]}),u.jsx("div",{style:{width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent",borderTop:"5px solid rgba(0,0,0,0.45)"}})]}),u.jsxs("div",{className:"flex items-center w-full gap-2 relative",children:[u.jsx("div",{className:"flex-1 relative",children:u.jsxs(u.Fragment,{children:[$A!=="recording"&&$A!=="paused"?u.jsxs(u.Fragment,{children:[u.jsx("button",{id:"upload-button-toggle",type:"button",onClick:()=>{Vg||Rg||UB(p=>!p)},className:"absolute left-1 bottom-[10px] sm:bottom-3 size-8 sm:size-9 rounded-full flex items-center justify-center transition-all duration-200 z-10 hover:bg-opacity-10",style:{color:l},onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="",children:u.jsx(Rt,{className:`size-4 sm:size-5 transition-transform duration-200 ${Wg?"rotate-45":""}`})}),u.jsx("button",{type:"button",onClick:()=>{Vg||Rg||QI()},className:"absolute right-1 bottom-[10px] sm:bottom-3 size-8 sm:size-9 rounded-full flex items-center justify-center transition-all duration-200 z-10",style:{color:l},onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="",children:u.jsx(jBA,{className:"size-4 sm:size-5"})})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:()=>{qI.current=!0,iC()},className:"absolute left-1 bottom-3 w-9 h-9 hover:bg-red-100 hover:bg-opacity-50 rounded-full flex items-center justify-center text-red-500 hover:text-red-600 z-10 after:w-2 after:h-2 after:bg-red-500 after:absolute after:rounded-full after:top-1/2 after:-right-3 after:-translate-y-1/2 after:animate-bounce",children:u.jsx(WBA,{className:"w-5 h-5"})}),u.jsx("button",{type:"button",onClick:()=>{CC?(eB(!1),GA()):(eB(!0),xg())},className:"absolute right-11 bottom-3 w-9 h-9 rounded-full flex items-center justify-center transition-all duration-200 z-10",style:{color:l},children:CC?u.jsx(OBA,{className:"w-7 h-7"}):u.jsx(SBA,{className:"w-7 h-7"})}),u.jsxs("div",{className:"absolute left-16 bottom-4 flex items-center gap-4 z-10 ",style:{color:l},children:[u.jsx("p",{children:YC}),u.jsx("p",{className:`${$A==="recording"?"animate-pulse":""}`,children:$A==="recording"?"Recording...":$A==="paused"?"Paused":"Starting..."})]}),u.jsx("button",{type:"button",onClick:()=>{iC()},className:"absolute right-1 bottom-3 w-9 h-9 rounded-full flex items-center justify-center transition-all duration-200 z-10",style:{color:l,background:"green"},children:u.jsx(tQ,{className:"w-5 h-5"})})]}),Wg&&u.jsxs("div",{className:"absolute bottom-12 left-0 rounded-lg shadow-xl border border-gray-700 py-2 min-w-48 z-10",style:{background:Z},children:[u.jsxs("button",{id:"document-button",onClick:()=>ai("document"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:T},onMouseEnter:p=>p.currentTarget.style.background=W,onMouseLeave:p=>p.currentTarget.style.background="",children:[u.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-full flex items-center justify-center",children:u.jsx(QM,{className:"w-4 h-4 text-white"})}),u.jsx("span",{children:"Document"})]}),u.jsxs("button",{id:"image-button",onClick:()=>ai("image"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:T},onMouseEnter:p=>p.currentTarget.style.background=W,onMouseLeave:p=>p.currentTarget.style.background="",children:[u.jsx("div",{className:"w-8 h-8 bg-green-600 rounded-full flex items-center justify-center",children:u.jsx(xBA,{className:"w-4 h-4 text-white"})}),u.jsx("span",{children:"Photos"})]}),u.jsxs("button",{id:"video-button",onClick:()=>ai("video"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:T},onMouseEnter:p=>p.currentTarget.style.background=W,onMouseLeave:p=>p.currentTarget.style.background="",children:[u.jsx("div",{className:"w-8 h-8 bg-red-600 rounded-full flex items-center justify-center",children:u.jsx(nj,{className:"w-4 h-4 text-white"})}),u.jsx("span",{children:"Videos"})]}),u.jsxs("button",{id:"audio-button",onClick:()=>ai("audio"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:T},onMouseEnter:p=>p.currentTarget.style.background=W,onMouseLeave:p=>p.currentTarget.style.background="",children:[u.jsx("div",{className:"w-8 h-8 bg-purple-600 rounded-full flex items-center justify-center",children:u.jsx(ZR,{className:"w-4 h-4 text-white"})}),u.jsx("span",{children:"Audio"})]})]}),u.jsx("textarea",{id:"message-input",ref:nQ,className:`disabled:opacity-50 w-full pt-3 text-xs sm:text-sm sm:pt-4 px-12 resize-none min-h-10 sm:min-h-12 max-h-32 overflow-y-auto focus:outline-none backdrop-blur-sm ${$A==="recording"||$A==="paused"?"cursor-default":""}`,value:$A==="recording"||$A==="paused"?"":qg,onChange:p=>jg(p.target.value),placeholder:$A==="recording"||$A==="paused"?"":"Type your message...",rows:1,onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),xB())},style:{borderRadius:`${K}px`,background:R,color:l,scrollbarWidth:"thin",scrollbarColor:`${s} transparent`},readOnly:$A==="recording"||$A==="paused",disabled:Rg||Vg})]})}),(qg.trim()||Ng.length!==0)&&u.jsx("div",{className:"w-min",children:u.jsx("button",{onClick:()=>xB(),className:"w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200 transform hover:scale-105",style:{background:s,color:l},children:u.jsx(rj,{className:"w-5 h-5"})})})]}),u.jsx("input",{ref:B,type:"file",multiple:!0,className:"hidden",accept:"image/*",onChange:p=>p.target.files&&FQ(p.target.files,B)}),u.jsx("input",{ref:I,type:"file",multiple:!0,className:"hidden",accept:"video/*",onChange:p=>p.target.files&&FQ(p.target.files,I)}),u.jsx("input",{ref:E,type:"file",multiple:!0,className:"hidden",accept:"audio/*",onChange:p=>p.target.files&&FQ(p.target.files,E)}),u.jsx("input",{ref:C,type:"file",multiple:!0,className:"hidden",accept:".pdf,.doc,.docx,.txt,.csv,.xlsx,.ppt,.pptx,.zip,.rar",onChange:p=>p.target.files&&FQ(p.target.files,C)})]})}),Bg&&u.jsx("div",{className:"fixed inset-0 z-[998] flex items-center justify-center",style:{background:"rgba(0,0,0,0.45)",backdropFilter:"blur(4px)"},onClick:()=>lg(!1),children:u.jsxs("div",{className:"relative w-full max-w-md mx-4 p-6 rounded-2xl shadow-2xl border overflow-hidden animate-[fadeIn_0.25s_ease]",style:{background:`linear-gradient(145deg, ${G}, ${s}, ${a})`,borderRadius:`${K}px`,borderColor:s},onClick:p=>p.stopPropagation(),children:[u.jsx("button",{onClick:()=>lg(!1),className:"absolute top-3 right-3 p-1 rounded-full transition-colors","aria-label":"Close bot info",style:{color:l},onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent",children:u.jsx(Dw,{className:"w-5 h-5"})}),g?.bot?u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("div",{className:"w-16 h-16 rounded-full p-1 flex items-center justify-center shadow-md overflow-hidden",style:{background:`linear-gradient(to bottom right, ${s}, ${a})`,borderRadius:"1.5rem"},children:u.jsx("img",{src:LB,alt:`${$B} logo`||"Bot avatar",className:"w-full h-full rounded-full",style:{borderRadius:"1.5rem"}})}),u.jsx("div",{className:"min-w-0",children:u.jsx("h3",{className:"text-lg font-semibold truncate",title:$B,style:{color:l},children:$B})})]}),Q?.description&&u.jsx("div",{className:"max-h-40 overflow-y-auto pr-1 custom-scrollbar",children:u.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-line",style:{wordBreak:"break-word",color:l},children:Q.description})}),u.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",style:{color:l},children:[Array.isArray(Q?.phone_numbers)&&Q.phone_numbers.length>0&&u.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.jsxs("span",{className:"uppercase tracking-wide font-bold",style:{color:l},children:["Phone number",Q.phone_numbers.length>1?"s":""]}),u.jsx("div",{className:"flex flex-col gap-1 flex-wrap",children:Q.phone_numbers.map((p,LA)=>u.jsx("a",{href:`tel:${p}`,className:"font-medium break-all",style:{color:l},children:p},LA))})]}),Array.isArray(Q?.websites)&&Q.websites.length>0&&u.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.jsxs("span",{className:"uppercase tracking-wide font-bold",style:{color:l},children:["Website",Q.websites.length>1?"s":""]}),u.jsx("div",{className:"flex flex-col gap-1 flex-wrap",children:Q.websites.map((p,LA)=>u.jsx("a",{className:"break-all underline font-semibold",href:p,target:"_blank",rel:"noopener noreferrer",children:p},LA))})]}),Array.isArray(Q?.emails)&&Q.emails.length>0&&u.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.jsxs("span",{className:"uppercase tracking-wide font-bold",style:{color:l},children:["Email",Q.emails.length>1?"s":""]}),u.jsx("div",{className:"flex flex-col gap-1",children:Q.emails.map((p,LA)=>u.jsx("a",{href:`mailto:${p}`,className:"font-medium break-all",style:{color:l},children:p},LA))})]}),Array.isArray(Q?.channels)&&Q?.channels.length>0&&u.jsxs("div",{className:"flex flex-col gap-2 mt-3",children:[u.jsx("span",{className:"uppercase tracking-wide font-bold text-xs",style:{color:l},children:"Connect with us"}),u.jsx("div",{className:"flex items-center gap-3 flex-wrap",children:Q?.channels.map((p,LA)=>{const RA=p.channel_name?.toLowerCase()||"",{icon:lA,color:cg,hoverColor:OA}=si(RA);return u.jsx("a",{href:p.link,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center p-2.5 rounded-2xl transition-all duration-200 hover:scale-105 shadow-md",style:{background:cg,color:"#FFFFFF"},title:p.channel_name,onMouseEnter:Xg=>Xg.currentTarget.style.background=OA,onMouseLeave:Xg=>Xg.currentTarget.style.background=cg,children:lA},LA)})})]})]})]}):u.jsxs("div",{className:"text-center",style:{color:l},children:[u.jsx("p",{className:"text-sm",children:"No bot selected."}),u.jsx("button",{type:"button",onClick:()=>lg(!1),className:"mt-4 px-4 py-2 rounded-lg text-sm font-medium bg-white/10 hover:bg-white/20 text-black transition-colors",style:{borderRadius:`${K}px`},children:"Close"})]})]})}),AQ&&u.jsx("div",{className:"fixed inset-0 z-[998] flex items-center justify-center",style:{background:"rgba(0,0,0,0.45)",backdropFilter:"blur(4px)"},onClick:()=>uE(!1),children:u.jsxs("div",{className:"relative w-full max-w-md mx-4 p-6 rounded-2xl shadow-2xl border overflow-hidden animate-[fadeIn_0.25s_ease]",style:{background:`linear-gradient(145deg, ${G}, ${s}, ${a})`,borderRadius:`${K}px`,borderColor:s},onClick:p=>p.stopPropagation(),children:[u.jsx("button",{onClick:()=>uE(!1),className:"absolute top-3 right-3 p-1 rounded-full transition-colors","aria-label":"Close reset chat",style:{color:l},onMouseEnter:p=>p.currentTarget.style.background=s,onMouseLeave:p=>p.currentTarget.style.background="transparent",children:u.jsx(Dw,{className:"w-5 h-5"})}),u.jsx("h3",{className:"text-lg font-semibold mb-2 ",style:{color:l},children:"Reset Chat?"}),u.jsx("p",{className:"mb-4",style:{color:l},children:"Are you sure you want to reset the chat? This will clear all messages."}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx("button",{className:"px-4 py-2 rounded bg-white/80 text-gray-900 hover:bg-white",onClick:()=>uE(!1),children:"Cancel"}),u.jsx("button",{className:"px-4 py-2 rounded bg-red-600 text-white hover:bg-red-700",onClick:async()=>{uE(!1),await lQ()},children:"Confirm"})]})]})})]}),["easyspace2","clinique","arts-clinique","fizzy","tessttt"].includes(g.bot?.botId)?u.jsxs("div",{className:`${kA?"hidden":"fixed"} select-none bottom-2 right-1 sm:right-10`,style:{zIndex:999,animation:kA?"none":"smoothFloat 3s ease-in-out infinite"},children:[!kA&&u.jsxs("div",{className:"absolute top-[70px] -left-10 sm:top-40 sm:-left-10 -translate-x-1/2 bg-white rounded-lg shadow-lg p-3 min-w-[100px] cursor-pointer",style:{animation:"slideInFromRight 0.5s ease-out"},onClick:KE,children:[u.jsx("div",{className:"flex items-center gap-2 w-full",children:u.jsx("div",{className:"flex-1",children:u.jsx("p",{className:"text-sm font-medium text-gray-900",children:u.jsx(cE,{sequence:[y4(Q?.widgetLoadBehavior)],cursor:!1,speed:50})})})}),u.jsx("div",{className:"absolute top-full right-9 border-l-[8px] border-r-[8px] border-t-[8px] border-l-transparent border-r-transparent border-t-white w-0 h-0"})]}),u.jsxs("button",{onClick:KE,className:"transform transition-transform hover:scale-95",style:{cursor:"pointer",background:"transparent",border:"none",padding:0},children:[u.jsx("img",{src:["clinique","arts-clinique"].includes(g.bot?.botId)?ghA:["easyspace2","tessttt"].includes(g.bot?.botId)?AhA:g.bot?.botId==="fizzy"?EhA:"",alt:"Rihab",className:"w-auto h-[250px] sm:h-[400px] object-contain"}),zE>0&&!kA?u.jsx(u.Fragment,{children:u.jsx("audio",{src:"https://public-assets.content-platform.envatousercontent.com/3a5b6a9c-bead-4397-bc15-393c0f6edb9f/87e342b2-9863-4e6c-83af-edeb375b338d/preview.mp3",className:"hidden",autoPlay:!0})}):null]})]}):["test","asks-bot","recruteur","auditec","auditec_agent","sofradis"].includes(g.bot?.botId)||!Q.icon?u.jsxs("div",{className:`${kA?"hidden":"fixed"} select-none bottom-2 right-1 sm:right-10`,style:{zIndex:999},children:[!kA&&u.jsxs("div",{className:"absolute -left-24 top-0 -translate-x-1/2 bg-white rounded-lg shadow-lg p-3 min-w-[100px] cursor-pointer",style:{animation:"slideInFromRight 0.5s ease-out"},onClick:KE,children:[u.jsx("div",{className:"flex items-center gap-2 w-full",children:u.jsx("div",{className:"flex-1",children:u.jsx("p",{className:"text-sm font-medium text-gray-900",children:u.jsx(cE,{sequence:[y4(Q?.widgetLoadBehavior)],cursor:!1,speed:50})})})}),u.jsx("div",{className:"absolute -right-2 top-1/2 -translate-y-1/2 border-t-[8px] border-b-[8px] border-l-[8px] border-t-transparent border-b-transparent border-l-white w-0 h-0"})]}),u.jsxs("button",{onClick:KE,className:"transform transition-transform hover:scale-95 cursor-pointer bg-transparent border-0 p-0",children:[u.jsx("img",{src:g?.bot.botId==="auditec"||g?.bot.botId==="auditec_agent"?IhA:g?.bot.botId==="sofradis"?ChA:CZ,alt:"Tybot",className:`w-auto ${g?.bot.botId==="auditec"||g?.bot.botId==="auditec_agent"?"h-[130px] sm:h-[150px]":"h-[100px] sm:h-[120px]"} object-contain`}),zE>0&&!kA?u.jsx(u.Fragment,{children:u.jsx("audio",{src:"https://public-assets.content-platform.envatousercontent.com/3a5b6a9c-bead-4397-bc15-393c0f6edb9f/87e342b2-9863-4e6c-83af-edeb375b338d/preview.mp3",className:"hidden",autoPlay:!0})}):null]})]}):aA==="middle-right"?u.jsx("div",{className:"fixed top-1/2 -translate-y-1/2",style:{right:"0",transform:kA?`translateX(-${TA}px)`:"translateX(0)",transition:"transform 0.3s cubic-bezier(0.4,0,0.2,1)",zIndex:1e3},children:u.jsxs("button",{onClick:()=>{Cg(p=>!p),ZI.current=!kA,kA||ZE()},className:"px-4 py-3 shadow-lg transform",style:{background:KQ,borderTopLeftRadius:`${L}px`,borderBottomLeftRadius:`${z}px`,borderTopRightRadius:`${j}px`,borderBottomRightRadius:`${d}px`,zIndex:1e7},children:[u.jsx("img",{src:LB,alt:"Tybot logo",className:"w-7 h-7"}),zE>0&&!kA?u.jsxs(u.Fragment,{children:[u.jsx("audio",{src:"https://public-assets.content-platform.envatousercontent.com/3a5b6a9c-bead-4397-bc15-393c0f6edb9f/87e342b2-9863-4e6c-83af-edeb375b338d/preview.mp3",className:"hidden",autoPlay:!0}),u.jsx("span",{className:"absolute -top-1 -left-1 bg-red-500 text-white text-xs font-medium size-5 rounded-full flex items-center justify-center",children:zE>9?"9+":zE})]}):null]})}):u.jsxs("div",{ref:Ug,className:`${kA?"hidden":"fixed"} rounded-full select-none`,style:{left:`${zA.x}px`,top:`${zA.y}px`,zIndex:999,cursor:nA?"grabbing":"grab",animation:(zE>0||Dg)&&!kA&&!nA?"gentlePulse 2s ease-in-out infinite, smoothFloat 3s ease-in-out infinite":"none",transition:nA?"none":"all 0.2s ease-out"},children:[Dg&&!kA&&!nA&&u.jsxs("div",{className:`absolute ${aA==="bottom-right"?"bottom-[110%] right-2":aA==="bottom-left"?"bottom-16 left-0":"top-1/2 right-20 -translate-y-1/2"} bg-white rounded-lg shadow-lg p-3 min-w-[250px] cursor-pointer`,style:{animation:"slideInFromRight 0.5s ease-out"},onClick:KE,children:[u.jsx("div",{className:"flex items-center gap-2 w-full",children:u.jsx("div",{className:"flex-1",children:u.jsx("p",{className:"text-sm font-medium text-gray-900",children:u.jsx(cE,{sequence:[y4(Q?.widgetLoadBehavior)],cursor:!1,speed:50})})})}),u.jsx("div",{className:`absolute ${aA==="bottom-right"?"top-full right-6 border-l-[8px] border-r-[8px] border-t-[8px] border-l-transparent border-r-transparent":aA==="bottom-left"?"top-full right-6 border-l-[8px] border-r-[8px] border-t-[8px] border-l-transparent border-r-transparent border-t-white":"top-1/2 right-0 border-l-[8px] border-t-[8px] border-b-[8px] border-l-white border-t-transparent border-b-transparent transform translate-x-full -translate-y-1/2"} w-0 h-0`})]}),u.jsxs("button",{onClick:KE,onMouseDown:UQ,onTouchStart:dw,className:"rounded-full size-[67px] p-1 shadow-lg transform",style:{background:KQ,cursor:nA?"grabbing":"grab"},onMouseEnter:p=>!nA&&(p.currentTarget.style.transform="scale(0.95)"),onMouseLeave:p=>!nA&&(p.currentTarget.style.transform="scale(1)"),children:[u.jsx("div",{className:"size-full overflow-hidden rounded-full",children:u.jsx("img",{src:LB,alt:"Tybot logo",className:"w-full h-full"})}),zE>0&&!kA?u.jsxs(u.Fragment,{children:[u.jsx("audio",{src:"https://public-assets.content-platform.envatousercontent.com/3a5b6a9c-bead-4397-bc15-393c0f6edb9f/87e342b2-9863-4e6c-83af-edeb375b338d/preview.mp3",className:"hidden",autoPlay:!0}),u.jsx("span",{className:"absolute -top-0 -left-0 bg-red-500 text-white text-xs font-medium size-5 rounded-full flex items-center justify-center",children:zE>9?"9+":zE})]}):null]})]})]})};function RcA(g){const A="tybot-widget-container";let B=document.getElementById(A);B||(B=document.createElement("div"),B.id=A,document.body.appendChild(B));const I=B.shadowRoot??B.attachShadow({mode:"open"});if(!document.querySelector("#tybot-widget-fonts")){const o=document.createElement("link");o.rel="preconnect",o.href="https://fonts.googleapis.com";const w=document.createElement("link");w.rel="preconnect",w.href="https://fonts.gstatic.com",w.crossOrigin="";const e=document.createElement("link");e.id="tybot-widget-fonts",e.rel="stylesheet",e.href="https://fonts.googleapis.com/css2?family=Nunito:ital@0;1&display=swap",document.head.append(o),document.head.append(w),document.head.append(e)}if(!I.querySelector("#tybot-widget-style")){const o=document.createElement("style");o.id="tybot-widget-style",o.textContent=y6,I.appendChild(o)}const E=I.querySelector("#tybot-widget-root");E&&E.remove();const C=document.createElement("div");C.id="tybot-widget-root",I.appendChild(C),p6.createRoot(C).render(u.jsx(rcA,{config:g}))}/*!
|
|
711
711
|
* html2canvas 1.4.1 <https://html2canvas.hertzen.com>
|
|
712
712
|
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
|
713
713
|
* Released under MIT License
|