tybotflow-widget 0.4.2 → 0.4.3
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 +7 -4
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -50179,7 +50179,9 @@ const KW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
50179
50179
|
{
|
|
50180
50180
|
id: "upload-button-toggle",
|
|
50181
50181
|
type: "button",
|
|
50182
|
-
onClick: () =>
|
|
50182
|
+
onClick: () => {
|
|
50183
|
+
Ee || Rt((O) => !O);
|
|
50184
|
+
},
|
|
50183
50185
|
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",
|
|
50184
50186
|
style: {
|
|
50185
50187
|
color: x
|
|
@@ -50194,7 +50196,7 @@ const KW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
50194
50196
|
{
|
|
50195
50197
|
type: "button",
|
|
50196
50198
|
onClick: () => {
|
|
50197
|
-
ic();
|
|
50199
|
+
Ee || ic();
|
|
50198
50200
|
},
|
|
50199
50201
|
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",
|
|
50200
50202
|
style: {
|
|
@@ -50317,7 +50319,7 @@ const KW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
50317
50319
|
{
|
|
50318
50320
|
id: "message-input",
|
|
50319
50321
|
ref: Da,
|
|
50320
|
-
className: `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 ${bt === "recording" || bt === "paused" ? "cursor-default" : ""}`,
|
|
50322
|
+
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 ${bt === "recording" || bt === "paused" ? "cursor-default" : ""}`,
|
|
50321
50323
|
value: bt === "recording" || bt === "paused" ? "" : ae,
|
|
50322
50324
|
onChange: (O) => ge(O.target.value),
|
|
50323
50325
|
placeholder: bt === "recording" || bt === "paused" ? "" : "Type your message...",
|
|
@@ -50332,7 +50334,8 @@ const KW = ({ attachment: e, formatFileSize: t, mainColor: n, secondaryColor: a,
|
|
|
50332
50334
|
scrollbarWidth: "thin",
|
|
50333
50335
|
scrollbarColor: `${h} transparent`
|
|
50334
50336
|
},
|
|
50335
|
-
readOnly: bt === "recording" || bt === "paused"
|
|
50337
|
+
readOnly: bt === "recording" || bt === "paused",
|
|
50338
|
+
disabled: Ee
|
|
50336
50339
|
}
|
|
50337
50340
|
)
|
|
50338
50341
|
] }) }),
|
package/dist/index.umd.js
CHANGED
|
@@ -434,4 +434,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
434
434
|
}
|
|
435
435
|
`}),T.jsxs("div",{className:"fixed top-0 right-0 h-full shadow-2xl !z-[100000000]",style:{width:we+"px",transition:"transform 0.3s cubic-bezier(0.4,0,0.2,1)",transform:tt?"translateX(0)":`translateX(${we}px)`,background:Ko},onDrop:ki,onDragOver:Yo,onDragEnter:ir,onDragLeave:Kl,children:[T.jsx("div",{onMouseDown:Ft,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:O=>O.currentTarget.style.background=h,onMouseLeave:O=>O.currentTarget.style.background="transparent"}),xt&&T.jsx("div",{className:"absolute inset-0 bg-opacity-20 border-2 border-dashed flex items-center justify-center !z-[9999999]",style:{borderColor:h},children:T.jsxs("div",{className:"text-center ",style:{color:x},children:[T.jsx(xz,{className:"w-12 h-12 mx-auto mb-2"}),T.jsx("p",{className:"text-lg font-semibold",children:"Drop files here"})]})}),T.jsx("div",{className:"text-center py-[1px] flex flex-col items-center justify-center gap-1 backdrop-blur-sm",style:{background:h},children:T.jsxs("p",{className:"text-[11px]",style:{color:x},children:["© Powered by"," ",T.jsx("a",{href:"https://tybot.ma",target:"_blank",rel:"noopener noreferrer",className:"underline font-semibold hover:opacity-80 transition-opacity ",style:{color:x},children:"Tybot"})]})}),jn?T.jsxs("div",{className:"flex items-center justify-between px-4 py-1 sm:py-3 border-b",style:{background:ty,borderColor:v},children:[T.jsxs("div",{className:"flex items-center gap-3",children:[T.jsx("div",{className:"sm:size-10 size-8 flex items-center justify-center overflow-hidden rounded-full",children:T.jsx("img",{src:Ci,alt:`${_a} Logo`,className:"w-full h-full"})}),T.jsx("h2",{className:"sm:text-lg text-md font-semibold",style:{color:x},children:_a})]}),T.jsxs("div",{className:"flex justify-between items-center gap-2 ml-2",children:[T.jsx("button",{className:"transition-colors p-1 rounded-full",style:{color:x},title:"Reset chat","aria-label":"Reset chat",onClick:()=>oa(!0),onMouseEnter:O=>O.currentTarget.style.background=h,onMouseLeave:O=>O.currentTarget.style.background="transparent",children:T.jsx(Ez,{className:"w-5 h-5"})}),T.jsx("button",{onClick:()=>Me(!0),className:"transition-colors p-1 rounded-full",style:{color:x},title:"Bot info","aria-label":"Bot info",onMouseEnter:O=>O.currentTarget.style.background=h,onMouseLeave:O=>O.currentTarget.style.background="transparent",children:T.jsx(fz,{className:"w-5 h-5"})}),T.jsx("button",{onClick:()=>{me(!1),Kt.current=!1},className:"transition-colors p-1 rounded-full",style:{color:x},title:"Close Chat","aria-label":"Close Chat",onMouseEnter:O=>O.currentTarget.style.background=h,onMouseLeave:O=>O.currentTarget.style.background="transparent",children:T.jsx(ko,{className:"w-5 h-5"})})]})]}):T.jsx("div",{className:"flex items-center justify-end px-6 py-3",children:T.jsx("div",{className:"flex items-center",children:T.jsx("button",{onClick:()=>{me(!1),Kt.current=!1},className:"transition-colors p-1 rounded-full",style:{color:e?.inputTextColor||"#FFF"},title:"Close Chat","aria-label":"Close Chat",onMouseEnter:O=>O.currentTarget.style.background=h,onMouseLeave:O=>O.currentTarget.style.background="transparent",children:T.jsx(ko,{className:"w-5 h-5"})})})}),jn&&T.jsxs("div",{ref:t,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:`${h} transparent`,fontSize:L+"px"},children:[Jr.map(O=>T.jsxs("div",{className:`flex ${O.sender==="agent"?"flex-col sm:flex-row":""} items-start gap-3 ${O.sender==="user"?"flex-row-reverse":""}`,children:[T.jsx("div",{className:"sm:size-8 size-7 rounded-full flex items-center justify-center flex-shrink-0",style:{background:O.sender==="user"?oe:J},children:O.sender==="user"?T.jsx(Tz,{className:"sm:size-4 size-3",style:{color:S}}):T.jsx(qw,{className:"sm:size-4 size-3",style:{color:j}})}),T.jsxs("div",{className:`flex flex-col flex-1 ${O.sender==="user"?"items-end":"items-start"}`,children:[O.attachments&&O.attachments.length>0&&T.jsx("div",{className:"flex flex-col items-end w-[88%] mb-2 space-y-2",children:O.attachments.map(ue=>T.jsx(ZY,{attachment:ue,formatFileSize:Wo,mainColor:h,secondaryColor:m,controlsColor:x},ue.id))}),O.content&&O.sender==="user"?T.jsx("div",{className:"px-4 py-2 backdrop-blur-sm break-words w-fit",style:{wordBreak:"break-word",overflowWrap:"break-word",borderRadius:`${N}px`,maxWidth:D+"%",background:X,color:$},children:T.jsx(Hr,{remarkPlugins:[Gr],components:qn,children:typeof O.content=="string"?O.content.replace(/\n/g,`
|
|
436
436
|
`):""})}):typeof O.content=="object"?O.content.map((ue,pe)=>T.jsx("div",{className:"mb-1 px-4 py-2 backdrop-blur-sm break-words w-fit",style:{wordBreak:"break-word",overflowWrap:"break-word",borderRadius:`${N}px`,maxWidth:D+"%",background:Y,color:G},children:aa(ue)},pe)):typeof O.content=="string"&&O.content?T.jsx("div",{className:"mb-1 px-4 py-2 backdrop-blur-sm break-words w-fit",style:{wordBreak:"break-word",overflowWrap:"break-word",borderRadius:`${N}px`,maxWidth:D+"%",background:Y,color:G},children:T.jsx(Hr,{remarkPlugins:[Gr],components:qn,children:O.content.replace(/\n/g,`
|
|
437
|
-
`)})}):null,T.jsx("span",{className:"ml-1 text-[10px] sm:text-xs mt-1",style:{color:x},children:O.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]},O.id)),Ee&&T.jsxs("div",{className:"flex items-start gap-3",children:[T.jsx("div",{className:"sm:size-8 size-7 rounded-full bg-gradient-to-r flex items-center justify-center",style:{background:J},children:T.jsx(qw,{className:"sm:size-4 size-3",style:{color:j}})}),T.jsx("div",{className:"px-4 py-2",style:{background:Y,color:G,borderRadius:`${N}px`},children:T.jsxs("div",{className:"flex space-x-1",children:[T.jsx("div",{className:"size-1 sm:size-2 rounded-full animate-bounce",style:{background:G}}),T.jsx("div",{className:"size-1 sm:size-2 rounded-full animate-bounce",style:{background:G,animationDelay:"0.1s"}}),T.jsx("div",{className:"size-1 sm:size-2 rounded-full animate-bounce",style:{background:G,animationDelay:"0.2s"}})]})})]})]}),!jn&&T.jsxs("div",{className:"w-full h-full flex flex-col mt-20 items-center p-4 gap-4",children:[T.jsx("h4",{className:"text-sm font-bold mb-2",style:{color:x},children:"Veuillez fournir vos informations pour commencer à discuter"}),T.jsxs("form",{onSubmit:ia,className:"w-full max-w-xs flex flex-col gap-4 p-6 rounded-2xl shadow-lg",style:{background:h},children:[u?.formFields.includes("full_name")&&T.jsx("input",{type:"text",placeholder:"Nom et prénom",value:kn,onChange:O=>Va(O.target.value),className:"py-3 px-4 rounded-lg outline-none transition-all duration-200",style:{borderRadius:"14px",backgroundColor:x,color:w,borderColor:m}},"full_name"),u?.formFields.includes("phone_number")&&T.jsx("input",{type:"text",placeholder:"Téléphone",value:rr,onChange:O=>Dt(O.target.value),className:"py-3 px-4 rounded-lg outline-none transition-all duration-200",style:{borderRadius:"14px",backgroundColor:x,color:w,borderColor:m}},"phone_number"),u?.formFields.includes("email")&&T.jsx("input",{type:"email",placeholder:"Email",value:Ya,onChange:O=>Xl(O.target.value),className:"py-3 px-4 rounded-lg outline-none transition-all duration-200",style:{borderRadius:"14px",backgroundColor:x,color:w,borderColor:m}},"email"),T.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, ${h}, ${m})`,letterSpacing:"2px",borderRadius:"14px",color:x},children:"Submit"})]})]}),jn&&T.jsxs("div",{className:"absolute bottom-0 left-0 right-0 px-4 pt-0 pb-3",style:{background:`linear-gradient(to top, ${y}, transparent)`},children:[Et.length>0&&T.jsx("div",{className:"flex flex-wrap gap-2 mb-3 p-3 bg-opacity-70 rounded-lg",style:{background:w},children:Et.map(O=>T.jsx(JY,{attachment:O,onRemove:()=>ta(O.id)},O.id))}),T.jsxs("div",{className:"flex items-center w-full gap-2 relative",children:[T.jsx("div",{className:"flex-1 relative",children:T.jsxs(T.Fragment,{children:[bt!=="recording"&&bt!=="paused"?T.jsxs(T.Fragment,{children:[T.jsx("button",{id:"upload-button-toggle",type:"button",onClick:()=>Rt(O=>!O),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:x},onMouseEnter:O=>O.currentTarget.style.background=h,onMouseLeave:O=>O.currentTarget.style.background="",children:T.jsx(hl,{className:`size-4 sm:size-5 transition-transform duration-200 ${ft?"rotate-45":""}`})}),T.jsx("button",{type:"button",onClick:()=>{Zb()},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:x},onMouseEnter:O=>O.currentTarget.style.background=h,onMouseLeave:O=>O.currentTarget.style.background="",children:T.jsx(gz,{className:"size-4 sm:size-5"})})]}):T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button",onClick:()=>{mt.current=!0,nr()},className:"absolute left-1 bottom-[10px] sm:bottom-3 size-8 sm:size-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:T.jsx(Az,{className:"size-4 sm:size-5"})}),T.jsx("button",{type:"button",onClick:()=>{Bt?(Xt(!1),an()):(Xt(!0),qt())},className:"absolute right-11 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:x},children:Bt?T.jsx(uz,{className:"size-6 sm:size-7"}):T.jsx(lz,{className:"size-6 sm:size-7"})}),T.jsxs("div",{className:"absolute left-16 bottom-4 flex items-center gap-4 z-10 ",style:{color:x},children:[T.jsx("p",{children:tr}),T.jsx("p",{className:`${bt==="recording"?"animate-pulse":""}`,children:bt==="recording"?"Recording...":bt==="paused"?"Paused":"Starting..."})]}),T.jsx("button",{type:"button",onClick:()=>{nr()},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:x,background:"green"},children:T.jsx(fl,{className:"size-4 sm:size-5"})})]}),ft&&T.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:B},children:[T.jsxs("button",{id:"document-button",onClick:()=>Oi("document"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:H},onMouseEnter:O=>O.currentTarget.style.background=W,onMouseLeave:O=>O.currentTarget.style.background="",children:[T.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-full flex items-center justify-center",children:T.jsx(Co,{className:"w-4 h-4 text-white"})}),T.jsx("span",{children:"Document"})]}),T.jsxs("button",{id:"image-button",onClick:()=>Oi("image"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:H},onMouseEnter:O=>O.currentTarget.style.background=W,onMouseLeave:O=>O.currentTarget.style.background="",children:[T.jsx("div",{className:"w-8 h-8 bg-green-600 rounded-full flex items-center justify-center",children:T.jsx(pz,{className:"w-4 h-4 text-white"})}),T.jsx("span",{children:"Photos"})]}),T.jsxs("button",{id:"video-button",onClick:()=>Oi("video"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:H},onMouseEnter:O=>O.currentTarget.style.background=W,onMouseLeave:O=>O.currentTarget.style.background="",children:[T.jsx("div",{className:"w-8 h-8 bg-red-600 rounded-full flex items-center justify-center",children:T.jsx(_w,{className:"w-4 h-4 text-white"})}),T.jsx("span",{children:"Videos"})]}),T.jsxs("button",{id:"audio-button",onClick:()=>Oi("audio"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:H},onMouseEnter:O=>O.currentTarget.style.background=W,onMouseLeave:O=>O.currentTarget.style.background="",children:[T.jsx("div",{className:"w-8 h-8 bg-purple-600 rounded-full flex items-center justify-center",children:T.jsx(bd,{className:"w-4 h-4 text-white"})}),T.jsx("span",{children:"Audio"})]})]}),T.jsx("textarea",{id:"message-input",ref:Wa,className:`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 ${bt==="recording"||bt==="paused"?"cursor-default":""}`,value:bt==="recording"||bt==="paused"?"":ae,onChange:O=>ge(O.target.value),placeholder:bt==="recording"||bt==="paused"?"":"Type your message...",rows:1,onKeyDown:O=>{O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),Ut())},style:{borderRadius:`${A}px`,background:w,color:x,scrollbarWidth:"thin",scrollbarColor:`${h} transparent`},readOnly:bt==="recording"||bt==="paused"})]})}),(ae.trim()||Et.length!==0)&&T.jsx("div",{className:"w-min",children:T.jsx("button",{onClick:()=>Ut(),className:"w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200 transform hover:scale-105",style:{background:h,color:x},children:T.jsx(Gw,{className:"w-5 h-5"})})})]}),T.jsx("input",{ref:n,type:"file",multiple:!0,className:"hidden",accept:"image/*",onChange:O=>O.target.files&&ar(O.target.files,n)}),T.jsx("input",{ref:a,type:"file",multiple:!0,className:"hidden",accept:"video/*",onChange:O=>O.target.files&&ar(O.target.files,a)}),T.jsx("input",{ref:o,type:"file",multiple:!0,className:"hidden",accept:"audio/*",onChange:O=>O.target.files&&ar(O.target.files,o)}),T.jsx("input",{ref:l,type:"file",multiple:!0,className:"hidden",accept:".pdf,.doc,.docx,.txt,.csv,.xlsx,.ppt,.pptx,.zip,.rar",onChange:O=>O.target.files&&ar(O.target.files,l)})]}),ve&&T.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:()=>Me(!1),children:T.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, ${y}, ${h}, ${m})`,borderRadius:`${A}px`,borderColor:h},onClick:O=>O.stopPropagation(),children:[T.jsx("button",{onClick:()=>Me(!1),className:"absolute top-3 right-3 p-1 rounded-full transition-colors","aria-label":"Close bot info",style:{color:x},onMouseEnter:O=>O.currentTarget.style.background=h,onMouseLeave:O=>O.currentTarget.style.background="transparent",children:T.jsx(ko,{className:"w-5 h-5"})}),e?.bot?T.jsxs("div",{className:"flex flex-col gap-4",children:[T.jsxs("div",{className:"flex items-center gap-4",children:[T.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, ${h}, ${m})`,borderRadius:"1.5rem"},children:T.jsx("img",{src:Ci,alt:`${_a} logo`||"Bot avatar",className:"w-full h-full rounded-full",style:{borderRadius:"1.5rem"}})}),T.jsx("div",{className:"min-w-0",children:T.jsx("h3",{className:"text-lg font-semibold truncate",title:_a,style:{color:x},children:_a})})]}),u?.description&&T.jsx("div",{className:"max-h-40 overflow-y-auto pr-1 custom-scrollbar",children:T.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-line",style:{wordBreak:"break-word",color:x},children:u.description})}),T.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",style:{color:x},children:[Array.isArray(u?.phone_numbers)&&u.phone_numbers.length>0&&T.jsxs("div",{className:"flex flex-col gap-0.5",children:[T.jsxs("span",{className:"uppercase tracking-wide font-bold",style:{color:x},children:["Phone number",u.phone_numbers.length>1?"s":""]}),T.jsx("div",{className:"flex flex-col gap-1 flex-wrap",children:u.phone_numbers.map((O,ue)=>T.jsx("span",{className:"font-medium break-all",style:{color:x},children:O},ue))})]}),Array.isArray(u?.websites)&&u.websites.length>0&&T.jsxs("div",{className:"flex flex-col gap-0.5",children:[T.jsxs("span",{className:"uppercase tracking-wide font-bold",style:{color:x},children:["Website",u.websites.length>1?"s":""]}),T.jsx("div",{className:"flex flex-col gap-1 flex-wrap",children:u.websites.map((O,ue)=>T.jsx("a",{className:"break-all underline font-semibold",href:O,target:"_blank",rel:"noopener noreferrer",children:O},ue))})]}),Array.isArray(u?.emails)&&u.emails.length>0&&T.jsxs("div",{className:"flex flex-col gap-0.5",children:[T.jsxs("span",{className:"uppercase tracking-wide font-bold",style:{color:x},children:["Email",u.emails.length>1?"s":""]}),T.jsx("div",{className:"flex flex-col gap-1",children:u.emails.map((O,ue)=>T.jsx("span",{className:"font-medium break-all",style:{color:x},children:O},ue))})]})]})]}):T.jsxs("div",{className:"text-center",style:{color:x},children:[T.jsx("p",{className:"text-sm",children:"No bot selected."}),T.jsx("button",{type:"button",onClick:()=>Me(!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:`${A}px`},children:"Close"})]})]})}),ey&&T.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:()=>oa(!1),children:T.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, ${y}, ${h}, ${m})`,borderRadius:`${A}px`,borderColor:h},onClick:O=>O.stopPropagation(),children:[T.jsx("button",{onClick:()=>oa(!1),className:"absolute top-3 right-3 p-1 rounded-full transition-colors","aria-label":"Close reset chat",style:{color:x},onMouseEnter:O=>O.currentTarget.style.background=h,onMouseLeave:O=>O.currentTarget.style.background="transparent",children:T.jsx(ko,{className:"w-5 h-5"})}),T.jsx("h3",{className:"text-lg font-semibold mb-2 ",style:{color:x},children:"Reset Chat?"}),T.jsx("p",{className:"mb-4",style:{color:x},children:"Are you sure you want to reset the chat? This will clear all messages."}),T.jsxs("div",{className:"flex justify-end gap-2",children:[T.jsx("button",{className:"px-4 py-2 rounded bg-white/80 text-gray-900 hover:bg-white",onClick:()=>oa(!1),children:"Cancel"}),T.jsx("button",{className:"px-4 py-2 rounded bg-red-600 text-white hover:bg-red-700",onClick:async()=>{oa(!1),await $l()},children:"Confirm"})]})]})})]}),se==="middle-right"?T.jsx("div",{className:"fixed top-1/2 -translate-y-1/2",style:{right:"0",transform:tt?`translateX(-${we}px)`:"translateX(0)",transition:"transform 0.3s cubic-bezier(0.4,0,0.2,1)",zIndex:1e3},children:T.jsxs("button",{onClick:()=>{me(O=>!O),Kt.current=!tt,tt||_o()},className:"px-4 py-3 shadow-lg transform",style:{background:eu,borderTopLeftRadius:`${C}px`,borderBottomLeftRadius:`${U}px`,borderTopRightRadius:`${M}px`,borderBottomRightRadius:`${P}px`,zIndex:1e7},children:[T.jsx("img",{src:Ci,alt:"Tybot logo",className:"w-7 h-7"}),yn>0&&!tt?T.jsxs(T.Fragment,{children:[T.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}),T.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:yn>9?"9+":yn})]}):null]})}):T.jsxs("div",{ref:ne,className:`${tt?"hidden":"fixed"} rounded-full select-none`,style:{left:`${Ie.x}px`,top:`${Ie.y}px`,zIndex:999,cursor:Xe?"grabbing":"grab",animation:(yn>0||ze)&&!tt&&!Xe?"gentlePulse 2s ease-in-out infinite, smoothFloat 3s ease-in-out infinite":"none",transition:Xe?"none":"all 0.2s ease-out"},children:[ze&&!tt&&!Xe&&T.jsxs("div",{className:`absolute ${se==="bottom-right"?"bottom-[110%] right-2":se==="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:Xa,children:[T.jsx("div",{className:"flex items-center gap-2 w-full",children:T.jsx("div",{className:"flex-1",children:T.jsx("p",{className:"text-sm font-medium text-gray-900",children:T.jsx(jt,{sequence:[u?.widgetLoadBehavior?.message||"👋 Hey there! how can I help you?"],cursor:!1,speed:50})})})}),T.jsx("div",{className:`absolute ${se==="bottom-right"?"top-full right-6 border-l-[8px] border-r-[8px] border-t-[8px] border-l-transparent border-r-transparent":se==="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`})]}),T.jsxs("button",{onClick:Xa,onMouseDown:Ii,onTouchStart:Ql,className:"rounded-full size-[67px] p-1 shadow-lg transform",style:{background:eu,cursor:Xe?"grabbing":"grab"},onMouseEnter:O=>!Xe&&(O.currentTarget.style.transform="scale(0.95)"),onMouseLeave:O=>!Xe&&(O.currentTarget.style.transform="scale(1)"),children:[T.jsx("div",{className:"size-full overflow-hidden rounded-full",children:T.jsx("img",{src:Ci,alt:"Tybot logo",className:"w-full h-full"})}),yn>0&&!tt?T.jsxs(T.Fragment,{children:[T.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}),T.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:yn>9?"9+":yn})]}):null]})]})]})};function e6(e){const t="tybot-widget-container";let n=document.getElementById(t);n||(n=document.createElement("div"),n.id=t,document.body.appendChild(n));const a=n.shadowRoot??n.attachShadow({mode:"open"});if(!document.querySelector("#tybot-widget-fonts")){const d=document.createElement("link");d.rel="preconnect",d.href="https://fonts.googleapis.com";const p=document.createElement("link");p.rel="preconnect",p.href="https://fonts.gstatic.com",p.crossOrigin="";const f=document.createElement("link");f.id="tybot-widget-fonts",f.rel="stylesheet",f.href="https://fonts.googleapis.com/css2?family=Nunito:ital@0;1&display=swap",document.head.append(d),document.head.append(p),document.head.append(f)}if(!a.querySelector("#tybot-widget-style")){const d=document.createElement("style");d.id="tybot-widget-style",d.textContent=ED,a.appendChild(d)}const o=a.querySelector("#tybot-widget-root");o&&o.remove();const l=document.createElement("div");l.id="tybot-widget-root",a.appendChild(l),yD.createRoot(l).render(T.jsx($Y,{config:e}))}di.createTybotWidget=e6,Object.defineProperty(di,Symbol.toStringTag,{value:"Module"})});
|
|
437
|
+
`)})}):null,T.jsx("span",{className:"ml-1 text-[10px] sm:text-xs mt-1",style:{color:x},children:O.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]},O.id)),Ee&&T.jsxs("div",{className:"flex items-start gap-3",children:[T.jsx("div",{className:"sm:size-8 size-7 rounded-full bg-gradient-to-r flex items-center justify-center",style:{background:J},children:T.jsx(qw,{className:"sm:size-4 size-3",style:{color:j}})}),T.jsx("div",{className:"px-4 py-2",style:{background:Y,color:G,borderRadius:`${N}px`},children:T.jsxs("div",{className:"flex space-x-1",children:[T.jsx("div",{className:"size-1 sm:size-2 rounded-full animate-bounce",style:{background:G}}),T.jsx("div",{className:"size-1 sm:size-2 rounded-full animate-bounce",style:{background:G,animationDelay:"0.1s"}}),T.jsx("div",{className:"size-1 sm:size-2 rounded-full animate-bounce",style:{background:G,animationDelay:"0.2s"}})]})})]})]}),!jn&&T.jsxs("div",{className:"w-full h-full flex flex-col mt-20 items-center p-4 gap-4",children:[T.jsx("h4",{className:"text-sm font-bold mb-2",style:{color:x},children:"Veuillez fournir vos informations pour commencer à discuter"}),T.jsxs("form",{onSubmit:ia,className:"w-full max-w-xs flex flex-col gap-4 p-6 rounded-2xl shadow-lg",style:{background:h},children:[u?.formFields.includes("full_name")&&T.jsx("input",{type:"text",placeholder:"Nom et prénom",value:kn,onChange:O=>Va(O.target.value),className:"py-3 px-4 rounded-lg outline-none transition-all duration-200",style:{borderRadius:"14px",backgroundColor:x,color:w,borderColor:m}},"full_name"),u?.formFields.includes("phone_number")&&T.jsx("input",{type:"text",placeholder:"Téléphone",value:rr,onChange:O=>Dt(O.target.value),className:"py-3 px-4 rounded-lg outline-none transition-all duration-200",style:{borderRadius:"14px",backgroundColor:x,color:w,borderColor:m}},"phone_number"),u?.formFields.includes("email")&&T.jsx("input",{type:"email",placeholder:"Email",value:Ya,onChange:O=>Xl(O.target.value),className:"py-3 px-4 rounded-lg outline-none transition-all duration-200",style:{borderRadius:"14px",backgroundColor:x,color:w,borderColor:m}},"email"),T.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, ${h}, ${m})`,letterSpacing:"2px",borderRadius:"14px",color:x},children:"Submit"})]})]}),jn&&T.jsxs("div",{className:"absolute bottom-0 left-0 right-0 px-4 pt-0 pb-3",style:{background:`linear-gradient(to top, ${y}, transparent)`},children:[Et.length>0&&T.jsx("div",{className:"flex flex-wrap gap-2 mb-3 p-3 bg-opacity-70 rounded-lg",style:{background:w},children:Et.map(O=>T.jsx(JY,{attachment:O,onRemove:()=>ta(O.id)},O.id))}),T.jsxs("div",{className:"flex items-center w-full gap-2 relative",children:[T.jsx("div",{className:"flex-1 relative",children:T.jsxs(T.Fragment,{children:[bt!=="recording"&&bt!=="paused"?T.jsxs(T.Fragment,{children:[T.jsx("button",{id:"upload-button-toggle",type:"button",onClick:()=>{Ee||Rt(O=>!O)},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:x},onMouseEnter:O=>O.currentTarget.style.background=h,onMouseLeave:O=>O.currentTarget.style.background="",children:T.jsx(hl,{className:`size-4 sm:size-5 transition-transform duration-200 ${ft?"rotate-45":""}`})}),T.jsx("button",{type:"button",onClick:()=>{Ee||Zb()},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:x},onMouseEnter:O=>O.currentTarget.style.background=h,onMouseLeave:O=>O.currentTarget.style.background="",children:T.jsx(gz,{className:"size-4 sm:size-5"})})]}):T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button",onClick:()=>{mt.current=!0,nr()},className:"absolute left-1 bottom-[10px] sm:bottom-3 size-8 sm:size-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:T.jsx(Az,{className:"size-4 sm:size-5"})}),T.jsx("button",{type:"button",onClick:()=>{Bt?(Xt(!1),an()):(Xt(!0),qt())},className:"absolute right-11 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:x},children:Bt?T.jsx(uz,{className:"size-6 sm:size-7"}):T.jsx(lz,{className:"size-6 sm:size-7"})}),T.jsxs("div",{className:"absolute left-16 bottom-4 flex items-center gap-4 z-10 ",style:{color:x},children:[T.jsx("p",{children:tr}),T.jsx("p",{className:`${bt==="recording"?"animate-pulse":""}`,children:bt==="recording"?"Recording...":bt==="paused"?"Paused":"Starting..."})]}),T.jsx("button",{type:"button",onClick:()=>{nr()},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:x,background:"green"},children:T.jsx(fl,{className:"size-4 sm:size-5"})})]}),ft&&T.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:B},children:[T.jsxs("button",{id:"document-button",onClick:()=>Oi("document"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:H},onMouseEnter:O=>O.currentTarget.style.background=W,onMouseLeave:O=>O.currentTarget.style.background="",children:[T.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-full flex items-center justify-center",children:T.jsx(Co,{className:"w-4 h-4 text-white"})}),T.jsx("span",{children:"Document"})]}),T.jsxs("button",{id:"image-button",onClick:()=>Oi("image"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:H},onMouseEnter:O=>O.currentTarget.style.background=W,onMouseLeave:O=>O.currentTarget.style.background="",children:[T.jsx("div",{className:"w-8 h-8 bg-green-600 rounded-full flex items-center justify-center",children:T.jsx(pz,{className:"w-4 h-4 text-white"})}),T.jsx("span",{children:"Photos"})]}),T.jsxs("button",{id:"video-button",onClick:()=>Oi("video"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:H},onMouseEnter:O=>O.currentTarget.style.background=W,onMouseLeave:O=>O.currentTarget.style.background="",children:[T.jsx("div",{className:"w-8 h-8 bg-red-600 rounded-full flex items-center justify-center",children:T.jsx(_w,{className:"w-4 h-4 text-white"})}),T.jsx("span",{children:"Videos"})]}),T.jsxs("button",{id:"audio-button",onClick:()=>Oi("audio"),className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors",style:{color:H},onMouseEnter:O=>O.currentTarget.style.background=W,onMouseLeave:O=>O.currentTarget.style.background="",children:[T.jsx("div",{className:"w-8 h-8 bg-purple-600 rounded-full flex items-center justify-center",children:T.jsx(bd,{className:"w-4 h-4 text-white"})}),T.jsx("span",{children:"Audio"})]})]}),T.jsx("textarea",{id:"message-input",ref:Wa,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 ${bt==="recording"||bt==="paused"?"cursor-default":""}`,value:bt==="recording"||bt==="paused"?"":ae,onChange:O=>ge(O.target.value),placeholder:bt==="recording"||bt==="paused"?"":"Type your message...",rows:1,onKeyDown:O=>{O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),Ut())},style:{borderRadius:`${A}px`,background:w,color:x,scrollbarWidth:"thin",scrollbarColor:`${h} transparent`},readOnly:bt==="recording"||bt==="paused",disabled:Ee})]})}),(ae.trim()||Et.length!==0)&&T.jsx("div",{className:"w-min",children:T.jsx("button",{onClick:()=>Ut(),className:"w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200 transform hover:scale-105",style:{background:h,color:x},children:T.jsx(Gw,{className:"w-5 h-5"})})})]}),T.jsx("input",{ref:n,type:"file",multiple:!0,className:"hidden",accept:"image/*",onChange:O=>O.target.files&&ar(O.target.files,n)}),T.jsx("input",{ref:a,type:"file",multiple:!0,className:"hidden",accept:"video/*",onChange:O=>O.target.files&&ar(O.target.files,a)}),T.jsx("input",{ref:o,type:"file",multiple:!0,className:"hidden",accept:"audio/*",onChange:O=>O.target.files&&ar(O.target.files,o)}),T.jsx("input",{ref:l,type:"file",multiple:!0,className:"hidden",accept:".pdf,.doc,.docx,.txt,.csv,.xlsx,.ppt,.pptx,.zip,.rar",onChange:O=>O.target.files&&ar(O.target.files,l)})]}),ve&&T.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:()=>Me(!1),children:T.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, ${y}, ${h}, ${m})`,borderRadius:`${A}px`,borderColor:h},onClick:O=>O.stopPropagation(),children:[T.jsx("button",{onClick:()=>Me(!1),className:"absolute top-3 right-3 p-1 rounded-full transition-colors","aria-label":"Close bot info",style:{color:x},onMouseEnter:O=>O.currentTarget.style.background=h,onMouseLeave:O=>O.currentTarget.style.background="transparent",children:T.jsx(ko,{className:"w-5 h-5"})}),e?.bot?T.jsxs("div",{className:"flex flex-col gap-4",children:[T.jsxs("div",{className:"flex items-center gap-4",children:[T.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, ${h}, ${m})`,borderRadius:"1.5rem"},children:T.jsx("img",{src:Ci,alt:`${_a} logo`||"Bot avatar",className:"w-full h-full rounded-full",style:{borderRadius:"1.5rem"}})}),T.jsx("div",{className:"min-w-0",children:T.jsx("h3",{className:"text-lg font-semibold truncate",title:_a,style:{color:x},children:_a})})]}),u?.description&&T.jsx("div",{className:"max-h-40 overflow-y-auto pr-1 custom-scrollbar",children:T.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-line",style:{wordBreak:"break-word",color:x},children:u.description})}),T.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",style:{color:x},children:[Array.isArray(u?.phone_numbers)&&u.phone_numbers.length>0&&T.jsxs("div",{className:"flex flex-col gap-0.5",children:[T.jsxs("span",{className:"uppercase tracking-wide font-bold",style:{color:x},children:["Phone number",u.phone_numbers.length>1?"s":""]}),T.jsx("div",{className:"flex flex-col gap-1 flex-wrap",children:u.phone_numbers.map((O,ue)=>T.jsx("span",{className:"font-medium break-all",style:{color:x},children:O},ue))})]}),Array.isArray(u?.websites)&&u.websites.length>0&&T.jsxs("div",{className:"flex flex-col gap-0.5",children:[T.jsxs("span",{className:"uppercase tracking-wide font-bold",style:{color:x},children:["Website",u.websites.length>1?"s":""]}),T.jsx("div",{className:"flex flex-col gap-1 flex-wrap",children:u.websites.map((O,ue)=>T.jsx("a",{className:"break-all underline font-semibold",href:O,target:"_blank",rel:"noopener noreferrer",children:O},ue))})]}),Array.isArray(u?.emails)&&u.emails.length>0&&T.jsxs("div",{className:"flex flex-col gap-0.5",children:[T.jsxs("span",{className:"uppercase tracking-wide font-bold",style:{color:x},children:["Email",u.emails.length>1?"s":""]}),T.jsx("div",{className:"flex flex-col gap-1",children:u.emails.map((O,ue)=>T.jsx("span",{className:"font-medium break-all",style:{color:x},children:O},ue))})]})]})]}):T.jsxs("div",{className:"text-center",style:{color:x},children:[T.jsx("p",{className:"text-sm",children:"No bot selected."}),T.jsx("button",{type:"button",onClick:()=>Me(!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:`${A}px`},children:"Close"})]})]})}),ey&&T.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:()=>oa(!1),children:T.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, ${y}, ${h}, ${m})`,borderRadius:`${A}px`,borderColor:h},onClick:O=>O.stopPropagation(),children:[T.jsx("button",{onClick:()=>oa(!1),className:"absolute top-3 right-3 p-1 rounded-full transition-colors","aria-label":"Close reset chat",style:{color:x},onMouseEnter:O=>O.currentTarget.style.background=h,onMouseLeave:O=>O.currentTarget.style.background="transparent",children:T.jsx(ko,{className:"w-5 h-5"})}),T.jsx("h3",{className:"text-lg font-semibold mb-2 ",style:{color:x},children:"Reset Chat?"}),T.jsx("p",{className:"mb-4",style:{color:x},children:"Are you sure you want to reset the chat? This will clear all messages."}),T.jsxs("div",{className:"flex justify-end gap-2",children:[T.jsx("button",{className:"px-4 py-2 rounded bg-white/80 text-gray-900 hover:bg-white",onClick:()=>oa(!1),children:"Cancel"}),T.jsx("button",{className:"px-4 py-2 rounded bg-red-600 text-white hover:bg-red-700",onClick:async()=>{oa(!1),await $l()},children:"Confirm"})]})]})})]}),se==="middle-right"?T.jsx("div",{className:"fixed top-1/2 -translate-y-1/2",style:{right:"0",transform:tt?`translateX(-${we}px)`:"translateX(0)",transition:"transform 0.3s cubic-bezier(0.4,0,0.2,1)",zIndex:1e3},children:T.jsxs("button",{onClick:()=>{me(O=>!O),Kt.current=!tt,tt||_o()},className:"px-4 py-3 shadow-lg transform",style:{background:eu,borderTopLeftRadius:`${C}px`,borderBottomLeftRadius:`${U}px`,borderTopRightRadius:`${M}px`,borderBottomRightRadius:`${P}px`,zIndex:1e7},children:[T.jsx("img",{src:Ci,alt:"Tybot logo",className:"w-7 h-7"}),yn>0&&!tt?T.jsxs(T.Fragment,{children:[T.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}),T.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:yn>9?"9+":yn})]}):null]})}):T.jsxs("div",{ref:ne,className:`${tt?"hidden":"fixed"} rounded-full select-none`,style:{left:`${Ie.x}px`,top:`${Ie.y}px`,zIndex:999,cursor:Xe?"grabbing":"grab",animation:(yn>0||ze)&&!tt&&!Xe?"gentlePulse 2s ease-in-out infinite, smoothFloat 3s ease-in-out infinite":"none",transition:Xe?"none":"all 0.2s ease-out"},children:[ze&&!tt&&!Xe&&T.jsxs("div",{className:`absolute ${se==="bottom-right"?"bottom-[110%] right-2":se==="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:Xa,children:[T.jsx("div",{className:"flex items-center gap-2 w-full",children:T.jsx("div",{className:"flex-1",children:T.jsx("p",{className:"text-sm font-medium text-gray-900",children:T.jsx(jt,{sequence:[u?.widgetLoadBehavior?.message||"👋 Hey there! how can I help you?"],cursor:!1,speed:50})})})}),T.jsx("div",{className:`absolute ${se==="bottom-right"?"top-full right-6 border-l-[8px] border-r-[8px] border-t-[8px] border-l-transparent border-r-transparent":se==="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`})]}),T.jsxs("button",{onClick:Xa,onMouseDown:Ii,onTouchStart:Ql,className:"rounded-full size-[67px] p-1 shadow-lg transform",style:{background:eu,cursor:Xe?"grabbing":"grab"},onMouseEnter:O=>!Xe&&(O.currentTarget.style.transform="scale(0.95)"),onMouseLeave:O=>!Xe&&(O.currentTarget.style.transform="scale(1)"),children:[T.jsx("div",{className:"size-full overflow-hidden rounded-full",children:T.jsx("img",{src:Ci,alt:"Tybot logo",className:"w-full h-full"})}),yn>0&&!tt?T.jsxs(T.Fragment,{children:[T.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}),T.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:yn>9?"9+":yn})]}):null]})]})]})};function e6(e){const t="tybot-widget-container";let n=document.getElementById(t);n||(n=document.createElement("div"),n.id=t,document.body.appendChild(n));const a=n.shadowRoot??n.attachShadow({mode:"open"});if(!document.querySelector("#tybot-widget-fonts")){const d=document.createElement("link");d.rel="preconnect",d.href="https://fonts.googleapis.com";const p=document.createElement("link");p.rel="preconnect",p.href="https://fonts.gstatic.com",p.crossOrigin="";const f=document.createElement("link");f.id="tybot-widget-fonts",f.rel="stylesheet",f.href="https://fonts.googleapis.com/css2?family=Nunito:ital@0;1&display=swap",document.head.append(d),document.head.append(p),document.head.append(f)}if(!a.querySelector("#tybot-widget-style")){const d=document.createElement("style");d.id="tybot-widget-style",d.textContent=ED,a.appendChild(d)}const o=a.querySelector("#tybot-widget-root");o&&o.remove();const l=document.createElement("div");l.id="tybot-widget-root",a.appendChild(l),yD.createRoot(l).render(T.jsx($Y,{config:e}))}di.createTybotWidget=e6,Object.defineProperty(di,Symbol.toStringTag,{value:"Module"})});
|