ordify-chat-widget 1.0.45 → 1.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AttachmentChips.d.ts +10 -0
- package/dist/components/AttachmentChips.d.ts.map +1 -0
- package/dist/components/AttachmentPicker.d.ts +16 -0
- package/dist/components/AttachmentPicker.d.ts.map +1 -0
- package/dist/components/ChatHeader.d.ts +13 -0
- package/dist/components/ChatHeader.d.ts.map +1 -0
- package/dist/components/Conversation.d.ts +22 -0
- package/dist/components/Conversation.d.ts.map +1 -0
- package/dist/components/EmbeddedChat.d.ts +9 -0
- package/dist/components/EmbeddedChat.d.ts.map +1 -0
- package/dist/components/FloatingChat.d.ts +9 -0
- package/dist/components/FloatingChat.d.ts.map +1 -0
- package/dist/components/Icons.d.ts +10 -0
- package/dist/components/Icons.d.ts.map +1 -0
- package/dist/components/InlineChat.d.ts +9 -0
- package/dist/components/InlineChat.d.ts.map +1 -0
- package/dist/components/MarkdownRenderer.d.ts +7 -0
- package/dist/components/MarkdownRenderer.d.ts.map +1 -0
- package/dist/components/OrdifyChat.d.ts +4 -0
- package/dist/components/OrdifyChat.d.ts.map +1 -0
- package/dist/components/ProfessionalInput.d.ts +15 -0
- package/dist/components/ProfessionalInput.d.ts.map +1 -0
- package/dist/components/ResizeHandle.d.ts +8 -0
- package/dist/components/ResizeHandle.d.ts.map +1 -0
- package/dist/components/SendIcon.d.ts +4 -0
- package/dist/components/SendIcon.d.ts.map +1 -0
- package/dist/components/WelcomeScreen.d.ts +11 -0
- package/dist/components/WelcomeScreen.d.ts.map +1 -0
- package/dist/components/styled/ChatComponents.d.ts +45 -0
- package/dist/components/styled/ChatComponents.d.ts.map +1 -0
- package/dist/hooks/useOrdifyChat.d.ts +4 -0
- package/dist/hooks/useOrdifyChat.d.ts.map +1 -0
- package/dist/hooks/useOrdifyConfig.d.ts +36 -0
- package/dist/hooks/useOrdifyConfig.d.ts.map +1 -0
- package/dist/hooks/useWidgetAttachmentStaging.d.ts +16 -0
- package/dist/hooks/useWidgetAttachmentStaging.d.ts.map +1 -0
- package/dist/index.cjs.js +1182 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +4482 -0
- package/dist/ordify-chat-widget.standalone.js +346 -67
- package/dist/ordify-chat-widget.standalone.js.map +1 -1
- package/dist/standalone.d.ts +12 -0
- package/dist/standalone.d.ts.map +1 -0
- package/dist/types/index.d.ts +150 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/api.d.ts +26 -0
- package/dist/utils/api.d.ts.map +1 -0
- package/dist/utils/attachments.d.ts +6 -0
- package/dist/utils/attachments.d.ts.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,1182 @@
|
|
|
1
|
+
"use strict";var Cn=Object.defineProperty;var jn=(e,t,r)=>t in e?Cn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ft=(e,t,r)=>jn(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react");function In(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const zt=In(k);var Or={exports:{}},Je={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var An=k,En=Symbol.for("react.element"),Tn=Symbol.for("react.fragment"),Rn=Object.prototype.hasOwnProperty,Mn=An.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_n={key:!0,ref:!0,__self:!0,__source:!0};function zr(e,t,r){var n,a={},c=null,u=null;r!==void 0&&(c=""+r),t.key!==void 0&&(c=""+t.key),t.ref!==void 0&&(u=t.ref);for(n in t)Rn.call(t,n)&&!_n.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)a[n]===void 0&&(a[n]=t[n]);return{$$typeof:En,type:e,key:c,ref:u,props:a,_owner:Mn.current}}Je.Fragment=Tn;Je.jsx=zr;Je.jsxs=zr;Or.exports=Je;var l=Or.exports;function Me(){return Math.random().toString(36).substr(2,9)}function On(e){return new Intl.DateTimeFormat("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}).format(e)}function zn(e,t){let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>e(...n),t)}}function Dn(e,t){let r;return(...n)=>{r||(e(...n),r=!0,setTimeout(()=>r=!1,t))}}function Nn(e){return{id:e.id,name:e.name,url:e.url,content_type:e.content_type,type:e.type,size:e.size??null,preview:null,oauth_token:null}}class Dr{constructor(t){ft(this,"config");ft(this,"warnedLegacyApiKey",!1);if(this.config=t,!this.config.publishableKey&&!this.config.apiKey)throw new Error("Either publishableKey or apiKey is required.");this.config.publishableKey&&this.config.apiKey&&console.warn("[Ordify] Both publishableKey and apiKey provided. publishableKey will be used.")}usePublishableKey(){return!!this.config.publishableKey}maybeWarnLegacyApiKey(){this.usePublishableKey()||this.warnedLegacyApiKey||(this.warnedLegacyApiKey=!0,console.warn("[Ordify] Using legacy apiKey in browser. For production embeds, use publishableKey from user settings."))}getAuthHeaders(t=!1){return this.usePublishableKey()?{...t?{"Content-Type":"application/json"}:{},"x-ordify-publishable-key":this.config.publishableKey,accept:"application/json"}:(this.maybeWarnLegacyApiKey(),{...t?{"Content-Type":"application/json"}:{},"api-key":this.config.apiKey,accept:"application/json"})}async sendMessage(t,r,n,a){const c=this.usePublishableKey()?`/widget/chat/${this.config.agentId}`:`/chat/agents/${this.config.agentId}`,u=`${this.config.apiBaseUrl}${c}`,d=a!=null&&a.length?a.map(Nn):void 0,h={message:t,sessionId:r,context:n};d!=null&&d.length&&(h.attachments=d,h.use_document_understanding=d.some(b=>b.type==="document"||!b.type&&!String(b.content_type||"").startsWith("image/")));const g=await fetch(u,{method:"POST",headers:this.getAuthHeaders(!0),body:JSON.stringify(h)});if(!g.ok){const b=await g.json();throw new Error(`API Error: ${b.detail}`)}if(!g.body)throw new Error("No response body");return g.body}async uploadAttachment(t){if(!this.usePublishableKey())throw new Error("[Ordify] uploadAttachment requires publishableKey.");const r=`${this.config.apiBaseUrl}/widget/attachments`,n=new FormData;n.append("file",t);const a=await fetch(r,{method:"POST",headers:this.getAuthHeaders(!1),body:n});if(!a.ok){let u=`HTTP ${a.status}`;try{u=(await a.json()).detail||u}catch{}throw new Error(`API Error: ${u}`)}const c=await a.json();if(!(c!=null&&c.url)||!(c!=null&&c.content_type)||!(c!=null&&c.name))throw new Error("Invalid attachment response from server");return{id:c.id,name:c.name,type:c.type==="image"?"image":"document",url:c.url,content_type:c.content_type,size:c.size,preview:c.preview}}async createSession(){const t=this.usePublishableKey()?"/widget/sessions":"/sessions",r=`${this.config.apiBaseUrl}${t}`,n=await fetch(r,{method:"POST",headers:this.getAuthHeaders(!0),body:JSON.stringify({name:"Chat Session",agentConfig:{type:"chat",settings:null}})});if(!n.ok){const a=await n.json();throw new Error(`API Error: ${a.detail}`)}return n.json()}async getSessionWithMessages(t){const r=this.usePublishableKey()?`/widget/sessions/${t}/with-messages`:`/sessions/${t}/with-messages`,n=`${this.config.apiBaseUrl}${r}`,a=await fetch(n,{method:"GET",headers:this.getAuthHeaders()});if(!a.ok){const c=await a.json();throw new Error(`API Error: ${c.detail}`)}return a.json()}async getAgents(){if(!this.config.apiKey)throw new Error("[Ordify] getAgents() requires apiKey and is not supported with publishableKey.");const t=`${this.config.apiBaseUrl}/chat/agents`,r=await fetch(t,{method:"GET",headers:{"api-key":this.config.apiKey,accept:"application/json"}});if(!r.ok){const a=await r.json();throw new Error(`API Error: ${a.detail}`)}return(await r.json()).agents||[]}async getSessions(){if(!this.config.apiKey)throw new Error("[Ordify] getSessions() requires apiKey and is not supported with publishableKey.");const t=`${this.config.apiBaseUrl}/sessions`,r=await fetch(t,{method:"GET",headers:{"api-key":this.config.apiKey,accept:"application/json"}});if(!r.ok){const n=await r.json();throw new Error(`API Error: ${n.detail}`)}return r.json()}}function Nr(e){try{if(e.startsWith("data: ")){const t=e.slice(6).trim();if(t==="[DONE]"||t==="")return{text:"",sessionId:"",type:"done"};const r=JSON.parse(t);return r.done?{text:"",sessionId:r.sessionId||"",type:"done"}:r}}catch(t){console.warn("Failed to parse streaming response:",t)}return null}function er(e){const t=(e.attachments||[]).map(r=>r.id).join("|");return`${e.role}:${e.content.trim()}:${t}`}function Bn(e){const t=e.attachments;if(!t||!Array.isArray(t)||t.length===0)return;const r=[];for(const n of t){const a=n.url||"";a&&r.push({id:n.id||Me(),name:String(n.name||"attachment"),type:n.type==="image"?"image":"document",url:a,content_type:String(n.content_type||n.contentType||"application/octet-stream"),size:n.size,preview:n.preview})}return r.length?r:void 0}function Br(e){const[t,r]=k.useState([]),[n,a]=k.useState(!1),[c,u]=k.useState(null),[d,h]=k.useState(e.sessionId||null),[g,b]=k.useState(!1),[p,v]=k.useState(!1),[w,S]=k.useState(!1),[I,C]=k.useState(!1),[o,i]=k.useState(!1),s=k.useRef(null),f=k.useRef(""),m=k.useRef(!1),y=k.useRef(!1),x=k.useRef(!1),E=`${e.publishableKey??""}|${e.apiKey??""}|${e.apiBaseUrl??""}|${e.agentId}`;f.current!==E&&(s.current=null,f.current=E),s.current||(s.current=new Dr({publishableKey:e.publishableKey,apiKey:e.apiKey,apiBaseUrl:e.apiBaseUrl||"https://api.ordify.ai",agentId:e.agentId}));const M=k.useRef(null),j=k.useRef(new Set);k.useEffect(()=>{if(e.sessionId&&e.sessionId!==d){const A=j.current.has(e.sessionId);h(e.sessionId),y.current=!1,M.current=null,S(!1),A||r([])}},[e.sessionId]),k.useEffect(()=>{(async()=>{const D=d||e.sessionId;if(x.current||n)return;if(!D){y.current=!0,M.current=null,S(!1);return}if(M.current===D)return;if(j.current.has(D)&&t.length>0&&!y.current){y.current=!0,M.current=D,C(!1);return}M.current=D,C(!0);try{const $=await s.current.getSessionWithMessages(D);if($.messages&&$.messages.length>0){const N=$.messages.map(O=>({id:O.id||Me(),content:O.content||"",role:O.role==="assistant"?"assistant":"user",timestamp:O.timestamp?new Date(O.timestamp):new Date,sessionId:D,attachments:Bn(O)}));r(O=>{if(O.length>0){const W=new Map,B=new Map;return O.forEach(z=>{W.set(z.id,z);const U=er(z);B.has(U)||B.set(U,z)}),N.forEach(z=>{const U=er(z);!W.has(z.id)&&!B.has(U)?(W.set(z.id,z),B.set(U,z)):W.has(z.id)&&W.set(z.id,z)}),Array.from(W.values()).sort((z,U)=>z.timestamp.getTime()-U.timestamp.getTime())}return N}),S(!0),i(!0)}else S(!1)}catch($){console.warn("Failed to load session history:",$),S(!1),$ instanceof Error&&$.message.includes("404")&&(h(null),M.current=null)}finally{C(!1),y.current=!0}})()},[d,e.sessionId]);const R=k.useCallback(()=>{u(null)},[]),K=k.useCallback(async A=>{if(!s.current)throw new Error("API client not initialized");return s.current.uploadAttachment(A)},[]),L=k.useCallback(async(A,D,H)=>{const $=A.trim(),N=!!(H&&H.length>0);if(!(!$&&!N||n)){a(!0),u(null);try{const O=H!=null&&H.length?H.map(V=>({...V})):void 0,W={id:Me(),content:$,role:"user",timestamp:new Date,sessionId:d||void 0,attachments:O};r(V=>[...V,W]),i(!0);let B=d||e.sessionId||null;B?B!==d&&h(B):(B=(await s.current.createSession()).id,j.current.add(B),e.onSessionCreated&&e.onSessionCreated(B)),x.current=!0;const z=(await s.current.sendMessage($||"(see attachments)",B,D,O)).getReader(),U=new TextDecoder;let Q={id:Me(),content:"",role:"assistant",timestamp:new Date,sessionId:B};for(r(V=>[...V,Q]);;){const{done:V,value:oe}=await z.read();if(V)break;const ae=U.decode(oe,{stream:!0}).split(`
|
|
10
|
+
`);for(const be of ae){if(!be.trim())continue;const te=Nr(be);if(te){if(te.type==="stream"&&te.text)Q.content+=te.text,r(J=>J.find(Ee=>Ee.id===Q.id)?J.map(Ee=>Ee.id===Q.id?{...Ee,content:Q.content}:Ee):[...J,{...Q,content:Q.content}]);else if(te.type==="done")break}}}B&&B!==d&&h(B),e.onMessage&&e.onMessage(Q)}catch(O){const W=O instanceof Error?O.message:"Failed to send message";u(W),e.onError&&e.onError(O instanceof Error?O:new Error(W))}finally{x.current=!1,a(!1)}}},[e.onSessionCreated,e.onMessage,e.onError,e.sessionId,n,d]);return k.useEffect(()=>{const D=!(d||e.sessionId)||!w,H=e.quickQuestions&&e.quickQuestions.length>0;if((e.initialMessage||e.initialContext)&&D&&!p&&!n&&!I&&!m.current&&y.current&&!H){v(!0),m.current=!0;let $,N;if(e.initialMessage&&e.initialContext)$=e.initialMessage,N=e.initialContext;else if(e.initialMessage)$=e.initialMessage,N=void 0;else if(e.initialContext)$="Hi",N=e.initialContext;else return;setTimeout(()=>{L($,N)},0)}},[e.initialMessage,e.initialContext,p,n,I,w,d,e.sessionId,L]),{messages:t,sendMessage:L,uploadAttachment:K,isLoading:n,error:c,clearError:R,sessionId:d,isOpen:g,setIsOpen:b,hasSessionStarted:o}}function Pr(e){return k.useMemo(()=>{const t=e.agentId||process.env.ORDIFY_AGENT_ID,r=e.publishableKey||process.env.ORDIFY_PUBLISHABLE_KEY,n=e.apiKey||process.env.ORDIFY_API_KEY,a=e.apiBaseUrl||process.env.ORDIFY_API_BASE_URL||"https://r.ordify.ai";if(!t)throw new Error("Ordify agent ID is required. Provide agentId prop or set ORDIFY_AGENT_ID environment variable.");if(!r&&!n)throw new Error("Ordify credentials are required. Provide publishableKey (recommended) or apiKey.");return{agentId:t,publishableKey:r,apiKey:n,apiBaseUrl:a,mode:e.mode||"floating",position:e.position||"bottom-right",theme:e.theme||"auto",placeholder:e.placeholder||"Type a message...",height:e.height||"500px",className:e.className||"",buttonStyle:e.buttonStyle||{},chatWindowStyle:e.chatWindowStyle||{},showHeader:e.showHeader!==!1,buttonText:e.buttonText,chatName:e.chatName,primaryColor:e.primaryColor,agentImage:e.agentImage,onMessage:e.onMessage,onError:e.onError,onClose:e.onClose,onSessionCreated:e.onSessionCreated,initialMessage:e.initialMessage,initialContext:e.initialContext,sessionId:e.sessionId,quickQuestions:e.quickQuestions,welcomeMessage:e.welcomeMessage,welcomeImage:e.welcomeImage,enableAttachments:e.enableAttachments,maxAttachmentSizeMB:e.maxAttachmentSizeMB,maxAttachments:e.maxAttachments,allowedAttachmentTypes:e.allowedAttachmentTypes}},[e])}/**
|
|
11
|
+
* @license lucide-react v0.544.0 - ISC
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the ISC license.
|
|
14
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/const Pn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ln=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),tr=e=>{const t=Ln(e);return t.charAt(0).toUpperCase()+t.slice(1)},Lr=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Fn=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
16
|
+
* @license lucide-react v0.544.0 - ISC
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the ISC license.
|
|
19
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
20
|
+
*/var Kn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
21
|
+
* @license lucide-react v0.544.0 - ISC
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the ISC license.
|
|
24
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/const Wn=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:c,iconNode:u,...d},h)=>k.createElement("svg",{ref:h,...Kn,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Lr("lucide",a),...!c&&!Fn(d)&&{"aria-hidden":"true"},...d},[...u.map(([g,b])=>k.createElement(g,b)),...Array.isArray(c)?c:[c]]));/**
|
|
26
|
+
* @license lucide-react v0.544.0 - ISC
|
|
27
|
+
*
|
|
28
|
+
* This source code is licensed under the ISC license.
|
|
29
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
30
|
+
*/const Xe=(e,t)=>{const r=k.forwardRef(({className:n,...a},c)=>k.createElement(Wn,{ref:c,iconNode:t,className:Lr(`lucide-${Pn(tr(e))}`,`lucide-${e}`,n),...a}));return r.displayName=tr(e),r};/**
|
|
31
|
+
* @license lucide-react v0.544.0 - ISC
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the ISC license.
|
|
34
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/const Un=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Hn=Xe("file-text",Un);/**
|
|
36
|
+
* @license lucide-react v0.544.0 - ISC
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the ISC license.
|
|
39
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
40
|
+
*/const qn=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Gn=Xe("image",qn);/**
|
|
41
|
+
* @license lucide-react v0.544.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/const Yn=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Qn=Xe("paperclip",Yn);/**
|
|
46
|
+
* @license lucide-react v0.544.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/const Vn=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zn=Xe("x",Vn);var Z=function(){return Z=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(t[c]=r[c])}return t},Z.apply(this,arguments)};function Ge(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,c;n<a;n++)(c||!(n in t))&&(c||(c=Array.prototype.slice.call(t,0,n)),c[n]=t[n]);return e.concat(c||Array.prototype.slice.call(t))}var F="-ms-",_e="-moz-",P="-webkit-",Fr="comm",et="rule",Dt="decl",Jn="@import",Kr="@keyframes",Xn="@layer",Wr=Math.abs,Nt=String.fromCharCode,It=Object.assign;function eo(e,t){return Y(e,0)^45?(((t<<2^Y(e,0))<<2^Y(e,1))<<2^Y(e,2))<<2^Y(e,3):0}function Ur(e){return e.trim()}function ie(e,t){return(e=t.exec(e))?e[0]:e}function _(e,t,r){return e.replace(t,r)}function Le(e,t,r){return e.indexOf(t,r)}function Y(e,t){return e.charCodeAt(t)|0}function ke(e,t,r){return e.slice(t,r)}function ne(e){return e.length}function Hr(e){return e.length}function Re(e,t){return t.push(e),e}function to(e,t){return e.map(t).join("")}function rr(e,t){return e.filter(function(r){return!ie(r,t)})}var tt=1,we=1,qr=0,X=0,G=0,Ae="";function rt(e,t,r,n,a,c,u,d){return{value:e,root:t,parent:r,type:n,props:a,children:c,line:tt,column:we,length:u,return:"",siblings:d}}function de(e,t){return It(rt("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function xe(e){for(;e.root;)e=de(e.root,{children:[e]});Re(e,e.siblings)}function ro(){return G}function no(){return G=X>0?Y(Ae,--X):0,we--,G===10&&(we=1,tt--),G}function ee(){return G=X<qr?Y(Ae,X++):0,we++,G===10&&(we=1,tt++),G}function fe(){return Y(Ae,X)}function Fe(){return X}function nt(e,t){return ke(Ae,e,t)}function At(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function oo(e){return tt=we=1,qr=ne(Ae=e),X=0,[]}function ao(e){return Ae="",e}function ht(e){return Ur(nt(X-1,Et(e===91?e+2:e===40?e+1:e)))}function so(e){for(;(G=fe())&&G<33;)ee();return At(e)>2||At(G)>3?"":" "}function io(e,t){for(;--t&&ee()&&!(G<48||G>102||G>57&&G<65||G>70&&G<97););return nt(e,Fe()+(t<6&&fe()==32&&ee()==32))}function Et(e){for(;ee();)switch(G){case e:return X;case 34:case 39:e!==34&&e!==39&&Et(G);break;case 40:e===41&&Et(e);break;case 92:ee();break}return X}function co(e,t){for(;ee()&&e+G!==57;)if(e+G===84&&fe()===47)break;return"/*"+nt(t,X-1)+"*"+Nt(e===47?e:ee())}function lo(e){for(;!At(fe());)ee();return nt(e,X)}function uo(e){return ao(Ke("",null,null,null,[""],e=oo(e),0,[0],e))}function Ke(e,t,r,n,a,c,u,d,h){for(var g=0,b=0,p=u,v=0,w=0,S=0,I=1,C=1,o=1,i=0,s="",f=a,m=c,y=n,x=s;C;)switch(S=i,i=ee()){case 40:if(S!=108&&Y(x,p-1)==58){Le(x+=_(ht(i),"&","&\f"),"&\f",Wr(g?d[g-1]:0))!=-1&&(o=-1);break}case 34:case 39:case 91:x+=ht(i);break;case 9:case 10:case 13:case 32:x+=so(S);break;case 92:x+=io(Fe()-1,7);continue;case 47:switch(fe()){case 42:case 47:Re(po(co(ee(),Fe()),t,r,h),h);break;default:x+="/"}break;case 123*I:d[g++]=ne(x)*o;case 125*I:case 59:case 0:switch(i){case 0:case 125:C=0;case 59+b:o==-1&&(x=_(x,/\f/g,"")),w>0&&ne(x)-p&&Re(w>32?or(x+";",n,r,p-1,h):or(_(x," ","")+";",n,r,p-2,h),h);break;case 59:x+=";";default:if(Re(y=nr(x,t,r,g,b,a,d,s,f=[],m=[],p,c),c),i===123)if(b===0)Ke(x,t,y,y,f,c,p,d,m);else switch(v===99&&Y(x,3)===110?100:v){case 100:case 108:case 109:case 115:Ke(e,y,y,n&&Re(nr(e,y,y,0,0,a,d,s,a,f=[],p,m),m),a,m,p,d,n?f:m);break;default:Ke(x,y,y,y,[""],m,0,d,m)}}g=b=w=0,I=o=1,s=x="",p=u;break;case 58:p=1+ne(x),w=S;default:if(I<1){if(i==123)--I;else if(i==125&&I++==0&&no()==125)continue}switch(x+=Nt(i),i*I){case 38:o=b>0?1:(x+="\f",-1);break;case 44:d[g++]=(ne(x)-1)*o,o=1;break;case 64:fe()===45&&(x+=ht(ee())),v=fe(),b=p=ne(s=x+=lo(Fe())),i++;break;case 45:S===45&&ne(x)==2&&(I=0)}}return c}function nr(e,t,r,n,a,c,u,d,h,g,b,p){for(var v=a-1,w=a===0?c:[""],S=Hr(w),I=0,C=0,o=0;I<n;++I)for(var i=0,s=ke(e,v+1,v=Wr(C=u[I])),f=e;i<S;++i)(f=Ur(C>0?w[i]+" "+s:_(s,/&\f/g,w[i])))&&(h[o++]=f);return rt(e,t,r,a===0?et:d,h,g,b,p)}function po(e,t,r,n){return rt(e,t,r,Fr,Nt(ro()),ke(e,2,-2),0,n)}function or(e,t,r,n,a){return rt(e,t,r,Dt,ke(e,0,n),ke(e,n+1,-1),n,a)}function Gr(e,t,r){switch(eo(e,t)){case 5103:return P+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return P+e+e;case 4789:return _e+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return P+e+_e+e+F+e+e;case 5936:switch(Y(e,t+11)){case 114:return P+e+F+_(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return P+e+F+_(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return P+e+F+_(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return P+e+F+e+e;case 6165:return P+e+F+"flex-"+e+e;case 5187:return P+e+_(e,/(\w+).+(:[^]+)/,P+"box-$1$2"+F+"flex-$1$2")+e;case 5443:return P+e+F+"flex-item-"+_(e,/flex-|-self/g,"")+(ie(e,/flex-|baseline/)?"":F+"grid-row-"+_(e,/flex-|-self/g,""))+e;case 4675:return P+e+F+"flex-line-pack"+_(e,/align-content|flex-|-self/g,"")+e;case 5548:return P+e+F+_(e,"shrink","negative")+e;case 5292:return P+e+F+_(e,"basis","preferred-size")+e;case 6060:return P+"box-"+_(e,"-grow","")+P+e+F+_(e,"grow","positive")+e;case 4554:return P+_(e,/([^-])(transform)/g,"$1"+P+"$2")+e;case 6187:return _(_(_(e,/(zoom-|grab)/,P+"$1"),/(image-set)/,P+"$1"),e,"")+e;case 5495:case 3959:return _(e,/(image-set\([^]*)/,P+"$1$`$1");case 4968:return _(_(e,/(.+:)(flex-)?(.*)/,P+"box-pack:$3"+F+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+P+e+e;case 4200:if(!ie(e,/flex-|baseline/))return F+"grid-column-align"+ke(e,t)+e;break;case 2592:case 3360:return F+_(e,"template-","")+e;case 4384:case 3616:return r&&r.some(function(n,a){return t=a,ie(n.props,/grid-\w+-end/)})?~Le(e+(r=r[t].value),"span",0)?e:F+_(e,"-start","")+e+F+"grid-row-span:"+(~Le(r,"span",0)?ie(r,/\d+/):+ie(r,/\d+/)-+ie(e,/\d+/))+";":F+_(e,"-start","")+e;case 4896:case 4128:return r&&r.some(function(n){return ie(n.props,/grid-\w+-start/)})?e:F+_(_(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return _(e,/(.+)-inline(.+)/,P+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ne(e)-1-t>6)switch(Y(e,t+1)){case 109:if(Y(e,t+4)!==45)break;case 102:return _(e,/(.+:)(.+)-([^]+)/,"$1"+P+"$2-$3$1"+_e+(Y(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Le(e,"stretch",0)?Gr(_(e,"stretch","fill-available"),t,r)+e:e}break;case 5152:case 5920:return _(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,a,c,u,d,h,g){return F+a+":"+c+g+(u?F+a+"-span:"+(d?h:+h-+c)+g:"")+e});case 4949:if(Y(e,t+6)===121)return _(e,":",":"+P)+e;break;case 6444:switch(Y(e,Y(e,14)===45?18:11)){case 120:return _(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+P+(Y(e,14)===45?"inline-":"")+"box$3$1"+P+"$2$3$1"+F+"$2box$3")+e;case 100:return _(e,":",":"+F)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return _(e,"scroll-","scroll-snap-")+e}return e}function Ye(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function fo(e,t,r,n){switch(e.type){case Xn:if(e.children.length)break;case Jn:case Dt:return e.return=e.return||e.value;case Fr:return"";case Kr:return e.return=e.value+"{"+Ye(e.children,n)+"}";case et:if(!ne(e.value=e.props.join(",")))return""}return ne(r=Ye(e.children,n))?e.return=e.value+"{"+r+"}":""}function ho(e){var t=Hr(e);return function(r,n,a,c){for(var u="",d=0;d<t;d++)u+=e[d](r,n,a,c)||"";return u}}function mo(e){return function(t){t.root||(t=t.return)&&e(t)}}function go(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Dt:e.return=Gr(e.value,e.length,r);return;case Kr:return Ye([de(e,{value:_(e.value,"@","@"+P)})],n);case et:if(e.length)return to(r=e.props,function(a){switch(ie(a,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":xe(de(e,{props:[_(a,/:(read-\w+)/,":"+_e+"$1")]})),xe(de(e,{props:[a]})),It(e,{props:rr(r,n)});break;case"::placeholder":xe(de(e,{props:[_(a,/:(plac\w+)/,":"+P+"input-$1")]})),xe(de(e,{props:[_(a,/:(plac\w+)/,":"+_e+"$1")]})),xe(de(e,{props:[_(a,/:(plac\w+)/,F+"input-$1")]})),xe(de(e,{props:[a]})),It(e,{props:rr(r,n)});break}return""})}}var bo={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ve=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",Yr="active",Qr="data-styled-version",ot="6.1.19",Bt=`/*!sc*/
|
|
51
|
+
`,Qe=typeof window<"u"&&typeof document<"u",xo=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""&&process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY),at=Object.freeze([]),$e=Object.freeze({});function yo(e,t,r){return r===void 0&&(r=$e),e.theme!==r.theme&&e.theme||t||r.theme}var Vr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),ko=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,wo=/(^-|-$)/g;function ar(e){return e.replace(ko,"-").replace(wo,"")}var vo=/(a)(d)/gi,Ne=52,sr=function(e){return String.fromCharCode(e+(e>25?39:97))};function Tt(e){var t,r="";for(t=Math.abs(e);t>Ne;t=t/Ne|0)r=sr(t%Ne)+r;return(sr(t%Ne)+r).replace(vo,"$1-$2")}var mt,Zr=5381,ye=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},Jr=function(e){return ye(Zr,e)};function $o(e){return Tt(Jr(e)>>>0)}function So(e){return e.displayName||e.name||"Component"}function gt(e){return typeof e=="string"&&!0}var Xr=typeof Symbol=="function"&&Symbol.for,en=Xr?Symbol.for("react.memo"):60115,Co=Xr?Symbol.for("react.forward_ref"):60112,jo={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Io={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},tn={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ao=((mt={})[Co]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},mt[en]=tn,mt);function ir(e){return("type"in(t=e)&&t.type.$$typeof)===en?tn:"$$typeof"in e?Ao[e.$$typeof]:jo;var t}var Eo=Object.defineProperty,To=Object.getOwnPropertyNames,cr=Object.getOwnPropertySymbols,Ro=Object.getOwnPropertyDescriptor,Mo=Object.getPrototypeOf,lr=Object.prototype;function rn(e,t,r){if(typeof t!="string"){if(lr){var n=Mo(t);n&&n!==lr&&rn(e,n,r)}var a=To(t);cr&&(a=a.concat(cr(t)));for(var c=ir(e),u=ir(t),d=0;d<a.length;++d){var h=a[d];if(!(h in Io||r&&r[h]||u&&h in u||c&&h in c)){var g=Ro(t,h);try{Eo(e,h,g)}catch{}}}}return e}function Se(e){return typeof e=="function"}function Pt(e){return typeof e=="object"&&"styledComponentId"in e}function pe(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function dr(e,t){if(e.length===0)return"";for(var r=e[0],n=1;n<e.length;n++)r+=e[n];return r}function ze(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Rt(e,t,r){if(r===void 0&&(r=!1),!r&&!ze(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var n=0;n<t.length;n++)e[n]=Rt(e[n],t[n]);else if(ze(t))for(var n in t)e[n]=Rt(e[n],t[n]);return e}function Lt(e,t){Object.defineProperty(e,"toString",{value:t})}function De(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var _o=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var r=0,n=0;n<t;n++)r+=this.groupSizes[n];return r},e.prototype.insertRules=function(t,r){if(t>=this.groupSizes.length){for(var n=this.groupSizes,a=n.length,c=a;t>=c;)if((c<<=1)<0)throw De(16,"".concat(t));this.groupSizes=new Uint32Array(c),this.groupSizes.set(n),this.length=c;for(var u=a;u<c;u++)this.groupSizes[u]=0}for(var d=this.indexOfGroup(t+1),h=(u=0,r.length);u<h;u++)this.tag.insertRule(d,r[u])&&(this.groupSizes[t]++,d++)},e.prototype.clearGroup=function(t){if(t<this.length){var r=this.groupSizes[t],n=this.indexOfGroup(t),a=n+r;this.groupSizes[t]=0;for(var c=n;c<a;c++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(t){var r="";if(t>=this.length||this.groupSizes[t]===0)return r;for(var n=this.groupSizes[t],a=this.indexOfGroup(t),c=a+n,u=a;u<c;u++)r+="".concat(this.tag.getRule(u)).concat(Bt);return r},e}(),We=new Map,Ve=new Map,Ue=1,Be=function(e){if(We.has(e))return We.get(e);for(;Ve.has(Ue);)Ue++;var t=Ue++;return We.set(e,t),Ve.set(t,e),t},Oo=function(e,t){Ue=t+1,We.set(e,t),Ve.set(t,e)},zo="style[".concat(ve,"][").concat(Qr,'="').concat(ot,'"]'),Do=new RegExp("^".concat(ve,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),No=function(e,t,r){for(var n,a=r.split(","),c=0,u=a.length;c<u;c++)(n=a[c])&&e.registerName(t,n)},Bo=function(e,t){for(var r,n=((r=t.textContent)!==null&&r!==void 0?r:"").split(Bt),a=[],c=0,u=n.length;c<u;c++){var d=n[c].trim();if(d){var h=d.match(Do);if(h){var g=0|parseInt(h[1],10),b=h[2];g!==0&&(Oo(b,g),No(e,b,h[3]),e.getTag().insertRules(g,a)),a.length=0}else a.push(d)}}},ur=function(e){for(var t=document.querySelectorAll(zo),r=0,n=t.length;r<n;r++){var a=t[r];a&&a.getAttribute(ve)!==Yr&&(Bo(e,a),a.parentNode&&a.parentNode.removeChild(a))}};function Po(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var nn=function(e){var t=document.head,r=e||t,n=document.createElement("style"),a=function(d){var h=Array.from(d.querySelectorAll("style[".concat(ve,"]")));return h[h.length-1]}(r),c=a!==void 0?a.nextSibling:null;n.setAttribute(ve,Yr),n.setAttribute(Qr,ot);var u=Po();return u&&n.setAttribute("nonce",u),r.insertBefore(n,c),n},Lo=function(){function e(t){this.element=nn(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(r){if(r.sheet)return r.sheet;for(var n=document.styleSheets,a=0,c=n.length;a<c;a++){var u=n[a];if(u.ownerNode===r)return u}throw De(17)}(this.element),this.length=0}return e.prototype.insertRule=function(t,r){try{return this.sheet.insertRule(r,t),this.length++,!0}catch{return!1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.prototype.getRule=function(t){var r=this.sheet.cssRules[t];return r&&r.cssText?r.cssText:""},e}(),Fo=function(){function e(t){this.element=nn(t),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(t,r){if(t<=this.length&&t>=0){var n=document.createTextNode(r);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e}(),Ko=function(){function e(t){this.rules=[],this.length=0}return e.prototype.insertRule=function(t,r){return t<=this.length&&(this.rules.splice(t,0,r),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e}(),pr=Qe,Wo={isServer:!Qe,useCSSOMInjection:!xo},on=function(){function e(t,r,n){t===void 0&&(t=$e),r===void 0&&(r={});var a=this;this.options=Z(Z({},Wo),t),this.gs=r,this.names=new Map(n),this.server=!!t.isServer,!this.server&&Qe&&pr&&(pr=!1,ur(this)),Lt(this,function(){return function(c){for(var u=c.getTag(),d=u.length,h="",g=function(p){var v=function(o){return Ve.get(o)}(p);if(v===void 0)return"continue";var w=c.names.get(v),S=u.getGroup(p);if(w===void 0||!w.size||S.length===0)return"continue";var I="".concat(ve,".g").concat(p,'[id="').concat(v,'"]'),C="";w!==void 0&&w.forEach(function(o){o.length>0&&(C+="".concat(o,","))}),h+="".concat(S).concat(I,'{content:"').concat(C,'"}').concat(Bt)},b=0;b<d;b++)g(b);return h}(a)})}return e.registerId=function(t){return Be(t)},e.prototype.rehydrate=function(){!this.server&&Qe&&ur(this)},e.prototype.reconstructWithOptions=function(t,r){return r===void 0&&(r=!0),new e(Z(Z({},this.options),t),this.gs,r&&this.names||void 0)},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=function(r){var n=r.useCSSOMInjection,a=r.target;return r.isServer?new Ko(a):n?new Lo(a):new Fo(a)}(this.options),new _o(t)));var t},e.prototype.hasNameForId=function(t,r){return this.names.has(t)&&this.names.get(t).has(r)},e.prototype.registerName=function(t,r){if(Be(t),this.names.has(t))this.names.get(t).add(r);else{var n=new Set;n.add(r),this.names.set(t,n)}},e.prototype.insertRules=function(t,r,n){this.registerName(t,r),this.getTag().insertRules(Be(t),n)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(Be(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Uo=/&/g,Ho=/^\s*\/\/.*$/gm;function an(e,t){return e.map(function(r){return r.type==="rule"&&(r.value="".concat(t," ").concat(r.value),r.value=r.value.replaceAll(",",",".concat(t," ")),r.props=r.props.map(function(n){return"".concat(t," ").concat(n)})),Array.isArray(r.children)&&r.type!=="@keyframes"&&(r.children=an(r.children,t)),r})}function qo(e){var t,r,n,a=$e,c=a.options,u=c===void 0?$e:c,d=a.plugins,h=d===void 0?at:d,g=function(v,w,S){return S.startsWith(r)&&S.endsWith(r)&&S.replaceAll(r,"").length>0?".".concat(t):v},b=h.slice();b.push(function(v){v.type===et&&v.value.includes("&")&&(v.props[0]=v.props[0].replace(Uo,r).replace(n,g))}),u.prefix&&b.push(go),b.push(fo);var p=function(v,w,S,I){w===void 0&&(w=""),S===void 0&&(S=""),I===void 0&&(I="&"),t=I,r=w,n=new RegExp("\\".concat(r,"\\b"),"g");var C=v.replace(Ho,""),o=uo(S||w?"".concat(S," ").concat(w," { ").concat(C," }"):C);u.namespace&&(o=an(o,u.namespace));var i=[];return Ye(o,ho(b.concat(mo(function(s){return i.push(s)})))),i};return p.hash=h.length?h.reduce(function(v,w){return w.name||De(15),ye(v,w.name)},Zr).toString():"",p}var Go=new on,Mt=qo(),sn=k.createContext({shouldForwardProp:void 0,styleSheet:Go,stylis:Mt});sn.Consumer;k.createContext(void 0);function fr(){return k.useContext(sn)}var Yo=function(){function e(t,r){var n=this;this.inject=function(a,c){c===void 0&&(c=Mt);var u=n.name+c.hash;a.hasNameForId(n.id,u)||a.insertRules(n.id,u,c(n.rules,u,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=r,Lt(this,function(){throw De(12,String(n.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=Mt),this.name+t.hash},e}(),Qo=function(e){return e>="A"&&e<="Z"};function hr(e){for(var t="",r=0;r<e.length;r++){var n=e[r];if(r===1&&n==="-"&&e[0]==="-")return e;Qo(n)?t+="-"+n.toLowerCase():t+=n}return t.startsWith("ms-")?"-"+t:t}var cn=function(e){return e==null||e===!1||e===""},ln=function(e){var t,r,n=[];for(var a in e){var c=e[a];e.hasOwnProperty(a)&&!cn(c)&&(Array.isArray(c)&&c.isCss||Se(c)?n.push("".concat(hr(a),":"),c,";"):ze(c)?n.push.apply(n,Ge(Ge(["".concat(a," {")],ln(c),!1),["}"],!1)):n.push("".concat(hr(a),": ").concat((t=a,(r=c)==null||typeof r=="boolean"||r===""?"":typeof r!="number"||r===0||t in bo||t.startsWith("--")?String(r).trim():"".concat(r,"px")),";")))}return n};function he(e,t,r,n){if(cn(e))return[];if(Pt(e))return[".".concat(e.styledComponentId)];if(Se(e)){if(!Se(c=e)||c.prototype&&c.prototype.isReactComponent||!t)return[e];var a=e(t);return he(a,t,r,n)}var c;return e instanceof Yo?r?(e.inject(r,n),[e.getName(n)]):[e]:ze(e)?ln(e):Array.isArray(e)?Array.prototype.concat.apply(at,e.map(function(u){return he(u,t,r,n)})):[e.toString()]}function Vo(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(Se(r)&&!Pt(r))return!1}return!0}var Zo=Jr(ot),Jo=function(){function e(t,r,n){this.rules=t,this.staticRulesId="",this.isStatic=(n===void 0||n.isStatic)&&Vo(t),this.componentId=r,this.baseHash=ye(Zo,r),this.baseStyle=n,on.registerId(r)}return e.prototype.generateAndInjectStyles=function(t,r,n){var a=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,r,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&r.hasNameForId(this.componentId,this.staticRulesId))a=pe(a,this.staticRulesId);else{var c=dr(he(this.rules,t,r,n)),u=Tt(ye(this.baseHash,c)>>>0);if(!r.hasNameForId(this.componentId,u)){var d=n(c,".".concat(u),void 0,this.componentId);r.insertRules(this.componentId,u,d)}a=pe(a,u),this.staticRulesId=u}else{for(var h=ye(this.baseHash,n.hash),g="",b=0;b<this.rules.length;b++){var p=this.rules[b];if(typeof p=="string")g+=p;else if(p){var v=dr(he(p,t,r,n));h=ye(h,v+b),g+=v}}if(g){var w=Tt(h>>>0);r.hasNameForId(this.componentId,w)||r.insertRules(this.componentId,w,n(g,".".concat(w),void 0,this.componentId)),a=pe(a,w)}}return a},e}(),dn=k.createContext(void 0);dn.Consumer;var bt={};function Xo(e,t,r){var n=Pt(e),a=e,c=!gt(e),u=t.attrs,d=u===void 0?at:u,h=t.componentId,g=h===void 0?function(f,m){var y=typeof f!="string"?"sc":ar(f);bt[y]=(bt[y]||0)+1;var x="".concat(y,"-").concat($o(ot+y+bt[y]));return m?"".concat(m,"-").concat(x):x}(t.displayName,t.parentComponentId):h,b=t.displayName,p=b===void 0?function(f){return gt(f)?"styled.".concat(f):"Styled(".concat(So(f),")")}(e):b,v=t.displayName&&t.componentId?"".concat(ar(t.displayName),"-").concat(t.componentId):t.componentId||g,w=n&&a.attrs?a.attrs.concat(d).filter(Boolean):d,S=t.shouldForwardProp;if(n&&a.shouldForwardProp){var I=a.shouldForwardProp;if(t.shouldForwardProp){var C=t.shouldForwardProp;S=function(f,m){return I(f,m)&&C(f,m)}}else S=I}var o=new Jo(r,v,n?a.componentStyle:void 0);function i(f,m){return function(y,x,E){var M=y.attrs,j=y.componentStyle,R=y.defaultProps,K=y.foldedComponentIds,L=y.styledComponentId,A=y.target,D=k.useContext(dn),H=fr(),$=y.shouldForwardProp||H.shouldForwardProp,N=yo(x,D,R)||$e,O=function(Q,V,oe){for(var ge,ae=Z(Z({},V),{className:void 0,theme:oe}),be=0;be<Q.length;be+=1){var te=Se(ge=Q[be])?ge(ae):ge;for(var J in te)ae[J]=J==="className"?pe(ae[J],te[J]):J==="style"?Z(Z({},ae[J]),te[J]):te[J]}return V.className&&(ae.className=pe(ae.className,V.className)),ae}(M,x,N),W=O.as||A,B={};for(var q in O)O[q]===void 0||q[0]==="$"||q==="as"||q==="theme"&&O.theme===N||(q==="forwardedAs"?B.as=O.forwardedAs:$&&!$(q,W)||(B[q]=O[q]));var z=function(Q,V){var oe=fr(),ge=Q.generateAndInjectStyles(V,oe.styleSheet,oe.stylis);return ge}(j,O),U=pe(K,L);return z&&(U+=" "+z),O.className&&(U+=" "+O.className),B[gt(W)&&!Vr.has(W)?"class":"className"]=U,E&&(B.ref=E),k.createElement(W,B)}(s,f,m)}i.displayName=p;var s=k.forwardRef(i);return s.attrs=w,s.componentStyle=o,s.displayName=p,s.shouldForwardProp=S,s.foldedComponentIds=n?pe(a.foldedComponentIds,a.styledComponentId):"",s.styledComponentId=v,s.target=n?a.target:e,Object.defineProperty(s,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(f){this._foldedDefaultProps=n?function(m){for(var y=[],x=1;x<arguments.length;x++)y[x-1]=arguments[x];for(var E=0,M=y;E<M.length;E++)Rt(m,M[E],!0);return m}({},a.defaultProps,f):f}}),Lt(s,function(){return".".concat(s.styledComponentId)}),c&&rn(s,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),s}function mr(e,t){for(var r=[e[0]],n=0,a=t.length;n<a;n+=1)r.push(t[n],e[n+1]);return r}var gr=function(e){return Object.assign(e,{isCss:!0})};function ea(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(Se(e)||ze(e))return gr(he(mr(at,Ge([e],t,!0))));var n=e;return t.length===0&&n.length===1&&typeof n[0]=="string"?he(n):gr(he(mr(n,t)))}function _t(e,t,r){if(r===void 0&&(r=$e),!t)throw De(1,t);var n=function(a){for(var c=[],u=1;u<arguments.length;u++)c[u-1]=arguments[u];return e(t,r,ea.apply(void 0,Ge([a],c,!1)))};return n.attrs=function(a){return _t(e,t,Z(Z({},r),{attrs:Array.prototype.concat(r.attrs,a).filter(Boolean)}))},n.withConfig=function(a){return _t(e,t,Z(Z({},r),a))},n}var un=function(e){return _t(Xo,e)},T=un;Vr.forEach(function(e){T[e]=un(e)});const ta=T.div`
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-wrap: wrap;
|
|
54
|
+
gap: 6px;
|
|
55
|
+
margin-bottom: 6px;
|
|
56
|
+
`,ra=T.div`
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: 6px;
|
|
60
|
+
max-width: 220px;
|
|
61
|
+
padding: 4px 8px;
|
|
62
|
+
border-radius: 8px;
|
|
63
|
+
font-size: 12px;
|
|
64
|
+
background: ${e=>e.$isImage?"rgba(59, 130, 246, 0.12)":"rgba(107, 114, 128, 0.12)"};
|
|
65
|
+
color: #374151;
|
|
66
|
+
border: 1px solid #e5e7eb;
|
|
67
|
+
|
|
68
|
+
[data-theme='dark'] & {
|
|
69
|
+
color: #e5e7eb;
|
|
70
|
+
border-color: #4b5563;
|
|
71
|
+
background: ${e=>e.$isImage?"rgba(59, 130, 246, 0.2)":"rgba(107, 114, 128, 0.25)"};
|
|
72
|
+
}
|
|
73
|
+
`,na=T.img`
|
|
74
|
+
width: 28px;
|
|
75
|
+
height: 28px;
|
|
76
|
+
object-fit: cover;
|
|
77
|
+
border-radius: 4px;
|
|
78
|
+
`,oa=T.span`
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
text-overflow: ellipsis;
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
flex: 1;
|
|
83
|
+
min-width: 0;
|
|
84
|
+
`,aa=T.button`
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
padding: 2px;
|
|
89
|
+
border: none;
|
|
90
|
+
background: transparent;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
color: #6b7280;
|
|
93
|
+
border-radius: 4px;
|
|
94
|
+
|
|
95
|
+
&:hover {
|
|
96
|
+
color: #ef4444;
|
|
97
|
+
background: rgba(239, 68, 68, 0.1);
|
|
98
|
+
}
|
|
99
|
+
`;function Ce({attachments:e,onRemove:t,readOnly:r}){return e.length?l.jsx(ta,{children:e.map(n=>{const a=n.type==="image",c=a&&(n.preview||n.url);return l.jsxs(ra,{$isImage:a,title:n.name,children:[c?l.jsx(na,{src:n.preview||n.url,alt:"",loading:"lazy",decoding:"async"}):a?l.jsx(Gn,{size:16,"aria-hidden":!0}):l.jsx(Hn,{size:16,"aria-hidden":!0}),l.jsx(oa,{children:n.name}),!r&&t&&l.jsx(aa,{type:"button",onClick:()=>t(n.id),"aria-label":`Remove ${n.name}`,children:l.jsx(Zn,{size:14})})]},n.id)})}):null}const pn=["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel","text/csv","text/plain","text/markdown","application/json","image/png","image/jpeg","image/webp","image/gif"],sa={".pdf":"application/pdf",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".xls":"application/vnd.ms-excel",".csv":"text/csv",".txt":"text/plain",".md":"text/markdown",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif"};function ia(e){const t=e.lastIndexOf(".");if(!(t<0))return sa[e.slice(t).toLowerCase()]}async function Ft(e){var r;if(!e)return[];const t=[];if((r=e.files)!=null&&r.length)for(let n=0;n<e.files.length;n++)t.push(e.files[n]);return t}function fn(e,t,r){if(e.size>t)return`File too large (max ${Math.floor(t/(1024*1024))}MB)`;if(r.includes(e.type))return null;const n=ia(e.name);return n&&r.includes(n)?null:"File type not allowed for attachments"}const ca=T.button`
|
|
100
|
+
display: flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
justify-content: center;
|
|
103
|
+
width: 36px;
|
|
104
|
+
height: 36px;
|
|
105
|
+
min-width: 36px;
|
|
106
|
+
min-height: 36px;
|
|
107
|
+
border-radius: 8px;
|
|
108
|
+
border: 1px solid #d1d5db;
|
|
109
|
+
background: #f9fafb;
|
|
110
|
+
color: #374151;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
flex-shrink: 0;
|
|
113
|
+
transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
|
|
114
|
+
|
|
115
|
+
&:hover:not(:disabled) {
|
|
116
|
+
background: #f3f4f6;
|
|
117
|
+
border-color: #9ca3af;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&:disabled {
|
|
121
|
+
opacity: 0.45;
|
|
122
|
+
cursor: not-allowed;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
[data-theme='dark'] & {
|
|
126
|
+
background: #374151;
|
|
127
|
+
border-color: #4b5563;
|
|
128
|
+
color: #e5e7eb;
|
|
129
|
+
}
|
|
130
|
+
`,la=T.button`
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
justify-content: center;
|
|
134
|
+
width: 28px;
|
|
135
|
+
height: 28px;
|
|
136
|
+
min-width: 28px;
|
|
137
|
+
min-height: 28px;
|
|
138
|
+
border: none;
|
|
139
|
+
border-radius: 8px;
|
|
140
|
+
background: transparent;
|
|
141
|
+
color: #64748b;
|
|
142
|
+
cursor: pointer;
|
|
143
|
+
flex-shrink: 0;
|
|
144
|
+
transition: background 0.2s ease, color 0.2s ease;
|
|
145
|
+
|
|
146
|
+
&:hover:not(:disabled) {
|
|
147
|
+
background: rgba(15, 23, 42, 0.06);
|
|
148
|
+
color: #334155;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&:disabled {
|
|
152
|
+
opacity: 0.45;
|
|
153
|
+
cursor: not-allowed;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@media (prefers-color-scheme: dark) {
|
|
157
|
+
color: #94a3b8;
|
|
158
|
+
|
|
159
|
+
&:hover:not(:disabled) {
|
|
160
|
+
background: rgba(255, 255, 255, 0.08);
|
|
161
|
+
color: #e2e8f0;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
[data-theme='dark'] & {
|
|
166
|
+
color: #94a3b8;
|
|
167
|
+
|
|
168
|
+
&:hover:not(:disabled) {
|
|
169
|
+
background: rgba(255, 255, 255, 0.08);
|
|
170
|
+
color: #e2e8f0;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
`;function Kt({disabled:e,integrated:t=!1,maxFileBytes:r,maxFiles:n,allowedMime:a=pn,currentCount:c,uploadAttachment:u,onUploaded:d,onError:h}){const g=k.useRef(null),[b,p]=k.useState(!1),v=k.useMemo(()=>[".pdf,.docx,.xlsx,.xls,.csv,.txt,.md,.json","image/png,image/jpeg,image/webp,image/gif"].join(","),[]),w=k.useCallback(async i=>{const s=Array.from(i);if(!s.length)return;let f=0;for(const m of s){if(c+f>=n){h==null||h(`You can attach at most ${n} files per message.`);break}const y=fn(m,r,a);if(y){h==null||h(`${m.name}: ${y}`);continue}try{p(!0);const x=await u(m);d(x),f+=1}catch(x){const E=x instanceof Error?x.message:"Upload failed";h==null||h(E)}finally{p(!1)}}},[a,c,r,n,h,d,u]),S=i=>{const s=i.target.files;s!=null&&s.length&&w(s),i.target.value=""},I=c>=n,C=!!(e||b||I),o=t?la:ca;return l.jsxs(l.Fragment,{children:[l.jsx("input",{ref:g,type:"file",multiple:!0,accept:v,style:{display:"none"},onChange:S}),l.jsx(o,{type:"button",disabled:C,"aria-label":"Attach file",title:"Attach file",onClick:()=>{var i;return(i=g.current)==null?void 0:i.click()},children:l.jsx(Qn,{size:16,strokeWidth:2})})]})}function ue(){return ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ue.apply(this,arguments)}const da=["children","options"],br=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((e,t)=>(e[t.toLowerCase()]=t,e),{class:"className",for:"htmlFor"}),xr={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},ua=["style","script","pre"],pa=["src","href","data","formAction","srcDoc","action"],fa=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,ha=/mailto:/i,ma=/\n{2,}$/,yr=/^(\s*>[\s\S]*?)(?=\n\n|$)/,ga=/^ *> ?/gm,ba=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,xa=/^ {2,}\n/,ya=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,kr=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,wr=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,ka=/^(`+)((?:\\`|(?!\1)`|[^`])+)\1/,wa=/^(?:\n *)*\n/,va=/\r\n?/g,$a=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,Sa=/^\[\^([^\]]+)]/,Ca=/\f/g,ja=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,Ia=/^\s*?\[(x|\s)\]/,vr=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,$r=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,Sr=/^([^\n]+)\n *(=|-){3,} *\n/,xt=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,Aa=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,Cr=/^<!--[\s\S]*?(?:-->)/,Ea=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,yt=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,Ta=/^\{.*\}$/,Ra=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,Ma=/^<([^ >]+@[^ >]+)>/,_a=/^<([^ >]+:\/[^ >]+)>/,Oa=/-([a-z])?/gi,jr=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,za=/^[^\n]+(?: \n|\n{2,})/,Da=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,Na=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,Ba=/^\[([^\]]*)\] ?\[([^\]]*)\]/,Pa=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,La=/\t/g,Fa=/(^ *\||\| *$)/g,Ka=/^ *:-+: *$/,Wa=/^ *:-+ *$/,Ua=/^ *-+: *$/,st=e=>`(?=[\\s\\S]+?\\1${e?"\\1":""})`,it="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",Ha=RegExp(`^([*_])\\1${st(1)}${it}\\1\\1(?!\\1)`),qa=RegExp(`^([*_])${st(0)}${it}\\1(?!\\1)`),Ga=RegExp(`^(==)${st(0)}${it}\\1`),Ya=RegExp(`^(~~)${st(0)}${it}\\1`),Qa=/^(:[a-zA-Z0-9-_]+:)/,Va=/^\\([^0-9A-Za-z\s])/,Za=/\\([^0-9A-Za-z\s])/g,Ja=/^[\s\S](?:(?! \n|[0-9]\.|http)[^=*_~\-\n:<`\\\[!])*/,Xa=/^\n+/,es=/^([ \t]*)/,ts=/(?:^|\n)( *)$/,Wt="(?:\\d+\\.)",Ut="(?:[*+-])";function hn(e){return"( *)("+(e===1?Wt:Ut)+") +"}const mn=hn(1),gn=hn(2);function bn(e){return RegExp("^"+(e===1?mn:gn))}const rs=bn(1),ns=bn(2);function xn(e){return RegExp("^"+(e===1?mn:gn)+"[^\\n]*(?:\\n(?!\\1"+(e===1?Wt:Ut)+" )[^\\n]*)*(\\n|$)","gm")}const os=xn(1),as=xn(2);function yn(e){const t=e===1?Wt:Ut;return RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const kn=yn(1),wn=yn(2);function Ir(e,t){const r=t===1,n=r?kn:wn,a=r?os:as,c=r?rs:ns;return{t:u=>c.test(u),o:je(function(u,d){const h=ts.exec(d.prevCapture);return h&&(d.list||!d.inline&&!d.simple)?n.exec(u=h[1]+u):null}),i:1,u(u,d,h){const g=r?+u[2]:void 0,b=u[0].replace(ma,`
|
|
174
|
+
`).match(a);let p=!1;return{items:b.map(function(v,w){const S=c.exec(v)[0].length,I=RegExp("^ {1,"+S+"}","gm"),C=v.replace(I,"").replace(c,""),o=w===b.length-1,i=C.indexOf(`
|
|
175
|
+
|
|
176
|
+
`)!==-1||o&&p;p=i;const s=h.inline,f=h.list;let m;h.list=!0,i?(h.inline=!1,m=Oe(C)+`
|
|
177
|
+
|
|
178
|
+
`):(h.inline=!0,m=Oe(C));const y=d(m,h);return h.inline=s,h.list=f,y}),ordered:r,start:g}},l:(u,d,h)=>e(u.ordered?"ol":"ul",{key:h.key,start:u.type==="20"?u.start:void 0},u.items.map(function(g,b){return e("li",{key:b},d(g,h))}))}}const ss=RegExp(`^\\[((?:\\[[^\\[\\]]*(?:\\[[^\\[\\]]*\\][^\\[\\]]*)*\\]|[^\\[\\]])*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['"]([\\s\\S]*?)['"])?\\s*\\)`),is=/^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/;function Oe(e){let t=e.length;for(;t>0&&e[t-1]<=" ";)t--;return e.slice(0,t)}function He(e,t){return e.startsWith(t)}function cs(e,t,r){if(Array.isArray(r)){for(let n=0;n<r.length;n++)if(He(e,r[n]))return!0;return!1}return r(e,t)}function Te(e){return e.replace(/[ÀÁÂÃÄÅàáâãä忯]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function ls(e){return Ua.test(e)?"right":Ka.test(e)?"center":Wa.test(e)?"left":null}function Ar(e,t,r,n){const a=r.inTable;r.inTable=!0;let c=[[]],u="";function d(){if(!u)return;const h=c[c.length-1];h.push.apply(h,t(u,r)),u=""}return e.trim().split(/(`[^`]*`|\\\||\|)/).filter(Boolean).forEach((h,g,b)=>{h.trim()==="|"&&(d(),n)?g!==0&&g!==b.length-1&&c.push([]):u+=h}),d(),r.inTable=a,c}function ds(e,t,r){r.inline=!0;const n=e[2]?e[2].replace(Fa,"").split("|").map(ls):[],a=e[3]?function(u,d,h){return u.trim().split(`
|
|
179
|
+
`).map(function(g){return Ar(g,d,h,!0)})}(e[3],t,r):[],c=Ar(e[1],t,r,!!a.length);return r.inline=!1,a.length?{align:n,cells:a,header:c,type:"25"}:{children:c,type:"21"}}function Er(e,t){return e.align[t]==null?{}:{textAlign:e.align[t]}}function je(e){return e.inline=1,e}function ce(e){return je(function(t,r){return r.inline?e.exec(t):null})}function le(e){return je(function(t,r){return r.inline||r.simple?e.exec(t):null})}function se(e){return function(t,r){return r.inline||r.simple?null:e.exec(t)}}function Pe(e){return je(function(t){return e.exec(t)})}const us=/(javascript|vbscript|data(?!:image)):/i;function ps(e){try{const t=decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"");if(us.test(t))return null}catch{return null}return e}function re(e){return e&&e.replace(Za,"$1")}function qe(e,t,r){const n=r.inline||!1,a=r.simple||!1;r.inline=!0,r.simple=!0;const c=e(t,r);return r.inline=n,r.simple=a,c}function fs(e,t,r){const n=r.inline||!1,a=r.simple||!1;r.inline=!1,r.simple=!0;const c=e(t,r);return r.inline=n,r.simple=a,c}function hs(e,t,r){const n=r.inline||!1;r.inline=!1;const a=e(t,r);return r.inline=n,a}const kt=(e,t,r)=>({children:qe(t,e[2],r)});function wt(){return{}}function vt(){return null}function ms(...e){return e.filter(Boolean).join(" ")}function $t(e,t,r){let n=e;const a=t.split(".");for(;a.length&&(n=n[a[0]],n!==void 0);)a.shift();return n||r}function gs(e="",t={}){t.overrides=t.overrides||{},t.namedCodesToUnicode=t.namedCodesToUnicode?ue({},xr,t.namedCodesToUnicode):xr;const r=t.slugify||Te,n=t.sanitizer||ps,a=t.createElement||zt.createElement,c=[yr,kr,wr,t.enforceAtxHeadings?$r:vr,Sr,jr,kn,wn],u=[...c,za,xt,Cr,yt];function d(o,i,...s){const f=$t(t.overrides,o+".props",{});return a(function(m,y){const x=$t(y,m);return x?typeof x=="function"||typeof x=="object"&&"render"in x?x:$t(y,m+".component",m):m}(o,t.overrides),ue({},i,f,{className:ms(i==null?void 0:i.className,f.className)||void 0}),...s)}function h(o){o=o.replace(ja,"");let i=!1;t.forceInline?i=!0:t.forceBlock||(i=Pa.test(o)===!1);const s=S(w(i?o:Oe(o).replace(Xa,"")+`
|
|
180
|
+
|
|
181
|
+
`,{inline:i}));for(;typeof s[s.length-1]=="string"&&!s[s.length-1].trim();)s.pop();if(t.wrapper===null)return s;const f=t.wrapper||(i?"span":"div");let m;if(s.length>1||t.forceWrapper)m=s;else{if(s.length===1)return m=s[0],typeof m=="string"?d("span",{key:"outer"},m):m;m=null}return a(f,{key:"outer"},m)}function g(o,i){if(!i||!i.trim())return null;const s=i.match(fa);return s?s.reduce(function(f,m){const y=m.indexOf("=");if(y!==-1){const x=function(R){return R.indexOf("-")!==-1&&R.match(Ea)===null&&(R=R.replace(Oa,function(K,L){return L.toUpperCase()})),R}(m.slice(0,y)).trim(),E=function(R){const K=R[0];return(K==='"'||K==="'")&&R.length>=2&&R[R.length-1]===K?R.slice(1,-1):R}(m.slice(y+1).trim()),M=br[x]||x;if(M==="ref")return f;const j=f[M]=function(R,K,L,A){return K==="style"?function(D){const H=[];let $="",N=!1,O=!1,W="";if(!D)return H;for(let q=0;q<D.length;q++){const z=D[q];if(z!=='"'&&z!=="'"||N||(O?z===W&&(O=!1,W=""):(O=!0,W=z)),z==="("&&$.endsWith("url")?N=!0:z===")"&&N&&(N=!1),z!==";"||O||N)$+=z;else{const U=$.trim();if(U){const Q=U.indexOf(":");if(Q>0){const V=U.slice(0,Q).trim(),oe=U.slice(Q+1).trim();H.push([V,oe])}}$=""}}const B=$.trim();if(B){const q=B.indexOf(":");if(q>0){const z=B.slice(0,q).trim(),U=B.slice(q+1).trim();H.push([z,U])}}return H}(L).reduce(function(D,[H,$]){return D[H.replace(/(-[a-z])/g,N=>N[1].toUpperCase())]=A($,R,H),D},{}):pa.indexOf(K)!==-1?A(re(L),R,K):(L.match(Ta)&&(L=re(L.slice(1,L.length-1))),L==="true"||L!=="false"&&L)}(o,x,E,n);typeof j=="string"&&(xt.test(j)||yt.test(j))&&(f[M]=h(j.trim()))}else m!=="style"&&(f[br[m]||m]=!0);return f},{}):null}const b=[],p={},v={0:{t:[">"],o:se(yr),i:1,u(o,i,s){const[,f,m]=o[0].replace(ga,"").match(ba);return{alert:f,children:i(m,s)}},l(o,i,s){const f={key:s.key};return o.alert&&(f.className="markdown-alert-"+r(o.alert.toLowerCase(),Te),o.children.unshift({attrs:{},children:[{type:"27",text:o.alert}],noInnerParse:!0,type:"11",tag:"header"})),d("blockquote",f,i(o.children,s))}},1:{o:Pe(xa),i:1,u:wt,l:(o,i,s)=>d("br",{key:s.key})},2:{t:o=>{const i=o[0];return i==="-"||i==="*"||i==="_"},o:se(ya),i:1,u:wt,l:(o,i,s)=>d("hr",{key:s.key})},3:{t:[" "],o:se(wr),i:0,u:o=>({lang:void 0,text:re(Oe(o[0].replace(/^ {4}/gm,"")))}),l:(o,i,s)=>d("pre",{key:s.key},d("code",ue({},o.attrs,{className:o.lang?"lang-"+o.lang:""}),o.text))},4:{t:["```","~~~"],o:se(kr),i:0,u:o=>({attrs:g("code",o[3]||""),lang:o[2]||void 0,text:o[4],type:"3"})},5:{t:["`"],o:le(ka),i:3,u:o=>({text:re(o[2])}),l:(o,i,s)=>d("code",{key:s.key},o.text)},6:{t:["[^"],o:se($a),i:0,u:o=>(b.push({footnote:o[2],identifier:o[1]}),{}),l:vt},7:{t:["[^"],o:ce(Sa),i:1,u:o=>({target:"#"+r(o[1],Te),text:o[1]}),l:(o,i,s)=>d("a",{key:s.key,href:n(o.target,"a","href")},d("sup",{key:s.key},o.text))},8:{t:["[ ]","[x]"],o:ce(Ia),i:1,u:o=>({completed:o[1].toLowerCase()==="x"}),l:(o,i,s)=>d("input",{checked:o.completed,key:s.key,readOnly:!0,type:"checkbox"})},9:{t:["#"],o:se(t.enforceAtxHeadings?$r:vr),i:1,u:(o,i,s)=>({children:qe(i,o[2],s),id:r(o[2],Te),level:o[1].length}),l:(o,i,s)=>d("h"+o.level,{id:o.id,key:s.key},i(o.children,s))},10:{o:se(Sr),i:0,u:(o,i,s)=>({children:qe(i,o[1],s),level:o[2]==="="?1:2,type:"9"})},11:{t:["<"],o:Pe(xt),i:1,u(o,i,s){const[,f]=o[3].match(es),m=RegExp("^"+f,"gm"),y=o[3].replace(m,""),x=(E=y,u.some(L=>L.test(E))?hs:qe);var E;const M=o[1].toLowerCase(),j=ua.indexOf(M)!==-1,R=(j?M:o[1]).trim(),K={attrs:g(R,o[2]),noInnerParse:j,tag:R};if(s.inAnchor=s.inAnchor||M==="a",j)K.text=o[3];else{const L=s.inHTML;s.inHTML=!0,K.children=x(i,y,s),s.inHTML=L}return s.inAnchor=!1,K},l:(o,i,s)=>d(o.tag,ue({key:s.key},o.attrs),o.text||(o.children?i(o.children,s):""))},13:{t:["<"],o:Pe(yt),i:1,u(o){const i=o[1].trim();return{attrs:g(i,o[2]||""),tag:i}},l:(o,i,s)=>d(o.tag,ue({},o.attrs,{key:s.key}))},12:{t:["<!--"],o:Pe(Cr),i:1,u:()=>({}),l:vt},14:{t:["!["],o:le(is),i:1,u:o=>({alt:re(o[1]),target:re(o[2]),title:re(o[3])}),l:(o,i,s)=>d("img",{key:s.key,alt:o.alt||void 0,title:o.title||void 0,src:n(o.target,"img","src")})},15:{t:["["],o:ce(ss),i:3,u:(o,i,s)=>({children:fs(i,o[1],s),target:re(o[2]),title:re(o[3])}),l:(o,i,s)=>d("a",{key:s.key,href:n(o.target,"a","href"),title:o.title},i(o.children,s))},16:{t:["<"],o:ce(_a),i:0,u:o=>({children:[{text:o[1],type:"27"}],target:o[1],type:"15"})},17:{t:(o,i)=>!i.inAnchor&&!t.disableAutoLink&&(He(o,"http://")||He(o,"https://")),o:ce(Ra),i:0,u:o=>({children:[{text:o[1],type:"27"}],target:o[1],title:void 0,type:"15"})},18:{t:["<"],o:ce(Ma),i:0,u(o){let i=o[1],s=o[1];return ha.test(s)||(s="mailto:"+s),{children:[{text:i.replace("mailto:",""),type:"27"}],target:s,type:"15"}}},20:Ir(d,1),33:Ir(d,2),19:{o:se(wa),i:3,u:wt,l:()=>`
|
|
182
|
+
`},21:{o:je(function(o,i){if(i.inline||i.simple||i.inHTML&&o.indexOf(`
|
|
183
|
+
|
|
184
|
+
`)===-1&&i.prevCapture.indexOf(`
|
|
185
|
+
|
|
186
|
+
`)===-1)return null;let s="";o.split(`
|
|
187
|
+
`).every(m=>(m+=`
|
|
188
|
+
`,!c.some(y=>y.test(m))&&(s+=m,!!m.trim())));const f=Oe(s);return f===""?null:[s,,f]}),i:3,u:kt,l:(o,i,s)=>d("p",{key:s.key},i(o.children,s))},22:{t:["["],o:ce(Da),i:0,u:o=>(p[o[1]]={target:o[2],title:o[4]},{}),l:vt},23:{t:["!["],o:le(Na),i:0,u:o=>({alt:o[1]?re(o[1]):void 0,ref:o[2]}),l:(o,i,s)=>p[o.ref]?d("img",{key:s.key,alt:o.alt,src:n(p[o.ref].target,"img","src"),title:p[o.ref].title}):null},24:{t:o=>o[0]==="["&&o.indexOf("](")===-1,o:ce(Ba),i:0,u:(o,i,s)=>({children:i(o[1],s),fallbackChildren:o[0],ref:o[2]}),l:(o,i,s)=>p[o.ref]?d("a",{key:s.key,href:n(p[o.ref].target,"a","href"),title:p[o.ref].title},i(o.children,s)):d("span",{key:s.key},o.fallbackChildren)},25:{t:["|"],o:se(jr),i:1,u:ds,l(o,i,s){const f=o;return d("table",{key:s.key},d("thead",null,d("tr",null,f.header.map(function(m,y){return d("th",{key:y,style:Er(f,y)},i(m,s))}))),d("tbody",null,f.cells.map(function(m,y){return d("tr",{key:y},m.map(function(x,E){return d("td",{key:E,style:Er(f,E)},i(x,s))}))})))}},27:{o:je(function(o,i){let s;return He(o,":")&&(s=Qa.exec(o)),s||Ja.exec(o)}),i:4,u(o){const i=o[0];return{text:i.indexOf("&")===-1?i:i.replace(Aa,(s,f)=>t.namedCodesToUnicode[f]||s)}},l:o=>o.text},28:{t:["**","__"],o:le(Ha),i:2,u:(o,i,s)=>({children:i(o[2],s)}),l:(o,i,s)=>d("strong",{key:s.key},i(o.children,s))},29:{t:o=>{const i=o[0];return(i==="*"||i==="_")&&o[1]!==i},o:le(qa),i:3,u:(o,i,s)=>({children:i(o[2],s)}),l:(o,i,s)=>d("em",{key:s.key},i(o.children,s))},30:{t:["\\"],o:le(Va),i:1,u:o=>({text:o[1],type:"27"})},31:{t:["=="],o:le(Ga),i:3,u:kt,l:(o,i,s)=>d("mark",{key:s.key},i(o.children,s))},32:{t:["~~"],o:le(Ya),i:3,u:kt,l:(o,i,s)=>d("del",{key:s.key},i(o.children,s))}};t.disableParsingRawHTML===!0&&(delete v[11],delete v[13]);const w=function(o){var i=Object.keys(o);function s(f,m){var y=[];if(m.prevCapture=m.prevCapture||"",f.trim())for(;f;)for(var x=0;x<i.length;){var E=i[x],M=o[E];if(!M.t||cs(f,m,M.t)){var j=M.o(f,m);if(j&&j[0]){f=f.substring(j[0].length);var R=M.u(j,s,m);m.prevCapture+=j[0],R.type||(R.type=E),y.push(R);break}x++}else x++}return m.prevCapture="",y}return i.sort(function(f,m){return o[f].i-o[m].i||(f<m?-1:1)}),function(f,m){return s(function(y){return y.replace(va,`
|
|
189
|
+
`).replace(Ca,"").replace(La," ")}(f),m)}}(v),S=(I=function(o,i){return function(s,f,m){const y=o[s.type].l;return i?i(()=>y(s,f,m),s,f,m):y(s,f,m)}}(v,t.renderRule),function o(i,s={}){if(Array.isArray(i)){const f=s.key,m=[];let y=!1;for(let x=0;x<i.length;x++){s.key=x;const E=o(i[x],s),M=typeof E=="string";M&&y?m[m.length-1]+=E:E!==null&&m.push(E),y=M}return s.key=f,m}return I(i,o,s)});var I;const C=h(e);return b.length?d("div",null,C,d("footer",{key:"footer"},b.map(function(o){return d("div",{id:r(o.identifier,Te),key:o.identifier},o.identifier,S(w(o.footnote,{inline:!0})))}))):C}const bs=e=>{let{children:t="",options:r}=e,n=function(a,c){if(a==null)return{};var u,d,h={},g=Object.keys(a);for(d=0;d<g.length;d++)c.indexOf(u=g[d])>=0||(h[u]=a[u]);return h}(e,da);return zt.cloneElement(gs(t,r),n)},xs=T.div`
|
|
190
|
+
code {
|
|
191
|
+
@media (prefers-color-scheme: dark) {
|
|
192
|
+
background-color: #374151 !important;
|
|
193
|
+
color: #e5e7eb !important;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
[data-theme="dark"] & {
|
|
197
|
+
background-color: #374151 !important;
|
|
198
|
+
color: #e5e7eb !important;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
pre {
|
|
203
|
+
@media (prefers-color-scheme: dark) {
|
|
204
|
+
background-color: #374151 !important;
|
|
205
|
+
color: #e5e7eb !important;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
[data-theme="dark"] & {
|
|
209
|
+
background-color: #374151 !important;
|
|
210
|
+
color: #e5e7eb !important;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
blockquote {
|
|
215
|
+
@media (prefers-color-scheme: dark) {
|
|
216
|
+
background-color: #1e3a8a !important;
|
|
217
|
+
border-left-color: #3b82f6 !important;
|
|
218
|
+
color: #e5e7eb !important;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
[data-theme="dark"] & {
|
|
222
|
+
background-color: #1e3a8a !important;
|
|
223
|
+
border-left-color: #3b82f6 !important;
|
|
224
|
+
color: #e5e7eb !important;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
`;function ct({content:e,className:t}){return l.jsx(xs,{className:t,children:l.jsx(bs,{options:{overrides:{p:{props:{style:{marginBottom:"12px",lineHeight:"1.5",color:"inherit"}}},strong:{props:{style:{fontWeight:700,color:"inherit"}}},em:{props:{style:{fontStyle:"italic",color:"inherit"}}},code:{props:{style:{backgroundColor:"#f3f4f6",padding:"2px 6px",borderRadius:"4px",fontSize:"14px",fontFamily:"monospace",color:"#111827"}}},pre:{props:{style:{backgroundColor:"#f3f4f6",padding:"12px",borderRadius:"6px",fontSize:"14px",fontFamily:"monospace",color:"#111827",overflowX:"auto",marginBottom:"12px"}}},ul:{props:{className:"list-disc list-inside mb-3 space-y-1 ml-2"}},ol:{props:{className:"list-decimal list-inside mb-3 space-y-1 ml-2"}},li:{props:{className:"leading-relaxed"}},blockquote:{props:{style:{borderLeft:"4px solid #93c5fd",paddingLeft:"16px",padding:"8px",fontStyle:"italic",marginBottom:"12px",backgroundColor:"#eff6ff",borderRadius:"4px",color:"inherit"}}},h1:{props:{style:{fontSize:"20px",fontWeight:700,marginBottom:"12px",color:"inherit"}}},h2:{props:{style:{fontSize:"18px",fontWeight:700,marginBottom:"8px",color:"inherit"}}},h3:{props:{style:{fontSize:"16px",fontWeight:700,marginBottom:"8px",color:"inherit"}}},h4:{props:{style:{fontSize:"14px",fontWeight:700,marginBottom:"8px",color:"inherit"}}},h5:{props:{style:{fontSize:"14px",fontWeight:700,marginBottom:"8px",color:"inherit"}}},h6:{props:{style:{fontSize:"14px",fontWeight:700,marginBottom:"8px",color:"inherit"}}},hr:{props:{style:{margin:"16px 0",borderColor:"#e5e7eb",borderWidth:"1px",borderStyle:"solid"}}},a:{props:{style:{color:"#2563eb",textDecoration:"underline"},target:"_blank",rel:"noopener noreferrer"}}}},children:e})})}const vn=T.div`
|
|
228
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
229
|
+
background-color: white;
|
|
230
|
+
border: 1px solid #e5e7eb;
|
|
231
|
+
min-height: 0;
|
|
232
|
+
|
|
233
|
+
/* Scoped CSS reset to prevent host page style leakage */
|
|
234
|
+
& button,
|
|
235
|
+
& input,
|
|
236
|
+
& textarea,
|
|
237
|
+
& select {
|
|
238
|
+
margin: 0;
|
|
239
|
+
padding: 0;
|
|
240
|
+
border: none;
|
|
241
|
+
background: none;
|
|
242
|
+
box-sizing: border-box;
|
|
243
|
+
font-family: inherit;
|
|
244
|
+
font-size: inherit;
|
|
245
|
+
font-weight: normal;
|
|
246
|
+
line-height: normal;
|
|
247
|
+
color: inherit;
|
|
248
|
+
text-shadow: none;
|
|
249
|
+
-webkit-appearance: none;
|
|
250
|
+
appearance: none;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/* Try both media query approaches */
|
|
254
|
+
@media (prefers-color-scheme: dark) {
|
|
255
|
+
background-color: #1f2937;
|
|
256
|
+
border-color: #374151;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/* Alternative approach using data attribute */
|
|
260
|
+
&[data-theme="dark"] {
|
|
261
|
+
background-color: #1f2937;
|
|
262
|
+
border-color: #374151;
|
|
263
|
+
}
|
|
264
|
+
`,Ie=T.div`
|
|
265
|
+
max-width: 80%;
|
|
266
|
+
padding: 12px;
|
|
267
|
+
border-radius: 8px;
|
|
268
|
+
font-size: 14px;
|
|
269
|
+
word-break: break-word;
|
|
270
|
+
margin-left: ${e=>e.$isUser?"auto":"0"};
|
|
271
|
+
margin-right: ${e=>e.$isUser?"0":"auto"};
|
|
272
|
+
line-height: 1.5;
|
|
273
|
+
|
|
274
|
+
/* User message styles - Light mode */
|
|
275
|
+
background-color: ${e=>e.$isUser?"#3b82f6":"#f3f4f6"};
|
|
276
|
+
color: ${e=>e.$isUser?"#ffffff":"#111827"};
|
|
277
|
+
|
|
278
|
+
/* Ensure bold text has proper contrast */
|
|
279
|
+
strong, b {
|
|
280
|
+
font-weight: 600;
|
|
281
|
+
color: inherit;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* Dark mode support - Media query */
|
|
285
|
+
@media (prefers-color-scheme: dark) {
|
|
286
|
+
background-color: ${e=>e.$isUser?"#3b82f6":"transparent"};
|
|
287
|
+
color: ${e=>e.$isUser?"#ffffff":"#e5e7eb"};
|
|
288
|
+
|
|
289
|
+
strong, b {
|
|
290
|
+
color: ${e=>(e.$isUser,"#ffffff")};
|
|
291
|
+
font-weight: 700;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/* Dark mode support - Data attribute (for ChatWindow/ChatWidget parents) */
|
|
296
|
+
[data-theme="dark"] & {
|
|
297
|
+
background-color: ${e=>e.$isUser?"#3b82f6":"transparent"};
|
|
298
|
+
color: ${e=>e.$isUser?"#ffffff":"#e5e7eb"};
|
|
299
|
+
|
|
300
|
+
strong, b {
|
|
301
|
+
color: ${e=>(e.$isUser,"#ffffff")};
|
|
302
|
+
font-weight: 700;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
`,Ht=T.div`
|
|
306
|
+
display: flex;
|
|
307
|
+
flex-direction: column;
|
|
308
|
+
flex: 1;
|
|
309
|
+
min-width: 0;
|
|
310
|
+
border: 1px solid #e5e7eb;
|
|
311
|
+
border-radius: 14px;
|
|
312
|
+
background-color: #ffffff;
|
|
313
|
+
overflow: hidden;
|
|
314
|
+
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
|
315
|
+
|
|
316
|
+
&:focus-within {
|
|
317
|
+
border-color: #9ca3af;
|
|
318
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
@media (prefers-color-scheme: dark) {
|
|
322
|
+
background-color: #18181b;
|
|
323
|
+
border-color: rgba(255, 255, 255, 0.1);
|
|
324
|
+
|
|
325
|
+
&:focus-within {
|
|
326
|
+
border-color: rgba(255, 255, 255, 0.3);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
[data-theme='dark'] & {
|
|
331
|
+
background-color: #18181b;
|
|
332
|
+
border-color: rgba(255, 255, 255, 0.1);
|
|
333
|
+
|
|
334
|
+
&:focus-within {
|
|
335
|
+
border-color: rgba(255, 255, 255, 0.3);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
`,qt=T.div`
|
|
339
|
+
display: flex;
|
|
340
|
+
align-items: center;
|
|
341
|
+
justify-content: space-between;
|
|
342
|
+
gap: 6px;
|
|
343
|
+
flex-shrink: 0;
|
|
344
|
+
padding: 6px 10px;
|
|
345
|
+
border-top: 1px solid #e5e7eb;
|
|
346
|
+
background-color: #f9fafb;
|
|
347
|
+
|
|
348
|
+
@media (prefers-color-scheme: dark) {
|
|
349
|
+
border-top-color: #52525b;
|
|
350
|
+
background-color: #3f3f46;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
[data-theme='dark'] & {
|
|
354
|
+
border-top-color: #52525b;
|
|
355
|
+
background-color: #3f3f46;
|
|
356
|
+
}
|
|
357
|
+
`,ys=T.textarea`
|
|
358
|
+
display: block;
|
|
359
|
+
width: 100%;
|
|
360
|
+
min-width: 0;
|
|
361
|
+
min-height: 42px;
|
|
362
|
+
max-height: 96px;
|
|
363
|
+
padding: 8px 12px;
|
|
364
|
+
border: none;
|
|
365
|
+
border-radius: 0;
|
|
366
|
+
background-color: transparent;
|
|
367
|
+
color: #1f2937;
|
|
368
|
+
font-size: 14px;
|
|
369
|
+
line-height: 1.5;
|
|
370
|
+
font-family: inherit;
|
|
371
|
+
resize: none;
|
|
372
|
+
outline: none;
|
|
373
|
+
transition: color 0.2s ease;
|
|
374
|
+
box-sizing: border-box;
|
|
375
|
+
overflow-y: auto;
|
|
376
|
+
|
|
377
|
+
&::placeholder {
|
|
378
|
+
color: #6b7280;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
&:disabled {
|
|
382
|
+
opacity: 0.5;
|
|
383
|
+
cursor: not-allowed;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
@media (prefers-color-scheme: dark) {
|
|
387
|
+
color: #f9fafb;
|
|
388
|
+
|
|
389
|
+
&::placeholder {
|
|
390
|
+
color: #9ca3af;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
[data-theme='dark'] & {
|
|
395
|
+
color: #f9fafb;
|
|
396
|
+
|
|
397
|
+
&::placeholder {
|
|
398
|
+
color: #9ca3af;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
`,Gt=T.div`
|
|
402
|
+
display: flex;
|
|
403
|
+
align-items: center;
|
|
404
|
+
gap: 8px;
|
|
405
|
+
padding: 8px 12px 10px;
|
|
406
|
+
border-top: 1px solid #e5e7eb;
|
|
407
|
+
background-color: #ffffff;
|
|
408
|
+
|
|
409
|
+
@media (prefers-color-scheme: dark) {
|
|
410
|
+
background-color: #1f2937;
|
|
411
|
+
border-top-color: #374151;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
[data-theme="dark"] & {
|
|
415
|
+
background-color: #1f2937;
|
|
416
|
+
border-top-color: #374151;
|
|
417
|
+
}
|
|
418
|
+
`,ks=T.textarea`
|
|
419
|
+
flex: 1;
|
|
420
|
+
width: 100%;
|
|
421
|
+
min-height: 40px;
|
|
422
|
+
max-height: 120px;
|
|
423
|
+
padding: 8px 12px;
|
|
424
|
+
border: 1px solid #d1d5db;
|
|
425
|
+
border-radius: 6px;
|
|
426
|
+
background-color: #ffffff;
|
|
427
|
+
color: #1f2937;
|
|
428
|
+
font-size: 14px;
|
|
429
|
+
font-family: inherit;
|
|
430
|
+
resize: none;
|
|
431
|
+
outline: none;
|
|
432
|
+
transition: all 0.2s ease;
|
|
433
|
+
|
|
434
|
+
&::placeholder {
|
|
435
|
+
color: #6b7280;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
&:focus {
|
|
439
|
+
border-color: #3b82f6;
|
|
440
|
+
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
&:disabled {
|
|
444
|
+
opacity: 0.5;
|
|
445
|
+
cursor: not-allowed;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
@media (prefers-color-scheme: dark) {
|
|
449
|
+
background-color: #374151;
|
|
450
|
+
color: #f9fafb;
|
|
451
|
+
border-color: #4b5563;
|
|
452
|
+
|
|
453
|
+
&::placeholder {
|
|
454
|
+
color: #9ca3af;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
&:focus {
|
|
458
|
+
border-color: #3b82f6;
|
|
459
|
+
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
[data-theme="dark"] & {
|
|
464
|
+
background-color: #374151;
|
|
465
|
+
color: #f9fafb;
|
|
466
|
+
border-color: #4b5563;
|
|
467
|
+
|
|
468
|
+
&::placeholder {
|
|
469
|
+
color: #9ca3af;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
&:focus {
|
|
473
|
+
border-color: #3b82f6;
|
|
474
|
+
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
`,ws=T.button`
|
|
478
|
+
width: 32px;
|
|
479
|
+
height: 32px;
|
|
480
|
+
min-width: 32px;
|
|
481
|
+
min-height: 32px;
|
|
482
|
+
padding: 0;
|
|
483
|
+
box-sizing: border-box;
|
|
484
|
+
line-height: normal;
|
|
485
|
+
background: transparent;
|
|
486
|
+
border: 2px solid #3b82f6;
|
|
487
|
+
border-radius: 50%;
|
|
488
|
+
color: #3b82f6;
|
|
489
|
+
cursor: pointer;
|
|
490
|
+
display: flex;
|
|
491
|
+
align-items: center;
|
|
492
|
+
justify-content: center;
|
|
493
|
+
transition: all 0.2s ease;
|
|
494
|
+
flex-shrink: 0;
|
|
495
|
+
|
|
496
|
+
&:hover:not(:disabled) {
|
|
497
|
+
background: #3b82f6;
|
|
498
|
+
color: white;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
&:disabled {
|
|
502
|
+
opacity: 0.5;
|
|
503
|
+
cursor: not-allowed;
|
|
504
|
+
border-color: #9ca3af;
|
|
505
|
+
color: #9ca3af;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
svg {
|
|
509
|
+
width: 16px !important;
|
|
510
|
+
height: 16px !important;
|
|
511
|
+
min-width: 16px !important;
|
|
512
|
+
min-height: 16px !important;
|
|
513
|
+
color: inherit;
|
|
514
|
+
display: block !important;
|
|
515
|
+
visibility: visible !important;
|
|
516
|
+
opacity: 1 !important;
|
|
517
|
+
flex-shrink: 0;
|
|
518
|
+
}
|
|
519
|
+
svg path {
|
|
520
|
+
stroke: currentColor !important;
|
|
521
|
+
fill: none !important;
|
|
522
|
+
visibility: visible !important;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
@media (prefers-color-scheme: dark) {
|
|
526
|
+
border-color: #60a5fa;
|
|
527
|
+
color: #60a5fa;
|
|
528
|
+
&:hover:not(:disabled) {
|
|
529
|
+
background: #2563eb;
|
|
530
|
+
color: white;
|
|
531
|
+
}
|
|
532
|
+
&:disabled {
|
|
533
|
+
border-color: #6b7280;
|
|
534
|
+
color: #6b7280;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
[data-theme="dark"] & {
|
|
539
|
+
border-color: #60a5fa;
|
|
540
|
+
color: #60a5fa;
|
|
541
|
+
&:hover:not(:disabled) {
|
|
542
|
+
background: #2563eb;
|
|
543
|
+
color: white;
|
|
544
|
+
}
|
|
545
|
+
&:disabled {
|
|
546
|
+
border-color: #6b7280;
|
|
547
|
+
color: #6b7280;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
`,Yt=T.button`
|
|
551
|
+
width: 26px;
|
|
552
|
+
height: 26px;
|
|
553
|
+
min-width: 26px;
|
|
554
|
+
min-height: 26px;
|
|
555
|
+
padding: 0;
|
|
556
|
+
box-sizing: border-box;
|
|
557
|
+
line-height: normal;
|
|
558
|
+
background: transparent;
|
|
559
|
+
border: 1px solid #3b82f6;
|
|
560
|
+
border-radius: 8px;
|
|
561
|
+
color: #3b82f6;
|
|
562
|
+
cursor: pointer;
|
|
563
|
+
display: flex;
|
|
564
|
+
align-items: center;
|
|
565
|
+
justify-content: center;
|
|
566
|
+
transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
|
|
567
|
+
box-shadow 0.2s ease;
|
|
568
|
+
flex-shrink: 0;
|
|
569
|
+
|
|
570
|
+
&:hover:not(:disabled) {
|
|
571
|
+
background: rgba(59, 130, 246, 0.12);
|
|
572
|
+
color: #2563eb;
|
|
573
|
+
border-color: #2563eb;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
&:focus-visible {
|
|
577
|
+
outline: none;
|
|
578
|
+
box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(59, 130, 246, 0.45);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
&:disabled {
|
|
582
|
+
opacity: 0.45;
|
|
583
|
+
cursor: not-allowed;
|
|
584
|
+
border-color: #9ca3af;
|
|
585
|
+
color: #9ca3af;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
svg {
|
|
589
|
+
width: 13px !important;
|
|
590
|
+
height: 13px !important;
|
|
591
|
+
min-width: 13px !important;
|
|
592
|
+
min-height: 13px !important;
|
|
593
|
+
color: inherit;
|
|
594
|
+
display: block !important;
|
|
595
|
+
visibility: visible !important;
|
|
596
|
+
opacity: 1 !important;
|
|
597
|
+
flex-shrink: 0;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
svg path {
|
|
601
|
+
stroke: currentColor !important;
|
|
602
|
+
fill: none !important;
|
|
603
|
+
visibility: visible !important;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
@media (prefers-color-scheme: dark) {
|
|
607
|
+
border-color: #60a5fa;
|
|
608
|
+
color: #60a5fa;
|
|
609
|
+
|
|
610
|
+
&:hover:not(:disabled) {
|
|
611
|
+
background: rgba(96, 165, 250, 0.14);
|
|
612
|
+
color: #93c5fd;
|
|
613
|
+
border-color: #93c5fd;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
&:focus-visible {
|
|
617
|
+
box-shadow: 0 0 0 2px #18181b, 0 0 0 4px rgba(96, 165, 250, 0.45);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
&:disabled {
|
|
621
|
+
border-color: #6b7280;
|
|
622
|
+
color: #6b7280;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
[data-theme='dark'] & {
|
|
627
|
+
border-color: #60a5fa;
|
|
628
|
+
color: #60a5fa;
|
|
629
|
+
|
|
630
|
+
&:hover:not(:disabled) {
|
|
631
|
+
background: rgba(96, 165, 250, 0.14);
|
|
632
|
+
color: #93c5fd;
|
|
633
|
+
border-color: #93c5fd;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
&:focus-visible {
|
|
637
|
+
box-shadow: 0 0 0 2px #18181b, 0 0 0 4px rgba(96, 165, 250, 0.45);
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
&:disabled {
|
|
641
|
+
border-color: #6b7280;
|
|
642
|
+
color: #6b7280;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
`,St=(e,t=.15)=>{if(e&&e.startsWith("#")){const r=e.replace("#",""),n=parseInt(r,16);if(isNaN(n))return e;const a=Math.max(0,Math.min(255,n>>16&255)*(1-t)),c=Math.max(0,Math.min(255,n>>8&255)*(1-t)),u=Math.max(0,Math.min(255,n&255)*(1-t));return`#${Math.floor(a).toString(16).padStart(2,"0")}${Math.floor(c).toString(16).padStart(2,"0")}${Math.floor(u).toString(16).padStart(2,"0")}`}return e||"#2563eb"},vs=T.button`
|
|
646
|
+
position: fixed;
|
|
647
|
+
z-index: 50;
|
|
648
|
+
height: 48px;
|
|
649
|
+
padding: 0 16px;
|
|
650
|
+
box-sizing: border-box;
|
|
651
|
+
line-height: normal;
|
|
652
|
+
background: ${e=>{if(e.$primaryColor){const t=St(e.$primaryColor,.1);return`linear-gradient(135deg, ${e.$primaryColor} 0%, ${t} 100%)`}return"linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%)"}};
|
|
653
|
+
color: white;
|
|
654
|
+
border: none;
|
|
655
|
+
border-radius: 24px;
|
|
656
|
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
657
|
+
cursor: pointer;
|
|
658
|
+
display: flex;
|
|
659
|
+
align-items: center;
|
|
660
|
+
gap: 8px;
|
|
661
|
+
font-weight: 500;
|
|
662
|
+
font-size: 14px;
|
|
663
|
+
transition: all 0.2s ease;
|
|
664
|
+
|
|
665
|
+
/* Position based on prop */
|
|
666
|
+
${e=>{switch(e.$position){case"bottom-left":return"bottom: 24px; left: 24px;";case"top-right":return"top: 24px; right: 24px;";case"top-left":return"top: 24px; left: 24px;";default:return"bottom: 24px; right: 24px;"}}}
|
|
667
|
+
|
|
668
|
+
&:hover {
|
|
669
|
+
background: ${e=>{if(e.$primaryColor){const t=St(e.$primaryColor,.2),r=St(e.$primaryColor,.3);return`linear-gradient(135deg, ${t} 0%, ${r} 100%)`}return"linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%)"}};
|
|
670
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
.icon-container {
|
|
674
|
+
width: 24px;
|
|
675
|
+
height: 24px;
|
|
676
|
+
background: rgba(255, 255, 255, 0.2);
|
|
677
|
+
border-radius: 50%;
|
|
678
|
+
display: flex;
|
|
679
|
+
align-items: center;
|
|
680
|
+
justify-content: center;
|
|
681
|
+
}
|
|
682
|
+
`,$s=T.div`
|
|
683
|
+
position: fixed;
|
|
684
|
+
z-index: 50;
|
|
685
|
+
width: 320px;
|
|
686
|
+
background: white;
|
|
687
|
+
border: 1px solid #e5e7eb;
|
|
688
|
+
border-radius: 8px;
|
|
689
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
690
|
+
display: flex;
|
|
691
|
+
flex-direction: column;
|
|
692
|
+
|
|
693
|
+
/* Position based on prop */
|
|
694
|
+
${e=>{switch(e.$position){case"bottom-left":return"bottom: 24px; left: 24px;";case"top-right":return"top: 24px; right: 24px;";case"top-left":return"top: 24px; left: 24px;";default:return"bottom: 24px; right: 24px;"}}}
|
|
695
|
+
|
|
696
|
+
@media (prefers-color-scheme: dark) {
|
|
697
|
+
background: #1f2937;
|
|
698
|
+
border-color: #374151;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
&[data-theme="dark"] {
|
|
702
|
+
background: #1f2937;
|
|
703
|
+
border-color: #374151;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
@media (min-width: 640px) {
|
|
707
|
+
width: 384px;
|
|
708
|
+
}
|
|
709
|
+
`;T.div`
|
|
710
|
+
padding: 12px 16px;
|
|
711
|
+
background: ${e=>e.primaryColor||"#3b82f6"};
|
|
712
|
+
color: white;
|
|
713
|
+
border-radius: 8px 8px 0 0;
|
|
714
|
+
display: flex;
|
|
715
|
+
align-items: center;
|
|
716
|
+
justify-content: space-between;
|
|
717
|
+
font-weight: 500;
|
|
718
|
+
|
|
719
|
+
.header-content {
|
|
720
|
+
display: flex;
|
|
721
|
+
align-items: center;
|
|
722
|
+
gap: 8px;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
.header-actions {
|
|
726
|
+
display: flex;
|
|
727
|
+
align-items: center;
|
|
728
|
+
gap: 4px;
|
|
729
|
+
}
|
|
730
|
+
`;T.button`
|
|
731
|
+
width: 24px;
|
|
732
|
+
height: 24px;
|
|
733
|
+
padding: 0;
|
|
734
|
+
box-sizing: border-box;
|
|
735
|
+
line-height: normal;
|
|
736
|
+
background: transparent;
|
|
737
|
+
border: none;
|
|
738
|
+
color: white;
|
|
739
|
+
cursor: pointer;
|
|
740
|
+
display: flex;
|
|
741
|
+
align-items: center;
|
|
742
|
+
justify-content: center;
|
|
743
|
+
border-radius: 4px;
|
|
744
|
+
transition: background-color 0.2s ease;
|
|
745
|
+
|
|
746
|
+
&:hover {
|
|
747
|
+
background: rgba(255, 255, 255, 0.1);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
svg {
|
|
751
|
+
width: 16px;
|
|
752
|
+
height: 16px;
|
|
753
|
+
}
|
|
754
|
+
`;T.div`
|
|
755
|
+
flex: 1;
|
|
756
|
+
overflow-y: auto;
|
|
757
|
+
padding: 16px;
|
|
758
|
+
display: flex;
|
|
759
|
+
flex-direction: column;
|
|
760
|
+
gap: 16px;
|
|
761
|
+
|
|
762
|
+
/* Custom scrollbar */
|
|
763
|
+
&::-webkit-scrollbar {
|
|
764
|
+
width: 6px;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
&::-webkit-scrollbar-track {
|
|
768
|
+
background: #f1f5f9;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
&::-webkit-scrollbar-thumb {
|
|
772
|
+
background: #cbd5e1;
|
|
773
|
+
border-radius: 3px;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
777
|
+
background: #94a3b8;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
@media (prefers-color-scheme: dark) {
|
|
781
|
+
&::-webkit-scrollbar-track {
|
|
782
|
+
background: #374151;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
&::-webkit-scrollbar-thumb {
|
|
786
|
+
background: #6b7280;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
790
|
+
background: #9ca3af;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
[data-theme="dark"] & {
|
|
795
|
+
&::-webkit-scrollbar-track {
|
|
796
|
+
background: #374151;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
&::-webkit-scrollbar-thumb {
|
|
800
|
+
background: #6b7280;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
804
|
+
background: #9ca3af;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
`;const Qt=T.div`
|
|
808
|
+
display: flex;
|
|
809
|
+
gap: 4px;
|
|
810
|
+
align-items: center;
|
|
811
|
+
|
|
812
|
+
.dot {
|
|
813
|
+
width: 8px;
|
|
814
|
+
height: 8px;
|
|
815
|
+
background: #6b7280;
|
|
816
|
+
border-radius: 50%;
|
|
817
|
+
animation: bounce 1.4s ease-in-out infinite both;
|
|
818
|
+
|
|
819
|
+
&:nth-child(1) { animation-delay: -0.32s; }
|
|
820
|
+
&:nth-child(2) { animation-delay: -0.16s; }
|
|
821
|
+
&:nth-child(3) { animation-delay: 0s; }
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
@keyframes bounce {
|
|
825
|
+
0%, 80%, 100% {
|
|
826
|
+
transform: scale(0);
|
|
827
|
+
}
|
|
828
|
+
40% {
|
|
829
|
+
transform: scale(1);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
@media (prefers-color-scheme: dark) {
|
|
834
|
+
.dot {
|
|
835
|
+
background: #9ca3af;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
`;T.div`
|
|
839
|
+
font-size: 12px;
|
|
840
|
+
margin-top: 4px;
|
|
841
|
+
color: ${e=>e.$isUser?"rgba(255, 255, 255, 0.8)":"#6b7280"};
|
|
842
|
+
|
|
843
|
+
@media (prefers-color-scheme: dark) {
|
|
844
|
+
color: ${e=>e.$isUser?"rgba(255, 255, 255, 0.8)":"#d1d5db"};
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
[data-theme="dark"] & {
|
|
848
|
+
color: ${e=>e.$isUser?"rgba(255, 255, 255, 0.8)":"#d1d5db"};
|
|
849
|
+
}
|
|
850
|
+
`;const Vt=T.div`
|
|
851
|
+
font-size: 14px;
|
|
852
|
+
color: #dc2626;
|
|
853
|
+
text-align: center;
|
|
854
|
+
padding: 8px;
|
|
855
|
+
margin: 16px 0;
|
|
856
|
+
|
|
857
|
+
@media (prefers-color-scheme: dark) {
|
|
858
|
+
color: #f87171;
|
|
859
|
+
}
|
|
860
|
+
`,Ss=T.div`
|
|
861
|
+
position: absolute;
|
|
862
|
+
${e=>e.$position==="top"?"top: 0;":"bottom: 0;"}
|
|
863
|
+
left: 0;
|
|
864
|
+
right: 0;
|
|
865
|
+
height: 6px;
|
|
866
|
+
background: linear-gradient(90deg, #e5e7eb 0%, #3b82f6 50%, #e5e7eb 100%);
|
|
867
|
+
cursor: ${e=>(e.$position==="top","ns-resize")};
|
|
868
|
+
border-radius: ${e=>e.$position==="top"?"8px 8px 0 0":"0 0 8px 8px"};
|
|
869
|
+
opacity: 0.7;
|
|
870
|
+
transition: opacity 0.2s ease;
|
|
871
|
+
|
|
872
|
+
&:hover {
|
|
873
|
+
opacity: 1;
|
|
874
|
+
background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 50%, #3b82f6 100%);
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
@media (prefers-color-scheme: dark) {
|
|
878
|
+
background: linear-gradient(90deg, #374151 0%, #3b82f6 50%, #374151 100%);
|
|
879
|
+
|
|
880
|
+
&:hover {
|
|
881
|
+
background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 50%, #3b82f6 100%);
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
`,me=T.img`
|
|
885
|
+
width: ${e=>e.$size||"32px"};
|
|
886
|
+
height: ${e=>e.$size||"32px"};
|
|
887
|
+
border-radius: 50%;
|
|
888
|
+
object-fit: cover;
|
|
889
|
+
flex-shrink: 0;
|
|
890
|
+
border: 2px solid rgba(255, 255, 255, 0.2);
|
|
891
|
+
background-color: rgba(255, 255, 255, 0.1);
|
|
892
|
+
`,Cs=T.div`
|
|
893
|
+
display: flex;
|
|
894
|
+
flex-direction: column;
|
|
895
|
+
align-items: center;
|
|
896
|
+
justify-content: flex-start;
|
|
897
|
+
padding: 24px 16px;
|
|
898
|
+
flex: 1;
|
|
899
|
+
min-height: 0;
|
|
900
|
+
overflow-y: auto;
|
|
901
|
+
gap: 20px;
|
|
902
|
+
position: relative;
|
|
903
|
+
|
|
904
|
+
/* Gradient background - starts with full primary color at top, fades to background color */
|
|
905
|
+
background: ${e=>e.$primaryColor?`linear-gradient(to bottom, ${e.$primaryColor} 0%, ${e.$primaryColor} 20%, rgba(255, 255, 255, 0.3) 45%, rgba(255, 255, 255, 0.7) 65%, rgba(255, 255, 255, 1) 100%)`:"transparent"};
|
|
906
|
+
|
|
907
|
+
@media (prefers-color-scheme: dark) {
|
|
908
|
+
background: ${e=>e.$primaryColor?`linear-gradient(to bottom, ${e.$primaryColor} 0%, ${e.$primaryColor} 20%, rgba(31, 41, 55, 0.3) 45%, rgba(31, 41, 55, 0.7) 65%, rgba(31, 41, 55, 1) 100%)`:"transparent"};
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
[data-theme="dark"] & {
|
|
912
|
+
background: ${e=>e.$primaryColor?`linear-gradient(to bottom, ${e.$primaryColor} 0%, ${e.$primaryColor} 20%, rgba(31, 41, 55, 0.3) 45%, rgba(31, 41, 55, 0.7) 65%, rgba(31, 41, 55, 1) 100%)`:"transparent"};
|
|
913
|
+
}
|
|
914
|
+
`,js=T.div`
|
|
915
|
+
font-size: 18px;
|
|
916
|
+
font-weight: 600;
|
|
917
|
+
text-align: center;
|
|
918
|
+
color: #111827;
|
|
919
|
+
margin-bottom: 8px;
|
|
920
|
+
|
|
921
|
+
@media (prefers-color-scheme: dark) {
|
|
922
|
+
color: #f9fafb;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
[data-theme="dark"] & {
|
|
926
|
+
color: #f9fafb;
|
|
927
|
+
}
|
|
928
|
+
`,Is=T.img`
|
|
929
|
+
max-width: 120px;
|
|
930
|
+
max-height: 120px;
|
|
931
|
+
width: auto;
|
|
932
|
+
height: auto;
|
|
933
|
+
object-fit: contain;
|
|
934
|
+
margin-bottom: 8px;
|
|
935
|
+
border-radius: 8px;
|
|
936
|
+
`,As=T.div`
|
|
937
|
+
display: flex;
|
|
938
|
+
flex-direction: column;
|
|
939
|
+
gap: 12px;
|
|
940
|
+
width: 100%;
|
|
941
|
+
max-width: 100%;
|
|
942
|
+
margin-bottom: 16px;
|
|
943
|
+
`,Es=T.button`
|
|
944
|
+
width: 100%;
|
|
945
|
+
padding: 12px 16px;
|
|
946
|
+
box-sizing: border-box;
|
|
947
|
+
line-height: normal;
|
|
948
|
+
text-align: left;
|
|
949
|
+
border: 1px solid #e5e7eb;
|
|
950
|
+
border-radius: 8px;
|
|
951
|
+
background-color: #ffffff;
|
|
952
|
+
color: #111827;
|
|
953
|
+
font-size: 14px;
|
|
954
|
+
font-weight: 500;
|
|
955
|
+
cursor: pointer;
|
|
956
|
+
transition: all 0.2s ease;
|
|
957
|
+
|
|
958
|
+
&:hover:not(:disabled) {
|
|
959
|
+
background-color: ${e=>e.$primaryColor?`${e.$primaryColor}15`:"#f3f4f6"};
|
|
960
|
+
border-color: ${e=>e.$primaryColor||"#d1d5db"};
|
|
961
|
+
transform: translateY(-1px);
|
|
962
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
&:active:not(:disabled) {
|
|
966
|
+
transform: translateY(0);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
&:disabled {
|
|
970
|
+
opacity: 0.5;
|
|
971
|
+
cursor: not-allowed;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
@media (prefers-color-scheme: dark) {
|
|
975
|
+
background-color: #374151;
|
|
976
|
+
color: #f9fafb;
|
|
977
|
+
border-color: #4b5563;
|
|
978
|
+
|
|
979
|
+
&:hover:not(:disabled) {
|
|
980
|
+
background-color: ${e=>e.$primaryColor?`${e.$primaryColor}25`:"#4b5563"};
|
|
981
|
+
border-color: ${e=>e.$primaryColor||"#6b7280"};
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
[data-theme="dark"] & {
|
|
986
|
+
background-color: #374151;
|
|
987
|
+
color: #f9fafb;
|
|
988
|
+
border-color: #4b5563;
|
|
989
|
+
|
|
990
|
+
&:hover:not(:disabled) {
|
|
991
|
+
background-color: ${e=>e.$primaryColor?`${e.$primaryColor}25`:"#4b5563"};
|
|
992
|
+
border-color: ${e=>e.$primaryColor||"#6b7280"};
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
`,Ts=T.div`
|
|
996
|
+
display: flex;
|
|
997
|
+
align-items: center;
|
|
998
|
+
gap: 8px;
|
|
999
|
+
width: 100%;
|
|
1000
|
+
margin-top: auto;
|
|
1001
|
+
padding-top: 16px;
|
|
1002
|
+
border-top: 1px solid #e5e7eb;
|
|
1003
|
+
|
|
1004
|
+
@media (prefers-color-scheme: dark) {
|
|
1005
|
+
border-top-color: #374151;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
[data-theme="dark"] & {
|
|
1009
|
+
border-top-color: #374151;
|
|
1010
|
+
}
|
|
1011
|
+
`,lt=k.forwardRef(function({value:t,onChange:r,onKeyDown:n,placeholder:a="Type a message...",disabled:c=!1,className:u,maxLength:d=2e3,variant:h="default"},g){const b=w=>{r(w.target.value)},p=w=>{w.key==="Enter"&&!w.shiftKey&&w.preventDefault(),n(w)},v=h==="composer"?ys:ks;return l.jsx(v,{ref:g,value:t,onChange:b,onKeyDown:p,placeholder:a,disabled:c,maxLength:d,className:u,onInput:w=>{const S=w.target;S.style.height="auto";const I=h==="composer"?96:120;S.style.height=`${Math.min(S.scrollHeight,I)}px`}})});function dt({size:e=16}){return l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"M22 2L11 13"}),l.jsx("path",{d:"M22 2L15 22L11 13L2 9L22 2Z"})]})}function Zt({config:e,onQuestionClick:t,onSendMessage:r,isLoading:n}){const[a,c]=k.useState(""),u=k.useRef(null),d=async()=>{!a.trim()||n||(await r(a.trim()),c(""))},h=b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),d())},g=e.welcomeMessage||"Hi there 👋 How can we help?";return l.jsxs(Cs,{$primaryColor:e.primaryColor,children:[e.welcomeImage&&l.jsx(Is,{src:e.welcomeImage,alt:"Welcome"}),l.jsx(js,{children:g}),e.quickQuestions&&e.quickQuestions.length>0&&l.jsx(As,{children:e.quickQuestions.map((b,p)=>l.jsx(Es,{onClick:()=>t(b),disabled:n,$primaryColor:e.primaryColor,children:b},p))}),l.jsxs(Ts,{children:[l.jsx(lt,{ref:u,value:a,onChange:c,onKeyDown:h,placeholder:e.placeholder||"Type a message...",disabled:n}),l.jsx(ws,{onClick:d,disabled:n||!a.trim(),children:l.jsx(dt,{size:16})})]})]})}function ut(e,t){var I;const r=(e.maxAttachmentSizeMB??10)*1024*1024,n=e.maxAttachments??3,a=(I=e.allowedAttachmentTypes)!=null&&I.length?e.allowedAttachmentTypes:pn,c=!!(e.enableAttachments&&e.publishableKey),[u,d]=k.useState([]),[h,g]=k.useState(null),b=k.useRef([]);k.useEffect(()=>{b.current=u},[u]);const p=k.useCallback(async C=>{if(c){g(null);for(const o of C){if(b.current.length>=n){g(`At most ${n} attachments per message.`);break}const i=fn(o,r,a);if(i){g(`${o.name}: ${i}`);continue}try{const s=await t(o);d(f=>{if(f.length>=n)return f;const m=[...f,s];return b.current=m,m})}catch(s){g(s instanceof Error?s.message:"Upload failed")}}}},[a,c,r,n,t]),v=k.useCallback(C=>{d(o=>{const i=o.filter(s=>s.id!==C);return b.current=i,i})},[]),w=k.useCallback(()=>{d([]),b.current=[],g(null)},[]),S=k.useCallback(C=>{g(null),d(o=>{if(o.length>=n)return o;const i=[...o,C];return b.current=i,i})},[n]);return{enabled:c,staged:u,attachmentError:h,setAttachmentError:g,addFiles:p,appendStaged:S,removeStaged:v,clearStaged:w,maxFiles:n,maxBytes:r,allowed:a}}function Rs({size:e=16}){return l.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:l.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function Ms({size:e=16}){return l.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[l.jsx("path",{d:"M18 6 6 18"}),l.jsx("path",{d:"m6 6 12 12"})]})}/*!---------------------------------------------------------------------------------------------
|
|
1012
|
+
* Copyright (c) StackBlitz. All rights reserved.
|
|
1013
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
1014
|
+
*--------------------------------------------------------------------------------------------*/const _s={damping:.7,stiffness:.05,mass:1.25},Os=70,zs=1e3/60,Ds=350;let pt=!1;var Rr;(Rr=globalThis.document)==null||Rr.addEventListener("mousedown",()=>{pt=!0});var Mr;(Mr=globalThis.document)==null||Mr.addEventListener("mouseup",()=>{pt=!1});var _r;(_r=globalThis.document)==null||_r.addEventListener("click",()=>{pt=!1});const Ns=(e={})=>{const[t,r]=k.useState(!1),[n,a]=k.useState(e.initial!==!1),[c,u]=k.useState(!1),d=k.useRef(null);d.current=e;const h=k.useCallback(()=>{var f;if(!pt)return!1;const i=window.getSelection();if(!i||!i.rangeCount)return!1;const s=i.getRangeAt(0);return s.commonAncestorContainer.contains(C.current)||((f=C.current)==null?void 0:f.contains(s.commonAncestorContainer))},[]),g=k.useCallback(i=>{p.isAtBottom=i,a(i)},[]),b=k.useCallback(i=>{p.escapedFromLock=i,r(i)},[]),p=k.useMemo(()=>{let i;return{escapedFromLock:t,isAtBottom:n,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){var s;return((s=C.current)==null?void 0:s.scrollTop)??0},set scrollTop(s){C.current&&(C.current.scrollTop=s,p.ignoreScrollToTop=C.current.scrollTop)},get targetScrollTop(){return!C.current||!o.current?0:C.current.scrollHeight-1-C.current.clientHeight},get calculatedTargetScrollTop(){if(!C.current||!o.current)return 0;const{targetScrollTop:s}=this;if(!e.targetScrollTop)return s;if((i==null?void 0:i.targetScrollTop)===s)return i.calculatedScrollTop;const f=Math.max(Math.min(e.targetScrollTop(s,{scrollElement:C.current,contentElement:o.current}),s),0);return i={targetScrollTop:s,calculatedScrollTop:f},requestAnimationFrame(()=>{i=void 0}),f},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Os}}},[]),v=k.useCallback((i={})=>{var M;typeof i=="string"&&(i={animation:i}),i.preserveScrollPosition||g(!0);const s=Date.now()+(Number(i.wait)||0),f=jt(d.current,i.animation),{ignoreEscapes:m=!1}=i;let y,x=p.calculatedTargetScrollTop;i.duration instanceof Promise?i.duration.finally(()=>{y=Date.now()}):y=s+(i.duration??0);const E=async()=>{const j=new Promise(requestAnimationFrame).then(()=>{var A;if(!p.isAtBottom)return p.animation=void 0,!1;const{scrollTop:R}=p,K=performance.now(),L=(K-(p.lastTick??K))/zs;if(p.animation||(p.animation={behavior:f,promise:j,ignoreEscapes:m}),p.animation.behavior===f&&(p.lastTick=K),h()||s>Date.now())return E();if(R<Math.min(x,p.calculatedTargetScrollTop)){if(((A=p.animation)==null?void 0:A.behavior)===f){if(f==="instant")return p.scrollTop=p.calculatedTargetScrollTop,E();p.velocity=(f.damping*p.velocity+f.stiffness*p.scrollDifference)/f.mass,p.accumulated+=p.velocity*L,p.scrollTop+=p.accumulated,p.scrollTop!==R&&(p.accumulated=0)}return E()}return y>Date.now()?(x=p.calculatedTargetScrollTop,E()):(p.animation=void 0,p.scrollTop<p.calculatedTargetScrollTop?v({animation:jt(d.current,d.current.resize),ignoreEscapes:m,duration:Math.max(0,y-Date.now())||void 0}):p.isAtBottom)});return j.then(R=>(requestAnimationFrame(()=>{p.animation||(p.lastTick=void 0,p.velocity=0)}),R))};return i.wait!==!0&&(p.animation=void 0),((M=p.animation)==null?void 0:M.behavior)===f?p.animation.promise:E()},[g,h,p]),w=k.useCallback(()=>{b(!0),g(!1)},[b,g]),S=k.useCallback(({target:i})=>{if(i!==C.current)return;const{scrollTop:s,ignoreScrollToTop:f}=p;let{lastScrollTop:m=s}=p;p.lastScrollTop=s,p.ignoreScrollToTop=void 0,f&&f>s&&(m=f),u(p.isNearBottom),setTimeout(()=>{var E;if(p.resizeDifference||s===f)return;if(h()){b(!0),g(!1);return}const y=s>m,x=s<m;if((E=p.animation)!=null&&E.ignoreEscapes){p.scrollTop=m;return}x&&(b(!0),g(!1)),y&&b(!1),!p.escapedFromLock&&p.isNearBottom&&g(!0)},1)},[b,g,h,p]),I=k.useCallback(({target:i,deltaY:s})=>{var m;let f=i;for(;!["scroll","auto"].includes(getComputedStyle(f).overflow);){if(!f.parentElement)return;f=f.parentElement}f===C.current&&s<0&&C.current.scrollHeight>C.current.clientHeight&&!((m=p.animation)!=null&&m.ignoreEscapes)&&(b(!0),g(!1))},[b,g,p]),C=Tr(i=>{var s,f;(s=C.current)==null||s.removeEventListener("scroll",S),(f=C.current)==null||f.removeEventListener("wheel",I),i==null||i.addEventListener("scroll",S,{passive:!0}),i==null||i.addEventListener("wheel",I,{passive:!0})},[]),o=Tr(i=>{var f,m;if((f=p.resizeObserver)==null||f.disconnect(),!i)return;let s;p.resizeObserver=new ResizeObserver(([y])=>{const{height:x}=y.contentRect,E=x-(s??x);if(p.resizeDifference=E,p.scrollTop>p.targetScrollTop&&(p.scrollTop=p.targetScrollTop),u(p.isNearBottom),E>=0){const M=jt(d.current,s?d.current.resize:d.current.initial);v({animation:M,wait:!0,preserveScrollPosition:!0,duration:M==="instant"?void 0:Ds})}else p.isNearBottom&&(b(!1),g(!0));s=x,requestAnimationFrame(()=>{setTimeout(()=>{p.resizeDifference===E&&(p.resizeDifference=0)},1)})}),(m=p.resizeObserver)==null||m.observe(i)},[]);return{contentRef:o,scrollRef:C,scrollToBottom:v,stopScroll:w,isAtBottom:n||c,isNearBottom:c,escapedFromLock:t,state:p}};function Tr(e,t){const r=k.useCallback(n=>(r.current=n,e(n)),t);return r}const Ct=new Map;function jt(...e){const t={..._s};let r=!1;for(const a of e){if(a==="instant"){r=!0;continue}typeof a=="object"&&(r=!1,t.damping=a.damping??t.damping,t.stiffness=a.stiffness??t.stiffness,t.mass=a.mass??t.mass)}const n=JSON.stringify(t);return Ct.has(n)||Ct.set(n,Object.freeze(t)),r?"instant":Ct.get(n)}const $n=k.createContext(null),Bs=typeof window<"u"?k.useLayoutEffect:k.useEffect;function Ze({instance:e,children:t,resize:r,initial:n,mass:a,damping:c,stiffness:u,targetScrollTop:d,contextRef:h,...g}){const b=k.useRef(null),p=zt.useCallback((m,y)=>{const x=(f==null?void 0:f.targetScrollTop)??d;return(x==null?void 0:x(m,y))??m},[d]),v=Ns({mass:a,damping:c,stiffness:u,resize:r,initial:n,targetScrollTop:p}),{scrollRef:w,contentRef:S,scrollToBottom:I,stopScroll:C,isAtBottom:o,escapedFromLock:i,state:s}=e??v,f=k.useMemo(()=>({scrollToBottom:I,stopScroll:C,scrollRef:w,isAtBottom:o,escapedFromLock:i,contentRef:S,state:s,get targetScrollTop(){return b.current},set targetScrollTop(m){b.current=m}}),[I,o,S,w,C,i,s]);return k.useImperativeHandle(h,()=>f,[f]),Bs(()=>{w.current&&getComputedStyle(w.current).overflow==="visible"&&(w.current.style.overflow="auto")},[]),l.jsx($n.Provider,{value:f,children:l.jsx("div",{...g,children:typeof t=="function"?t(f):t})})}(function(e){function t({children:r,...n}){const a=Ps();return l.jsx("div",{ref:a.scrollRef,style:{height:"100%",width:"100%"},children:l.jsx("div",{...n,ref:a.contentRef,children:typeof r=="function"?r(a):r})})}e.Content=t})(Ze||(Ze={}));function Ps(){const e=k.useContext($n);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}const Ls=T(Ze)`
|
|
1015
|
+
position: relative;
|
|
1016
|
+
flex: 1;
|
|
1017
|
+
overflow-y: auto;
|
|
1018
|
+
scroll-behavior: smooth;
|
|
1019
|
+
scrollbar-width: thin;
|
|
1020
|
+
scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
|
|
1021
|
+
|
|
1022
|
+
&::-webkit-scrollbar {
|
|
1023
|
+
width: 8px;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
&::-webkit-scrollbar-track {
|
|
1027
|
+
background: transparent;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
&::-webkit-scrollbar-thumb {
|
|
1031
|
+
background-color: rgba(148, 163, 184, 0.45);
|
|
1032
|
+
border-radius: 999px;
|
|
1033
|
+
border: 2px solid transparent;
|
|
1034
|
+
background-clip: padding-box;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
1038
|
+
background-color: rgba(100, 116, 139, 0.55);
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
@media (prefers-color-scheme: dark) {
|
|
1042
|
+
scrollbar-color: rgba(71, 85, 105, 0.75) transparent;
|
|
1043
|
+
|
|
1044
|
+
&::-webkit-scrollbar-thumb {
|
|
1045
|
+
background-color: rgba(71, 85, 105, 0.65);
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
1049
|
+
background-color: rgba(100, 116, 139, 0.75);
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
[data-theme='dark'] & {
|
|
1054
|
+
scrollbar-color: rgba(71, 85, 105, 0.75) transparent;
|
|
1055
|
+
|
|
1056
|
+
&::-webkit-scrollbar-thumb {
|
|
1057
|
+
background-color: rgba(71, 85, 105, 0.65);
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
1061
|
+
background-color: rgba(100, 116, 139, 0.75);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
`,Fs=T(Ze.Content)`
|
|
1065
|
+
padding: 16px;
|
|
1066
|
+
`;T.button`
|
|
1067
|
+
position: absolute;
|
|
1068
|
+
bottom: 16px;
|
|
1069
|
+
left: 50%;
|
|
1070
|
+
transform: translateX(-50%);
|
|
1071
|
+
width: 40px;
|
|
1072
|
+
height: 40px;
|
|
1073
|
+
border-radius: 50%;
|
|
1074
|
+
border: 1px solid #d1d5db;
|
|
1075
|
+
background: white;
|
|
1076
|
+
color: #6b7280;
|
|
1077
|
+
cursor: pointer;
|
|
1078
|
+
display: flex;
|
|
1079
|
+
align-items: center;
|
|
1080
|
+
justify-content: center;
|
|
1081
|
+
transition: all 0.2s ease;
|
|
1082
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
1083
|
+
|
|
1084
|
+
&:hover {
|
|
1085
|
+
background: #f9fafb;
|
|
1086
|
+
border-color: #9ca3af;
|
|
1087
|
+
color: #374151;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
svg {
|
|
1091
|
+
width: 16px;
|
|
1092
|
+
height: 16px;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
@media (prefers-color-scheme: dark) {
|
|
1096
|
+
background: #1f2937;
|
|
1097
|
+
border-color: #374151;
|
|
1098
|
+
color: #9ca3af;
|
|
1099
|
+
|
|
1100
|
+
&:hover {
|
|
1101
|
+
background: #374151;
|
|
1102
|
+
border-color: #4b5563;
|
|
1103
|
+
color: #d1d5db;
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
`;function Jt({className:e,children:t,style:r,onDragOver:n,onDragLeave:a,onDrop:c}){return l.jsx(Ls,{className:e,style:r,initial:"smooth",resize:"smooth",role:"log",onDragOver:n,onDragLeave:a,onDrop:c,children:t})}function Xt({className:e,children:t}){return l.jsx(Fs,{className:e,children:t})}function Sn({config:e,chat:t}){const{messages:r,sendMessage:n,uploadAttachment:a,isLoading:c,error:u,hasSessionStarted:d}=t,[h,g]=k.useState(""),[b,p]=k.useState(!1),v=k.useRef(null),{enabled:w,staged:S,attachmentError:I,setAttachmentError:C,addFiles:o,appendStaged:i,removeStaged:s,clearStaged:f,maxFiles:m,maxBytes:y,allowed:x}=ut(e,a),E=()=>e.theme==="dark"?"dark":e.theme==="light"?"light":b?"dark":"light";k.useEffect(()=>{if(e.theme==="auto"||!e.theme){const A=()=>{p(window.matchMedia("(prefers-color-scheme: dark)").matches)};A();const D=window.matchMedia("(prefers-color-scheme: dark)");return D.addEventListener("change",A),()=>D.removeEventListener("change",A)}else p(e.theme==="dark")},[e.theme]);const M=async()=>{const A=h.trim();!A&&S.length===0||c||(await n(A,void 0,S.length?S:void 0),g(""),f(),setTimeout(()=>{var D;(D=v.current)==null||D.focus()},100))},j=A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),M())},R=k.useMemo(()=>e.height==="100%"||e.height==="100vh"?{height:"100%",minHeight:0,display:"flex",flexDirection:"column",borderRadius:"8px"}:{height:e.height,display:"flex",flexDirection:"column",borderRadius:"8px"},[e.height]),K=A=>{w&&(A.preventDefault(),A.dataTransfer.dropEffect="copy")},L=async A=>{if(!w)return;A.preventDefault();const D=await Ft(A.dataTransfer);D.length&&await o(D)};return l.jsx(vn,{"data-theme":E(),style:R,children:e.quickQuestions&&e.quickQuestions.length>0&&!d?l.jsx(Zt,{config:e,onQuestionClick:async A=>{await n(A)},onSendMessage:n,isLoading:c}):l.jsxs(l.Fragment,{children:[l.jsx(Jt,{style:{flex:1},onDragOver:K,onDrop:L,children:l.jsxs(Xt,{children:[r.map(A=>l.jsxs("div",{style:{display:"flex",marginBottom:"16px",justifyContent:A.role==="user"?"flex-end":"flex-start",alignItems:"flex-start",gap:"8px"},children:[A.role==="assistant"&&e.agentImage&&l.jsx(me,{src:e.agentImage,alt:e.chatName||"Agent",$size:"28px"}),l.jsx(Ie,{$isUser:A.role==="user",children:A.role==="assistant"?l.jsx(ct,{content:A.content}):l.jsxs(l.Fragment,{children:[A.attachments&&A.attachments.length>0&&l.jsx(Ce,{attachments:A.attachments,readOnly:!0}),A.content?A.content:null]})})]},A.id)),c&&l.jsxs("div",{style:{display:"flex",justifyContent:"flex-start",alignItems:"flex-start",gap:"8px",marginBottom:"16px"},children:[e.agentImage&&l.jsx(me,{src:e.agentImage,alt:e.chatName||"Agent",$size:"28px"}),l.jsx(Ie,{$isUser:!1,children:l.jsxs(Qt,{children:[l.jsx("div",{className:"dot"}),l.jsx("div",{className:"dot"}),l.jsx("div",{className:"dot"})]})})]}),u&&l.jsx(Vt,{children:u})]})}),l.jsxs(Gt,{style:{flexDirection:"column",alignItems:"stretch",gap:0},children:[(I||w&&S.length>0)&&l.jsxs("div",{style:{paddingBottom:8},children:[I&&l.jsx("div",{style:{fontSize:12,color:"#dc2626",marginBottom:4},children:I}),w&&S.length>0&&l.jsx(Ce,{attachments:S,onRemove:s})]}),l.jsx("div",{style:{width:"100%"},children:l.jsxs(Ht,{children:[l.jsx(lt,{ref:v,variant:"composer",value:h,onChange:g,onKeyDown:j,placeholder:e.placeholder,disabled:c}),l.jsxs(qt,{children:[l.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1,minWidth:0},children:w&&l.jsx(Kt,{integrated:!0,disabled:c,maxFileBytes:y,maxFiles:m,allowedMime:x,currentCount:S.length,uploadAttachment:a,onUploaded:i,onError:C})}),l.jsx(Yt,{type:"button",onClick:M,disabled:c||!h.trim()&&S.length===0,"aria-label":"Send message",children:l.jsx(dt,{size:13})})]})]})})]})]})})}const Ks=T.div`
|
|
1107
|
+
display: flex;
|
|
1108
|
+
align-items: center;
|
|
1109
|
+
justify-content: space-between;
|
|
1110
|
+
padding: 12px 16px;
|
|
1111
|
+
border-radius: 8px 8px 0 0;
|
|
1112
|
+
background: ${e=>e.$showWelcomeScreen&&e.$primaryColor?e.$primaryColor:"#ffffff"};
|
|
1113
|
+
color: ${e=>e.$showWelcomeScreen&&e.$primaryColor?"white":"#111827"};
|
|
1114
|
+
border-bottom: none;
|
|
1115
|
+
transition: background-color 0.3s ease, color 0.3s ease;
|
|
1116
|
+
|
|
1117
|
+
@media (prefers-color-scheme: dark) {
|
|
1118
|
+
background: ${e=>e.$showWelcomeScreen&&e.$primaryColor?e.$primaryColor:"#1f2937"};
|
|
1119
|
+
color: ${e=>e.$showWelcomeScreen&&e.$primaryColor?"white":"#f9fafb"};
|
|
1120
|
+
border-bottom: none;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
[data-theme="dark"] & {
|
|
1124
|
+
background: ${e=>e.$showWelcomeScreen&&e.$primaryColor?e.$primaryColor:"#1f2937"};
|
|
1125
|
+
color: ${e=>e.$showWelcomeScreen&&e.$primaryColor?"white":"#f9fafb"};
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
[data-theme="light"] & {
|
|
1129
|
+
background: ${e=>e.$showWelcomeScreen&&e.$primaryColor?e.$primaryColor:"#ffffff"};
|
|
1130
|
+
color: ${e=>e.$showWelcomeScreen&&e.$primaryColor?"white":"#111827"};
|
|
1131
|
+
}
|
|
1132
|
+
`,Ws=T.div`
|
|
1133
|
+
display: flex;
|
|
1134
|
+
align-items: center;
|
|
1135
|
+
gap: 12px;
|
|
1136
|
+
`,Us=T.div`
|
|
1137
|
+
display: flex;
|
|
1138
|
+
align-items: center;
|
|
1139
|
+
gap: 8px;
|
|
1140
|
+
`,Hs=T.div`
|
|
1141
|
+
width: 8px;
|
|
1142
|
+
height: 8px;
|
|
1143
|
+
background: #10b981;
|
|
1144
|
+
border-radius: 50%;
|
|
1145
|
+
animation: pulse 2s infinite;
|
|
1146
|
+
|
|
1147
|
+
@keyframes pulse {
|
|
1148
|
+
0%, 100% {
|
|
1149
|
+
opacity: 1;
|
|
1150
|
+
}
|
|
1151
|
+
50% {
|
|
1152
|
+
opacity: 0.5;
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
`,qs=T.span`
|
|
1156
|
+
font-weight: 500;
|
|
1157
|
+
font-size: 14px;
|
|
1158
|
+
`,Gs=T.div`
|
|
1159
|
+
display: flex;
|
|
1160
|
+
align-items: center;
|
|
1161
|
+
gap: 4px;
|
|
1162
|
+
`,Ys=T.button`
|
|
1163
|
+
padding: 4px;
|
|
1164
|
+
background: transparent;
|
|
1165
|
+
border: none;
|
|
1166
|
+
color: inherit;
|
|
1167
|
+
cursor: pointer;
|
|
1168
|
+
border-radius: 4px;
|
|
1169
|
+
transition: background-color 0.2s ease;
|
|
1170
|
+
display: flex;
|
|
1171
|
+
align-items: center;
|
|
1172
|
+
justify-content: center;
|
|
1173
|
+
|
|
1174
|
+
&:hover {
|
|
1175
|
+
background: rgba(255, 255, 255, 0.1);
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
svg {
|
|
1179
|
+
width: 16px;
|
|
1180
|
+
height: 16px;
|
|
1181
|
+
}
|
|
1182
|
+
`;function Qs({chatName:e="Chat Assistant",showCloseButton:t=!0,onClose:r,agentImage:n,className:a,primaryColor:c,showWelcomeScreen:u=!1}){return l.jsxs(Ks,{className:a,$primaryColor:c,$showWelcomeScreen:u,children:[l.jsxs(Ws,{children:[n&&l.jsx(me,{src:n,alt:e||"Agent",$size:"32px"}),l.jsxs(Us,{children:[l.jsx(Hs,{}),l.jsx(qs,{children:e})]})]}),l.jsx(Gs,{children:t&&l.jsx(Ys,{onClick:r,"aria-label":"Close",children:l.jsx(Ms,{size:16})})})]})}function Ot({config:e,chat:t}){const{messages:r,sendMessage:n,uploadAttachment:a,isLoading:c,error:u,isOpen:d,setIsOpen:h,hasSessionStarted:g}=t,[b,p]=k.useState(""),[v,w]=k.useState(e.height||600),[S,I]=k.useState(!1),C=k.useRef(null),{enabled:o,staged:i,attachmentError:s,setAttachmentError:f,addFiles:m,appendStaged:y,removeStaged:x,clearStaged:E,maxFiles:M,maxBytes:j,allowed:R}=ut(e,a),K=()=>e.theme==="dark"?"dark":e.theme==="light"?"light":S?"dark":"light";k.useEffect(()=>{if(e.theme==="auto"||!e.theme){const $=()=>{I(window.matchMedia("(prefers-color-scheme: dark)").matches)};$();const N=window.matchMedia("(prefers-color-scheme: dark)");return N.addEventListener("change",$),()=>N.removeEventListener("change",$)}else I(e.theme==="dark")},[e.theme]);const L=async()=>{const $=b.trim();!$&&i.length===0||c||(await n($,void 0,i.length?i:void 0),p(""),E(),setTimeout(()=>{var N;(N=C.current)==null||N.focus()},100))},A=$=>{$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),L())},D=$=>{o&&($.preventDefault(),$.dataTransfer.dropEffect="copy")},H=async $=>{if(!o)return;$.preventDefault();const N=await Ft($.dataTransfer);N.length&&await m(N)};return d?l.jsxs($s,{$position:e.position||"bottom-right","data-theme":K(),style:{height:v,...e.chatWindowStyle},children:[e.resizable!==!1&&l.jsx(Ss,{$position:"top",onMouseDown:$=>{$.preventDefault();const N=$.clientY,O=typeof v=="number"?v:600,W=q=>{const z=q.clientY-N,U=O-z;w(Math.max(200,Math.min(600,U)))},B=()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",B)};document.addEventListener("mousemove",W),document.addEventListener("mouseup",B)}}),e.showHeader!==!1&&l.jsx(Qs,{agentImage:e.agentImage,chatName:e.chatName,onClose:()=>h(!1),primaryColor:e.primaryColor,showWelcomeScreen:e.quickQuestions&&e.quickQuestions.length>0&&!g}),e.quickQuestions&&e.quickQuestions.length>0&&!g?l.jsx(Zt,{config:e,onQuestionClick:async $=>{await n($)},onSendMessage:n,isLoading:c}):l.jsxs(l.Fragment,{children:[l.jsx(Jt,{onDragOver:D,onDrop:H,children:l.jsxs(Xt,{children:[r.map($=>l.jsxs("div",{style:{display:"flex",marginBottom:"16px",justifyContent:$.role==="user"?"flex-end":"flex-start",alignItems:"flex-start",gap:"8px"},children:[$.role==="assistant"&&e.agentImage&&l.jsx(me,{src:e.agentImage,alt:e.chatName||"Agent",$size:"28px"}),l.jsx(Ie,{$isUser:$.role==="user",children:$.role==="assistant"?l.jsx(ct,{content:$.content}):l.jsxs(l.Fragment,{children:[$.attachments&&$.attachments.length>0&&l.jsx(Ce,{attachments:$.attachments,readOnly:!0}),$.content?$.content:null]})})]},$.id)),c&&l.jsxs("div",{style:{display:"flex",justifyContent:"flex-start",alignItems:"flex-start",gap:"8px",marginBottom:"16px"},children:[e.agentImage&&l.jsx(me,{src:e.agentImage,alt:e.chatName||"Agent",$size:"28px"}),l.jsx(Ie,{$isUser:!1,children:l.jsxs(Qt,{children:[l.jsx("div",{className:"dot"}),l.jsx("div",{className:"dot"}),l.jsx("div",{className:"dot"})]})})]}),u&&l.jsx(Vt,{children:u})]})}),l.jsxs(Gt,{style:{flexDirection:"column",alignItems:"stretch",gap:0},children:[(s||o&&i.length>0)&&l.jsxs("div",{style:{paddingBottom:8},children:[s&&l.jsx("div",{style:{fontSize:12,color:"#dc2626",marginBottom:4},children:s}),o&&i.length>0&&l.jsx(Ce,{attachments:i,onRemove:x})]}),l.jsx("div",{style:{width:"100%"},children:l.jsxs(Ht,{children:[l.jsx(lt,{ref:C,variant:"composer",value:b,onChange:p,onKeyDown:A,placeholder:e.placeholder,disabled:c}),l.jsxs(qt,{children:[l.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1,minWidth:0},children:o&&l.jsx(Kt,{integrated:!0,disabled:c,maxFileBytes:j,maxFiles:M,allowedMime:R,currentCount:i.length,uploadAttachment:a,onUploaded:y,onError:f})}),l.jsx(Yt,{type:"button",onClick:L,disabled:c||!b.trim()&&i.length===0,"aria-label":"Send message",children:l.jsx(dt,{size:13})})]})]})})]})]})]}):l.jsxs(vs,{onClick:()=>h(!0),style:e.buttonStyle,$position:e.position||"bottom-right",$primaryColor:e.primaryColor,"aria-label":"Open chat",children:[l.jsx("div",{className:"icon-container",children:l.jsx(Rs,{size:16})}),l.jsx("span",{children:e.buttonText||e.chatName||"AI Chat"})]})}function Vs(e){const t=Pr(e),r=Br(t);switch(t.mode){case"floating":return l.jsx(Ot,{config:t,chat:r});case"embedded":return l.jsx(Sn,{config:t,chat:r});default:return l.jsx(Ot,{config:t,chat:r})}}function Zs({config:e,chat:t}){const{messages:r,sendMessage:n,uploadAttachment:a,isLoading:c,error:u,hasSessionStarted:d}=t,[h,g]=k.useState(""),b=k.useRef(null),{enabled:p,staged:v,attachmentError:w,setAttachmentError:S,addFiles:I,appendStaged:C,removeStaged:o,clearStaged:i,maxFiles:s,maxBytes:f,allowed:m}=ut(e,a),y=async()=>{const j=h.trim();!j&&v.length===0||c||(await n(j,void 0,v.length?v:void 0),g(""),i(),setTimeout(()=>{var R;(R=b.current)==null||R.focus()},100))},x=j=>{j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),y())},E=j=>{p&&(j.preventDefault(),j.dataTransfer.dropEffect="copy")},M=async j=>{if(!p)return;j.preventDefault();const R=await Ft(j.dataTransfer);R.length&&await I(R)};return l.jsx(vn,{style:{height:e.height,display:"flex",flexDirection:"column",backgroundColor:"white",border:"1px solid #e5e7eb",borderRadius:"8px"},children:e.quickQuestions&&e.quickQuestions.length>0&&!d?l.jsx(Zt,{config:e,onQuestionClick:async j=>{await n(j)},onSendMessage:n,isLoading:c}):l.jsxs(l.Fragment,{children:[l.jsx(Jt,{style:{flex:1},onDragOver:E,onDrop:M,children:l.jsxs(Xt,{children:[r.map(j=>l.jsxs("div",{style:{display:"flex",marginBottom:"12px",justifyContent:j.role==="user"?"flex-end":"flex-start",alignItems:"flex-start",gap:"8px"},children:[j.role==="assistant"&&e.agentImage&&l.jsx(me,{src:e.agentImage,alt:e.chatName||"Agent",$size:"28px"}),l.jsx(Ie,{$isUser:j.role==="user",children:j.role==="assistant"?l.jsx(ct,{content:j.content}):l.jsxs(l.Fragment,{children:[j.attachments&&j.attachments.length>0&&l.jsx(Ce,{attachments:j.attachments,readOnly:!0}),j.content?j.content:null]})})]},j.id)),c&&l.jsxs("div",{style:{display:"flex",justifyContent:"flex-start",alignItems:"flex-start",gap:"8px",marginBottom:"12px"},children:[e.agentImage&&l.jsx(me,{src:e.agentImage,alt:e.chatName||"Agent",$size:"28px"}),l.jsx(Ie,{$isUser:!1,children:l.jsxs(Qt,{children:[l.jsx("div",{className:"dot"}),l.jsx("div",{className:"dot"}),l.jsx("div",{className:"dot"})]})})]}),u&&l.jsx(Vt,{children:u})]})}),l.jsxs(Gt,{style:{flexDirection:"column",alignItems:"stretch",gap:0},children:[(w||p&&v.length>0)&&l.jsxs("div",{style:{paddingBottom:8},children:[w&&l.jsx("div",{style:{fontSize:12,color:"#dc2626",marginBottom:4},children:w}),p&&v.length>0&&l.jsx(Ce,{attachments:v,onRemove:o})]}),l.jsx("div",{style:{width:"100%"},children:l.jsxs(Ht,{children:[l.jsx(lt,{ref:b,variant:"composer",value:h,onChange:g,onKeyDown:x,placeholder:e.placeholder,disabled:c}),l.jsxs(qt,{children:[l.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1,minWidth:0},children:p&&l.jsx(Kt,{integrated:!0,disabled:c,maxFileBytes:f,maxFiles:s,allowedMime:m,currentCount:v.length,uploadAttachment:a,onUploaded:C,onError:S})}),l.jsx(Yt,{type:"button",onClick:y,disabled:c||!h.trim()&&v.length===0,"aria-label":"Send message",children:l.jsx(dt,{size:13})})]})]})})]})]})})}exports.EmbeddedChat=Sn;exports.FloatingChat=Ot;exports.InlineChat=Zs;exports.MarkdownRenderer=ct;exports.OrdifyApiClient=Dr;exports.OrdifyChat=Vs;exports.debounce=zn;exports.formatTime=On;exports.generateId=Me;exports.parseStreamingResponse=Nr;exports.throttle=Dn;exports.useOrdifyChat=Br;exports.useOrdifyConfig=Pr;exports.useWidgetAttachmentStaging=ut;
|