@superwise.ai/superwise-chatbot-package 1.0.3 → 1.0.4

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.
@@ -1,4 +1,4 @@
1
- (function(O,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],i):(O=typeof globalThis<"u"?globalThis:O||self,i(O.ReactChatbot={},O.React))})(this,function(O,i){"use strict";var de={exports:{}},q={};/**
1
+ (function(B,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],i):(B=typeof globalThis<"u"?globalThis:B||self,i(B.ReactChatbot={},B.React))})(this,function(B,i){"use strict";var me={exports:{}},q={};/**
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 ue;function ve(){if(ue)return q;ue=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(m,c,a){var p=null;if(a!==void 0&&(p=""+a),c.key!==void 0&&(p=""+c.key),"key"in c){a={};for(var l in c)l!=="key"&&(a[l]=c[l])}else a=c;return c=a.ref,{$$typeof:r,type:m,key:p,ref:c!==void 0?c:null,props:a}}return q.Fragment=n,q.jsx=s,q.jsxs=s,q}var ee={};/**
9
+ */var ye;function _e(){if(ye)return q;ye=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(d,l,s){var m=null;if(s!==void 0&&(m=""+s),l.key!==void 0&&(m=""+l.key),"key"in l){s={};for(var c in l)c!=="key"&&(s[c]=l[c])}else s=l;return l=s.ref,{$$typeof:t,type:d,key:m,ref:l!==void 0?l:null,props:s}}return q.Fragment=n,q.jsx=a,q.jsxs=a,q}var ee={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,12 +14,12 @@
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 fe;function Ee(){return fe||(fe=1,process.env.NODE_ENV!=="production"&&function(){function r(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===M?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case I:return"Fragment";case W:return"Profiler";case H:return"StrictMode";case se:return"Suspense";case ae: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 g:return"Portal";case R:return t.displayName||"Context";case N:return(t._context.displayName||"Context")+".Consumer";case oe:var d=t.render;return t=t.displayName,t||(t=d.displayName||d.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ie:return d=t.displayName||null,d!==null?d:r(t.type)||"Memo";case $:d=t._payload,t=t._init;try{return r(t(d))}catch{}}return null}function n(t){return""+t}function s(t){try{n(t);var d=!1}catch{d=!0}if(d){d=console;var C=d.error,k=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return C.call(d,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",k),n(t)}}function m(t){if(t===I)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===$)return"<...>";try{var d=r(t);return d?"<"+d+">":"<...>"}catch{return"<...>"}}function c(){var t=J.A;return t===null?null:t.getOwner()}function a(){return Error("react-stack-top-frame")}function p(t){if(he.call(t,"key")){var d=Object.getOwnPropertyDescriptor(t,"key").get;if(d&&d.isReactWarning)return!1}return t.key!==void 0}function l(t,d){function C(){F||(F=!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)",d))}C.isReactWarning=!0,Object.defineProperty(t,"key",{get:C,configurable:!0})}function b(){var t=r(this.type);return re[t]||(re[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 x(t,d,C,k,B,X){var f=C.ref;return t={$$typeof:u,type:t,key:d,props:C,_owner:k},(f!==void 0?f:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:b}):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:B}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function w(t,d,C,k,B,X){var f=d.children;if(f!==void 0)if(k)if(le(f)){for(k=0;k<f.length;k++)E(f[k]);Object.freeze&&Object.freeze(f)}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 E(f);if(he.call(d,"key")){f=r(t);var P=Object.keys(d).filter(function(K){return K!=="key"});k=0<P.length?"{key: someKey, "+P.join(": ..., ")+": ...}":"{key: someKey}",Z[f+k]||(P=0<P.length?"{"+P.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var xe;function Me(){return xe||(xe=1,process.env.NODE_ENV!=="production"&&function(){function t(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===W?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case R:return"Fragment";case z:return"Profiler";case P:return"StrictMode";case se:return"Suspense";case ae:return"SuspenseList";case V:return"Activity"}if(typeof r=="object")switch(typeof r.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),r.$$typeof){case h:return"Portal";case A:return r.displayName||"Context";case J:return(r._context.displayName||"Context")+".Consumer";case oe:var p=r.render;return r=r.displayName,r||(r=p.displayName||p.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case ie:return p=r.displayName||null,p!==null?p:t(r.type)||"Memo";case $:p=r._payload,r=r._init;try{return t(r(p))}catch{}}return null}function n(r){return""+r}function a(r){try{n(r);var p=!1}catch{p=!0}if(p){p=console;var S=p.error,j=typeof Symbol=="function"&&Symbol.toStringTag&&r[Symbol.toStringTag]||r.constructor.name||"Object";return S.call(p,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",j),n(r)}}function d(r){if(r===R)return"<>";if(typeof r=="object"&&r!==null&&r.$$typeof===$)return"<...>";try{var p=t(r);return p?"<"+p+">":"<...>"}catch{return"<...>"}}function l(){var r=X.A;return r===null?null:r.getOwner()}function s(){return Error("react-stack-top-frame")}function m(r){if(fe.call(r,"key")){var p=Object.getOwnPropertyDescriptor(r,"key").get;if(p&&p.isReactWarning)return!1}return r.key!==void 0}function c(r,p){function S(){D||(D=!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)",p))}S.isReactWarning=!0,Object.defineProperty(r,"key",{get:S,configurable:!0})}function g(){var r=t(this.type);return re[r]||(re[r]=!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.")),r=this.props.ref,r!==void 0?r:null}function b(r,p,S,j,M,ne){var E=S.ref;return r={$$typeof:u,type:r,key:p,props:S,_owner:j},(E!==void 0?E:null)!==null?Object.defineProperty(r,"ref",{enumerable:!1,get:g}):Object.defineProperty(r,"ref",{enumerable:!1,value:null}),r._store={},Object.defineProperty(r._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(r,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(r,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:M}),Object.defineProperty(r,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ne}),Object.freeze&&(Object.freeze(r.props),Object.freeze(r)),r}function f(r,p,S,j,M,ne){var E=p.children;if(E!==void 0)if(j)if(le(E)){for(j=0;j<E.length;j++)L(E[j]);Object.freeze&&Object.freeze(E)}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 L(E);if(fe.call(p,"key")){E=t(r);var I=Object.keys(p).filter(function(_){return _!=="key"});j=0<I.length?"{key: someKey, "+I.join(": ..., ")+": ...}":"{key: someKey}",Y[E+j]||(I=0<I.length?"{"+I.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} />`,k,f,P,f),Z[f+k]=!0)}if(f=null,C!==void 0&&(s(C),f=""+C),p(d)&&(s(d.key),f=""+d.key),"key"in d){C={};for(var Y in d)Y!=="key"&&(C[Y]=d[Y])}else C=d;return f&&l(C,typeof t=="function"?t.displayName||t.name||"Unknown":t),x(t,f,C,c(),B,X)}function E(t){L(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===$&&(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===u}var S=i,u=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),R=Symbol.for("react.context"),oe=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),M=Symbol.for("react.client.reference"),J=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=Object.prototype.hasOwnProperty,le=Array.isArray,T=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(t){return t()}};var F,re={},ce=S.react_stack_bottom_frame.bind(S,a)(),U=T(m(a)),Z={};ee.Fragment=I,ee.jsx=function(t,d,C){var k=1e4>J.recentlyCreatedOwnerStacks++;return w(t,d,C,!1,k?Error("react-stack-top-frame"):ce,k?T(m(t)):U)},ee.jsxs=function(t,d,C){var k=1e4>J.recentlyCreatedOwnerStacks++;return w(t,d,C,!0,k?Error("react-stack-top-frame"):ce,k?T(m(t)):U)}}()),ee}process.env.NODE_ENV==="production"?de.exports=ve():de.exports=Ee();var e=de.exports;const Se=["Parameters:","additional_parameter_company_name:","additional_parameter_company_size:","additional_parameter_user_role:","additional_parameter_use_case:"],te="Apologize, I’m unable to respond at the moment. Please try asking your question again or click Contact Sales to get in touch with our team.";function je(r){if(typeof r!="string"||r.length===0)return r;let n=r;for(const s of Se)for(;;){const m=n.indexOf(s);if(m===-1)break;const c=n.indexOf("{",m);if(c===-1)break;let a=0,p=-1;for(let x=c;x<n.length;x++){const w=n[x];if(w==="{")a++;else if(w==="}"&&(a--,a===0)){p=x;break}}if(p===-1)break;const l=n.slice(0,m).trim(),b=n.slice(p+1).trim();n=l+(b.length>0?" "+b:"")}return n.includes("Parameters:")&&(n=n.split("Parameters:")[0].trim()),n}async function Le(r,n=[],s=[],m="",c="",a="",p=null){var E,L,S;const l=typeof a=="string"&&a.trim().length>0?a.trim():"https://sage-api-ttyw-stage.superwise.ai/api/v1/",b=l.replace(/\/+$/,"").endsWith("/chat")?l:l.replace(/\/+$/,"")+"/chat",x=Array.isArray(n)?n.map(u=>({role:u.role,message:u.content!=null?u.content:""})):[],w={user_input:r,chat_history:x,mql_df:Array.isArray(s)?s:[],agent_id:m,discovery_agent_id:c,utm_source:"Web",utm_medium:"chatbot"};console.log("Sending payload:",w);try{const u=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(w),signal:p??void 0});if(console.log("Response status:",u.status),console.log("Response headers:",u.headers),!u.ok){const N=await u.text();return console.error("API Error Response:",N),{reply:te,mqlDf:[],isError:!0,status:u.status}}const g=await u.json();console.log("API Response Data:",g);let I="⚠️ No reply from server.",H=[],W=!1;return g.chat_response?I=g.chat_response:g.success&&((E=g.data)!=null&&E.chat_response)?I=g.data.chat_response:g.message&&(I=g.message),g.mql_df?H=g.mql_df:(L=g.data)!=null&&L.mql_df&&(H=g.data.mql_df),(g.chat_history_limit_exceeded===!0||((S=g.data)==null?void 0:S.chat_history_limit_exceeded)===!0)&&(W=!0),I=je(I),{reply:I,mqlDf:H,chatHistoryLimitExceeded:W}}catch(u){if(console.error("API call failed:",u),u.name==="AbortError")throw u;return u.name==="TypeError"&&u.message.includes("fetch")?{reply:te,mqlDf:[],isError:!0}:{reply:te,mqlDf:[],isError:!0}}}async function Ie(r,n=null,s=[],m=""){const p=(typeof m=="string"&&m.trim().length>0?m.trim():"https://sage-api-ttyw-stage.superwise.ai/api/v1/").replace(/\/+$/,"").replace(/\/chat\/?$/,"").replace(/\/+$/,"")+"/pdf",l=Array.isArray(r)&&r.length>0?r[0]:n||{name:"User",email:"user@example.com",summary:"Chat conversation summary"},b=Array.isArray(s)?s.map(w=>({role:w.role,message:w.content!=null?w.content:""})):[],x={lead_row:l,chat_history:b};console.log("Downloading PDF with payload:",x);try{const w=await fetch(p,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/pdf"},body:JSON.stringify(x)});if(console.log("PDF Response status:",w.status),!w.ok){const u=await w.text();throw console.error("PDF API Error Response:",u),new Error(`PDF API Error ${w.status}: ${u}`)}const E=await w.blob(),L=window.URL.createObjectURL(E),S=document.createElement("a");return S.href=L,S.download=`chatbot-report-${new Date().toISOString().split("T")[0]}.pdf`,document.body.appendChild(S),S.click(),document.body.removeChild(S),window.URL.revokeObjectURL(L),!0}catch(w){throw console.error("PDF download failed:",w),w}}const h={container:{position:"fixed",bottom:"0px",right:"20px",zIndex:999999,fontFamily:"'Inter', sans-serif",maxWidth:"400px",width:"80vw",maxHeight:"75vh",height:"75vh",display:"flex",flexDirection:"column",borderRadius:"1rem",background:"white",boxShadow:"0 0 8rem 0 rgba(0, 0, 0, 0.1), 0rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5)",boxSizing:"border-box"},containerExpanded:{position:"fixed",top:"0px",left:"0px",right:"0px",bottom:"0px",zIndex:999999,fontFamily:"'Inter', sans-serif",width:"100%",height:"100%",display:"flex",flexDirection:"column",borderRadius:"0",background:"white",boxShadow:"0 0 8rem 0 rgba(0, 0, 0, 0.1), 0rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5)",boxSizing:"border-box"},containerMinimized:{position:"fixed",bottom:"20px",right:"20px",zIndex:999999,fontFamily:"'Inter', sans-serif",width:"auto",minWidth:"250px",maxWidth:"350px",height:"auto",display:"flex",flexDirection:"row",borderRadius:"25px",background:"#000000",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",boxSizing:"border-box",padding:"12px 16px",alignItems:"center",cursor:"pointer"},header:{position:"relative",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px",background:"var(--swttyw-primary-color)",color:"#fff",borderRadius:"10px 10px 0 0",fontFamily:"'Inter', sans-serif",flexShrink:0,boxSizing:"border-box"},name:{fontWeight:500,fontSize:"var(--swttyw-header-font-size)",color:"#fff",flexGrow:1,marginBottom:"0.125rem",wordBreak:"break-all"},headerActions:{display:"flex",alignItems:"center",gap:"8px"},headerButton:{background:"transparent",border:"none",color:"#fff",cursor:"pointer",padding:"4px",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",textDecoration:"none",transition:"opacity 0.3s ease"},chatSection:{padding:"1rem",backgroundColor:"var(--swttyw-background-color)",flexGrow:1,overflowY:"auto",overflowX:"hidden",display:"flex",flexDirection:"column",boxShadow:"inset 0 2rem 2rem -2rem rgba(0, 0, 0, 0.05), inset 0 -2rem 2rem -2rem rgba(0, 0, 0, 0.05)",height:"calc(50vh - 200px)"},inputSection:{boxSizing:"border-box",flexBasis:"4rem",flexShrink:0,display:"flex",alignItems:"center",boxShadow:"0 0 1rem rgba(0, 0, 0, 0.1), 0rem 1rem 1rem -1rem rgba(0, 0, 0, 0.2)",margin:"0.50rem"},textarea:{border:"none",backgroundImage:"none",backgroundColor:"white",padding:"0.5rem 1rem",marginRight:"1rem",borderRadius:"10px",flexGrow:2,fontFamily:"'Inter', sans-serif",fontWeight:400,letterSpacing:"0.025em",resize:"none",fontSize:"16px",outline:"none"},inputFooter:{display:"flex",flexDirection:"column",justifyContent:"space-between",padding:"5px"},sendButton:{background:"transparent",border:"0px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#000000"},characterCount:{fontSize:"12px",color:"var(--swttyw-primary-color)",textAlign:"center"},modalOverlay:{position:"absolute",background:"#ffffffe8",height:"calc(100% - 85px)",width:"100%",top:"48px",display:"flex",justifyContent:"center",alignItems:"center"},modalBody:{textAlign:"center"},modalActions:{display:"flex",justifyContent:"center"},footer:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--swttyw-primary-color)",borderRadius:"0 0 10px 10px",paddingBottom:"6px",paddingTop:"6px",marginTop:"0px",color:"#f8f9fa",fontSize:"var(--swttyw-footer-font-size)",borderTop:"3px solid var(--swttyw-primary-color)",padding:"15px 0px",fontFamily:"'Inter', sans-serif"},message:{boxSizing:"border-box",padding:"0.5rem 1rem",margin:"1rem",background:"#FFF",borderRadius:"1.125rem 1.125rem 1.125rem 0",minHeight:"2.25rem",width:"fit-content",boxShadow:"0 0 2rem rgba(0, 0, 0, 0.075), 0rem 1rem 1rem -1rem rgba(0, 0, 0, 0.1)",fontSize:"15px",wordBreak:"break-word",fontFamily:"'Inter', sans-serif",display:"table",alignItems:"flex-start",gap:"8px",position:"relative"},messageSelf:{margin:"1rem 1rem 1rem auto",borderRadius:"1.125rem 1.125rem 0 1.125rem",background:"#000000",color:"white",position:"relative",maxWidth:"80%",fontSize:"var(--swttyw-body-font-size)",flexDirection:"row-reverse"},messageOther:{position:"relative",fontSize:"var(--swttyw-body-font-size)"},messageAvatar:{width:"24px",height:"24px",borderRadius:"50%",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"bold",position:"absolute",top:"5px"},messageContent:{flex:1,marginLeft:"32px",marginRight:"8px"},minimizedContent:{display:"flex",alignItems:"center",gap:"12px",color:"white",flex:1},chatIcon:{width:"20px",height:"20px",flexShrink:0},minimizedTitle:{color:"white",fontSize:"16px",fontWeight:"500",margin:0}},He=`@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');\r
22
+ <%s key={someKey} {...props} />`,j,E,I,E),Y[E+j]=!0)}if(E=null,S!==void 0&&(a(S),E=""+S),m(p)&&(a(p.key),E=""+p.key),"key"in p){S={};for(var K in p)K!=="key"&&(S[K]=p[K])}else S=p;return E&&c(S,typeof r=="function"?r.displayName||r.name||"Unknown":r),b(r,E,S,l(),M,ne)}function L(r){y(r)?r._store&&(r._store.validated=1):typeof r=="object"&&r!==null&&r.$$typeof===$&&(r._payload.status==="fulfilled"?y(r._payload.value)&&r._payload.value._store&&(r._payload.value._store.validated=1):r._store&&(r._store.validated=1))}function y(r){return typeof r=="object"&&r!==null&&r.$$typeof===u}var x=i,u=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),A=Symbol.for("react.context"),oe=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),W=Symbol.for("react.client.reference"),X=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe=Object.prototype.hasOwnProperty,le=Array.isArray,O=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(r){return r()}};var D,re={},ce=x.react_stack_bottom_frame.bind(x,s)(),Z=O(d(s)),Y={};ee.Fragment=R,ee.jsx=function(r,p,S){var j=1e4>X.recentlyCreatedOwnerStacks++;return f(r,p,S,!1,j?Error("react-stack-top-frame"):ce,j?O(d(r)):Z)},ee.jsxs=function(r,p,S){var j=1e4>X.recentlyCreatedOwnerStacks++;return f(r,p,S,!0,j?Error("react-stack-top-frame"):ce,j?O(d(r)):Z)}}()),ee}process.env.NODE_ENV==="production"?me.exports=_e():me.exports=Me();var e=me.exports;const Pe=["Parameters:","additional_parameter_company_name:","additional_parameter_company_size:","additional_parameter_user_role:","additional_parameter_use_case:"],te="Apologize, I’m unable to respond at the moment. Please try asking your question again or click Contact Sales to get in touch with our team.";function Ae(t){if(typeof t!="string"||t.length===0)return t;let n=t;for(const a of Pe)for(;;){const d=n.indexOf(a);if(d===-1)break;const l=n.indexOf("{",d);if(l===-1)break;let s=0,m=-1;for(let b=l;b<n.length;b++){const f=n[b];if(f==="{")s++;else if(f==="}"&&(s--,s===0)){m=b;break}}if(m===-1)break;const c=n.slice(0,d).trim(),g=n.slice(m+1).trim();n=c+(g.length>0?" "+g:"")}return n.includes("Parameters:")&&(n=n.split("Parameters:")[0].trim()),n}function Ve(t){if(typeof t!="string"||t.length===0)return t;const n=t.trim();return n.startsWith("Message: ")?n.slice(9).trim():n.startsWith("Message : ")?n.slice(11).trim():t}async function We(t,n=[],a=[],d="",l="",s="",m=null){var L,y,x;const c=typeof s=="string"&&s.trim().length>0?s.trim():"https://sage-api-ttyw-stage.superwise.ai/api/v1/",g=c.replace(/\/+$/,"").endsWith("/chat")?c:c.replace(/\/+$/,"")+"/chat",b=Array.isArray(n)?n.map(u=>({role:u.role,message:u.content!=null?u.content:""})):[],f={user_input:t,chat_history:b,mql_df:Array.isArray(a)?a:[],agent_id:d,discovery_agent_id:l,utm_source:"Web",utm_medium:"chatbot"};console.log("Sending payload:",f);try{const u=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(f),signal:m??void 0});if(console.log("Response status:",u.status),console.log("Response headers:",u.headers),!u.ok){const J=await u.text();return console.error("API Error Response:",J),{reply:te,mqlDf:[],isError:!0,status:u.status}}const h=await u.json();console.log("API Response Data:",h);let R="⚠️ No reply from server.",P=[],z=!1;return h.chat_response?R=h.chat_response:h.success&&((L=h.data)!=null&&L.chat_response)?R=h.data.chat_response:h.message&&(R=h.message),h.mql_df?P=h.mql_df:(y=h.data)!=null&&y.mql_df&&(P=h.data.mql_df),(h.chat_history_limit_exceeded===!0||((x=h.data)==null?void 0:x.chat_history_limit_exceeded)===!0)&&(z=!0),R=Ae(R),R=Ve(R),{reply:R,mqlDf:P,chatHistoryLimitExceeded:z}}catch(u){if(console.error("API call failed:",u),u.name==="AbortError")throw u;return u.name==="TypeError"&&u.message.includes("fetch")?{reply:te,mqlDf:[],isError:!0}:{reply:te,mqlDf:[],isError:!0}}}async function Te(t,n=null,a=[],d=""){const m=(typeof d=="string"&&d.trim().length>0?d.trim():"https://sage-api-ttyw-stage.superwise.ai/api/v1/").replace(/\/+$/,"").replace(/\/chat\/?$/,"").replace(/\/+$/,"")+"/pdf",c=Array.isArray(t)&&t.length>0?t[0]:n||{name:"User",email:"user@example.com",summary:"Chat conversation summary"},g=Array.isArray(a)?a.map(f=>({role:f.role,message:f.content!=null?f.content:""})):[],b={lead_row:c,chat_history:g};console.log("Downloading PDF with payload:",b);try{const f=await fetch(m,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/pdf"},body:JSON.stringify(b)});if(console.log("PDF Response status:",f.status),!f.ok){const u=await f.text();throw console.error("PDF API Error Response:",u),new Error(`PDF API Error ${f.status}: ${u}`)}const L=await f.blob(),y=window.URL.createObjectURL(L),x=document.createElement("a");return x.href=y,x.download=`chatbot-report-${new Date().toISOString().split("T")[0]}.pdf`,document.body.appendChild(x),x.click(),document.body.removeChild(x),window.URL.revokeObjectURL(y),!0}catch(f){throw console.error("PDF download failed:",f),f}}const w={container:{position:"fixed",bottom:"20px",right:"20px",zIndex:999999,fontFamily:"'Inter', sans-serif",maxWidth:"400px",width:"80vw",maxHeight:"75vh",height:"75vh",display:"flex",flexDirection:"column",borderRadius:"1rem",background:"white",boxShadow:"0 0 8rem 0 rgba(0, 0, 0, 0.1), 0rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5)",boxSizing:"border-box"},containerExpanded:{position:"fixed",top:"5px",left:"10px",right:"20px",bottom:"20px",zIndex:999999,fontFamily:"'Inter', sans-serif",display:"flex",flexDirection:"column",borderRadius:"0",background:"white",boxShadow:"0 0 8rem 0 rgba(0, 0, 0, 0.1), 0rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5)",boxSizing:"border-box"},containerMinimized:{position:"fixed",bottom:"20px",right:"20px",zIndex:999999,fontFamily:"'Inter', sans-serif",width:"auto",minWidth:"250px",maxWidth:"350px",height:"auto",display:"flex",flexDirection:"row",borderRadius:"25px",background:"#000000",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",boxSizing:"border-box",padding:"12px 16px",alignItems:"center",cursor:"pointer"},header:{position:"relative",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px",background:"var(--swttyw-primary-color)",color:"#fff",borderRadius:"10px 10px 0 0",fontFamily:"'Inter', sans-serif",flexShrink:0,boxSizing:"border-box"},name:{fontWeight:500,fontSize:"var(--swttyw-header-font-size)",color:"#fff",flexGrow:1,marginBottom:"0.125rem",wordBreak:"break-all"},headerActions:{display:"flex",alignItems:"center",gap:"8px"},headerButton:{background:"transparent",border:"none",color:"#fff",cursor:"pointer",padding:"4px",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",textDecoration:"none",transition:"opacity 0.3s ease"},chatSection:{padding:"1rem",backgroundColor:"var(--swttyw-background-color)",flexGrow:1,overflowY:"auto",overflowX:"hidden",display:"flex",flexDirection:"column",boxShadow:"inset 0 2rem 2rem -2rem rgba(0, 0, 0, 0.05), inset 0 -2rem 2rem -2rem rgba(0, 0, 0, 0.05)",height:"calc(50vh - 200px)"},inputSection:{boxSizing:"border-box",flexBasis:"4rem",flexShrink:0,display:"flex",alignItems:"center",boxShadow:"0 0 1rem rgba(0, 0, 0, 0.1), 0rem 1rem 1rem -1rem rgba(0, 0, 0, 0.2)",margin:"0.50rem"},textarea:{border:"none",backgroundImage:"none",backgroundColor:"white",padding:"0.5rem 1rem",marginRight:"1rem",borderRadius:"10px",flexGrow:2,fontFamily:"'Inter', sans-serif",fontWeight:400,letterSpacing:"0.025em",resize:"none",fontSize:"16px",outline:"none"},inputFooter:{display:"flex",flexDirection:"column",justifyContent:"space-between",padding:"5px"},sendButton:{background:"transparent",border:"0px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#000000"},characterCount:{fontSize:"12px",color:"var(--swttyw-primary-color)",textAlign:"center"},modalOverlay:{position:"absolute",background:"#ffffffe8",height:"calc(100% - 85px)",width:"100%",top:"48px",display:"flex",justifyContent:"center",alignItems:"center"},modalBody:{textAlign:"center"},modalActions:{display:"flex",justifyContent:"center"},footer:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--swttyw-primary-color)",borderRadius:"0 0 10px 10px",paddingBottom:"6px",paddingTop:"6px",marginTop:"0px",color:"#f8f9fa",fontSize:"var(--swttyw-footer-font-size)",borderTop:"3px solid var(--swttyw-primary-color)",padding:"15px 0px",fontFamily:"'Inter', sans-serif"},message:{boxSizing:"border-box",padding:"0.5rem 1rem",margin:"1rem",background:"#FFF",borderRadius:"1.125rem 1.125rem 1.125rem 0",minHeight:"2.25rem",width:"fit-content",boxShadow:"0 0 2rem rgba(0, 0, 0, 0.075), 0rem 1rem 1rem -1rem rgba(0, 0, 0, 0.1)",fontSize:"15px",wordBreak:"break-word",fontFamily:"'Inter', sans-serif",display:"table",alignItems:"flex-start",gap:"8px",position:"relative"},messageSelf:{margin:"1rem 1rem 1rem auto",borderRadius:"1.125rem 1.125rem 0 1.125rem",background:"#000000",color:"white",position:"relative",maxWidth:"80%",fontSize:"var(--swttyw-body-font-size)",flexDirection:"row-reverse"},messageOther:{position:"relative",fontSize:"var(--swttyw-body-font-size)"},messageAvatar:{width:"24px",height:"24px",borderRadius:"50%",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"bold",position:"absolute",top:"5px"},messageContent:{flex:1,marginLeft:"32px",marginRight:"8px"},minimizedContent:{display:"flex",alignItems:"center",gap:"12px",color:"white",flex:1},chatIcon:{width:"20px",height:"20px",flexShrink:0},minimizedTitle:{color:"white",fontSize:"16px",fontWeight:"500",margin:0}},Fe=`@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');\r
23
23
  \r
24
24
  .sw-ttyw-chatbot {\r
25
25
  --swttyw-primary-color: #000;\r
@@ -55,6 +55,15 @@ React keys must be passed directly to JSX without using spread:
55
55
  opacity: 0.9;\r
56
56
  }\r
57
57
  \r
58
+ /* Loading (typing) bubble: give it a comfortable min-height so it doesn't look cramped */\r
59
+ .sw-ttyw-chatbot .message-loading .message-content {\r
60
+ min-height: 1.75rem !important;\r
61
+ min-width: 4.5rem !important;\r
62
+ display: flex !important;\r
63
+ align-items: center !important;\r
64
+ padding: 0.25rem 0 0.25rem 0.5rem !important;\r
65
+ } \r
66
+ \r
58
67
  .typing {\r
59
68
  display: inline-block !important;\r
60
69
  width: 0.8rem !important;\r
@@ -191,6 +200,7 @@ React keys must be passed directly to JSX without using spread:
191
200
  flex-wrap: wrap;\r
192
201
  gap: 10px;\r
193
202
  align-items: center;\r
203
+ justify-content: center;\r
194
204
  }\r
195
205
  \r
196
206
  .sw-ttyw-limit-download-pdf,\r
@@ -323,6 +333,14 @@ React keys must be passed directly to JSX without using spread:
323
333
  overflow-x: hidden;\r
324
334
  }\r
325
335
  \r
336
+ /* Reduce space taken by <br> in responses (avoid large gaps after paragraphs) */\r
337
+ .sw-ttyw-markdown br {\r
338
+ display: block;\r
339
+ line-height: 0.5;\r
340
+ margin: 0;\r
341
+ padding: 0;\r
342
+ }\r
343
+ \r
326
344
  .sw-ttyw-markdown pre,\r
327
345
  .sw-ttyw-markdown pre.sw-ttyw-code-block {\r
328
346
  margin: 0.5em 0;\r
@@ -351,12 +369,18 @@ React keys must be passed directly to JSX without using spread:
351
369
  }\r
352
370
  \r
353
371
  .sw-ttyw-markdown ul {\r
354
- margin: 0.5em 0;\r
372
+ margin: 0.35em 0;\r
355
373
  padding-left: 1.25em;\r
356
374
  list-style: disc;\r
375
+ } \r
376
+ .sw-ttyw-markdown ul ul {\r
377
+ margin: 0.2em 0;\r
378
+ padding-left: 1.25em;\r
379
+ list-style: circle;\r
357
380
  }\r
358
381
  .sw-ttyw-markdown li {\r
359
- margin: 0.2em 0;\r
382
+ margin: 0.15em 0;\r
383
+ line-height: 1.4;\r
360
384
  }\r
361
385
  \r
362
386
  .sw-ttyw-markdown a {\r
@@ -379,7 +403,7 @@ React keys must be passed directly to JSX without using spread:
379
403
  font-weight: 600;\r
380
404
  font-size: 1.05em;\r
381
405
  margin: 0.75em 0 0.35em;\r
382
- line-height: 1.35;\r
406
+ line-height: 1.0;\r
383
407
  color: inherit;\r
384
408
  }\r
385
409
  .sw-ttyw-markdown .sw-ttyw-text-block:first-child {\r
@@ -425,9 +449,34 @@ React keys must be passed directly to JSX without using spread:
425
449
  #sw-ttyw-chat-send-message:disabled svg,\r
426
450
  #sw-ttyw-chat-send-message:disabled path {\r
427
451
  cursor: not-allowed;\r
428
- }`,Re="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='190'%20height='42'%20viewBox='0%200%20190%2042'%20fill='none'%3e%3cpath%20d='M17.2253%2014.2603C17.155%2014.0259%2016.9441%2013.8618%2016.7097%2013.8618H14.6472C14.3894%2013.8618%2014.1785%2014.0259%2014.1316%2014.2603L10.7801%2027.5053C10.7332%2027.6694%2010.7801%2027.8335%2010.8739%2027.9741C10.9676%2028.1148%2011.1317%2028.1851%2011.2957%2028.1851H12.9363C13.1941%2028.1851%2013.4051%2027.9976%2013.4754%2027.7631L14.0613%2025.0673H17.3191L17.905%2027.7631C17.9519%2028.021%2018.1862%2028.1851%2018.444%2028.1851H20.0846C20.2487%2028.1851%2020.4128%2028.1148%2020.5065%2027.9741C20.6003%2027.8335%2020.6471%2027.6694%2020.6003%2027.5053L17.2488%2014.2603H17.2253ZM14.5769%2022.5824L15.655%2017.636L16.7566%2022.5824H14.5769Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M23.8359%2013.8618H22.2656C21.9609%2013.8618%2021.7266%2014.0962%2021.7266%2014.401V27.6459C21.7266%2027.9507%2021.9609%2028.1851%2022.2656%2028.1851H23.8359C24.1406%2028.1851%2024.375%2027.9507%2024.375%2027.6459V14.401C24.375%2014.0962%2024.1406%2013.8618%2023.8359%2013.8618ZM22.2891%2014.0493C22.2422%2014.0493%2022.1953%2014.0493%2022.1484%2014.0728C22.1953%2014.0728%2022.2422%2014.0493%2022.2891%2014.0493Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M36.1401%2029.4041L36.0932%2012.5256C36.0932%2011.3066%2035.4369%2010.1579%2034.3588%209.5484L19.7341%201.15601C18.6794%200.546507%2017.3669%200.546507%2016.2888%201.15601L1.71091%209.61872C0.65624%2010.2282%200%2011.3769%200%2012.5959L0.046874%2029.4744C0.046874%2030.6934%200.703114%2031.8421%201.78122%2032.4516L16.406%2040.844C17.4607%2041.4535%2018.7731%2041.4535%2019.8513%2040.844L34.4291%2032.3813C35.4838%2031.7718%2036.1401%2030.6231%2036.1401%2029.4041ZM11.9998%2031.5608C6.16397%2028.1851%204.17181%2020.7539%207.54676%2014.9167C10.8983%209.07955%2018.3513%207.08694%2024.1871%2010.4626C30.023%2013.8149%2032.0151%2021.2696%2028.6402%2027.1068C25.2887%2032.9439%2017.8357%2034.9365%2011.9998%2031.5608Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M46.3593%2014.19C46.6171%2013.9087%2046.9218%2013.6977%2047.2734%2013.557C47.6249%2013.4164%2048.0468%2013.3461%2048.5155%2013.3461C48.9843%2013.3461%2049.6171%2013.4398%2050.0858%2013.6508C50.5546%2013.8618%2050.9295%2014.1665%2051.2342%2014.5416C51.3983%2014.7526%2051.5623%2014.987%2051.6795%2015.2683C51.8202%2015.5496%2051.9139%2015.8309%2051.9608%2016.1357L55.4295%2015.0574C55.1717%2014.1431%2054.8201%2013.3695%2054.3748%2012.7131C53.9295%2012.0567%2053.3904%2011.4941%2052.7576%2011.0487C52.1952%2010.6502%2051.5623%2010.3689%2050.8358%2010.1813C50.1327%209.99379%2049.3593%209.90002%2048.5624%209.90002C47.7655%209.90002%2046.5937%2010.0407%2045.7734%2010.3454C44.9765%2010.6502%2044.2734%2011.0956%2043.7109%2011.6816C43.125%2012.2443%2042.7031%2012.9241%2042.4219%2013.7211C42.1406%2014.5182%2042%2015.4324%2042%2016.4405C42%2017.4485%2042.1641%2018.5034%2042.5156%2019.277C42.8672%2020.0506%2043.3828%2020.707%2044.0859%2021.2461C44.789%2021.7853%2045.7031%2022.2776%2046.8515%2022.6761L48.8436%2023.4028C49.5702%2023.6842%2050.1561%2023.9655%2050.5546%2024.2702C50.953%2024.5515%2051.2342%2024.8797%2051.3983%2025.2314C51.5623%2025.583%2051.6327%2026.0284%2051.6327%2026.5676C51.6327%2027.1067%2051.5858%2027.4818%2051.4686%2027.8335C51.3749%2028.1851%2051.1874%2028.4899%2050.9764%2028.7712C50.742%2029.0759%2050.4374%2029.2869%2050.0624%2029.4275C49.7108%2029.5682%2049.2889%2029.6385%2048.8202%2029.6385C48.3515%2029.6385%2047.7187%2029.5448%2047.2734%2029.3338C46.8046%2029.1228%2046.4296%2028.818%2046.1249%2028.443C45.9374%2028.232%2045.7734%2027.9976%2045.6562%2027.6928C45.5156%2027.4115%2045.4453%2027.1067%2045.3749%2026.802L41.8594%2027.7866C42.0937%2028.7008%2042.4453%2029.4979%2042.8906%2030.2011C43.3594%2030.9044%2043.8984%2031.467%2044.5546%2031.9359C45.1406%2032.311%2045.7734%2032.5923%2046.4765%2032.8032C47.1796%2033.0142%2047.953%2033.108%2048.7499%2033.108C49.5468%2033.108%2050.742%2032.9439%2051.5389%2032.6626C52.3592%2032.3578%2053.0623%2031.9124%2053.6483%2031.3029C54.1873%2030.7169%2054.6092%2030.0136%2054.9139%2029.1931C55.2185%2028.3726%2055.3592%2027.4349%2055.3592%2026.3566C55.3592%2025.2782%2055.1951%2024.2702%2054.8435%2023.4966C54.492%2022.723%2053.9764%2022.0666%2053.2498%2021.5275C52.5233%2020.9883%2051.5858%2020.496%2050.3905%2020.0506L48.4218%2019.3239C47.6952%2019.0426%2047.1327%2018.7612%2046.7577%2018.4799C46.3593%2018.1752%2046.1015%2017.8704%2045.9609%2017.5188C45.8203%2017.1672%2045.7499%2016.7686%2045.7499%2016.2998C45.7499%2015.8309%2045.7968%2015.4324%2045.914%2015.0808C46.0077%2014.7292%2046.1718%2014.4478%2046.3593%2014.19Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M67.5233%2026.4504C67.5233%2027.1536%2067.4295%2027.7631%2067.242%2028.232C67.0545%2028.7008%2066.7499%2029.0525%2066.3046%2029.3103C65.8593%2029.5682%2065.2733%2029.6854%2064.5468%2029.6854C63.8202%2029.6854%2063.2109%2029.5682%2062.7656%2029.3103C62.3202%2029.0525%2062.0156%2028.7008%2061.8281%2028.232C61.6406%2027.7631%2061.5468%2027.1771%2061.5468%2026.4504V10.1579H57.8672V26.3332C57.8672%2027.6694%2058.1016%2028.8415%2058.5703%2029.8495C59.039%2030.8575%2059.7656%2031.6546%2060.75%2032.2406C61.7343%2032.8267%2063.0234%2033.108%2064.5702%2033.108C66.1171%2033.108%2067.3592%2032.8267%2068.367%2032.2406C69.3748%2031.6546%2070.1014%2030.8575%2070.5467%2029.8261C70.992%2028.7946%2071.2264%2027.6459%2071.2264%2026.3332V10.1579H67.5467V26.4504H67.5233Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M83.7186%2010.9549C82.7811%2010.4158%2081.5858%2010.1579%2080.1562%2010.1579H74.0859V32.8033H77.7656V24.9032H80.1093C81.5624%2024.9032%2082.7577%2024.6453%2083.6952%2024.1296C84.6327%2023.6138%2085.3358%2022.8168%2085.8045%2021.7385C86.2732%2020.6601%2086.5076%2019.2536%2086.5076%2017.5423C86.5076%2015.831%2086.2732%2014.4479%2085.8045%2013.3695C85.3358%2012.2912%2084.6327%2011.4941%2083.6952%2010.9549H83.7186ZM82.4999%2019.9099C82.2889%2020.4726%2081.9843%2020.8711%2081.5858%2021.1289C81.1874%2021.3868%2080.6718%2021.504%2080.0155%2021.504H77.7421V13.6274H80.0155C80.6718%2013.6274%2081.1874%2013.7446%2081.5858%2014.0025C81.9843%2014.2603%2082.2889%2014.6588%2082.4999%2015.2215C82.7108%2015.7841%2082.8046%2016.5577%2082.8046%2017.5423C82.8046%2018.5268%2082.7108%2019.3473%2082.4999%2019.9099Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M88.5938%2032.8267H99.7029V29.3807H92.2734V23.0043H98.4608V19.5817H92.2734V13.6274H99.7029V10.1813H88.5938V32.8267Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M111.797%2023.356C112.711%2022.8402%20113.437%2022.0666%20113.953%2021.0352C114.469%2020.0037%20114.726%2018.7144%20114.726%2017.1672C114.726%2015.62%20114.492%2014.2134%20114.023%2013.2054C113.555%2012.1739%20112.851%2011.4238%20111.961%2010.9315C111.047%2010.4392%20109.922%2010.2048%20108.586%2010.2048H102.023V32.8501H105.703V24.153H108.258L111.094%2032.8501H115.078L111.75%2023.4028C111.75%2023.4028%20111.797%2023.4028%20111.82%2023.3794L111.797%2023.356ZM105.68%2013.6274H108.422C108.961%2013.6274%20109.406%2013.7211%20109.805%2013.9321C110.18%2014.1431%20110.484%2014.4947%20110.695%2015.0105C110.906%2015.5028%20111%2016.2295%20111%2017.1437C111%2018.058%20110.906%2018.8081%20110.695%2019.3239C110.484%2019.8396%20110.203%2020.1912%20109.828%2020.4022C109.453%2020.6132%20109.008%2020.707%20108.469%2020.707H105.703V13.6508L105.68%2013.6274Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M132.234%2027.3412L129.047%2010.1813H125.508L122.344%2027.2474L119.086%2010.1813H115.148L120.328%2032.8267H124.148L127.289%2017.6595L130.406%2032.8267H134.226L139.382%2010.1813H135.492L132.234%2027.3412Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M144.773%2010.1813H141.094V32.8267H144.773V10.1813Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M151.851%2014.19C152.109%2013.9087%20152.414%2013.6977%20152.766%2013.557C153.117%2013.4164%20153.539%2013.3461%20154.008%2013.3461C154.476%2013.3461%20155.109%2013.4398%20155.578%2013.6508C156.047%2013.8618%20156.422%2014.1665%20156.726%2014.5416C156.89%2014.7526%20157.055%2014.987%20157.172%2015.2683C157.312%2015.5496%20157.406%2015.8309%20157.453%2016.1357L160.922%2015.0574C160.664%2014.1431%20160.312%2013.3695%20159.867%2012.7131C159.422%2012.0567%20158.883%2011.4941%20158.25%2011.0487C157.687%2010.6502%20157.055%2010.3689%20156.328%2010.1813C155.625%209.99379%20154.851%209.90002%20154.055%209.90002C153.258%209.90002%20152.086%2010.0407%20151.266%2010.3454C150.469%2010.6502%20149.766%2011.0956%20149.203%2011.6816C148.617%2012.2443%20148.195%2012.9241%20147.914%2013.7211C147.633%2014.5182%20147.492%2015.4324%20147.492%2016.4405C147.492%2017.4485%20147.656%2018.5034%20148.008%2019.277C148.359%2020.0506%20148.875%2020.707%20149.578%2021.2461C150.281%2021.7853%20151.195%2022.2776%20152.344%2022.6761L154.336%2023.4028C155.062%2023.6842%20155.648%2023.9655%20156.047%2024.2702C156.445%2024.5515%20156.726%2024.8797%20156.89%2025.2314C157.055%2025.583%20157.125%2026.0284%20157.125%2026.5676C157.125%2027.1067%20157.078%2027.4818%20156.961%2027.8335C156.867%2028.1851%20156.68%2028.4899%20156.469%2028.7712C156.234%2029.0759%20155.93%2029.2869%20155.555%2029.4275C155.203%2029.5682%20154.781%2029.6385%20154.312%2029.6385C153.844%2029.6385%20153.211%2029.5448%20152.766%2029.3338C152.297%2029.1228%20151.922%2028.818%20151.617%2028.443C151.43%2028.232%20151.266%2027.9976%20151.148%2027.6928C151.008%2027.4115%20150.914%2027.1067%20150.867%2026.802L147.352%2027.7866C147.586%2028.7008%20147.937%2029.4979%20148.383%2030.2011C148.852%2030.9044%20149.391%2031.467%20150.047%2031.9359C150.633%2032.311%20151.266%2032.5923%20151.969%2032.8032C152.672%2033.0142%20153.445%2033.108%20154.242%2033.108C155.039%2033.108%20156.234%2032.9439%20157.031%2032.6626C157.851%2032.3578%20158.555%2031.9124%20159.14%2031.3029C159.68%2030.7169%20160.101%2030.0136%20160.406%2029.1931C160.711%2028.3726%20160.851%2027.4349%20160.851%2026.3566C160.851%2025.2782%20160.687%2024.2702%20160.336%2023.4966C159.984%2022.723%20159.469%2022.0666%20158.742%2021.5275C158.015%2020.9883%20157.078%2020.496%20155.883%2020.0506L153.914%2019.3239C153.187%2019.0426%20152.625%2018.7612%20152.25%2018.4799C151.852%2018.1752%20151.594%2017.8704%20151.453%2017.5188C151.312%2017.1672%20151.242%2016.7686%20151.242%2016.2998C151.242%2015.8309%20151.289%2015.4324%20151.406%2015.0808C151.5%2014.7292%20151.664%2014.4478%20151.851%2014.19Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M174.633%2013.6274V10.1813H163.5V32.8267H174.633V29.3807H167.18V23.0043H173.367V19.5817H167.18V13.6274H174.633Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M179.316%2011.0956V10.1345H183.512V11.0956H181.918V15.8075H180.91V11.0956H179.316Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M184.168%2010.1345H185.41L186.676%2013.9321L187.941%2010.1345H189.184V15.8075H188.269V11.8223L187.098%2015.1511H186.254L185.082%2011.9161V15.831H184.168V10.1579V10.1345Z'%20fill='black'%3e%3c/path%3e%3c/svg%3e";let _e=0;function we({width:r=20,height:n=20,style:s}){const m=i.useRef(null);m.current||(m.current=`clip0_avatar_${++_e}`);const c=m.current;return e.jsxs("svg",{width:r,height:n,viewBox:"0 0 155 174",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:s,"aria-hidden":!0,children:[e.jsxs("g",{clipPath:`url(#${c})`,children:[e.jsx("path",{d:"M73.41 57.8388C73.15 56.8088 72.23 56.0988 71.17 56.0988H62.35C61.29 56.0988 60.37 56.8188 60.11 57.8488L45.8 114.299C45.62 114.999 45.78 115.719 46.22 116.289C46.66 116.859 47.33 117.179 48.05 117.179H55.05C56.13 117.179 57.08 116.419 57.31 115.359L59.83 103.889H73.76L76.29 115.359C76.52 116.409 77.47 117.179 78.55 117.179H85.54C86.26 117.179 86.92 116.849 87.37 116.289C87.81 115.719 87.96 114.999 87.79 114.299L73.44 57.8488L73.41 57.8388ZM62.12 93.3688L66.76 72.2188L71.42 93.3688H62.12Z",fill:"#FF0000"}),e.jsx("path",{d:"M101.69 56.0988H95.01C93.73 56.0988 92.7 57.1388 92.7 58.4088V114.859C92.7 116.139 93.74 117.169 95.01 117.169H101.69C102.97 117.169 104 116.129 104 114.859V58.4088C104 57.1288 102.96 56.0988 101.69 56.0988Z",fill:"#FF0000"}),e.jsx("path",{d:"M154.17 122.419L153.98 50.4588C153.97 45.2188 151.16 40.3788 146.61 37.7688L84.21 1.94879C79.66 -0.661205 74.07 -0.651206 69.54 1.98879L7.30003 38.1288C2.77003 40.7588 -0.00997311 45.6088 2.68877e-05 50.8488L0.190027 122.809C0.200027 128.049 3.01003 132.889 7.56003 135.499L69.97 171.319C74.52 173.929 80.11 173.919 84.64 171.279L146.87 135.139C151.4 132.509 154.19 127.659 154.17 122.409V122.419ZM51.11 131.639C26.26 117.289 17.74 85.5088 32.09 60.6488C46.44 35.7988 78.22 27.2788 103.08 41.6288C127.93 55.9788 136.45 87.7588 122.1 112.619C107.75 137.469 75.97 145.989 51.11 131.639Z",fill:"#FF0000"})]}),e.jsx("defs",{children:e.jsx("clipPath",{id:c,children:e.jsx("rect",{width:"154.17",height:"173.268",fill:"white"})})})]})}function Me({width:r,height:n=20,style:s}){const m=r??4.6875*n;return e.jsxs("svg",{width:m,height:n,viewBox:"0 0 75 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:s,"aria-hidden":!0,children:[e.jsx("path",{d:"M6.82917 5.34411C6.8013 5.25174 6.71768 5.18707 6.62476 5.18707H5.80712C5.70492 5.18707 5.62129 5.25174 5.60271 5.34411L4.27404 10.5635C4.25546 10.6282 4.27404 10.6928 4.31121 10.7483C4.34838 10.8037 4.41341 10.8314 4.47845 10.8314H5.12885C5.23106 10.8314 5.31468 10.7575 5.34255 10.6651L5.57484 9.60278H6.86634L7.09862 10.6651C7.11721 10.7667 7.21012 10.8314 7.31232 10.8314H7.96272C8.02776 10.8314 8.0928 10.8037 8.12997 10.7483C8.16713 10.6928 8.18571 10.6282 8.16713 10.5635L6.83846 5.34411H6.82917ZM5.77925 8.62356L6.20665 6.67437L6.64335 8.62356H5.77925Z",fill:"white"}),e.jsx("path",{d:"M9.44935 5.18707H8.82683C8.70604 5.18707 8.61313 5.27945 8.61313 5.39954V10.6189C8.61313 10.739 8.70604 10.8314 8.82683 10.8314H9.44935C9.57014 10.8314 9.66305 10.739 9.66305 10.6189V5.39954C9.66305 5.27945 9.57014 5.18707 9.44935 5.18707ZM8.83612 5.26097C8.81754 5.26097 8.79896 5.26098 8.78037 5.27021C8.79896 5.27021 8.81754 5.26097 8.83612 5.26097Z",fill:"white"}),e.jsx("path",{d:"M14.3273 11.3118L14.3087 4.66051C14.3087 4.18014 14.0486 3.72748 13.6212 3.4873L7.82334 0.180139C7.40523 -0.0600462 6.88491 -0.0600462 6.45751 0.180139L0.678271 3.51501C0.260159 3.7552 0 4.20785 0 4.68822L0.0185826 11.3395C0.0185826 11.8199 0.278741 12.2725 0.706145 12.5127L6.50396 15.8199C6.92208 16.06 7.44239 16.06 7.8698 15.8199L13.649 12.485C14.0671 12.2448 14.3273 11.7921 14.3273 11.3118ZM4.75719 12.1617C2.44363 10.8314 1.65386 7.903 2.99182 5.60277C4.32049 3.30254 7.27515 2.51732 9.5887 3.84758C11.9023 5.16859 12.692 8.10624 11.3541 10.4065C10.0254 12.7067 7.07074 13.4919 4.75719 12.1617Z",fill:"white"}),e.jsx("path",{d:"M18.3783 5.31638C18.4805 5.20553 18.6013 5.12239 18.7407 5.06696C18.8801 5.01153 19.0473 4.98382 19.2331 4.98382C19.419 4.98382 19.6698 5.02077 19.8557 5.10391C20.0415 5.18706 20.1902 5.30715 20.3109 5.45495C20.376 5.53809 20.441 5.63047 20.4875 5.74133C20.5432 5.85218 20.5804 5.96303 20.599 6.08313L21.9741 5.65819C21.8719 5.29791 21.7325 4.99306 21.556 4.7344C21.3795 4.47574 21.1657 4.25403 20.9149 4.07851C20.6919 3.92147 20.441 3.81061 20.153 3.73671C19.8742 3.6628 19.5676 3.62585 19.2517 3.62585C18.9358 3.62585 18.4712 3.68128 18.1461 3.80137C17.8301 3.92147 17.5514 4.09698 17.3284 4.32793C17.0961 4.54964 16.9289 4.81754 16.8174 5.13163C16.7059 5.44571 16.6501 5.80599 16.6501 6.20322C16.6501 6.60045 16.7152 7.01615 16.8545 7.321C16.9939 7.62585 17.1983 7.88451 17.4771 8.09699C17.7558 8.30946 18.1182 8.50345 18.5735 8.6605L19.3632 8.94687C19.6513 9.05772 19.8835 9.16858 20.0415 9.28867C20.1994 9.39953 20.3109 9.52886 20.376 9.66742C20.441 9.80599 20.4689 9.98151 20.4689 10.194C20.4689 10.4065 20.4503 10.5543 20.4039 10.6928C20.3667 10.8314 20.2924 10.9515 20.2087 11.0623C20.1158 11.1824 19.995 11.2656 19.8464 11.321C19.707 11.3764 19.5398 11.4041 19.3539 11.4041C19.1681 11.4041 18.9172 11.3672 18.7407 11.2841C18.5549 11.2009 18.4062 11.0808 18.2854 10.933C18.2111 10.8499 18.1461 10.7575 18.0996 10.6374C18.0438 10.5265 18.016 10.4065 17.9881 10.2864L16.5944 10.6744C16.6873 11.0346 16.8267 11.3487 17.0032 11.6259C17.189 11.903 17.4027 12.1247 17.6629 12.3095C17.8952 12.4573 18.1461 12.5681 18.4248 12.6513C18.7035 12.7344 19.0101 12.7714 19.3261 12.7714C19.642 12.7714 20.1158 12.7067 20.4317 12.5958C20.7569 12.4757 21.0357 12.3002 21.268 12.06C21.4817 11.8291 21.6489 11.552 21.7697 11.2286C21.8905 10.9053 21.9462 10.5358 21.9462 10.1108C21.9462 9.6859 21.8812 9.28867 21.7418 8.98382C21.6024 8.67897 21.398 8.42031 21.11 8.20784C20.822 7.99537 20.4503 7.80137 19.9765 7.62585L19.196 7.33948C18.9079 7.22862 18.685 7.11777 18.5363 7.00691C18.3783 6.88682 18.2761 6.76673 18.2204 6.62816C18.1646 6.4896 18.1368 6.33255 18.1368 6.14779C18.1368 5.96304 18.1553 5.80599 18.2018 5.66742C18.239 5.52885 18.304 5.418 18.3783 5.31638Z",fill:"white"}),e.jsx("path",{d:"M26.7684 10.1478C26.7684 10.4249 26.7313 10.6651 26.657 10.8499C26.5826 11.0346 26.4618 11.1732 26.2853 11.2748C26.1088 11.3764 25.8765 11.4226 25.5884 11.4226C25.3004 11.4226 25.0588 11.3764 24.8823 11.2748C24.7058 11.1732 24.585 11.0346 24.5106 10.8499C24.4363 10.6651 24.3991 10.4342 24.3991 10.1478V3.72748H22.9404V10.1016C22.9404 10.6282 23.0333 11.0901 23.2191 11.4873C23.405 11.8845 23.693 12.1986 24.0832 12.4296C24.4735 12.6605 24.9845 12.7714 25.5977 12.7714C26.211 12.7714 26.7034 12.6605 27.1029 12.4296C27.5025 12.1986 27.7905 11.8845 27.967 11.4781C28.1436 11.0716 28.2365 10.6189 28.2365 10.1016V3.72748H26.7777V10.1478H26.7684Z",fill:"white"}),e.jsx("path",{d:"M33.1888 4.04157C32.8171 3.8291 32.3433 3.72748 31.7765 3.72748H29.37V12.6513H30.8288V9.5381H31.7579C32.334 9.5381 32.8078 9.43648 33.1795 9.23325C33.5511 9.03002 33.8299 8.71593 34.0157 8.29099C34.2015 7.86605 34.2945 7.31177 34.2945 6.63741C34.2945 5.96304 34.2015 5.41801 34.0157 4.99307C33.8299 4.56813 33.5511 4.25404 33.1795 4.04157H33.1888ZM32.7056 7.57043C32.622 7.79214 32.5012 7.94919 32.3433 8.0508C32.1853 8.15242 31.9809 8.19861 31.7207 8.19861H30.8195V5.09469H31.7207C31.9809 5.09469 32.1853 5.14088 32.3433 5.24249C32.5012 5.34411 32.622 5.50115 32.7056 5.72286C32.7893 5.94457 32.8264 6.24942 32.8264 6.63741C32.8264 7.0254 32.7893 7.34873 32.7056 7.57043Z",fill:"white"}),e.jsx("path",{d:"M35.1214 12.6605H39.5255V11.3025H36.5801V8.78981H39.0331V7.44108H36.5801V5.09466H39.5255V3.73669H35.1214V12.6605Z",fill:"white"}),e.jsx("path",{d:"M44.3199 8.92842C44.6822 8.72519 44.9703 8.42034 45.1747 8.01387C45.3791 7.6074 45.4813 7.09932 45.4813 6.48962C45.4813 5.87992 45.3884 5.32565 45.2026 4.92842C45.0167 4.52195 44.738 4.22634 44.3849 4.03235C44.0226 3.83835 43.5766 3.74597 43.047 3.74597H40.4454V12.6698H41.9041V9.24251H42.9169L44.0411 12.6698H45.6207L44.3013 8.94689C44.3013 8.94689 44.3199 8.9469 44.3292 8.93766L44.3199 8.92842ZM41.8948 5.0947H42.9819C43.1956 5.0947 43.3722 5.13165 43.5301 5.21479C43.6788 5.29793 43.7996 5.4365 43.8832 5.63974C43.9668 5.83373 44.004 6.12011 44.004 6.48038C44.004 6.84066 43.9668 7.13627 43.8832 7.3395C43.7996 7.54274 43.6881 7.68131 43.5394 7.76445C43.3907 7.84759 43.2142 7.88454 43.0005 7.88454H41.9041V5.10394L41.8948 5.0947Z",fill:"white"}),e.jsx("path",{d:"M52.4219 10.4988L51.1583 3.73669H49.7553L48.501 10.4619L47.2095 3.73669H45.6485L47.7019 12.6605H49.2164L50.4615 6.68358L51.6972 12.6605H53.2117L55.2558 3.73669H53.7134L52.4219 10.4988Z",fill:"white"}),e.jsx("path",{d:"M57.3928 3.73669H55.9341V12.6605H57.3928V3.73669Z",fill:"white"}),e.jsx("path",{d:"M60.1988 5.31638C60.301 5.20553 60.4218 5.12239 60.5612 5.06696C60.7006 5.01153 60.8678 4.98382 61.0536 4.98382C61.2395 4.98382 61.4903 5.02077 61.6762 5.10391C61.862 5.18706 62.0107 5.30715 62.1314 5.45495C62.1965 5.53809 62.2615 5.63047 62.308 5.74133C62.3637 5.85218 62.4009 5.96303 62.4195 6.08313L63.7946 5.65819C63.6924 5.29791 63.553 4.99306 63.3765 4.7344C63.1999 4.47574 62.9862 4.25403 62.7354 4.07851C62.5124 3.92147 62.2615 3.81061 61.9735 3.73671C61.6947 3.6628 61.3881 3.62585 61.0722 3.62585C60.7563 3.62585 60.2917 3.68128 59.9665 3.80137C59.6506 3.92147 59.3719 4.09698 59.1489 4.32793C58.9166 4.54964 58.7494 4.81754 58.6379 5.13163C58.5264 5.44571 58.4706 5.80599 58.4706 6.20322C58.4706 6.60045 58.5357 7.01615 58.675 7.321C58.8144 7.62585 59.0188 7.88451 59.2976 8.09699C59.5763 8.30946 59.9387 8.50345 60.394 8.6605L61.1837 8.94687C61.4718 9.05772 61.704 9.16858 61.862 9.28867C62.0199 9.39953 62.1314 9.52886 62.1965 9.66742C62.2615 9.80599 62.2894 9.98151 62.2894 10.194C62.2894 10.4065 62.2708 10.5543 62.2244 10.6928C62.1872 10.8314 62.1129 10.9515 62.0292 11.0623C61.9363 11.1824 61.8155 11.2656 61.6669 11.321C61.5275 11.3764 61.3603 11.4041 61.1744 11.4041C60.9886 11.4041 60.7377 11.3672 60.5612 11.2841C60.3754 11.2009 60.2267 11.0808 60.1059 10.933C60.0316 10.8499 59.9665 10.7575 59.9201 10.6374C59.8643 10.5265 59.8272 10.4065 59.8086 10.2864L58.4149 10.6744C58.5078 11.0346 58.6472 11.3487 58.8237 11.6259C59.0095 11.903 59.2232 12.1247 59.4834 12.3095C59.7157 12.4573 59.9665 12.5681 60.2453 12.6513C60.524 12.7344 60.8306 12.7714 61.1466 12.7714C61.4625 12.7714 61.9363 12.7067 62.2522 12.5958C62.5774 12.4757 62.8562 12.3002 63.0885 12.06C63.3022 11.8291 63.4694 11.552 63.5902 11.2286C63.711 10.9053 63.7667 10.5358 63.7667 10.1108C63.7667 9.6859 63.7017 9.28867 63.5623 8.98382C63.4229 8.67897 63.2185 8.42031 62.9305 8.20784C62.6425 7.99537 62.2708 7.80137 61.797 7.62585L61.0165 7.33948C60.7284 7.22862 60.5054 7.11777 60.3568 7.00691C60.1988 6.88682 60.0966 6.76673 60.0409 6.62816C59.9851 6.4896 59.9573 6.33255 59.9573 6.14779C59.9573 5.96304 59.9758 5.80599 60.0223 5.66742C60.0595 5.52885 60.1245 5.418 60.1988 5.31638Z",fill:"white"}),e.jsx("path",{d:"M69.23 5.09466V3.73669H64.8167V12.6605H69.23V11.3025H66.2754V8.78981H68.7283V7.44108H66.2754V5.09466H69.23Z",fill:"white"}),e.jsx("path",{d:"M71.0883 4.09701V3.71826H72.7515V4.09701H72.1197V5.95383H71.7201V4.09701H71.0883Z",fill:"white"}),e.jsx("path",{d:"M73.0116 3.71826H73.5041L74.0058 5.2148L74.5075 3.71826H75V5.95383H74.6376V4.38339L74.173 5.69517H73.8386L73.374 4.42034V5.96306H73.0116V3.7275V3.71826Z",fill:"white"})]})}const ge="superwise-chatbot-package-css";function Pe(){if(typeof document>"u"||document.getElementById(ge))return;const r=document.createElement("style");r.id=ge,r.textContent=He,document.head.appendChild(r)}Pe();function Ve(r){return r==="human"?{...h.message,...h.messageSelf}:{...h.message,...h.messageOther}}function pe(r){return String(r).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function me(r){return!r.trim()||/\[text\]|\[\/text\]|\]\[text\]/i.test(r)||/\?|!/.test(r)||r.includes("—")||r.includes("–")||/^\s*(Would|Can|May|Could|Should|I |You |We |Let's|Please|Sure|Yes|No)\b/i.test(r)||/\b(your|you|we|me)\b/i.test(r)||/^\s*[A-Z][^.(]*[.?]\s*$/.test(r)||/^\s*#/.test(r)||/^\s*[-*]\s+[A-Z]/.test(r)&&!/\.\w+\s*\(|=/.test(r)||/^\s*\d+\.\s+[A-Z][^.(]*$/.test(r)?!1:!!(/^\s*[)\]}]\s*$/.test(r)||/^\s*[\w.]+\s*=/.test(r)||/\.\w+\s*\(|\b(print|range|open|str|int|list|dict)\s*\(/.test(r)||/^\s*(def|class|import|from|return|if|else|elif|for|while|try|except|with|async)\b/.test(r)||/^\s{2,}/.test(r)&&/[=(){}\[\],:]/.test(r)||/[,(]\s*$|:\s*$/.test(r)||/["'][^"']*["']\s*[:=]/.test(r)&&r.length>10||/\b\w+\s*\([^)]*\)\s*$/.test(r)&&/[=.]\w+\s*\(|import|from\s+\w+/.test(r))}function Ae(r){const n=[],s=r.split(`
429
- `),m=[];let c=0;for(;c<s.length;){const a=s[c];if(!me(a)){m.push(a),c++;continue}const p=[];for(;c<s.length;){const l=me(s[c]),b=s[c].trim()==="",x=c+1<s.length&&me(s[c+1]);if(l||b&&p.length>0&&x)p.push(s[c]),c++;else break}if(p.length>=2){const l=n.length,b=p.join(`
430
- `).trim(),x=pe(b);n.push({placeholder:`\0CODE_RAW_${l}\0`,html:`<pre class="sw-ttyw-code-block"><code>${x}</code></pre>`}),m.push(`\0CODE_RAW_${l}\0`)}else p.length===1&&m.push(p[0])}return{html:m.join(`
431
- `),codeBlocks:n}}function ye(r){if(!r)return"";let n=String(r);const s=[];n=n.replace(/```\s*(\w*)\s*\n?([\s\S]*?)```/g,(a,p,l)=>{const b=s.length,x=pe(l.trim());return s.push(`<pre class="sw-ttyw-code-block"><code class="${p?`language-${p}`:""}">${x}</code></pre>`),`\0CODE_FENCED_${b}\0`}),n=n.replace(/\[code\]([\s\S]*?)\[\/code\]/gi,(a,p)=>{const l=s.length,b=pe(p.trim());return s.push(`<pre class="sw-ttyw-code-block"><code>${b}</code></pre>`),`\0CODE_FENCED_${l}\0`});const{html:m,codeBlocks:c}=Ae(n);return n=m,n=n.replace(/\[text\]([\s\S]*?)(?:\[\/text\]|\]\[text\])/gi,'<span class="sw-ttyw-text-block">$1</span>').replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>').replace(/(https?:\/\/[^\s<]+)/g,'<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\[([^[\]]+)\]/g,'<span class="sw-ttyw-bracket-label">$1</span>').replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^\s*\* (.*$)/gim,"<li>$1</li>").replace(/^\s*- (.*$)/gim,"<li>$1</li>").replace(/^\s*\d+\. (.*$)/gim,"<li>$1</li>").replace(/\n/g,"<br>"),n=n.replace(/((?:<li>.*?<\/li>(?:<br>)?)+)/g,"<ul>$1</ul>"),s.forEach((a,p)=>{n=n.replace(`\0CODE_FENCED_${p}\0`,a)}),c.forEach(({placeholder:a,html:p})=>{n=n.replace(a,p)}),n}const We=30,Te=300,Fe=i.memo(function({text:n,speed:s=20,onComplete:m}){const[c,a]=i.useState(""),[p,l]=i.useState(!1),b=i.useRef(m);i.useEffect(()=>{b.current=m},[m]),i.useEffect(()=>{if(!n)return;a(""),l(!1);const w=n.trim().split(/\s+/),E=Math.min(We,w.length),L=w.slice(0,E).join(" "),S=Math.min(L.length,Te,n.length);let u=0;const g=setInterval(()=>{u<S?(a(n.slice(0,u+1)),u++):(a(n),l(!0),clearInterval(g),b.current&&b.current())},s);return()=>clearInterval(g)},[n,s]);const x=w=>w.replace(/(https?:\/\/[^\s<]+)/g,'<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\[([^[\]]+)\]/g,"$1").replace(/\[bold\](.*?)\[\/bold\]/g,"<strong>$1</strong>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/(?:^|\n)-\s+/g,`
432
- • `).replace(/\n/g,"<br/>").replace(/(\d+\.\s)/g,"<br/>$1").replace(/(\*\s)/g,"<br/>$1");return e.jsx("div",{style:{whiteSpace:"pre-wrap",lineHeight:"1.5",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:p?ye(c):x(c)+'<span class="typing-cursor">|</span>'}})}),ze=i.memo(function({msg:n,isTyping:s=!1,onTypingComplete:m}){const c=n.from==="human"?"sw-ttyw-message self":"sw-ttyw-message other";return e.jsxs("div",{className:c,style:Ve(n.from),children:[e.jsx("div",{className:"message-avatar",style:h.messageAvatar,children:n.from==="human"?e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M20 21V19C20 17.9391 19.5786 16.9217 18.8284 16.1716C18.0783 15.4214 17.0609 15 16 15H8C6.93913 15 5.92172 15.4214 5.17157 16.1716C4.42143 16.9217 4 17.9391 4 19V21",fill:"black"}),e.jsx("circle",{cx:"12",cy:"7",r:"4",fill:"black"})]}):e.jsx(we,{width:20,height:20})}),e.jsx("div",{className:"message-content sw-ttyw-markdown",style:h.messageContent,children:n.from==="ai"&&s?e.jsx(Fe,{text:n.text,speed:20,onComplete:m}):n.from==="ai"?e.jsx("div",{style:{whiteSpace:"pre-wrap",lineHeight:"1.5",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:ye(n.text)}}):e.jsx("div",{style:{whiteSpace:"pre-wrap",lineHeight:"1.5",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:n.text.replace(/\[([^[\]]+)\]/g,"$1").replace(/\[bold\](.*?)\[\/bold\]/g,"<strong>$1</strong>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/(?:^|\n)-\s+/g,`
433
- • `).replace(/\n/g,"<br/>").replace(/(\d+\.\s)/g,"<br/>$1").replace(/(\*\s)/g,"<br/>$1")}})})]})}),De=(r="")=>{const n=new Date().getHours();let s=[];return n>=5&&n<12?r?s=[`🌅 Good morning ${r}! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?`,`☀️ Morning ${r}! I'm an expert on SUPERWISE. What would you like to discover or optimize today?`,`🌞 Good morning ${r}! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?`,`👋 Rise and shine ${r}! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.`,`👋 Morning ${r}! I'm an expert on SUPERWISE. How can I guide you through the platform today?`]:s=["🌅 Good morning! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?","☀️ Morning! I'm an expert on SUPERWISE. What would you like to discover or optimize today?","🌞 Good morning! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?","👋 Rise and shine! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.","👋 Morning! I'm an expert on SUPERWISE. How can I guide you through the platform today?"]:n>=12&&n<17?r?s=[`🌞 Good afternoon ${r}! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?`,`☀️ Afternoon ${r}! I'm an expert on SUPERWISE. How may I help you today?`,`👋 Good afternoon ${r}! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?`,`🌅 Hey there ${r}! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.`,`🌅 Afternoon ${r}! I'm an expert on SUPERWISE. How can I support your exploration today?`]:s=["🌞 Good afternoon! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?","☀️ Afternoon! I'm an expert on SUPERWISE. How may I help you today?","👋 Good afternoon! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?","🌅 Hey there! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.","🌅 Afternoon! I'm an expert on SUPERWISE. How can I support your exploration today?"]:n>=17&&n<21?r?s=[`🌆 Good evening ${r}! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?`,`🌅 Evening ${r}! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?`,`👋 Good evening ${r}! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?`,`🌇 Hey there ${r}! SUPERWISE expert here. Want to dive into the platform together?`,`🌇 Evening ${r}! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?`]:s=["🌆 Good evening! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?","🌅 Evening! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?","👋 Good evening! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?","🌇 Hey there! SUPERWISE expert here. Want to dive into the platform together?","🌇 Evening! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?"]:r?s=[`🌙 Good evening ${r}! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.`,`⭐ Evening ${r}! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?`,`👋 Good evening ${r}! I'm a SUPERWISE expert. Looking to discover features or understand how something works?`,`🌃 Hey there ${r}! I'm a SUPERWISE expert. Want to explore what the platform offers?`,`🌃 Evening ${r}! SUPERWISE expert here. How can I help simplify or explain things for you today?`]:s=["🌙 Good evening! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.","⭐ Evening! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?","👋 Good evening! I'm a SUPERWISE expert. Looking to discover features or understand how something works?","🌃 Hey there! I'm a SUPERWISE expert. Want to explore what the platform offers?","🌃 Evening! SUPERWISE expert here. How can I help simplify or explain things for you today?"],s[Math.floor(Math.random()*s.length)]};function Oe({title:r="",agentId:n="",discoveryAgentId:s="",primaryColor:m="",apiUrl:c=""}){const[a,p]=i.useState(()=>{try{if(typeof window<"u"&&window.localStorage){const o=window.localStorage.getItem("chatbot-messages");return o?JSON.parse(o):[]}}catch{}return[]}),[l,b]=i.useState(()=>{try{if(typeof window<"u"&&window.localStorage){const o=window.localStorage.getItem("chatbot-mql_df");return o?JSON.parse(o):[]}}catch{}return[]}),[x,w]=i.useState(""),[E,L]=i.useState(!1),[S,u]=i.useState(!1),[g,I]=i.useState(!1),[H,W]=i.useState(!1),[N,R]=i.useState(new Set),[oe,se]=i.useState(!1),[ae,ie]=i.useState(!1),[$,_]=i.useState(!1),[M,J]=i.useState(!1),[he,le]=i.useState(""),[T,F]=i.useState(""),re=12e4,ce="https://superwise.ai/contact/",U=i.useRef(null),Z=i.useRef(null),d=(()=>{if(m)return m;if(typeof document<"u"&&typeof window<"u"){const o=document.querySelector("[data-chatbot-color]");if(o)return o.getAttribute("data-chatbot-color")||"#000";const j=getComputedStyle(document.documentElement).getPropertyValue("--swttyw-primary-color").trim();if(j)return j}return"#000"})(),C=i.useMemo(()=>{if(!l||l.length===0)return"";const o=l.find(v=>v.name&&v.email);return o?`${o.name} (${o.email})`:""},[l]),k=i.useRef(null),B=i.useRef(null),X=i.useRef(a),f=i.useCallback(()=>{U.current&&(clearTimeout(U.current),U.current=null)},[]),P=i.useCallback(o=>{f(),U.current=setTimeout(o,re)},[re,f]),Y=i.useMemo(()=>a.map(o=>({role:o.from,content:o.text})),[a]),K=o=>{F(o),setTimeout(()=>{F("")},4e3)},Ne=o=>{const v=o.length,j=o.trim();return le(""),F(""),!j||v===0?(K("Please enter a message before sending."),!1):new RegExp(/(<([^>]+)>)/gi).test(j)?(K("Please avoid using HTML tags or scripts in your message."),!1):j.length<2?(K("Please enter a meaningful question (at least 2 characters)."),!1):j.length>1e3?(K("Message is too long. Please keep it under 1000 characters."),!1):(le(""),F(""),!0)},ne=i.useCallback((o="auto")=>{var j;const v=B.current;v&&(v.scrollTop=v.scrollHeight),(j=k.current)==null||j.scrollIntoView({behavior:o})},[]);i.useEffect(()=>{requestAnimationFrame(()=>ne("auto"))},[a,T,$,M,ne]),i.useEffect(()=>{if(!E&&N.size===0)return;const o=setInterval(()=>ne("auto"),120);return()=>clearInterval(o)},[E,N,ne]),i.useEffect(()=>{try{typeof window<"u"&&window.localStorage&&window.localStorage.setItem("chatbot-messages",JSON.stringify(a))}catch{}},[a]),i.useEffect(()=>{try{typeof window<"u"&&window.localStorage&&window.localStorage.setItem("chatbot-mql_df",JSON.stringify(l))}catch{}},[l]),i.useEffect(()=>{X.current=a},[a]),i.useEffect(()=>{if(a.length===0&&!oe){const v={from:"ai",text:De(C)};p([v]),se(!0),R(new Set([0]))}},[a.length,oe,C]),i.useEffect(()=>()=>f(),[f]);const xe=i.useCallback(async()=>{var ke;if(E||M)return;const o=x.trim();if(!o||!Ne(x))return;_(!1),f(),(ke=Z.current)==null||ke.abort();const v=new AbortController;Z.current=v;const j=v.signal,V={from:"human",text:o},z=X.current,Ze=[...z,V];p(Ze),w(""),L(!0);let be=o;if(l&&l.length>0&&!ae){const y=z.filter(G=>G.from==="ai").pop();y&&y.text&&y.text.trim()!==""&&(be=o+"."+y.text,ie(!0))}const Be=[...Y,{role:"human",content:o}];P(()=>{var y;_(!0),(y=Z.current)==null||y.abort(),L(!1)});try{const y=await Le(be,Be,l,n,s,c,j);if(f(),typeof y=="string"){const G={from:"ai",text:y};p(D=>{const A=[...D,G];return R(Q=>new Set([...Q,A.length-1])),A}),(y.startsWith("⚠️")||y.startsWith("❌"))&&_(!0)}else{if(y!=null&&y.isError){_(!0);const D=y.reply||te;p(A=>{const Q=[...A,{from:"ai",text:D}];return R(Ye=>new Set([...Ye,Q.length-1])),Q});return}const G={from:"ai",text:y.reply};p(D=>{const A=[...D,G];return R(Q=>new Set([...Q,A.length-1])),A}),y.mqlDf&&Array.isArray(y.mqlDf)&&b(y.mqlDf),y.reply&&(y.reply.startsWith("⚠️")||y.reply.startsWith("❌"))&&_(!0),y.chatHistoryLimitExceeded&&J(!0)}}catch(y){if(f(),y.name==="AbortError")return;_(!0),p(G=>{const D=[...G,{from:"ai",text:te}];return R(A=>new Set([...A,D.length-1])),D})}finally{L(!1)}},[x,n,s,l,ae,Y,M,f,P]),Ue=i.useCallback(()=>{var o;f(),(o=Z.current)==null||o.abort(),_(!1),J(!1),p([]),R(new Set),se(!1),ie(!1);try{typeof window<"u"&&window.localStorage&&window.localStorage.removeItem("chatbot-messages")}catch{}u(!1)},[f]),Ce=i.useCallback(async()=>{var o,v,j;if(!l||l.length===0){console.warn("No mql_df data available for PDF download");return}try{L(!0),console.log("mql_df data for lead extraction:",l);const V={name:((o=l.find(z=>z.name))==null?void 0:o.name)||"Chat User",email:((v=l.find(z=>z.email))==null?void 0:v.email)||"user@example.com",summary:`Chat conversation with ${a.length} messages. User asked: "${((j=a.find(z=>z.from==="human"))==null?void 0:j.text)||"No user messages"}"`};console.log("Extracted lead row:",V),await Ie(l,V,Y,c),console.log("PDF downloaded successfully")}catch(V){console.error("Failed to download PDF:",V)}finally{L(!1)}},[l,a]);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"sw-ttyw-chatbot",style:{...g?h.containerMinimized:H?h.containerExpanded:h.container,"--swttyw-primary-color":d,"--swttyw-avatar-image":"url('')","--swttyw-user-avatar-image":"url('')","--swttyw-background-color":"#F7F7F7","--swttyw-header-font-size":"16px","--swttyw-body-font-size":"15px","--swttyw-footer-font-size":"16px","--swttyw-user-background-image":"url('')"},onClick:g?()=>I(!1):void 0,children:[g?e.jsxs("div",{style:h.minimizedContent,children:[e.jsxs("svg",{style:h.chatIcon,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M21 15C21 15.5304 20.7893 16.0391 20.4142 16.4142C20.0391 16.7893 19.5304 17 19 17H7L3 21V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H19C19.5304 3 20.0391 3.21071 20.4142 3.58579C20.7893 3.96086 21 4.46957 21 5V15Z",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 9H16",stroke:"white",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("path",{d:"M8 13H12",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}),e.jsx("div",{style:h.minimizedTitle,children:r})]}):e.jsxs("div",{className:"sw-ttyw-chat-header",style:h.header,children:[e.jsx("div",{className:"sw-ttyw-name",style:h.name,children:r}),e.jsxs("div",{style:h.headerActions,children:[e.jsx("button",{onClick:()=>W(o=>!o),style:h.headerButton,title:H?"Shrink chat":"Expand chat",children:H?e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M9 4V9H4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M15 4V9H20",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M9 20V15H4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M15 20V15H20",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}):e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M4 9V4H9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M20 9V4H15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M4 15V20H9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M20 15V20H15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("button",{onClick:()=>{g||W(!1),I(!g)},style:h.headerButton,title:g?"Maximize chat":"Minimize chat",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M6 9H18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}),l&&l.length>0&&e.jsx("button",{onClick:Ce,style:h.headerButton,title:"Download PDF Report",disabled:E,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M7 10L12 15L17 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 15V3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("button",{onClick:()=>u(!0),style:h.headerButton,title:"Clear chat",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M3 6H5H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 6V4C8 3.46957 8.21071 2.96086 8.58579 2.58579C8.96086 2.21071 9.46957 2 10 2H14C14.5304 2 15.0391 2.21071 15.4142 2.58579C15.7893 2.96086 16 3.46957 16 4V6M19 6V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V6H19Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M10 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M14 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})]}),!g&&e.jsxs("div",{className:"sw-ttyw-chat-section",style:{flexGrow:1,display:"flex",flexDirection:"column"},children:[e.jsxs("div",{className:"sw-ttyw-messages",style:h.chatSection,ref:B,children:[a.length===0&&!E&&e.jsx("div",{className:"sw-ttyw-empty-state",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",position:"relative"},children:e.jsx("img",{src:Re,alt:"Superwise Logo",style:{width:"350px",height:"200px",opacity:.8,objectFit:"contain"},onError:o=>{console.log("Logo failed to load, using fallback"),o.target.style.display="none"}})}),a.map((o,v)=>e.jsx(ze,{msg:o,isTyping:N.has(v),onTypingComplete:()=>{R(j=>{const V=new Set(j);return V.delete(v),V}),requestAnimationFrame(()=>ne("auto"))}},v)),T&&e.jsxs("div",{className:"sw-ttyw-validation-message",children:[e.jsx("span",{className:"error-icon",children:"⚠️"}),e.jsx("span",{children:T})]}),$&&e.jsx("div",{className:"sw-ttyw-contact-cta",children:e.jsxs("a",{href:ce,target:"_blank",rel:"noopener noreferrer",className:"sw-ttyw-cta-button",children:[e.jsx("span",{className:"sw-ttyw-cta-icon","aria-hidden":!0,children:"✉"}),"Contact Sales"]})}),M&&e.jsxs("div",{className:"sw-ttyw-limit-exceeded",children:[e.jsx("div",{className:"sw-ttyw-limit-exceeded-message",children:"Chat history limit reached. Please download your conversation as PDF and clear chat history to continue."}),e.jsxs("div",{className:"sw-ttyw-limit-action-buttons",children:[e.jsxs("button",{type:"button",className:"sw-ttyw-limit-download-pdf",onClick:Ce,disabled:E,children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[e.jsx("path",{d:"M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M7 10L12 15L17 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 15V3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Download Chat"]}),e.jsxs("button",{type:"button",className:"sw-ttyw-limit-clear-history",onClick:()=>u(!0),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[e.jsx("path",{d:"M3 6H5H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 6V4C8 3.46957 8.21071 2.96086 8.58579 2.58579C8.96086 2.21071 9.46957 2 10 2H14C14.5304 2 15.0391 2.21071 15.4142 2.58579C15.7893 2.96086 16 3.46957 16 4V6M19 6V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V6H19Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M10 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M14 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Clear History"]})]})]}),E&&e.jsxs("div",{className:"sw-ttyw-message other message-loading",style:{...h.message,...h.messageOther},children:[e.jsx("div",{className:"message-avatar",style:h.messageAvatar,children:e.jsx(we,{width:20,height:20})}),e.jsxs("div",{className:"message-content",style:h.messageContent,children:[e.jsx("div",{className:"typing typing-1"}),e.jsx("div",{className:"typing typing-2"}),e.jsx("div",{className:"typing typing-3"})]})]}),e.jsx("div",{ref:k})]}),e.jsxs("div",{className:"sw-ttyw-chat-input-section",style:h.inputSection,children:[e.jsx("textarea",{className:"sw-ttyw-input",placeholder:M?"Chat limit reached.":"Please ask question here",value:x,onChange:o=>{w(o.target.value),T&&F("")},maxLength:1e3,disabled:E||M,style:h.textarea,onKeyDown:o=>o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),xe())}),e.jsxs("div",{className:"sw-ttyw-chat-input-content",style:h.inputFooter,children:[e.jsxs("small",{id:"sw-ttyw-chat-textbox-status",style:h.characterCount,children:[e.jsx("span",{children:x.length}),"/1000"]}),e.jsx("button",{id:"sw-ttyw-chat-send-message",onClick:xe,"aria-label":"Send message",disabled:E||M,style:h.sendButton,children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000",className:"cwv replaced-svg",children:[e.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),e.jsx("path",{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})]})})]})]})]}),S&&e.jsxs("div",{className:"swttyw-modal swttyw-modal-clear-history",style:h.modalOverlay,children:[e.jsx("div",{className:"swtty-modal-header"}),e.jsxs("div",{className:"swtty-modal-body",style:h.modalBody,children:[e.jsx("div",{className:"swtty-content",children:"Are you sure you want to delete the chat history?"}),e.jsxs("div",{className:"swtty-action",style:h.modalActions,children:[e.jsx("input",{type:"button",className:"swttyw-btn swttyw-btn-primary",id:"swttyw-btn-clear-history-yes",onClick:Ue,value:"Yes",style:{background:"var(--swttyw-primary-color)",color:"white",border:"none",padding:"10px 20px",cursor:"pointer",borderRadius:"8px",margin:"10px 5px"}}),e.jsx("input",{type:"button",className:"swttyw-btn swttyw-btn-primary-inverse",id:"swttyw-btn-clear-history-no",onClick:()=>u(!1),value:"No",style:{background:"transparent",color:"var(--swttyw-primary-color)",border:"1px solid var(--swttyw-primary-color)",padding:"10px 20px",cursor:"pointer",borderRadius:"8px",margin:"10px 5px"}})]})]}),e.jsx("div",{className:"swtty-modal-footer"})]}),!g&&e.jsxs("div",{className:"sw-ttyw-chat-footer",style:h.footer,children:["Powered by ",e.jsx("a",{href:"https://superwise.ai/",className:"ml-1",target:"_new",rel:"noopener noreferrer",style:{marginLeft:"0.25rem",lineHeight:0},"aria-label":"SUPERWISE®",children:e.jsx(Me,{height:20})})]})]})})}O.Chatbot=Oe,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
452
+ }\r
453
+ \r
454
+ .sw-ttyw-jump-latest {\r
455
+ position: sticky;\r
456
+ bottom: 12px;\r
457
+ display: flex;\r
458
+ justify-content: center;\r
459
+ margin-top: 8px;\r
460
+ }\r
461
+ \r
462
+ .sw-ttyw-jump-button {\r
463
+ background: var(--swttyw-primary-color, #000);\r
464
+ border: 1px solid var(--swttyw-primary-color, #000);\r
465
+ color: #fff;\r
466
+ border-radius: 20px;\r
467
+ padding: 6px 12px;\r
468
+ font-size: 12px;\r
469
+ cursor: pointer;\r
470
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);\r
471
+ }\r
472
+ \r
473
+ .sw-ttyw-jump-button:hover {\r
474
+ opacity: 0.9;\r
475
+ }`,ze="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='190'%20height='42'%20viewBox='0%200%20190%2042'%20fill='none'%3e%3cpath%20d='M17.2253%2014.2603C17.155%2014.0259%2016.9441%2013.8618%2016.7097%2013.8618H14.6472C14.3894%2013.8618%2014.1785%2014.0259%2014.1316%2014.2603L10.7801%2027.5053C10.7332%2027.6694%2010.7801%2027.8335%2010.8739%2027.9741C10.9676%2028.1148%2011.1317%2028.1851%2011.2957%2028.1851H12.9363C13.1941%2028.1851%2013.4051%2027.9976%2013.4754%2027.7631L14.0613%2025.0673H17.3191L17.905%2027.7631C17.9519%2028.021%2018.1862%2028.1851%2018.444%2028.1851H20.0846C20.2487%2028.1851%2020.4128%2028.1148%2020.5065%2027.9741C20.6003%2027.8335%2020.6471%2027.6694%2020.6003%2027.5053L17.2488%2014.2603H17.2253ZM14.5769%2022.5824L15.655%2017.636L16.7566%2022.5824H14.5769Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M23.8359%2013.8618H22.2656C21.9609%2013.8618%2021.7266%2014.0962%2021.7266%2014.401V27.6459C21.7266%2027.9507%2021.9609%2028.1851%2022.2656%2028.1851H23.8359C24.1406%2028.1851%2024.375%2027.9507%2024.375%2027.6459V14.401C24.375%2014.0962%2024.1406%2013.8618%2023.8359%2013.8618ZM22.2891%2014.0493C22.2422%2014.0493%2022.1953%2014.0493%2022.1484%2014.0728C22.1953%2014.0728%2022.2422%2014.0493%2022.2891%2014.0493Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M36.1401%2029.4041L36.0932%2012.5256C36.0932%2011.3066%2035.4369%2010.1579%2034.3588%209.5484L19.7341%201.15601C18.6794%200.546507%2017.3669%200.546507%2016.2888%201.15601L1.71091%209.61872C0.65624%2010.2282%200%2011.3769%200%2012.5959L0.046874%2029.4744C0.046874%2030.6934%200.703114%2031.8421%201.78122%2032.4516L16.406%2040.844C17.4607%2041.4535%2018.7731%2041.4535%2019.8513%2040.844L34.4291%2032.3813C35.4838%2031.7718%2036.1401%2030.6231%2036.1401%2029.4041ZM11.9998%2031.5608C6.16397%2028.1851%204.17181%2020.7539%207.54676%2014.9167C10.8983%209.07955%2018.3513%207.08694%2024.1871%2010.4626C30.023%2013.8149%2032.0151%2021.2696%2028.6402%2027.1068C25.2887%2032.9439%2017.8357%2034.9365%2011.9998%2031.5608Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M46.3593%2014.19C46.6171%2013.9087%2046.9218%2013.6977%2047.2734%2013.557C47.6249%2013.4164%2048.0468%2013.3461%2048.5155%2013.3461C48.9843%2013.3461%2049.6171%2013.4398%2050.0858%2013.6508C50.5546%2013.8618%2050.9295%2014.1665%2051.2342%2014.5416C51.3983%2014.7526%2051.5623%2014.987%2051.6795%2015.2683C51.8202%2015.5496%2051.9139%2015.8309%2051.9608%2016.1357L55.4295%2015.0574C55.1717%2014.1431%2054.8201%2013.3695%2054.3748%2012.7131C53.9295%2012.0567%2053.3904%2011.4941%2052.7576%2011.0487C52.1952%2010.6502%2051.5623%2010.3689%2050.8358%2010.1813C50.1327%209.99379%2049.3593%209.90002%2048.5624%209.90002C47.7655%209.90002%2046.5937%2010.0407%2045.7734%2010.3454C44.9765%2010.6502%2044.2734%2011.0956%2043.7109%2011.6816C43.125%2012.2443%2042.7031%2012.9241%2042.4219%2013.7211C42.1406%2014.5182%2042%2015.4324%2042%2016.4405C42%2017.4485%2042.1641%2018.5034%2042.5156%2019.277C42.8672%2020.0506%2043.3828%2020.707%2044.0859%2021.2461C44.789%2021.7853%2045.7031%2022.2776%2046.8515%2022.6761L48.8436%2023.4028C49.5702%2023.6842%2050.1561%2023.9655%2050.5546%2024.2702C50.953%2024.5515%2051.2342%2024.8797%2051.3983%2025.2314C51.5623%2025.583%2051.6327%2026.0284%2051.6327%2026.5676C51.6327%2027.1067%2051.5858%2027.4818%2051.4686%2027.8335C51.3749%2028.1851%2051.1874%2028.4899%2050.9764%2028.7712C50.742%2029.0759%2050.4374%2029.2869%2050.0624%2029.4275C49.7108%2029.5682%2049.2889%2029.6385%2048.8202%2029.6385C48.3515%2029.6385%2047.7187%2029.5448%2047.2734%2029.3338C46.8046%2029.1228%2046.4296%2028.818%2046.1249%2028.443C45.9374%2028.232%2045.7734%2027.9976%2045.6562%2027.6928C45.5156%2027.4115%2045.4453%2027.1067%2045.3749%2026.802L41.8594%2027.7866C42.0937%2028.7008%2042.4453%2029.4979%2042.8906%2030.2011C43.3594%2030.9044%2043.8984%2031.467%2044.5546%2031.9359C45.1406%2032.311%2045.7734%2032.5923%2046.4765%2032.8032C47.1796%2033.0142%2047.953%2033.108%2048.7499%2033.108C49.5468%2033.108%2050.742%2032.9439%2051.5389%2032.6626C52.3592%2032.3578%2053.0623%2031.9124%2053.6483%2031.3029C54.1873%2030.7169%2054.6092%2030.0136%2054.9139%2029.1931C55.2185%2028.3726%2055.3592%2027.4349%2055.3592%2026.3566C55.3592%2025.2782%2055.1951%2024.2702%2054.8435%2023.4966C54.492%2022.723%2053.9764%2022.0666%2053.2498%2021.5275C52.5233%2020.9883%2051.5858%2020.496%2050.3905%2020.0506L48.4218%2019.3239C47.6952%2019.0426%2047.1327%2018.7612%2046.7577%2018.4799C46.3593%2018.1752%2046.1015%2017.8704%2045.9609%2017.5188C45.8203%2017.1672%2045.7499%2016.7686%2045.7499%2016.2998C45.7499%2015.8309%2045.7968%2015.4324%2045.914%2015.0808C46.0077%2014.7292%2046.1718%2014.4478%2046.3593%2014.19Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M67.5233%2026.4504C67.5233%2027.1536%2067.4295%2027.7631%2067.242%2028.232C67.0545%2028.7008%2066.7499%2029.0525%2066.3046%2029.3103C65.8593%2029.5682%2065.2733%2029.6854%2064.5468%2029.6854C63.8202%2029.6854%2063.2109%2029.5682%2062.7656%2029.3103C62.3202%2029.0525%2062.0156%2028.7008%2061.8281%2028.232C61.6406%2027.7631%2061.5468%2027.1771%2061.5468%2026.4504V10.1579H57.8672V26.3332C57.8672%2027.6694%2058.1016%2028.8415%2058.5703%2029.8495C59.039%2030.8575%2059.7656%2031.6546%2060.75%2032.2406C61.7343%2032.8267%2063.0234%2033.108%2064.5702%2033.108C66.1171%2033.108%2067.3592%2032.8267%2068.367%2032.2406C69.3748%2031.6546%2070.1014%2030.8575%2070.5467%2029.8261C70.992%2028.7946%2071.2264%2027.6459%2071.2264%2026.3332V10.1579H67.5467V26.4504H67.5233Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M83.7186%2010.9549C82.7811%2010.4158%2081.5858%2010.1579%2080.1562%2010.1579H74.0859V32.8033H77.7656V24.9032H80.1093C81.5624%2024.9032%2082.7577%2024.6453%2083.6952%2024.1296C84.6327%2023.6138%2085.3358%2022.8168%2085.8045%2021.7385C86.2732%2020.6601%2086.5076%2019.2536%2086.5076%2017.5423C86.5076%2015.831%2086.2732%2014.4479%2085.8045%2013.3695C85.3358%2012.2912%2084.6327%2011.4941%2083.6952%2010.9549H83.7186ZM82.4999%2019.9099C82.2889%2020.4726%2081.9843%2020.8711%2081.5858%2021.1289C81.1874%2021.3868%2080.6718%2021.504%2080.0155%2021.504H77.7421V13.6274H80.0155C80.6718%2013.6274%2081.1874%2013.7446%2081.5858%2014.0025C81.9843%2014.2603%2082.2889%2014.6588%2082.4999%2015.2215C82.7108%2015.7841%2082.8046%2016.5577%2082.8046%2017.5423C82.8046%2018.5268%2082.7108%2019.3473%2082.4999%2019.9099Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M88.5938%2032.8267H99.7029V29.3807H92.2734V23.0043H98.4608V19.5817H92.2734V13.6274H99.7029V10.1813H88.5938V32.8267Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M111.797%2023.356C112.711%2022.8402%20113.437%2022.0666%20113.953%2021.0352C114.469%2020.0037%20114.726%2018.7144%20114.726%2017.1672C114.726%2015.62%20114.492%2014.2134%20114.023%2013.2054C113.555%2012.1739%20112.851%2011.4238%20111.961%2010.9315C111.047%2010.4392%20109.922%2010.2048%20108.586%2010.2048H102.023V32.8501H105.703V24.153H108.258L111.094%2032.8501H115.078L111.75%2023.4028C111.75%2023.4028%20111.797%2023.4028%20111.82%2023.3794L111.797%2023.356ZM105.68%2013.6274H108.422C108.961%2013.6274%20109.406%2013.7211%20109.805%2013.9321C110.18%2014.1431%20110.484%2014.4947%20110.695%2015.0105C110.906%2015.5028%20111%2016.2295%20111%2017.1437C111%2018.058%20110.906%2018.8081%20110.695%2019.3239C110.484%2019.8396%20110.203%2020.1912%20109.828%2020.4022C109.453%2020.6132%20109.008%2020.707%20108.469%2020.707H105.703V13.6508L105.68%2013.6274Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M132.234%2027.3412L129.047%2010.1813H125.508L122.344%2027.2474L119.086%2010.1813H115.148L120.328%2032.8267H124.148L127.289%2017.6595L130.406%2032.8267H134.226L139.382%2010.1813H135.492L132.234%2027.3412Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M144.773%2010.1813H141.094V32.8267H144.773V10.1813Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M151.851%2014.19C152.109%2013.9087%20152.414%2013.6977%20152.766%2013.557C153.117%2013.4164%20153.539%2013.3461%20154.008%2013.3461C154.476%2013.3461%20155.109%2013.4398%20155.578%2013.6508C156.047%2013.8618%20156.422%2014.1665%20156.726%2014.5416C156.89%2014.7526%20157.055%2014.987%20157.172%2015.2683C157.312%2015.5496%20157.406%2015.8309%20157.453%2016.1357L160.922%2015.0574C160.664%2014.1431%20160.312%2013.3695%20159.867%2012.7131C159.422%2012.0567%20158.883%2011.4941%20158.25%2011.0487C157.687%2010.6502%20157.055%2010.3689%20156.328%2010.1813C155.625%209.99379%20154.851%209.90002%20154.055%209.90002C153.258%209.90002%20152.086%2010.0407%20151.266%2010.3454C150.469%2010.6502%20149.766%2011.0956%20149.203%2011.6816C148.617%2012.2443%20148.195%2012.9241%20147.914%2013.7211C147.633%2014.5182%20147.492%2015.4324%20147.492%2016.4405C147.492%2017.4485%20147.656%2018.5034%20148.008%2019.277C148.359%2020.0506%20148.875%2020.707%20149.578%2021.2461C150.281%2021.7853%20151.195%2022.2776%20152.344%2022.6761L154.336%2023.4028C155.062%2023.6842%20155.648%2023.9655%20156.047%2024.2702C156.445%2024.5515%20156.726%2024.8797%20156.89%2025.2314C157.055%2025.583%20157.125%2026.0284%20157.125%2026.5676C157.125%2027.1067%20157.078%2027.4818%20156.961%2027.8335C156.867%2028.1851%20156.68%2028.4899%20156.469%2028.7712C156.234%2029.0759%20155.93%2029.2869%20155.555%2029.4275C155.203%2029.5682%20154.781%2029.6385%20154.312%2029.6385C153.844%2029.6385%20153.211%2029.5448%20152.766%2029.3338C152.297%2029.1228%20151.922%2028.818%20151.617%2028.443C151.43%2028.232%20151.266%2027.9976%20151.148%2027.6928C151.008%2027.4115%20150.914%2027.1067%20150.867%2026.802L147.352%2027.7866C147.586%2028.7008%20147.937%2029.4979%20148.383%2030.2011C148.852%2030.9044%20149.391%2031.467%20150.047%2031.9359C150.633%2032.311%20151.266%2032.5923%20151.969%2032.8032C152.672%2033.0142%20153.445%2033.108%20154.242%2033.108C155.039%2033.108%20156.234%2032.9439%20157.031%2032.6626C157.851%2032.3578%20158.555%2031.9124%20159.14%2031.3029C159.68%2030.7169%20160.101%2030.0136%20160.406%2029.1931C160.711%2028.3726%20160.851%2027.4349%20160.851%2026.3566C160.851%2025.2782%20160.687%2024.2702%20160.336%2023.4966C159.984%2022.723%20159.469%2022.0666%20158.742%2021.5275C158.015%2020.9883%20157.078%2020.496%20155.883%2020.0506L153.914%2019.3239C153.187%2019.0426%20152.625%2018.7612%20152.25%2018.4799C151.852%2018.1752%20151.594%2017.8704%20151.453%2017.5188C151.312%2017.1672%20151.242%2016.7686%20151.242%2016.2998C151.242%2015.8309%20151.289%2015.4324%20151.406%2015.0808C151.5%2014.7292%20151.664%2014.4478%20151.851%2014.19Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M174.633%2013.6274V10.1813H163.5V32.8267H174.633V29.3807H167.18V23.0043H173.367V19.5817H167.18V13.6274H174.633Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M179.316%2011.0956V10.1345H183.512V11.0956H181.918V15.8075H180.91V11.0956H179.316Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M184.168%2010.1345H185.41L186.676%2013.9321L187.941%2010.1345H189.184V15.8075H188.269V11.8223L187.098%2015.1511H186.254L185.082%2011.9161V15.831H184.168V10.1579V10.1345Z'%20fill='black'%3e%3c/path%3e%3c/svg%3e";let Oe=0;function Ce({width:t=20,height:n=20,style:a}){const d=i.useRef(null);d.current||(d.current=`clip0_avatar_${++Oe}`);const l=d.current;return e.jsxs("svg",{width:t,height:n,viewBox:"0 0 155 174",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:a,"aria-hidden":!0,children:[e.jsxs("g",{clipPath:`url(#${l})`,children:[e.jsx("path",{d:"M73.41 57.8388C73.15 56.8088 72.23 56.0988 71.17 56.0988H62.35C61.29 56.0988 60.37 56.8188 60.11 57.8488L45.8 114.299C45.62 114.999 45.78 115.719 46.22 116.289C46.66 116.859 47.33 117.179 48.05 117.179H55.05C56.13 117.179 57.08 116.419 57.31 115.359L59.83 103.889H73.76L76.29 115.359C76.52 116.409 77.47 117.179 78.55 117.179H85.54C86.26 117.179 86.92 116.849 87.37 116.289C87.81 115.719 87.96 114.999 87.79 114.299L73.44 57.8488L73.41 57.8388ZM62.12 93.3688L66.76 72.2188L71.42 93.3688H62.12Z",fill:"#FF0000"}),e.jsx("path",{d:"M101.69 56.0988H95.01C93.73 56.0988 92.7 57.1388 92.7 58.4088V114.859C92.7 116.139 93.74 117.169 95.01 117.169H101.69C102.97 117.169 104 116.129 104 114.859V58.4088C104 57.1288 102.96 56.0988 101.69 56.0988Z",fill:"#FF0000"}),e.jsx("path",{d:"M154.17 122.419L153.98 50.4588C153.97 45.2188 151.16 40.3788 146.61 37.7688L84.21 1.94879C79.66 -0.661205 74.07 -0.651206 69.54 1.98879L7.30003 38.1288C2.77003 40.7588 -0.00997311 45.6088 2.68877e-05 50.8488L0.190027 122.809C0.200027 128.049 3.01003 132.889 7.56003 135.499L69.97 171.319C74.52 173.929 80.11 173.919 84.64 171.279L146.87 135.139C151.4 132.509 154.19 127.659 154.17 122.409V122.419ZM51.11 131.639C26.26 117.289 17.74 85.5088 32.09 60.6488C46.44 35.7988 78.22 27.2788 103.08 41.6288C127.93 55.9788 136.45 87.7588 122.1 112.619C107.75 137.469 75.97 145.989 51.11 131.639Z",fill:"#FF0000"})]}),e.jsx("defs",{children:e.jsx("clipPath",{id:l,children:e.jsx("rect",{width:"154.17",height:"173.268",fill:"white"})})})]})}function De({width:t,height:n=20,style:a}){const d=t??4.6875*n;return e.jsxs("svg",{width:d,height:n,viewBox:"0 0 75 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:a,"aria-hidden":!0,children:[e.jsx("path",{d:"M6.82917 5.34411C6.8013 5.25174 6.71768 5.18707 6.62476 5.18707H5.80712C5.70492 5.18707 5.62129 5.25174 5.60271 5.34411L4.27404 10.5635C4.25546 10.6282 4.27404 10.6928 4.31121 10.7483C4.34838 10.8037 4.41341 10.8314 4.47845 10.8314H5.12885C5.23106 10.8314 5.31468 10.7575 5.34255 10.6651L5.57484 9.60278H6.86634L7.09862 10.6651C7.11721 10.7667 7.21012 10.8314 7.31232 10.8314H7.96272C8.02776 10.8314 8.0928 10.8037 8.12997 10.7483C8.16713 10.6928 8.18571 10.6282 8.16713 10.5635L6.83846 5.34411H6.82917ZM5.77925 8.62356L6.20665 6.67437L6.64335 8.62356H5.77925Z",fill:"white"}),e.jsx("path",{d:"M9.44935 5.18707H8.82683C8.70604 5.18707 8.61313 5.27945 8.61313 5.39954V10.6189C8.61313 10.739 8.70604 10.8314 8.82683 10.8314H9.44935C9.57014 10.8314 9.66305 10.739 9.66305 10.6189V5.39954C9.66305 5.27945 9.57014 5.18707 9.44935 5.18707ZM8.83612 5.26097C8.81754 5.26097 8.79896 5.26098 8.78037 5.27021C8.79896 5.27021 8.81754 5.26097 8.83612 5.26097Z",fill:"white"}),e.jsx("path",{d:"M14.3273 11.3118L14.3087 4.66051C14.3087 4.18014 14.0486 3.72748 13.6212 3.4873L7.82334 0.180139C7.40523 -0.0600462 6.88491 -0.0600462 6.45751 0.180139L0.678271 3.51501C0.260159 3.7552 0 4.20785 0 4.68822L0.0185826 11.3395C0.0185826 11.8199 0.278741 12.2725 0.706145 12.5127L6.50396 15.8199C6.92208 16.06 7.44239 16.06 7.8698 15.8199L13.649 12.485C14.0671 12.2448 14.3273 11.7921 14.3273 11.3118ZM4.75719 12.1617C2.44363 10.8314 1.65386 7.903 2.99182 5.60277C4.32049 3.30254 7.27515 2.51732 9.5887 3.84758C11.9023 5.16859 12.692 8.10624 11.3541 10.4065C10.0254 12.7067 7.07074 13.4919 4.75719 12.1617Z",fill:"white"}),e.jsx("path",{d:"M18.3783 5.31638C18.4805 5.20553 18.6013 5.12239 18.7407 5.06696C18.8801 5.01153 19.0473 4.98382 19.2331 4.98382C19.419 4.98382 19.6698 5.02077 19.8557 5.10391C20.0415 5.18706 20.1902 5.30715 20.3109 5.45495C20.376 5.53809 20.441 5.63047 20.4875 5.74133C20.5432 5.85218 20.5804 5.96303 20.599 6.08313L21.9741 5.65819C21.8719 5.29791 21.7325 4.99306 21.556 4.7344C21.3795 4.47574 21.1657 4.25403 20.9149 4.07851C20.6919 3.92147 20.441 3.81061 20.153 3.73671C19.8742 3.6628 19.5676 3.62585 19.2517 3.62585C18.9358 3.62585 18.4712 3.68128 18.1461 3.80137C17.8301 3.92147 17.5514 4.09698 17.3284 4.32793C17.0961 4.54964 16.9289 4.81754 16.8174 5.13163C16.7059 5.44571 16.6501 5.80599 16.6501 6.20322C16.6501 6.60045 16.7152 7.01615 16.8545 7.321C16.9939 7.62585 17.1983 7.88451 17.4771 8.09699C17.7558 8.30946 18.1182 8.50345 18.5735 8.6605L19.3632 8.94687C19.6513 9.05772 19.8835 9.16858 20.0415 9.28867C20.1994 9.39953 20.3109 9.52886 20.376 9.66742C20.441 9.80599 20.4689 9.98151 20.4689 10.194C20.4689 10.4065 20.4503 10.5543 20.4039 10.6928C20.3667 10.8314 20.2924 10.9515 20.2087 11.0623C20.1158 11.1824 19.995 11.2656 19.8464 11.321C19.707 11.3764 19.5398 11.4041 19.3539 11.4041C19.1681 11.4041 18.9172 11.3672 18.7407 11.2841C18.5549 11.2009 18.4062 11.0808 18.2854 10.933C18.2111 10.8499 18.1461 10.7575 18.0996 10.6374C18.0438 10.5265 18.016 10.4065 17.9881 10.2864L16.5944 10.6744C16.6873 11.0346 16.8267 11.3487 17.0032 11.6259C17.189 11.903 17.4027 12.1247 17.6629 12.3095C17.8952 12.4573 18.1461 12.5681 18.4248 12.6513C18.7035 12.7344 19.0101 12.7714 19.3261 12.7714C19.642 12.7714 20.1158 12.7067 20.4317 12.5958C20.7569 12.4757 21.0357 12.3002 21.268 12.06C21.4817 11.8291 21.6489 11.552 21.7697 11.2286C21.8905 10.9053 21.9462 10.5358 21.9462 10.1108C21.9462 9.6859 21.8812 9.28867 21.7418 8.98382C21.6024 8.67897 21.398 8.42031 21.11 8.20784C20.822 7.99537 20.4503 7.80137 19.9765 7.62585L19.196 7.33948C18.9079 7.22862 18.685 7.11777 18.5363 7.00691C18.3783 6.88682 18.2761 6.76673 18.2204 6.62816C18.1646 6.4896 18.1368 6.33255 18.1368 6.14779C18.1368 5.96304 18.1553 5.80599 18.2018 5.66742C18.239 5.52885 18.304 5.418 18.3783 5.31638Z",fill:"white"}),e.jsx("path",{d:"M26.7684 10.1478C26.7684 10.4249 26.7313 10.6651 26.657 10.8499C26.5826 11.0346 26.4618 11.1732 26.2853 11.2748C26.1088 11.3764 25.8765 11.4226 25.5884 11.4226C25.3004 11.4226 25.0588 11.3764 24.8823 11.2748C24.7058 11.1732 24.585 11.0346 24.5106 10.8499C24.4363 10.6651 24.3991 10.4342 24.3991 10.1478V3.72748H22.9404V10.1016C22.9404 10.6282 23.0333 11.0901 23.2191 11.4873C23.405 11.8845 23.693 12.1986 24.0832 12.4296C24.4735 12.6605 24.9845 12.7714 25.5977 12.7714C26.211 12.7714 26.7034 12.6605 27.1029 12.4296C27.5025 12.1986 27.7905 11.8845 27.967 11.4781C28.1436 11.0716 28.2365 10.6189 28.2365 10.1016V3.72748H26.7777V10.1478H26.7684Z",fill:"white"}),e.jsx("path",{d:"M33.1888 4.04157C32.8171 3.8291 32.3433 3.72748 31.7765 3.72748H29.37V12.6513H30.8288V9.5381H31.7579C32.334 9.5381 32.8078 9.43648 33.1795 9.23325C33.5511 9.03002 33.8299 8.71593 34.0157 8.29099C34.2015 7.86605 34.2945 7.31177 34.2945 6.63741C34.2945 5.96304 34.2015 5.41801 34.0157 4.99307C33.8299 4.56813 33.5511 4.25404 33.1795 4.04157H33.1888ZM32.7056 7.57043C32.622 7.79214 32.5012 7.94919 32.3433 8.0508C32.1853 8.15242 31.9809 8.19861 31.7207 8.19861H30.8195V5.09469H31.7207C31.9809 5.09469 32.1853 5.14088 32.3433 5.24249C32.5012 5.34411 32.622 5.50115 32.7056 5.72286C32.7893 5.94457 32.8264 6.24942 32.8264 6.63741C32.8264 7.0254 32.7893 7.34873 32.7056 7.57043Z",fill:"white"}),e.jsx("path",{d:"M35.1214 12.6605H39.5255V11.3025H36.5801V8.78981H39.0331V7.44108H36.5801V5.09466H39.5255V3.73669H35.1214V12.6605Z",fill:"white"}),e.jsx("path",{d:"M44.3199 8.92842C44.6822 8.72519 44.9703 8.42034 45.1747 8.01387C45.3791 7.6074 45.4813 7.09932 45.4813 6.48962C45.4813 5.87992 45.3884 5.32565 45.2026 4.92842C45.0167 4.52195 44.738 4.22634 44.3849 4.03235C44.0226 3.83835 43.5766 3.74597 43.047 3.74597H40.4454V12.6698H41.9041V9.24251H42.9169L44.0411 12.6698H45.6207L44.3013 8.94689C44.3013 8.94689 44.3199 8.9469 44.3292 8.93766L44.3199 8.92842ZM41.8948 5.0947H42.9819C43.1956 5.0947 43.3722 5.13165 43.5301 5.21479C43.6788 5.29793 43.7996 5.4365 43.8832 5.63974C43.9668 5.83373 44.004 6.12011 44.004 6.48038C44.004 6.84066 43.9668 7.13627 43.8832 7.3395C43.7996 7.54274 43.6881 7.68131 43.5394 7.76445C43.3907 7.84759 43.2142 7.88454 43.0005 7.88454H41.9041V5.10394L41.8948 5.0947Z",fill:"white"}),e.jsx("path",{d:"M52.4219 10.4988L51.1583 3.73669H49.7553L48.501 10.4619L47.2095 3.73669H45.6485L47.7019 12.6605H49.2164L50.4615 6.68358L51.6972 12.6605H53.2117L55.2558 3.73669H53.7134L52.4219 10.4988Z",fill:"white"}),e.jsx("path",{d:"M57.3928 3.73669H55.9341V12.6605H57.3928V3.73669Z",fill:"white"}),e.jsx("path",{d:"M60.1988 5.31638C60.301 5.20553 60.4218 5.12239 60.5612 5.06696C60.7006 5.01153 60.8678 4.98382 61.0536 4.98382C61.2395 4.98382 61.4903 5.02077 61.6762 5.10391C61.862 5.18706 62.0107 5.30715 62.1314 5.45495C62.1965 5.53809 62.2615 5.63047 62.308 5.74133C62.3637 5.85218 62.4009 5.96303 62.4195 6.08313L63.7946 5.65819C63.6924 5.29791 63.553 4.99306 63.3765 4.7344C63.1999 4.47574 62.9862 4.25403 62.7354 4.07851C62.5124 3.92147 62.2615 3.81061 61.9735 3.73671C61.6947 3.6628 61.3881 3.62585 61.0722 3.62585C60.7563 3.62585 60.2917 3.68128 59.9665 3.80137C59.6506 3.92147 59.3719 4.09698 59.1489 4.32793C58.9166 4.54964 58.7494 4.81754 58.6379 5.13163C58.5264 5.44571 58.4706 5.80599 58.4706 6.20322C58.4706 6.60045 58.5357 7.01615 58.675 7.321C58.8144 7.62585 59.0188 7.88451 59.2976 8.09699C59.5763 8.30946 59.9387 8.50345 60.394 8.6605L61.1837 8.94687C61.4718 9.05772 61.704 9.16858 61.862 9.28867C62.0199 9.39953 62.1314 9.52886 62.1965 9.66742C62.2615 9.80599 62.2894 9.98151 62.2894 10.194C62.2894 10.4065 62.2708 10.5543 62.2244 10.6928C62.1872 10.8314 62.1129 10.9515 62.0292 11.0623C61.9363 11.1824 61.8155 11.2656 61.6669 11.321C61.5275 11.3764 61.3603 11.4041 61.1744 11.4041C60.9886 11.4041 60.7377 11.3672 60.5612 11.2841C60.3754 11.2009 60.2267 11.0808 60.1059 10.933C60.0316 10.8499 59.9665 10.7575 59.9201 10.6374C59.8643 10.5265 59.8272 10.4065 59.8086 10.2864L58.4149 10.6744C58.5078 11.0346 58.6472 11.3487 58.8237 11.6259C59.0095 11.903 59.2232 12.1247 59.4834 12.3095C59.7157 12.4573 59.9665 12.5681 60.2453 12.6513C60.524 12.7344 60.8306 12.7714 61.1466 12.7714C61.4625 12.7714 61.9363 12.7067 62.2522 12.5958C62.5774 12.4757 62.8562 12.3002 63.0885 12.06C63.3022 11.8291 63.4694 11.552 63.5902 11.2286C63.711 10.9053 63.7667 10.5358 63.7667 10.1108C63.7667 9.6859 63.7017 9.28867 63.5623 8.98382C63.4229 8.67897 63.2185 8.42031 62.9305 8.20784C62.6425 7.99537 62.2708 7.80137 61.797 7.62585L61.0165 7.33948C60.7284 7.22862 60.5054 7.11777 60.3568 7.00691C60.1988 6.88682 60.0966 6.76673 60.0409 6.62816C59.9851 6.4896 59.9573 6.33255 59.9573 6.14779C59.9573 5.96304 59.9758 5.80599 60.0223 5.66742C60.0595 5.52885 60.1245 5.418 60.1988 5.31638Z",fill:"white"}),e.jsx("path",{d:"M69.23 5.09466V3.73669H64.8167V12.6605H69.23V11.3025H66.2754V8.78981H68.7283V7.44108H66.2754V5.09466H69.23Z",fill:"white"}),e.jsx("path",{d:"M71.0883 4.09701V3.71826H72.7515V4.09701H72.1197V5.95383H71.7201V4.09701H71.0883Z",fill:"white"}),e.jsx("path",{d:"M73.0116 3.71826H73.5041L74.0058 5.2148L74.5075 3.71826H75V5.95383H74.6376V4.38339L74.173 5.69517H73.8386L73.374 4.42034V5.96306H73.0116V3.7275V3.71826Z",fill:"white"})]})}const be="superwise-chatbot-package-css";function Ne(){if(typeof document>"u"||document.getElementById(be))return;const t=document.createElement("style");t.id=be,t.textContent=Fe,document.head.appendChild(t)}Ne();function Ue(t){return t==="human"?{...w.message,...w.messageSelf}:{...w.message,...w.messageOther}}function ue(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function he(t){return!t.trim()||/^\s*([*\-]|\d+\.)\s+/.test(t)||/\[text\]|\[\/text\]|\]\[text\]/i.test(t)||/\?|!/.test(t)||t.includes("—")||t.includes("–")||/^\s*(Would|Can|May|Could|Should|I |You |We |Let's|Please|Sure|Yes|No)\b/i.test(t)||/\b(your|you|we|me)\b/i.test(t)||/^\s*[A-Z][^.(]*[.?]\s*$/.test(t)||/^\s*#/.test(t)||/^\s*[-*]\s+[A-Z]/.test(t)&&!/\.\w+\s*\(|=/.test(t)||/^\s*\d+\.\s+[A-Z][^.(]*$/.test(t)?!1:!!(/^\s*[)\]}]\s*$/.test(t)||/^\s*[\w.]+\s*=/.test(t)||/\.\w+\s*\(|\b(print|range|open|str|int|list|dict)\s*\(/.test(t)||/^\s*(def|class|import|from|return|if|else|elif|for|while|try|except|with|async)\b/.test(t)||/^\s{2,}/.test(t)&&/[=(){}\[\],:]/.test(t)||/[,(]\s*$|:\s*$/.test(t)||/["'][^"']*["']\s*[:=]/.test(t)&&t.length>10||/\b\w+\s*\([^)]*\)\s*$/.test(t)&&/[=.]\w+\s*\(|import|from\s+\w+/.test(t))}function Be(t){const n=[],a=t.split(`
476
+ `),d=[];let l=0;for(;l<a.length;){const s=a[l];if(!he(s)){d.push(s),l++;continue}const m=[];for(;l<a.length;){const c=he(a[l]),g=a[l].trim()==="",b=l+1<a.length&&he(a[l+1]);if(c||g&&m.length>0&&b)m.push(a[l]),l++;else break}if(m.length>=2){const c=n.length,g=m.join(`
477
+ `).trim(),b=ue(g);n.push({placeholder:`\0CODE_RAW_${c}\0`,html:`<pre class="sw-ttyw-code-block"><code>${b}</code></pre>`}),d.push(`\0CODE_RAW_${c}\0`)}else m.length===1&&d.push(m[0])}return{html:d.join(`
478
+ `),codeBlocks:n}}function ke(t){return!t||!String(t).trim()?"":String(t).replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/\n/g,"<br>")}const ve=/^\s*([*\-]|\d+\.)\s+(.*)$/;function Ze(t){const n=[];for(const s of t){const m=s.match(ve);if(!m)continue;const c=s.match(/^(\s*)/)[1].length,g=m[2];n.push({indent:c,content:g})}if(n.length===0)return"";const a=2,d=[],l=[0];for(let s=0;s<n.length;s++){const{indent:m,content:c}=n[s],g=Math.floor(m/a),b=s+1<n.length?Math.floor(n[s+1].indent/a):-1;for(;l.length>1&&g<=l[l.length-2];)l.pop(),d.push("</ul></li>");g>l[l.length-1]?(l.push(g),d.push("<ul>")):s>0&&g<=l[l.length-1]&&d.push("</li>");const f=ke(c);d.push("<li>",f),b<=g&&d.push("</li>")}for(;l.length>1;)l.pop(),d.push("</ul></li>");return"<ul>"+d.join("")+"</ul>"}function Se(t){if(!t)return"";let n=String(t);const a=[];n=n.replace(/```\s*(\w*)\s*\n?([\s\S]*?)```/g,(y,x,u)=>{const h=a.length,R=ue(u.trim());return a.push(`<pre class="sw-ttyw-code-block"><code class="${x?`language-${x}`:""}">${R}</code></pre>`),`\0CODE_FENCED_${h}\0`}),n=n.replace(/\[code\]([\s\S]*?)\[\/code\]/gi,(y,x)=>{const u=a.length,h=ue(x.trim());return a.push(`<pre class="sw-ttyw-code-block"><code>${h}</code></pre>`),`\0CODE_FENCED_${u}\0`});const{html:d,codeBlocks:l}=Be(n);n=d,n=n.replace(/\[text\]([\s\S]*?)(?:\[\/text\]|\]\[text\])/gi,'<span class="sw-ttyw-text-block">$1</span>').replace(/\[bold\]([\s\S]*?)\[\/bold\]/gi,"<strong>$1</strong>").replace(/\[italic\]([\s\S]*?)\[\/italic\]/gi,"<em>$1</em>").replace(/bold([\s\S]*?)\/bold/gi,"<strong>$1</strong>").replace(/italic([\s\S]*?)\/italic/gi,"<em>$1</em>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>').replace(/(https?:\/\/[^\s<]+)/g,'<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\[([^[\]]+)\]/g,'<span class="sw-ttyw-bracket-label">$1</span>');const s=n.split(`
479
+ `),m=[];let c=[],g=[];function b(){c.length&&(m.push({type:"list",lines:c}),c=[])}function f(){g.length&&(m.push({type:"content",lines:g}),g=[])}for(let y=0;y<s.length;y++){const x=s[y];ve.test(x)?(f(),c.push(x)):(b(),g.push(x))}return b(),f(),n=m.map(y=>y.type==="list"?Ze(y.lines):ke(y.lines.join(`
480
+ `))).join(""),a.forEach((y,x)=>{n=n.replace(`\0CODE_FENCED_${x}\0`,y)}),l.forEach(({placeholder:y,html:x})=>{n=n.replace(y,x)}),n=n.replace(/(<br\s*\/?>)\s*$/i,""),n}const Ye=30,Ge=300,Je=i.memo(function({text:n,speed:a=20,onComplete:d}){const[l,s]=i.useState(""),[m,c]=i.useState(!1),g=i.useRef(d);i.useEffect(()=>{g.current=d},[d]),i.useEffect(()=>{if(!n)return;s(""),c(!1);const f=n.trim().split(/\s+/),L=Math.min(Ye,f.length),y=f.slice(0,L).join(" "),x=Math.min(y.length,Ge,n.length);let u=0;const h=setInterval(()=>{u<x?(s(n.slice(0,u+1)),u++):(s(n),c(!0),clearInterval(h),g.current&&g.current())},a);return()=>clearInterval(h)},[n,a]);const b=f=>f.replace(/(https?:\/\/[^\s<]+)/g,'<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\[bold\]([\s\S]*?)\[\/bold\]/gi,"<strong>$1</strong>").replace(/\[italic\]([\s\S]*?)\[\/italic\]/gi,"<em>$1</em>").replace(/bold([\s\S]*?)\/bold/gi,"<strong>$1</strong>").replace(/italic([\s\S]*?)\/italic/gi,"<em>$1</em>").replace(/\[([^[\]]+)\]/g,"<strong>$1</strong>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/(?:^|\n)-\s+/g,`
481
+ • `).replace(/\n/g,"<br/>").replace(/(\d+\.\s)/g,"<br/>$1").replace(/(\*\s)/g,"<br/>$1");return e.jsx("div",{style:{whiteSpace:"pre-wrap",lineHeight:"1.5",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:m?Se(l):b(l)+'<span class="typing-cursor">|</span>'}})}),$e=i.memo(function({msg:n,isTyping:a=!1,onTypingComplete:d}){const l=n.from==="human"?"sw-ttyw-message self":"sw-ttyw-message other";return e.jsxs("div",{className:l,style:Ue(n.from),children:[e.jsx("div",{className:"message-avatar",style:w.messageAvatar,children:n.from==="human"?e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M20 21V19C20 17.9391 19.5786 16.9217 18.8284 16.1716C18.0783 15.4214 17.0609 15 16 15H8C6.93913 15 5.92172 15.4214 5.17157 16.1716C4.42143 16.9217 4 17.9391 4 19V21",fill:"black"}),e.jsx("circle",{cx:"12",cy:"7",r:"4",fill:"black"})]}):e.jsx(Ce,{width:20,height:20})}),e.jsx("div",{className:"message-content sw-ttyw-markdown",style:w.messageContent,children:n.from==="ai"&&a?e.jsx(Je,{text:n.text,speed:20,onComplete:d}):n.from==="ai"?e.jsx("div",{style:{whiteSpace:"pre-wrap",lineHeight:"1.5",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Se(n.text)}}):e.jsx("div",{style:{whiteSpace:"pre-wrap",lineHeight:"1.5",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:n.text.replace(/\[bold\]([\s\S]*?)\[\/bold\]/gi,"<strong>$1</strong>").replace(/\[italic\]([\s\S]*?)\[\/italic\]/gi,"<em>$1</em>").replace(/bold([\s\S]*?)\/bold/gi,"<strong>$1</strong>").replace(/italic([\s\S]*?)\/italic/gi,"<em>$1</em>").replace(/\[([^[\]]+)\]/g,"<strong>$1</strong>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/(?:^|\n)-\s+/g,`
482
+ • `).replace(/\n/g,"<br/>").replace(/(\d+\.\s)/g,"<br/>$1").replace(/(\*\s)/g,"<br/>$1")}})})]})}),Xe=(t="")=>{const n=new Date().getHours();let a=[];return n>=5&&n<12?t?a=[`🌅 Good morning ${t}! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?`,`☀️ Morning ${t}! I'm an expert on SUPERWISE. What would you like to discover or optimize today?`,`🌞 Good morning ${t}! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?`,`👋 Rise and shine ${t}! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.`,`👋 Morning ${t}! I'm an expert on SUPERWISE. How can I guide you through the platform today?`]:a=["🌅 Good morning! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?","☀️ Morning! I'm an expert on SUPERWISE. What would you like to discover or optimize today?","🌞 Good morning! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?","👋 Rise and shine! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.","👋 Morning! I'm an expert on SUPERWISE. How can I guide you through the platform today?"]:n>=12&&n<17?t?a=[`🌞 Good afternoon ${t}! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?`,`☀️ Afternoon ${t}! I'm an expert on SUPERWISE. How may I help you today?`,`👋 Good afternoon ${t}! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?`,`🌅 Hey there ${t}! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.`,`🌅 Afternoon ${t}! I'm an expert on SUPERWISE. How can I support your exploration today?`]:a=["🌞 Good afternoon! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?","☀️ Afternoon! I'm an expert on SUPERWISE. How may I help you today?","👋 Good afternoon! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?","🌅 Hey there! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.","🌅 Afternoon! I'm an expert on SUPERWISE. How can I support your exploration today?"]:n>=17&&n<21?t?a=[`🌆 Good evening ${t}! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?`,`🌅 Evening ${t}! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?`,`👋 Good evening ${t}! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?`,`🌇 Hey there ${t}! SUPERWISE expert here. Want to dive into the platform together?`,`🌇 Evening ${t}! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?`]:a=["🌆 Good evening! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?","🌅 Evening! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?","👋 Good evening! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?","🌇 Hey there! SUPERWISE expert here. Want to dive into the platform together?","🌇 Evening! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?"]:t?a=[`🌙 Good evening ${t}! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.`,`⭐ Evening ${t}! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?`,`👋 Good evening ${t}! I'm a SUPERWISE expert. Looking to discover features or understand how something works?`,`🌃 Hey there ${t}! I'm a SUPERWISE expert. Want to explore what the platform offers?`,`🌃 Evening ${t}! SUPERWISE expert here. How can I help simplify or explain things for you today?`]:a=["🌙 Good evening! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.","⭐ Evening! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?","👋 Good evening! I'm a SUPERWISE expert. Looking to discover features or understand how something works?","🌃 Hey there! I'm a SUPERWISE expert. Want to explore what the platform offers?","🌃 Evening! SUPERWISE expert here. How can I help simplify or explain things for you today?"],a[Math.floor(Math.random()*a.length)]};function Ke({title:t="",agentId:n="",discoveryAgentId:a="",primaryColor:d="",apiUrl:l=""}){const[s,m]=i.useState(()=>{try{if(typeof window<"u"&&window.localStorage){const o=window.localStorage.getItem("chatbot-messages");return o?JSON.parse(o):[]}}catch{}return[]}),[c,g]=i.useState(()=>{try{if(typeof window<"u"&&window.localStorage){const o=window.localStorage.getItem("chatbot-mql_df");return o?JSON.parse(o):[]}}catch{}return[]}),[b,f]=i.useState(""),[L,y]=i.useState(!1),[x,u]=i.useState(!1),[h,R]=i.useState(!1),[P,z]=i.useState(!1),[J,A]=i.useState(new Set),[oe,se]=i.useState(!1),[ae,ie]=i.useState(!1),[$,V]=i.useState(!1),[W,X]=i.useState(!1),[fe,le]=i.useState(""),[O,D]=i.useState(""),re=12e4,ce="https://superwise.ai/contact/",Z=i.useRef(null),Y=i.useRef(null),p=(()=>{if(d)return d;if(typeof document<"u"&&typeof window<"u"){const o=document.querySelector("[data-chatbot-color]");if(o)return o.getAttribute("data-chatbot-color")||"#000";const k=getComputedStyle(document.documentElement).getPropertyValue("--swttyw-primary-color").trim();if(k)return k}return"#000"})(),S=i.useMemo(()=>{if(!c||c.length===0)return"";const o=c.find(C=>C.name&&C.email);return o?`${o.name} (${o.email})`:""},[c]),j=i.useRef(null),M=i.useRef(null),[ne,E]=i.useState(!0),I=i.useRef(!0),K=i.useRef(s),_=i.useCallback(()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)},[]),Ee=i.useCallback(o=>{_(),Z.current=setTimeout(o,re)},[re,_]),we=i.useMemo(()=>s.map(o=>({role:o.from,content:o.text})),[s]),de=o=>{D(o),setTimeout(()=>{D("")},4e3)},Qe=o=>{const C=o.length,k=o.trim();return le(""),D(""),!k||C===0?(de("Please enter a message before sending."),!1):new RegExp(/(<([^>]+)>)/gi).test(k)?(de("Please avoid using HTML tags or scripts in your message."),!1):k.length<2?(de("Please enter a meaningful question (at least 2 characters)."),!1):k.length>1e3?(de("Message is too long. Please keep it under 1000 characters."),!1):(le(""),D(""),!0)},N=i.useCallback((o="auto")=>{var k;const C=M.current;C&&(C.scrollTop=C.scrollHeight),(k=j.current)==null||k.scrollIntoView({behavior:o}),I.current=!0,E(!0)},[]);i.useEffect(()=>{I.current&&requestAnimationFrame(()=>N("auto"))},[s,O,$,W,J,L,N]),i.useEffect(()=>{const o=M.current;if(!o||typeof ResizeObserver>"u")return;const C=new ResizeObserver(()=>{I.current&&N("auto")});return C.observe(o),()=>C.disconnect()},[N]);const ge=i.useRef(null),je=i.useRef(h);i.useEffect(()=>{const o=je.current;if(je.current=h,o&&!h){const C=ge.current;C!=null?(ge.current=null,requestAnimationFrame(()=>{const k=M.current;if(k){const H=k.scrollHeight-k.clientHeight;k.scrollTop=Math.min(C,Math.max(0,H));const pe=k.scrollHeight-k.scrollTop-k.clientHeight<=40;I.current=pe,E(pe)}})):requestAnimationFrame(()=>N("auto"))}},[h,N]);const qe=i.useCallback(()=>{const o=M.current;if(!o)return;const H=o.scrollHeight-o.scrollTop-o.clientHeight<=40;I.current!==H&&(I.current=H,E(H))},[]);i.useEffect(()=>{try{typeof window<"u"&&window.localStorage&&window.localStorage.setItem("chatbot-messages",JSON.stringify(s))}catch{}},[s]),i.useEffect(()=>{try{typeof window<"u"&&window.localStorage&&window.localStorage.setItem("chatbot-mql_df",JSON.stringify(c))}catch{}},[c]),i.useEffect(()=>{K.current=s},[s]),i.useEffect(()=>{if(s.length===0&&!oe){const C={from:"ai",text:Xe(S)};m([C]),se(!0),A(new Set([0]))}},[s.length,oe,S]),i.useEffect(()=>()=>_(),[_]);const Le=i.useCallback(async()=>{var Ie;if(L||W)return;const o=b.trim();if(!o||!Qe(b))return;V(!1),_(),(Ie=Y.current)==null||Ie.abort();const C=new AbortController;Y.current=C;const k=C.signal,H={from:"human",text:o},T=K.current,pe=[...T,H];m(pe),f(""),y(!0);let He=o;if(c&&c.length>0&&!ae){const v=T.filter(G=>G.from==="ai").pop();v&&v.text&&v.text.trim()!==""&&(He=o+"."+v.text,ie(!0))}const tt=[...we,{role:"human",content:o}];Ee(()=>{var v;V(!0),(v=Y.current)==null||v.abort(),y(!1)});try{const v=await We(He,tt,c,n,a,l,k);if(_(),typeof v=="string"){const G={from:"ai",text:v};m(U=>{const F=[...U,G];return A(Q=>new Set([...Q,F.length-1])),F}),(v.startsWith("⚠️")||v.startsWith("❌"))&&V(!0)}else{if(v!=null&&v.isError){V(!0);const U=v.reply||te;m(F=>{const Q=[...F,{from:"ai",text:U}];return A(rt=>new Set([...rt,Q.length-1])),Q});return}const G={from:"ai",text:v.reply};m(U=>{const F=[...U,G];return A(Q=>new Set([...Q,F.length-1])),F}),v.mqlDf&&Array.isArray(v.mqlDf)&&g(v.mqlDf),v.reply&&(v.reply.startsWith("⚠️")||v.reply.startsWith("❌"))&&V(!0),v.chatHistoryLimitExceeded&&X(!0)}}catch(v){if(_(),v.name==="AbortError")return;V(!0),m(G=>{const U=[...G,{from:"ai",text:te}];return A(F=>new Set([...F,U.length-1])),U})}finally{y(!1)}},[b,n,a,c,ae,we,W,_,Ee]),et=i.useCallback(()=>{var o;_(),(o=Y.current)==null||o.abort(),V(!1),X(!1),m([]),A(new Set),se(!1),ie(!1);try{typeof window<"u"&&window.localStorage&&window.localStorage.removeItem("chatbot-messages")}catch{}u(!1)},[_]),Re=i.useCallback(async()=>{var o,C,k;if(!c||c.length===0){console.warn("No mql_df data available for PDF download");return}try{y(!0),console.log("mql_df data for lead extraction:",c);const H={name:((o=c.find(T=>T.name))==null?void 0:o.name)||"Chat User",email:((C=c.find(T=>T.email))==null?void 0:C.email)||"user@example.com",summary:`Chat conversation with ${s.length} messages. User asked: "${((k=s.find(T=>T.from==="human"))==null?void 0:k.text)||"No user messages"}"`};console.log("Extracted lead row:",H),await Te(c,H,we,l),console.log("PDF downloaded successfully")}catch(H){console.error("Failed to download PDF:",H)}finally{y(!1)}},[c,s]);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"sw-ttyw-chatbot",style:{...h?w.containerMinimized:P?w.containerExpanded:w.container,"--swttyw-primary-color":p,"--swttyw-avatar-image":"url('')","--swttyw-user-avatar-image":"url('')","--swttyw-background-color":"#F7F7F7","--swttyw-header-font-size":"16px","--swttyw-body-font-size":"15px","--swttyw-footer-font-size":"16px","--swttyw-user-background-image":"url('')"},onClick:h?()=>R(!1):void 0,children:[h?e.jsxs("div",{style:w.minimizedContent,children:[e.jsxs("svg",{style:w.chatIcon,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M21 15C21 15.5304 20.7893 16.0391 20.4142 16.4142C20.0391 16.7893 19.5304 17 19 17H7L3 21V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H19C19.5304 3 20.0391 3.21071 20.4142 3.58579C20.7893 3.96086 21 4.46957 21 5V15Z",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 9H16",stroke:"white",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("path",{d:"M8 13H12",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}),e.jsx("div",{style:w.minimizedTitle,children:t})]}):e.jsxs("div",{className:"sw-ttyw-chat-header",style:w.header,children:[e.jsx("div",{className:"sw-ttyw-name",style:w.name,children:t}),e.jsxs("div",{style:w.headerActions,children:[e.jsx("button",{onClick:()=>z(o=>!o),style:w.headerButton,title:P?"Shrink chat":"Expand chat",children:P?e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M9 4V9H4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M15 4V9H20",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M9 20V15H4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M15 20V15H20",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}):e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M4 9V4H9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M20 9V4H15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M4 15V20H9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M20 15V20H15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("button",{onClick:()=>{if(!h){const o=M.current;o&&(ge.current=o.scrollTop),z(!1)}R(!h)},style:w.headerButton,title:h?"Maximize chat":"Minimize chat",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M6 9H18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}),c&&c.length>0&&e.jsx("button",{onClick:Re,style:w.headerButton,title:"Download PDF Report",disabled:L,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M7 10L12 15L17 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 15V3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("button",{onClick:()=>u(!0),style:w.headerButton,title:"Clear chat",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M3 6H5H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 6V4C8 3.46957 8.21071 2.96086 8.58579 2.58579C8.96086 2.21071 9.46957 2 10 2H14C14.5304 2 15.0391 2.21071 15.4142 2.58579C15.7893 2.96086 16 3.46957 16 4V6M19 6V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V6H19Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M10 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M14 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})]}),!h&&e.jsxs("div",{className:"sw-ttyw-chat-section",style:{flexGrow:1,display:"flex",flexDirection:"column"},children:[e.jsxs("div",{className:"sw-ttyw-messages",style:w.chatSection,ref:M,onScroll:qe,children:[s.length===0&&!L&&e.jsx("div",{className:"sw-ttyw-empty-state",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",position:"relative"},children:e.jsx("img",{src:ze,alt:"Superwise Logo",style:{width:"350px",height:"200px",opacity:.8,objectFit:"contain"},onError:o=>{console.log("Logo failed to load, using fallback"),o.target.style.display="none"}})}),s.map((o,C)=>e.jsx($e,{msg:o,isTyping:J.has(C),onTypingComplete:()=>{A(k=>{const H=new Set(k);return H.delete(C),H}),requestAnimationFrame(()=>N("auto"))}},C)),O&&e.jsxs("div",{className:"sw-ttyw-validation-message",children:[e.jsx("span",{className:"error-icon",children:"⚠️"}),e.jsx("span",{children:O})]}),$&&e.jsx("div",{className:"sw-ttyw-contact-cta",children:e.jsxs("a",{href:ce,target:"_blank",rel:"noopener noreferrer",className:"sw-ttyw-cta-button",children:[e.jsx("span",{className:"sw-ttyw-cta-icon","aria-hidden":!0,children:"✉"}),"Contact Sales"]})}),W&&e.jsxs("div",{className:"sw-ttyw-limit-exceeded",children:[e.jsx("div",{className:"sw-ttyw-limit-exceeded-message",children:"Chat history limit reached. Please download your conversation as PDF and clear chat history to continue."}),e.jsxs("div",{className:"sw-ttyw-limit-action-buttons",children:[e.jsxs("button",{type:"button",className:"sw-ttyw-limit-download-pdf",onClick:Re,disabled:L,children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[e.jsx("path",{d:"M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M7 10L12 15L17 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 15V3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Download Chat"]}),e.jsxs("button",{type:"button",className:"sw-ttyw-limit-clear-history",onClick:()=>u(!0),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[e.jsx("path",{d:"M3 6H5H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8 6V4C8 3.46957 8.21071 2.96086 8.58579 2.58579C8.96086 2.21071 9.46957 2 10 2H14C14.5304 2 15.0391 2.21071 15.4142 2.58579C15.7893 2.96086 16 3.46957 16 4V6M19 6V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V6H19Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M10 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M14 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Clear History"]})]})]}),L&&e.jsxs("div",{className:"sw-ttyw-message other message-loading",style:{...w.message,...w.messageOther,minHeight:"2.5rem"},children:[e.jsx("div",{className:"message-avatar",style:w.messageAvatar,children:e.jsx(Ce,{width:20,height:20})}),e.jsxs("div",{className:"message-content",style:w.messageContent,children:[e.jsx("div",{className:"typing typing-1"}),e.jsx("div",{className:"typing typing-2"}),e.jsx("div",{className:"typing typing-3"})]})]}),!ne&&e.jsx("div",{className:"sw-ttyw-jump-latest",children:e.jsx("button",{type:"button",className:"sw-ttyw-jump-button",onClick:()=>{N("smooth"),E(!0)},children:"Jump to latest"})}),e.jsx("div",{ref:j})]}),e.jsxs("div",{className:"sw-ttyw-chat-input-section",style:w.inputSection,children:[e.jsx("textarea",{className:"sw-ttyw-input",placeholder:W?"Chat limit reached.":"Please ask question here",value:b,onChange:o=>{f(o.target.value),O&&D("")},maxLength:1e3,disabled:L||W,style:w.textarea,onKeyDown:o=>o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),Le())}),e.jsxs("div",{className:"sw-ttyw-chat-input-content",style:w.inputFooter,children:[e.jsxs("small",{id:"sw-ttyw-chat-textbox-status",style:w.characterCount,children:[e.jsx("span",{children:b.length}),"/1000"]}),e.jsx("button",{id:"sw-ttyw-chat-send-message",onClick:Le,"aria-label":"Send message",disabled:L||W,style:w.sendButton,children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000",className:"cwv replaced-svg",children:[e.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),e.jsx("path",{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})]})})]})]})]}),x&&e.jsxs("div",{className:"swttyw-modal swttyw-modal-clear-history",style:w.modalOverlay,children:[e.jsx("div",{className:"swtty-modal-header"}),e.jsxs("div",{className:"swtty-modal-body",style:w.modalBody,children:[e.jsx("div",{className:"swtty-content",children:"Are you sure you want to delete the chat history?"}),e.jsxs("div",{className:"swtty-action",style:w.modalActions,children:[e.jsx("input",{type:"button",className:"swttyw-btn swttyw-btn-primary",id:"swttyw-btn-clear-history-yes",onClick:et,value:"Yes",style:{background:"var(--swttyw-primary-color)",color:"white",border:"none",padding:"10px 20px",cursor:"pointer",borderRadius:"8px",margin:"10px 5px"}}),e.jsx("input",{type:"button",className:"swttyw-btn swttyw-btn-primary-inverse",id:"swttyw-btn-clear-history-no",onClick:()=>u(!1),value:"No",style:{background:"transparent",color:"var(--swttyw-primary-color)",border:"1px solid var(--swttyw-primary-color)",padding:"10px 20px",cursor:"pointer",borderRadius:"8px",margin:"10px 5px"}})]})]}),e.jsx("div",{className:"swtty-modal-footer"})]}),!h&&e.jsxs("div",{className:"sw-ttyw-chat-footer",style:w.footer,children:["Powered by ",e.jsx("a",{href:"https://superwise.ai/",className:"ml-1",target:"_new",rel:"noopener noreferrer",style:{marginLeft:"0.25rem",lineHeight:0},"aria-label":"SUPERWISE®",children:e.jsx(De,{height:20})})]})]})})}B.Chatbot=Ke,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
@@ -1 +1 @@
1
- @import"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap";.sw-ttyw-chatbot{--swttyw-primary-color: #000;--swttyw-avatar-image: url();--swttyw-user-avatar-image: url();--swttyw-background-color: #F7F7F7;--swttyw-header-font-size: 16px;--swttyw-body-font-size: 15px;--swttyw-footer-font-size: 16px;--swttyw-user-background-image: url();scrollbar-width:thin;scrollbar-color:black transparent}.sw-ttyw-chatbot ::-webkit-scrollbar{width:10px;height:10px}.sw-ttyw-chatbot ::-webkit-scrollbar-track{background:#0000000d;border-radius:5px}.sw-ttyw-chatbot ::-webkit-scrollbar-thumb{background:var(--swttyw-primary-color);border-radius:5px;min-height:40px}.sw-ttyw-chatbot ::-webkit-scrollbar-thumb:hover{background:var(--swttyw-primary-color);opacity:.9}.typing{display:inline-block!important;width:.8rem!important;height:.8rem!important;min-width:.8rem!important;min-height:.8rem!important;max-width:.8rem!important;max-height:.8rem!important;margin-right:.5rem!important;box-sizing:border-box!important;background:#ccc!important;border-radius:50%!important}.typing.typing-1{-webkit-animation:typingAlt 1.4s infinite!important;animation:typingAlt 1.4s infinite!important}.typing.typing-2{-webkit-animation:typingAlt 1.4s .2s infinite!important;animation:typingAlt 1.4s .2s infinite!important}.typing.typing-3{-webkit-animation:typingAlt 1.4s .4s infinite!important;animation:typingAlt 1.4s .4s infinite!important}.typing-cursor{animation:blink 1s infinite;color:var(--swttyw-primary-color);font-weight:700}@keyframes blink{0%,50%{opacity:1}51%,to{opacity:0}}.swttyw-input-error{background-color:#fee8e8;border:1px solid #FDC2C2;border-radius:8px;padding:12px 16px;margin:8px 0;display:flex;align-items:center;gap:8px;color:#e04f4f;font-size:14px;line-height:1.4}.swttyw-input-error .error-icon{color:#f59e0b;font-size:16px;flex-shrink:0}.sw-ttyw-validation-message{background-color:#fee8e8;border:1px solid #FDC2C2;border-radius:8px;padding:12px 16px;margin:8px 16px;display:flex;align-items:center;gap:8px;color:#e04f4f;font-size:14px;line-height:1.4;animation:slideIn .3s ease-out}.sw-ttyw-validation-message .error-icon{color:#f59e0b;font-size:16px;flex-shrink:0}.sw-ttyw-contact-cta{margin:0 auto;animation:slideIn .3s ease-out;max-width:320px;text-align:center}.sw-ttyw-cta-button{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;background:var(--swttyw-primary-color, #000);color:#fff!important;text-decoration:none;border-radius:8px;font-size:14px;font-weight:500;transition:opacity .2s,transform .2s}.sw-ttyw-cta-button:hover{opacity:.9;transform:translateY(-1px)}.sw-ttyw-cta-icon{font-size:16px}.sw-ttyw-limit-exceeded{margin:8px 16px;animation:slideIn .3s ease-out}.sw-ttyw-limit-exceeded-message{background-color:#fee8e8;border:1px solid #FDC2C2;border-radius:8px;padding:12px 16px;margin-bottom:12px;color:#e04f4f;font-size:14px;line-height:1.4}.sw-ttyw-limit-action-buttons{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.sw-ttyw-limit-download-pdf,.sw-ttyw-limit-clear-history{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:opacity .2s,transform .2s;border:none}.sw-ttyw-limit-download-pdf{background:var(--swttyw-primary-color, #000);color:#fff}.sw-ttyw-limit-download-pdf:hover:not(:disabled){opacity:.9;transform:translateY(-1px)}.sw-ttyw-limit-download-pdf:disabled{opacity:.6;cursor:not-allowed}.sw-ttyw-limit-clear-history{background:transparent;color:var(--swttyw-primary-color, #000);border:1px solid var(--swttyw-primary-color, #000)}.sw-ttyw-limit-clear-history:hover{opacity:.9;transform:translateY(-1px)}@keyframes slideIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@-webkit-keyframes typingAlt{0%,60%,to{transform:translateY(0) scale(1);opacity:.4}30%{transform:translateY(-10px) scale(1.2);opacity:1}}@keyframes typingAlt{0%,60%,to{transform:translateY(0) scale(1);opacity:.4}30%{transform:translateY(-10px) scale(1.2);opacity:1}}.sw-ttyw-message.self{background:#000!important;color:#fff!important;margin:1rem 1rem 1rem auto!important;border-radius:1.125rem 1.125rem 0!important;max-width:80%!important;display:table}.sw-ttyw-message.self .message-avatar{right:-28px!important;left:auto!important}.sw-ttyw-message.other .message-avatar{left:-28px!important;right:auto!important;display:table}.sw-ttyw-message .message-content{margin-left:0!important;margin-right:0!important;padding-left:0!important;padding-right:0!important;min-width:0;overflow-wrap:break-word;word-break:break-word;overflow-x:hidden}.sw-ttyw-markdown h1,.sw-ttyw-markdown h2,.sw-ttyw-markdown h3{margin:.5em 0 .25em;font-weight:600;line-height:1.3}.sw-ttyw-markdown h1{font-size:1.25em}.sw-ttyw-markdown h2{font-size:1.1em}.sw-ttyw-markdown h3{font-size:1em}.sw-ttyw-markdown h1:first-child,.sw-ttyw-markdown h2:first-child,.sw-ttyw-markdown h3:first-child{margin-top:0}.sw-ttyw-markdown{overflow-wrap:break-word;word-break:break-word;overflow-x:hidden}.sw-ttyw-markdown pre,.sw-ttyw-markdown pre.sw-ttyw-code-block{margin:.5em 0;padding:.75em 1em;background:#0000000f;border-radius:6px;overflow-x:hidden;white-space:pre-wrap;word-break:break-word;font-size:.9em;line-height:1.4}.sw-ttyw-markdown code{padding:.15em .4em;background:#00000014;border-radius:4px;font-size:.9em;word-break:break-word}.sw-ttyw-markdown pre code,.sw-ttyw-markdown pre.sw-ttyw-code-block code{padding:0;background:none;white-space:pre-wrap;word-break:break-word}.sw-ttyw-markdown ul{margin:.5em 0;padding-left:1.25em;list-style:disc}.sw-ttyw-markdown li{margin:.2em 0}.sw-ttyw-markdown a{color:var(--swttyw-primary-color, #000);text-decoration:underline}.sw-ttyw-markdown a:hover{opacity:.85}.sw-ttyw-markdown .sw-ttyw-bracket-label{font-style:italic;opacity:.9}.sw-ttyw-markdown .sw-ttyw-text-block{display:block;font-weight:600;font-size:1.05em;margin:.75em 0 .35em;line-height:1.35;color:inherit}.sw-ttyw-markdown .sw-ttyw-text-block:first-child{margin-top:0}.sw-ttyw-empty-state{background-color:var(--swttyw-background-color)!important;transition:opacity .3s ease-in-out!important}.sw-ttyw-empty-state:hover{opacity:.5!important}.sw-ttyw-messages{overflow-x:hidden;scrollbar-width:thin;scrollbar-color:black transparent}.sw-ttyw-messages:has(.sw-ttyw-empty-state){overflow:hidden!important}.sw-ttyw-chat-footer img{height:20px!important}.sw-ttyw-input:disabled{opacity:.7;cursor:not-allowed}#sw-ttyw-chat-send-message:disabled{opacity:.5;cursor:not-allowed}#sw-ttyw-chat-send-message:disabled svg,#sw-ttyw-chat-send-message:disabled path{cursor:not-allowed}
1
+ @import"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap";.sw-ttyw-chatbot{--swttyw-primary-color: #000;--swttyw-avatar-image: url();--swttyw-user-avatar-image: url();--swttyw-background-color: #F7F7F7;--swttyw-header-font-size: 16px;--swttyw-body-font-size: 15px;--swttyw-footer-font-size: 16px;--swttyw-user-background-image: url();scrollbar-width:thin;scrollbar-color:black transparent}.sw-ttyw-chatbot ::-webkit-scrollbar{width:10px;height:10px}.sw-ttyw-chatbot ::-webkit-scrollbar-track{background:#0000000d;border-radius:5px}.sw-ttyw-chatbot ::-webkit-scrollbar-thumb{background:var(--swttyw-primary-color);border-radius:5px;min-height:40px}.sw-ttyw-chatbot ::-webkit-scrollbar-thumb:hover{background:var(--swttyw-primary-color);opacity:.9}.sw-ttyw-chatbot .message-loading .message-content{min-height:1.75rem!important;min-width:4.5rem!important;display:flex!important;align-items:center!important;padding:.25rem 0 .25rem .5rem!important}.typing{display:inline-block!important;width:.8rem!important;height:.8rem!important;min-width:.8rem!important;min-height:.8rem!important;max-width:.8rem!important;max-height:.8rem!important;margin-right:.5rem!important;box-sizing:border-box!important;background:#ccc!important;border-radius:50%!important}.typing.typing-1{-webkit-animation:typingAlt 1.4s infinite!important;animation:typingAlt 1.4s infinite!important}.typing.typing-2{-webkit-animation:typingAlt 1.4s .2s infinite!important;animation:typingAlt 1.4s .2s infinite!important}.typing.typing-3{-webkit-animation:typingAlt 1.4s .4s infinite!important;animation:typingAlt 1.4s .4s infinite!important}.typing-cursor{animation:blink 1s infinite;color:var(--swttyw-primary-color);font-weight:700}@keyframes blink{0%,50%{opacity:1}51%,to{opacity:0}}.swttyw-input-error{background-color:#fee8e8;border:1px solid #FDC2C2;border-radius:8px;padding:12px 16px;margin:8px 0;display:flex;align-items:center;gap:8px;color:#e04f4f;font-size:14px;line-height:1.4}.swttyw-input-error .error-icon{color:#f59e0b;font-size:16px;flex-shrink:0}.sw-ttyw-validation-message{background-color:#fee8e8;border:1px solid #FDC2C2;border-radius:8px;padding:12px 16px;margin:8px 16px;display:flex;align-items:center;gap:8px;color:#e04f4f;font-size:14px;line-height:1.4;animation:slideIn .3s ease-out}.sw-ttyw-validation-message .error-icon{color:#f59e0b;font-size:16px;flex-shrink:0}.sw-ttyw-contact-cta{margin:0 auto;animation:slideIn .3s ease-out;max-width:320px;text-align:center}.sw-ttyw-cta-button{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;background:var(--swttyw-primary-color, #000);color:#fff!important;text-decoration:none;border-radius:8px;font-size:14px;font-weight:500;transition:opacity .2s,transform .2s}.sw-ttyw-cta-button:hover{opacity:.9;transform:translateY(-1px)}.sw-ttyw-cta-icon{font-size:16px}.sw-ttyw-limit-exceeded{margin:8px 16px;animation:slideIn .3s ease-out}.sw-ttyw-limit-exceeded-message{background-color:#fee8e8;border:1px solid #FDC2C2;border-radius:8px;padding:12px 16px;margin-bottom:12px;color:#e04f4f;font-size:14px;line-height:1.4}.sw-ttyw-limit-action-buttons{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:center}.sw-ttyw-limit-download-pdf,.sw-ttyw-limit-clear-history{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;transition:opacity .2s,transform .2s;border:none}.sw-ttyw-limit-download-pdf{background:var(--swttyw-primary-color, #000);color:#fff}.sw-ttyw-limit-download-pdf:hover:not(:disabled){opacity:.9;transform:translateY(-1px)}.sw-ttyw-limit-download-pdf:disabled{opacity:.6;cursor:not-allowed}.sw-ttyw-limit-clear-history{background:transparent;color:var(--swttyw-primary-color, #000);border:1px solid var(--swttyw-primary-color, #000)}.sw-ttyw-limit-clear-history:hover{opacity:.9;transform:translateY(-1px)}@keyframes slideIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@-webkit-keyframes typingAlt{0%,60%,to{transform:translateY(0) scale(1);opacity:.4}30%{transform:translateY(-10px) scale(1.2);opacity:1}}@keyframes typingAlt{0%,60%,to{transform:translateY(0) scale(1);opacity:.4}30%{transform:translateY(-10px) scale(1.2);opacity:1}}.sw-ttyw-message.self{background:#000!important;color:#fff!important;margin:1rem 1rem 1rem auto!important;border-radius:1.125rem 1.125rem 0!important;max-width:80%!important;display:table}.sw-ttyw-message.self .message-avatar{right:-28px!important;left:auto!important}.sw-ttyw-message.other .message-avatar{left:-28px!important;right:auto!important;display:table}.sw-ttyw-message .message-content{margin-left:0!important;margin-right:0!important;padding-left:0!important;padding-right:0!important;min-width:0;overflow-wrap:break-word;word-break:break-word;overflow-x:hidden}.sw-ttyw-markdown h1,.sw-ttyw-markdown h2,.sw-ttyw-markdown h3{margin:.5em 0 .25em;font-weight:600;line-height:1.3}.sw-ttyw-markdown h1{font-size:1.25em}.sw-ttyw-markdown h2{font-size:1.1em}.sw-ttyw-markdown h3{font-size:1em}.sw-ttyw-markdown h1:first-child,.sw-ttyw-markdown h2:first-child,.sw-ttyw-markdown h3:first-child{margin-top:0}.sw-ttyw-markdown{overflow-wrap:break-word;word-break:break-word;overflow-x:hidden}.sw-ttyw-markdown br{display:block;line-height:.5;margin:0;padding:0}.sw-ttyw-markdown pre,.sw-ttyw-markdown pre.sw-ttyw-code-block{margin:.5em 0;padding:.75em 1em;background:#0000000f;border-radius:6px;overflow-x:hidden;white-space:pre-wrap;word-break:break-word;font-size:.9em;line-height:1.4}.sw-ttyw-markdown code{padding:.15em .4em;background:#00000014;border-radius:4px;font-size:.9em;word-break:break-word}.sw-ttyw-markdown pre code,.sw-ttyw-markdown pre.sw-ttyw-code-block code{padding:0;background:none;white-space:pre-wrap;word-break:break-word}.sw-ttyw-markdown ul{margin:.35em 0;padding-left:1.25em;list-style:disc}.sw-ttyw-markdown ul ul{margin:.2em 0;padding-left:1.25em;list-style:circle}.sw-ttyw-markdown li{margin:.15em 0;line-height:1.4}.sw-ttyw-markdown a{color:var(--swttyw-primary-color, #000);text-decoration:underline}.sw-ttyw-markdown a:hover{opacity:.85}.sw-ttyw-markdown .sw-ttyw-bracket-label{font-style:italic;opacity:.9}.sw-ttyw-markdown .sw-ttyw-text-block{display:block;font-weight:600;font-size:1.05em;margin:.75em 0 .35em;line-height:1;color:inherit}.sw-ttyw-markdown .sw-ttyw-text-block:first-child{margin-top:0}.sw-ttyw-empty-state{background-color:var(--swttyw-background-color)!important;transition:opacity .3s ease-in-out!important}.sw-ttyw-empty-state:hover{opacity:.5!important}.sw-ttyw-messages{overflow-x:hidden;scrollbar-width:thin;scrollbar-color:black transparent}.sw-ttyw-messages:has(.sw-ttyw-empty-state){overflow:hidden!important}.sw-ttyw-chat-footer img{height:20px!important}.sw-ttyw-input:disabled{opacity:.7;cursor:not-allowed}#sw-ttyw-chat-send-message:disabled{opacity:.5;cursor:not-allowed}#sw-ttyw-chat-send-message:disabled svg,#sw-ttyw-chat-send-message:disabled path{cursor:not-allowed}.sw-ttyw-jump-latest{position:sticky;bottom:12px;display:flex;justify-content:center;margin-top:8px}.sw-ttyw-jump-button{background:var(--swttyw-primary-color, #000);border:1px solid var(--swttyw-primary-color, #000);color:#fff;border-radius:20px;padding:6px 12px;font-size:12px;cursor:pointer;box-shadow:0 2px 6px #00000014}.sw-ttyw-jump-button:hover{opacity:.9}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superwise.ai/superwise-chatbot-package",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "A reusable React chatbot component package",
5
5
  "author": "Superwise",
6
6
  "license": "MIT",