react-sigma-chatbox 1.0.0 → 1.0.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.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(N,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],f):(N=typeof globalThis<"u"?globalThis:N||self,f(N.ReactSigmaChatbox={},N.React))})(this,(function(N,f){"use strict";var U={exports:{}},P={};/**
1
+ (function(k,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],g):(k=typeof globalThis<"u"?globalThis:k||self,g(k.ReactSigmaChatbox={},k.React))})(this,(function(k,g){"use strict";var F={exports:{}},M={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Q;function ae(){if(Q)return P;Q=1;var r=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function o(s,a,l){var m=null;if(l!==void 0&&(m=""+l),a.key!==void 0&&(m=""+a.key),"key"in a){l={};for(var i in a)i!=="key"&&(l[i]=a[i])}else l=a;return a=l.ref,{$$typeof:r,type:s,key:m,ref:a!==void 0?a:null,props:l}}return P.Fragment=d,P.jsx=o,P.jsxs=o,P}var M={};/**
9
+ */var Q;function ae(){if(Q)return M;Q=1;var r=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function o(s,l,c){var h=null;if(c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),"key"in l){c={};for(var i in l)i!=="key"&&(c[i]=l[i])}else c=l;return l=c.ref,{$$typeof:r,type:s,key:h,ref:l!==void 0?l:null,props:c}}return M.Fragment=u,M.jsx=o,M.jsxs=o,M}var L={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,14 +14,14 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Z;function oe(){return Z||(Z=1,process.env.NODE_ENV!=="production"&&(function(){function r(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===A?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case F:return"Profiler";case _:return"StrictMode";case D:return"Suspense";case J:return"SuspenseList";case T:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case R:return"Portal";case V:return t.displayName||"Context";case B:return(t._context.displayName||"Context")+".Consumer";case k:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case w:return n=t.displayName||null,n!==null?n:r(t.type)||"Memo";case v:n=t._payload,t=t._init;try{return r(t(n))}catch{}}return null}function d(t){return""+t}function o(t){try{d(t);var n=!1}catch{n=!0}if(n){n=console;var u=n.error,h=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return u.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",h),d(t)}}function s(t){if(t===E)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===v)return"<...>";try{var n=r(t);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function a(){var t=W.A;return t===null?null:t.getOwner()}function l(){return Error("react-stack-top-frame")}function m(t){if(O.call(t,"key")){var n=Object.getOwnPropertyDescriptor(t,"key").get;if(n&&n.isReactWarning)return!1}return t.key!==void 0}function i(t,n){function u(){ee||(ee=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}u.isReactWarning=!0,Object.defineProperty(t,"key",{get:u,configurable:!0})}function c(){var t=r(this.type);return te[t]||(te[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function p(t,n,u,h,X,G){var x=u.ref;return t={$$typeof:C,type:t,key:n,props:u,_owner:h},(x!==void 0?x:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:c}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function b(t,n,u,h,X,G){var x=n.children;if(x!==void 0)if(h)if(Y(x)){for(h=0;h<x.length;h++)S(x[h]);Object.freeze&&Object.freeze(x)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else S(x);if(O.call(n,"key")){x=r(t);var I=Object.keys(n).filter(function(fe){return fe!=="key"});h=0<I.length?"{key: someKey, "+I.join(": ..., ")+": ...}":"{key: someKey}",se[x+h]||(I=0<I.length?"{"+I.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var Z;function oe(){return Z||(Z=1,process.env.NODE_ENV!=="production"&&(function(){function r(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===O?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case R:return"Fragment";case X:return"Profiler";case C:return"StrictMode";case W:return"Suspense";case H:return"SuspenseList";case _:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case S:return"Portal";case V:return t.displayName||"Context";case B:return(t._context.displayName||"Context")+".Consumer";case T:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case y:return n=t.displayName||null,n!==null?n:r(t.type)||"Memo";case w:n=t._payload,t=t._init;try{return r(t(n))}catch{}}return null}function u(t){return""+t}function o(t){try{u(t);var n=!1}catch{n=!0}if(n){n=console;var m=n.error,f=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return m.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",f),u(t)}}function s(t){if(t===R)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===w)return"<...>";try{var n=r(t);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function l(){var t=Y.A;return t===null?null:t.getOwner()}function c(){return Error("react-stack-top-frame")}function h(t){if(I.call(t,"key")){var n=Object.getOwnPropertyDescriptor(t,"key").get;if(n&&n.isReactWarning)return!1}return t.key!==void 0}function i(t,n){function m(){ee||(ee=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}m.isReactWarning=!0,Object.defineProperty(t,"key",{get:m,configurable:!0})}function a(){var t=r(this.type);return te[t]||(te[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function d(t,n,m,f,z,$){var p=m.ref;return t={$$typeof:A,type:t,key:n,props:m,_owner:f},(p!==void 0?p:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:a}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:z}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:$}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function x(t,n,m,f,z,$){var p=n.children;if(p!==void 0)if(f)if(U(p)){for(f=0;f<p.length;f++)v(p[f]);Object.freeze&&Object.freeze(p)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else v(p);if(I.call(n,"key")){p=r(t);var P=Object.keys(n).filter(function(fe){return fe!=="key"});f=0<P.length?"{key: someKey, "+P.join(": ..., ")+": ...}":"{key: someKey}",se[p+f]||(P=0<P.length?"{"+P.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,h,x,I,x),se[x+h]=!0)}if(x=null,u!==void 0&&(o(u),x=""+u),m(n)&&(o(n.key),x=""+n.key),"key"in n){u={};for(var $ in n)$!=="key"&&(u[$]=n[$])}else u=n;return x&&i(u,typeof t=="function"?t.displayName||t.name||"Unknown":t),p(t,x,u,a(),X,G)}function S(t){L(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===v&&(t._payload.status==="fulfilled"?L(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function L(t){return typeof t=="object"&&t!==null&&t.$$typeof===C}var j=f,C=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),V=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),T=Symbol.for("react.activity"),A=Symbol.for("react.client.reference"),W=j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=Object.prototype.hasOwnProperty,Y=Array.isArray,H=console.createTask?console.createTask:function(){return null};j={react_stack_bottom_frame:function(t){return t()}};var ee,te={},re=j.react_stack_bottom_frame.bind(j,l)(),ne=H(s(l)),se={};M.Fragment=E,M.jsx=function(t,n,u){var h=1e4>W.recentlyCreatedOwnerStacks++;return b(t,n,u,!1,h?Error("react-stack-top-frame"):re,h?H(s(t)):ne)},M.jsxs=function(t,n,u){var h=1e4>W.recentlyCreatedOwnerStacks++;return b(t,n,u,!0,h?Error("react-stack-top-frame"):re,h?H(s(t)):ne)}})()),M}var K;function le(){return K||(K=1,process.env.NODE_ENV==="production"?U.exports=ae():U.exports=oe()),U.exports}var e=le(),y=(r=>(r.TEXT="text",r.PRODUCT_LIST="product_list",r.LOADING="loading",r))(y||{}),g=(r=>(r.USER="user",r.AI="ai",r))(g||{});const ie=({title:r,primaryColor:d,onClose:o,onReset:s,onToggleExpand:a,isExpanded:l,language:m,onLanguageChange:i})=>{const c=[{value:"en",label:"EN"},{value:"vi",label:"VI"},{value:"ja",label:"JA"}];return e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between border-b border-red-50/50 sticky top-0 z-10 bg-[#fff1f2]/90 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-full overflow-hidden bg-white p-0.5 shadow-sm",children:e.jsx("img",{src:"https://fptshop.com.vn/img/bitu/bitu-avatar.png",onError:p=>p.currentTarget.src="https://cdn-icons-png.flaticon.com/512/4712/4712035.png",className:"w-full h-full object-contain",alt:"Bot Icon"})}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("h3",{className:"font-bold text-[#1a2b56] text-[14px] leading-tight tracking-tight flex items-center gap-1",children:[r," ",e.jsx("span",{className:"text-red-400 text-[10px]",children:"✨"})]}),e.jsxs("span",{className:"text-[10px] text-green-500 font-medium flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse"}),"Online"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("div",{className:"relative group mr-1",children:[e.jsx("select",{value:m,onChange:p=>i(p.target.value),className:"appearance-none bg-white/50 border border-gray-200 rounded-lg px-2 pr-5 py-1 text-[10px] font-black text-indigo-600 cursor-pointer hover:bg-white transition-all focus:outline-none focus:ring-2 focus:ring-indigo-100 uppercase",title:"Select language",children:c.map(p=>e.jsx("option",{value:p.value,className:"font-sans font-bold",children:p.label},p.value))}),e.jsx("div",{className:"absolute right-1.5 top-1/2 -translate-y-1/2 pointer-events-none text-indigo-400",children:e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),e.jsx("button",{onClick:s,className:"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-white/60 text-gray-500 hover:text-indigo-600 transition-all",title:"Reset chat",children:e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),e.jsx("path",{d:"M21 3v5h-5"}),e.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),e.jsx("path",{d:"M8 16H3v5"})]})}),e.jsx("button",{onClick:a,className:"w-8 h-8 hidden md:flex items-center justify-center rounded-lg hover:bg-white/60 text-gray-500 hover:text-indigo-600 transition-all",title:l?"Collapse":"Expand",children:l?e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M4 14h6v6"}),e.jsx("path",{d:"M20 10h-6V4"}),e.jsx("path",{d:"M14 10l7-7"}),e.jsx("path",{d:"M10 14l-7 7"})]}):e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M15 3h6v6"}),e.jsx("path",{d:"M9 21H3v-6"}),e.jsx("path",{d:"M21 3l-7 7"}),e.jsx("path",{d:"M3 21l7-7"})]})}),e.jsx("button",{onClick:o,className:"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-red-50 text-gray-500 hover:text-red-500 transition-all",title:"Close",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"M6 6l12 12"})]})})]})]})},ce=({product:r,primaryColor:d})=>e.jsxs("div",{className:"min-w-[170px] max-w-[170px] bg-white rounded-xl border border-gray-50 shadow-sm overflow-hidden flex flex-col hover:shadow-lg transition-all duration-300 group",children:[e.jsxs("div",{className:"relative h-32 w-full bg-white flex items-center justify-center p-2",children:[e.jsx("img",{src:r.image,alt:r.name,className:"h-full w-full object-contain group-hover:scale-105 transition-transform duration-500"}),r.discount&&e.jsx("div",{className:"absolute top-2 left-2 bg-red-600 text-white text-[9px] font-bold px-1.5 py-0.5 rounded-md shadow-sm",children:r.discount})]}),e.jsxs("div",{className:"p-3 flex-1 flex flex-col justify-between border-t border-gray-50",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-[11px] font-bold text-gray-800 line-clamp-2 min-h-[30px] mb-1.5 group-hover:text-red-600 transition-colors",children:r.name}),e.jsxs("div",{className:"mb-2",children:[e.jsx("span",{className:"text-red-600 font-extrabold text-[13px]",children:r.price}),r.oldPrice&&e.jsx("span",{className:"text-[10px] text-gray-400 line-through ml-1 block opacity-60",children:r.oldPrice})]})]}),e.jsx("button",{className:"w-full py-1.5 rounded-lg text-[11px] font-bold border transition-all duration-300 active:scale-95 shadow-sm",style:{borderColor:d,color:d},onMouseEnter:o=>{o.currentTarget.style.backgroundColor=d,o.currentTarget.style.color="white"},onMouseLeave:o=>{o.currentTarget.style.backgroundColor="transparent",o.currentTarget.style.color=d},children:"Chọn mua"})]})]}),z=r=>{const d=/(\*\*.*?\*\*|\[.*?\]\(.*?\))/g;return r.split(d).map((s,a)=>{if(s.startsWith("**")&&s.endsWith("**")){const m=s.slice(2,-2);return e.jsx("strong",{className:"font-bold text-gray-900",children:m},a)}const l=s.match(/\[(.*?)\]\((.*?)\)/);if(l){const[m,i,c]=l;return e.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline break-all font-semibold",children:i},a)}return s})},de=({text:r})=>{const d=r.split(`
23
- `);return e.jsx("div",{className:"markdown-body space-y-1.5",children:d.map((o,s)=>{const a=o.trim(),l=a.match(/^(#{1,4})\s+(.*)$/);if(l){const i=l[1].length,c=l[2],p=i===1?"text-lg font-bold mb-3 mt-1":i===2?"text-md font-bold mb-2 mt-1":"text-[14px] font-bold mb-1.5 mt-0.5 text-gray-900 uppercase tracking-wide";return e.jsx("div",{className:p,children:z(c)},s)}const m=a.match(/^[*+-]\s+(.*)$/);if(m){const i=m[1];return e.jsxs("div",{className:"flex gap-2.5 pl-1 mb-2 items-start",children:[e.jsx("span",{className:"text-gray-400 flex-shrink-0 mt-1.5 w-1 h-1 bg-gray-400 rounded-full"}),e.jsx("div",{className:"flex-1 leading-relaxed text-gray-800",children:z(i)})]},s)}return a===""?e.jsx("div",{className:"h-3"},s):e.jsx("div",{className:"mb-1 leading-relaxed text-gray-800",children:z(o)},s)})})},ue=({messages:r,isLoading:d,quickReplies:o,onQuickReply:s,primaryColor:a,renderMarkdown:l=!1})=>{const m="https://fptshop.com.vn/img/bitu/bitu-avatar.png",i="https://cdn-icons-png.flaticon.com/512/4712/4712035.png";return e.jsxs("div",{className:"flex flex-col gap-8 pb-4",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center animate-msg",children:[e.jsx("div",{className:"relative mb-5",children:e.jsx("div",{className:"w-24 h-24 flex items-center justify-center",children:e.jsx("img",{src:m,onError:c=>c.currentTarget.src=i,className:"w-full h-full object-contain",alt:"Sigma AI Hero"})})}),e.jsxs("h2",{className:"text-xl font-bold text-[#1a2b56] flex items-center justify-center gap-1",children:["Sigma ",e.jsx("span",{className:"bg-indigo-600 text-white text-[10px] px-1.5 py-0.5 rounded-md leading-none ml-1 uppercase font-bold tracking-tight",children:"AI"})]}),e.jsxs("div",{className:"text-[14px] text-gray-600 mt-3 leading-relaxed px-4",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-bold text-gray-800",children:"Sigma Assistant"})," hỗ trợ bạn mọi lúc mọi nơi"]}),e.jsx("p",{children:"Tăng cường hiệu suất với AI thông minh"})]})]}),r.map((c,p)=>e.jsxs("div",{className:`flex flex-col animate-msg ${c.sender===g.USER?"items-end":"items-start"}`,style:{animationDelay:`${p*.05}s`},children:[c.sender===g.AI&&e.jsxs("div",{className:"flex items-center gap-1.5 mb-2 ml-1",children:[e.jsx("img",{src:m,onError:b=>b.currentTarget.src=i,className:"w-4 h-4 object-contain",alt:"AI"}),e.jsx("span",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-widest",children:"AI Agent"})]}),e.jsxs("div",{className:`flex flex-col ${c.sender===g.USER?"items-end":"items-start"} max-w-[94%]`,children:[e.jsx("div",{className:`px-4 py-3 rounded-[18px] text-[14px] shadow-sm border border-black/[0.03] ${c.sender===g.USER?"bg-indigo-600 text-white rounded-tr-none whitespace-pre-line shadow-indigo-100":"bg-white text-gray-800 border-none rounded-tl-none"} ${!l||c.sender===g.USER?"whitespace-pre-line":""}`,children:l&&c.sender===g.AI?e.jsx(de,{text:c.content}):c.content}),c.type===y.PRODUCT_LIST&&c.products&&e.jsx("div",{className:"w-full mt-4 flex gap-4 overflow-x-auto pb-4 pt-1 no-scrollbar snap-x",children:c.products.map(b=>e.jsx("div",{className:"product-card-snap",children:e.jsx(ce,{product:b,primaryColor:a})},b.id))}),p===0&&r.length===1&&c.sender===g.AI&&e.jsx("div",{className:"mt-5 flex flex-wrap gap-2.5 w-full",children:o.map((b,S)=>e.jsx("button",{onClick:()=>s(b),className:"px-4 py-2 rounded-full text-[13px] font-semibold border border-transparent bg-white text-gray-600 hover:text-indigo-600 hover:border-indigo-100 transition-all duration-200 shadow-sm active:scale-95",children:b},S))})]})]},c.id)),d&&e.jsxs("div",{className:"flex flex-col gap-1.5 items-start animate-msg",children:[e.jsx("div",{className:"flex items-center gap-1.5 ml-1",children:e.jsx("img",{src:m,onError:c=>c.currentTarget.src=i,className:"w-4 h-4 object-contain",alt:"AI Loading"})}),e.jsxs("div",{className:"flex gap-1.5 bg-white px-4 py-3 rounded-[18px] rounded-tl-none border-none shadow-sm",children:[e.jsx("span",{className:"w-2 h-2 bg-indigo-300 rounded-full animate-sigma-bounce"}),e.jsx("span",{className:"w-2 h-2 bg-indigo-300 rounded-full animate-sigma-bounce [animation-delay:0.2s]"}),e.jsx("span",{className:"w-2 h-2 bg-indigo-300 rounded-full animate-sigma-bounce [animation-delay:0.4s]"})]})]})]})},me=({placeholder:r,onSendMessage:d,primaryColor:o})=>{const[s,a]=f.useState(""),l=()=>{s.trim()&&(d(s),a(""))},m=i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),l())};return e.jsx("div",{className:"p-1",children:e.jsxs("div",{className:"relative flex items-center bg-gray-50/50 rounded-2xl border border-gray-100 focus-within:border-indigo-100 focus-within:bg-white transition-all duration-200 pr-2 pl-3 py-1",children:[e.jsx("textarea",{value:s,onChange:i=>a(i.target.value),onKeyDown:m,placeholder:r,rows:1,className:"w-full bg-transparent border-none outline-none focus:ring-0 text-[14px] text-gray-700 font-normal py-3 px-1 resize-none chat-scrollbar min-h-[44px] max-h-[120px] leading-relaxed placeholder:text-gray-400",style:{fontWeight:400}}),e.jsx("button",{onClick:l,disabled:!s.trim(),className:`w-9 h-9 rounded-xl flex-shrink-0 flex items-center justify-center transition-all duration-300 shadow-sm ${s.trim()?"bg-indigo-600 text-white hover:bg-indigo-700 active:scale-95":"bg-gray-200 text-gray-400 cursor-not-allowed"}`,children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"m5 12 7-7 7 7"}),e.jsx("path",{d:"M12 19V5"})]})})]})})},he=({isOpen:r,onClick:d,primaryColor:o,className:s=""})=>e.jsx("div",{className:`fixed bottom-4 right-4 md:bottom-6 md:right-6 z-[100] ${s}`,children:e.jsx("button",{onClick:d,className:`w-12 h-12 bg-white rounded-2xl shadow-lg flex items-center justify-center border transition-all duration-300 overflow-hidden ${r?"border-indigo-500 ring-4 ring-indigo-50 scale-105 rotate-0":"border-slate-100 hover:scale-110 hover:shadow-xl"}`,children:e.jsx("img",{src:"https://fptshop.com.vn/img/bitu/bitu-avatar.png",className:"w-10 h-10 object-contain",alt:"Bitu",onError:a=>a.currentTarget.src="https://cdn-icons-png.flaticon.com/512/4712/4712035.png"})})}),q=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),xe=({config:r,onGetAiResponse:d})=>{const[o,s]=f.useState(!1),[a,l]=f.useState(!1),[m,i]=f.useState(!1),[c,p]=f.useState(q()),[b,S]=f.useState("en"),[L,j]=f.useState([{id:"welcome",type:y.TEXT,sender:g.AI,content:r.welcomeMessage,timestamp:new Date}]),[C,R]=f.useState(!1),E=f.useRef(null),_=f.useRef(0);f.useEffect(()=>{if(o){const k=setTimeout(()=>i(!0),50);return()=>clearTimeout(k)}else i(!1)},[o]),f.useEffect(()=>{E.current&&o&&(E.current.scrollTop=E.current.scrollHeight)},[L,o,C]);const F=async k=>{if(!k.trim()||C)return;const D=++_.current,J={id:`user-${Date.now()}`,type:y.TEXT,sender:g.USER,content:k,timestamp:new Date};j(w=>[...w,J]),R(!0);try{const w=d(k,c,b);if(w&&typeof w=="object"&&Symbol.asyncIterator in w){let v="",T=!1;const A=`ai-${Date.now()}`;for await(const W of w){if(D!==_.current)return;T||(j(O=>[...O,{id:A,type:y.TEXT,sender:g.AI,content:"",timestamp:new Date}]),R(!1),T=!0),v+=W,j(O=>O.map(Y=>Y.id===A?{...Y,content:v}:Y))}}else{const v=await w;if(D!==_.current)return;R(!1);const T=typeof v=="string"?{text:v,products:void 0}:v;j(A=>[...A,{id:`ai-${Date.now()}`,type:T.products?y.PRODUCT_LIST:y.TEXT,sender:g.AI,content:T.text,products:T.products,timestamp:new Date}])}}catch(w){if(D!==_.current)return;console.error("Chatbox Error:",w),R(!1),j(v=>[...v,{id:`err-${Date.now()}`,type:y.TEXT,sender:g.AI,content:"Hệ thống đang bận, vui lòng thử lại sau.",timestamp:new Date}])}},B=()=>{_.current++,p(q()),j([{id:"welcome",type:y.TEXT,sender:g.AI,content:r.welcomeMessage,timestamp:new Date}]),R(!1),l(!1)},V=`
22
+ <%s key={someKey} {...props} />`,f,p,P,p),se[p+f]=!0)}if(p=null,m!==void 0&&(o(m),p=""+m),h(n)&&(o(n.key),p=""+n.key),"key"in n){m={};for(var G in n)G!=="key"&&(m[G]=n[G])}else m=n;return p&&i(m,typeof t=="function"?t.displayName||t.name||"Unknown":t),d(t,p,m,l(),z,$)}function v(t){E(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===w&&(t._payload.status==="fulfilled"?E(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function E(t){return typeof t=="object"&&t!==null&&t.$$typeof===A}var j=g,A=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),V=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),O=Symbol.for("react.client.reference"),Y=j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=Object.prototype.hasOwnProperty,U=Array.isArray,J=console.createTask?console.createTask:function(){return null};j={react_stack_bottom_frame:function(t){return t()}};var ee,te={},re=j.react_stack_bottom_frame.bind(j,c)(),ne=J(s(c)),se={};L.Fragment=R,L.jsx=function(t,n,m){var f=1e4>Y.recentlyCreatedOwnerStacks++;return x(t,n,m,!1,f?Error("react-stack-top-frame"):re,f?J(s(t)):ne)},L.jsxs=function(t,n,m){var f=1e4>Y.recentlyCreatedOwnerStacks++;return x(t,n,m,!0,f?Error("react-stack-top-frame"):re,f?J(s(t)):ne)}})()),L}var K;function le(){return K||(K=1,process.env.NODE_ENV==="production"?F.exports=ae():F.exports=oe()),F.exports}var e=le(),N=(r=>(r.TEXT="text",r.PRODUCT_LIST="product_list",r.LOADING="loading",r))(N||{}),b=(r=>(r.USER="user",r.AI="ai",r))(b||{});const ie=({title:r,primaryColor:u,onClose:o,onReset:s,onToggleExpand:l,isExpanded:c,language:h,onLanguageChange:i})=>{const a=[{value:"en",label:"EN"},{value:"vi",label:"VI"},{value:"ja",label:"JA"}];return e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between border-b border-red-50/50 sticky top-0 z-10 bg-[#fff1f2]/90 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-full overflow-hidden bg-white p-0.5 shadow-sm",children:e.jsx("img",{src:"https://fptshop.com.vn/img/bitu/bitu-avatar.png",onError:d=>d.currentTarget.src="https://cdn-icons-png.flaticon.com/512/4712/4712035.png",className:"w-full h-full object-contain",alt:"Bot Icon"})}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("h3",{className:"font-bold text-[#1a2b56] text-[14px] leading-tight tracking-tight flex items-center gap-1",children:[r," ",e.jsx("span",{className:"text-red-400 text-[10px]",children:"✨"})]}),e.jsxs("span",{className:"text-[10px] text-green-500 font-medium flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse"}),"Online"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("div",{className:"relative group mr-1",children:[e.jsx("select",{value:h,onChange:d=>i(d.target.value),className:"appearance-none bg-white/50 border border-gray-200 rounded-lg px-2 pr-5 py-1 text-[10px] font-black text-indigo-600 cursor-pointer hover:bg-white transition-all focus:outline-none focus:ring-2 focus:ring-indigo-100 uppercase",title:"Select language",children:a.map(d=>e.jsx("option",{value:d.value,className:"font-sans font-bold",children:d.label},d.value))}),e.jsx("div",{className:"absolute right-1.5 top-1/2 -translate-y-1/2 pointer-events-none text-indigo-400",children:e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),e.jsx("button",{onClick:s,className:"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-white/60 text-gray-500 hover:text-indigo-600 transition-all",title:"Reset chat",children:e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),e.jsx("path",{d:"M21 3v5h-5"}),e.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),e.jsx("path",{d:"M8 16H3v5"})]})}),e.jsx("button",{onClick:l,className:"w-8 h-8 hidden md:flex items-center justify-center rounded-lg hover:bg-white/60 text-gray-500 hover:text-indigo-600 transition-all",title:c?"Collapse":"Expand",children:c?e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M4 14h6v6"}),e.jsx("path",{d:"M20 10h-6V4"}),e.jsx("path",{d:"M14 10l7-7"}),e.jsx("path",{d:"M10 14l-7 7"})]}):e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M15 3h6v6"}),e.jsx("path",{d:"M9 21H3v-6"}),e.jsx("path",{d:"M21 3l-7 7"}),e.jsx("path",{d:"M3 21l7-7"})]})}),e.jsx("button",{onClick:o,className:"w-8 h-8 flex items-center justify-center rounded-lg hover:bg-red-50 text-gray-500 hover:text-red-500 transition-all",title:"Close",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"M6 6l12 12"})]})})]})]})},ce=({product:r,primaryColor:u})=>e.jsxs("div",{className:"min-w-[170px] max-w-[170px] bg-white rounded-xl border border-gray-50 shadow-sm overflow-hidden flex flex-col hover:shadow-lg transition-all duration-300 group",children:[e.jsxs("div",{className:"relative h-32 w-full bg-white flex items-center justify-center p-2",children:[e.jsx("img",{src:r.image,alt:r.name,className:"h-full w-full object-contain group-hover:scale-105 transition-transform duration-500"}),r.discount&&e.jsx("div",{className:"absolute top-2 left-2 bg-red-600 text-white text-[9px] font-bold px-1.5 py-0.5 rounded-md shadow-sm",children:r.discount})]}),e.jsxs("div",{className:"p-3 flex-1 flex flex-col justify-between border-t border-gray-50",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-[11px] font-bold text-gray-800 line-clamp-2 min-h-[30px] mb-1.5 group-hover:text-red-600 transition-colors",children:r.name}),e.jsxs("div",{className:"mb-2",children:[e.jsx("span",{className:"text-red-600 font-extrabold text-[13px]",children:r.price}),r.oldPrice&&e.jsx("span",{className:"text-[10px] text-gray-400 line-through ml-1 block opacity-60",children:r.oldPrice})]})]}),e.jsx("button",{className:"w-full py-1.5 rounded-lg text-[11px] font-bold border transition-all duration-300 active:scale-95 shadow-sm",style:{borderColor:u,color:u},onMouseEnter:o=>{o.currentTarget.style.backgroundColor=u,o.currentTarget.style.color="white"},onMouseLeave:o=>{o.currentTarget.style.backgroundColor="transparent",o.currentTarget.style.color=u},children:"Chọn mua"})]})]}),D=r=>{const u=/(\*\*.*?\*\*|\[.*?\]\(.*?\))/g;return r.split(u).map((s,l)=>{if(s.startsWith("**")&&s.endsWith("**")){const h=s.slice(2,-2);return e.jsx("strong",{className:"font-bold text-gray-900",children:h},l)}const c=s.match(/\[(.*?)\]\((.*?)\)/);if(c){const[h,i,a]=c;return e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline break-all font-semibold",children:i},l)}return s})},de=({text:r})=>{const u=r.split(`
23
+ `),o=[];let s=[],l=!1;const c=h=>{if(s.length>0){const a=s.length>1&&s[1].every(d=>d.trim().match(/^:?-+:?$/))?[s[0],...s.slice(2)]:s;o.push(e.jsx("div",{className:"my-4 overflow-x-auto border border-gray-200 rounded-lg shadow-sm bg-white",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200 text-[13px]",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsx("tr",{children:a[0].map((d,x)=>e.jsx("th",{className:"px-3 py-2 text-left font-bold text-gray-700 border-r last:border-r-0 border-gray-200",children:D(d.trim())},x))})}),e.jsx("tbody",{className:"divide-y divide-gray-100 bg-white",children:a.slice(1).map((d,x)=>e.jsx("tr",{className:"hover:bg-gray-50/50 transition-colors",children:d.map((v,E)=>e.jsx("td",{className:"px-3 py-2 text-gray-600 border-r last:border-r-0 border-gray-200 align-top",children:D(v.trim())},E))},x))})]})},`table-${h}`)),s=[],l=!1}};return u.forEach((h,i)=>{const a=h.trim();if(a.startsWith("|")&&a.endsWith("|")){const v=a.split("|").slice(1,-1);s.push(v),l=!0;return}else l&&c(i);const d=a.match(/^(#{1,4})\s+(.*)$/);if(d){const v=d[1].length,E=d[2],j=v===1?"text-lg font-bold mb-3 mt-4 first:mt-1":v===2?"text-md font-bold mb-2 mt-3":"text-[13px] font-black mb-1.5 mt-4 text-indigo-600 uppercase tracking-widest";o.push(e.jsx("div",{className:j,children:D(E)},i));return}const x=a.match(/^[*+-]\s+(.*)$/);if(x){const v=x[1];o.push(e.jsxs("div",{className:"flex gap-2.5 pl-1 mb-1.5 items-start",children:[e.jsx("span",{className:"text-indigo-400 flex-shrink-0 mt-2 w-1.5 h-1.5 bg-indigo-400 rounded-full"}),e.jsx("div",{className:"flex-1 leading-relaxed text-gray-800",children:D(v)})]},i));return}if(a===""){o.push(e.jsx("div",{className:"h-2"},i));return}o.push(e.jsx("div",{className:"mb-1 leading-relaxed text-gray-800",children:D(h)},i))}),l&&c(u.length),e.jsx("div",{className:"markdown-body text-[14px]",children:o})},ue=({messages:r,isLoading:u,quickReplies:o,onQuickReply:s,primaryColor:l,renderMarkdown:c=!1})=>{const h="https://fptshop.com.vn/img/bitu/bitu-avatar.png",i="https://cdn-icons-png.flaticon.com/512/4712/4712035.png";return e.jsxs("div",{className:"flex flex-col gap-8 pb-4",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center animate-msg",children:[e.jsx("div",{className:"relative mb-5",children:e.jsx("div",{className:"w-20 h-20 flex items-center justify-center",children:e.jsx("img",{src:h,onError:a=>a.currentTarget.src=i,className:"w-full h-full object-contain",alt:"Sigma AI Hero"})})}),e.jsxs("h2",{className:"text-xl font-bold text-[#1a2b56] flex items-center justify-center gap-1",children:["Sigma ",e.jsx("span",{className:"bg-indigo-600 text-white text-[10px] px-1.5 py-0.5 rounded-md leading-none ml-1 uppercase font-bold tracking-tight",children:"AI"})]}),e.jsx("div",{className:"text-[14px] text-gray-600 mt-3 leading-relaxed px-4 max-w-[280px]",children:e.jsxs("p",{children:[e.jsx("span",{className:"font-bold text-gray-800",children:"Sigma Assistant"})," hỗ trợ bạn mọi lúc mọi nơi"]})})]}),r.map((a,d)=>e.jsxs("div",{className:`flex flex-col animate-msg ${a.sender===b.USER?"items-end":"items-start"}`,style:{animationDelay:`${d*.05}s`},children:[a.sender===b.AI&&e.jsxs("div",{className:"flex items-center gap-1.5 mb-2 ml-1",children:[e.jsx("img",{src:h,onError:x=>x.currentTarget.src=i,className:"w-4 h-4 object-contain",alt:"AI"}),e.jsx("span",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-widest",children:"AI Agent"})]}),e.jsxs("div",{className:`flex flex-col ${a.sender===b.USER?"items-end":"items-start"} max-w-[96%]`,children:[e.jsx("div",{className:`px-4 py-3 rounded-[20px] shadow-sm border border-black/[0.02] ${a.sender===b.USER?"bg-indigo-600 text-white rounded-tr-none whitespace-pre-line shadow-indigo-100":"bg-white text-gray-800 border-none rounded-tl-none"} ${!c||a.sender===b.USER?"whitespace-pre-line":""}`,children:c&&a.sender===b.AI?e.jsx(de,{text:a.content}):a.content}),a.type===N.PRODUCT_LIST&&a.products&&e.jsx("div",{className:"w-full mt-4 flex gap-4 overflow-x-auto pb-4 pt-1 no-scrollbar snap-x",children:a.products.map(x=>e.jsx("div",{className:"product-card-snap",children:e.jsx(ce,{product:x,primaryColor:l})},x.id))}),d===0&&r.length===1&&a.sender===b.AI&&e.jsx("div",{className:"mt-5 flex flex-wrap gap-2.5 w-full",children:o.map((x,v)=>e.jsx("button",{onClick:()=>s(x),className:"px-4 py-2 rounded-full text-[13px] font-semibold border border-transparent bg-white text-gray-600 hover:text-indigo-600 hover:border-indigo-100 transition-all duration-200 shadow-sm active:scale-95",children:x},v))})]})]},a.id)),u&&e.jsxs("div",{className:"flex flex-col gap-1.5 items-start animate-msg",children:[e.jsx("div",{className:"flex items-center gap-1.5 ml-1",children:e.jsx("img",{src:h,onError:a=>a.currentTarget.src=i,className:"w-4 h-4 object-contain",alt:"AI Loading"})}),e.jsxs("div",{className:"flex gap-1.5 bg-white px-4 py-3 rounded-[18px] rounded-tl-none border-none shadow-sm",children:[e.jsx("span",{className:"w-2 h-2 bg-indigo-300 rounded-full animate-sigma-bounce"}),e.jsx("span",{className:"w-2 h-2 bg-indigo-300 rounded-full animate-sigma-bounce [animation-delay:0.2s]"}),e.jsx("span",{className:"w-2 h-2 bg-indigo-300 rounded-full animate-sigma-bounce [animation-delay:0.4s]"})]})]})]})},he=({placeholder:r,onSendMessage:u,primaryColor:o})=>{const[s,l]=g.useState(""),c=()=>{s.trim()&&(u(s),l(""))},h=i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),c())};return e.jsx("div",{className:"p-1",children:e.jsxs("div",{className:"relative flex items-center bg-gray-50/50 rounded-2xl border border-gray-100 focus-within:border-indigo-100 focus-within:bg-white transition-all duration-200 pr-2 pl-3 py-1",children:[e.jsx("textarea",{value:s,onChange:i=>l(i.target.value),onKeyDown:h,placeholder:r,rows:1,className:"w-full bg-transparent border-none outline-none focus:ring-0 text-[14px] text-gray-700 font-normal py-3 px-1 resize-none chat-scrollbar min-h-[44px] max-h-[120px] leading-relaxed placeholder:text-gray-400",style:{fontWeight:400}}),e.jsx("button",{onClick:c,disabled:!s.trim(),className:`w-9 h-9 rounded-xl flex-shrink-0 flex items-center justify-center transition-all duration-300 shadow-sm ${s.trim()?"bg-indigo-600 text-white hover:bg-indigo-700 active:scale-95":"bg-gray-200 text-gray-400 cursor-not-allowed"}`,children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"m5 12 7-7 7 7"}),e.jsx("path",{d:"M12 19V5"})]})})]})})},me=({isOpen:r,onClick:u,primaryColor:o,className:s=""})=>e.jsx("div",{className:`fixed bottom-4 right-4 md:bottom-6 md:right-6 z-[100] ${s}`,children:e.jsx("button",{onClick:u,className:`w-12 h-12 bg-white rounded-2xl shadow-lg flex items-center justify-center border transition-all duration-300 overflow-hidden ${r?"border-indigo-500 ring-4 ring-indigo-50 scale-105 rotate-0":"border-slate-100 hover:scale-110 hover:shadow-xl"}`,children:e.jsx("img",{src:"https://fptshop.com.vn/img/bitu/bitu-avatar.png",className:"w-10 h-10 object-contain",alt:"Bitu",onError:l=>l.currentTarget.src="https://cdn-icons-png.flaticon.com/512/4712/4712035.png"})})}),q=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),xe=({config:r,onGetAiResponse:u})=>{const[o,s]=g.useState(!1),[l,c]=g.useState(!1),[h,i]=g.useState(!1),[a,d]=g.useState(q()),[x,v]=g.useState("en"),[E,j]=g.useState([{id:"welcome",type:N.TEXT,sender:b.AI,content:r.welcomeMessage,timestamp:new Date}]),[A,S]=g.useState(!1),R=g.useRef(null),C=g.useRef(0);g.useEffect(()=>{if(o){const T=setTimeout(()=>i(!0),50);return()=>clearTimeout(T)}else i(!1)},[o]),g.useEffect(()=>{R.current&&o&&(R.current.scrollTop=R.current.scrollHeight)},[E,o,A]);const X=async T=>{if(!T.trim()||A)return;const W=++C.current,H={id:`user-${Date.now()}`,type:N.TEXT,sender:b.USER,content:T,timestamp:new Date};j(y=>[...y,H]),S(!0);try{const y=u(T,a,x);if(y&&typeof y=="object"&&Symbol.asyncIterator in y){let w="",_=!1;const O=`ai-${Date.now()}`;for await(const Y of y){if(W!==C.current)return;_||(j(I=>[...I,{id:O,type:N.TEXT,sender:b.AI,content:"",timestamp:new Date}]),S(!1),_=!0),w+=Y,j(I=>I.map(U=>U.id===O?{...U,content:w}:U))}}else{const w=await y;if(W!==C.current)return;S(!1);const _=typeof w=="string"?{text:w,products:void 0}:w;j(O=>[...O,{id:`ai-${Date.now()}`,type:_.products?N.PRODUCT_LIST:N.TEXT,sender:b.AI,content:_.text,products:_.products,timestamp:new Date}])}}catch(y){if(W!==C.current)return;console.error("Chatbox Error:",y),S(!1),j(w=>[...w,{id:`err-${Date.now()}`,type:N.TEXT,sender:b.AI,content:"Hệ thống đang bận, vui lòng thử lại sau.",timestamp:new Date}])}},B=()=>{C.current++,d(q()),j([{id:"welcome",type:N.TEXT,sender:b.AI,content:r.welcomeMessage,timestamp:new Date}]),S(!1),c(!1)},V=`
24
24
  fixed z-[99] overflow-hidden flex flex-col border border-white/40 shadow-2xl bg-white animate-chat-pop
25
- ${m?"transition-[width,height,border-radius,right,bottom] duration-300 ease-in-out":""}
26
- ${a?"bottom-0 right-0 w-full h-full md:bottom-6 md:right-28 md:w-[850px] md:h-[85vh] rounded-none md:rounded-[32px]":"bottom-0 right-0 w-full h-[80vh] md:bottom-6 md:right-28 md:w-[380px] md:h-[580px] rounded-t-[28px] md:rounded-[28px]"}
27
- `;return e.jsxs(e.Fragment,{children:[e.jsx(he,{isOpen:o,onClick:()=>s(!o),primaryColor:r.primaryColor,className:o?"hidden md:flex":"flex"}),o&&e.jsxs("div",{className:V,style:{left:"auto"},children:[e.jsx(ie,{title:r.botName,primaryColor:r.primaryColor,onClose:()=>s(!1),onReset:B,onToggleExpand:()=>l(!a),isExpanded:a,language:b,onLanguageChange:S}),e.jsx("div",{className:"flex-1 overflow-y-auto chat-scrollbar px-5 py-5 bg-slate-50/30",ref:E,children:e.jsx(ue,{messages:L,isLoading:C,quickReplies:r.quickReplies,onQuickReply:k=>F(k),primaryColor:r.primaryColor,renderMarkdown:r.renderMarkdown})}),e.jsx("div",{className:"bg-white p-3 border-t border-slate-100",children:e.jsx(me,{placeholder:r.placeholder,onSendMessage:F,primaryColor:r.primaryColor})})]})]})};N.Chatbox=xe,N.MessageType=y,N.SenderType=g,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})}));
25
+ ${h?"transition-[width,height,border-radius,right,bottom] duration-300 ease-in-out":""}
26
+ ${l?"bottom-0 right-0 w-full h-full md:bottom-6 md:right-28 md:w-[850px] md:h-[85vh] rounded-none md:rounded-[32px]":"bottom-0 right-0 w-full h-[80vh] md:bottom-6 md:right-28 md:w-[380px] md:h-[580px] rounded-t-[28px] md:rounded-[28px]"}
27
+ `;return e.jsxs(e.Fragment,{children:[e.jsx(me,{isOpen:o,onClick:()=>s(!o),primaryColor:r.primaryColor,className:o?"hidden md:flex":"flex"}),o&&e.jsxs("div",{className:V,style:{left:"auto"},children:[e.jsx(ie,{title:r.botName,primaryColor:r.primaryColor,onClose:()=>s(!1),onReset:B,onToggleExpand:()=>c(!l),isExpanded:l,language:x,onLanguageChange:v}),e.jsx("div",{className:"flex-1 overflow-y-auto chat-scrollbar px-5 py-5 bg-slate-50/30",ref:R,children:e.jsx(ue,{messages:E,isLoading:A,quickReplies:r.quickReplies,onQuickReply:T=>X(T),primaryColor:r.primaryColor,renderMarkdown:r.renderMarkdown})}),e.jsx("div",{className:"bg-white p-3 border-t border-slate-100",children:e.jsx(he,{placeholder:r.placeholder,onSendMessage:X,primaryColor:r.primaryColor})})]})]})};k.Chatbox=xe,k.MessageType=N,k.SenderType=b,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}));
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import le, { useState as E, useRef as ee, useEffect as te } from "react";
2
- var U = { exports: {} }, $ = {};
1
+ import le, { useState as R, useRef as ee, useEffect as te } from "react";
2
+ var F = { exports: {} }, $ = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.js
@@ -13,23 +13,23 @@ var re;
13
13
  function ie() {
14
14
  if (re) return $;
15
15
  re = 1;
16
- var r = Symbol.for("react.transitional.element"), d = Symbol.for("react.fragment");
17
- function o(s, a, l) {
18
- var m = null;
19
- if (l !== void 0 && (m = "" + l), a.key !== void 0 && (m = "" + a.key), "key" in a) {
20
- l = {};
21
- for (var i in a)
22
- i !== "key" && (l[i] = a[i]);
23
- } else l = a;
24
- return a = l.ref, {
16
+ var r = Symbol.for("react.transitional.element"), u = Symbol.for("react.fragment");
17
+ function o(s, l, c) {
18
+ var h = null;
19
+ if (c !== void 0 && (h = "" + c), l.key !== void 0 && (h = "" + l.key), "key" in l) {
20
+ c = {};
21
+ for (var i in l)
22
+ i !== "key" && (c[i] = l[i]);
23
+ } else c = l;
24
+ return l = c.ref, {
25
25
  $$typeof: r,
26
26
  type: s,
27
- key: m,
28
- ref: a !== void 0 ? a : null,
29
- props: l
27
+ key: h,
28
+ ref: l !== void 0 ? l : null,
29
+ props: c
30
30
  };
31
31
  }
32
- return $.Fragment = d, $.jsx = o, $.jsxs = o, $;
32
+ return $.Fragment = u, $.jsx = o, $.jsxs = o, $;
33
33
  }
34
34
  var D = {};
35
35
  /**
@@ -50,35 +50,35 @@ function ce() {
50
50
  return t.$$typeof === A ? null : t.displayName || t.name || null;
51
51
  if (typeof t == "string") return t;
52
52
  switch (t) {
53
- case N:
53
+ case E:
54
54
  return "Fragment";
55
- case W:
55
+ case Y:
56
56
  return "Profiler";
57
- case R:
57
+ case C:
58
58
  return "StrictMode";
59
59
  case P:
60
60
  return "Suspense";
61
- case X:
61
+ case z:
62
62
  return "SuspenseList";
63
- case k:
63
+ case T:
64
64
  return "Activity";
65
65
  }
66
66
  if (typeof t == "object")
67
67
  switch (typeof t.tag == "number" && console.error(
68
68
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
69
69
  ), t.$$typeof) {
70
- case T:
70
+ case _:
71
71
  return "Portal";
72
- case q:
72
+ case X:
73
73
  return t.displayName || "Context";
74
- case F:
74
+ case q:
75
75
  return (t._context.displayName || "Context") + ".Consumer";
76
- case w:
76
+ case N:
77
77
  var n = t.render;
78
78
  return t = t.displayName, t || (t = n.displayName || n.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
79
- case j:
79
+ case w:
80
80
  return n = t.displayName || null, n !== null ? n : r(t.type) || "Memo";
81
- case b:
81
+ case j:
82
82
  n = t._payload, t = t._init;
83
83
  try {
84
84
  return r(t(n));
@@ -87,29 +87,29 @@ function ce() {
87
87
  }
88
88
  return null;
89
89
  }
90
- function d(t) {
90
+ function u(t) {
91
91
  return "" + t;
92
92
  }
93
93
  function o(t) {
94
94
  try {
95
- d(t);
95
+ u(t);
96
96
  var n = !1;
97
97
  } catch {
98
98
  n = !0;
99
99
  }
100
100
  if (n) {
101
101
  n = console;
102
- var u = n.error, h = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
103
- return u.call(
102
+ var m = n.error, f = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
103
+ return m.call(
104
104
  n,
105
105
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
106
- h
107
- ), d(t);
106
+ f
107
+ ), u(t);
108
108
  }
109
109
  }
110
110
  function s(t) {
111
- if (t === N) return "<>";
112
- if (typeof t == "object" && t !== null && t.$$typeof === b)
111
+ if (t === E) return "<>";
112
+ if (typeof t == "object" && t !== null && t.$$typeof === j)
113
113
  return "<...>";
114
114
  try {
115
115
  var n = r(t);
@@ -118,49 +118,49 @@ function ce() {
118
118
  return "<...>";
119
119
  }
120
120
  }
121
- function a() {
121
+ function l() {
122
122
  var t = M.A;
123
123
  return t === null ? null : t.getOwner();
124
124
  }
125
- function l() {
125
+ function c() {
126
126
  return Error("react-stack-top-frame");
127
127
  }
128
- function m(t) {
129
- if (S.call(t, "key")) {
128
+ function h(t) {
129
+ if (I.call(t, "key")) {
130
130
  var n = Object.getOwnPropertyDescriptor(t, "key").get;
131
131
  if (n && n.isReactWarning) return !1;
132
132
  }
133
133
  return t.key !== void 0;
134
134
  }
135
135
  function i(t, n) {
136
- function u() {
137
- H || (H = !0, console.error(
136
+ function m() {
137
+ J || (J = !0, console.error(
138
138
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
139
139
  n
140
140
  ));
141
141
  }
142
- u.isReactWarning = !0, Object.defineProperty(t, "key", {
143
- get: u,
142
+ m.isReactWarning = !0, Object.defineProperty(t, "key", {
143
+ get: m,
144
144
  configurable: !0
145
145
  });
146
146
  }
147
- function c() {
147
+ function a() {
148
148
  var t = r(this.type);
149
149
  return G[t] || (G[t] = !0, console.error(
150
150
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
151
151
  )), t = this.props.ref, t !== void 0 ? t : null;
152
152
  }
153
- function f(t, n, u, h, Y, B) {
154
- var x = u.ref;
153
+ function d(t, n, m, f, U, V) {
154
+ var p = m.ref;
155
155
  return t = {
156
- $$typeof: C,
156
+ $$typeof: S,
157
157
  type: t,
158
158
  key: n,
159
- props: u,
160
- _owner: h
161
- }, (x !== void 0 ? x : null) !== null ? Object.defineProperty(t, "ref", {
159
+ props: m,
160
+ _owner: f
161
+ }, (p !== void 0 ? p : null) !== null ? Object.defineProperty(t, "ref", {
162
162
  enumerable: !1,
163
- get: c
163
+ get: a
164
164
  }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
165
165
  configurable: !1,
166
166
  enumerable: !1,
@@ -175,69 +175,69 @@ function ce() {
175
175
  configurable: !1,
176
176
  enumerable: !1,
177
177
  writable: !0,
178
- value: Y
178
+ value: U
179
179
  }), Object.defineProperty(t, "_debugTask", {
180
180
  configurable: !1,
181
181
  enumerable: !1,
182
182
  writable: !0,
183
- value: B
183
+ value: V
184
184
  }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
185
185
  }
186
- function g(t, n, u, h, Y, B) {
187
- var x = n.children;
188
- if (x !== void 0)
189
- if (h)
190
- if (L(x)) {
191
- for (h = 0; h < x.length; h++)
192
- _(x[h]);
193
- Object.freeze && Object.freeze(x);
186
+ function x(t, n, m, f, U, V) {
187
+ var p = n.children;
188
+ if (p !== void 0)
189
+ if (f)
190
+ if (L(p)) {
191
+ for (f = 0; f < p.length; f++)
192
+ g(p[f]);
193
+ Object.freeze && Object.freeze(p);
194
194
  } else
195
195
  console.error(
196
196
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
197
197
  );
198
- else _(x);
199
- if (S.call(n, "key")) {
200
- x = r(t);
201
- var I = Object.keys(n).filter(function(oe) {
198
+ else g(p);
199
+ if (I.call(n, "key")) {
200
+ p = r(t);
201
+ var O = Object.keys(n).filter(function(oe) {
202
202
  return oe !== "key";
203
203
  });
204
- h = 0 < I.length ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}", K[x + h] || (I = 0 < I.length ? "{" + I.join(": ..., ") + ": ...}" : "{}", console.error(
204
+ f = 0 < O.length ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}", K[p + f] || (O = 0 < O.length ? "{" + O.join(": ..., ") + ": ...}" : "{}", console.error(
205
205
  `A props object containing a "key" prop is being spread into JSX:
206
206
  let props = %s;
207
207
  <%s {...props} />
208
208
  React keys must be passed directly to JSX without using spread:
209
209
  let props = %s;
210
210
  <%s key={someKey} {...props} />`,
211
- h,
212
- x,
213
- I,
214
- x
215
- ), K[x + h] = !0);
211
+ f,
212
+ p,
213
+ O,
214
+ p
215
+ ), K[p + f] = !0);
216
216
  }
217
- if (x = null, u !== void 0 && (o(u), x = "" + u), m(n) && (o(n.key), x = "" + n.key), "key" in n) {
218
- u = {};
219
- for (var V in n)
220
- V !== "key" && (u[V] = n[V]);
221
- } else u = n;
222
- return x && i(
223
- u,
217
+ if (p = null, m !== void 0 && (o(m), p = "" + m), h(n) && (o(n.key), p = "" + n.key), "key" in n) {
218
+ m = {};
219
+ for (var H in n)
220
+ H !== "key" && (m[H] = n[H]);
221
+ } else m = n;
222
+ return p && i(
223
+ m,
224
224
  typeof t == "function" ? t.displayName || t.name || "Unknown" : t
225
- ), f(
225
+ ), d(
226
226
  t,
227
- x,
228
- u,
229
- a(),
230
- Y,
231
- B
227
+ p,
228
+ m,
229
+ l(),
230
+ U,
231
+ V
232
232
  );
233
233
  }
234
- function _(t) {
235
- O(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === b && (t._payload.status === "fulfilled" ? O(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
234
+ function g(t) {
235
+ y(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === j && (t._payload.status === "fulfilled" ? y(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
236
236
  }
237
- function O(t) {
238
- return typeof t == "object" && t !== null && t.$$typeof === C;
237
+ function y(t) {
238
+ return typeof t == "object" && t !== null && t.$$typeof === S;
239
239
  }
240
- var v = le, C = Symbol.for("react.transitional.element"), T = Symbol.for("react.portal"), N = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), W = Symbol.for("react.profiler"), F = Symbol.for("react.consumer"), q = Symbol.for("react.context"), w = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), j = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), k = Symbol.for("react.activity"), A = Symbol.for("react.client.reference"), M = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, S = Object.prototype.hasOwnProperty, L = Array.isArray, z = console.createTask ? console.createTask : function() {
240
+ var v = le, S = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), Y = Symbol.for("react.profiler"), q = Symbol.for("react.consumer"), X = Symbol.for("react.context"), N = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), z = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), T = Symbol.for("react.activity"), A = Symbol.for("react.client.reference"), M = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, I = Object.prototype.hasOwnProperty, L = Array.isArray, B = console.createTask ? console.createTask : function() {
241
241
  return null;
242
242
  };
243
243
  v = {
@@ -245,49 +245,49 @@ React keys must be passed directly to JSX without using spread:
245
245
  return t();
246
246
  }
247
247
  };
248
- var H, G = {}, Q = v.react_stack_bottom_frame.bind(
248
+ var J, G = {}, Q = v.react_stack_bottom_frame.bind(
249
249
  v,
250
- l
251
- )(), Z = z(s(l)), K = {};
252
- D.Fragment = N, D.jsx = function(t, n, u) {
253
- var h = 1e4 > M.recentlyCreatedOwnerStacks++;
254
- return g(
250
+ c
251
+ )(), Z = B(s(c)), K = {};
252
+ D.Fragment = E, D.jsx = function(t, n, m) {
253
+ var f = 1e4 > M.recentlyCreatedOwnerStacks++;
254
+ return x(
255
255
  t,
256
256
  n,
257
- u,
257
+ m,
258
258
  !1,
259
- h ? Error("react-stack-top-frame") : Q,
260
- h ? z(s(t)) : Z
259
+ f ? Error("react-stack-top-frame") : Q,
260
+ f ? B(s(t)) : Z
261
261
  );
262
- }, D.jsxs = function(t, n, u) {
263
- var h = 1e4 > M.recentlyCreatedOwnerStacks++;
264
- return g(
262
+ }, D.jsxs = function(t, n, m) {
263
+ var f = 1e4 > M.recentlyCreatedOwnerStacks++;
264
+ return x(
265
265
  t,
266
266
  n,
267
- u,
267
+ m,
268
268
  !0,
269
- h ? Error("react-stack-top-frame") : Q,
270
- h ? z(s(t)) : Z
269
+ f ? Error("react-stack-top-frame") : Q,
270
+ f ? B(s(t)) : Z
271
271
  );
272
272
  };
273
273
  })()), D;
274
274
  }
275
275
  var se;
276
276
  function de() {
277
- return se || (se = 1, process.env.NODE_ENV === "production" ? U.exports = ie() : U.exports = ce()), U.exports;
277
+ return se || (se = 1, process.env.NODE_ENV === "production" ? F.exports = ie() : F.exports = ce()), F.exports;
278
278
  }
279
- var e = de(), y = /* @__PURE__ */ ((r) => (r.TEXT = "text", r.PRODUCT_LIST = "product_list", r.LOADING = "loading", r))(y || {}), p = /* @__PURE__ */ ((r) => (r.USER = "user", r.AI = "ai", r))(p || {});
279
+ var e = de(), k = /* @__PURE__ */ ((r) => (r.TEXT = "text", r.PRODUCT_LIST = "product_list", r.LOADING = "loading", r))(k || {}), b = /* @__PURE__ */ ((r) => (r.USER = "user", r.AI = "ai", r))(b || {});
280
280
  const ue = ({
281
281
  title: r,
282
- primaryColor: d,
282
+ primaryColor: u,
283
283
  onClose: o,
284
284
  onReset: s,
285
- onToggleExpand: a,
286
- isExpanded: l,
287
- language: m,
285
+ onToggleExpand: l,
286
+ isExpanded: c,
287
+ language: h,
288
288
  onLanguageChange: i
289
289
  }) => {
290
- const c = [
290
+ const a = [
291
291
  { value: "en", label: "EN" },
292
292
  { value: "vi", label: "VI" },
293
293
  { value: "ja", label: "JA" }
@@ -302,7 +302,7 @@ const ue = ({
302
302
  "img",
303
303
  {
304
304
  src: "https://fptshop.com.vn/img/bitu/bitu-avatar.png",
305
- onError: (f) => f.currentTarget.src = "https://cdn-icons-png.flaticon.com/512/4712/4712035.png",
305
+ onError: (d) => d.currentTarget.src = "https://cdn-icons-png.flaticon.com/512/4712/4712035.png",
306
306
  className: "w-full h-full object-contain",
307
307
  alt: "Bot Icon"
308
308
  }
@@ -324,11 +324,11 @@ const ue = ({
324
324
  /* @__PURE__ */ e.jsx(
325
325
  "select",
326
326
  {
327
- value: m,
328
- onChange: (f) => i(f.target.value),
327
+ value: h,
328
+ onChange: (d) => i(d.target.value),
329
329
  className: "appearance-none bg-white/50 border border-gray-200 rounded-lg px-2 pr-5 py-1 text-[10px] font-black text-indigo-600 cursor-pointer hover:bg-white transition-all focus:outline-none focus:ring-2 focus:ring-indigo-100 uppercase",
330
330
  title: "Select language",
331
- children: c.map((f) => /* @__PURE__ */ e.jsx("option", { value: f.value, className: "font-sans font-bold", children: f.label }, f.value))
331
+ children: a.map((d) => /* @__PURE__ */ e.jsx("option", { value: d.value, className: "font-sans font-bold", children: d.label }, d.value))
332
332
  }
333
333
  ),
334
334
  /* @__PURE__ */ e.jsx("div", { className: "absolute right-1.5 top-1/2 -translate-y-1/2 pointer-events-none text-indigo-400", children: /* @__PURE__ */ e.jsx("svg", { width: "8", height: "8", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e.jsx("path", { d: "m6 9 6 6 6-6" }) }) })
@@ -350,10 +350,10 @@ const ue = ({
350
350
  /* @__PURE__ */ e.jsx(
351
351
  "button",
352
352
  {
353
- onClick: a,
353
+ onClick: l,
354
354
  className: "w-8 h-8 hidden md:flex items-center justify-center rounded-lg hover:bg-white/60 text-gray-500 hover:text-indigo-600 transition-all",
355
- title: l ? "Collapse" : "Expand",
356
- children: l ? /* @__PURE__ */ e.jsxs("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
355
+ title: c ? "Collapse" : "Expand",
356
+ children: c ? /* @__PURE__ */ e.jsxs("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
357
357
  /* @__PURE__ */ e.jsx("path", { d: "M4 14h6v6" }),
358
358
  /* @__PURE__ */ e.jsx("path", { d: "M20 10h-6V4" }),
359
359
  /* @__PURE__ */ e.jsx("path", { d: "M14 10l7-7" }),
@@ -382,7 +382,7 @@ const ue = ({
382
382
  ]
383
383
  }
384
384
  );
385
- }, me = ({ product: r, primaryColor: d }) => /* @__PURE__ */ e.jsxs("div", { className: "min-w-[170px] max-w-[170px] bg-white rounded-xl border border-gray-50 shadow-sm overflow-hidden flex flex-col hover:shadow-lg transition-all duration-300 group", children: [
385
+ }, he = ({ product: r, primaryColor: u }) => /* @__PURE__ */ e.jsxs("div", { className: "min-w-[170px] max-w-[170px] bg-white rounded-xl border border-gray-50 shadow-sm overflow-hidden flex flex-col hover:shadow-lg transition-all duration-300 group", children: [
386
386
  /* @__PURE__ */ e.jsxs("div", { className: "relative h-32 w-full bg-white flex items-center justify-center p-2", children: [
387
387
  /* @__PURE__ */ e.jsx(
388
388
  "img",
@@ -406,76 +406,104 @@ const ue = ({
406
406
  "button",
407
407
  {
408
408
  className: "w-full py-1.5 rounded-lg text-[11px] font-bold border transition-all duration-300 active:scale-95 shadow-sm",
409
- style: { borderColor: d, color: d },
409
+ style: { borderColor: u, color: u },
410
410
  onMouseEnter: (o) => {
411
- o.currentTarget.style.backgroundColor = d, o.currentTarget.style.color = "white";
411
+ o.currentTarget.style.backgroundColor = u, o.currentTarget.style.color = "white";
412
412
  },
413
413
  onMouseLeave: (o) => {
414
- o.currentTarget.style.backgroundColor = "transparent", o.currentTarget.style.color = d;
414
+ o.currentTarget.style.backgroundColor = "transparent", o.currentTarget.style.color = u;
415
415
  },
416
416
  children: "Chọn mua"
417
417
  }
418
418
  )
419
419
  ] })
420
- ] }), J = (r) => {
421
- const d = /(\*\*.*?\*\*|\[.*?\]\(.*?\))/g;
422
- return r.split(d).map((s, a) => {
420
+ ] }), W = (r) => {
421
+ const u = /(\*\*.*?\*\*|\[.*?\]\(.*?\))/g;
422
+ return r.split(u).map((s, l) => {
423
423
  if (s.startsWith("**") && s.endsWith("**")) {
424
- const m = s.slice(2, -2);
425
- return /* @__PURE__ */ e.jsx("strong", { className: "font-bold text-gray-900", children: m }, a);
424
+ const h = s.slice(2, -2);
425
+ return /* @__PURE__ */ e.jsx("strong", { className: "font-bold text-gray-900", children: h }, l);
426
426
  }
427
- const l = s.match(/\[(.*?)\]\((.*?)\)/);
428
- if (l) {
429
- const [m, i, c] = l;
427
+ const c = s.match(/\[(.*?)\]\((.*?)\)/);
428
+ if (c) {
429
+ const [h, i, a] = c;
430
430
  return /* @__PURE__ */ e.jsx(
431
431
  "a",
432
432
  {
433
- href: c,
433
+ href: a,
434
434
  target: "_blank",
435
435
  rel: "noopener noreferrer",
436
436
  className: "text-blue-600 hover:underline break-all font-semibold",
437
437
  children: i
438
438
  },
439
- a
439
+ l
440
440
  );
441
441
  }
442
442
  return s;
443
443
  });
444
- }, he = ({ text: r }) => {
445
- const d = r.split(`
446
- `);
447
- return /* @__PURE__ */ e.jsx("div", { className: "markdown-body space-y-1.5", children: d.map((o, s) => {
448
- const a = o.trim(), l = a.match(/^(#{1,4})\s+(.*)$/);
449
- if (l) {
450
- const i = l[1].length, c = l[2], f = i === 1 ? "text-lg font-bold mb-3 mt-1" : i === 2 ? "text-md font-bold mb-2 mt-1" : "text-[14px] font-bold mb-1.5 mt-0.5 text-gray-900 uppercase tracking-wide";
451
- return /* @__PURE__ */ e.jsx("div", { className: f, children: J(c) }, s);
444
+ }, me = ({ text: r }) => {
445
+ const u = r.split(`
446
+ `), o = [];
447
+ let s = [], l = !1;
448
+ const c = (h) => {
449
+ if (s.length > 0) {
450
+ const a = s.length > 1 && s[1].every((d) => d.trim().match(/^:?-+:?$/)) ? [s[0], ...s.slice(2)] : s;
451
+ o.push(
452
+ /* @__PURE__ */ e.jsx("div", { className: "my-4 overflow-x-auto border border-gray-200 rounded-lg shadow-sm bg-white", children: /* @__PURE__ */ e.jsxs("table", { className: "min-w-full divide-y divide-gray-200 text-[13px]", children: [
453
+ /* @__PURE__ */ e.jsx("thead", { className: "bg-gray-50", children: /* @__PURE__ */ e.jsx("tr", { children: a[0].map((d, x) => /* @__PURE__ */ e.jsx("th", { className: "px-3 py-2 text-left font-bold text-gray-700 border-r last:border-r-0 border-gray-200", children: W(d.trim()) }, x)) }) }),
454
+ /* @__PURE__ */ e.jsx("tbody", { className: "divide-y divide-gray-100 bg-white", children: a.slice(1).map((d, x) => /* @__PURE__ */ e.jsx("tr", { className: "hover:bg-gray-50/50 transition-colors", children: d.map((g, y) => /* @__PURE__ */ e.jsx("td", { className: "px-3 py-2 text-gray-600 border-r last:border-r-0 border-gray-200 align-top", children: W(g.trim()) }, y)) }, x)) })
455
+ ] }) }, `table-${h}`)
456
+ ), s = [], l = !1;
452
457
  }
453
- const m = a.match(/^[*+-]\s+(.*)$/);
454
- if (m) {
455
- const i = m[1];
456
- return /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2.5 pl-1 mb-2 items-start", children: [
457
- /* @__PURE__ */ e.jsx("span", { className: "text-gray-400 flex-shrink-0 mt-1.5 w-1 h-1 bg-gray-400 rounded-full" }),
458
- /* @__PURE__ */ e.jsx("div", { className: "flex-1 leading-relaxed text-gray-800", children: J(i) })
459
- ] }, s);
458
+ };
459
+ return u.forEach((h, i) => {
460
+ const a = h.trim();
461
+ if (a.startsWith("|") && a.endsWith("|")) {
462
+ const g = a.split("|").slice(1, -1);
463
+ s.push(g), l = !0;
464
+ return;
465
+ } else l && c(i);
466
+ const d = a.match(/^(#{1,4})\s+(.*)$/);
467
+ if (d) {
468
+ const g = d[1].length, y = d[2], v = g === 1 ? "text-lg font-bold mb-3 mt-4 first:mt-1" : g === 2 ? "text-md font-bold mb-2 mt-3" : "text-[13px] font-black mb-1.5 mt-4 text-indigo-600 uppercase tracking-widest";
469
+ o.push(/* @__PURE__ */ e.jsx("div", { className: v, children: W(y) }, i));
470
+ return;
460
471
  }
461
- return a === "" ? /* @__PURE__ */ e.jsx("div", { className: "h-3" }, s) : /* @__PURE__ */ e.jsx("div", { className: "mb-1 leading-relaxed text-gray-800", children: J(o) }, s);
462
- }) });
472
+ const x = a.match(/^[*+-]\s+(.*)$/);
473
+ if (x) {
474
+ const g = x[1];
475
+ o.push(
476
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2.5 pl-1 mb-1.5 items-start", children: [
477
+ /* @__PURE__ */ e.jsx("span", { className: "text-indigo-400 flex-shrink-0 mt-2 w-1.5 h-1.5 bg-indigo-400 rounded-full" }),
478
+ /* @__PURE__ */ e.jsx("div", { className: "flex-1 leading-relaxed text-gray-800", children: W(g) })
479
+ ] }, i)
480
+ );
481
+ return;
482
+ }
483
+ if (a === "") {
484
+ o.push(/* @__PURE__ */ e.jsx("div", { className: "h-2" }, i));
485
+ return;
486
+ }
487
+ o.push(
488
+ /* @__PURE__ */ e.jsx("div", { className: "mb-1 leading-relaxed text-gray-800", children: W(h) }, i)
489
+ );
490
+ }), l && c(u.length), /* @__PURE__ */ e.jsx("div", { className: "markdown-body text-[14px]", children: o });
463
491
  }, xe = ({
464
492
  messages: r,
465
- isLoading: d,
493
+ isLoading: u,
466
494
  quickReplies: o,
467
495
  onQuickReply: s,
468
- primaryColor: a,
469
- renderMarkdown: l = !1
496
+ primaryColor: l,
497
+ renderMarkdown: c = !1
470
498
  }) => {
471
- const m = "https://fptshop.com.vn/img/bitu/bitu-avatar.png", i = "https://cdn-icons-png.flaticon.com/512/4712/4712035.png";
499
+ const h = "https://fptshop.com.vn/img/bitu/bitu-avatar.png", i = "https://cdn-icons-png.flaticon.com/512/4712/4712035.png";
472
500
  return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-8 pb-4", children: [
473
501
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-8 text-center animate-msg", children: [
474
- /* @__PURE__ */ e.jsx("div", { className: "relative mb-5", children: /* @__PURE__ */ e.jsx("div", { className: "w-24 h-24 flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
502
+ /* @__PURE__ */ e.jsx("div", { className: "relative mb-5", children: /* @__PURE__ */ e.jsx("div", { className: "w-20 h-20 flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
475
503
  "img",
476
504
  {
477
- src: m,
478
- onError: (c) => c.currentTarget.src = i,
505
+ src: h,
506
+ onError: (a) => a.currentTarget.src = i,
479
507
  className: "w-full h-full object-contain",
480
508
  alt: "Sigma AI Hero"
481
509
  }
@@ -484,61 +512,58 @@ const ue = ({
484
512
  "Sigma ",
485
513
  /* @__PURE__ */ e.jsx("span", { className: "bg-indigo-600 text-white text-[10px] px-1.5 py-0.5 rounded-md leading-none ml-1 uppercase font-bold tracking-tight", children: "AI" })
486
514
  ] }),
487
- /* @__PURE__ */ e.jsxs("div", { className: "text-[14px] text-gray-600 mt-3 leading-relaxed px-4", children: [
488
- /* @__PURE__ */ e.jsxs("p", { children: [
489
- /* @__PURE__ */ e.jsx("span", { className: "font-bold text-gray-800", children: "Sigma Assistant" }),
490
- " hỗ trợ bạn mọi lúc mọi nơi"
491
- ] }),
492
- /* @__PURE__ */ e.jsx("p", { children: "Tăng cường hiệu suất với AI thông minh" })
493
- ] })
515
+ /* @__PURE__ */ e.jsx("div", { className: "text-[14px] text-gray-600 mt-3 leading-relaxed px-4 max-w-[280px]", children: /* @__PURE__ */ e.jsxs("p", { children: [
516
+ /* @__PURE__ */ e.jsx("span", { className: "font-bold text-gray-800", children: "Sigma Assistant" }),
517
+ " hỗ trợ bạn mọi lúc mọi nơi"
518
+ ] }) })
494
519
  ] }),
495
- r.map((c, f) => /* @__PURE__ */ e.jsxs(
520
+ r.map((a, d) => /* @__PURE__ */ e.jsxs(
496
521
  "div",
497
522
  {
498
- className: `flex flex-col animate-msg ${c.sender === p.USER ? "items-end" : "items-start"}`,
499
- style: { animationDelay: `${f * 0.05}s` },
523
+ className: `flex flex-col animate-msg ${a.sender === b.USER ? "items-end" : "items-start"}`,
524
+ style: { animationDelay: `${d * 0.05}s` },
500
525
  children: [
501
- c.sender === p.AI && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1.5 mb-2 ml-1", children: [
526
+ a.sender === b.AI && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1.5 mb-2 ml-1", children: [
502
527
  /* @__PURE__ */ e.jsx(
503
528
  "img",
504
529
  {
505
- src: m,
506
- onError: (g) => g.currentTarget.src = i,
530
+ src: h,
531
+ onError: (x) => x.currentTarget.src = i,
507
532
  className: "w-4 h-4 object-contain",
508
533
  alt: "AI"
509
534
  }
510
535
  ),
511
536
  /* @__PURE__ */ e.jsx("span", { className: "text-[11px] font-bold text-gray-400 uppercase tracking-widest", children: "AI Agent" })
512
537
  ] }),
513
- /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col ${c.sender === p.USER ? "items-end" : "items-start"} max-w-[94%]`, children: [
538
+ /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col ${a.sender === b.USER ? "items-end" : "items-start"} max-w-[96%]`, children: [
514
539
  /* @__PURE__ */ e.jsx(
515
540
  "div",
516
541
  {
517
- className: `px-4 py-3 rounded-[18px] text-[14px] shadow-sm border border-black/[0.03] ${c.sender === p.USER ? "bg-indigo-600 text-white rounded-tr-none whitespace-pre-line shadow-indigo-100" : "bg-white text-gray-800 border-none rounded-tl-none"} ${!l || c.sender === p.USER ? "whitespace-pre-line" : ""}`,
518
- children: l && c.sender === p.AI ? /* @__PURE__ */ e.jsx(he, { text: c.content }) : c.content
542
+ className: `px-4 py-3 rounded-[20px] shadow-sm border border-black/[0.02] ${a.sender === b.USER ? "bg-indigo-600 text-white rounded-tr-none whitespace-pre-line shadow-indigo-100" : "bg-white text-gray-800 border-none rounded-tl-none"} ${!c || a.sender === b.USER ? "whitespace-pre-line" : ""}`,
543
+ children: c && a.sender === b.AI ? /* @__PURE__ */ e.jsx(me, { text: a.content }) : a.content
519
544
  }
520
545
  ),
521
- c.type === y.PRODUCT_LIST && c.products && /* @__PURE__ */ e.jsx("div", { className: "w-full mt-4 flex gap-4 overflow-x-auto pb-4 pt-1 no-scrollbar snap-x", children: c.products.map((g) => /* @__PURE__ */ e.jsx("div", { className: "product-card-snap", children: /* @__PURE__ */ e.jsx(me, { product: g, primaryColor: a }) }, g.id)) }),
522
- f === 0 && r.length === 1 && c.sender === p.AI && /* @__PURE__ */ e.jsx("div", { className: "mt-5 flex flex-wrap gap-2.5 w-full", children: o.map((g, _) => /* @__PURE__ */ e.jsx(
546
+ a.type === k.PRODUCT_LIST && a.products && /* @__PURE__ */ e.jsx("div", { className: "w-full mt-4 flex gap-4 overflow-x-auto pb-4 pt-1 no-scrollbar snap-x", children: a.products.map((x) => /* @__PURE__ */ e.jsx("div", { className: "product-card-snap", children: /* @__PURE__ */ e.jsx(he, { product: x, primaryColor: l }) }, x.id)) }),
547
+ d === 0 && r.length === 1 && a.sender === b.AI && /* @__PURE__ */ e.jsx("div", { className: "mt-5 flex flex-wrap gap-2.5 w-full", children: o.map((x, g) => /* @__PURE__ */ e.jsx(
523
548
  "button",
524
549
  {
525
- onClick: () => s(g),
550
+ onClick: () => s(x),
526
551
  className: "px-4 py-2 rounded-full text-[13px] font-semibold border border-transparent bg-white text-gray-600 hover:text-indigo-600 hover:border-indigo-100 transition-all duration-200 shadow-sm active:scale-95",
527
- children: g
552
+ children: x
528
553
  },
529
- _
554
+ g
530
555
  )) })
531
556
  ] })
532
557
  ]
533
558
  },
534
- c.id
559
+ a.id
535
560
  )),
536
- d && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5 items-start animate-msg", children: [
561
+ u && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5 items-start animate-msg", children: [
537
562
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-1.5 ml-1", children: /* @__PURE__ */ e.jsx(
538
563
  "img",
539
564
  {
540
- src: m,
541
- onError: (c) => c.currentTarget.src = i,
565
+ src: h,
566
+ onError: (a) => a.currentTarget.src = i,
542
567
  className: "w-4 h-4 object-contain",
543
568
  alt: "AI Loading"
544
569
  }
@@ -550,19 +575,19 @@ const ue = ({
550
575
  ] })
551
576
  ] })
552
577
  ] });
553
- }, fe = ({ placeholder: r, onSendMessage: d, primaryColor: o }) => {
554
- const [s, a] = E(""), l = () => {
555
- s.trim() && (d(s), a(""));
556
- }, m = (i) => {
557
- i.key === "Enter" && !i.shiftKey && (i.preventDefault(), l());
578
+ }, fe = ({ placeholder: r, onSendMessage: u, primaryColor: o }) => {
579
+ const [s, l] = R(""), c = () => {
580
+ s.trim() && (u(s), l(""));
581
+ }, h = (i) => {
582
+ i.key === "Enter" && !i.shiftKey && (i.preventDefault(), c());
558
583
  };
559
584
  return /* @__PURE__ */ e.jsx("div", { className: "p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "relative flex items-center bg-gray-50/50 rounded-2xl border border-gray-100 focus-within:border-indigo-100 focus-within:bg-white transition-all duration-200 pr-2 pl-3 py-1", children: [
560
585
  /* @__PURE__ */ e.jsx(
561
586
  "textarea",
562
587
  {
563
588
  value: s,
564
- onChange: (i) => a(i.target.value),
565
- onKeyDown: m,
589
+ onChange: (i) => l(i.target.value),
590
+ onKeyDown: h,
566
591
  placeholder: r,
567
592
  rows: 1,
568
593
  className: "w-full bg-transparent border-none outline-none focus:ring-0 text-[14px] text-gray-700 font-normal py-3 px-1 resize-none chat-scrollbar min-h-[44px] max-h-[120px] leading-relaxed placeholder:text-gray-400",
@@ -572,7 +597,7 @@ const ue = ({
572
597
  /* @__PURE__ */ e.jsx(
573
598
  "button",
574
599
  {
575
- onClick: l,
600
+ onClick: c,
576
601
  disabled: !s.trim(),
577
602
  className: `w-9 h-9 rounded-xl flex-shrink-0 flex items-center justify-center transition-all duration-300 shadow-sm ${s.trim() ? "bg-indigo-600 text-white hover:bg-indigo-700 active:scale-95" : "bg-gray-200 text-gray-400 cursor-not-allowed"}`,
578
603
  children: /* @__PURE__ */ e.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: [
@@ -582,10 +607,10 @@ const ue = ({
582
607
  }
583
608
  )
584
609
  ] }) });
585
- }, pe = ({ isOpen: r, onClick: d, primaryColor: o, className: s = "" }) => /* @__PURE__ */ e.jsx("div", { className: `fixed bottom-4 right-4 md:bottom-6 md:right-6 z-[100] ${s}`, children: /* @__PURE__ */ e.jsx(
610
+ }, pe = ({ isOpen: r, onClick: u, primaryColor: o, className: s = "" }) => /* @__PURE__ */ e.jsx("div", { className: `fixed bottom-4 right-4 md:bottom-6 md:right-6 z-[100] ${s}`, children: /* @__PURE__ */ e.jsx(
586
611
  "button",
587
612
  {
588
- onClick: d,
613
+ onClick: u,
589
614
  className: `w-12 h-12 bg-white rounded-2xl shadow-lg flex items-center justify-center border transition-all duration-300 overflow-hidden ${r ? "border-indigo-500 ring-4 ring-indigo-50 scale-105 rotate-0" : "border-slate-100 hover:scale-110 hover:shadow-xl"}`,
590
615
  children: /* @__PURE__ */ e.jsx(
591
616
  "img",
@@ -593,92 +618,92 @@ const ue = ({
593
618
  src: "https://fptshop.com.vn/img/bitu/bitu-avatar.png",
594
619
  className: "w-10 h-10 object-contain",
595
620
  alt: "Bitu",
596
- onError: (a) => a.currentTarget.src = "https://cdn-icons-png.flaticon.com/512/4712/4712035.png"
621
+ onError: (l) => l.currentTarget.src = "https://cdn-icons-png.flaticon.com/512/4712/4712035.png"
597
622
  }
598
623
  )
599
624
  }
600
- ) }), ae = () => Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15), be = ({ config: r, onGetAiResponse: d }) => {
601
- const [o, s] = E(!1), [a, l] = E(!1), [m, i] = E(!1), [c, f] = E(ae()), [g, _] = E("en"), [O, v] = E([
625
+ ) }), ae = () => Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15), be = ({ config: r, onGetAiResponse: u }) => {
626
+ const [o, s] = R(!1), [l, c] = R(!1), [h, i] = R(!1), [a, d] = R(ae()), [x, g] = R("en"), [y, v] = R([
602
627
  {
603
628
  id: "welcome",
604
- type: y.TEXT,
605
- sender: p.AI,
629
+ type: k.TEXT,
630
+ sender: b.AI,
606
631
  content: r.welcomeMessage,
607
632
  timestamp: /* @__PURE__ */ new Date()
608
633
  }
609
- ]), [C, T] = E(!1), N = ee(null), R = ee(0);
634
+ ]), [S, _] = R(!1), E = ee(null), C = ee(0);
610
635
  te(() => {
611
636
  if (o) {
612
- const w = setTimeout(() => i(!0), 50);
613
- return () => clearTimeout(w);
637
+ const N = setTimeout(() => i(!0), 50);
638
+ return () => clearTimeout(N);
614
639
  } else
615
640
  i(!1);
616
641
  }, [o]), te(() => {
617
- N.current && o && (N.current.scrollTop = N.current.scrollHeight);
618
- }, [O, o, C]);
619
- const W = async (w) => {
620
- if (!w.trim() || C) return;
621
- const P = ++R.current, X = {
642
+ E.current && o && (E.current.scrollTop = E.current.scrollHeight);
643
+ }, [y, o, S]);
644
+ const Y = async (N) => {
645
+ if (!N.trim() || S) return;
646
+ const P = ++C.current, z = {
622
647
  id: `user-${Date.now()}`,
623
- type: y.TEXT,
624
- sender: p.USER,
625
- content: w,
648
+ type: k.TEXT,
649
+ sender: b.USER,
650
+ content: N,
626
651
  timestamp: /* @__PURE__ */ new Date()
627
652
  };
628
- v((j) => [...j, X]), T(!0);
653
+ v((w) => [...w, z]), _(!0);
629
654
  try {
630
- const j = d(w, c, g);
631
- if (j && typeof j == "object" && Symbol.asyncIterator in j) {
632
- let b = "", k = !1;
655
+ const w = u(N, a, x);
656
+ if (w && typeof w == "object" && Symbol.asyncIterator in w) {
657
+ let j = "", T = !1;
633
658
  const A = `ai-${Date.now()}`;
634
- for await (const M of j) {
635
- if (P !== R.current) return;
636
- k || (v((S) => [...S, {
659
+ for await (const M of w) {
660
+ if (P !== C.current) return;
661
+ T || (v((I) => [...I, {
637
662
  id: A,
638
- type: y.TEXT,
639
- sender: p.AI,
663
+ type: k.TEXT,
664
+ sender: b.AI,
640
665
  content: "",
641
666
  timestamp: /* @__PURE__ */ new Date()
642
- }]), T(!1), k = !0), b += M, v((S) => S.map(
643
- (L) => L.id === A ? { ...L, content: b } : L
667
+ }]), _(!1), T = !0), j += M, v((I) => I.map(
668
+ (L) => L.id === A ? { ...L, content: j } : L
644
669
  ));
645
670
  }
646
671
  } else {
647
- const b = await j;
648
- if (P !== R.current) return;
649
- T(!1);
650
- const k = typeof b == "string" ? { text: b, products: void 0 } : b;
672
+ const j = await w;
673
+ if (P !== C.current) return;
674
+ _(!1);
675
+ const T = typeof j == "string" ? { text: j, products: void 0 } : j;
651
676
  v((A) => [...A, {
652
677
  id: `ai-${Date.now()}`,
653
- type: k.products ? y.PRODUCT_LIST : y.TEXT,
654
- sender: p.AI,
655
- content: k.text,
656
- products: k.products,
678
+ type: T.products ? k.PRODUCT_LIST : k.TEXT,
679
+ sender: b.AI,
680
+ content: T.text,
681
+ products: T.products,
657
682
  timestamp: /* @__PURE__ */ new Date()
658
683
  }]);
659
684
  }
660
- } catch (j) {
661
- if (P !== R.current) return;
662
- console.error("Chatbox Error:", j), T(!1), v((b) => [...b, {
685
+ } catch (w) {
686
+ if (P !== C.current) return;
687
+ console.error("Chatbox Error:", w), _(!1), v((j) => [...j, {
663
688
  id: `err-${Date.now()}`,
664
- type: y.TEXT,
665
- sender: p.AI,
689
+ type: k.TEXT,
690
+ sender: b.AI,
666
691
  content: "Hệ thống đang bận, vui lòng thử lại sau.",
667
692
  timestamp: /* @__PURE__ */ new Date()
668
693
  }]);
669
694
  }
670
- }, F = () => {
671
- R.current++, f(ae()), v([{
695
+ }, q = () => {
696
+ C.current++, d(ae()), v([{
672
697
  id: "welcome",
673
- type: y.TEXT,
674
- sender: p.AI,
698
+ type: k.TEXT,
699
+ sender: b.AI,
675
700
  content: r.welcomeMessage,
676
701
  timestamp: /* @__PURE__ */ new Date()
677
- }]), T(!1), l(!1);
678
- }, q = `
702
+ }]), _(!1), c(!1);
703
+ }, X = `
679
704
  fixed z-[99] overflow-hidden flex flex-col border border-white/40 shadow-2xl bg-white animate-chat-pop
680
- ${m ? "transition-[width,height,border-radius,right,bottom] duration-300 ease-in-out" : ""}
681
- ${a ? "bottom-0 right-0 w-full h-full md:bottom-6 md:right-28 md:w-[850px] md:h-[85vh] rounded-none md:rounded-[32px]" : "bottom-0 right-0 w-full h-[80vh] md:bottom-6 md:right-28 md:w-[380px] md:h-[580px] rounded-t-[28px] md:rounded-[28px]"}
705
+ ${h ? "transition-[width,height,border-radius,right,bottom] duration-300 ease-in-out" : ""}
706
+ ${l ? "bottom-0 right-0 w-full h-full md:bottom-6 md:right-28 md:w-[850px] md:h-[85vh] rounded-none md:rounded-[32px]" : "bottom-0 right-0 w-full h-[80vh] md:bottom-6 md:right-28 md:w-[380px] md:h-[580px] rounded-t-[28px] md:rounded-[28px]"}
682
707
  `;
683
708
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
684
709
  /* @__PURE__ */ e.jsx(
@@ -690,27 +715,27 @@ const ue = ({
690
715
  className: o ? "hidden md:flex" : "flex"
691
716
  }
692
717
  ),
693
- o && /* @__PURE__ */ e.jsxs("div", { className: q, style: { left: "auto" }, children: [
718
+ o && /* @__PURE__ */ e.jsxs("div", { className: X, style: { left: "auto" }, children: [
694
719
  /* @__PURE__ */ e.jsx(
695
720
  ue,
696
721
  {
697
722
  title: r.botName,
698
723
  primaryColor: r.primaryColor,
699
724
  onClose: () => s(!1),
700
- onReset: F,
701
- onToggleExpand: () => l(!a),
702
- isExpanded: a,
703
- language: g,
704
- onLanguageChange: _
725
+ onReset: q,
726
+ onToggleExpand: () => c(!l),
727
+ isExpanded: l,
728
+ language: x,
729
+ onLanguageChange: g
705
730
  }
706
731
  ),
707
- /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto chat-scrollbar px-5 py-5 bg-slate-50/30", ref: N, children: /* @__PURE__ */ e.jsx(
732
+ /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto chat-scrollbar px-5 py-5 bg-slate-50/30", ref: E, children: /* @__PURE__ */ e.jsx(
708
733
  xe,
709
734
  {
710
- messages: O,
711
- isLoading: C,
735
+ messages: y,
736
+ isLoading: S,
712
737
  quickReplies: r.quickReplies,
713
- onQuickReply: (w) => W(w),
738
+ onQuickReply: (N) => Y(N),
714
739
  primaryColor: r.primaryColor,
715
740
  renderMarkdown: r.renderMarkdown
716
741
  }
@@ -719,7 +744,7 @@ const ue = ({
719
744
  fe,
720
745
  {
721
746
  placeholder: r.placeholder,
722
- onSendMessage: W,
747
+ onSendMessage: Y,
723
748
  primaryColor: r.primaryColor
724
749
  }
725
750
  ) })
@@ -728,6 +753,6 @@ const ue = ({
728
753
  };
729
754
  export {
730
755
  be as Chatbox,
731
- y as MessageType,
732
- p as SenderType
756
+ k as MessageType,
757
+ b as SenderType
733
758
  };
@@ -1 +1 @@
1
- *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.chat-scrollbar::-webkit-scrollbar{width:5px}.chat-scrollbar::-webkit-scrollbar-track{background:transparent}.chat-scrollbar::-webkit-scrollbar-thumb{background:#e5e7eb;border-radius:10px}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-2{left:.5rem}.right-0{right:0}.right-1\.5{right:.375rem}.right-4{right:1rem}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:.5rem}.z-10{z-index:10}.z-\[100\]{z-index:100}.z-\[99\]{z-index:99}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.flex{display:flex}.hidden{display:none}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-2{height:.5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-32{height:8rem}.h-4{height:1rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[80vh\]{height:80vh}.h-full{height:100%}.max-h-\[120px\]{max-height:120px}.min-h-\[30px\]{min-height:30px}.min-h-\[44px\]{min-height:44px}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-2{width:.5rem}.w-24{width:6rem}.w-4{width:1rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-\[170px\]{min-width:170px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-\[170px\]{max-width:170px}.max-w-\[94\%\]{max-width:94%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-pre-line{white-space:pre-line}.break-all{word-break:break-all}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\[18px\]{border-radius:18px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-none{border-radius:0}.rounded-xl{border-radius:.75rem}.rounded-t-\[28px\]{border-top-left-radius:28px;border-top-right-radius:28px}.rounded-tl-none{border-top-left-radius:0}.rounded-tr-none{border-top-right-radius:0}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-none{border-style:none}.border-black\/\[0\.03\]{border-color:#00000008}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-50{--tw-border-opacity: 1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1))}.border-indigo-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.border-red-50\/50{border-color:#fef2f280}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white\/40{border-color:#fff6}.bg-\[\#fff1f2\]\/90{background-color:#fff1f2e6}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-50\/50{background-color:#f9fafb80}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-indigo-300{--tw-bg-opacity: 1;background-color:rgb(165 180 252 / var(--tw-bg-opacity, 1))}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-50\/30{background-color:#f8fafc4d}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/50{background-color:#ffffff80}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-4{padding-bottom:1rem}.pl-1{padding-left:.25rem}.pl-3{padding-left:.75rem}.pr-2{padding-right:.5rem}.pr-5{padding-right:1.25rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[9px\]{font-size:9px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-widest{letter-spacing:.1em}.text-\[\#1a2b56\]{--tw-text-opacity: 1;color:rgb(26 43 86 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-indigo-400{--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-indigo-100{--tw-shadow-color: #e0e7ff;--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-indigo-50{--tw-ring-opacity: 1;--tw-ring-color: rgb(238 242 255 / var(--tw-ring-opacity, 1))}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,height\,border-radius\,right\,bottom\]{transition-property:width,height,border-radius,right,bottom;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.product-card-snap{scroll-snap-align:start}.\[animation-delay\:0\.2s\]{animation-delay:.2s}.\[animation-delay\:0\.4s\]{animation-delay:.4s}@keyframes chat-pop{0%{transform:scale(.9) translateY(20px);opacity:0}to{transform:scale(1) translateY(0);opacity:1}}@keyframes msg-fade-in{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes sigma-bounce{0%,to{transform:translateY(0)}50%{transform:translateY(-4px)}}.animate-chat-pop{animation:chat-pop .4s cubic-bezier(.34,1.56,.64,1) forwards}.animate-msg{animation:msg-fade-in .3s ease-out forwards}.animate-sigma-bounce{animation:sigma-bounce .6s infinite}.placeholder\:text-gray-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.placeholder\:text-gray-400::placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.focus-within\:border-indigo-100:focus-within{--tw-border-opacity: 1;border-color:rgb(224 231 255 / var(--tw-border-opacity, 1))}.focus-within\:bg-white:focus-within{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-indigo-100:hover{--tw-border-opacity: 1;border-color:rgb(224 231 255 / var(--tw-border-opacity, 1))}.hover\:bg-indigo-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/60:hover{background-color:#fff9}.hover\:text-indigo-600:hover{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-indigo-100:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(224 231 255 / var(--tw-ring-opacity, 1))}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}@media(min-width:768px){.md\:bottom-6{bottom:1.5rem}.md\:right-28{right:7rem}.md\:right-6{right:1.5rem}.md\:flex{display:flex}.md\:h-\[580px\]{height:580px}.md\:h-\[85vh\]{height:85vh}.md\:w-\[380px\]{width:380px}.md\:w-\[850px\]{width:850px}.md\:rounded-\[28px\]{border-radius:28px}.md\:rounded-\[32px\]{border-radius:32px}.md\:text-6xl{font-size:3.75rem;line-height:1}}
1
+ *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.chat-scrollbar::-webkit-scrollbar{width:4px}.chat-scrollbar::-webkit-scrollbar-track{background:transparent}.chat-scrollbar::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:10px}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.markdown-body table{border-collapse:collapse;width:100%;margin:10px 0}.markdown-body th,.markdown-body td{border:1px solid #f1f5f9}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-2{left:.5rem}.right-0{right:0}.right-1\.5{right:.375rem}.right-4{right:1rem}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:.5rem}.z-10{z-index:10}.z-\[100\]{z-index:100}.z-\[99\]{z-index:99}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.mr-1{margin-right:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.flex{display:flex}.table{display:table}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-2{height:.5rem}.h-20{height:5rem}.h-32{height:8rem}.h-4{height:1rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[80vh\]{height:80vh}.h-full{height:100%}.max-h-\[120px\]{max-height:120px}.min-h-\[30px\]{min-height:30px}.min-h-\[44px\]{min-height:44px}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-2{width:.5rem}.w-20{width:5rem}.w-4{width:1rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-\[170px\]{min-width:170px}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-\[170px\]{max-width:170px}.max-w-\[280px\]{max-width:280px}.max-w-\[96\%\]{max-width:96%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(243 244 246 / var(--tw-divide-opacity, 1))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity, 1))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-pre-line{white-space:pre-line}.break-all{word-break:break-all}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\[18px\]{border-radius:18px}.rounded-\[20px\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-none{border-radius:0}.rounded-xl{border-radius:.75rem}.rounded-t-\[28px\]{border-top-left-radius:28px;border-top-right-radius:28px}.rounded-tl-none{border-top-left-radius:0}.rounded-tr-none{border-top-right-radius:0}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-none{border-style:none}.border-black\/\[0\.02\]{border-color:#00000005}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-50{--tw-border-opacity: 1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1))}.border-indigo-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.border-red-50\/50{border-color:#fef2f280}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white\/40{border-color:#fff6}.bg-\[\#fff1f2\]\/90{background-color:#fff1f2e6}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-50\/50{background-color:#f9fafb80}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-indigo-300{--tw-bg-opacity: 1;background-color:rgb(165 180 252 / var(--tw-bg-opacity, 1))}.bg-indigo-400{--tw-bg-opacity: 1;background-color:rgb(129 140 248 / var(--tw-bg-opacity, 1))}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-50\/30{background-color:#f8fafc4d}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/50{background-color:#ffffff80}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-4{padding-bottom:1rem}.pl-1{padding-left:.25rem}.pl-3{padding-left:.75rem}.pr-2{padding-right:.5rem}.pr-5{padding-right:1.25rem}.pt-1{padding-top:.25rem}.text-left{text-align:left}.text-center{text-align:center}.align-top{vertical-align:top}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[9px\]{font-size:9px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-\[\#1a2b56\]{--tw-text-opacity: 1;color:rgb(26 43 86 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-indigo-400{--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-indigo-100{--tw-shadow-color: #e0e7ff;--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-indigo-50{--tw-ring-opacity: 1;--tw-ring-color: rgb(238 242 255 / var(--tw-ring-opacity, 1))}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,height\,border-radius\,right\,bottom\]{transition-property:width,height,border-radius,right,bottom;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.product-card-snap{scroll-snap-align:start}.\[animation-delay\:0\.2s\]{animation-delay:.2s}.\[animation-delay\:0\.4s\]{animation-delay:.4s}@keyframes chat-pop{0%{transform:scale(.9) translateY(20px);opacity:0}to{transform:scale(1) translateY(0);opacity:1}}@keyframes msg-fade-in{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes sigma-bounce{0%,to{transform:translateY(0)}50%{transform:translateY(-4px)}}.animate-chat-pop{animation:chat-pop .4s cubic-bezier(.34,1.56,.64,1) forwards}.animate-msg{animation:msg-fade-in .3s ease-out forwards}.animate-sigma-bounce{animation:sigma-bounce .6s infinite}.placeholder\:text-gray-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.placeholder\:text-gray-400::placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.first\:mt-1:first-child{margin-top:.25rem}.last\:border-r-0:last-child{border-right-width:0px}.focus-within\:border-indigo-100:focus-within{--tw-border-opacity: 1;border-color:rgb(224 231 255 / var(--tw-border-opacity, 1))}.focus-within\:bg-white:focus-within{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-indigo-100:hover{--tw-border-opacity: 1;border-color:rgb(224 231 255 / var(--tw-border-opacity, 1))}.hover\:bg-gray-50\/50:hover{background-color:#f9fafb80}.hover\:bg-indigo-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/60:hover{background-color:#fff9}.hover\:text-indigo-600:hover{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-indigo-100:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(224 231 255 / var(--tw-ring-opacity, 1))}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}@media(min-width:768px){.md\:bottom-6{bottom:1.5rem}.md\:right-28{right:7rem}.md\:right-6{right:1.5rem}.md\:flex{display:flex}.md\:h-\[580px\]{height:580px}.md\:h-\[85vh\]{height:85vh}.md\:w-\[380px\]{width:380px}.md\:w-\[850px\]{width:850px}.md\:rounded-\[28px\]{border-radius:28px}.md\:rounded-\[32px\]{border-radius:32px}.md\:text-6xl{font-size:3.75rem;line-height:1}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-sigma-chatbox",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "description": "A high-quality React chatbox library featuring product cards, quick replies, and AI integration.",
6
6
  "main": "dist/index.js",
@@ -52,4 +52,4 @@
52
52
  "autoprefixer": "^10.4.0",
53
53
  "postcss": "^8.4.0"
54
54
  }
55
- }
55
+ }