@xcelsior/ui-chat 2.0.4 → 2.0.6

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.
Files changed (46) hide show
  1. package/dist/index.d.mts +58 -5
  2. package/dist/index.d.ts +58 -5
  3. package/dist/index.js +1043 -427
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +1010 -397
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +2 -1
  8. package/src/components/BookingCancelledCard.tsx +103 -0
  9. package/src/components/BookingCards.stories.tsx +102 -0
  10. package/src/components/BookingConfirmationCard.tsx +170 -0
  11. package/src/components/BookingSlotPicker.stories.tsx +87 -0
  12. package/src/components/BookingSlotPicker.tsx +256 -0
  13. package/src/components/BrandIcons.stories.tsx +32 -1
  14. package/src/components/BrandIcons.tsx +21 -17
  15. package/src/components/Chat.tsx +43 -9
  16. package/src/components/ChatWidget.tsx +30 -2
  17. package/src/components/MessageItem.tsx +83 -72
  18. package/src/components/MessageList.tsx +4 -0
  19. package/src/hooks/useDraggablePosition.ts +147 -42
  20. package/src/hooks/useMessages.ts +106 -53
  21. package/src/hooks/useWebSocket.ts +17 -4
  22. package/src/index.tsx +11 -0
  23. package/src/types.ts +39 -2
  24. package/src/utils/api.ts +1 -0
  25. package/storybook-static/assets/BookingCancelledCard-XHuB-Ebp.js +31 -0
  26. package/storybook-static/assets/BookingCards.stories-DfJ482RS.js +66 -0
  27. package/storybook-static/assets/BookingSlotPicker-BkfssueW.js +1 -0
  28. package/storybook-static/assets/BookingSlotPicker.stories-fYlg1zLg.js +50 -0
  29. package/storybook-static/assets/BrandIcons-BsRAdWzL.js +4 -0
  30. package/storybook-static/assets/BrandIcons.stories-C6gBovfU.js +106 -0
  31. package/storybook-static/assets/Chat.stories-BrR7LHsz.js +830 -0
  32. package/storybook-static/assets/{Color-YHDXOIA2-CSuNIR0a.js → Color-YHDXOIA2-azE51u2m.js} +1 -1
  33. package/storybook-static/assets/{DocsRenderer-CFRXHY34-dpuOKTQp.js → DocsRenderer-CFRXHY34-jTmzKIDk.js} +3 -3
  34. package/storybook-static/assets/MessageItem-pEOwuLyh.js +34 -0
  35. package/storybook-static/assets/{MessageItem.stories-CsxqSqu-.js → MessageItem.stories-Cs5Vtkle.js} +2 -2
  36. package/storybook-static/assets/{entry-preview-C_-WO6GJ.js → entry-preview-vcpiajAT.js} +1 -1
  37. package/storybook-static/assets/globe-BtMvkLMD.js +31 -0
  38. package/storybook-static/assets/{iframe-BXTccXxS.js → iframe-Cx1n-SeE.js} +2 -2
  39. package/storybook-static/assets/{preview-Cyx3pE7Q.js → preview-Do3b3dZv.js} +2 -2
  40. package/storybook-static/iframe.html +1 -1
  41. package/storybook-static/index.json +1 -1
  42. package/storybook-static/project.json +1 -1
  43. package/storybook-static/assets/BrandIcons-Cjy5INAp.js +0 -4
  44. package/storybook-static/assets/BrandIcons.stories-BeVC6svr.js +0 -64
  45. package/storybook-static/assets/Chat.stories-BkbpOOSG.js +0 -830
  46. package/storybook-static/assets/MessageItem-Dlb6dSKL.js +0 -14
@@ -0,0 +1,830 @@
1
+ import{j as h}from"./jsx-runtime-Cf8x2fCZ.js";import{r as v,R as Os}from"./index--qcDGAq6.js";import{X as Ds,a as Br,C as Us}from"./BrandIcons-BsRAdWzL.js";import{M as Bs}from"./MessageItem-pEOwuLyh.js";import{r as Fs}from"./index-B_4m48Mv.js";import"./index-yBjzXJbu.js";import"./BookingSlotPicker-BkfssueW.js";import"./globe-BtMvkLMD.js";import"./BookingCancelledCard-XHuB-Ebp.js";import"./en-US-BukEqXxE.js";import"./index-BLHw34Di.js";function Hs(e,t){const[n,r]=v.useState(!1),[s,o]=v.useState(null),[i,a]=v.useState(null),l=v.useRef(null),u=v.useRef(null),c=v.useRef(0),p=v.useRef(null),f=v.useRef(!1),b=v.useRef(0),d=5,y=3e3,g=!!t,_=v.useCallback(P=>{p.current&&P.removeEventListener("message",p.current);const M=I=>{var A,$;try{const N=JSON.parse(I.data);if(o(N),N.type==="error"){const F=new Error(((A=N.data)==null?void 0:A.message)||"WebSocket error");a(F),($=e.onError)==null||$.call(e,F)}}catch(N){console.error("Failed to parse WebSocket message:",N)}};return P.addEventListener("message",M),p.current=M,()=>{P.removeEventListener("message",M),p.current===M&&(p.current=null)}},[]),C=v.useCallback(()=>{var M;if(f.current)return;const P=++b.current;console.log("connecting to WebSocket...",e.currentUser,e.conversationId);try{l.current&&(p.current&&(l.current.removeEventListener("message",p.current),p.current=null),l.current.close());const I=new URL(e.websocketUrl);I.searchParams.set("user",JSON.stringify(e.currentUser)),e.conversationId&&I.searchParams.set("conversationId",e.conversationId),e.apiKey&&I.searchParams.set("apiKey",e.apiKey);const A=new WebSocket(I.toString());A.onopen=()=>{var $;if(P===b.current){if(f.current){A.close(1e3,"Effect cleaned up");return}console.log("WebSocket connected"),r(!0),a(null),c.current=0,($=e.onConnectionChange)==null||$.call(e,!0)}},A.onerror=$=>{var F;if(P!==b.current||f.current)return;console.error("WebSocket error:",$);const N=new Error("WebSocket connection error");a(N),(F=e.onError)==null||F.call(e,N)},A.onclose=$=>{var N;P===b.current&&(f.current||(console.log("WebSocket closed:",$.code,$.reason),r(!1),(N=e.onConnectionChange)==null||N.call(e,!1),l.current=null,$.code!==1e3&&c.current<d&&(c.current+=1,console.log(`Reconnecting... (${c.current}/${d})`),u.current=setTimeout(()=>{C()},y))))},_(A),l.current=A??null}catch(I){console.error("Failed to create WebSocket connection:",I);const A=I instanceof Error?I:new Error("Failed to connect");a(A),(M=e.onError)==null||M.call(e,A)}},[JSON.stringify([e.currentUser,e.conversationId])]),w=v.useCallback((P,M)=>{var I,A;if(!l.current||l.current.readyState!==WebSocket.OPEN){console.error("WebSocket is not connected"),(I=e.toast)==null||I.error("Not connected to chat server");return}try{l.current.send(JSON.stringify({action:P,data:M}))}catch($){console.error("Failed to send message:",$);const N=$ instanceof Error?$:new Error("Failed to send message");a(N),(A=e.onError)==null||A.call(e,N)}},[e]),k=v.useCallback(()=>{c.current=0,f.current=!1,C()},[C]);return v.useEffect(()=>g?(r((t==null?void 0:t.readyState)===WebSocket.OPEN||!1),l.current=t,_(t)):(f.current=!1,C(),()=>{f.current=!0,u.current&&clearTimeout(u.current),l.current&&(p.current&&(l.current.removeEventListener("message",p.current),p.current=null),l.current.close(1e3,"Component unmounted"))}),[C,g,t,_]),{isConnected:g?(t==null?void 0:t.readyState)===WebSocket.OPEN||!1:n,sendMessage:w,lastMessage:s,error:i,reconnect:k}}function Fr(e,t){return function(){return e.apply(t,arguments)}}const{toString:qs}=Object.prototype,{getPrototypeOf:Ut}=Object,{iterator:at,toStringTag:Hr}=Symbol,ct=(e=>t=>{const n=qs.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),le=e=>(e=e.toLowerCase(),t=>ct(t)===e),lt=e=>t=>typeof t===e,{isArray:Ce}=Array,_e=lt("undefined");function Oe(e){return e!==null&&!_e(e)&&e.constructor!==null&&!_e(e.constructor)&&re(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const qr=le("ArrayBuffer");function Vs(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&qr(e.buffer),t}const Ws=lt("string"),re=lt("function"),Vr=lt("number"),De=e=>e!==null&&typeof e=="object",Xs=e=>e===!0||e===!1,Je=e=>{if(ct(e)!=="object")return!1;const t=Ut(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Hr in e)&&!(at in e)},Js=e=>{if(!De(e)||Oe(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ks=le("Date"),Gs=le("File"),Ys=le("Blob"),Zs=le("FileList"),Qs=e=>De(e)&&re(e.pipe),eo=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||re(e.append)&&((t=ct(e))==="formdata"||t==="object"&&re(e.toString)&&e.toString()==="[object FormData]"))},to=le("URLSearchParams"),[no,ro,so,oo]=["ReadableStream","Request","Response","Headers"].map(le),io=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ue(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Ce(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Oe(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function Wr(e,t){if(Oe(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const be=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Xr=e=>!_e(e)&&e!==be;function kt(){const{caseless:e,skipUndefined:t}=Xr(this)&&this||{},n={},r=(s,o)=>{const i=e&&Wr(n,o)||o;Je(n[i])&&Je(s)?n[i]=kt(n[i],s):Je(s)?n[i]=kt({},s):Ce(s)?n[i]=s.slice():(!t||!_e(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&Ue(arguments[s],r);return n}const ao=(e,t,n,{allOwnKeys:r}={})=>(Ue(t,(s,o)=>{n&&re(s)?e[o]=Fr(s,n):e[o]=s},{allOwnKeys:r}),e),co=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),lo=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},uo=(e,t,n,r)=>{let s,o,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&Ut(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},fo=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},po=e=>{if(!e)return null;if(Ce(e))return e;let t=e.length;if(!Vr(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ho=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ut(Uint8Array)),mo=(e,t)=>{const r=(e&&e[at]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},go=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},bo=le("HTMLFormElement"),vo=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Jt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),yo=le("RegExp"),Jr=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ue(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},xo=e=>{Jr(e,(t,n)=>{if(re(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(re(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},_o=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return Ce(e)?r(e):r(String(e).split(t)),n},wo=()=>{},ko=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Co(e){return!!(e&&re(e.append)&&e[Hr]==="FormData"&&e[at])}const So=e=>{const t=new Array(10),n=(r,s)=>{if(De(r)){if(t.indexOf(r)>=0)return;if(Oe(r))return r;if(!("toJSON"in r)){t[s]=r;const o=Ce(r)?[]:{};return Ue(r,(i,a)=>{const l=n(i,s+1);!_e(l)&&(o[a]=l)}),t[s]=void 0,o}}return r};return n(e,0)},$o=le("AsyncFunction"),Eo=e=>e&&(De(e)||re(e))&&re(e.then)&&re(e.catch),Kr=((e,t)=>e?setImmediate:t?((n,r)=>(be.addEventListener("message",({source:s,data:o})=>{s===be&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),be.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",re(be.postMessage)),jo=typeof queueMicrotask<"u"?queueMicrotask.bind(be):typeof process<"u"&&process.nextTick||Kr,Ro=e=>e!=null&&re(e[at]),m={isArray:Ce,isArrayBuffer:qr,isBuffer:Oe,isFormData:eo,isArrayBufferView:Vs,isString:Ws,isNumber:Vr,isBoolean:Xs,isObject:De,isPlainObject:Je,isEmptyObject:Js,isReadableStream:no,isRequest:ro,isResponse:so,isHeaders:oo,isUndefined:_e,isDate:Ks,isFile:Gs,isBlob:Ys,isRegExp:yo,isFunction:re,isStream:Qs,isURLSearchParams:to,isTypedArray:ho,isFileList:Zs,forEach:Ue,merge:kt,extend:ao,trim:io,stripBOM:co,inherits:lo,toFlatObject:uo,kindOf:ct,kindOfTest:le,endsWith:fo,toArray:po,forEachEntry:mo,matchAll:go,isHTMLForm:bo,hasOwnProperty:Jt,hasOwnProp:Jt,reduceDescriptors:Jr,freezeMethods:xo,toObjectSet:_o,toCamelCase:vo,noop:wo,toFiniteNumber:ko,findKey:Wr,global:be,isContextDefined:Xr,isSpecCompliantForm:Co,toJSONObject:So,isAsyncFn:$o,isThenable:Eo,setImmediate:Kr,asap:jo,isIterable:Ro};function O(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}m.inherits(O,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:m.toJSONObject(this.config),code:this.code,status:this.status}}});const Gr=O.prototype,Yr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Yr[e]={value:e}});Object.defineProperties(O,Yr);Object.defineProperty(Gr,"isAxiosError",{value:!0});O.from=(e,t,n,r,s,o)=>{const i=Object.create(Gr);m.toFlatObject(e,i,function(c){return c!==Error.prototype},u=>u!=="isAxiosError");const a=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return O.call(i,a,l,n,r,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const To=null;function Ct(e){return m.isPlainObject(e)||m.isArray(e)}function Zr(e){return m.endsWith(e,"[]")?e.slice(0,-2):e}function Kt(e,t,n){return e?e.concat(t).map(function(s,o){return s=Zr(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function Mo(e){return m.isArray(e)&&!e.some(Ct)}const Lo=m.toFlatObject(m,{},null,function(t){return/^is[A-Z]/.test(t)});function ut(e,t,n){if(!m.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=m.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,g){return!m.isUndefined(g[y])});const r=n.metaTokens,s=n.visitor||c,o=n.dots,i=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&m.isSpecCompliantForm(t);if(!m.isFunction(s))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(m.isDate(d))return d.toISOString();if(m.isBoolean(d))return d.toString();if(!l&&m.isBlob(d))throw new O("Blob is not supported. Use a Buffer instead.");return m.isArrayBuffer(d)||m.isTypedArray(d)?l&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function c(d,y,g){let _=d;if(d&&!g&&typeof d=="object"){if(m.endsWith(y,"{}"))y=r?y:y.slice(0,-2),d=JSON.stringify(d);else if(m.isArray(d)&&Mo(d)||(m.isFileList(d)||m.endsWith(y,"[]"))&&(_=m.toArray(d)))return y=Zr(y),_.forEach(function(w,k){!(m.isUndefined(w)||w===null)&&t.append(i===!0?Kt([y],k,o):i===null?y:y+"[]",u(w))}),!1}return Ct(d)?!0:(t.append(Kt(g,y,o),u(d)),!1)}const p=[],f=Object.assign(Lo,{defaultVisitor:c,convertValue:u,isVisitable:Ct});function b(d,y){if(!m.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+y.join("."));p.push(d),m.forEach(d,function(_,C){(!(m.isUndefined(_)||_===null)&&s.call(t,_,m.isString(C)?C.trim():C,y,f))===!0&&b(_,y?y.concat(C):[C])}),p.pop()}}if(!m.isObject(e))throw new TypeError("data must be an object");return b(e),t}function Gt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Bt(e,t){this._pairs=[],e&&ut(e,this,t)}const Qr=Bt.prototype;Qr.append=function(t,n){this._pairs.push([t,n])};Qr.toString=function(t){const n=t?function(r){return t.call(this,r,Gt)}:Gt;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Po(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function es(e,t,n){if(!t)return e;const r=n&&n.encode||Po;m.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=m.isURLSearchParams(t)?t.toString():new Bt(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Yt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){m.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ts={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zo=typeof URLSearchParams<"u"?URLSearchParams:Bt,No=typeof FormData<"u"?FormData:null,Ao=typeof Blob<"u"?Blob:null,Io={isBrowser:!0,classes:{URLSearchParams:zo,FormData:No,Blob:Ao},protocols:["http","https","file","blob","url","data"]},Ft=typeof window<"u"&&typeof document<"u",St=typeof navigator=="object"&&navigator||void 0,Oo=Ft&&(!St||["ReactNative","NativeScript","NS"].indexOf(St.product)<0),Do=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Uo=Ft&&window.location.href||"http://localhost",Bo=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ft,hasStandardBrowserEnv:Oo,hasStandardBrowserWebWorkerEnv:Do,navigator:St,origin:Uo},Symbol.toStringTag,{value:"Module"})),ee={...Bo,...Io};function Fo(e,t){return ut(e,new ee.classes.URLSearchParams,{visitor:function(n,r,s,o){return ee.isNode&&m.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Ho(e){return m.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function qo(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function ns(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),l=o>=n.length;return i=!i&&m.isArray(s)?s.length:i,l?(m.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!a):((!s[i]||!m.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&m.isArray(s[i])&&(s[i]=qo(s[i])),!a)}if(m.isFormData(e)&&m.isFunction(e.entries)){const n={};return m.forEachEntry(e,(r,s)=>{t(Ho(r),s,n,0)}),n}return null}function Vo(e,t,n){if(m.isString(e))try{return(t||JSON.parse)(e),m.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Be={transitional:ts,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=m.isObject(t);if(o&&m.isHTMLForm(t)&&(t=new FormData(t)),m.isFormData(t))return s?JSON.stringify(ns(t)):t;if(m.isArrayBuffer(t)||m.isBuffer(t)||m.isStream(t)||m.isFile(t)||m.isBlob(t)||m.isReadableStream(t))return t;if(m.isArrayBufferView(t))return t.buffer;if(m.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Fo(t,this.formSerializer).toString();if((a=m.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ut(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Vo(t)):t}],transformResponse:[function(t){const n=this.transitional||Be.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(m.isResponse(t)||m.isReadableStream(t))return t;if(t&&m.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?O.from(a,O.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ee.classes.FormData,Blob:ee.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};m.forEach(["delete","get","head","post","put","patch"],e=>{Be.headers[e]={}});const Wo=m.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Xo=e=>{const t={};let n,r,s;return e&&e.split(`
2
+ `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Wo[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Zt=Symbol("internals");function $e(e){return e&&String(e).trim().toLowerCase()}function Ke(e){return e===!1||e==null?e:m.isArray(e)?e.map(Ke):String(e)}function Jo(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Ko=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ht(e,t,n,r,s){if(m.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!m.isString(t)){if(m.isString(r))return t.indexOf(r)!==-1;if(m.isRegExp(r))return r.test(t)}}function Go(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Yo(e,t){const n=m.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let se=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(a,l,u){const c=$e(l);if(!c)throw new Error("header name must be a non-empty string");const p=m.findKey(s,c);(!p||s[p]===void 0||u===!0||u===void 0&&s[p]!==!1)&&(s[p||l]=Ke(a))}const i=(a,l)=>m.forEach(a,(u,c)=>o(u,c,l));if(m.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(m.isString(t)&&(t=t.trim())&&!Ko(t))i(Xo(t),n);else if(m.isObject(t)&&m.isIterable(t)){let a={},l,u;for(const c of t){if(!m.isArray(c))throw TypeError("Object iterator must return a key-value pair");a[u=c[0]]=(l=a[u])?m.isArray(l)?[...l,c[1]]:[l,c[1]]:c[1]}i(a,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=$e(t),t){const r=m.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Jo(s);if(m.isFunction(n))return n.call(this,s,r);if(m.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=$e(t),t){const r=m.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ht(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=$e(i),i){const a=m.findKey(r,i);a&&(!n||ht(r,r[a],a,n))&&(delete r[a],s=!0)}}return m.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||ht(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return m.forEach(this,(s,o)=>{const i=m.findKey(r,o);if(i){n[i]=Ke(s),delete n[o];return}const a=t?Go(o):String(o).trim();a!==o&&delete n[o],n[a]=Ke(s),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return m.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&m.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Zt]=this[Zt]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=$e(i);r[a]||(Yo(s,i),r[a]=!0)}return m.isArray(t)?t.forEach(o):o(t),this}};se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);m.reduceDescriptors(se.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});m.freezeMethods(se);function mt(e,t){const n=this||Be,r=t||n,s=se.from(r.headers);let o=r.data;return m.forEach(e,function(a){o=a.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function rs(e){return!!(e&&e.__CANCEL__)}function Se(e,t,n){O.call(this,e??"canceled",O.ERR_CANCELED,t,n),this.name="CanceledError"}m.inherits(Se,O,{__CANCEL__:!0});function ss(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new O("Request failed with status code "+n.status,[O.ERR_BAD_REQUEST,O.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Zo(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Qo(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),c=r[o];i||(i=u),n[s]=l,r[s]=u;let p=o,f=0;for(;p!==s;)f+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const b=c&&u-c;return b?Math.round(f*1e3/b):void 0}}function ei(e,t){let n=0,r=1e3/t,s,o;const i=(u,c=Date.now())=>{n=c,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const c=Date.now(),p=c-n;p>=r?i(u,c):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-p)))},()=>s&&i(s)]}const Qe=(e,t,n=3)=>{let r=0;const s=Qo(50,250);return ei(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,l=i-r,u=s(l),c=i<=a;r=i;const p={loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&c?(a-i)/u:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(p)},n)},Qt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},en=e=>(...t)=>m.asap(()=>e(...t)),ti=ee.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ee.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ee.origin),ee.navigator&&/(msie|trident)/i.test(ee.navigator.userAgent)):()=>!0,ni=ee.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];m.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),m.isString(r)&&a.push(`path=${r}`),m.isString(s)&&a.push(`domain=${s}`),o===!0&&a.push("secure"),m.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ri(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function si(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function os(e,t,n){let r=!ri(t);return e&&(r||n==!1)?si(e,t):t}const tn=e=>e instanceof se?{...e}:e;function ye(e,t){t=t||{};const n={};function r(u,c,p,f){return m.isPlainObject(u)&&m.isPlainObject(c)?m.merge.call({caseless:f},u,c):m.isPlainObject(c)?m.merge({},c):m.isArray(c)?c.slice():c}function s(u,c,p,f){if(m.isUndefined(c)){if(!m.isUndefined(u))return r(void 0,u,p,f)}else return r(u,c,p,f)}function o(u,c){if(!m.isUndefined(c))return r(void 0,c)}function i(u,c){if(m.isUndefined(c)){if(!m.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function a(u,c,p){if(p in t)return r(u,c);if(p in e)return r(void 0,u)}const l={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(u,c,p)=>s(tn(u),tn(c),p,!0)};return m.forEach(Object.keys({...e,...t}),function(c){const p=l[c]||s,f=p(e[c],t[c],c);m.isUndefined(f)&&p!==a||(n[c]=f)}),n}const is=e=>{const t=ye({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=se.from(i),t.url=es(os(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),m.isFormData(n)){if(ee.hasStandardBrowserEnv||ee.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(m.isFunction(n.getHeaders)){const l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([c,p])=>{u.includes(c.toLowerCase())&&i.set(c,p)})}}if(ee.hasStandardBrowserEnv&&(r&&m.isFunction(r)&&(r=r(t)),r||r!==!1&&ti(t.url))){const l=s&&o&&ni.read(o);l&&i.set(s,l)}return t},oi=typeof XMLHttpRequest<"u",ii=oi&&function(e){return new Promise(function(n,r){const s=is(e);let o=s.data;const i=se.from(s.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:u}=s,c,p,f,b,d;function y(){b&&b(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(c),s.signal&&s.signal.removeEventListener("abort",c)}let g=new XMLHttpRequest;g.open(s.method.toUpperCase(),s.url,!0),g.timeout=s.timeout;function _(){if(!g)return;const w=se.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:w,config:e,request:g};ss(function(M){n(M),y()},function(M){r(M),y()},E),g=null}"onloadend"in g?g.onloadend=_:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(_)},g.onabort=function(){g&&(r(new O("Request aborted",O.ECONNABORTED,e,g)),g=null)},g.onerror=function(k){const E=k&&k.message?k.message:"Network Error",P=new O(E,O.ERR_NETWORK,e,g);P.event=k||null,r(P),g=null},g.ontimeout=function(){let k=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const E=s.transitional||ts;s.timeoutErrorMessage&&(k=s.timeoutErrorMessage),r(new O(k,E.clarifyTimeoutError?O.ETIMEDOUT:O.ECONNABORTED,e,g)),g=null},o===void 0&&i.setContentType(null),"setRequestHeader"in g&&m.forEach(i.toJSON(),function(k,E){g.setRequestHeader(E,k)}),m.isUndefined(s.withCredentials)||(g.withCredentials=!!s.withCredentials),a&&a!=="json"&&(g.responseType=s.responseType),u&&([f,d]=Qe(u,!0),g.addEventListener("progress",f)),l&&g.upload&&([p,b]=Qe(l),g.upload.addEventListener("progress",p),g.upload.addEventListener("loadend",b)),(s.cancelToken||s.signal)&&(c=w=>{g&&(r(!w||w.type?new Se(null,e,g):w),g.abort(),g=null)},s.cancelToken&&s.cancelToken.subscribe(c),s.signal&&(s.signal.aborted?c():s.signal.addEventListener("abort",c)));const C=Zo(s.url);if(C&&ee.protocols.indexOf(C)===-1){r(new O("Unsupported protocol "+C+":",O.ERR_BAD_REQUEST,e));return}g.send(o||null)})},ai=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,a();const c=u instanceof Error?u:this.reason;r.abort(c instanceof O?c:new Se(c instanceof Error?c.message:c))}};let i=t&&setTimeout(()=>{i=null,o(new O(`timeout ${t} of ms exceeded`,O.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:l}=r;return l.unsubscribe=()=>m.asap(a),l}},ci=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},li=async function*(e,t){for await(const n of ui(e))yield*ci(n,t)},ui=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},nn=(e,t,n,r)=>{const s=li(e,t);let o=0,i,a=l=>{i||(i=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await s.next();if(u){a(),l.close();return}let p=c.byteLength;if(n){let f=o+=p;n(f)}l.enqueue(new Uint8Array(c))}catch(u){throw a(u),u}},cancel(l){return a(l),s.return()}},{highWaterMark:2})},rn=64*1024,{isFunction:He}=m,di=(({Request:e,Response:t})=>({Request:e,Response:t}))(m.global),{ReadableStream:sn,TextEncoder:on}=m.global,an=(e,...t)=>{try{return!!e(...t)}catch{return!1}},fi=e=>{e=m.merge.call({skipUndefined:!0},di,e);const{fetch:t,Request:n,Response:r}=e,s=t?He(t):typeof fetch=="function",o=He(n),i=He(r);if(!s)return!1;const a=s&&He(sn),l=s&&(typeof on=="function"?(d=>y=>d.encode(y))(new on):async d=>new Uint8Array(await new n(d).arrayBuffer())),u=o&&a&&an(()=>{let d=!1;const y=new n(ee.origin,{body:new sn,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!y}),c=i&&a&&an(()=>m.isReadableStream(new r("").body)),p={stream:c&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!p[d]&&(p[d]=(y,g)=>{let _=y&&y[d];if(_)return _.call(y);throw new O(`Response type '${d}' is not supported`,O.ERR_NOT_SUPPORT,g)})});const f=async d=>{if(d==null)return 0;if(m.isBlob(d))return d.size;if(m.isSpecCompliantForm(d))return(await new n(ee.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(m.isArrayBufferView(d)||m.isArrayBuffer(d))return d.byteLength;if(m.isURLSearchParams(d)&&(d=d+""),m.isString(d))return(await l(d)).byteLength},b=async(d,y)=>{const g=m.toFiniteNumber(d.getContentLength());return g??f(y)};return async d=>{let{url:y,method:g,data:_,signal:C,cancelToken:w,timeout:k,onDownloadProgress:E,onUploadProgress:P,responseType:M,headers:I,withCredentials:A="same-origin",fetchOptions:$}=is(d),N=t||fetch;M=M?(M+"").toLowerCase():"text";let F=ai([C,w&&w.toAbortSignal()],k),z=null;const j=F&&F.unsubscribe&&(()=>{F.unsubscribe()});let S;try{if(P&&u&&g!=="get"&&g!=="head"&&(S=await b(I,_))!==0){let J=new n(y,{method:"POST",body:_,duplex:"half"}),G;if(m.isFormData(_)&&(G=J.headers.get("content-type"))&&I.setContentType(G),J.body){const[te,Z]=Qt(S,Qe(en(P)));_=nn(J.body,rn,te,Z)}}m.isString(A)||(A=A?"include":"omit");const R=o&&"credentials"in n.prototype,D={...$,signal:F,method:g.toUpperCase(),headers:I.normalize().toJSON(),body:_,duplex:"half",credentials:R?A:void 0};z=o&&new n(y,D);let B=await(o?N(z,$):N(y,D));const H=c&&(M==="stream"||M==="response");if(c&&(E||H&&j)){const J={};["status","statusText","headers"].forEach(ie=>{J[ie]=B[ie]});const G=m.toFiniteNumber(B.headers.get("content-length")),[te,Z]=E&&Qt(G,Qe(en(E),!0))||[];B=new r(nn(B.body,rn,te,()=>{Z&&Z(),j&&j()}),J)}M=M||"text";let ce=await p[m.findKey(p,M)||"text"](B,d);return!H&&j&&j(),await new Promise((J,G)=>{ss(J,G,{data:ce,headers:se.from(B.headers),status:B.status,statusText:B.statusText,config:d,request:z})})}catch(R){throw j&&j(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new O("Network Error",O.ERR_NETWORK,d,z),{cause:R.cause||R}):O.from(R,R&&R.code,d,z)}}},pi=new Map,as=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,a=i,l,u,c=pi;for(;a--;)l=o[a],u=c.get(l),u===void 0&&c.set(l,u=a?new Map:fi(t)),c=u;return u};as();const Ht={http:To,xhr:ii,fetch:{get:as}};m.forEach(Ht,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const cn=e=>`- ${e}`,hi=e=>m.isFunction(e)||e===null||e===!1;function mi(e,t){e=m.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let a;if(s=r,!hi(r)&&(s=Ht[(a=String(r)).toLowerCase()],s===void 0))throw new O(`Unknown adapter '${a}'`);if(s&&(m.isFunction(s)||(s=s.get(t))))break;o[a||"#"+i]=s}if(!s){const i=Object.entries(o).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=n?i.length>1?`since :
4
+ `+i.map(cn).join(`
5
+ `):" "+cn(i[0]):"as no adapter specified";throw new O("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const cs={getAdapter:mi,adapters:Ht};function gt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Se(null,e)}function ln(e){return gt(e),e.headers=se.from(e.headers),e.data=mt.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),cs.getAdapter(e.adapter||Be.adapter,e)(e).then(function(r){return gt(e),r.data=mt.call(e,e.transformResponse,r),r.headers=se.from(r.headers),r},function(r){return rs(r)||(gt(e),r&&r.response&&(r.response.data=mt.call(e,e.transformResponse,r.response),r.response.headers=se.from(r.response.headers))),Promise.reject(r)})}const ls="1.13.2",dt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{dt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const un={};dt.transitional=function(t,n,r){function s(o,i){return"[Axios v"+ls+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,a)=>{if(t===!1)throw new O(s(i," has been removed"+(n?" in "+n:"")),O.ERR_DEPRECATED);return n&&!un[i]&&(un[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,a):!0}};dt.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function gi(e,t,n){if(typeof e!="object")throw new O("options must be an object",O.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const a=e[o],l=a===void 0||i(a,o,e);if(l!==!0)throw new O("option "+o+" must be "+l,O.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new O("Unknown option "+o,O.ERR_BAD_OPTION)}}const Ge={assertOptions:gi,validators:dt},ue=Ge.validators;let ve=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Yt,response:new Yt}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
+ `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ye(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&Ge.assertOptions(r,{silentJSONParsing:ue.transitional(ue.boolean),forcedJSONParsing:ue.transitional(ue.boolean),clarifyTimeoutError:ue.transitional(ue.boolean)},!1),s!=null&&(m.isFunction(s)?n.paramsSerializer={serialize:s}:Ge.assertOptions(s,{encode:ue.function,serialize:ue.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Ge.assertOptions(n,{baseUrl:ue.spelling("baseURL"),withXsrfToken:ue.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&m.merge(o.common,o[n.method]);o&&m.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),n.headers=se.concat(i,o);const a=[];let l=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(l=l&&y.synchronous,a.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let c,p=0,f;if(!l){const d=[ln.bind(this),void 0];for(d.unshift(...a),d.push(...u),f=d.length,c=Promise.resolve(n);p<f;)c=c.then(d[p++],d[p++]);return c}f=a.length;let b=n;for(;p<f;){const d=a[p++],y=a[p++];try{b=d(b)}catch(g){y.call(this,g);break}}try{c=ln.call(this,b)}catch(d){return Promise.reject(d)}for(p=0,f=u.length;p<f;)c=c.then(u[p++],u[p++]);return c}getUri(t){t=ye(this.defaults,t);const n=os(t.baseURL,t.url,t.allowAbsoluteUrls);return es(n,t.params,t.paramsSerializer)}};m.forEach(["delete","get","head","options"],function(t){ve.prototype[t]=function(n,r){return this.request(ye(r||{},{method:t,url:n,data:(r||{}).data}))}});m.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,a){return this.request(ye(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}ve.prototype[t]=n(),ve.prototype[t+"Form"]=n(!0)});let bi=class us{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(a=>{r.subscribe(a),o=a}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,a){r.reason||(r.reason=new Se(o,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new us(function(s){t=s}),cancel:t}}};function vi(e){return function(n){return e.apply(null,n)}}function yi(e){return m.isObject(e)&&e.isAxiosError===!0}const $t={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries($t).forEach(([e,t])=>{$t[t]=e});function ds(e){const t=new ve(e),n=Fr(ve.prototype.request,t);return m.extend(n,ve.prototype,t,{allOwnKeys:!0}),m.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return ds(ye(e,s))},n}const X=ds(Be);X.Axios=ve;X.CanceledError=Se;X.CancelToken=bi;X.isCancel=rs;X.VERSION=ls;X.toFormData=ut;X.AxiosError=O;X.Cancel=X.CanceledError;X.all=function(t){return Promise.all(t)};X.spread=vi;X.isAxiosError=yi;X.mergeConfig=ye;X.AxiosHeaders=se;X.formToJSON=e=>ns(m.isHTMLForm(e)?new FormData(e):e);X.getAdapter=cs.getAdapter;X.HttpStatusCode=$t;X.default=X;const{Axios:Ba,AxiosError:Fa,CanceledError:Ha,isCancel:qa,CancelToken:Va,VERSION:Wa,all:Xa,Cancel:Ja,isAxiosError:Ka,spread:Ga,toFormData:Ya,AxiosHeaders:Za,HttpStatusCode:Qa,formToJSON:ec,getAdapter:tc,mergeConfig:nc}=X;async function dn(e,t,n){var r,s,o,i;try{const a=await X.get(`${e}/messages`,{params:{conversationId:t.conversationId,limit:t.limit||50,pageToken:t.pageToken},headers:{"Content-Type":"application/json",...n},timeout:8e3});return{data:a.data.data??[],nextPageToken:(r=a.data.pagination)==null?void 0:r.nextPageToken}}catch(a){throw X.isAxiosError(a)?new Error(((i=(o=(s=a.response)==null?void 0:s.data)==null?void 0:o.error)==null?void 0:i.message)||a.message||"Failed to fetch messages"):a}}const xi=15e3,fn=new Set(["agent_active","pending_agent"]);function _i(e,t){const[n,r]=v.useState([]),[s,o]=v.useState(!1),[i,a]=v.useState(null),[l,u]=v.useState(void 0),[c,p]=v.useState(!0),[f,b]=v.useState(!1),[d,y]=v.useState(!1),g=v.useRef(null),_=v.useRef(!1),{httpApiUrl:C,conversationId:w,headers:k,onError:E,toast:P}=t,M=v.useMemo(()=>({...k,"x-api-key":t.apiKey}),[k,t.apiKey]),I=v.useCallback(()=>{y(!1),g.current&&(clearTimeout(g.current),g.current=null)},[]);v.useEffect(()=>{if(!C||!w)return;(async()=>{var S;try{const R=`${C}/conversation?conversationId=${encodeURIComponent(w)}`,D=await fetch(R,{headers:M});if(!D.ok)return;const B=await D.json(),H=((S=B.data)==null?void 0:S.conversation)??B.data;H!=null&&H.status&&fn.has(H.status)&&(_.current=!0)}catch{}})()},[C,w,M]),v.useEffect(()=>{if(!C||!w)return;(async()=>{o(!0),a(null);try{const S=await dn(C,{conversationId:w,limit:20},M);r(S.data),u(S.nextPageToken),p(!!S.nextPageToken),S.data.some(R=>R.senderType==="agent")&&(_.current=!0)}catch(S){const R=S instanceof Error?S:new Error("Failed to load messages");a(R),E==null||E(R),P==null||P.error("Failed to load existing messages")}finally{o(!1)}})()},[w,C,M,E,P]);const{onMessageReceived:A}=t;v.useEffect(()=>{var j;if(((j=e.lastMessage)==null?void 0:j.type)==="message"&&e.lastMessage.data){const S=e.lastMessage.data;if(w&&S.conversationId!==w)return;r(R=>{if(R.some(H=>H.id===S.id))return R;const D=new Date(S.createdAt).getTime(),B=R.findIndex(H=>H.id.startsWith("temp-")&&H.content===S.content&&H.senderId===S.senderId&&Math.abs(new Date(H.createdAt).getTime()-D)<1e4);if(B>=0){const H=[...R];return H[B]=S,H}return[...R,S]}),S.senderType==="agent"&&(_.current=!0),S.senderType!=="customer"&&I(),A==null||A(S)}},[e.lastMessage,A,w,I]),v.useEffect(()=>{if(!e.lastMessage)return;const{type:j,data:S}=e.lastMessage;if(j==="bot_not_responding"){if(S!=null&&S.conversationId&&w&&S.conversationId!==w)return;I(),_.current=!0}if(j==="conversation_updated"){if(S!=null&&S.conversationId&&w&&S.conversationId!==w)return;S!=null&&S.status&&fn.has(S.status)&&(_.current=!0,I())}},[e.lastMessage,w,I]);const $=v.useCallback(j=>{const S=_.current;r(R=>R.some(D=>D.id===j.id)?R:[...R,j]),j.senderType==="agent"&&(_.current=!0),j.senderType==="customer"&&!S&&(y(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{y(!1)},xi))},[]),N=v.useCallback((j,S)=>{r(R=>R.map(D=>D.id===j?{...D,status:S}:D))},[]),F=v.useCallback(()=>{r([]),_.current=!1},[]),z=v.useCallback(async()=>{if(!(!c||f||!C||!w||!l)){b(!0),a(null);try{const j=await dn(C,{conversationId:w,limit:20,pageToken:l},M);r(S=>[...j.data,...S]),u(j.nextPageToken),p(!!j.nextPageToken)}catch(j){const S=j instanceof Error?j:new Error("Failed to load more messages");a(S),E==null||E(S)}finally{b(!1)}}},[c,f,C,w,l,M,E]);return v.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]),{messages:n,addMessage:$,updateMessageStatus:N,clearMessages:F,isLoading:s,error:i,loadMore:z,hasMore:c,isLoadingMore:f,isBotThinking:d}}function wi(e,t){const[n,r]=v.useState(!1),[s,o]=v.useState(0),[i,a]=v.useState(null),u={...{maxFileSize:10*1024*1024,allowedTypes:["image/jpeg","image/jpg","image/png","image/gif","image/webp","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/plain","text/csv"]},...t},c=!!(t!=null&&t.uploadUrl),p=b=>u.allowedTypes.includes(b.type)?b.size>u.maxFileSize?`File size ${(b.size/1024/1024).toFixed(2)}MB exceeds the maximum allowed size of ${(u.maxFileSize/1024/1024).toFixed(2)}MB`:null:`File type ${b.type} is not supported. Allowed types: ${u.allowedTypes.join(", ")}`;return{uploadFile:async b=>{if(!(t!=null&&t.uploadUrl)){const y=new Error("File upload URL is not configured");throw a(y),y}const d=p(b);if(d){const y=new Error(d);throw a(y),y}r(!0),o(0),a(null);try{const y=await X.post(t.uploadUrl,{fileName:b.name,contentType:b.type,fileSize:b.size},{headers:{"Content-Type":"application/json","x-api-key":e||"",...t.headers}}),{uploadUrl:g,attachmentUrl:_}=y.data.data||y.data;if(!g||!_)throw new Error("Failed to get upload URL from server");return await X.put(g,b,{headers:{"Content-Type":b.type},onUploadProgress:C=>{if(C.total){const w=Math.round(C.loaded*100/C.total);o(w)}}}),{url:_,name:b.name,size:b.size,type:b.type,markdown:b.type.startsWith("image/")?`![${b.name}](${_})`:`[${b.name}](${_})`}}catch(y){console.error("File upload failed:",y);const g=y instanceof Error?y:new Error("Upload failed");throw a(g),g}finally{r(!1),o(0)}},isUploading:n,uploadProgress:s,error:i,canUpload:c}}function ki(e){const[t,n]=v.useState([]);return v.useEffect(()=>{var r;if(((r=e.lastMessage)==null?void 0:r.type)==="typing"&&e.lastMessage.data){const{userId:s,isTyping:o}=e.lastMessage.data;n(o?i=>i.includes(s)?i:[...i,s]:i=>i.filter(a=>a!==s))}},[e.lastMessage]),{isTyping:t.length>0,typingUsers:t}}const Ci="xcelsior-chat-size",qe=8,pn={n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize",ne:"nesw-resize",nw:"nwse-resize",se:"nwse-resize",sw:"nesw-resize"};function Si(e,t,n){try{const r=localStorage.getItem(e);if(r){const s=JSON.parse(r);if(typeof s.width=="number"&&typeof s.height=="number")return{width:s.width,height:s.height}}}catch{}return{width:t,height:n}}function hn(e,t,n){try{localStorage.setItem(e,JSON.stringify({width:t,height:n}))}catch{}}function bt(){return typeof window<"u"&&window.innerWidth<768}function mn(e,t){const{clientX:n,clientY:r}=e,s=r-t.top<qe,o=t.bottom-r<qe,i=n-t.left<qe,a=t.right-n<qe;return s&&i?"nw":s&&a?"ne":o&&i?"sw":o&&a?"se":s?"n":o?"s":i?"w":a?"e":null}function $i({initialWidth:e=380,initialHeight:t=580,minWidth:n=320,minHeight:r=400,maxWidth:s=800,maxHeight:o=900,storageKey:i=Ci,enabled:a=!0}={}){const[l,u]=v.useState(()=>typeof window>"u"?{width:e,height:t}:Si(i,e,t)),[c,p]=v.useState(!1),[f,b]=v.useState(!1),[d,y]=v.useState(null),g=v.useRef(l);g.current=l;const _=v.useRef(null),C=v.useRef(null),w=v.useCallback((z,j)=>{const S=Math.min(s,window.innerWidth-24),R=Math.min(o,window.innerHeight-100);return{width:Math.round(Math.max(n,Math.min(S,z))),height:Math.round(Math.max(r,Math.min(R,j)))}},[n,r,s,o]),k=v.useCallback((z,j)=>{if(!_.current)return g.current;const{edge:S,startWidth:R,startHeight:D}=_.current;let B=R,H=D;return S.includes("e")&&(B=R+z),S.includes("w")&&(B=R-z),S.includes("s")&&(H=D+j),S.includes("n")&&(H=D-j),w(B,H)},[w]),E=v.useCallback(z=>{if(!_.current)return;const j=z.clientX-_.current.startX,S=z.clientY-_.current.startY;u(k(j,S))},[k]),P=v.useCallback(z=>{if(!_.current)return;const j=z.clientX-_.current.startX,S=z.clientY-_.current.startY,R=k(j,S);hn(i,R.width,R.height),_.current=null,p(!1),y(null),document.body.style.cursor="",document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",P)},[k,i,E]),M=v.useCallback(z=>{if(!_.current||z.touches.length===0)return;z.preventDefault();const j=z.touches[0],S=j.clientX-_.current.startX,R=j.clientY-_.current.startY;u(k(S,R))},[k]),I=v.useCallback(z=>{if(!_.current)return;const j=z.changedTouches[0];if(j){const S=j.clientX-_.current.startX,R=j.clientY-_.current.startY,D=k(S,R);hn(i,D.width,D.height)}_.current=null,p(!1),y(null),document.removeEventListener("touchmove",M),document.removeEventListener("touchend",I)},[k,i,M]);v.useEffect(()=>()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",P),document.removeEventListener("touchmove",M),document.removeEventListener("touchend",I),document.body.style.cursor=""},[E,P,M,I]);const A=v.useCallback(z=>{if(!a||bt()||c)return;const j=z.currentTarget;C.current=j;const S=j.getBoundingClientRect(),R=mn(z,S);b(!!R),y(R),j.style.cursor=R?pn[R]:""},[a,c]),$=v.useCallback(z=>{!a||bt()||!d||(z.preventDefault(),z.stopPropagation(),_.current={edge:d,startX:z.clientX,startY:z.clientY,startWidth:g.current.width,startHeight:g.current.height},p(!0),document.body.style.cursor=pn[d],document.addEventListener("mousemove",E),document.addEventListener("mouseup",P))},[a,d,E,P]),N=v.useCallback(z=>{c||(b(!1),y(null),C.current&&(C.current.style.cursor=""))},[c]),F=v.useCallback(z=>{if(!a||bt()||z.touches.length===0)return;const S=z.currentTarget.getBoundingClientRect(),R=z.touches[0],D=mn(R,S);D&&(_.current={edge:D,startX:R.clientX,startY:R.clientY,startWidth:g.current.width,startHeight:g.current.height},p(!0),y(D),document.addEventListener("touchmove",M,{passive:!1}),document.addEventListener("touchend",I))},[a,M,I]);return{width:l.width,height:l.height,isResizing:c,isNearEdge:f,activeEdge:d,containerResizeProps:{onMouseMove:A,onMouseDown:$,onMouseLeave:N,onTouchStart:F}}}function Et({agent:e,onClose:t,onMinimize:n,theme:r}){return h.jsxs("div",{className:"relative text-white overflow-hidden",style:{flexShrink:0,background:["radial-gradient(ellipse at 30% 50%, rgba(0,50,255,0.4) 0%, transparent 60%)","radial-gradient(ellipse at 70% 30%, rgba(0,80,255,0.3) 0%, transparent 50%)","radial-gradient(ellipse at 50% 80%, rgba(0,30,200,0.3) 0%, transparent 60%)","linear-gradient(135deg, #0030cc 0%, #001a66 50%, #000d33 100%)"].join(", ")},children:[h.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 50%)"}}),h.jsxs("div",{className:"flex items-center justify-between",style:{padding:"8px 16px"},children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"relative",children:[e!=null&&e.avatar?h.jsx("img",{src:e.avatar,alt:e.name,className:"h-10 w-10 rounded-full object-cover",style:{boxShadow:"0 2px 8px rgba(0,0,0,0.25)"}}):h.jsx("div",{style:{filter:"drop-shadow(0 2px 8px rgba(0,0,0,0.3))"},children:h.jsx(Ds,{size:28,color:"white"})}),(e==null?void 0:e.status)==="online"&&h.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full",style:{backgroundColor:(r==null?void 0:r.statusPositive)||"#1ed473",border:"2.5px solid rgba(0,50,180,0.9)",boxShadow:`0 0 8px ${(r==null?void 0:r.statusPositive)||"#1ed473"}80`}})]}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold leading-tight",style:{fontSize:"15px",letterSpacing:"-0.01em"},children:(e==null?void 0:e.name)||"Xcelsior Software"}),h.jsx("p",{className:"mt-0.5 leading-tight",style:{fontSize:"12px",letterSpacing:"0.015em",color:"rgba(255,255,255,0.6)"},children:(e==null?void 0:e.status)==="online"?h.jsxs("span",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full",style:{backgroundColor:(r==null?void 0:r.statusPositive)||"#1ed473",boxShadow:`0 0 4px ${(r==null?void 0:r.statusPositive)||"#1ed473"}60`}}),"Online now"]}):(e==null?void 0:e.status)==="away"?"Away":"We typically reply within minutes"})]})]}),h.jsx("div",{className:"flex items-center gap-0.5",children:(n||t)&&h.jsx("button",{type:"button",onClick:n||t,className:"p-2 rounded-lg transition-all duration-150",style:{backgroundColor:"transparent"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="rgba(255,255,255,0.1)"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},"aria-label":"Minimize chat",children:h.jsxs("svg",{width:"18",height:"18",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:[h.jsx("title",{children:"Minimize"}),h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})]})})})]}),h.jsx("div",{className:"h-px",style:{background:"linear-gradient(90deg, transparent 5%, rgba(255,255,255,0.12) 30%, rgba(255,255,255,0.12) 70%, transparent 95%)"}})]})}try{Et.displayName="ChatHeader",Et.__docgenInfo={description:"",displayName:"ChatHeader",props:{agent:{defaultValue:null,description:"",name:"agent",required:!1,type:{name:"IUser | undefined"}},onClose:{defaultValue:null,description:"",name:"onClose",required:!1,type:{name:"(() => void) | undefined"}},onMinimize:{defaultValue:null,description:"",name:"onMinimize",required:!1,type:{name:"(() => void) | undefined"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"IChatTheme | undefined"}}}}}catch{}const Ei={sm:16,md:24,lg:36},ji={sm:2,md:2,lg:3};function et({size:e="md",color:t="currentColor"}){const n=Ei[e],r=ji[e];return h.jsxs(h.Fragment,{children:[h.jsx("style",{children:`
7
+ @keyframes xchat-spin {
8
+ to { transform: rotate(360deg); }
9
+ }
10
+ .xchat-spinner {
11
+ animation: xchat-spin 0.75s linear infinite;
12
+ border-radius: 50%;
13
+ display: inline-block;
14
+ flex-shrink: 0;
15
+ }
16
+ `}),h.jsx("span",{className:"xchat-spinner",role:"status","aria-label":"Loading",style:{width:n,height:n,border:`${r}px solid rgba(128,128,128,0.25)`,borderTopColor:t}})]})}try{et.displayName="Spinner",et.__docgenInfo={description:"",displayName:"Spinner",props:{size:{defaultValue:{value:"md"},description:"",name:"size",required:!1,type:{name:"enum",value:[{value:"undefined"},{value:'"sm"'},{value:'"md"'},{value:'"lg"'}]}},color:{defaultValue:{value:"currentColor"},description:"",name:"color",required:!1,type:{name:"string | undefined"}}}}}catch{}const vt={greeting:["Hey there!","Hello!","Hi! One moment","Welcome!","Nice to meet you"],farewell:["Wrapping up","One last thing","Almost done"],pricing:["Crunching numbers","Checking our plans","Let me look into that","Pulling up pricing","Running the numbers","Checking options"],quote:["Putting this together","Working on your quote","Gathering the details","Tailoring this for you"],booking:["Checking the calendar","Finding good times","Pulling up availability","Let me check slots"],technical:["Diving into the docs","Interesting question","Let me look that up","Checking the specs","Hmm, good one","Researching this"],code:["Reading the code","Checking the repo","Let me trace that","Debugging in my head"],support:["On it!","Let me help","Looking into this","Checking for you","I got you","Investigating"],frustrated:["I hear you","Let me fix this","Sorry about that","Working on it now","Bear with me"],services:["Great question","Let me explain","Pulling up details","Good to know you ask"],portfolio:["Checking our work","Pulling up examples","Let me show you","Finding case studies"],about:["Glad you asked!","Let me tell you","Good question","Here we go"],comparison:["Weighing the options","Let me compare","Thinking through this","Good point"],followUp:["Let me dig deeper","More details coming","Building on that","Expanding on this"],general:["Hmm, let me think","One sec","On it","Working on it","Almost there","Bear with me","Let me check","Good question","Hang tight","Looking into it","Let me see","Thinking","Just a moment","Figuring this out"]},Ri=[{key:"frustrated",pattern:/frustrat|angry|annoyed|terrible|worst|useless|waste|stupid|wtf|seriously|ridiculous|unacceptable|disappointing/},{key:"greeting",pattern:/^(hi\b|hey\b|hello\b|good morning|good afternoon|good evening|g'day|howdy|yo\b|sup\b|what's up|greetings)/},{key:"farewell",pattern:/\b(thanks|thank you|bye|goodbye|cheers|that's all|that's it|no more|all good|perfect thanks)\b/},{key:"booking",pattern:/\b(book|schedule|meeting|appointment|calendar|available time|free slot|set up a call|arrange|consultation time|when can)\b/},{key:"quote",pattern:/\b(quote|proposal|estimate|project cost|custom price|tailor|bespoke)\b/},{key:"pricing",pattern:/\b(price|cost|how much|pricing|rate|fee|budget|afford|charge|per hour|hourly|package|plan|tier|subscription)\b/},{key:"code",pattern:/\b(code|github|repo|commit|deploy|ci\/cd|docker|aws|lambda|api endpoint|sdk|npm|yarn|pnpm|typescript|react|next\.?js)\b/},{key:"technical",pattern:/\b(api|integrate|integration|stack|server|database|backend|frontend|infrastructure|architecture|performance|scalab|migration|devops|cloud)\b/},{key:"support",pattern:/\b(bug|error|issue|broken|not working|help|support|problem|fix|crash|down|fail|stuck|trouble|can't|cannot|doesn't work|won't)\b/},{key:"portfolio",pattern:/\b(portfolio|case stud|example|previous work|client|project you|showcase|demo|sample)\b/},{key:"services",pattern:/\b(service|what do you|what can you|offer|do you do|capabilit|specializ|expertise|solution|consult|develop|design|build|create)\b/},{key:"about",pattern:/\b(who are|about you|your team|your company|where are you|location|office|founded|history|values|mission)\b/},{key:"comparison",pattern:/\b(compare|vs|versus|difference|better|which one|alternative|competitor|pros and cons|trade.?off|should i|recommend)\b/},{key:"followUp",pattern:/\b(more detail|tell me more|elaborate|explain further|what about|and also|another question|one more|can you also|what else|go on)\b/}];function gn(e){if(!e)return"general";const t=e.toLowerCase().trim();for(const n of Ri)if(n.pattern.test(t))return n.key;return t.split(/\s+/).length<=3||t.endsWith("?"),"general"}function bn(e){const n=[...vt[e]||vt.general],r=vt.general.filter(o=>!n.includes(o)).sort(()=>Math.random()-.5).slice(0,3),s=[...n,...r];for(let o=s.length-1;o>0;o--){const i=Math.floor(Math.random()*(o+1));[s[o],s[i]]=[s[i],s[o]]}return s}function Ti(e){if(!(e!=null&&e.startsWith("#")))return!1;const t=e.replace("#",""),n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),s=parseInt(t.substring(4,6),16);return(.299*n+.587*r+.114*s)/255>.5}function jt({lastUserMessage:e,theme:t,showAvatar:n=!0}){const r=Ti(t==null?void 0:t.background),s=(t==null?void 0:t.primary)||"#337eff",o=(t==null?void 0:t.textMuted)||(r?"rgba(0,0,0,0.4)":"rgba(247,247,248,0.45)"),[i,a]=v.useState(0),[l,u]=v.useState(""),[c,p]=v.useState(!1),f=v.useRef(bn(gn(e)));return v.useEffect(()=>{f.current=bn(gn(e)),a(0),u(""),p(!1)},[e]),v.useEffect(()=>{const b=f.current,d=b[i%b.length];let y;return c?l.length>0?y=setTimeout(()=>u(l.slice(0,-1)),18):(p(!1),a(g=>(g+1)%f.current.length)):l.length<d.length?y=setTimeout(()=>u(d.slice(0,l.length+1)),30+Math.random()*30):y=setTimeout(()=>p(!0),1800),()=>clearTimeout(y)},[l,c,i]),h.jsxs("div",{className:"flex gap-2.5 mb-3",role:"status","aria-live":"polite","aria-label":"Xcelsior is thinking",children:[n&&h.jsx("div",{className:"flex-shrink-0 mt-auto mb-5",children:h.jsx(Br,{size:28})}),h.jsx("div",{className:"flex flex-col items-start",children:h.jsx("div",{style:{backgroundColor:r?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.04)",borderRadius:"18px 18px 18px 4px",boxShadow:r?"inset 0 0 0 1px rgba(0,0,0,0.06)":"inset 0 0 0 0.5px rgba(255,255,255,0.06), inset 0 1px 0 0 rgba(255,255,255,0.08)",padding:"12px 16px",minWidth:160},children:h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[h.jsx("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[0,1,2].map(b=>h.jsx("span",{style:{width:5,height:5,borderRadius:"50%",backgroundColor:s,display:"inline-block",animation:`thinkingPulse 1.4s ease-in-out ${b*.2}s infinite`}},b))}),h.jsxs("span",{style:{fontSize:12,color:o,letterSpacing:"0.015em",fontStyle:"italic"},children:[l,h.jsx("span",{style:{display:"inline-block",width:1,height:13,backgroundColor:o,marginLeft:1,animation:"cursorBlink 0.8s step-end infinite",verticalAlign:"text-bottom"}})]})]})})})]})}try{jt.displayName="ThinkingIndicator",jt.__docgenInfo={description:"",displayName:"ThinkingIndicator",props:{lastUserMessage:{defaultValue:null,description:"Last message the user sent — used to pick contextual phrases",name:"lastUserMessage",required:!1,type:{name:"string | undefined"}},theme:{defaultValue:null,description:"Chat theme for color matching",name:"theme",required:!1,type:{name:"IChatTheme | undefined"}},showAvatar:{defaultValue:{value:"true"},description:"Show avatar next to the indicator",name:"showAvatar",required:!1,type:{name:"boolean | undefined"}}}}}catch{}function Rt({messages:e,currentUser:t,isLoading:n=!1,isTyping:r=!1,typingUser:s,autoScroll:o=!0,onLoadMore:i,hasMore:a=!1,isLoadingMore:l=!1,theme:u,onQuickAction:c,isBotThinking:p=!1}){var A;const f=v.useRef(null),b=v.useRef(null),d=v.useRef(e.length),y=v.useRef(null),g=v.useRef(0),_=v.useRef(!1),C=v.useRef(!1),w=(u==null?void 0:u.background)||"#00001a",k=(()=>{if(!w.startsWith("#"))return!1;const $=w.replace("#",""),N=parseInt($.substring(0,2),16),F=parseInt($.substring(2,4),16),z=parseInt($.substring(4,6),16);return(.299*N+.587*F+.114*z)/255>.5})(),E=(u==null?void 0:u.primary)||"#337eff",P=(u==null?void 0:u.text)||(k?"#1a1a2e":"#f7f7f8"),M=(u==null?void 0:u.textMuted)||(k?"rgba(0,0,0,0.4)":"rgba(247,247,248,0.45)");v.useEffect(()=>{o&&f.current&&(e.length>d.current&&!l&&f.current.scrollIntoView({behavior:"smooth"}),d.current=e.length)},[e.length,o,l]),v.useEffect(()=>{e.length>0&&f.current&&!n&&!_.current?(setTimeout(()=>{var $;($=f.current)==null||$.scrollIntoView({behavior:"auto"}),setTimeout(()=>{C.current=!0},200)},100),_.current=!0):!n&&e.length===0&&!_.current&&(C.current=!0,_.current=!0)},[n,e.length]),v.useEffect(()=>{var $;if(l)g.current=(($=b.current)==null?void 0:$.scrollHeight)||0;else if(g.current>0&&b.current){const F=b.current.scrollHeight-g.current;b.current.scrollTop=F,g.current=0}},[l]);const I=v.useCallback(()=>{if(!b.current||!i||!a||l||!C.current)return;const{scrollTop:$}=b.current;$<100&&i()},[i,a,l]);return v.useEffect(()=>{const $=b.current;if($)return $.addEventListener("scroll",I),()=>$.removeEventListener("scroll",I)},[I]),n?h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(et,{size:"lg"})}):e.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",style:{padding:"40px 32px"},children:[h.jsx("h3",{className:"font-semibold mb-2",style:{color:P,fontSize:"17px",letterSpacing:"-0.01em"},children:"How can we help?"}),h.jsx("p",{className:"max-w-[240px]",style:{color:M,fontSize:"13px",lineHeight:"1.5",letterSpacing:"0.015em",marginBottom:20},children:"Ask us anything. We are here to help you get the most out of Xcelsior."}),h.jsx("div",{className:"flex flex-wrap justify-center gap-2",children:[{label:"Our services",message:"What services does Xcelsior offer?"},{label:"Get a quote",message:"I would like to get a quote for a project"},{label:"Support",message:"I need help with something"}].map($=>h.jsx("button",{type:"button",onClick:()=>c==null?void 0:c($.message),style:{padding:"6px 14px",borderRadius:"999px",cursor:"pointer",transition:"all 150ms ease",backgroundColor:k?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.04)",border:k?"1px solid rgba(0,0,0,0.1)":"1px solid rgba(255,255,255,0.1)",color:k?"rgba(0,0,0,0.6)":"rgba(247,247,248,0.6)",fontSize:"12px",letterSpacing:"0.015em"},onMouseEnter:N=>{N.currentTarget.style.backgroundColor=k?"rgba(0,0,0,0.08)":"rgba(255,255,255,0.08)",N.currentTarget.style.color=k?"rgba(0,0,0,0.8)":"rgba(247,247,248,0.8)",N.currentTarget.style.borderColor=E},onMouseLeave:N=>{N.currentTarget.style.backgroundColor=k?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.04)",N.currentTarget.style.color=k?"rgba(0,0,0,0.6)":"rgba(247,247,248,0.6)",N.currentTarget.style.borderColor=k?"rgba(0,0,0,0.1)":"rgba(255,255,255,0.1)"},children:$.label},$.label))})]}):h.jsxs("div",{ref:b,className:"flex-1 overflow-y-auto px-4 py-3",style:{scrollBehavior:"smooth"},children:[h.jsx("style",{children:`
17
+ @keyframes thinkingPulse {
18
+ 0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
19
+ 30% { opacity: 1; transform: scale(1); }
20
+ }
21
+ @keyframes cursorBlink {
22
+ 0%, 100% { opacity: 1; }
23
+ 50% { opacity: 0; }
24
+ }
25
+ `}),l&&h.jsx("div",{className:"flex justify-center py-3",children:h.jsx(et,{size:"sm"})}),h.jsx("div",{ref:y}),e.map($=>h.jsx(Bs,{message:$,currentUser:t,showAvatar:!0,showTimestamp:!0,theme:u},$.id)),r&&h.jsxs("div",{className:"flex gap-2.5 mb-3",children:[h.jsx("div",{className:"flex-shrink-0 mt-auto mb-5",children:h.jsx(Br,{size:28})}),h.jsxs("div",{className:"flex flex-col items-start",children:[h.jsx("div",{className:"px-4 py-3",style:{backgroundColor:k?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.04)",borderRadius:"18px 18px 18px 4px",boxShadow:k?"inset 0 0 0 1px rgba(0,0,0,0.06)":"inset 0 0 0 0.5px rgba(255,255,255,0.06), inset 0 1px 0 0 rgba(255,255,255,0.08)"},children:h.jsx("div",{className:"flex gap-1.5 items-center",style:{height:16},children:[0,1,2].map($=>h.jsx("span",{className:"rounded-full animate-bounce",style:{width:5,height:5,backgroundColor:`${E}80`,animationDelay:`${$*.15}s`,animationDuration:"0.8s"}},$))})}),s&&h.jsxs("span",{className:"mt-1 px-1",style:{color:M,fontSize:"11px",letterSpacing:"0.019em"},children:[s," is typing..."]})]})]}),p&&!r&&h.jsx(jt,{theme:u,lastUserMessage:(A=e.filter($=>$.senderType==="customer").pop())==null?void 0:A.content}),h.jsx("div",{ref:f})]})}try{Rt.displayName="MessageList",Rt.__docgenInfo={description:"",displayName:"MessageList",props:{messages:{defaultValue:null,description:"",name:"messages",required:!0,type:{name:"IMessage[]"}},currentUser:{defaultValue:null,description:"",name:"currentUser",required:!0,type:{name:"IUser"}},isLoading:{defaultValue:{value:"false"},description:"",name:"isLoading",required:!1,type:{name:"boolean | undefined"}},isTyping:{defaultValue:{value:"false"},description:"",name:"isTyping",required:!1,type:{name:"boolean | undefined"}},typingUser:{defaultValue:null,description:"",name:"typingUser",required:!1,type:{name:"string | undefined"}},autoScroll:{defaultValue:{value:"true"},description:"",name:"autoScroll",required:!1,type:{name:"boolean | undefined"}},onLoadMore:{defaultValue:null,description:"",name:"onLoadMore",required:!1,type:{name:"(() => void) | undefined"}},hasMore:{defaultValue:{value:"false"},description:"",name:"hasMore",required:!1,type:{name:"boolean | undefined"}},isLoadingMore:{defaultValue:{value:"false"},description:"",name:"isLoadingMore",required:!1,type:{name:"boolean | undefined"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"IChatTheme | undefined"}},onQuickAction:{defaultValue:null,description:"Called when a quick-start action button is clicked — sends the text as a message",name:"onQuickAction",required:!1,type:{name:"((text: string) => void) | undefined"}},isBotThinking:{defaultValue:{value:"false"},description:"True when user sent a message and bot response hasn't arrived yet",name:"isBotThinking",required:!1,type:{name:"boolean | undefined"}}}}}catch{}function fs(e){return e&&e.__esModule?e.default:e}function ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ft,L,ps,Ie,hs,vn,tt={},ms=[],Mi=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function me(e,t){for(var n in t)e[n]=t[n];return e}function gs(e){var t=e.parentNode;t&&t.removeChild(e)}function Tt(e,t,n){var r,s,o,i={};for(o in t)o=="key"?r=t[o]:o=="ref"?s=t[o]:i[o]=t[o];if(arguments.length>2&&(i.children=arguments.length>3?ft.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)i[o]===void 0&&(i[o]=e.defaultProps[o]);return Ye(e,i,r,s,null)}function Ye(e,t,n,r,s){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:s??++ps};return s==null&&L.vnode!=null&&L.vnode(o),o}function pe(){return{current:null}}function we(e){return e.children}function de(e,t){this.props=e,this.context=t}function ke(e,t){if(t==null)return e.__?ke(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?ke(e):null}function bs(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return bs(e)}}function yn(e){(!e.__d&&(e.__d=!0)&&Ie.push(e)&&!nt.__r++||vn!==L.debounceRendering)&&((vn=L.debounceRendering)||hs)(nt)}function nt(){for(var e;nt.__r=Ie.length;)e=Ie.sort(function(t,n){return t.__v.__b-n.__v.__b}),Ie=[],e.some(function(t){var n,r,s,o,i,a;t.__d&&(i=(o=(n=t).__v).__e,(a=n.__P)&&(r=[],(s=me({},o)).__v=o.__v+1,qt(a,o,s,n.__n,a.ownerSVGElement!==void 0,o.__h!=null?[i]:null,r,i??ke(o),o.__h),_s(r,o),o.__e!=i&&bs(o)))})}function vs(e,t,n,r,s,o,i,a,l,u){var c,p,f,b,d,y,g,_=r&&r.__k||ms,C=_.length;for(n.__k=[],c=0;c<t.length;c++)if((b=n.__k[c]=(b=t[c])==null||typeof b=="boolean"?null:typeof b=="string"||typeof b=="number"||typeof b=="bigint"?Ye(null,b,null,null,b):Array.isArray(b)?Ye(we,{children:b},null,null,null):b.__b>0?Ye(b.type,b.props,b.key,null,b.__v):b)!=null){if(b.__=n,b.__b=n.__b+1,(f=_[c])===null||f&&b.key==f.key&&b.type===f.type)_[c]=void 0;else for(p=0;p<C;p++){if((f=_[p])&&b.key==f.key&&b.type===f.type){_[p]=void 0;break}f=null}qt(e,b,f=f||tt,s,o,i,a,l,u),d=b.__e,(p=b.ref)&&f.ref!=p&&(g||(g=[]),f.ref&&g.push(f.ref,null,b),g.push(p,b.__c||d,b)),d!=null?(y==null&&(y=d),typeof b.type=="function"&&b.__k===f.__k?b.__d=l=ys(b,l,e):l=xs(e,b,f,_,d,l),typeof n.type=="function"&&(n.__d=l)):l&&f.__e==l&&l.parentNode!=e&&(l=ke(f))}for(n.__e=y,c=C;c--;)_[c]!=null&&(typeof n.type=="function"&&_[c].__e!=null&&_[c].__e==n.__d&&(n.__d=ke(r,c+1)),ks(_[c],_[c]));if(g)for(c=0;c<g.length;c++)ws(g[c],g[++c],g[++c])}function ys(e,t,n){for(var r,s=e.__k,o=0;s&&o<s.length;o++)(r=s[o])&&(r.__=e,t=typeof r.type=="function"?ys(r,t,n):xs(n,r,r,s,r.__e,t));return t}function rt(e,t){return t=t||[],e==null||typeof e=="boolean"||(Array.isArray(e)?e.some(function(n){rt(n,t)}):t.push(e)),t}function xs(e,t,n,r,s,o){var i,a,l;if(t.__d!==void 0)i=t.__d,t.__d=void 0;else if(n==null||s!=o||s.parentNode==null)e:if(o==null||o.parentNode!==e)e.appendChild(s),i=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<r.length;l+=2)if(a==s)break e;e.insertBefore(s,o),i=o}return i!==void 0?i:s.nextSibling}function Li(e,t,n,r,s){var o;for(o in n)o==="children"||o==="key"||o in t||st(e,o,null,n[o],r);for(o in t)s&&typeof t[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||n[o]===t[o]||st(e,o,t[o],n[o],r)}function xn(e,t,n){t[0]==="-"?e.setProperty(t,n):e[t]=n==null?"":typeof n!="number"||Mi.test(t)?n:n+"px"}function st(e,t,n,r,s){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||xn(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||xn(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?wn:_n,o):e.removeEventListener(t,o?wn:_n,o);else if(t!=="dangerouslySetInnerHTML"){if(s)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if(t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n!=null&&(n!==!1||t[0]==="a"&&t[1]==="r")?e.setAttribute(t,n):e.removeAttribute(t))}}function _n(e){this.l[e.type+!1](L.event?L.event(e):e)}function wn(e){this.l[e.type+!0](L.event?L.event(e):e)}function qt(e,t,n,r,s,o,i,a,l){var u,c,p,f,b,d,y,g,_,C,w,k=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(u=L.__b)&&u(t);try{e:if(typeof k=="function"){if(g=t.props,_=(u=k.contextType)&&r[u.__c],C=u?_?_.props.value:u.__:r,n.__c?y=(c=t.__c=n.__c).__=c.__E:("prototype"in k&&k.prototype.render?t.__c=c=new k(g,C):(t.__c=c=new de(g,C),c.constructor=k,c.render=zi),_&&_.sub(c),c.props=g,c.state||(c.state={}),c.context=C,c.__n=r,p=c.__d=!0,c.__h=[]),c.__s==null&&(c.__s=c.state),k.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=me({},c.__s)),me(c.__s,k.getDerivedStateFromProps(g,c.__s))),f=c.props,b=c.state,p)k.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(k.getDerivedStateFromProps==null&&g!==f&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(g,C),!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(g,c.__s,C)===!1||t.__v===n.__v){c.props=g,c.state=c.__s,t.__v!==n.__v&&(c.__d=!1),c.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(E){E&&(E.__=t)}),c.__h.length&&i.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(g,c.__s,C),c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(f,b,d)})}c.context=C,c.props=g,c.state=c.__s,(u=L.__r)&&u(t),c.__d=!1,c.__v=t,c.__P=e,u=c.render(c.props,c.state,c.context),c.state=c.__s,c.getChildContext!=null&&(r=me(me({},r),c.getChildContext())),p||c.getSnapshotBeforeUpdate==null||(d=c.getSnapshotBeforeUpdate(f,b)),w=u!=null&&u.type===we&&u.key==null?u.props.children:u,vs(e,Array.isArray(w)?w:[w],t,n,r,s,o,i,a,l),c.base=t.__e,t.__h=null,c.__h.length&&i.push(c),y&&(c.__E=c.__=null),c.__e=!1}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Pi(n.__e,t,n,r,s,o,i,l);(u=L.diffed)&&u(t)}catch(E){t.__v=null,(l||o!=null)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),L.__e(E,t,n)}}function _s(e,t){L.__c&&L.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){L.__e(r,n.__v)}})}function Pi(e,t,n,r,s,o,i,a){var l,u,c,p=n.props,f=t.props,b=t.type,d=0;if(b==="svg"&&(s=!0),o!=null){for(;d<o.length;d++)if((l=o[d])&&"setAttribute"in l==!!b&&(b?l.localName===b:l.nodeType===3)){e=l,o[d]=null;break}}if(e==null){if(b===null)return document.createTextNode(f);e=s?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,f.is&&f),o=null,a=!1}if(b===null)p===f||a&&e.data===f||(e.data=f);else{if(o=o&&ft.call(e.childNodes),u=(p=n.props||tt).dangerouslySetInnerHTML,c=f.dangerouslySetInnerHTML,!a){if(o!=null)for(p={},d=0;d<e.attributes.length;d++)p[e.attributes[d].name]=e.attributes[d].value;(c||u)&&(c&&(u&&c.__html==u.__html||c.__html===e.innerHTML)||(e.innerHTML=c&&c.__html||""))}if(Li(e,f,p,s,a),c)t.__k=[];else if(d=t.props.children,vs(e,Array.isArray(d)?d:[d],t,n,r,s&&b!=="foreignObject",o,i,o?o[0]:n.__k&&ke(n,0),a),o!=null)for(d=o.length;d--;)o[d]!=null&&gs(o[d]);a||("value"in f&&(d=f.value)!==void 0&&(d!==p.value||d!==e.value||b==="progress"&&!d)&&st(e,"value",d,p.value,!1),"checked"in f&&(d=f.checked)!==void 0&&d!==e.checked&&st(e,"checked",d,p.checked,!1))}return e}function ws(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){L.__e(r,n)}}function ks(e,t,n){var r,s;if(L.unmount&&L.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||ws(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){L.__e(o,t)}r.base=r.__P=null}if(r=e.__k)for(s=0;s<r.length;s++)r[s]&&ks(r[s],t,typeof e.type!="function");n||e.__e==null||gs(e.__e),e.__e=e.__d=void 0}function zi(e,t,n){return this.constructor(e,n)}function Cs(e,t,n){var r,s,o;L.__&&L.__(e,t),s=(r=typeof n=="function")?null:n&&n.__k||t.__k,o=[],qt(t,e=(!r&&n||t).__k=Tt(we,null,[e]),s||tt,tt,t.ownerSVGElement!==void 0,!r&&n?[n]:s?null:t.firstChild?ft.call(t.childNodes):null,o,!r&&n?n:s?s.__e:t.firstChild,r),_s(o,e)}ft=ms.slice,L={__e:function(e,t){for(var n,r,s;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&r.getDerivedStateFromError!=null&&(n.setState(r.getDerivedStateFromError(e)),s=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e),s=n.__d),s)return n.__E=n}catch(o){e=o}throw e}},ps=0,de.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=me({},this.state),typeof e=="function"&&(e=e(me({},n),this.props)),e&&me(n,e),e!=null&&this.__v&&(t&&this.__h.push(t),yn(this))},de.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),yn(this))},de.prototype.render=we,Ie=[],hs=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,nt.__r=0;var Ni=0;function x(e,t,n,r,s){var o,i,a={};for(i in t)i=="ref"?o=t[i]:a[i]=t[i];var l={type:e,props:a,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--Ni,__source:r,__self:s};if(typeof e=="function"&&(o=e.defaultProps))for(i in o)a[i]===void 0&&(a[i]=o[i]);return L.vnode&&L.vnode(l),l}function Ai(e,t){try{window.localStorage[`emoji-mart.${e}`]=JSON.stringify(t)}catch{}}function Ii(e){try{const t=window.localStorage[`emoji-mart.${e}`];if(t)return JSON.parse(t)}catch{}}var ge={set:Ai,get:Ii};const yt=new Map,Oi=[{v:15,emoji:"🫨"},{v:14,emoji:"🫠"},{v:13.1,emoji:"😶‍🌫️"},{v:13,emoji:"🥸"},{v:12.1,emoji:"🧑‍🦰"},{v:12,emoji:"🥱"},{v:11,emoji:"🥰"},{v:5,emoji:"🤩"},{v:4,emoji:"👱‍♀️"},{v:3,emoji:"🤣"},{v:2,emoji:"👋🏻"},{v:1,emoji:"🙃"}];function Di(){for(const{v:e,emoji:t}of Oi)if(Ss(t))return e}function Ui(){return!Ss("🇨🇦")}function Ss(e){if(yt.has(e))return yt.get(e);const t=Bi(e);return yt.set(e,t),t}const Bi=(()=>{let e=null;try{navigator.userAgent.includes("jsdom")||(e=document.createElement("canvas").getContext("2d",{willReadFrequently:!0}))}catch{}if(!e)return()=>!1;const t=25,n=20,r=Math.floor(t/2);return e.font=r+"px Arial, Sans-Serif",e.textBaseline="top",e.canvas.width=n*2,e.canvas.height=t,s=>{e.clearRect(0,0,n*2,t),e.fillStyle="#FF0000",e.fillText(s,0,22),e.fillStyle="#0000FF",e.fillText(s,n,22);const o=e.getImageData(0,0,n,t).data,i=o.length;let a=0;for(;a<i&&!o[a+3];a+=4);if(a>=i)return!1;const l=n+a/4%n,u=Math.floor(a/4/n),c=e.getImageData(l,u,1,1).data;return!(o[a]!==c[0]||o[a+2]!==c[2]||e.measureText(s).width>=n)}})();var kn={latestVersion:Di,noCountryFlags:Ui};const Mt=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart"];let Y=null;function Fi(e){Y||(Y=ge.get("frequently")||{});const t=e.id||e;t&&(Y[t]||(Y[t]=0),Y[t]+=1,ge.set("last",t),ge.set("frequently",Y))}function Hi({maxFrequentRows:e,perLine:t}){if(!e)return[];Y||(Y=ge.get("frequently"));let n=[];if(!Y){Y={};for(let o in Mt.slice(0,t)){const i=Mt[o];Y[i]=t-o,n.push(i)}return n}const r=e*t,s=ge.get("last");for(let o in Y)n.push(o);if(n.sort((o,i)=>{const a=Y[i],l=Y[o];return a==l?o.localeCompare(i):a-l}),n.length>r){const o=n.slice(r);n=n.slice(0,r);for(let i of o)i!=s&&delete Y[i];s&&n.indexOf(s)==-1&&(delete Y[n[n.length-1]],n.splice(-1,1,s)),ge.set("frequently",Y)}return n}var $s={add:Fi,get:Hi,DEFAULTS:Mt},Es={};Es=JSON.parse('{"search":"Search","search_no_results_1":"Oh no!","search_no_results_2":"That emoji couldn’t be found","pick":"Pick an emoji…","add_custom":"Add custom emoji","categories":{"activity":"Activity","custom":"Custom","flags":"Flags","foods":"Food & Drink","frequent":"Frequently used","nature":"Animals & Nature","objects":"Objects","people":"Smileys & People","places":"Travel & Places","search":"Search Results","symbols":"Symbols"},"skins":{"1":"Default","2":"Light","3":"Medium-Light","4":"Medium","5":"Medium-Dark","6":"Dark","choose":"Choose default skin tone"}}');var he={autoFocus:{value:!1},dynamicWidth:{value:!1},emojiButtonColors:{value:null},emojiButtonRadius:{value:"100%"},emojiButtonSize:{value:36},emojiSize:{value:24},emojiVersion:{value:15,choices:[1,2,3,4,5,11,12,12.1,13,13.1,14,15]},exceptEmojis:{value:[]},icons:{value:"auto",choices:["auto","outline","solid"]},locale:{value:"en",choices:["en","ar","be","cs","de","es","fa","fi","fr","hi","it","ja","ko","nl","pl","pt","ru","sa","tr","uk","vi","zh"]},maxFrequentRows:{value:4},navPosition:{value:"top",choices:["top","bottom","none"]},noCountryFlags:{value:!1},noResultsEmoji:{value:null},perLine:{value:9},previewEmoji:{value:null},previewPosition:{value:"bottom",choices:["top","bottom","none"]},searchPosition:{value:"sticky",choices:["sticky","static","none"]},set:{value:"native",choices:["native","apple","facebook","google","twitter"]},skin:{value:1,choices:[1,2,3,4,5,6]},skinTonePosition:{value:"preview",choices:["preview","search","none"]},theme:{value:"auto",choices:["auto","light","dark"]},categories:null,categoryIcons:null,custom:null,data:null,i18n:null,getImageURL:null,getSpritesheetURL:null,onAddCustomEmoji:null,onClickOutside:null,onEmojiSelect:null,stickySearch:{deprecated:!0,value:!0}};let Q=null,U=null;const xt={};async function Cn(e){if(xt[e])return xt[e];const n=await(await fetch(e)).json();return xt[e]=n,n}let _t=null,js=null,Rs=!1;function pt(e,{caller:t}={}){return _t||(_t=new Promise(n=>{js=n})),e?qi(e):t&&!Rs&&console.warn(`\`${t}\` requires data to be initialized first. Promise will be pending until \`init\` is called.`),_t}async function qi(e){Rs=!0;let{emojiVersion:t,set:n,locale:r}=e;if(t||(t=he.emojiVersion.value),n||(n=he.set.value),r||(r=he.locale.value),U)U.categories=U.categories.filter(l=>!l.name);else{U=(typeof e.data=="function"?await e.data():e.data)||await Cn(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/sets/${t}/${n}.json`),U.emoticons={},U.natives={},U.categories.unshift({id:"frequent",emojis:[]});for(const l in U.aliases){const u=U.aliases[l],c=U.emojis[u];c&&(c.aliases||(c.aliases=[]),c.aliases.push(l))}U.originalCategories=U.categories}if(Q=(typeof e.i18n=="function"?await e.i18n():e.i18n)||(r=="en"?fs(Es):await Cn(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/i18n/${r}.json`)),e.custom)for(let l in e.custom){l=parseInt(l);const u=e.custom[l],c=e.custom[l-1];if(!(!u.emojis||!u.emojis.length)){u.id||(u.id=`custom_${l+1}`),u.name||(u.name=Q.categories.custom),c&&!u.icon&&(u.target=c.target||c),U.categories.push(u);for(const p of u.emojis)U.emojis[p.id]=p}}e.categories&&(U.categories=U.originalCategories.filter(l=>e.categories.indexOf(l.id)!=-1).sort((l,u)=>{const c=e.categories.indexOf(l.id),p=e.categories.indexOf(u.id);return c-p}));let s=null,o=null;n=="native"&&(s=kn.latestVersion(),o=e.noCountryFlags||kn.noCountryFlags());let i=U.categories.length,a=!1;for(;i--;){const l=U.categories[i];if(l.id=="frequent"){let{maxFrequentRows:p,perLine:f}=e;p=p>=0?p:he.maxFrequentRows.value,f||(f=he.perLine.value),l.emojis=$s.get({maxFrequentRows:p,perLine:f})}if(!l.emojis||!l.emojis.length){U.categories.splice(i,1);continue}const{categoryIcons:u}=e;if(u){const p=u[l.id];p&&!l.icon&&(l.icon=p)}let c=l.emojis.length;for(;c--;){const p=l.emojis[c],f=p.id?p:U.emojis[p],b=()=>{l.emojis.splice(c,1)};if(!f||e.exceptEmojis&&e.exceptEmojis.includes(f.id)){b();continue}if(s&&f.version>s){b();continue}if(o&&l.id=="flags"&&!Ki.includes(f.id)){b();continue}if(!f.search){if(a=!0,f.search=","+[[f.id,!1],[f.name,!0],[f.keywords,!1],[f.emoticons,!1]].map(([y,g])=>{if(y)return(Array.isArray(y)?y:[y]).map(_=>(g?_.split(/[-|_|\s]+/):[_]).map(C=>C.toLowerCase())).flat()}).flat().filter(y=>y&&y.trim()).join(","),f.emoticons)for(const y of f.emoticons)U.emoticons[y]||(U.emoticons[y]=f.id);let d=0;for(const y of f.skins){if(!y)continue;d++;const{native:g}=y;g&&(U.natives[g]=f.id,f.search+=`,${g}`);const _=d==1?"":`:skin-tone-${d}:`;y.shortcodes=`:${f.id}:${_}`}}}}a&&xe.reset(),js()}function Ts(e,t,n){e||(e={});const r={};for(let s in t)r[s]=Ms(s,e,t,n);return r}function Ms(e,t,n,r){const s=n[e];let o=r&&r.getAttribute(e)||(t[e]!=null&&t[e]!=null?t[e]:null);return s&&(o!=null&&s.value&&typeof s.value!=typeof o&&(typeof s.value=="boolean"?o=o!="false":o=s.value.constructor(o)),s.transform&&o&&(o=s.transform(o)),(o==null||s.choices&&s.choices.indexOf(o)==-1)&&(o=s.value)),o}const Vi=/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/;let Lt=null;function Wi(e){return e.id?e:U.emojis[e]||U.emojis[U.aliases[e]]||U.emojis[U.natives[e]]}function Xi(){Lt=null}async function Ji(e,{maxResults:t,caller:n}={}){if(!e||!e.trim().length)return null;t||(t=90),await pt(null,{caller:n||"SearchIndex.search"});const r=e.toLowerCase().replace(/(\w)-/,"$1 ").split(/[\s|,]+/).filter((a,l,u)=>a.trim()&&u.indexOf(a)==l);if(!r.length)return;let s=Lt||(Lt=Object.values(U.emojis)),o,i;for(const a of r){if(!s.length)break;o=[],i={};for(const l of s){if(!l.search)continue;const u=l.search.indexOf(`,${a}`);u!=-1&&(o.push(l),i[l.id]||(i[l.id]=0),i[l.id]+=l.id==a?0:u+1)}s=o}return o.length<2||(o.sort((a,l)=>{const u=i[a.id],c=i[l.id];return u==c?a.id.localeCompare(l.id):u-c}),o.length>t&&(o=o.slice(0,t))),o}var xe={search:Ji,get:Wi,reset:Xi,SHORTCODES_REGEX:Vi};const Ki=["checkered_flag","crossed_flags","pirate_flag","rainbow-flag","transgender_flag","triangular_flag_on_post","waving_black_flag","waving_white_flag"];function Gi(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((n,r)=>n==t[r])}async function Yi(e=1){for(let t in[...Array(e).keys()])await new Promise(requestAnimationFrame)}function Zi(e,{skinIndex:t=0}={}){const n=e.skins[t]||(t=0,e.skins[t]),r={id:e.id,name:e.name,native:n.native,unified:n.unified,keywords:e.keywords,shortcodes:n.shortcodes||e.shortcodes};return e.skins.length>1&&(r.skin=t+1),n.src&&(r.src=n.src),e.aliases&&e.aliases.length&&(r.aliases=e.aliases),e.emoticons&&e.emoticons.length&&(r.emoticons=e.emoticons),r}const Qi={activity:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:x("path",{d:"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113"})}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:x("path",{d:"M16.17 337.5c0 44.98 7.565 83.54 13.98 107.9C35.22 464.3 50.46 496 174.9 496c9.566 0 19.59-.4707 29.84-1.271L17.33 307.3C16.53 317.6 16.17 327.7 16.17 337.5zM495.8 174.5c0-44.98-7.565-83.53-13.98-107.9c-4.688-17.54-18.34-31.23-36.04-35.95C435.5 27.91 392.9 16 337 16c-9.564 0-19.59 .4707-29.84 1.271l187.5 187.5C495.5 194.4 495.8 184.3 495.8 174.5zM26.77 248.8l236.3 236.3c142-36.1 203.9-150.4 222.2-221.1L248.9 26.87C106.9 62.96 45.07 177.2 26.77 248.8zM256 335.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L164.7 283.3C161.6 280.2 160 276.1 160 271.1c0-8.529 6.865-16 16-16c4.095 0 8.189 1.562 11.31 4.688l64.01 64C254.4 327.8 256 331.9 256 335.1zM304 287.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L212.7 235.3C209.6 232.2 208 228.1 208 223.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01C302.5 279.8 304 283.9 304 287.1zM256 175.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01c3.125 3.125 4.688 7.219 4.688 11.31c0 9.133-7.468 16-16 16c-4.094 0-8.189-1.562-11.31-4.688l-64.01-64.01C257.6 184.2 256 180.1 256 175.1z"})})},custom:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:x("path",{d:"M417.1 368c-5.937 10.27-16.69 16-27.75 16c-5.422 0-10.92-1.375-15.97-4.281L256 311.4V448c0 17.67-14.33 32-31.1 32S192 465.7 192 448V311.4l-118.3 68.29C68.67 382.6 63.17 384 57.75 384c-11.06 0-21.81-5.734-27.75-16c-8.828-15.31-3.594-34.88 11.72-43.72L159.1 256L41.72 187.7C26.41 178.9 21.17 159.3 29.1 144C36.63 132.5 49.26 126.7 61.65 128.2C65.78 128.7 69.88 130.1 73.72 132.3L192 200.6V64c0-17.67 14.33-32 32-32S256 46.33 256 64v136.6l118.3-68.29c3.838-2.213 7.939-3.539 12.07-4.051C398.7 126.7 411.4 132.5 417.1 144c8.828 15.31 3.594 34.88-11.72 43.72L288 256l118.3 68.28C421.6 333.1 426.8 352.7 417.1 368z"})}),flags:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:x("path",{d:"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z"})}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:x("path",{d:"M64 496C64 504.8 56.75 512 48 512h-32C7.25 512 0 504.8 0 496V32c0-17.75 14.25-32 32-32s32 14.25 32 32V496zM476.3 0c-6.365 0-13.01 1.35-19.34 4.233c-45.69 20.86-79.56 27.94-107.8 27.94c-59.96 0-94.81-31.86-163.9-31.87C160.9 .3055 131.6 4.867 96 15.75v350.5c32-9.984 59.87-14.1 84.85-14.1c73.63 0 124.9 31.78 198.6 31.78c31.91 0 68.02-5.971 111.1-23.09C504.1 355.9 512 344.4 512 332.1V30.73C512 11.1 495.3 0 476.3 0z"})})},foods:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:x("path",{d:"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9"})}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:x("path",{d:"M481.9 270.1C490.9 279.1 496 291.3 496 304C496 316.7 490.9 328.9 481.9 337.9C472.9 346.9 460.7 352 448 352H64C51.27 352 39.06 346.9 30.06 337.9C21.06 328.9 16 316.7 16 304C16 291.3 21.06 279.1 30.06 270.1C39.06 261.1 51.27 256 64 256H448C460.7 256 472.9 261.1 481.9 270.1zM475.3 388.7C478.3 391.7 480 395.8 480 400V416C480 432.1 473.3 449.3 461.3 461.3C449.3 473.3 432.1 480 416 480H96C79.03 480 62.75 473.3 50.75 461.3C38.74 449.3 32 432.1 32 416V400C32 395.8 33.69 391.7 36.69 388.7C39.69 385.7 43.76 384 48 384H464C468.2 384 472.3 385.7 475.3 388.7zM50.39 220.8C45.93 218.6 42.03 215.5 38.97 211.6C35.91 207.7 33.79 203.2 32.75 198.4C31.71 193.5 31.8 188.5 32.99 183.7C54.98 97.02 146.5 32 256 32C365.5 32 457 97.02 479 183.7C480.2 188.5 480.3 193.5 479.2 198.4C478.2 203.2 476.1 207.7 473 211.6C469.1 215.5 466.1 218.6 461.6 220.8C457.2 222.9 452.3 224 447.3 224H64.67C59.73 224 54.84 222.9 50.39 220.8zM372.7 116.7C369.7 119.7 368 123.8 368 128C368 131.2 368.9 134.3 370.7 136.9C372.5 139.5 374.1 141.6 377.9 142.8C380.8 143.1 384 144.3 387.1 143.7C390.2 143.1 393.1 141.6 395.3 139.3C397.6 137.1 399.1 134.2 399.7 131.1C400.3 128 399.1 124.8 398.8 121.9C397.6 118.1 395.5 116.5 392.9 114.7C390.3 112.9 387.2 111.1 384 111.1C379.8 111.1 375.7 113.7 372.7 116.7V116.7zM244.7 84.69C241.7 87.69 240 91.76 240 96C240 99.16 240.9 102.3 242.7 104.9C244.5 107.5 246.1 109.6 249.9 110.8C252.8 111.1 256 112.3 259.1 111.7C262.2 111.1 265.1 109.6 267.3 107.3C269.6 105.1 271.1 102.2 271.7 99.12C272.3 96.02 271.1 92.8 270.8 89.88C269.6 86.95 267.5 84.45 264.9 82.7C262.3 80.94 259.2 79.1 256 79.1C251.8 79.1 247.7 81.69 244.7 84.69V84.69zM116.7 116.7C113.7 119.7 112 123.8 112 128C112 131.2 112.9 134.3 114.7 136.9C116.5 139.5 118.1 141.6 121.9 142.8C124.8 143.1 128 144.3 131.1 143.7C134.2 143.1 137.1 141.6 139.3 139.3C141.6 137.1 143.1 134.2 143.7 131.1C144.3 128 143.1 124.8 142.8 121.9C141.6 118.1 139.5 116.5 136.9 114.7C134.3 112.9 131.2 111.1 128 111.1C123.8 111.1 119.7 113.7 116.7 116.7L116.7 116.7z"})})},frequent:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[x("path",{d:"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"}),x("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"})]}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:x("path",{d:"M256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512zM232 256C232 264 236 271.5 242.7 275.1L338.7 339.1C349.7 347.3 364.6 344.3 371.1 333.3C379.3 322.3 376.3 307.4 365.3 300L280 243.2V120C280 106.7 269.3 96 255.1 96C242.7 96 231.1 106.7 231.1 120L232 256z"})})},nature:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[x("path",{d:"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8"}),x("path",{d:"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235"})]}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:x("path",{d:"M332.7 19.85C334.6 8.395 344.5 0 356.1 0C363.6 0 370.6 3.52 375.1 9.502L392 32H444.1C456.8 32 469.1 37.06 478.1 46.06L496 64H552C565.3 64 576 74.75 576 88V112C576 156.2 540.2 192 496 192H426.7L421.6 222.5L309.6 158.5L332.7 19.85zM448 64C439.2 64 432 71.16 432 80C432 88.84 439.2 96 448 96C456.8 96 464 88.84 464 80C464 71.16 456.8 64 448 64zM416 256.1V480C416 497.7 401.7 512 384 512H352C334.3 512 320 497.7 320 480V364.8C295.1 377.1 268.8 384 240 384C211.2 384 184 377.1 160 364.8V480C160 497.7 145.7 512 128 512H96C78.33 512 64 497.7 64 480V249.8C35.23 238.9 12.64 214.5 4.836 183.3L.9558 167.8C-3.331 150.6 7.094 133.2 24.24 128.1C41.38 124.7 58.76 135.1 63.05 152.2L66.93 167.8C70.49 182 83.29 191.1 97.97 191.1H303.8L416 256.1z"})})},objects:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[x("path",{d:"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z"}),x("path",{d:"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789"})]}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:x("path",{d:"M112.1 454.3c0 6.297 1.816 12.44 5.284 17.69l17.14 25.69c5.25 7.875 17.17 14.28 26.64 14.28h61.67c9.438 0 21.36-6.401 26.61-14.28l17.08-25.68c2.938-4.438 5.348-12.37 5.348-17.7L272 415.1h-160L112.1 454.3zM191.4 .0132C89.44 .3257 16 82.97 16 175.1c0 44.38 16.44 84.84 43.56 115.8c16.53 18.84 42.34 58.23 52.22 91.45c.0313 .25 .0938 .5166 .125 .7823h160.2c.0313-.2656 .0938-.5166 .125-.7823c9.875-33.22 35.69-72.61 52.22-91.45C351.6 260.8 368 220.4 368 175.1C368 78.61 288.9-.2837 191.4 .0132zM192 96.01c-44.13 0-80 35.89-80 79.1C112 184.8 104.8 192 96 192S80 184.8 80 176c0-61.76 50.25-111.1 112-111.1c8.844 0 16 7.159 16 16S200.8 96.01 192 96.01z"})})},people:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[x("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}),x("path",{d:"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0"})]}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:x("path",{d:"M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256 432C332.1 432 396.2 382 415.2 314.1C419.1 300.4 407.8 288 393.6 288H118.4C104.2 288 92.92 300.4 96.76 314.1C115.8 382 179.9 432 256 432V432zM176.4 160C158.7 160 144.4 174.3 144.4 192C144.4 209.7 158.7 224 176.4 224C194 224 208.4 209.7 208.4 192C208.4 174.3 194 160 176.4 160zM336.4 224C354 224 368.4 209.7 368.4 192C368.4 174.3 354 160 336.4 160C318.7 160 304.4 174.3 304.4 192C304.4 209.7 318.7 224 336.4 224z"})})},places:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[x("path",{d:"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5"}),x("path",{d:"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z"})]}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:x("path",{d:"M39.61 196.8L74.8 96.29C88.27 57.78 124.6 32 165.4 32H346.6C387.4 32 423.7 57.78 437.2 96.29L472.4 196.8C495.6 206.4 512 229.3 512 256V448C512 465.7 497.7 480 480 480H448C430.3 480 416 465.7 416 448V400H96V448C96 465.7 81.67 480 64 480H32C14.33 480 0 465.7 0 448V256C0 229.3 16.36 206.4 39.61 196.8V196.8zM109.1 192H402.9L376.8 117.4C372.3 104.6 360.2 96 346.6 96H165.4C151.8 96 139.7 104.6 135.2 117.4L109.1 192zM96 256C78.33 256 64 270.3 64 288C64 305.7 78.33 320 96 320C113.7 320 128 305.7 128 288C128 270.3 113.7 256 96 256zM416 320C433.7 320 448 305.7 448 288C448 270.3 433.7 256 416 256C398.3 256 384 270.3 384 288C384 305.7 398.3 320 416 320z"})})},symbols:{outline:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:x("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76"})}),solid:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:x("path",{d:"M500.3 7.251C507.7 13.33 512 22.41 512 31.1V175.1C512 202.5 483.3 223.1 447.1 223.1C412.7 223.1 383.1 202.5 383.1 175.1C383.1 149.5 412.7 127.1 447.1 127.1V71.03L351.1 90.23V207.1C351.1 234.5 323.3 255.1 287.1 255.1C252.7 255.1 223.1 234.5 223.1 207.1C223.1 181.5 252.7 159.1 287.1 159.1V63.1C287.1 48.74 298.8 35.61 313.7 32.62L473.7 .6198C483.1-1.261 492.9 1.173 500.3 7.251H500.3zM74.66 303.1L86.5 286.2C92.43 277.3 102.4 271.1 113.1 271.1H174.9C185.6 271.1 195.6 277.3 201.5 286.2L213.3 303.1H239.1C266.5 303.1 287.1 325.5 287.1 351.1V463.1C287.1 490.5 266.5 511.1 239.1 511.1H47.1C21.49 511.1-.0019 490.5-.0019 463.1V351.1C-.0019 325.5 21.49 303.1 47.1 303.1H74.66zM143.1 359.1C117.5 359.1 95.1 381.5 95.1 407.1C95.1 434.5 117.5 455.1 143.1 455.1C170.5 455.1 191.1 434.5 191.1 407.1C191.1 381.5 170.5 359.1 143.1 359.1zM440.3 367.1H496C502.7 367.1 508.6 372.1 510.1 378.4C513.3 384.6 511.6 391.7 506.5 396L378.5 508C372.9 512.1 364.6 513.3 358.6 508.9C352.6 504.6 350.3 496.6 353.3 489.7L391.7 399.1H336C329.3 399.1 323.4 395.9 321 389.6C318.7 383.4 320.4 376.3 325.5 371.1L453.5 259.1C459.1 255 467.4 254.7 473.4 259.1C479.4 263.4 481.6 271.4 478.7 278.3L440.3 367.1zM116.7 219.1L19.85 119.2C-8.112 90.26-6.614 42.31 24.85 15.34C51.82-8.137 93.26-3.642 118.2 21.83L128.2 32.32L137.7 21.83C162.7-3.642 203.6-8.137 231.6 15.34C262.6 42.31 264.1 90.26 236.1 119.2L139.7 219.1C133.2 225.6 122.7 225.6 116.7 219.1H116.7z"})})}},ea={loupe:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:x("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"})}),delete:x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:x("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"})})};var ot={categories:Qi,search:ea};function Pt(e){let{id:t,skin:n,emoji:r}=e;if(e.shortcodes){const a=e.shortcodes.match(xe.SHORTCODES_REGEX);a&&(t=a[1],a[2]&&(n=a[2]))}if(r||(r=xe.get(t||e.native)),!r)return e.fallback;const s=r.skins[n-1]||r.skins[0],o=s.src||(e.set!="native"&&!e.spritesheet?typeof e.getImageURL=="function"?e.getImageURL(e.set,s.unified):`https://cdn.jsdelivr.net/npm/emoji-datasource-${e.set}@15.0.1/img/${e.set}/64/${s.unified}.png`:void 0),i=typeof e.getSpritesheetURL=="function"?e.getSpritesheetURL(e.set):`https://cdn.jsdelivr.net/npm/emoji-datasource-${e.set}@15.0.1/img/${e.set}/sheets-256/64.png`;return x("span",{class:"emoji-mart-emoji","data-emoji-set":e.set,children:o?x("img",{style:{maxWidth:e.size||"1em",maxHeight:e.size||"1em",display:"inline-block"},alt:s.native||s.shortcodes,src:o}):e.set=="native"?x("span",{style:{fontSize:e.size,fontFamily:'"EmojiMart", "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "Android Emoji"'},children:s.native}):x("span",{style:{display:"block",width:e.size,height:e.size,backgroundImage:`url(${i})`,backgroundSize:`${100*U.sheet.cols}% ${100*U.sheet.rows}%`,backgroundPosition:`${100/(U.sheet.cols-1)*s.x}% ${100/(U.sheet.rows-1)*s.y}%`}})})}const ta=typeof window<"u"&&window.HTMLElement?window.HTMLElement:Object;class Ls extends ta{static get observedAttributes(){return Object.keys(this.Props)}update(t={}){for(let n in t)this.attributeChangedCallback(n,null,t[n])}attributeChangedCallback(t,n,r){if(!this.component)return;const s=Ms(t,{[t]:r},this.constructor.Props,this);this.component.componentWillReceiveProps?this.component.componentWillReceiveProps({[t]:s}):(this.component.props[t]=s,this.component.forceUpdate())}disconnectedCallback(){this.disconnected=!0,this.component&&this.component.unregister&&this.component.unregister()}constructor(t={}){if(super(),this.props=t,t.parent||t.ref){let n=null;const r=t.parent||(n=t.ref&&t.ref.current);n&&(n.innerHTML=""),r&&r.appendChild(this)}}}class na extends Ls{setShadow(){this.attachShadow({mode:"open"})}injectStyles(t){if(!t)return;const n=document.createElement("style");n.textContent=t,this.shadowRoot.insertBefore(n,this.shadowRoot.firstChild)}constructor(t,{styles:n}={}){super(t),this.setShadow(),this.injectStyles(n)}}var Ps={fallback:"",id:"",native:"",shortcodes:"",size:{value:"",transform:e=>/\D/.test(e)?e:`${e}px`},set:he.set,skin:he.skin};class zs extends Ls{async connectedCallback(){const t=Ts(this.props,Ps,this);t.element=this,t.ref=n=>{this.component=n},await pt(),!this.disconnected&&Cs(x(Pt,{...t}),this)}constructor(t){super(t)}}ae(zs,"Props",Ps);typeof customElements<"u"&&!customElements.get("em-emoji")&&customElements.define("em-emoji",zs);var Sn,zt=[],$n=L.__b,En=L.__r,jn=L.diffed,Rn=L.__c,Tn=L.unmount;function ra(){var e;for(zt.sort(function(t,n){return t.__v.__b-n.__v.__b});e=zt.pop();)if(e.__P)try{e.__H.__h.forEach(Ze),e.__H.__h.forEach(Nt),e.__H.__h=[]}catch(t){e.__H.__h=[],L.__e(t,e.__v)}}L.__b=function(e){$n&&$n(e)},L.__r=function(e){En&&En(e);var t=e.__c.__H;t&&(t.__h.forEach(Ze),t.__h.forEach(Nt),t.__h=[])},L.diffed=function(e){jn&&jn(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(zt.push(t)!==1&&Sn===L.requestAnimationFrame||((Sn=L.requestAnimationFrame)||function(n){var r,s=function(){clearTimeout(o),Mn&&cancelAnimationFrame(r),setTimeout(n)},o=setTimeout(s,100);Mn&&(r=requestAnimationFrame(s))})(ra))},L.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Ze),n.__h=n.__h.filter(function(r){return!r.__||Nt(r)})}catch(r){t.some(function(s){s.__h&&(s.__h=[])}),t=[],L.__e(r,n.__v)}}),Rn&&Rn(e,t)},L.unmount=function(e){Tn&&Tn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Ze(r)}catch(s){t=s}}),t&&L.__e(t,n.__v))};var Mn=typeof requestAnimationFrame=="function";function Ze(e){var t=e.__c;typeof t=="function"&&(e.__c=void 0,t())}function Nt(e){e.__c=e.__()}function sa(e,t){for(var n in t)e[n]=t[n];return e}function Ln(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function it(e){this.props=e}(it.prototype=new de).isPureReactComponent=!0,it.prototype.shouldComponentUpdate=function(e,t){return Ln(this.props,e)||Ln(this.state,t)};var Pn=L.__b;L.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Pn&&Pn(e)};var oa=L.__e;L.__e=function(e,t,n){if(e.then){for(var r,s=t;s=s.__;)if((r=s.__c)&&r.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}oa(e,t,n)};var zn=L.unmount;function wt(){this.__u=0,this.t=null,this.__b=null}function Ns(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function Ve(){this.u=null,this.o=null}L.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),zn&&zn(e)},(wt.prototype=new de).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var s=Ns(r.__v),o=!1,i=function(){o||(o=!0,n.__R=null,s?s(a):a())};n.__R=i;var a=function(){if(!--r.__u){if(r.state.__e){var u=r.state.__e;r.__v.__k[0]=(function p(f,b,d){return f&&(f.__v=null,f.__k=f.__k&&f.__k.map(function(y){return p(y,b,d)}),f.__c&&f.__c.__P===b&&(f.__e&&d.insertBefore(f.__e,f.__d),f.__c.__e=!0,f.__c.__P=d)),f})(u,u.__c.__P,u.__c.__O)}var c;for(r.setState({__e:r.__b=null});c=r.t.pop();)c.forceUpdate()}},l=t.__h===!0;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(i,i)},wt.prototype.componentWillUnmount=function(){this.t=[]},wt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=(function o(i,a,l){return i&&(i.__c&&i.__c.__H&&(i.__c.__H.__.forEach(function(u){typeof u.__c=="function"&&u.__c()}),i.__c.__H=null),(i=sa({},i)).__c!=null&&(i.__c.__P===l&&(i.__c.__P=a),i.__c=null),i.__k=i.__k&&i.__k.map(function(u){return o(u,a,l)})),i})(this.__b,n,r.__O=r.__P)}this.__b=null}var s=t.__e&&Tt(we,null,e.fallback);return s&&(s.__h=null),[Tt(we,null,t.__e?null:e.children),s]};var Nn=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};(Ve.prototype=new de).__e=function(e){var t=this,n=Ns(t.__v),r=t.o.get(e);return r[0]++,function(s){var o=function(){t.props.revealOrder?(r.push(s),Nn(t,e,r)):s()};n?n(o):o()}},Ve.prototype.render=function(e){this.u=null,this.o=new Map;var t=rt(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Ve.prototype.componentDidUpdate=Ve.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){Nn(e,n,t)})};var ia=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,aa=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,ca=typeof document<"u",la=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(e)};de.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(de.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var An=L.event;function ua(){}function da(){return this.cancelBubble}function fa(){return this.defaultPrevented}L.event=function(e){return An&&(e=An(e)),e.persist=ua,e.isPropagationStopped=da,e.isDefaultPrevented=fa,e.nativeEvent=e};var In={configurable:!0,get:function(){return this.class}},On=L.vnode;L.vnode=function(e){var t=e.type,n=e.props,r=n;if(typeof t=="string"){var s=t.indexOf("-")===-1;for(var o in r={},n){var i=n[o];ca&&o==="children"&&t==="noscript"||o==="value"&&"defaultValue"in n&&i==null||(o==="defaultValue"&&"value"in n&&n.value==null?o="value":o==="download"&&i===!0?i="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!la(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():s&&aa.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():i===null&&(i=void 0),r[o]=i)}t=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=rt(n.children).forEach(function(a){a.props.selected=r.value.indexOf(a.props.value)!=-1})),t=="select"&&r.defaultValue!=null&&(r.value=rt(n.children).forEach(function(a){a.props.selected=r.multiple?r.defaultValue.indexOf(a.props.value)!=-1:r.defaultValue==a.props.value})),e.props=r,n.class!=n.className&&(In.enumerable="className"in n,n.className!=null&&(r.class=n.className),Object.defineProperty(r,"className",In))}e.$$typeof=ia,On&&On(e)};var Dn=L.__r;L.__r=function(e){Dn&&Dn(e),e.__c};const pa={light:"outline",dark:"solid"};class ha extends it{renderIcon(t){const{icon:n}=t;if(n){if(n.svg)return x("span",{class:"flex",dangerouslySetInnerHTML:{__html:n.svg}});if(n.src)return x("img",{src:n.src})}const r=ot.categories[t.id]||ot.categories.custom,s=this.props.icons=="auto"?pa[this.props.theme]:this.props.icons;return r[s]||r}render(){let t=null;return x("nav",{id:"nav",class:"padding","data-position":this.props.position,dir:this.props.dir,children:x("div",{class:"flex relative",children:[this.categories.map((n,r)=>{const s=n.name||Q.categories[n.id],o=!this.props.unfocused&&n.id==this.state.categoryId;return o&&(t=r),x("button",{"aria-label":s,"aria-selected":o||void 0,title:s,type:"button",class:"flex flex-grow flex-center",onMouseDown:i=>i.preventDefault(),onClick:()=>{this.props.onClick({category:n,i:r})},children:this.renderIcon(n)})}),x("div",{class:"bar",style:{width:`${100/this.categories.length}%`,opacity:t==null?0:1,transform:this.props.dir==="rtl"?`scaleX(-1) translateX(${t*100}%)`:`translateX(${t*100}%)`}})]})})}constructor(){super(),this.categories=U.categories.filter(t=>!t.target),this.state={categoryId:this.categories[0].id}}}class ma extends it{shouldComponentUpdate(t){for(let n in t)if(n!="children"&&t[n]!=this.props[n])return!0;return!1}render(){return this.props.children}}const We={rowsPerRender:10};class ga extends de{getInitialState(t=this.props){return{skin:ge.get("skin")||t.skin,theme:this.initTheme(t.theme)}}componentWillMount(){this.dir=Q.rtl?"rtl":"ltr",this.refs={menu:pe(),navigation:pe(),scroll:pe(),search:pe(),searchInput:pe(),skinToneButton:pe(),skinToneRadio:pe()},this.initGrid(),this.props.stickySearch==!1&&this.props.searchPosition=="sticky"&&(console.warn("[EmojiMart] Deprecation warning: `stickySearch` has been renamed `searchPosition`."),this.props.searchPosition="static")}componentDidMount(){if(this.register(),this.shadowRoot=this.base.parentNode,this.props.autoFocus){const{searchInput:t}=this.refs;t.current&&t.current.focus()}}componentWillReceiveProps(t){this.nextState||(this.nextState={});for(const n in t)this.nextState[n]=t[n];clearTimeout(this.nextStateTimer),this.nextStateTimer=setTimeout(()=>{let n=!1;for(const s in this.nextState)this.props[s]=this.nextState[s],(s==="custom"||s==="categories")&&(n=!0);delete this.nextState;const r=this.getInitialState();if(n)return this.reset(r);this.setState(r)})}componentWillUnmount(){this.unregister()}async reset(t={}){await pt(this.props),this.initGrid(),this.unobserve(),this.setState(t,()=>{this.observeCategories(),this.observeRows()})}register(){document.addEventListener("click",this.handleClickOutside),this.observe()}unregister(){var t;document.removeEventListener("click",this.handleClickOutside),(t=this.darkMedia)==null||t.removeEventListener("change",this.darkMediaCallback),this.unobserve()}observe(){this.observeCategories(),this.observeRows()}unobserve({except:t=[]}={}){Array.isArray(t)||(t=[t]);for(const n of this.observers)t.includes(n)||n.disconnect();this.observers=[].concat(t)}initGrid(){const{categories:t}=U;this.refs.categories=new Map;const n=U.categories.map(s=>s.id).join(",");this.navKey&&this.navKey!=n&&this.refs.scroll.current&&(this.refs.scroll.current.scrollTop=0),this.navKey=n,this.grid=[],this.grid.setsize=0;const r=(s,o)=>{const i=[];i.__categoryId=o.id,i.__index=s.length,this.grid.push(i);const a=this.grid.length-1,l=a%We.rowsPerRender?{}:pe();return l.index=a,l.posinset=this.grid.setsize+1,s.push(l),i};for(let s of t){const o=[];let i=r(o,s);for(let a of s.emojis)i.length==this.getPerLine()&&(i=r(o,s)),this.grid.setsize+=1,i.push(a);this.refs.categories.set(s.id,{root:pe(),rows:o})}}initTheme(t){if(t!="auto")return t;if(!this.darkMedia){if(this.darkMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMedia.media.match(/^not/))return"light";this.darkMedia.addEventListener("change",this.darkMediaCallback)}return this.darkMedia.matches?"dark":"light"}initDynamicPerLine(t=this.props){if(!t.dynamicWidth)return;const{element:n,emojiButtonSize:r}=t,s=()=>{const{width:i}=n.getBoundingClientRect();return Math.floor(i/r)},o=new ResizeObserver(()=>{this.unobserve({except:o}),this.setState({perLine:s()},()=>{this.initGrid(),this.forceUpdate(()=>{this.observeCategories(),this.observeRows()})})});return o.observe(n),this.observers.push(o),s()}getPerLine(){return this.state.perLine||this.props.perLine}getEmojiByPos([t,n]){const r=this.state.searchResults||this.grid,s=r[t]&&r[t][n];if(s)return xe.get(s)}observeCategories(){const t=this.refs.navigation.current;if(!t)return;const n=new Map,r=i=>{i!=t.state.categoryId&&t.setState({categoryId:i})},s={root:this.refs.scroll.current,threshold:[0,1]},o=new IntersectionObserver(i=>{for(const l of i){const u=l.target.dataset.id;n.set(u,l.intersectionRatio)}const a=[...n];for(const[l,u]of a)if(u){r(l);break}},s);for(const{root:i}of this.refs.categories.values())o.observe(i.current);this.observers.push(o)}observeRows(){const t={...this.state.visibleRows},n=new IntersectionObserver(r=>{for(const s of r){const o=parseInt(s.target.dataset.index);s.isIntersecting?t[o]=!0:delete t[o]}this.setState({visibleRows:t})},{root:this.refs.scroll.current,rootMargin:`${this.props.emojiButtonSize*(We.rowsPerRender+5)}px 0px ${this.props.emojiButtonSize*We.rowsPerRender}px`});for(const{rows:r}of this.refs.categories.values())for(const s of r)s.current&&n.observe(s.current);this.observers.push(n)}preventDefault(t){t.preventDefault()}unfocusSearch(){const t=this.refs.searchInput.current;t&&t.blur()}navigate({e:t,input:n,left:r,right:s,up:o,down:i}){const a=this.state.searchResults||this.grid;if(!a.length)return;let[l,u]=this.state.pos;const c=(()=>{if(l==0&&u==0&&!t.repeat&&(r||o))return null;if(l==-1)return!t.repeat&&(s||i)&&n.selectionStart==n.value.length?[0,0]:null;if(r||s){let p=a[l];const f=r?-1:1;if(u+=f,!p[u]){if(l+=f,p=a[l],!p)return l=r?0:a.length-1,u=r?0:a[l].length-1,[l,u];u=r?p.length-1:0}return[l,u]}if(o||i){l+=o?-1:1;const p=a[l];return p?(p[u]||(u=p.length-1),[l,u]):(l=o?0:a.length-1,u=o?0:a[l].length-1,[l,u])}})();if(c)t.preventDefault();else{this.state.pos[0]>-1&&this.setState({pos:[-1,-1]});return}this.setState({pos:c,keyboard:!0},()=>{this.scrollTo({row:c[0]})})}scrollTo({categoryId:t,row:n}){const r=this.state.searchResults||this.grid;if(!r.length)return;const s=this.refs.scroll.current,o=s.getBoundingClientRect();let i=0;if(n>=0&&(t=r[n].__categoryId),t&&(i=(this.refs[t]||this.refs.categories.get(t).root).current.getBoundingClientRect().top-(o.top-s.scrollTop)+1),n>=0)if(!n)i=0;else{const a=r[n].__index,l=i+a*this.props.emojiButtonSize,u=l+this.props.emojiButtonSize+this.props.emojiButtonSize*.88;if(l<s.scrollTop)i=l;else if(u>s.scrollTop+o.height)i=u-o.height;else return}this.ignoreMouse(),s.scrollTop=i}ignoreMouse(){this.mouseIsIgnored=!0,clearTimeout(this.ignoreMouseTimer),this.ignoreMouseTimer=setTimeout(()=>{delete this.mouseIsIgnored},100)}handleEmojiOver(t){this.mouseIsIgnored||this.state.showSkins||this.setState({pos:t||[-1,-1],keyboard:!1})}handleEmojiClick({e:t,emoji:n,pos:r}){if(this.props.onEmojiSelect&&(!n&&r&&(n=this.getEmojiByPos(r)),n)){const s=Zi(n,{skinIndex:this.state.skin-1});this.props.maxFrequentRows&&$s.add(s,this.props),this.props.onEmojiSelect(s,t)}}closeSkins(){this.state.showSkins&&(this.setState({showSkins:null,tempSkin:null}),this.base.removeEventListener("click",this.handleBaseClick),this.base.removeEventListener("keydown",this.handleBaseKeydown))}handleSkinMouseOver(t){this.setState({tempSkin:t})}handleSkinClick(t){this.ignoreMouse(),this.closeSkins(),this.setState({skin:t,tempSkin:null}),ge.set("skin",t)}renderNav(){return x(ha,{ref:this.refs.navigation,icons:this.props.icons,theme:this.state.theme,dir:this.dir,unfocused:!!this.state.searchResults,position:this.props.navPosition,onClick:this.handleCategoryClick},this.navKey)}renderPreview(){const t=this.getEmojiByPos(this.state.pos),n=this.state.searchResults&&!this.state.searchResults.length;return x("div",{id:"preview",class:"flex flex-middle",dir:this.dir,"data-position":this.props.previewPosition,children:[x("div",{class:"flex flex-middle flex-grow",children:[x("div",{class:"flex flex-auto flex-middle flex-center",style:{height:this.props.emojiButtonSize,fontSize:this.props.emojiButtonSize},children:x(Pt,{emoji:t,id:n?this.props.noResultsEmoji||"cry":this.props.previewEmoji||(this.props.previewPosition=="top"?"point_down":"point_up"),set:this.props.set,size:this.props.emojiButtonSize,skin:this.state.tempSkin||this.state.skin,spritesheet:!0,getSpritesheetURL:this.props.getSpritesheetURL})}),x("div",{class:`margin-${this.dir[0]}`,children:t||n?x("div",{class:`padding-${this.dir[2]} align-${this.dir[0]}`,children:[x("div",{class:"preview-title ellipsis",children:t?t.name:Q.search_no_results_1}),x("div",{class:"preview-subtitle ellipsis color-c",children:t?t.skins[0].shortcodes:Q.search_no_results_2})]}):x("div",{class:"preview-placeholder color-c",children:Q.pick})})]}),!t&&this.props.skinTonePosition=="preview"&&this.renderSkinToneButton()]})}renderEmojiButton(t,{pos:n,posinset:r,grid:s}){const o=this.props.emojiButtonSize,i=this.state.tempSkin||this.state.skin,l=(t.skins[i-1]||t.skins[0]).native,u=Gi(this.state.pos,n),c=n.concat(t.id).join("");return x(ma,{selected:u,skin:i,size:o,children:x("button",{"aria-label":l,"aria-selected":u||void 0,"aria-posinset":r,"aria-setsize":s.setsize,"data-keyboard":this.state.keyboard,title:this.props.previewPosition=="none"?t.name:void 0,type:"button",class:"flex flex-center flex-middle",tabindex:"-1",onClick:p=>this.handleEmojiClick({e:p,emoji:t}),onMouseEnter:()=>this.handleEmojiOver(n),onMouseLeave:()=>this.handleEmojiOver(),style:{width:this.props.emojiButtonSize,height:this.props.emojiButtonSize,fontSize:this.props.emojiSize,lineHeight:0},children:[x("div",{"aria-hidden":"true",class:"background",style:{borderRadius:this.props.emojiButtonRadius,backgroundColor:this.props.emojiButtonColors?this.props.emojiButtonColors[(r-1)%this.props.emojiButtonColors.length]:void 0}}),x(Pt,{emoji:t,set:this.props.set,size:this.props.emojiSize,skin:i,spritesheet:!0,getSpritesheetURL:this.props.getSpritesheetURL})]})},c)}renderSearch(){const t=this.props.previewPosition=="none"||this.props.skinTonePosition=="search";return x("div",{children:[x("div",{class:"spacer"}),x("div",{class:"flex flex-middle",children:[x("div",{class:"search relative flex-grow",children:[x("input",{type:"search",ref:this.refs.searchInput,placeholder:Q.search,onClick:this.handleSearchClick,onInput:this.handleSearchInput,onKeyDown:this.handleSearchKeyDown,autoComplete:"off"}),x("span",{class:"icon loupe flex",children:ot.search.loupe}),this.state.searchResults&&x("button",{title:"Clear","aria-label":"Clear",type:"button",class:"icon delete flex",onClick:this.clearSearch,onMouseDown:this.preventDefault,children:ot.search.delete})]}),t&&this.renderSkinToneButton()]})]})}renderSearchResults(){const{searchResults:t}=this.state;return t?x("div",{class:"category",ref:this.refs.search,children:[x("div",{class:`sticky padding-small align-${this.dir[0]}`,children:Q.categories.search}),x("div",{children:t.length?t.map((n,r)=>x("div",{class:"flex",children:n.map((s,o)=>this.renderEmojiButton(s,{pos:[r,o],posinset:r*this.props.perLine+o+1,grid:t}))})):x("div",{class:`padding-small align-${this.dir[0]}`,children:this.props.onAddCustomEmoji&&x("a",{onClick:this.props.onAddCustomEmoji,children:Q.add_custom})})})]}):null}renderCategories(){const{categories:t}=U,n=!!this.state.searchResults,r=this.getPerLine();return x("div",{style:{visibility:n?"hidden":void 0,display:n?"none":void 0,height:"100%"},children:t.map(s=>{const{root:o,rows:i}=this.refs.categories.get(s.id);return x("div",{"data-id":s.target?s.target.id:s.id,class:"category",ref:o,children:[x("div",{class:`sticky padding-small align-${this.dir[0]}`,children:s.name||Q.categories[s.id]}),x("div",{class:"relative",style:{height:i.length*this.props.emojiButtonSize},children:i.map((a,l)=>{const u=a.index-a.index%We.rowsPerRender,c=this.state.visibleRows[u],p="current"in a?a:void 0;if(!c&&!p)return null;const f=l*r,b=f+r,d=s.emojis.slice(f,b);return d.length<r&&d.push(...new Array(r-d.length)),x("div",{"data-index":a.index,ref:p,class:"flex row",style:{top:l*this.props.emojiButtonSize},children:c&&d.map((y,g)=>{if(!y)return x("div",{style:{width:this.props.emojiButtonSize,height:this.props.emojiButtonSize}});const _=xe.get(y);return this.renderEmojiButton(_,{pos:[a.index,g],posinset:a.posinset+g,grid:this.grid})})},a.index)})})]})})})}renderSkinToneButton(){return this.props.skinTonePosition=="none"?null:x("div",{class:"flex flex-auto flex-center flex-middle",style:{position:"relative",width:this.props.emojiButtonSize,height:this.props.emojiButtonSize},children:x("button",{type:"button",ref:this.refs.skinToneButton,class:"skin-tone-button flex flex-auto flex-center flex-middle","aria-selected":this.state.showSkins?"":void 0,"aria-label":Q.skins.choose,title:Q.skins.choose,onClick:this.openSkins,style:{width:this.props.emojiSize,height:this.props.emojiSize},children:x("span",{class:`skin-tone skin-tone-${this.state.skin}`})})})}renderLiveRegion(){const t=this.getEmojiByPos(this.state.pos),n=t?t.name:"";return x("div",{"aria-live":"polite",class:"sr-only",children:n})}renderSkins(){const n=this.refs.skinToneButton.current.getBoundingClientRect(),r=this.base.getBoundingClientRect(),s={};return this.dir=="ltr"?s.right=r.right-n.right-3:s.left=n.left-r.left-3,this.props.previewPosition=="bottom"&&this.props.skinTonePosition=="preview"?s.bottom=r.bottom-n.top+6:(s.top=n.bottom-r.top+3,s.bottom="auto"),x("div",{ref:this.refs.menu,role:"radiogroup",dir:this.dir,"aria-label":Q.skins.choose,class:"menu hidden","data-position":s.top?"top":"bottom",style:s,children:[...Array(6).keys()].map(o=>{const i=o+1,a=this.state.skin==i;return x("div",{children:[x("input",{type:"radio",name:"skin-tone",value:i,"aria-label":Q.skins[i],ref:a?this.refs.skinToneRadio:null,defaultChecked:a,onChange:()=>this.handleSkinMouseOver(i),onKeyDown:l=>{(l.code=="Enter"||l.code=="Space"||l.code=="Tab")&&(l.preventDefault(),this.handleSkinClick(i))}}),x("button",{"aria-hidden":"true",tabindex:"-1",onClick:()=>this.handleSkinClick(i),onMouseEnter:()=>this.handleSkinMouseOver(i),onMouseLeave:()=>this.handleSkinMouseOver(),class:"option flex flex-grow flex-middle",children:[x("span",{class:`skin-tone skin-tone-${i}`}),x("span",{class:"margin-small-lr",children:Q.skins[i]})]})]})})})}render(){const t=this.props.perLine*this.props.emojiButtonSize;return x("section",{id:"root",class:"flex flex-column",dir:this.dir,style:{width:this.props.dynamicWidth?"100%":`calc(${t}px + (var(--padding) + var(--sidebar-width)))`},"data-emoji-set":this.props.set,"data-theme":this.state.theme,"data-menu":this.state.showSkins?"":void 0,children:[this.props.previewPosition=="top"&&this.renderPreview(),this.props.navPosition=="top"&&this.renderNav(),this.props.searchPosition=="sticky"&&x("div",{class:"padding-lr",children:this.renderSearch()}),x("div",{ref:this.refs.scroll,class:"scroll flex-grow padding-lr",children:x("div",{style:{width:this.props.dynamicWidth?"100%":t,height:"100%"},children:[this.props.searchPosition=="static"&&this.renderSearch(),this.renderSearchResults(),this.renderCategories()]})}),this.props.navPosition=="bottom"&&this.renderNav(),this.props.previewPosition=="bottom"&&this.renderPreview(),this.state.showSkins&&this.renderSkins(),this.renderLiveRegion()]})}constructor(t){super(),ae(this,"darkMediaCallback",()=>{this.props.theme=="auto"&&this.setState({theme:this.darkMedia.matches?"dark":"light"})}),ae(this,"handleClickOutside",n=>{const{element:r}=this.props;n.target!=r&&(this.state.showSkins&&this.closeSkins(),this.props.onClickOutside&&this.props.onClickOutside(n))}),ae(this,"handleBaseClick",n=>{this.state.showSkins&&(n.target.closest(".menu")||(n.preventDefault(),n.stopImmediatePropagation(),this.closeSkins()))}),ae(this,"handleBaseKeydown",n=>{this.state.showSkins&&n.key=="Escape"&&(n.preventDefault(),n.stopImmediatePropagation(),this.closeSkins())}),ae(this,"handleSearchClick",()=>{this.getEmojiByPos(this.state.pos)&&this.setState({pos:[-1,-1]})}),ae(this,"handleSearchInput",async()=>{const n=this.refs.searchInput.current;if(!n)return;const{value:r}=n,s=await xe.search(r),o=()=>{this.refs.scroll.current&&(this.refs.scroll.current.scrollTop=0)};if(!s)return this.setState({searchResults:s,pos:[-1,-1]},o);const i=n.selectionStart==n.value.length?[0,0]:[-1,-1],a=[];a.setsize=s.length;let l=null;for(let u of s)(!a.length||l.length==this.getPerLine())&&(l=[],l.__categoryId="search",l.__index=a.length,a.push(l)),l.push(u);this.ignoreMouse(),this.setState({searchResults:a,pos:i},o)}),ae(this,"handleSearchKeyDown",n=>{const r=n.currentTarget;switch(n.stopImmediatePropagation(),n.key){case"ArrowLeft":this.navigate({e:n,input:r,left:!0});break;case"ArrowRight":this.navigate({e:n,input:r,right:!0});break;case"ArrowUp":this.navigate({e:n,input:r,up:!0});break;case"ArrowDown":this.navigate({e:n,input:r,down:!0});break;case"Enter":n.preventDefault(),this.handleEmojiClick({e:n,pos:this.state.pos});break;case"Escape":n.preventDefault(),this.state.searchResults?this.clearSearch():this.unfocusSearch();break}}),ae(this,"clearSearch",()=>{const n=this.refs.searchInput.current;n&&(n.value="",n.focus(),this.handleSearchInput())}),ae(this,"handleCategoryClick",({category:n,i:r})=>{this.scrollTo(r==0?{row:-1}:{categoryId:n.id})}),ae(this,"openSkins",n=>{const{currentTarget:r}=n,s=r.getBoundingClientRect();this.setState({showSkins:s},async()=>{await Yi(2);const o=this.refs.menu.current;o&&(o.classList.remove("hidden"),this.refs.skinToneRadio.current.focus(),this.base.addEventListener("click",this.handleBaseClick,!0),this.base.addEventListener("keydown",this.handleBaseKeydown,!0))})}),this.observers=[],this.state={pos:[-1,-1],perLine:this.initDynamicPerLine(t),visibleRows:{0:!0},...this.getInitialState(t)}}}class Vt extends na{async connectedCallback(){const t=Ts(this.props,he,this);t.element=this,t.ref=n=>{this.component=n},await pt(t),!this.disconnected&&Cs(x(ga,{...t}),this.shadowRoot)}constructor(t){super(t,{styles:fs(As)})}}ae(Vt,"Props",he);typeof customElements<"u"&&!customElements.get("em-emoji-picker")&&customElements.define("em-emoji-picker",Vt);var As={};As=`:host {
26
+ width: min-content;
27
+ height: 435px;
28
+ min-height: 230px;
29
+ border-radius: var(--border-radius);
30
+ box-shadow: var(--shadow);
31
+ --border-radius: 10px;
32
+ --category-icon-size: 18px;
33
+ --font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
34
+ --font-size: 15px;
35
+ --preview-placeholder-size: 21px;
36
+ --preview-title-size: 1.1em;
37
+ --preview-subtitle-size: .9em;
38
+ --shadow-color: 0deg 0% 0%;
39
+ --shadow: .3px .5px 2.7px hsl(var(--shadow-color) / .14), .4px .8px 1px -3.2px hsl(var(--shadow-color) / .14), 1px 2px 2.5px -4.5px hsl(var(--shadow-color) / .14);
40
+ display: flex;
41
+ }
42
+
43
+ [data-theme="light"] {
44
+ --em-rgb-color: var(--rgb-color, 34, 36, 39);
45
+ --em-rgb-accent: var(--rgb-accent, 34, 102, 237);
46
+ --em-rgb-background: var(--rgb-background, 255, 255, 255);
47
+ --em-rgb-input: var(--rgb-input, 255, 255, 255);
48
+ --em-color-border: var(--color-border, rgba(0, 0, 0, .05));
49
+ --em-color-border-over: var(--color-border-over, rgba(0, 0, 0, .1));
50
+ }
51
+
52
+ [data-theme="dark"] {
53
+ --em-rgb-color: var(--rgb-color, 222, 222, 221);
54
+ --em-rgb-accent: var(--rgb-accent, 58, 130, 247);
55
+ --em-rgb-background: var(--rgb-background, 21, 22, 23);
56
+ --em-rgb-input: var(--rgb-input, 0, 0, 0);
57
+ --em-color-border: var(--color-border, rgba(255, 255, 255, .1));
58
+ --em-color-border-over: var(--color-border-over, rgba(255, 255, 255, .2));
59
+ }
60
+
61
+ #root {
62
+ --color-a: rgb(var(--em-rgb-color));
63
+ --color-b: rgba(var(--em-rgb-color), .65);
64
+ --color-c: rgba(var(--em-rgb-color), .45);
65
+ --padding: 12px;
66
+ --padding-small: calc(var(--padding) / 2);
67
+ --sidebar-width: 16px;
68
+ --duration: 225ms;
69
+ --duration-fast: 125ms;
70
+ --duration-instant: 50ms;
71
+ --easing: cubic-bezier(.4, 0, .2, 1);
72
+ width: 100%;
73
+ text-align: left;
74
+ border-radius: var(--border-radius);
75
+ background-color: rgb(var(--em-rgb-background));
76
+ position: relative;
77
+ }
78
+
79
+ @media (prefers-reduced-motion) {
80
+ #root {
81
+ --duration: 0;
82
+ --duration-fast: 0;
83
+ --duration-instant: 0;
84
+ }
85
+ }
86
+
87
+ #root[data-menu] button {
88
+ cursor: auto;
89
+ }
90
+
91
+ #root[data-menu] .menu button {
92
+ cursor: pointer;
93
+ }
94
+
95
+ :host, #root, input, button {
96
+ color: rgb(var(--em-rgb-color));
97
+ font-family: var(--font-family);
98
+ font-size: var(--font-size);
99
+ -webkit-font-smoothing: antialiased;
100
+ -moz-osx-font-smoothing: grayscale;
101
+ line-height: normal;
102
+ }
103
+
104
+ *, :before, :after {
105
+ box-sizing: border-box;
106
+ min-width: 0;
107
+ margin: 0;
108
+ padding: 0;
109
+ }
110
+
111
+ .relative {
112
+ position: relative;
113
+ }
114
+
115
+ .flex {
116
+ display: flex;
117
+ }
118
+
119
+ .flex-auto {
120
+ flex: none;
121
+ }
122
+
123
+ .flex-center {
124
+ justify-content: center;
125
+ }
126
+
127
+ .flex-column {
128
+ flex-direction: column;
129
+ }
130
+
131
+ .flex-grow {
132
+ flex: auto;
133
+ }
134
+
135
+ .flex-middle {
136
+ align-items: center;
137
+ }
138
+
139
+ .flex-wrap {
140
+ flex-wrap: wrap;
141
+ }
142
+
143
+ .padding {
144
+ padding: var(--padding);
145
+ }
146
+
147
+ .padding-t {
148
+ padding-top: var(--padding);
149
+ }
150
+
151
+ .padding-lr {
152
+ padding-left: var(--padding);
153
+ padding-right: var(--padding);
154
+ }
155
+
156
+ .padding-r {
157
+ padding-right: var(--padding);
158
+ }
159
+
160
+ .padding-small {
161
+ padding: var(--padding-small);
162
+ }
163
+
164
+ .padding-small-b {
165
+ padding-bottom: var(--padding-small);
166
+ }
167
+
168
+ .padding-small-lr {
169
+ padding-left: var(--padding-small);
170
+ padding-right: var(--padding-small);
171
+ }
172
+
173
+ .margin {
174
+ margin: var(--padding);
175
+ }
176
+
177
+ .margin-r {
178
+ margin-right: var(--padding);
179
+ }
180
+
181
+ .margin-l {
182
+ margin-left: var(--padding);
183
+ }
184
+
185
+ .margin-small-l {
186
+ margin-left: var(--padding-small);
187
+ }
188
+
189
+ .margin-small-lr {
190
+ margin-left: var(--padding-small);
191
+ margin-right: var(--padding-small);
192
+ }
193
+
194
+ .align-l {
195
+ text-align: left;
196
+ }
197
+
198
+ .align-r {
199
+ text-align: right;
200
+ }
201
+
202
+ .color-a {
203
+ color: var(--color-a);
204
+ }
205
+
206
+ .color-b {
207
+ color: var(--color-b);
208
+ }
209
+
210
+ .color-c {
211
+ color: var(--color-c);
212
+ }
213
+
214
+ .ellipsis {
215
+ white-space: nowrap;
216
+ max-width: 100%;
217
+ width: auto;
218
+ text-overflow: ellipsis;
219
+ overflow: hidden;
220
+ }
221
+
222
+ .sr-only {
223
+ width: 1px;
224
+ height: 1px;
225
+ position: absolute;
226
+ top: auto;
227
+ left: -10000px;
228
+ overflow: hidden;
229
+ }
230
+
231
+ a {
232
+ cursor: pointer;
233
+ color: rgb(var(--em-rgb-accent));
234
+ }
235
+
236
+ a:hover {
237
+ text-decoration: underline;
238
+ }
239
+
240
+ .spacer {
241
+ height: 10px;
242
+ }
243
+
244
+ [dir="rtl"] .scroll {
245
+ padding-left: 0;
246
+ padding-right: var(--padding);
247
+ }
248
+
249
+ .scroll {
250
+ padding-right: 0;
251
+ overflow-x: hidden;
252
+ overflow-y: auto;
253
+ }
254
+
255
+ .scroll::-webkit-scrollbar {
256
+ width: var(--sidebar-width);
257
+ height: var(--sidebar-width);
258
+ }
259
+
260
+ .scroll::-webkit-scrollbar-track {
261
+ border: 0;
262
+ }
263
+
264
+ .scroll::-webkit-scrollbar-button {
265
+ width: 0;
266
+ height: 0;
267
+ display: none;
268
+ }
269
+
270
+ .scroll::-webkit-scrollbar-corner {
271
+ background-color: rgba(0, 0, 0, 0);
272
+ }
273
+
274
+ .scroll::-webkit-scrollbar-thumb {
275
+ min-height: 20%;
276
+ min-height: 65px;
277
+ border: 4px solid rgb(var(--em-rgb-background));
278
+ border-radius: 8px;
279
+ }
280
+
281
+ .scroll::-webkit-scrollbar-thumb:hover {
282
+ background-color: var(--em-color-border-over) !important;
283
+ }
284
+
285
+ .scroll:hover::-webkit-scrollbar-thumb {
286
+ background-color: var(--em-color-border);
287
+ }
288
+
289
+ .sticky {
290
+ z-index: 1;
291
+ background-color: rgba(var(--em-rgb-background), .9);
292
+ -webkit-backdrop-filter: blur(4px);
293
+ backdrop-filter: blur(4px);
294
+ font-weight: 500;
295
+ position: sticky;
296
+ top: -1px;
297
+ }
298
+
299
+ [dir="rtl"] .search input[type="search"] {
300
+ padding: 10px 2.2em 10px 2em;
301
+ }
302
+
303
+ [dir="rtl"] .search .loupe {
304
+ left: auto;
305
+ right: .7em;
306
+ }
307
+
308
+ [dir="rtl"] .search .delete {
309
+ left: .7em;
310
+ right: auto;
311
+ }
312
+
313
+ .search {
314
+ z-index: 2;
315
+ position: relative;
316
+ }
317
+
318
+ .search input, .search button {
319
+ font-size: calc(var(--font-size) - 1px);
320
+ }
321
+
322
+ .search input[type="search"] {
323
+ width: 100%;
324
+ background-color: var(--em-color-border);
325
+ transition-duration: var(--duration);
326
+ transition-property: background-color, box-shadow;
327
+ transition-timing-function: var(--easing);
328
+ border: 0;
329
+ border-radius: 10px;
330
+ outline: 0;
331
+ padding: 10px 2em 10px 2.2em;
332
+ display: block;
333
+ }
334
+
335
+ .search input[type="search"]::-ms-input-placeholder {
336
+ color: inherit;
337
+ opacity: .6;
338
+ }
339
+
340
+ .search input[type="search"]::placeholder {
341
+ color: inherit;
342
+ opacity: .6;
343
+ }
344
+
345
+ .search input[type="search"], .search input[type="search"]::-webkit-search-decoration, .search input[type="search"]::-webkit-search-cancel-button, .search input[type="search"]::-webkit-search-results-button, .search input[type="search"]::-webkit-search-results-decoration {
346
+ -webkit-appearance: none;
347
+ -ms-appearance: none;
348
+ appearance: none;
349
+ }
350
+
351
+ .search input[type="search"]:focus {
352
+ background-color: rgb(var(--em-rgb-input));
353
+ box-shadow: inset 0 0 0 1px rgb(var(--em-rgb-accent)), 0 1px 3px rgba(65, 69, 73, .2);
354
+ }
355
+
356
+ .search .icon {
357
+ z-index: 1;
358
+ color: rgba(var(--em-rgb-color), .7);
359
+ position: absolute;
360
+ top: 50%;
361
+ transform: translateY(-50%);
362
+ }
363
+
364
+ .search .loupe {
365
+ pointer-events: none;
366
+ left: .7em;
367
+ }
368
+
369
+ .search .delete {
370
+ right: .7em;
371
+ }
372
+
373
+ svg {
374
+ fill: currentColor;
375
+ width: 1em;
376
+ height: 1em;
377
+ }
378
+
379
+ button {
380
+ -webkit-appearance: none;
381
+ -ms-appearance: none;
382
+ appearance: none;
383
+ cursor: pointer;
384
+ color: currentColor;
385
+ background-color: rgba(0, 0, 0, 0);
386
+ border: 0;
387
+ }
388
+
389
+ #nav {
390
+ z-index: 2;
391
+ padding-top: 12px;
392
+ padding-bottom: 12px;
393
+ padding-right: var(--sidebar-width);
394
+ position: relative;
395
+ }
396
+
397
+ #nav button {
398
+ color: var(--color-b);
399
+ transition: color var(--duration) var(--easing);
400
+ }
401
+
402
+ #nav button:hover {
403
+ color: var(--color-a);
404
+ }
405
+
406
+ #nav svg, #nav img {
407
+ width: var(--category-icon-size);
408
+ height: var(--category-icon-size);
409
+ }
410
+
411
+ #nav[dir="rtl"] .bar {
412
+ left: auto;
413
+ right: 0;
414
+ }
415
+
416
+ #nav .bar {
417
+ width: 100%;
418
+ height: 3px;
419
+ background-color: rgb(var(--em-rgb-accent));
420
+ transition: transform var(--duration) var(--easing);
421
+ border-radius: 3px 3px 0 0;
422
+ position: absolute;
423
+ bottom: -12px;
424
+ left: 0;
425
+ }
426
+
427
+ #nav button[aria-selected] {
428
+ color: rgb(var(--em-rgb-accent));
429
+ }
430
+
431
+ #preview {
432
+ z-index: 2;
433
+ padding: calc(var(--padding) + 4px) var(--padding);
434
+ padding-right: var(--sidebar-width);
435
+ position: relative;
436
+ }
437
+
438
+ #preview .preview-placeholder {
439
+ font-size: var(--preview-placeholder-size);
440
+ }
441
+
442
+ #preview .preview-title {
443
+ font-size: var(--preview-title-size);
444
+ }
445
+
446
+ #preview .preview-subtitle {
447
+ font-size: var(--preview-subtitle-size);
448
+ }
449
+
450
+ #nav:before, #preview:before {
451
+ content: "";
452
+ height: 2px;
453
+ position: absolute;
454
+ left: 0;
455
+ right: 0;
456
+ }
457
+
458
+ #nav[data-position="top"]:before, #preview[data-position="top"]:before {
459
+ background: linear-gradient(to bottom, var(--em-color-border), transparent);
460
+ top: 100%;
461
+ }
462
+
463
+ #nav[data-position="bottom"]:before, #preview[data-position="bottom"]:before {
464
+ background: linear-gradient(to top, var(--em-color-border), transparent);
465
+ bottom: 100%;
466
+ }
467
+
468
+ .category:last-child {
469
+ min-height: calc(100% + 1px);
470
+ }
471
+
472
+ .category button {
473
+ font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, sans-serif;
474
+ position: relative;
475
+ }
476
+
477
+ .category button > * {
478
+ position: relative;
479
+ }
480
+
481
+ .category button .background {
482
+ opacity: 0;
483
+ background-color: var(--em-color-border);
484
+ transition: opacity var(--duration-fast) var(--easing) var(--duration-instant);
485
+ position: absolute;
486
+ top: 0;
487
+ bottom: 0;
488
+ left: 0;
489
+ right: 0;
490
+ }
491
+
492
+ .category button:hover .background {
493
+ transition-duration: var(--duration-instant);
494
+ transition-delay: 0s;
495
+ }
496
+
497
+ .category button[aria-selected] .background {
498
+ opacity: 1;
499
+ }
500
+
501
+ .category button[data-keyboard] .background {
502
+ transition: none;
503
+ }
504
+
505
+ .row {
506
+ width: 100%;
507
+ position: absolute;
508
+ top: 0;
509
+ left: 0;
510
+ }
511
+
512
+ .skin-tone-button {
513
+ border: 1px solid rgba(0, 0, 0, 0);
514
+ border-radius: 100%;
515
+ }
516
+
517
+ .skin-tone-button:hover {
518
+ border-color: var(--em-color-border);
519
+ }
520
+
521
+ .skin-tone-button:active .skin-tone {
522
+ transform: scale(.85) !important;
523
+ }
524
+
525
+ .skin-tone-button .skin-tone {
526
+ transition: transform var(--duration) var(--easing);
527
+ }
528
+
529
+ .skin-tone-button[aria-selected] {
530
+ background-color: var(--em-color-border);
531
+ border-top-color: rgba(0, 0, 0, .05);
532
+ border-bottom-color: rgba(0, 0, 0, 0);
533
+ border-left-width: 0;
534
+ border-right-width: 0;
535
+ }
536
+
537
+ .skin-tone-button[aria-selected] .skin-tone {
538
+ transform: scale(.9);
539
+ }
540
+
541
+ .menu {
542
+ z-index: 2;
543
+ white-space: nowrap;
544
+ border: 1px solid var(--em-color-border);
545
+ background-color: rgba(var(--em-rgb-background), .9);
546
+ -webkit-backdrop-filter: blur(4px);
547
+ backdrop-filter: blur(4px);
548
+ transition-property: opacity, transform;
549
+ transition-duration: var(--duration);
550
+ transition-timing-function: var(--easing);
551
+ border-radius: 10px;
552
+ padding: 4px;
553
+ position: absolute;
554
+ box-shadow: 1px 1px 5px rgba(0, 0, 0, .05);
555
+ }
556
+
557
+ .menu.hidden {
558
+ opacity: 0;
559
+ }
560
+
561
+ .menu[data-position="bottom"] {
562
+ transform-origin: 100% 100%;
563
+ }
564
+
565
+ .menu[data-position="bottom"].hidden {
566
+ transform: scale(.9)rotate(-3deg)translateY(5%);
567
+ }
568
+
569
+ .menu[data-position="top"] {
570
+ transform-origin: 100% 0;
571
+ }
572
+
573
+ .menu[data-position="top"].hidden {
574
+ transform: scale(.9)rotate(3deg)translateY(-5%);
575
+ }
576
+
577
+ .menu input[type="radio"] {
578
+ clip: rect(0 0 0 0);
579
+ width: 1px;
580
+ height: 1px;
581
+ border: 0;
582
+ margin: 0;
583
+ padding: 0;
584
+ position: absolute;
585
+ overflow: hidden;
586
+ }
587
+
588
+ .menu input[type="radio"]:checked + .option {
589
+ box-shadow: 0 0 0 2px rgb(var(--em-rgb-accent));
590
+ }
591
+
592
+ .option {
593
+ width: 100%;
594
+ border-radius: 6px;
595
+ padding: 4px 6px;
596
+ }
597
+
598
+ .option:hover {
599
+ color: #fff;
600
+ background-color: rgb(var(--em-rgb-accent));
601
+ }
602
+
603
+ .skin-tone {
604
+ width: 16px;
605
+ height: 16px;
606
+ border-radius: 100%;
607
+ display: inline-block;
608
+ position: relative;
609
+ overflow: hidden;
610
+ }
611
+
612
+ .skin-tone:after {
613
+ content: "";
614
+ mix-blend-mode: overlay;
615
+ background: linear-gradient(rgba(255, 255, 255, .2), rgba(0, 0, 0, 0));
616
+ border: 1px solid rgba(0, 0, 0, .8);
617
+ border-radius: 100%;
618
+ position: absolute;
619
+ top: 0;
620
+ bottom: 0;
621
+ left: 0;
622
+ right: 0;
623
+ box-shadow: inset 0 -2px 3px #000, inset 0 1px 2px #fff;
624
+ }
625
+
626
+ .skin-tone-1 {
627
+ background-color: #ffc93a;
628
+ }
629
+
630
+ .skin-tone-2 {
631
+ background-color: #ffdab7;
632
+ }
633
+
634
+ .skin-tone-3 {
635
+ background-color: #e7b98f;
636
+ }
637
+
638
+ .skin-tone-4 {
639
+ background-color: #c88c61;
640
+ }
641
+
642
+ .skin-tone-5 {
643
+ background-color: #a46134;
644
+ }
645
+
646
+ .skin-tone-6 {
647
+ background-color: #5d4437;
648
+ }
649
+
650
+ [data-index] {
651
+ justify-content: space-between;
652
+ }
653
+
654
+ [data-emoji-set="twitter"] .skin-tone:after {
655
+ box-shadow: none;
656
+ border-color: rgba(0, 0, 0, .5);
657
+ }
658
+
659
+ [data-emoji-set="twitter"] .skin-tone-1 {
660
+ background-color: #fade72;
661
+ }
662
+
663
+ [data-emoji-set="twitter"] .skin-tone-2 {
664
+ background-color: #f3dfd0;
665
+ }
666
+
667
+ [data-emoji-set="twitter"] .skin-tone-3 {
668
+ background-color: #eed3a8;
669
+ }
670
+
671
+ [data-emoji-set="twitter"] .skin-tone-4 {
672
+ background-color: #cfad8d;
673
+ }
674
+
675
+ [data-emoji-set="twitter"] .skin-tone-5 {
676
+ background-color: #a8805d;
677
+ }
678
+
679
+ [data-emoji-set="twitter"] .skin-tone-6 {
680
+ background-color: #765542;
681
+ }
682
+
683
+ [data-emoji-set="google"] .skin-tone:after {
684
+ box-shadow: inset 0 0 2px 2px rgba(0, 0, 0, .4);
685
+ }
686
+
687
+ [data-emoji-set="google"] .skin-tone-1 {
688
+ background-color: #f5c748;
689
+ }
690
+
691
+ [data-emoji-set="google"] .skin-tone-2 {
692
+ background-color: #f1d5aa;
693
+ }
694
+
695
+ [data-emoji-set="google"] .skin-tone-3 {
696
+ background-color: #d4b48d;
697
+ }
698
+
699
+ [data-emoji-set="google"] .skin-tone-4 {
700
+ background-color: #aa876b;
701
+ }
702
+
703
+ [data-emoji-set="google"] .skin-tone-5 {
704
+ background-color: #916544;
705
+ }
706
+
707
+ [data-emoji-set="google"] .skin-tone-6 {
708
+ background-color: #61493f;
709
+ }
710
+
711
+ [data-emoji-set="facebook"] .skin-tone:after {
712
+ border-color: rgba(0, 0, 0, .4);
713
+ box-shadow: inset 0 -2px 3px #000, inset 0 1px 4px #fff;
714
+ }
715
+
716
+ [data-emoji-set="facebook"] .skin-tone-1 {
717
+ background-color: #f5c748;
718
+ }
719
+
720
+ [data-emoji-set="facebook"] .skin-tone-2 {
721
+ background-color: #f1d5aa;
722
+ }
723
+
724
+ [data-emoji-set="facebook"] .skin-tone-3 {
725
+ background-color: #d4b48d;
726
+ }
727
+
728
+ [data-emoji-set="facebook"] .skin-tone-4 {
729
+ background-color: #aa876b;
730
+ }
731
+
732
+ [data-emoji-set="facebook"] .skin-tone-5 {
733
+ background-color: #916544;
734
+ }
735
+
736
+ [data-emoji-set="facebook"] .skin-tone-6 {
737
+ background-color: #61493f;
738
+ }
739
+
740
+ `;function ba(e){const t=v.useRef(null),n=v.useRef(null);return n.current&&n.current.update(e),v.useEffect(()=>(n.current=new Vt({...e,ref:t}),()=>{n.current=null}),[]),Os.createElement("div",{ref:t})}function va(e){let t=0,n=0,r=0;if(e.startsWith("#")){const s=e.replace("#","");t=parseInt(s.substring(0,2),16),n=parseInt(s.substring(2,4),16),r=parseInt(s.substring(4,6),16)}return(.299*t+.587*n+.114*r)/255>.5}function At({onSend:e,onTyping:t,config:n,fileUpload:r,disabled:s=!1}){var ce,J,G,te,Z,ie;const[o,i]=v.useState(""),[a,l]=v.useState(!1),[u,c]=v.useState(),[p,f]=v.useState(null),[b,d]=v.useState(!1),y=v.useRef(null),g=v.useRef(null),_=v.useRef(null),C=v.useRef(null),w=v.useRef(null),k=v.useRef(null),E=v.useRef(!1),P=n.enableEmoji??!0,M=n.enableFileUpload??!0,I=((ce=n.theme)==null?void 0:ce.background)||"#00001a",A=va(I),$=((J=n.theme)==null?void 0:J.text)||(A?"#1a1a2e":"#f7f7f8"),N=((G=n.theme)==null?void 0:G.textMuted)||(A?"rgba(0,0,0,0.4)":"rgba(247,247,248,0.45)"),F=((te=n.theme)==null?void 0:te.primary)||"#337eff";v.useEffect(()=>{P&&(async()=>{try{const T=await fetch("https://cdn.jsdelivr.net/npm/@emoji-mart/data");c(await T.json())}catch(T){console.error("Failed to load emoji data:",T)}})()},[P]),v.useEffect(()=>{const T=q=>{g.current&&!g.current.contains(q.target)&&l(!1)};return a&&document.addEventListener("mousedown",T),()=>{document.removeEventListener("mousedown",T)}},[a]),v.useEffect(()=>()=>{w.current&&clearTimeout(w.current),k.current&&clearTimeout(k.current)},[]),v.useEffect(()=>{if(!a)return;const T=()=>{if(_.current){const q=_.current.getBoundingClientRect();f({top:q.top-370,left:q.left-300})}};return window.addEventListener("resize",T),window.addEventListener("scroll",T,!0),()=>{window.removeEventListener("resize",T),window.removeEventListener("scroll",T,!0)}},[a]);const z=T=>{i(T),t&&n.enableTypingIndicator!==!1&&(k.current&&clearTimeout(k.current),w.current&&clearTimeout(w.current),E.current||(k.current=setTimeout(()=>{t(!0),E.current=!0},300)),w.current=setTimeout(()=>{E.current&&(t(!1),E.current=!1)},1500))},j=()=>{var q;const T=o.trim();!T||s||(e(T),i(""),l(!1),t&&(w.current&&clearTimeout(w.current),k.current&&clearTimeout(k.current),E.current&&(t(!1),E.current=!1)),(q=y.current)==null||q.focus())},S=T=>{T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),j())},R=T=>{const q=y.current;if(!q){i(K=>K+T);return}const oe=q.selectionStart,W=q.selectionEnd,V=o.slice(0,oe)+T+o.slice(W);i(V),setTimeout(()=>{const K=oe+T.length;q.setSelectionRange(K,K),q.focus()},0)},D=async T=>{var W,V,K;const q=T.target.files;if(!q||q.length===0)return;const oe=q[0];try{(W=n.toast)==null||W.info("Uploading file...");const ne=await r.uploadFile(oe);ne!=null&&ne.markdown&&(R(`
741
+ ${ne.markdown}
742
+ `),(V=n.toast)==null||V.success("File uploaded successfully"))}catch(ne){console.error("File upload failed:",ne),(K=n.toast)==null||K.error(ne.message)}finally{C.current&&(C.current.value="")}},B=o.trim().length>0&&!s,H=A?"rgba(0,0,0,0.35)":"rgba(247,247,248,0.3)";return h.jsxs("div",{className:"px-4 py-3",style:{borderTop:A?"1px solid rgba(0,0,0,0.06)":"1px solid rgba(255,255,255,0.06)"},children:[h.jsxs("div",{className:"relative flex items-center rounded-full transition-all duration-200",style:{backgroundColor:A?"rgba(112,115,124,0.08)":"rgba(112,115,124,0.12)",outline:b?`2px solid ${F}`:"none",outlineOffset:"-1px",border:A?"1px solid rgba(0,0,0,0.1)":"1px solid rgba(255,255,255,0.08)",backdropFilter:"blur(32px)"},children:[h.jsx("style",{children:`.xchat-input::placeholder { color: ${H}; }`}),h.jsx("textarea",{ref:y,value:o,onChange:T=>z(T.target.value),onKeyDown:S,onFocus:()=>d(!0),onBlur:()=>d(!1),placeholder:"Type a message...",rows:1,className:"xchat-input flex-1 resize-none bg-transparent",style:{color:$,border:"none",outline:"none",boxShadow:"none",WebkitAppearance:"none",padding:"10px 0 10px 20px",minHeight:"42px",maxHeight:"120px",caretColor:F,fontSize:"14px",lineHeight:"20px",letterSpacing:"0.006em"},disabled:s}),h.jsxs("div",{className:"flex items-center gap-1 px-2 shrink-0",children:[P&&h.jsx("button",{ref:_,type:"button",onClick:()=>{if(!a&&_.current){const T=_.current.getBoundingClientRect();f({top:T.top-450,left:T.left-290})}l(T=>!T)},className:"p-1.5 rounded-lg transition-all duration-150",style:{color:N,backgroundColor:"transparent"},onMouseEnter:T=>{T.currentTarget.style.backgroundColor=A?"rgba(0,0,0,0.06)":"rgba(255,255,255,0.06)",T.currentTarget.style.color=$},onMouseLeave:T=>{T.currentTarget.style.backgroundColor="transparent",T.currentTarget.style.color=N},disabled:s,"aria-label":"Add emoji",children:h.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[h.jsx("title",{children:"Emoji"}),h.jsx("circle",{cx:"12",cy:"12",r:"10"}),h.jsx("path",{d:"M8 14s1.5 2 4 2 4-2 4-2"}),h.jsx("line",{x1:"9",y1:"9",x2:"9.01",y2:"9"}),h.jsx("line",{x1:"15",y1:"9",x2:"15.01",y2:"9"})]})}),M&&r.canUpload&&h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",onClick:()=>{var T;return(T=C.current)==null?void 0:T.click()},className:"p-1.5 rounded-lg transition-all duration-150",style:{color:N,backgroundColor:"transparent"},onMouseEnter:T=>{T.currentTarget.style.backgroundColor="rgba(255,255,255,0.06)",T.currentTarget.style.color=$},onMouseLeave:T=>{T.currentTarget.style.backgroundColor="transparent",T.currentTarget.style.color=N},disabled:s||r.isUploading,"aria-label":"Attach file",children:r.isUploading?h.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:"animate-spin","aria-hidden":"true",children:[h.jsx("title",{children:"Uploading"}),h.jsx("path",{d:"M21 12a9 9 0 11-6.219-8.56"})]}):h.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[h.jsx("title",{children:"Attach file"}),h.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})]})}),h.jsx("input",{ref:C,type:"file",accept:"image/*,application/pdf,.doc,.docx",className:"hidden",onChange:D})]}),h.jsx("button",{type:"button",onClick:j,disabled:!B,className:"p-1.5 rounded-lg transition-all duration-200",style:{background:B?`linear-gradient(135deg, ${F}, ${((Z=n.theme)==null?void 0:Z.primaryStrong)||"#005eff"})`:"transparent",color:B?"#ffffff":N,opacity:B?1:.35,cursor:B?"pointer":"default",boxShadow:B?`0 2px 8px -2px ${F}60`:"none"},"aria-label":"Send message",children:h.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[h.jsx("title",{children:"Send"}),h.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),h.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]})]}),r.isUploading&&h.jsxs("div",{className:"mt-2 px-1",children:[h.jsx("div",{className:"w-full rounded-full overflow-hidden",style:{height:3,backgroundColor:A?"rgba(0,0,0,0.06)":"rgba(255,255,255,0.06)"},children:h.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${r.uploadProgress}%`,background:`linear-gradient(90deg, ${F}, ${((ie=n.theme)==null?void 0:ie.primaryStrong)||"#005eff"})`}})}),h.jsxs("p",{className:"mt-1",style:{fontSize:"11px",letterSpacing:"0.019em",color:N},children:["Uploading... ",r.uploadProgress,"%"]})]}),a&&u&&p&&typeof document<"u"&&Fs.createPortal(h.jsx("div",{ref:g,className:"fixed rounded-xl overflow-hidden",style:{top:`${p.top}px`,left:`${p.left}px`,zIndex:9999,boxShadow:["inset 0 0 0 0.5px rgba(255,255,255,0.06)","inset 0 1px 0 0 rgba(255,255,255,0.1)","0 16px 48px -8px rgba(0,0,0,0.5)"].join(", ")},children:h.jsx(ba,{data:u,onEmojiSelect:T=>{R(T.native||T.shortcodes||""),l(!1)},previewPosition:"none",skinTonePosition:"none",navPosition:"bottom",perLine:8,searchPosition:"sticky",theme:"dark"})}),document.body)]})}try{At.displayName="ChatInput",At.__docgenInfo={description:"",displayName:"ChatInput",props:{onSend:{defaultValue:null,description:"",name:"onSend",required:!0,type:{name:"(message: string) => void"}},onTyping:{defaultValue:null,description:"",name:"onTyping",required:!1,type:{name:"((isTyping: boolean) => void) | undefined"}},config:{defaultValue:null,description:"",name:"config",required:!0,type:{name:"IChatConfig"}},fileUpload:{defaultValue:null,description:"",name:"fileUpload",required:!0,type:{name:"UseFileUploadReturn"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean | undefined"}}}}}catch{}function ya(){var t;let e;try{const n=localStorage.getItem("xcelsior-chat-anon-id");n?e=n:(e=`anon-${((t=crypto.randomUUID)==null?void 0:t.call(crypto))||Math.random().toString(36).slice(2)}`,localStorage.setItem("xcelsior-chat-anon-id",e))}catch{e=`anon-${Math.random().toString(36).slice(2)}`}return{name:"Visitor",email:`${e}@anonymous.xcelsior.co`,type:"customer",status:"online"}}function It({config:e,className:t="",variant:n="popover",externalWebSocket:r,onMinimize:s,onClose:o,resolvedPosition:i="right"}){var G,te,Z,ie,T,q,oe,W;const a=n==="fullPage",l=e.currentUser||ya(),u={...e,currentUser:l},c=Hs(u,r),{messages:p,addMessage:f,isLoading:b,loadMore:d,hasMore:y,isLoadingMore:g,isBotThinking:_}=_i(c,u),C=wi(e.apiKey,e.fileUpload),{isTyping:w,typingUsers:k}=ki(c),{width:E,height:P,isResizing:M,isNearEdge:I,containerResizeProps:A}=$i({initialWidth:380,initialHeight:580,minWidth:320,minHeight:400,maxWidth:800,maxHeight:900,enabled:!a}),$=v.useRef(null),N=v.useCallback(V=>{var Fe,Xt;if(!c.isConnected){(Fe=e.toast)==null||Fe.error("Not connected to chat server");return}const K=Date.now();if($.current&&$.current.content===V&&K-$.current.time<1e3)return;$.current={content:V,time:K};const ne={id:`temp-${K}`,conversationId:e.conversationId||"",senderId:l.email,senderType:l.type,content:V,messageType:"text",createdAt:new Date().toISOString(),status:"sent"};f(ne),c.sendMessage("sendMessage",{conversationId:e.conversationId,content:V,messageType:"text"}),(Xt=e.onMessageSent)==null||Xt.call(e,ne)},[c,e,f,l]),F=v.useCallback(V=>{!c.isConnected||e.enableTypingIndicator===!1||c.sendMessage("typing",{conversationId:e.conversationId,isTyping:V})},[c,e]);v.useEffect(()=>{var V;c.error&&((V=e.toast)==null||V.error(c.error.message||"An error occurred"))},[c.error,e]);const z=((G=e.theme)==null?void 0:G.background)||"#00001a";(te=e.theme)!=null&&te.backgroundAlt;const j=((Z=e.theme)==null?void 0:Z.text)||"#f7f7f8",S=((ie=e.theme)==null?void 0:ie.primary)||"#337eff",R=((T=e.theme)==null?void 0:T.textMuted)||"rgba(247,247,248,0.45)",D=(()=>{if(!z.startsWith("#"))return!1;const V=z.replace("#",""),K=parseInt(V.substring(0,2),16),ne=parseInt(V.substring(2,4),16),Fe=parseInt(V.substring(4,6),16);return(.299*K+.587*ne+.114*Fe)/255>.5})(),B=i==="left"?"left-4":"right-4",H=a?{backgroundColor:z,color:j}:{width:E,height:P,maxHeight:"calc(100vh - 100px)",backgroundColor:z,color:j,borderRadius:16,boxShadow:D?["0 25px 60px -12px rgba(0,0,0,0.15)","0 0 0 1px rgba(0,0,0,0.08)"].join(", "):["inset 0 0 0 0.5px rgba(255,255,255,0.06)","inset 0 1px 0 0 rgba(255,255,255,0.12)","0 25px 60px -12px rgba(0,0,0,0.6)","0 0 40px -8px rgba(51,126,255,0.15)"].join(", "),userSelect:M?"none":void 0},ce=a?{}:{backgroundImage:D?"radial-gradient(circle, rgba(0,0,0,0.04) 1px, transparent 1px)":"radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px)",backgroundSize:"24px 24px"},J=!a&&I?{outline:D?"2px solid rgba(0,94,255,0.25)":"2px solid rgba(51,126,255,0.35)",outlineOffset:-1,transition:"outline 150ms ease"}:{outline:"2px solid transparent",outlineOffset:-1,transition:"outline 150ms ease"};return h.jsxs("div",{className:a?`flex flex-col h-full ${t}`:`fixed bottom-20 ${B} z-50 flex flex-col overflow-hidden ${t}`,style:{...H,...ce,...J},...a?{}:A,children:[!a&&h.jsx(Et,{agent:l.type==="customer"?{email:"contact@xcelsior.co",name:"Xcelsior Software",type:"agent",status:c.isConnected?"online":"offline"}:void 0,onMinimize:s,onClose:o,theme:e.theme}),!c.isConnected&&h.jsx("div",{className:"px-4 py-2",style:{backgroundColor:D?"rgba(255,169,56,0.08)":"rgba(255,169,56,0.06)",borderBottom:`1px solid rgba(255,169,56,${D?"0.15":"0.12"})`},children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"w-1.5 h-1.5 rounded-full animate-pulse",style:{backgroundColor:((q=e.theme)==null?void 0:q.statusCaution)||"#ffa938"}}),h.jsx("span",{style:{fontSize:"12px",letterSpacing:"0.015em",color:((oe=e.theme)==null?void 0:oe.statusCaution)||"#ffa938"},children:"Reconnecting..."}),h.jsx("button",{type:"button",onClick:c.reconnect,className:"ml-auto transition-opacity",style:{fontSize:"12px",letterSpacing:"0.015em",color:((W=e.theme)==null?void 0:W.statusCaution)||"#ffa938",opacity:.7},onMouseEnter:V=>{V.currentTarget.style.opacity="1"},onMouseLeave:V=>{V.currentTarget.style.opacity="0.7"},children:"Retry"})]})}),b?h.jsx("div",{className:"flex-1 flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"w-7 h-7 border-2 border-t-transparent rounded-full animate-spin mx-auto mb-3",style:{borderColor:S,borderTopColor:"transparent"}}),h.jsx("p",{style:{fontSize:"12px",letterSpacing:"0.015em",color:R},children:"Loading messages..."})]})}):h.jsx(Rt,{messages:p,currentUser:l,isTyping:w,typingUser:k[0],autoScroll:!0,onLoadMore:d,hasMore:y,isLoadingMore:g,theme:e.theme,onQuickAction:N,isBotThinking:_}),h.jsx(At,{onSend:N,onTyping:F,config:u,fileUpload:C,disabled:!c.isConnected}),!a&&h.jsx("div",{className:"px-4 py-1.5 text-center",style:{borderTop:D?"1px solid rgba(0,0,0,0.06)":"1px solid rgba(255,255,255,0.06)",backgroundColor:D?"rgba(0,0,0,0.03)":"rgba(0,0,0,0.2)"},children:h.jsxs("p",{style:{fontSize:"10px",letterSpacing:"0.025em",color:D?"rgba(0,0,0,0.35)":"rgba(247,247,248,0.28)"},children:["Powered by"," ",h.jsx("span",{style:{fontWeight:600,color:D?"rgba(0,0,0,0.5)":"rgba(247,247,248,0.45)"},children:"Xcelsior"})]})})]})}try{It.displayName="ChatWidget",It.__docgenInfo={description:"",displayName:"ChatWidget",props:{config:{defaultValue:null,description:"",name:"config",required:!0,type:{name:"IChatConfig"}},className:{defaultValue:{value:""},description:"",name:"className",required:!1,type:{name:"string | undefined"}},variant:{defaultValue:{value:"popover"},description:"",name:"variant",required:!1,type:{name:"enum",value:[{value:"undefined"},{value:'"popover"'},{value:'"fullPage"'}]}},externalWebSocket:{defaultValue:null,description:"",name:"externalWebSocket",required:!1,type:{name:"WebSocket | null | undefined"}},onMinimize:{defaultValue:null,description:"",name:"onMinimize",required:!1,type:{name:"(() => void) | undefined"}},onClose:{defaultValue:null,description:"",name:"onClose",required:!1,type:{name:"(() => void) | undefined"}},resolvedPosition:{defaultValue:{value:"right"},description:"Resolved position (left or right) from the parent Chat component",name:"resolvedPosition",required:!1,type:{name:"enum",value:[{value:"undefined"},{value:'"left"'},{value:'"right"'}]}}}}}catch{}function Ot({onSubmit:e,className:t="",initialName:n="",initialEmail:r="",onMinimize:s,onClose:o}){const[i,a]=v.useState(n),[l,u]=v.useState(r),[c,p]=v.useState({}),[f,b]=v.useState(!1),[d,y]=v.useState(null),g=()=>{const w={};return i.trim()?i.trim().length<2&&(w.name="Name must be at least 2 characters"):w.name="Name is required",l.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l)||(w.email="Please enter a valid email address"):w.email="Email is required",p(w),Object.keys(w).length===0},_=async w=>{if(w.preventDefault(),!!g()){b(!0);try{e(i.trim(),l.trim())}catch(k){console.error("Error submitting form:",k)}finally{b(!1)}}},C=(w,k)=>({width:"100%",padding:"10px 16px",fontSize:"14px",lineHeight:"20px",letterSpacing:"0.006em",color:"#f7f7f8",backgroundColor:"rgba(255,255,255,0.04)",border:"none",borderRadius:"12px",outline:"none",boxShadow:k?"inset 0 0 0 1px rgba(255,99,99,0.5)":d===w?"inset 0 0 0 1px rgba(51,126,255,0.4), 0 0 0 3px rgba(51,126,255,0.15)":"inset 0 0 0 0.5px rgba(255,255,255,0.08)",transition:"box-shadow 0.2s ease",caretColor:"#337eff"});return h.jsxs("div",{className:`fixed bottom-4 right-4 z-50 flex flex-col overflow-hidden ${t}`,style:{width:380,maxHeight:"calc(100vh - 2rem)",backgroundColor:"#00001a",borderRadius:16,boxShadow:["inset 0 0 0 0.5px rgba(255,255,255,0.06)","inset 0 1px 0 0 rgba(255,255,255,0.12)","0 25px 60px -12px rgba(0,0,0,0.6)","0 0 40px -8px rgba(51,126,255,0.15)"].join(", "),backgroundImage:"radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px)",backgroundSize:"24px 24px"},children:[h.jsxs("div",{className:"relative text-white overflow-hidden",style:{background:"linear-gradient(135deg, #337eff 0%, #005eff 50%, #001a66 100%)"},children:[h.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 40%)"}}),h.jsx("div",{className:"relative px-5 py-4",children:h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{className:"flex-1",children:[h.jsx("h2",{className:"font-semibold",style:{fontSize:"17px",letterSpacing:"-0.01em"},children:"Start a Conversation"}),h.jsx("p",{className:"mt-1",style:{fontSize:"13px",letterSpacing:"0.015em",color:"rgba(255,255,255,0.6)"},children:"Please provide your details to continue"})]}),h.jsxs("div",{className:"flex gap-1 ml-2",children:[h.jsx("button",{type:"button",onClick:s,className:"p-2 rounded-lg transition-all duration-150",style:{backgroundColor:"transparent"},onMouseEnter:w=>{w.currentTarget.style.backgroundColor="rgba(255,255,255,0.1)"},onMouseLeave:w=>{w.currentTarget.style.backgroundColor="transparent"},"aria-label":"Minimize chat",children:h.jsxs("svg",{width:"18",height:"18",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[h.jsx("title",{children:"Minimize"}),h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})]})}),h.jsx("button",{type:"button",onClick:o,className:"p-2 rounded-lg transition-all duration-150",style:{backgroundColor:"transparent"},onMouseEnter:w=>{w.currentTarget.style.backgroundColor="rgba(255,255,255,0.1)"},onMouseLeave:w=>{w.currentTarget.style.backgroundColor="transparent"},"aria-label":"Close chat",children:h.jsxs("svg",{width:"18",height:"18",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[h.jsx("title",{children:"Close"}),h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})]})})]})]})}),h.jsx("div",{className:"h-px",style:{background:"linear-gradient(90deg, transparent 5%, rgba(255,255,255,0.12) 30%, rgba(255,255,255,0.12) 70%, transparent 95%)"}})]}),h.jsxs("form",{onSubmit:_,className:"p-5 flex flex-col gap-4",children:[h.jsxs("div",{children:[h.jsxs("label",{htmlFor:"chat-name",className:"block mb-2 font-medium",style:{fontSize:"13px",letterSpacing:"0.015em",color:"rgba(247,247,248,0.72)"},children:["Name ",h.jsx("span",{style:{color:"#ff6363"},children:"*"})]}),h.jsx("input",{type:"text",id:"chat-name",value:i,onChange:w=>{a(w.target.value),c.name&&p(k=>({...k,name:void 0}))},onFocus:()=>y("name"),onBlur:()=>y(null),style:C("name",!!c.name),placeholder:"John Doe",disabled:f,autoComplete:"name"}),c.name&&h.jsx("p",{className:"mt-1.5",style:{fontSize:"12px",letterSpacing:"0.015em",color:"#ff6363"},role:"alert",children:c.name})]}),h.jsxs("div",{children:[h.jsxs("label",{htmlFor:"chat-email",className:"block mb-2 font-medium",style:{fontSize:"13px",letterSpacing:"0.015em",color:"rgba(247,247,248,0.72)"},children:["Email ",h.jsx("span",{style:{color:"#ff6363"},children:"*"})]}),h.jsx("input",{type:"email",id:"chat-email",value:l,onChange:w=>{u(w.target.value),c.email&&p(k=>({...k,email:void 0}))},onFocus:()=>y("email"),onBlur:()=>y(null),style:C("email",!!c.email),placeholder:"john@example.com",disabled:f,autoComplete:"email"}),c.email&&h.jsx("p",{className:"mt-1.5",style:{fontSize:"12px",letterSpacing:"0.015em",color:"#ff6363"},role:"alert",children:c.email})]}),h.jsx("button",{type:"submit",disabled:f,className:"w-full py-2.5 rounded-xl font-semibold text-white transition-all duration-200",style:{fontSize:"14px",letterSpacing:"0.006em",background:"linear-gradient(135deg, #337eff, #005eff)",boxShadow:"0 4px 16px -4px rgba(51,126,255,0.4)",opacity:f?.6:1,cursor:f?"not-allowed":"pointer"},onMouseEnter:w=>{f||(w.currentTarget.style.boxShadow="0 6px 20px -4px rgba(51,126,255,0.5)")},onMouseLeave:w=>{w.currentTarget.style.boxShadow="0 4px 16px -4px rgba(51,126,255,0.4)"},children:f?h.jsxs("span",{className:"flex items-center justify-center gap-2",children:[h.jsxs("svg",{className:"animate-spin",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-label":"Loading",children:[h.jsx("title",{children:"Loading"}),h.jsx("path",{d:"M21 12a9 9 0 11-6.219-8.56"})]}),"Starting Chat..."]}):"Start Chat"}),h.jsx("p",{className:"text-center",style:{fontSize:"11px",letterSpacing:"0.019em",color:"rgba(247,247,248,0.28)"},children:"We respect your privacy. Your information will only be used to assist you."})]}),h.jsx("div",{className:"px-4 py-1.5 text-center",style:{borderTop:"1px solid rgba(255,255,255,0.06)",backgroundColor:"rgba(0,0,0,0.2)"},children:h.jsxs("p",{style:{fontSize:"10px",letterSpacing:"0.025em",color:"rgba(247,247,248,0.28)"},children:["Powered by"," ",h.jsx("span",{style:{fontWeight:600,color:"rgba(247,247,248,0.45)"},children:"Xcelsior"})]})})]})}try{Ot.displayName="PreChatForm",Ot.__docgenInfo={description:`PreChatForm component for collecting user information before starting chat.
743
+ Styled to match the Xcelsior website design system.`,displayName:"PreChatForm",props:{onSubmit:{defaultValue:null,description:"",name:"onSubmit",required:!0,type:{name:"(name: string, email: string) => void"}},className:{defaultValue:{value:""},description:"",name:"className",required:!1,type:{name:"string | undefined"}},initialName:{defaultValue:{value:""},description:"",name:"initialName",required:!1,type:{name:"string | undefined"}},initialEmail:{defaultValue:{value:""},description:"",name:"initialEmail",required:!1,type:{name:"string | undefined"}},onMinimize:{defaultValue:null,description:"Callback when user wants to minimize the form",name:"onMinimize",required:!0,type:{name:"() => void"}},onClose:{defaultValue:null,description:"Callback when user wants to close the form",name:"onClose",required:!0,type:{name:"() => void"}}}}}catch{}const Is="xcelsior-chat-position",Un=5,Wt=64,Bn=16,xa=20,_a=.4,Fn=400,wa="cubic-bezier(0.2, 0.9, 0.3, 1.1)";function ka(){try{const e=localStorage.getItem(Is);if(e==="left"||e==="right")return e}catch{}return"right"}function Ca(e){try{localStorage.setItem(Is,e)}catch{}}function Hn(e){return e==="left"?Bn:window.innerWidth-Bn-Wt}function qn(){return window.innerHeight-xa-Wt}function Sa(e="auto"){const t=e==="auto"?ka():e,[n,r]=v.useState(t),s=v.useRef(n);s.current=n;const[o,i]=v.useState(!1),a=v.useRef(null),l=v.useRef(!1),u=v.useRef(!1),c=v.useRef({x:0,y:0}),p=v.useRef({x:0,y:0}),f=v.useRef([]),b=v.useRef(!1),[d,y]=v.useState(!1);v.useEffect(()=>{try{if(!localStorage.getItem("xcelsior-chat-hint-shown")&&!b.current){b.current=!0,y(!0);const w=setTimeout(()=>{y(!1),localStorage.setItem("xcelsior-chat-hint-shown","true")},2e3);return()=>clearTimeout(w)}}catch{}},[]),v.useEffect(()=>{const C=k=>{if(!l.current)return;const E=a.current;if(!E)return;const P=k.clientX-c.current.x,M=k.clientY-c.current.y;(Math.abs(P)>Un||Math.abs(M)>Un)&&(u.current=!0),E.style.transition="none",E.style.transform=`translate(${P}px, ${M}px)`;const I=performance.now();f.current.push({x:k.clientX,t:I}),f.current.length>5&&f.current.shift()},w=k=>{if(!l.current)return;l.current=!1;const E=a.current;if(!E)return;let P=0;const M=f.current;if(M.length>=2){const G=M[0],te=M[M.length-1],Z=te.t-G.t;Z>0&&(P=(te.x-G.x)/Z)}f.current=[];const I=p.current.x+(k.clientX-c.current.x),A=window.innerWidth/2;let $;Math.abs(P)>_a?$=P<0?"left":"right":$=I+Wt/2<A?"left":"right";const N=Hn(s.current),F=qn(),z=p.current.x+(k.clientX-c.current.x),j=p.current.y+(k.clientY-c.current.y),S=Hn($),R=qn(),D=z-N,B=j-F,H=S-N,ce=R-F;E.style.transition="none",E.style.transform=`translate(${D}px, ${B}px)`,E.offsetHeight,E.style.transition=`transform ${Fn}ms ${wa}`,E.style.transform=`translate(${H}px, ${ce}px)`;const J=()=>{E.style.transition="",E.style.transform="",E.removeEventListener("transitionend",J),i(!1),$!==s.current&&(r($),Ca($))};E.addEventListener("transitionend",J,{once:!0}),setTimeout(J,Fn+50)};return document.addEventListener("pointermove",C),document.addEventListener("pointerup",w),()=>{document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",w)}},[]);const g=v.useCallback(C=>{C.preventDefault();const w=a.current;if(!w)return;const k=w.getBoundingClientRect();c.current={x:C.clientX,y:C.clientY},p.current={x:k.left,y:k.top},l.current=!0,u.current=!1,f.current=[],i(!0)},[]),_=v.useCallback(()=>u.current,[]);return{position:n,isDragging:o,showHint:d,containerRef:a,shouldSuppressClick:_,handlers:{onPointerDown:g}}}function $a({state:e,defaultState:t="minimized",onStateChange:n}){const[r,s]=v.useState(t),o=e!==void 0&&e!=="undefined",i=o?e:r,a=v.useCallback(l=>{o||s(l),n==null||n(l)},[o,n]);return{currentState:i,setState:a,isControlled:o}}function Xe(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).substring(2,15)}`}function Dt({config:e,className:t="",storageKeyPrefix:n="xcelsior_chat",onPreChatSubmit:r,state:s,defaultState:o="minimized",onStateChange:i}){var D,B,H,ce,J,G,te,Z;const[a,l]=v.useState(null),[u,c]=v.useState(""),[p,f]=v.useState(!0),b=e.identityCollection||"progressive",{position:d,isDragging:y,showHint:g,containerRef:_,shouldSuppressClick:C,handlers:w}=Sa(e.position),k=v.useRef(!1),{currentState:E,setState:P}=$a({state:s,defaultState:o,onStateChange:i}),M=e.conversationId,I=(D=e.currentUser)==null?void 0:D.email,A=(B=e.currentUser)==null?void 0:B.name,$=(H=e.currentUser)==null?void 0:H.avatar,N=(ce=e.currentUser)==null?void 0:ce.status;v.useEffect(()=>{if(k.current)return;(()=>{var T;try{if(I&&A){const W=M||Xe();l({name:A,email:I,avatar:$,type:"customer",status:N}),c(W),f(!1),k.current=!0;return}const q=localStorage.getItem(`${n}_user`);if(q){const W=JSON.parse(q);if(!(Date.now()-W.timestamp>1440*60*1e3)&&W.email&&W.name){const K={name:W.name,email:W.email,type:"customer",status:"online"};l(K),c(W.conversationId),f(!1),k.current=!0;return}}const oe=M||Xe();if(c(oe),b==="progressive"||b==="none"){let W;try{const ne=localStorage.getItem("xcelsior-chat-anon-id");ne?W=ne:(W=`anon-${((T=crypto.randomUUID)==null?void 0:T.call(crypto))||Math.random().toString(36).slice(2)}`,localStorage.setItem("xcelsior-chat-anon-id",W))}catch{W=`anon-${Math.random().toString(36).slice(2)}`}const K={name:"Visitor",email:`${W}@anonymous.xcelsior.co`,type:"customer",status:"online"};l(K);try{localStorage.setItem(`${n}_user`,JSON.stringify({name:K.name,email:K.email,conversationId:oe,timestamp:Date.now()}))}catch{}}k.current=!0}catch(q){console.error("Error initializing chat session:",q),c(M||Xe()),k.current=!0}finally{f(!1)}})()},[M,I,A,$,N,n,b]);const F=v.useCallback((ie,T)=>{const q=u||Xe(),oe={name:ie,email:T,type:"customer",status:"online"},W={name:ie,email:T,conversationId:q,timestamp:Date.now()};try{localStorage.setItem(`${n}_user`,JSON.stringify(W))}catch{}l(oe),c(q),r==null||r(oe)},[u,n,r]);if(p||E==="closed")return null;const z=d==="left"?"left-4":"right-4",j=((J=e.theme)==null?void 0:J.primary)||"#337eff",S=((G=e.theme)==null?void 0:G.primaryStrong)||"#005eff";if(E==="minimized")return h.jsx("div",{ref:_,className:`fixed bottom-5 ${z} z-50 ${t}`,children:h.jsxs("button",{type:"button",onClick:()=>{C()||P("open")},className:`group relative rounded-full text-white flex items-center justify-center touch-none select-none ${g?"animate-bounce":""} ${y?"cursor-grabbing scale-110":"cursor-grab hover:scale-[1.08] transition-transform duration-300"}`,style:{width:64,height:64,background:`linear-gradient(135deg, ${j}, ${S})`,boxShadow:[`0 4px 24px 0 ${j}80`,"0 8px 32px -4px rgba(0,0,0,0.3)","inset 0 1px 0 0 rgba(255,255,255,0.2)"].join(", ")},"aria-label":"Open chat",...w,children:[h.jsx(Us,{size:36,className:"pointer-events-none"}),h.jsx("span",{className:"absolute inset-0 rounded-full animate-ping pointer-events-none",style:{backgroundColor:j,opacity:.15,animationDuration:"2.5s"}})]})});if(b==="form"&&(!a||!a.email||!a.name))return h.jsx(Ot,{onSubmit:F,className:t,initialName:(te=e.currentUser)==null?void 0:te.name,initialEmail:(Z=e.currentUser)==null?void 0:Z.email,onClose:()=>P("closed"),onMinimize:()=>P("minimized")});const R={...e,conversationId:u,currentUser:a||void 0};return h.jsx(It,{config:R,className:t,onClose:()=>P("closed"),onMinimize:()=>P("minimized"),resolvedPosition:d})}try{Dt.displayName="Chat",Dt.__docgenInfo={description:"",displayName:"Chat",props:{config:{defaultValue:null,description:"",name:"config",required:!0,type:{name:'Omit<IChatConfig, "conversationId"> & { conversationId?: string | undefined; }'}},className:{defaultValue:{value:""},description:"",name:"className",required:!1,type:{name:"string | undefined"}},storageKeyPrefix:{defaultValue:{value:"xcelsior_chat"},description:"",name:"storageKeyPrefix",required:!1,type:{name:"string | undefined"}},onPreChatSubmit:{defaultValue:null,description:"",name:"onPreChatSubmit",required:!1,type:{name:"((user: IUser) => void) | undefined"}},state:{defaultValue:null,description:"",name:"state",required:!1,type:{name:"enum",value:[{value:"undefined"},{value:'"undefined"'},{value:'"open"'},{value:'"minimized"'},{value:'"closed"'}]}},defaultState:{defaultValue:{value:"minimized"},description:"",name:"defaultState",required:!1,type:{name:"enum",value:[{value:"undefined"},{value:'"undefined"'},{value:'"open"'},{value:'"minimized"'},{value:'"closed"'}]}},onStateChange:{defaultValue:null,description:"",name:"onStateChange",required:!1,type:{name:"((state: ChatWidgetState) => void) | undefined"}}}}}catch{}const rc={title:"Components/Chat",component:Dt,parameters:{layout:"fullscreen"},tags:["autodocs"]},Ea={primary:"#337eff",primaryStrong:"#005eff",background:"#02164a",backgroundAlt:"#00001a",text:"#f7f7f8",textMuted:"rgba(247, 247, 248, 0.6)",statusPositive:"#1ed473",statusCaution:"#ffa938",statusNegative:"#ff6363",borderColor:"rgba(255, 255, 255, 0.1)"},fe={websocketUrl:"wss://dev-ws-chat.xcelsior.co",httpApiUrl:"https://dev-chat.xcelsior.co/api",enableEmoji:!0,enableFileUpload:!0,enableTypingIndicator:!0,fileUpload:{uploadUrl:"https://dev-chat.xcelsior.co/api/attachments/upload-url",maxFileSize:2*1024*1024,allowedTypes:["image/jpeg","image/png","image/gif","application/pdf","text/plain"]},enableReadReceipts:!0,apiKey:"test",theme:Ea,toast:{success:e=>console.log("Success:",e),error:e=>console.error("Error:",e),info:e=>console.log("Info:",e)}},Ee={args:{config:{...fe,identityCollection:"progressive"}}},je={args:{config:{...fe,identityCollection:"form"}}},Re={args:{config:{...fe,identityCollection:"progressive",currentUser:{name:"John Doe",email:"john@example.com",type:"customer",status:"online"}}}},Te={args:{config:{...fe,identityCollection:"progressive",position:"left"}}},Me={args:{config:{...fe,identityCollection:"progressive",position:"right"}}},Le={args:{config:{...fe,identityCollection:"progressive",position:"auto"}}},Pe={args:{config:{...fe,identityCollection:"progressive",theme:{primary:"#005eff",primaryStrong:"#003ecc",background:"#ffffff",backgroundAlt:"#f7f7f8",text:"#171719",textMuted:"rgba(23, 23, 25, 0.5)",statusPositive:"#1ed473",statusCaution:"#ffa938",statusNegative:"#ff6363",borderColor:"rgba(0, 0, 0, 0.1)"}}}},ze={args:{config:fe}},Ne={args:{config:fe,defaultState:"open"}},Ae={args:{config:{...fe,identityCollection:"progressive"},defaultState:"open"}};var Vn,Wn,Xn,Jn,Kn;Ee.parameters={...Ee.parameters,docs:{...(Vn=Ee.parameters)==null?void 0:Vn.docs,source:{originalSource:`{
744
+ args: {
745
+ config: {
746
+ ...baseConfig,
747
+ identityCollection: 'progressive'
748
+ }
749
+ }
750
+ }`,...(Xn=(Wn=Ee.parameters)==null?void 0:Wn.docs)==null?void 0:Xn.source},description:{story:"Progressive identity mode (default) — no pre-chat form, bot collects info during conversation",...(Kn=(Jn=Ee.parameters)==null?void 0:Jn.docs)==null?void 0:Kn.description}}};var Gn,Yn,Zn,Qn,er;je.parameters={...je.parameters,docs:{...(Gn=je.parameters)==null?void 0:Gn.docs,source:{originalSource:`{
751
+ args: {
752
+ config: {
753
+ ...baseConfig,
754
+ identityCollection: 'form'
755
+ }
756
+ }
757
+ }`,...(Zn=(Yn=je.parameters)==null?void 0:Yn.docs)==null?void 0:Zn.source},description:{story:"Form identity mode — shows pre-chat form before chat",...(er=(Qn=je.parameters)==null?void 0:Qn.docs)==null?void 0:er.description}}};var tr,nr,rr,sr,or;Re.parameters={...Re.parameters,docs:{...(tr=Re.parameters)==null?void 0:tr.docs,source:{originalSource:`{
758
+ args: {
759
+ config: {
760
+ ...baseConfig,
761
+ identityCollection: 'progressive',
762
+ currentUser: {
763
+ name: 'John Doe',
764
+ email: 'john@example.com',
765
+ type: 'customer',
766
+ status: 'online'
767
+ }
768
+ }
769
+ }
770
+ }`,...(rr=(nr=Re.parameters)==null?void 0:nr.docs)==null?void 0:rr.source},description:{story:"With known user — skips form/anonymous, goes straight to chat",...(or=(sr=Re.parameters)==null?void 0:sr.docs)==null?void 0:or.description}}};var ir,ar,cr,lr,ur;Te.parameters={...Te.parameters,docs:{...(ir=Te.parameters)==null?void 0:ir.docs,source:{originalSource:`{
771
+ args: {
772
+ config: {
773
+ ...baseConfig,
774
+ identityCollection: 'progressive',
775
+ position: 'left'
776
+ }
777
+ }
778
+ }`,...(cr=(ar=Te.parameters)==null?void 0:ar.docs)==null?void 0:cr.source},description:{story:"Widget positioned on the left",...(ur=(lr=Te.parameters)==null?void 0:lr.docs)==null?void 0:ur.description}}};var dr,fr,pr,hr,mr;Me.parameters={...Me.parameters,docs:{...(dr=Me.parameters)==null?void 0:dr.docs,source:{originalSource:`{
779
+ args: {
780
+ config: {
781
+ ...baseConfig,
782
+ identityCollection: 'progressive',
783
+ position: 'right'
784
+ }
785
+ }
786
+ }`,...(pr=(fr=Me.parameters)==null?void 0:fr.docs)==null?void 0:pr.source},description:{story:"Widget positioned on the right (explicit)",...(mr=(hr=Me.parameters)==null?void 0:hr.docs)==null?void 0:mr.description}}};var gr,br,vr,yr,xr;Le.parameters={...Le.parameters,docs:{...(gr=Le.parameters)==null?void 0:gr.docs,source:{originalSource:`{
787
+ args: {
788
+ config: {
789
+ ...baseConfig,
790
+ identityCollection: 'progressive',
791
+ position: 'auto'
792
+ }
793
+ }
794
+ }`,...(vr=(br=Le.parameters)==null?void 0:br.docs)==null?void 0:vr.source},description:{story:"Auto position — reads from localStorage, falls back to right",...(xr=(yr=Le.parameters)==null?void 0:yr.docs)==null?void 0:xr.description}}};var _r,wr,kr,Cr,Sr;Pe.parameters={...Pe.parameters,docs:{...(_r=Pe.parameters)==null?void 0:_r.docs,source:{originalSource:`{
795
+ args: {
796
+ config: {
797
+ ...baseConfig,
798
+ identityCollection: 'progressive',
799
+ theme: {
800
+ primary: '#005eff',
801
+ primaryStrong: '#003ecc',
802
+ background: '#ffffff',
803
+ backgroundAlt: '#f7f7f8',
804
+ text: '#171719',
805
+ textMuted: 'rgba(23, 23, 25, 0.5)',
806
+ statusPositive: '#1ed473',
807
+ statusCaution: '#ffa938',
808
+ statusNegative: '#ff6363',
809
+ borderColor: 'rgba(0, 0, 0, 0.1)'
810
+ }
811
+ }
812
+ }
813
+ }`,...(kr=(wr=Pe.parameters)==null?void 0:wr.docs)==null?void 0:kr.source},description:{story:"Light theme variant",...(Sr=(Cr=Pe.parameters)==null?void 0:Cr.docs)==null?void 0:Sr.description}}};var $r,Er,jr,Rr,Tr;ze.parameters={...ze.parameters,docs:{...($r=ze.parameters)==null?void 0:$r.docs,source:{originalSource:`{
814
+ args: {
815
+ config: baseConfig
816
+ }
817
+ }`,...(jr=(Er=ze.parameters)==null?void 0:Er.docs)==null?void 0:jr.source},description:{story:"Default (dark theme Xcelsior branded)",...(Tr=(Rr=ze.parameters)==null?void 0:Rr.docs)==null?void 0:Tr.description}}};var Mr,Lr,Pr,zr,Nr;Ne.parameters={...Ne.parameters,docs:{...(Mr=Ne.parameters)==null?void 0:Mr.docs,source:{originalSource:`{
818
+ args: {
819
+ config: baseConfig,
820
+ defaultState: 'open'
821
+ }
822
+ }`,...(Pr=(Lr=Ne.parameters)==null?void 0:Lr.docs)==null?void 0:Pr.source},description:{story:"Starts in open state",...(Nr=(zr=Ne.parameters)==null?void 0:zr.docs)==null?void 0:Nr.description}}};var Ar,Ir,Or,Dr,Ur;Ae.parameters={...Ae.parameters,docs:{...(Ar=Ae.parameters)==null?void 0:Ar.docs,source:{originalSource:`{
823
+ args: {
824
+ config: {
825
+ ...baseConfig,
826
+ identityCollection: 'progressive'
827
+ },
828
+ defaultState: 'open'
829
+ }
830
+ }`,...(Or=(Ir=Ae.parameters)==null?void 0:Ir.docs)==null?void 0:Or.source},description:{story:"Resizable widget — drag the bottom-right corner to resize",...(Ur=(Dr=Ae.parameters)==null?void 0:Dr.docs)==null?void 0:Ur.description}}};const sc=["ProgressiveIdentity","FormIdentity","WithKnownUser","PositionLeft","PositionRight","PositionAuto","LightTheme","Default","OpenByDefault","Resizable"];export{ze as Default,je as FormIdentity,Pe as LightTheme,Ne as OpenByDefault,Le as PositionAuto,Te as PositionLeft,Me as PositionRight,Ee as ProgressiveIdentity,Ae as Resizable,Re as WithKnownUser,sc as __namedExportsOrder,rc as default};