import{t as e}from"./card-BDbI8Gdq.js";import{t}from"./flex-Chz2_RPk.js";import{$t as n,Bi as r,Ca as i,Ci as a,Dn as o,Dt as s,Ea as c,Ei as l,Fi as u,Ii as d,It as f,Lt as p,Ni as m,Pi as h,Rr as g,Sa as _,Ti as v,W as y,X as b,Y as x,Z as S,_a as C,ai as w,at as T,ba as E,c as D,dr as O,fr as k,ft as A,g as j,gn as M,ot as N,pa as P,qt as ee,rr as F,rt as te,s as ne,st as I,ti as L,va as R,wa as z,wn as B,xa as re,ya as V,yn as H}from"./index-DThTpSPU.js";import{t as ie}from"./agent-B0_A2P2o.js";function ae(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n`u`?null:G(BigInt.prototype.toString),Ie=typeof Symbol>`u`?null:G(Symbol.prototype.toString),W=G(Object.prototype.hasOwnProperty),Le=G(Object.prototype.toString),Re=G(RegExp.prototype.test),ze=Be(TypeError);function G(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ye(e,t,n)}}function Be(e){return function(){return be(e,[...arguments])}}function K(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:De;if(fe&&fe(e,null),!Ee(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(pe(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Ve(e){for(let t=0;t/g),at=ge(/\${[\w\W]*/g),ot=ge(/^data-[\-\w.\u00B7-\uFFFF]+$/),st=ge(/^aria-[\-\w]+$/),ct=ge(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),lt=ge(/^(?:\w+script|data):/i),ut=ge(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),dt=ge(/^html$/i),ft=ge(/^[a-z][.\w]*(-[.\w]+)+$/i),pt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},mt=function(){return typeof window>`u`?null:window},ht=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},gt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function _t(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mt(),t=e=>_t(e);if(t.version=`3.4.7`,t.removed=[],!e||!e.document||e.document.nodeType!==pt.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=We(d,`cloneNode`),p=We(d,`remove`),m=We(d,`nextSibling`),h=We(d,`childNodes`),g=We(d,`parentNode`),_=We(d,`shadowRoot`),v=We(d,`attributes`),y=o&&o.prototype?We(o.prototype,`nodeType`):null,b=o&&o.prototype?We(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C=n,w=C.implementation,T=C.createNodeIterator,E=C.createDocumentFragment,D=C.getElementsByTagName,O=r.importNode,k=gt();t.isSupported=typeof de==`function`&&typeof g==`function`&&w&&w.createHTMLDocument!==void 0;let A=rt,j=it,M=at,N=ot,P=st,ee=lt,F=ut,te=ft,ne=ct,I=null,L=K({},[...Ke,...qe,...Je,...Xe,...Qe]),R=null,z=K({},[...$e,...et,...tt,...nt]),B=Object.seal(_e(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),re=null,V=null,H=Object.seal(_e(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ie=!0,ae=!0,oe=!1,se=!0,ce=!1,le=!0,ue=!1,fe=!1,pe=!1,me=!1,he=!1,ge=!1,ve=!0,ye=!1,be=`user-content-`,Ne=!0,Pe=!1,Fe={},Ie=null,Le=K({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),G=null,Be=K({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ve=null,vt=K({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),yt=`http://www.w3.org/1998/Math/MathML`,q=`http://www.w3.org/2000/svg`,bt=`http://www.w3.org/1999/xhtml`,xt=bt,St=!1,Ct=null,wt=K({},[yt,q,bt],Oe),Tt=K({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Et=K({},[`annotation-xml`]),Dt=K({},[`title`,`style`,`font`,`a`,`script`]),Ot=null,kt=[`application/xhtml+xml`,`text/html`],J=null,At=null,jt=n.createElement(`form`),Mt=function(e){return e instanceof RegExp||e instanceof Function},Nt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(At&&At===e)return;(!e||typeof e!=`object`)&&(e={}),e=He(e),Ot=kt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,J=Ot===`application/xhtml+xml`?Oe:De,I=W(e,`ALLOWED_TAGS`)&&Ee(e.ALLOWED_TAGS)?K({},e.ALLOWED_TAGS,J):L,R=W(e,`ALLOWED_ATTR`)&&Ee(e.ALLOWED_ATTR)?K({},e.ALLOWED_ATTR,J):z,Ct=W(e,`ALLOWED_NAMESPACES`)&&Ee(e.ALLOWED_NAMESPACES)?K({},e.ALLOWED_NAMESPACES,Oe):wt,Ve=W(e,`ADD_URI_SAFE_ATTR`)&&Ee(e.ADD_URI_SAFE_ATTR)?K(He(vt),e.ADD_URI_SAFE_ATTR,J):vt,G=W(e,`ADD_DATA_URI_TAGS`)&&Ee(e.ADD_DATA_URI_TAGS)?K(He(Be),e.ADD_DATA_URI_TAGS,J):Be,Ie=W(e,`FORBID_CONTENTS`)&&Ee(e.FORBID_CONTENTS)?K({},e.FORBID_CONTENTS,J):Le,re=W(e,`FORBID_TAGS`)&&Ee(e.FORBID_TAGS)?K({},e.FORBID_TAGS,J):He({}),V=W(e,`FORBID_ATTR`)&&Ee(e.FORBID_ATTR)?K({},e.FORBID_ATTR,J):He({}),Fe=W(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?He(e.USE_PROFILES):e.USE_PROFILES:!1,ie=e.ALLOW_ARIA_ATTR!==!1,ae=e.ALLOW_DATA_ATTR!==!1,oe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,se=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ce=e.SAFE_FOR_TEMPLATES||!1,le=e.SAFE_FOR_XML!==!1,ue=e.WHOLE_DOCUMENT||!1,me=e.RETURN_DOM||!1,he=e.RETURN_DOM_FRAGMENT||!1,ge=e.RETURN_TRUSTED_TYPE||!1,pe=e.FORCE_BODY||!1,ve=e.SANITIZE_DOM!==!1,ye=e.SANITIZE_NAMED_PROPS||!1,Ne=e.KEEP_CONTENT!==!1,Pe=e.IN_PLACE||!1,ne=Ge(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:ct,xt=typeof e.NAMESPACE==`string`?e.NAMESPACE:bt,Tt=W(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?He(e.MATHML_TEXT_INTEGRATION_POINTS):K({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Et=W(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?He(e.HTML_INTEGRATION_POINTS):K({},[`annotation-xml`]);let t=W(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?He(e.CUSTOM_ELEMENT_HANDLING):_e(null);if(B=_e(null),W(t,`tagNameCheck`)&&Mt(t.tagNameCheck)&&(B.tagNameCheck=t.tagNameCheck),W(t,`attributeNameCheck`)&&Mt(t.attributeNameCheck)&&(B.attributeNameCheck=t.attributeNameCheck),W(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(B.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),ce&&(ae=!1),he&&(me=!0),Fe&&(I=K({},Qe),R=_e(null),Fe.html===!0&&(K(I,Ke),K(R,$e)),Fe.svg===!0&&(K(I,qe),K(R,et),K(R,nt)),Fe.svgFilters===!0&&(K(I,Je),K(R,et),K(R,nt)),Fe.mathMl===!0&&(K(I,Xe),K(R,tt),K(R,nt))),H.tagCheck=null,H.attributeCheck=null,W(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?H.tagCheck=e.ADD_TAGS:Ee(e.ADD_TAGS)&&(I===L&&(I=He(I)),K(I,e.ADD_TAGS,J))),W(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?H.attributeCheck=e.ADD_ATTR:Ee(e.ADD_ATTR)&&(R===z&&(R=He(R)),K(R,e.ADD_ATTR,J))),W(e,`ADD_URI_SAFE_ATTR`)&&Ee(e.ADD_URI_SAFE_ATTR)&&K(Ve,e.ADD_URI_SAFE_ATTR,J),W(e,`FORBID_CONTENTS`)&&Ee(e.FORBID_CONTENTS)&&(Ie===Le&&(Ie=He(Ie)),K(Ie,e.FORBID_CONTENTS,J)),W(e,`ADD_FORBID_CONTENTS`)&&Ee(e.ADD_FORBID_CONTENTS)&&(Ie===Le&&(Ie=He(Ie)),K(Ie,e.ADD_FORBID_CONTENTS,J)),Ne&&(I[`#text`]=!0),ue&&K(I,[`html`,`head`,`body`]),I.table&&(K(I,[`tbody`]),delete re.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw ze(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw ze(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);x=e.TRUSTED_TYPES_POLICY,S=x.createHTML(``)}else x===void 0&&(x=ht(u,i)),x!==null&&typeof S==`string`&&(S=x.createHTML(``));(k.uponSanitizeElement.length>0||k.uponSanitizeAttribute.length>0)&&I===L&&(I=He(I)),k.uponSanitizeAttribute.length>0&&R===z&&(R=He(R)),U&&U(e),At=e},Pt=K({},[...qe,...Je,...Ye]),Ft=K({},[...Xe,...Ze]),It=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:xt,tagName:`template`});let n=De(e.tagName),r=De(t.tagName);return Ct[e.namespaceURI]?e.namespaceURI===q?t.namespaceURI===bt?n===`svg`:t.namespaceURI===yt?n===`svg`&&(r===`annotation-xml`||Tt[r]):!!Pt[n]:e.namespaceURI===yt?t.namespaceURI===bt?n===`math`:t.namespaceURI===q?n===`math`&&Et[r]:!!Ft[n]:e.namespaceURI===bt?t.namespaceURI===q&&!Et[r]||t.namespaceURI===yt&&!Tt[r]?!1:!Ft[n]&&(Dt[n]||!Pt[n]):!!(Ot===`application/xhtml+xml`&&Ct[e.namespaceURI]):!1},Lt=function(e){we(t.removed,{element:e});try{g(e).removeChild(e)}catch{p(e)}},Y=function(e,n){try{we(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{we(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(me||he)try{Lt(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Rt=function(e){let t=null,r=null;if(pe)e=``+e;else{let t=ke(e,/^[\r\n\t ]+/);r=t&&t[0]}Ot===`application/xhtml+xml`&&xt===bt&&(e=``+e+``);let i=x?x.createHTML(e):e;if(xt===bt)try{t=new l().parseFromString(i,Ot)}catch{}if(!t||!t.documentElement){t=w.createDocument(xt,`template`,null);try{t.documentElement.innerHTML=St?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),xt===bt?D.call(t,ue?`html`:`body`)[0]:ue?t.documentElement:a},zt=function(e){return T.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Bt=function(e){e.normalize();let t=T.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;){let e=n.data;xe([A,j,M],t=>{e=Ae(e,t,` `)}),n.data=e,n=t.nextNode()}},Vt=function(e){let t=b?b(e):null;return typeof t!=`string`||J(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},Ht=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===pt.documentFragment}catch{return!1}},Ut=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function Wt(e,n,r){xe(e,e=>{e.call(t,n,r,At)})}let Gt=function(e){let n=null;if(Wt(k.beforeSanitizeElements,e,null),Vt(e))return Lt(e),!0;let r=J(e.nodeName);if(Wt(k.uponSanitizeElement,e,{tagName:r,allowedTags:I}),le&&e.hasChildNodes()&&!Ut(e.firstElementChild)&&Re(/<[/\w!]/g,e.innerHTML)&&Re(/<[/\w!]/g,e.textContent)||le&&e.namespaceURI===bt&&r===`style`&&Ut(e.firstElementChild)||e.nodeType===pt.progressingInstruction||le&&e.nodeType===pt.comment&&Re(/<[/\w]/g,e.data))return Lt(e),!0;if(re[r]||!(H.tagCheck instanceof Function&&H.tagCheck(r))&&!I[r]){if(!re[r]&&Jt(r)&&(B.tagNameCheck instanceof RegExp&&Re(B.tagNameCheck,r)||B.tagNameCheck instanceof Function&&B.tagNameCheck(r)))return!1;if(Ne&&!Ie[r]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=f(n[i],!0);t.insertBefore(r,m(e))}}}return Lt(e),!0}return(y?y(e):e.nodeType)===pt.element&&!It(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Re(/<\/no(script|embed|frames)/i,e.innerHTML)?(Lt(e),!0):(ce&&e.nodeType===pt.text&&(n=e.textContent,xe([A,j,M],e=>{n=Ae(n,e,` `)}),e.textContent!==n&&(we(t.removed,{element:e.cloneNode()}),e.textContent=n)),Wt(k.afterSanitizeElements,e,null),!1)},Kt=function(e,t,r){if(V[t]||ve&&(t===`id`||t===`name`)&&(r in n||r in jt))return!1;let i=R[t]||H.attributeCheck instanceof Function&&H.attributeCheck(t,e);if(!(ae&&!V[t]&&Re(N,t))&&!(ie&&Re(P,t))){if(!i||V[t]){if(!(Jt(e)&&(B.tagNameCheck instanceof RegExp&&Re(B.tagNameCheck,e)||B.tagNameCheck instanceof Function&&B.tagNameCheck(e))&&(B.attributeNameCheck instanceof RegExp&&Re(B.attributeNameCheck,t)||B.attributeNameCheck instanceof Function&&B.attributeNameCheck(t,e))||t===`is`&&B.allowCustomizedBuiltInElements&&(B.tagNameCheck instanceof RegExp&&Re(B.tagNameCheck,r)||B.tagNameCheck instanceof Function&&B.tagNameCheck(r))))return!1}else if(!Ve[t]&&!Re(ne,Ae(r,F,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&je(r,`data:`)===0&&G[e])&&!(oe&&!Re(ee,Ae(r,F,``)))&&r)return!1}return!0},qt=K({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Jt=function(e){return!qt[De(e)]&&Re(te,e)},Yt=function(e){Wt(k.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||Vt(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:R,forceKeepAttr:void 0},i=n.length;for(;i--;){let a=n[i],o=a.name,s=a.namespaceURI,c=a.value,l=J(o),d=c,f=o===`value`?d:Me(d);if(r.attrName=l,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,Wt(k.uponSanitizeAttribute,e,r),f=r.attrValue,ye&&(l===`id`||l===`name`)&&je(f,be)!==0&&(Y(o,e),f=be+f),le&&Re(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){Y(o,e);continue}if(l===`attributename`&&ke(f,`href`)){Y(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Y(o,e);continue}if(!se&&Re(/\/>/i,f)){Y(o,e);continue}ce&&xe([A,j,M],e=>{f=Ae(f,e,` `)});let p=J(e.nodeName);if(!Kt(p,l,f)){Y(o,e);continue}if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!s)switch(u.getAttributeType(p,l)){case`TrustedHTML`:f=x.createHTML(f);break;case`TrustedScriptURL`:f=x.createScriptURL(f);break}if(f!==d)try{s?e.setAttributeNS(s,o,f):e.setAttribute(o,f),Vt(e)?Lt(e):Ce(t.removed)}catch{Y(o,e)}}Wt(k.afterSanitizeAttributes,e,null)},Xt=function(e){let t=null,n=zt(e);for(Wt(k.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Wt(k.uponSanitizeShadowNode,t,null),Gt(t),Yt(t),Ht(t.content)&&Xt(t.content),(y?y(t):t.nodeType)===pt.element){let e=_?_(t):t.shadowRoot;Ht(e)&&(Zt(e),Xt(e))}Wt(k.afterSanitizeShadowDOM,e,null)},Zt=function(e){let t=y?y(e):e.nodeType;if(t===pt.element){let t=_?_(e):e.shadowRoot;Ht(t)&&(Zt(t),Xt(t))}let n=h?h(e):e.childNodes;if(!n)return;let r=[];xe(n,e=>{we(r,e)});for(let e of r)Zt(e);if(t===pt.element){let t=b?b(e):null;if(typeof t==`string`&&J(t)===`template`){let t=e.content;Ht(t)&&Zt(t)}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(St=!e,St&&(e=``),typeof e!=`string`&&!Ut(e)&&(e=Ue(e),typeof e!=`string`))throw ze(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(fe||Nt(n),t.removed=[],typeof e==`string`&&(Pe=!1),Pe){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=J(t);if(!I[e]||re[e])throw ze(`root node is forbidden and cannot be sanitized in-place`)}if(Vt(e))throw ze(`root node is clobbered and cannot be sanitized in-place`);Zt(e)}else if(Ut(e))i=Rt(``),a=i.ownerDocument.importNode(e,!0),a.nodeType===pt.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Zt(a);else{if(!me&&!ce&&!ue&&e.indexOf(`<`)===-1)return x&&ge?x.createHTML(e):e;if(i=Rt(e),!i)return me?null:ge?S:``}i&&pe&&Lt(i.firstChild);let c=zt(Pe?e:i);for(;o=c.nextNode();)Gt(o),Yt(o),Ht(o.content)&&Xt(o.content);if(Pe)return ce&&Bt(e),e;if(me){if(ce&&Bt(i),he)for(s=E.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(R.shadowroot||R.shadowrootmode)&&(s=O.call(r,s,!0)),s}let l=ue?i.outerHTML:i.innerHTML;return ue&&I[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Re(dt,i.ownerDocument.doctype.name)&&(l=` `+l),ce&&xe([A,j,M],e=>{l=Ae(l,e,` `)}),x&&ge?x.createHTML(l):l},t.setConfig=function(){Nt(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),fe=!0},t.clearConfig=function(){At=null,fe=!1},t.isValidAttribute=function(e,t,n){return At||Nt({}),Kt(J(e),J(t),n)},t.addHook=function(e,t){typeof t==`function`&&we(k[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=Se(k[e],t);return n===-1?void 0:Te(k[e],n,1)[0]}return Ce(k[e])},t.removeHooks=function(e){k[e]=[]},t.removeAllHooks=function(){k=gt()},t}var vt=_t(),yt=z((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var t=`accept acceptCharset accessKey action allowFullScreen allowTransparency alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge charSet checked classID className colSpan cols content contentEditable contextMenu controls coords crossOrigin data dateTime default defer dir disabled download draggable encType form formAction formEncType formMethod formNoValidate formTarget frameBorder headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media mediaGroup method min minLength multiple muted name noValidate nonce open optimum pattern placeholder poster preload radioGroup readOnly rel required reversed role rowSpan rows sandbox scope scoped scrolling seamless selected shape size sizes span spellCheck src srcDoc srcLang srcSet start step style summary tabIndex target title type useMap value width wmode wrap onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`.split(/[\s\n]+/),n=`aria-`,r=`data-`;function i(e,t){return e.indexOf(t)===0}function a(e,a=!1){let o;o=a===!1?{aria:!0,data:!0,attr:!0}:a===!0?{aria:!0}:{...a};let s={};return Object.keys(e).forEach(a=>{(o.aria&&(a===`role`||i(a,n))||o.data&&i(a,r)||o.attr&&t.includes(a))&&(s[a]=e[a])}),s}})),q=c(i());function bt(e,t){return(0,q.useImperativeHandle)(e,()=>{let e=t(),{nativeElement:n}=e;return new Proxy(n,{get(t,n){return e[n]?e[n]:Reflect.get(t,n)}})})}var xt=q.createContext({}),St={classNames:{},styles:{},className:``,style:{},shortcutKeys:{}},Ct=e=>{let t=q.useContext(xt);return q.useMemo(()=>({...St,...t[e]}),[t[e]])};z((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.preMessage=void 0;var t={},n=[],r=e=>{n.push(e)};e.preMessage=r;function i(e,t){}function a(e,t){}function o(){t={}}function s(e,n,r){!n&&!t[r]&&(e(!1,r),t[r]=!0)}function c(e,t){s(i,e,t)}function l(e,t){s(a,e,t)}c.preMessage=r,c.resetWarned=o,c.noteOnce=l,e.default=c}))();function wt(){}var Tt=wt,Et=(0,q.createContext)(void 0),Dt=z(((e,t)=>{function n(e){return e&&e.__esModule?e:{default:e}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})),Ot=z((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default={items_per_page:`/ page`,jump_to:`Go to`,jump_to_confirm:`confirm`,page:`Page`,prev_page:`Previous Page`,next_page:`Next Page`,prev_5:`Previous 5 Pages`,next_5:`Next 5 Pages`,prev_3:`Previous 3 Pages`,next_3:`Next 3 Pages`,page_size:`Page Size`}})),kt=z((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.commonLocale=void 0,e.commonLocale={yearFormat:`YYYY`,dayFormat:`D`,cellMeridiemFormat:`A`,monthBeforeYear:!0}})),J=z((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=kt();function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default={placeholder:`Select time`,rangePlaceholder:[`Start time`,`End time`]}})),jt=z((e=>{var t=Dt().default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(J()),r=t(At());e.default={lang:{placeholder:`Select date`,yearPlaceholder:`Select year`,quarterPlaceholder:`Select quarter`,monthPlaceholder:`Select month`,weekPlaceholder:`Select week`,rangePlaceholder:[`Start date`,`End date`],rangeYearPlaceholder:[`Start year`,`End year`],rangeQuarterPlaceholder:[`Start quarter`,`End quarter`],rangeMonthPlaceholder:[`Start month`,`End month`],rangeWeekPlaceholder:[`Start week`,`End week`],...n.default},timePickerLocale:{...r.default}}})),Mt=z((e=>{var t=Dt().default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=t(jt()).default})),Nt=z((e=>{var t=Dt().default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(Ot()),r=t(Mt()),i=t(jt()),a=t(At()),o="${label} is not a valid ${type}";e.default={locale:`en`,Pagination:n.default,DatePicker:i.default,TimePicker:a.default,Calendar:r.default,global:{placeholder:`Please select`,close:`Close`,sortable:`sortable`,show:`Show`,hide:`Hide`},Table:{filterTitle:`Filter menu`,filterConfirm:`OK`,filterReset:`Reset`,filterEmptyText:`No filters`,filterCheckAll:`Select all items`,filterSearchPlaceholder:`Search in filters`,emptyText:`No data`,selectAll:`Select current page`,selectInvert:`Invert current page`,selectNone:`Clear all data`,selectionAll:`Select all data`,sortTitle:`Sort`,expand:`Expand row`,collapse:`Collapse row`,triggerDesc:`Click to sort descending`,triggerAsc:`Click to sort ascending`,cancelSort:`Click to cancel sorting`},Tour:{Next:`Next`,Previous:`Previous`,Finish:`Finish`},Modal:{okText:`OK`,cancelText:`Cancel`,justOkText:`OK`},Popconfirm:{okText:`OK`,cancelText:`Cancel`},Transfer:{titles:[``,``],searchPlaceholder:`Search here`,itemUnit:`item`,itemsUnit:`items`,remove:`Remove`,selectCurrent:`Select current page`,removeCurrent:`Remove current page`,selectAll:`Select all data`,deselectAll:`Deselect all data`,removeAll:`Remove all data`,selectInvert:`Invert current page`},Upload:{uploading:`Uploading...`,removeFile:`Remove file`,uploadError:`Upload error`,previewFile:`Preview file`,downloadFile:`Download file`},Empty:{description:`No data`},Icon:{icon:`icon`},Text:{edit:`Edit`,copy:`Copy`,copied:`Copied`,expand:`Expand`,collapse:`Collapse`},Form:{optional:`(optional)`,defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:o,method:o,array:o,object:o,number:o,date:o,boolean:o,integer:o,float:o,regexp:o,email:o,url:o,hex:o},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},QRCode:{expired:`QR code expired`,refresh:`Refresh`,scanned:`Scanned`},ColorPicker:{presetEmpty:`Empty`,transparent:`Transparent`,singleColor:`Single`,gradientColor:`Gradient`}}})),Pt=z(((e,t)=>{t.exports=Nt()})),Ft={locale:`en`,Conversations:{create:`New chat`},Sender:{stopLoading:`Stop loading`,speechRecording:`Speech recording`},Actions:{feedbackLike:`Like`,feedbackDislike:`Dislike`,audio:`Play audio`,audioRunning:`Audio playing`,audioError:`Playback error`,audioLoading:`Loading audio`},Bubble:{editableOk:`OK`,editableCancel:`Cancel`},Mermaid:{zoomIn:`Zoom in`,zoomOut:`Zoom out`,zoomReset:`Reset`,download:`Download`,code:`Code`,image:`Image`},Folder:{selectFile:`Please select a file`,loadError:`Failed to load file`,noService:`File content service not configured`,loadFailed:`Failed to load file`}},It=c(Pt()),Lt=(e,t)=>{let n=q.useContext(Et);return[q.useMemo(()=>{let r=t||Ft?.[e]||It.default?.[e],i=n?.[e]??{};return{...typeof r==`function`?r():r,...i||{}}},[e,t,n]),q.useMemo(()=>{let e=n?.locale;return n?.exist&&!e?Ft.locale:e},[n])]};function Y(){let{getPrefixCls:e,direction:t,csp:n,iconPrefixCls:r,theme:i}=q.useContext(g.ConfigContext);return{theme:i,getPrefixCls:e,direction:t,csp:n,iconPrefixCls:r}}var Rt=1e3,zt=4,Bt=140,Vt=Bt/2,Ht=250,Ut=500,Wt=.8;function Gt({className:e}){let[t]=Lt(`Sender`,Ft.Sender);return q.createElement(`svg`,{color:`currentColor`,viewBox:`0 0 ${Rt} ${Rt}`,xmlns:`http://www.w3.org/2000/svg`,className:e},q.createElement(`title`,null,t.speechRecording),Array.from({length:zt}).map((e,t)=>{let n=t*286.66666666666663,r=Rt/2-Ht/2,i=Rt/2-Ut/2;return q.createElement(`rect`,{fill:`currentColor`,rx:Vt,ry:Vt,height:Ht,width:Bt,x:n,y:r,key:t},q.createElement(`animate`,{attributeName:`height`,values:`${Ht}; ${Ut}; ${Ht}`,keyTimes:`0; 0.5; 1`,dur:`${Wt}s`,begin:`${Wt/zt*t}s`,repeatCount:`indefinite`}),q.createElement(`animate`,{attributeName:`y`,values:`${r}; ${i}; ${r}`,keyTimes:`0; 0.5; 1`,dur:`${Wt}s`,begin:`${Wt/zt*t}s`,repeatCount:`indefinite`}))}))}var Kt=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:`hidden`,"&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut}, opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:`hidden`,transition:`height ${e.motionDurationMid} ${e.motionEaseInOut}, opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}}),qt=`2.7.0`,Jt={blue:`#1677FF`,purple:`#722ED1`,cyan:`#13C2C2`,green:`#52C41A`,magenta:`#EB2F96`,pink:`#EB2F96`,red:`#F5222D`,orange:`#FA8C16`,yellow:`#FADB14`,volcano:`#FA541C`,geekblue:`#2F54EB`,gold:`#FAAD14`,lime:`#A0D911`,colorPrimary:`#1677ff`,colorSuccess:`#52c41a`,colorWarning:`#faad14`,colorError:`#ff4d4f`,colorInfo:`#1677ff`,colorLink:``,colorTextBase:``,colorBgBase:``,fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'`,fontFamilyCode:`'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace`,fontSize:14,lineWidth:1,lineType:`solid`,motionUnit:.1,motionBase:0,motionEaseOutCirc:`cubic-bezier(0.08, 0.82, 0.17, 1)`,motionEaseInOutCirc:`cubic-bezier(0.78, 0.14, 0.15, 0.86)`,motionEaseOut:`cubic-bezier(0.215, 0.61, 0.355, 1)`,motionEaseInOut:`cubic-bezier(0.645, 0.045, 0.355, 1)`,motionEaseOutBack:`cubic-bezier(0.12, 0.4, 0.29, 1.46)`,motionEaseInBack:`cubic-bezier(0.71, -0.46, 0.88, 0.6)`,motionEaseInQuint:`cubic-bezier(0.755, 0.05, 0.855, 0.06)`,motionEaseOutQuint:`cubic-bezier(0.23, 1, 0.32, 1)`,borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0};function Yt(e){return e>=0&&e<=255}function Xt(e,t){let{r:n,g:r,b:i,a:o}=new a(e).toRgb();if(o<1)return e;let{r:s,g:c,b:l}=new a(t).toRgb();for(let e=.01;e<=1;e+=.01){let t=Math.round((n-s*(1-e))/e),o=Math.round((r-c*(1-e))/e),u=Math.round((i-l*(1-e))/e);if(Yt(t)&&Yt(o)&&Yt(u))return new a({r:t,g:o,b:u,a:Math.round(e*100)/100}).toRgbString()}return new a({r:n,g:r,b:i,a:1}).toRgbString()}function Zt(e){let{override:t,...n}=e,r={...t};Object.keys(Jt).forEach(e=>{delete r[e]});let i={...n,...r},o=1200,s=1600;return i.motion===!1&&(i.motionDurationFast=`0s`,i.motionDurationMid=`0s`,i.motionDurationSlow=`0s`),{...i,colorFillContent:i.colorFillSecondary,colorFillContentHover:i.colorFill,colorFillAlter:i.colorFillQuaternary,colorBgContainerDisabled:i.colorFillTertiary,colorBorderBg:i.colorBgContainer,colorSplit:Xt(i.colorBorderSecondary,i.colorBgContainer),colorTextPlaceholder:i.colorTextQuaternary,colorTextDisabled:i.colorTextQuaternary,colorTextHeading:i.colorText,colorTextLabel:i.colorTextSecondary,colorTextDescription:i.colorTextTertiary,colorTextLightSolid:i.colorWhite,colorHighlight:i.colorError,colorBgTextHover:i.colorFillSecondary,colorBgTextActive:i.colorFill,colorIcon:i.colorTextTertiary,colorIconHover:i.colorText,colorErrorOutline:Xt(i.colorErrorBg,i.colorBgContainer),colorWarningOutline:Xt(i.colorWarningBg,i.colorBgContainer),fontSizeIcon:i.fontSizeSM,lineWidthFocus:i.lineWidth*3,lineWidth:i.lineWidth,controlOutlineWidth:i.lineWidth*2,controlInteractiveSize:i.controlHeight/2,controlItemBgHover:i.colorFillTertiary,controlItemBgActive:i.colorPrimaryBg,controlItemBgActiveHover:i.colorPrimaryBgHover,controlItemBgActiveDisabled:i.colorFill,controlTmpOutline:i.colorFillQuaternary,controlOutline:Xt(i.colorPrimaryBg,i.colorBgContainer),lineType:i.lineType,borderRadius:i.borderRadius,borderRadiusXS:i.borderRadiusXS,borderRadiusSM:i.borderRadiusSM,borderRadiusLG:i.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:`none`,linkHoverDecoration:`none`,linkFocusDecoration:`none`,controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:i.sizeXXS,paddingXS:i.sizeXS,paddingSM:i.sizeSM,padding:i.size,paddingMD:i.sizeMD,paddingLG:i.sizeLG,paddingXL:i.sizeXL,paddingContentHorizontalLG:i.sizeLG,paddingContentVerticalLG:i.sizeMS,paddingContentHorizontal:i.sizeMS,paddingContentVertical:i.sizeSM,paddingContentHorizontalSM:i.size,paddingContentVerticalSM:i.sizeXS,marginXXS:i.sizeXXS,marginXS:i.sizeXS,marginSM:i.sizeSM,margin:i.size,marginMD:i.sizeMD,marginLG:i.sizeLG,marginXL:i.sizeXL,marginXXL:i.sizeXXL,boxShadow:` 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowSecondary:` 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowTertiary:` 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02) `,screenXS:480,screenXSMin:480,screenXSMax:575,screenSM:576,screenSMMin:576,screenSMMax:767,screenMD:768,screenMDMin:768,screenMDMax:991,screenLG:992,screenLGMin:992,screenLGMax:o-1,screenXL:o,screenXLMin:o,screenXLMax:s-1,screenXXL:s,screenXXLMin:s,boxShadowPopoverArrow:`2px 2px 5px rgba(0, 0, 0, 0.05)`,boxShadowCard:` 0 1px 2px -2px ${new a(`rgba(0, 0, 0, 0.16)`).toRgbString()}, 0 3px 6px 0 ${new a(`rgba(0, 0, 0, 0.12)`).toRgbString()}, 0 5px 12px 4px ${new a(`rgba(0, 0, 0, 0.09)`).toRgbString()} `,boxShadowDrawerRight:` -6px 0 16px 0 rgba(0, 0, 0, 0.08), -3px 0 6px -4px rgba(0, 0, 0, 0.12), -9px 0 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowDrawerLeft:` 6px 0 16px 0 rgba(0, 0, 0, 0.08), 3px 0 6px -4px rgba(0, 0, 0, 0.12), 9px 0 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowDrawerUp:` 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowDrawerDown:` 0 -6px 16px 0 rgba(0, 0, 0, 0.08), 0 -3px 6px -4px rgba(0, 0, 0, 0.12), 0 -9px 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowTabsOverflowLeft:`inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)`,boxShadowTabsOverflowRight:`inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)`,boxShadowTabsOverflowTop:`inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)`,boxShadowTabsOverflowBottom:`inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)`,...r}}var Qt={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},$t={motionBase:!0,motionUnit:!0},en=d(I.defaultAlgorithm),tn={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},nn=(e,t,n)=>{let r=n.getDerivativeToken(e),{override:i,...a}=t,o={...r,override:i};return o=Zt(o),a&&Object.entries(a).forEach(([e,t])=>{let{theme:n,...r}=t,i=r;n&&(i=nn({...o,...r},{override:r},n)),o[e]=i}),o};function rn(){let{token:e,hashed:t,theme:n,override:r,cssVar:i,zeroRuntime:a}=q.useContext(I._internalContext),o={prefix:i?.prefix??`ant`,key:i?.key??`css-var-root`},s=n||en,[c,l,u]=h(s,[I.defaultSeed,e],{salt:`${qt}-${t||``}`,override:r,getComputedToken:nn,cssVar:{...o,unitless:Qt,ignore:$t,preserve:tn}});return[s,u,t?l:``,c,o,!!a]}function an(){let[e,t,n]=rn();return{theme:e,token:t,hashId:n}}var{genStyleHooks:on,genComponentStyleHook:sn,genSubStyleComponent:cn}=v({usePrefix:()=>{let{getPrefixCls:e,iconPrefixCls:t}=Y();return{iconPrefixCls:t,rootPrefixCls:e()}},useToken:()=>{let[e,t,n,r,i,a]=rn();return{theme:e,realToken:t,hashId:n,token:r,cssVar:i,zeroRuntime:a}},useCSP:()=>{let{csp:e}=Y();return e??{}},layer:{name:`antdx`}}),ln=z((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(e,t){let n=Object.assign({},e);return Array.isArray(t)&&t.forEach(e=>{delete n[e]}),n}})),un=q.createContext({});function dn(e){let t=getComputedStyle(e).display;return t===`block`||t===`flex`||t===`list-item`||t===`table`}function fn(e){let t=[``],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;n.nextNode();){let e=n.currentNode;if(e.nodeType===Node.TEXT_NODE){t[t.length-1]+=e.textContent;continue}e.tagName===`BR`&&e.parentNode?.childElementCount===1||(e.tagName===`BR`||dn(e))&&t.push(``)}return t.join(` `)}var pn=({content:e,prefixCls:n,okText:r,cancelText:i,onEditConfirm:a,onEditCancel:o})=>{let s=q.useRef(null),[c]=Lt(`Bubble`,Ft.Bubble),l=C(()=>{a?.(fn(s.current))}),u=C(()=>o?.());if(q.useEffect(()=>{s.current.textContent=e,s.current.focus();let t=window.getSelection(),n=document.createRange();n.selectNodeContents(s.current),n.collapse(!1),t.removeAllRanges(),t.addRange(n)},[]),typeof e!=`string`)throw Error(`Content of editable Bubble should be string`);let d=q.useMemo(()=>q.createElement(`div`,{ref:s,contentEditable:!0}),[]);return q.createElement(q.Fragment,null,d,q.createElement(t,{rootClassName:`${n}-editing-opts`,gap:8},q.createElement(M,{type:`primary`,shape:`round`,size:`small`,onClick:l},r||c.editableOk),q.createElement(M,{type:`text`,shape:`round`,size:`small`,onClick:u},i||c.editableCancel)))},mn=({prefixCls:e})=>q.createElement(`span`,{className:`${e}-dot`},q.createElement(`i`,{className:`${e}-dot-item`,key:`item-1`}),q.createElement(`i`,{className:`${e}-dot-item`,key:`item-2`}),q.createElement(`i`,{className:`${e}-dot-item`,key:`item-3`})),hn=new m(`loadingMove`,{"0%":{transform:`translateY(0)`},"10%":{transform:`translateY(4px)`},"20%":{transform:`translateY(0)`},"30%":{transform:`translateY(-4px)`},"40%":{transform:`translateY(0)`}}),gn=new m(`cursorBlink`,{"0%":{opacity:1},"50%":{opacity:0},"100%":{opacity:1}}),_n=new m(`fadeIn`,{"0%":{opacity:0},"100%":{opacity:1}}),vn=e=>{let{componentCls:t,fontSize:n,typingContent:r,typingAnimationDuration:i,typingAnimationName:a,lineHeight:o,paddingSM:s,colorText:c,calc:l}=e;return[{[t]:{display:`flex`,columnGap:s,[`&${t}-rtl`]:{direction:`rtl`},[`&${t}-loading`]:{alignItems:`center`},[`${t}-body`]:{display:`flex`,flexDirection:`column`,maxWidth:`100%`},[`${t}-content`]:{position:`relative`,boxSizing:`border-box`,minWidth:0,maxWidth:`100%`,minHeight:l(s).mul(2).add(l(o).mul(n)).equal(),paddingInline:`${u(e.padding)}`,paddingBlock:`${u(s)}`,color:c,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:`break-word`,"&-string":{whiteSpace:`pre-wrap`}},[`${t}-typing:last-child::after`]:{content:r,fontWeight:900,userSelect:`none`,opacity:1,marginInlineStart:`0.1em`,animationName:a,animationDuration:u(i),animationIterationCount:`infinite`,animationTimingFunction:`linear`},[`${t}-fade-in .fade-in`]:{display:`inline`,animationName:_n,animationDuration:`1s`,animationTimingFunction:`linear`},[`${t}-dot`]:{position:`relative`,height:e.controlHeight,display:`flex`,alignItems:`center`,columnGap:e.marginXS,padding:`0 ${u(e.paddingXXS)}`,alignSelf:`center`,"&-item":{backgroundColor:e.colorPrimary,borderRadius:`100%`,width:4,height:4,animationName:hn,animationDuration:`2s`,animationIterationCount:`infinite`,animationTimingFunction:`linear`,"&:nth-child(1)":{animationDelay:`0s`},"&:nth-child(2)":{animationDelay:`0.2s`},"&:nth-child(3)":{animationDelay:`0.4s`}}},[`&${t}-start`]:{flexDirection:`row`,alignSelf:`flex-start`,[`& ${t}-header`]:{flexDirection:`row`}},[`&${t}-end`]:{flexDirection:`row-reverse`,alignSelf:`flex-end`,[`& ${t}-header`]:{flexDirection:`row-reverse`},[`& ${t}-editing-opts`]:{flexDirection:`row-reverse`}}}},gn]},yn=e=>{let{componentCls:t}=e;return{[t]:{[`${t}-content`]:{"&-filled":{backgroundColor:e.colorFillContent},"&-outlined":{border:`1px solid ${e.colorBorderSecondary}`},"&-shadow":{boxShadow:e.boxShadowTertiary},"&-borderless":{backgroundColor:`transparent`,padding:0,minHeight:0}}}}},bn=e=>{let{componentCls:t,fontSize:n,lineHeight:r,paddingSM:i,borderRadius:a,calc:o}=e,s=o(n).mul(r).div(2).add(i).equal(),c=o(a).mul(2).equal(),l=`${t}-content`;return{[t]:{[l]:{"&-default":{borderRadius:{_skip_check_:!0,value:c}},"&-round":{borderRadius:{_skip_check_:!0,value:s}},"&-corner":{borderRadius:{_skip_check_:!0,value:c}},"&-editing":{"div:first-child":{outline:`none`},[`${t}-editing-opts`]:{marginBlockStart:e.marginSM,"button:last-child":{backgroundColor:e.colorBgContainer,"&:hover":{backgroundColor:e.colorBgLayout}}}}},[`&${t}-start ${t}-content-corner`]:{borderStartStartRadius:e.borderRadiusXS},[`&${t}-end ${t}-content-corner`]:{borderStartEndRadius:e.borderRadiusXS}}}},xn=e=>{let{componentCls:t}=e;return{[t]:{"&-divider":{width:`100%`,justifyContent:`center`,[`& ${t}-body`]:{width:`100%`}}}}},Sn=e=>{let{componentCls:t}=e;return{[`${t}-list`]:{maxHeight:`100%`,width:`100%`,boxSizing:`border-box`,[`& ${t}`]:{width:`100%`,boxSizing:`border-box`,paddingBlock:e.padding},[`& ${t}-start:not(${t}-divider):not(${t}-system)`]:{paddingInlineEnd:`15%`},[`& ${t}-end:not(${t}-divider):not(${t}-system)`]:{paddingInlineStart:`15%`},[`${t}-list-scroll-box`]:{overflowY:`auto`,display:`flex`,width:`100%`,maxHeight:`100%`,flexDirection:`column`,scrollbarWidth:`thin`,scrollbarColor:`${e.colorTextTertiary} transparent`,"&::-webkit-scrollbar":{width:8,backgroundColor:`transparent`},"&::-webkit-scrollbar-thumb":{backgroundColor:e.colorTextTertiary,borderRadius:e.borderRadiusSM}},[`${t}-list-autoscroll`]:{flexDirection:`column-reverse`},[`${t}-list-scroll-content`]:{display:`flex`,width:`100%`,height:`fit-content`,flexDirection:`column`,boxSizing:`border-box`,paddingInline:e.paddingXS}}}},Cn=e=>{let{componentCls:t,fontSize:n,lineHeight:r,paddingXXS:i,margin:a,colorText:o,fontSizeLG:s,calc:c}=e;return{[t]:{[`${t}-header`]:{display:`flex`,marginBottom:i,fontSize:n,lineHeight:r,color:o},[`${t}-footer`]:{display:`flex`,marginBlockStart:a,fontSize:n,lineHeight:r,color:o,"&-start":{flexDirection:`row`},"&-end":{flexDirection:`row-reverse`}},[`${t}-avatar`]:{minWidth:c(s).mul(2).equal()}}}},wn=e=>{let{componentCls:t,paddingSM:n,paddingXS:r,lineHeight:i,fontSize:a,fontSizeSM:o,calc:s}=e;return{[t]:{[`&${t}-system`]:{width:`100%`,justifyContent:`center`,[`${t}-content`]:{display:`flex`,gap:`${u(o)}`,alignItems:`center`,minHeight:s(r).mul(2).add(s(i).mul(a)).equal(),fontSize:`${u(a)}`,paddingInline:`${u(n)}`,paddingBlock:`${u(r)}`},[`${t}-system-content`]:{},[`${t}-system-extra`]:{}}}}},Tn=on(`Bubble`,e=>{let t=l(e,{});return[vn(t),yn(t),bn(t),Cn(t),Sn(t),wn(t),xn(t)]},()=>({typingContent:`"|"`,typingAnimationName:`cursorBlink`,typingAnimationDuration:`0.8s`})),En=z((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}})),Dn=c(z((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.useLayoutUpdateEffect=e.default=void 0;var t=o(i()),n=r(En());function r(e){return e&&e.__esModule?e:{default:e}}function a(e){if(typeof WeakMap!=`function`)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!=`object`&&typeof e!=`function`)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!==`default`&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}var s=(0,n.default)()?t.useLayoutEffect:t.useEffect,c=(e,n)=>{let r=t.useRef(!0);s(()=>e(r.current),n),s(()=>(r.current=!1,()=>{r.current=!0}),[])};e.useLayoutUpdateEffect=(e,t)=>{c(t=>{if(!t)return e()},t)},e.default=c}))());function On(e){return!e||e.length===0?``:e.reduce((e,t)=>{let n=0;for(;n{let e={effect:`fade-in`,interval:100,step:6,keepPrefix:!0};if(n===!0)return e;let{step:t=6,interval:r=100}=n,i=e=>typeof e==`number`;if(!i(r)||r<=0)throw`[Bubble] invalid prop typing.interval, expect positive number.`;if(!i(t)&&!Array.isArray(t))throw`[Bubble] invalid prop typing.step, expect positive number or positive number array`;if(i(t)&&t<=0)throw`[Bubble] invalid prop typing.step, expect positive number`;if(Array.isArray(t)){if(!i(t[0])||t[0]<=0)throw`[Bubble] invalid prop typing.step[0], expect positive number`;if(!i(t[1])||t[1]<=0)throw`[Bubble] invalid prop typing.step[1], expect positive number`;if(t[0]>t[1])throw`[Bubble] invalid prop typing.step, step[0] should less than step[1]`}return{...e,...n}},[n]),p=q.useRef({content:t,interval:f.interval,step:f.step});p.current={content:t,interval:f.interval,step:f.step};let m=()=>Math.random().toString().slice(2),h=q.useCallback(e=>{let t=0;c.current=f.keepPrefix?On([p.current.content,c.current]):``,o(c.current?[{text:c.current,id:m(),taskId:e,done:!0}]:[]);let n=()=>{if(e!==l.current)return;let a=performance.now(),{content:f,interval:h,step:g}=p.current;if(a-t[{text:t.map(({text:e})=>e).join(``),id:m(),taskId:e,done:!0}]),i?.(f),s.current=!1,l.current++;return}c.current+=y;let b={id:m(),text:y,taskId:e,done:!1};o(e=>e.concat(b)),s.current||=!0,t=a,u.current=requestAnimationFrame(n),r?.(c.current,f)};n()},[f.keepPrefix,r,i]),g=q.useCallback(()=>{cancelAnimationFrame(u.current),o([]),c.current=``,s.current=!1},[]);return(0,Dn.default)(()=>{if(!t)return g();t!==c.current&&(s.current&&!t.startsWith(c.current)?(cancelAnimationFrame(u.current),s.current=!1,requestAnimationFrame(()=>h(++l.current))):s.current===!1&&h(l.current))},[t,h]),{renderedData:a,animating:s.current,memoedAnimationCfg:f}}var An=({prefixCls:e,streaming:t,content:n,typing:i,onTyping:a,onTypingComplete:o})=>{let{renderedData:s,animating:c,memoedAnimationCfg:l}=kn({streaming:t,content:n,typing:i,onTyping:a,onTypingComplete:o}),{effect:u}=l,d=s.map(e=>u===`fade-in`&&!e.done?q.createElement(`span`,{key:e.id,className:`fade-in`},e.text):e.text),f=i===!0?!1:u===`typing`;return q.createElement(`div`,{className:r({[`${e}-typing`]:f&&c,[`${e}-fade-in`]:!f})},d)},jn=c(yt()),Mn=q.forwardRef(({prefixCls:e,rootClassName:t,style:n,className:i,styles:a={},classNames:o={},placement:s=`start`,content:c,contentRender:l,editable:u=!1,typing:d,streaming:f=!1,variant:p=`filled`,shape:m=`default`,header:h,footer:g,avatar:_,extra:v,footerPlacement:y,loading:b,loadingRender:x,onTyping:S,onTypingComplete:C,onEditConfirm:w,onEditCancel:T,...E},D)=>{let k=q.useRef(null);q.useImperativeHandle(D,()=>({nativeElement:k.current}));let A=Ct(`bubble`),{direction:j,getPrefixCls:M}=Y(),N=M(`bubble`,e),P=q.useContext(un),[ee,F]=Tn(N),te={...A.style,...A.styles.root,...a.root,...n},ne=r(N,A.className,A.classNames.root,o.root,t,i,ee,F,`${N}-${s}`,{[`${N}-${P.status}`]:P.status,[`${N}-rtl`]:j===`rtl`,[`${N}-loading`]:b}),I=(0,jn.default)(E,{attr:!0,aria:!0,data:!0}),L={key:P?.key,status:P?.status,extraInfo:P?.extraInfo},R=q.useMemo(()=>l?l(c,L):c,[c,l,L.key,L.status,L.extraInfo]),z=typeof d==`function`?d(c,L):d,B=!!z&&typeof R==`string`;q.useEffect(()=>{B||f||c&&C?.(c)},[R,B,f]);let re=y||(s===`start`?`outer-start`:`outer-end`),V=typeof u==`boolean`?u:u.editing,H=()=>{if(b)return x?x():q.createElement(mn,{prefixCls:N});let e=q.createElement(q.Fragment,null,B?q.createElement(An,{prefixCls:N,streaming:f,typing:z,content:R,onTyping:S,onTypingComplete:C}):R),t=re.includes(`inner`);return q.createElement(`div`,{className:ie(`body`),style:ae(`body`)},le(),q.createElement(`div`,{style:{...A.styles.content,...a.content},className:r(`${N}-content`,`${N}-content-${p}`,A.classNames.content,o.content,{[`${N}-content-${P?.status}`]:P?.status,[`${N}-content-${m}`]:p!==`borderless`,[`${N}-content-editing`]:V,[`${N}-content-string`]:typeof R==`string`})},V?q.createElement(pn,{prefixCls:N,content:c,okText:u?.okText,cancelText:u?.cancelText,onEditConfirm:w,onEditCancel:T}):q.createElement(q.Fragment,null,t?q.createElement(`div`,{className:r(`${N}-content-with-footer`)},e):e,t&&ue())),!V&&!t&&ue())},ie=e=>r(`${N}-${e}`,A.classNames[e],o[e]),ae=e=>({...A.styles[e],...a[e]}),oe=e=>typeof e==`function`?e(c,L):e,se=()=>_?q.createElement(`div`,{className:ie(`avatar`),style:ae(`avatar`)},oe(_)):null,ce=()=>v?q.createElement(`div`,{className:ie(`extra`),style:ae(`extra`)},oe(v)):null,le=()=>h?q.createElement(`div`,{className:ie(`header`),style:ae(`header`)},oe(h)):null,ue=()=>{if(!g)return null;let e=r(ie(`footer`),{[`${N}-footer-start`]:re.includes(`start`),[`${N}-footer-end`]:re.includes(`end`)});return q.createElement(`div`,{className:e,style:ae(`footer`)},oe(g))};return q.createElement(`div`,O({className:ne,style:te},E,I,{ref:k}),se(),H(),!V&&!b&&ce())}),Nn=q.forwardRef(({prefixCls:e,content:t=``,rootClassName:n,style:i,className:a,styles:o={},classNames:s={},dividerProps:c,...l},u)=>{let{getPrefixCls:d}=Y(),f=Ct(`bubble`),p=d(`bubble`,e),[m,h]=Tn(p),g=r(m,h,p,`${p}-divider`,f.className,f.classNames.root,a,s.root,n);return q.createElement(Mn,O({ref:u,style:i,styles:o,className:g,classNames:s,prefixCls:p,variant:`borderless`,content:t,contentRender:e=>q.createElement(ee,c,e)},l))});function Pn(e){return getComputedStyle(e).flexDirection===`column-reverse`}function Fn(e,t){let n=(0,q.useRef)(null),r=(0,q.useRef)(!0),i=(0,q.useRef)(!1),a=(0,q.useRef)(0),o=(0,q.useRef)(void 0),s=(0,q.useRef)(!1),c=(0,q.useRef)(!1);(0,q.useLayoutEffect)(()=>{if(!e||!t)return;if(!n.current){let t=document.createElement(`div`);t.style.bottom=`0`,t.style.flexShrink=`0`,t.style.pointerEvents=`none`,t.style.height=`10px`,t.style.visibility=`hidden`,e.insertBefore(t,e.firstChild),n.current=t}let a=new IntersectionObserver(([e])=>{r.current=e.isIntersecting,i.current=!e.isIntersecting},{root:e,threshold:0});a.observe(n.current);let s=new ResizeObserver(()=>{if(e){if(o.current){c.current&&requestAnimationFrame(()=>e.scrollTo({top:Pn(e)?0:e.scrollHeight,behavior:`instant`}));return}Pn(e)&&i.current&&d()}});return s.observe(t),()=>{a.disconnect(),s.disconnect(),clearTimeout(o.current),n.current?.parentNode&&(n.current.parentNode.removeChild(n.current),n.current=null)}},[e,t]);let l=(0,q.useCallback)(()=>{o.current=setTimeout(()=>{clearTimeout(o.current),o.current=void 0,c.current=!1},50)},[]),u=(0,q.useCallback)(e=>{let t=e.target;if(!Pn(t))return;let{scrollTop:n,scrollHeight:r}=t;if(a.current=r+n,s.current){s.current=!1;return}o.current&&clearTimeout(o.current),l()},[l]);(0,q.useLayoutEffect)(()=>{if(e)return e.addEventListener(`scroll`,u,{capture:!0}),()=>e?.removeEventListener(`scroll`,u,{capture:!0})},[e,u]);let d=(0,q.useCallback)(()=>{e.scrollTop=a.current-e.scrollHeight,s.current=!0},[e]);return{reset:(0,q.useCallback)(()=>{r.current=!0,i.current=!1,a.current=e?.scrollHeight||0},[e]),scrollTo:(0,q.useCallback)(n=>{if(!e||!t)return;let{top:r,intoView:i,intoViewDom:a}=n||{};Pn(e)?r!==void 0&&r>=-10?c.current=!0:a&&i?.block===`end`?c.current=t.lastElementChild===a:c.current=!1:r!==void 0&&r>=e.scrollHeight-e.clientHeight-10?c.current=!0:a&&i?.block===`end`?c.current=t.lastElementChild===a:c.current=!1,o.current||l(),a?a.scrollIntoView(i):e.scrollTo(n)},[e,t])}}var In=q.forwardRef(({prefixCls:e,content:t,variant:n=`shadow`,shape:i,style:a,className:o,styles:s={},classNames:c={},rootClassName:l,...u},d)=>{let f=Ct(`bubble`),{getPrefixCls:p}=Y(),m=p(`bubble`,e),[h,g]=Tn(m),_=r(h,g,`${m}-system`,m,f.className,f.classNames.root,c.root,o,l);return q.createElement(Mn,O({ref:d,style:a,className:_,styles:s,classNames:c,variant:n,shape:i,content:t},u))}),Ln=c(ln());function Rn(e){return typeof e==`function`&&e instanceof Function}var zn=q.memo(Mn),Bn=q.memo(Nn),Vn=q.memo(In),Hn=e=>{let{_key:t,bubblesRef:n,extraInfo:r,status:i,role:a,classNames:o={},styles:s={},...c}=e,l=q.useCallback(e=>{e?n.current[t]=e:delete n.current[t]},[t]),{root:u,bubble:d,divider:f,system:p,...m}=o,{root:h,bubble:g,divider:_,system:v,...y}=s,b=q.createElement(zn,O({ref:l,style:h||g,className:u||d,classNames:m,styles:y},c));return a===`divider`?b=q.createElement(Bn,O({ref:l,style:h||_,className:u||f,classNames:m,styles:y},c)):a===`system`&&(b=q.createElement(Vn,O({ref:l,style:h||v,className:u||p,classNames:m,styles:y},c))),q.createElement(un.Provider,{value:{key:t,status:i,extraInfo:r}},b)};Mn.List=q.forwardRef((e,t)=>{let{prefixCls:n,rootClassName:i,className:a,styles:o={},classNames:s={},style:c,items:l,autoScroll:u=!0,role:d,onScroll:f,...p}=e,m=(0,jn.default)(p,{attr:!0,aria:!0}),h=q.useRef(null),g=q.useRef({}),[_,v]=q.useState(),[y,b]=q.useState(),{scrollTo:x}=Fn(_,y),{getPrefixCls:S}=Y(),C=S(`bubble`,n),w=`${C}-list`,[T,E]=Tn(C),D=r(w,i,a,s.root,T,E),k={...o.root,...c};return bt(t,()=>({nativeElement:h.current,scrollBoxNativeElement:_,scrollTo:({key:e,top:t,behavior:n=`smooth`,block:r})=>{let{scrollHeight:i,clientHeight:a}=_;typeof t==`number`?x({top:u?-i+a+t:t,behavior:n}):t===`bottom`?x({top:u?0:i,behavior:n}):t===`top`?x({top:u?-i:0,behavior:n}):e&&g.current[e]&&x({intoView:{behavior:n,block:r},intoViewDom:g.current[e].nativeElement})}})),q.createElement(`div`,O({},m,{className:D,style:k,ref:h}),q.createElement(`div`,{className:r(`${w}-scroll-box`,s.scroll,{[`${w}-autoscroll`]:u}),style:o.scroll,ref:e=>v(e),onScroll:f},q.createElement(`div`,{ref:e=>b(e),className:r(`${w}-scroll-content`)},l.map(e=>{let t;if(e.role&&d){let n=d[e.role];t={...Rn(n)?n(e):n,...e}}else t=e;return q.createElement(Hn,O({classNames:(0,Ln.default)(s,[`root`,`scroll`]),styles:(0,Ln.default)(o,[`root`,`scroll`])},(0,Ln.default)(t,[`key`]),{key:e.key,_key:e.key,bubblesRef:g}))}))))}),Mn.System=In,Mn.Divider=Nn;var Un=Mn,Wn=()=>({height:0,opacity:0}),Gn=e=>{let{scrollHeight:t}=e;return{height:t,opacity:1}},Kn=e=>({height:e?e.offsetHeight:0}),qn=(e,t)=>t?.deadline===!0||t.propertyName===`height`,Jn=(e=`ant`)=>({motionName:`${e}-motion-collapse`,onAppearStart:Wn,onEnterStart:Wn,onAppearActive:Gn,onEnterActive:Gn,onLeaveStart:Kn,onLeaveActive:Wn,onAppearEnd:qn,onEnterEnd:qn,onLeaveEnd:qn,motionDeadline:500}),Yn=(e,t,n)=>{let r=typeof e==`boolean`||e?.expandedKeys===void 0,[i,a,o,s]=q.useMemo(()=>{let t={expandedKeys:[],defaultExpandedKeys:[],onExpand:()=>{}};return e?(typeof e==`object`&&(t={...t,...e}),[!0,t.defaultExpandedKeys,t.expandedKeys,t.onExpand]):[!1,t.defaultExpandedKeys,t.expandedKeys,t.onExpand]},[e]),[c,l]=P(a||[],r?void 0:o),u=e=>{l(t=>{let n=r?t:o,i=n.includes(e)?n.filter(t=>t!==e):[...n,e];return s?.(i),i})},d=q.useMemo(()=>i?{...Jn(n),motionAppear:!1,leavedClassName:`${t}-content-hidden`}:{},[n,t,i]);return[i,c,i?u:void 0,d]},Xn=c(z((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){let{keyCode:n}=e;if(e.altKey&&!e.ctrlKey||e.metaKey||n>=t.F1&&n<=t.F12)return!1;switch(n){case t.ALT:case t.CAPS_LOCK:case t.CONTEXT_MENU:case t.CTRL:case t.DOWN:case t.END:case t.ESC:case t.HOME:case t.INSERT:case t.LEFT:case t.MAC_FF_META:case t.META:case t.NUMLOCK:case t.NUM_CENTER:case t.PAGE_DOWN:case t.PAGE_UP:case t.PAUSE:case t.PRINT_SCREEN:case t.RIGHT:case t.SHIFT:case t.UP:case t.WIN_KEY:case t.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=t.ZERO&&e<=t.NINE||e>=t.NUM_ZERO&&e<=t.NUM_MULTIPLY||e>=t.A&&e<=t.Z||window.navigator.userAgent.indexOf(`WebKit`)!==-1&&e===0)return!0;switch(e){case t.SPACE:case t.QUESTION_MARK:case t.NUM_PLUS:case t.NUM_MINUS:case t.NUM_PERIOD:case t.NUM_DIVISION:case t.SEMICOLON:case t.DASH:case t.EQUALS:case t.COMMA:case t.PERIOD:case t.SLASH:case t.APOSTROPHE:case t.SINGLE_QUOTE:case t.OPEN_SQUARE_BRACKET:case t.BACKSLASH:case t.CLOSE_SQUARE_BRACKET:return!0;default:return!1}},isEditableTarget:function(e){let t=e.target;if(!(t instanceof HTMLElement))return!1;let n=t.tagName;return!!(n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t.isContentEditable)}};e.default=t}))()),Zn={Alt:[`altKey`,`⌥`,`Alt`],Ctrl:[`ctrlKey`,`⌃`,`Ctrl`],Meta:[`metaKey`,`⌘`,`Win`],Shift:[`shiftKey`,`⇧`,`Shift`]},Qn=Array.from({length:9},(e,t)=>Xn.default.ONE+t),$n=/(mac|iphone|ipod|ipad)/i.test(typeof navigator<`u`?navigator?.platform:``),er=e=>e===`number`?e:typeof e==`string`&&Zn?.[e]?.[$n?1:2]?Zn[e][$n?1:2]:Object.entries(Xn.default||{})?.find(([t,n])=>n===e)?.[0]||``,tr=(e,t)=>{let n=[...e],r=n.pop();return n.reduce((e,n)=>e&&(t[Zn?.[n]?.[0]]||!1),r===t.keyCode)?{actionShortcutKey:e,actionKeyCodeNumber:Qn.indexOf(t.keyCode)>-1?Qn.indexOf(t.keyCode):!1,actionKeyCode:t.keyCode,timeStamp:t.timeStamp}:!1},nr=e=>{let t=[...e],n=t.pop();return{keyCodeDict:n===`number`?Qn:[n],prefixKeys:t}},rr=(e,t,n)=>{Tt(!e.find(({shortcutKey:e})=>e.toString()===t.toString()),n,`Same shortcutKey ${t.toString()}`)},ir=(e,t,n)=>{let r=Object.assign({},t||{},n);return Object.keys(r).reduce(({flattenShortcutKeys:t,shortcutKeysInfo:n},i)=>{let a=r[i];if(!Array.isArray(a))return{flattenShortcutKeys:t,shortcutKeysInfo:n};if(n={...n,[i]:{shortcutKeys:a,shortcutKeysIcon:[]}},a.every(e=>Array.isArray(e)))a.forEach((r,a)=>{let o=r;rr(t,o,e),t.push({name:i,shortcutKey:o,index:a}),n[i].shortcutKeysIcon.push(o?.map(e=>er(e)))});else{let{keyCodeDict:r,prefixKeys:o}=nr(a);r.forEach(n=>{rr(t,[...o,n],e),t.push({name:i,shortcutKey:[...o,n]})}),n[i].shortcutKeysIcon=a.map(e=>er(e))}return{flattenShortcutKeys:t,shortcutKeysInfo:n}},{flattenShortcutKeys:[],shortcutKeysInfo:{}})},ar=()=>{let e=(0,q.useRef)(void 0);return[e,t=>{e.current=t}]},or=(e,t)=>{let{flattenShortcutKeys:n,shortcutKeysInfo:r}=ir(e,Ct(e).shortcutKeys,t),[i,a]=(0,q.useState)(null),[o,s]=ar(),c=(0,q.useRef)(!1),l=e=>{for(let t of n){let n=tr(t.shortcutKey,e);if(n){let e={...n,name:t.name,index:t?.index};if(c.current)return;c.current=!0,a(e),o?.current?.(e)}}},u=()=>{c.current=!1};return(0,q.useEffect)(()=>{if(n.length!==0)return document.addEventListener(`keydown`,l),document.addEventListener(`keyup`,u),()=>{document.removeEventListener(`keydown`,l),document.removeEventListener(`keyup`,u)}},[n.length,o]),[i,r,s]},sr=({shortcutKeysIcon:e,prefixCls:t})=>{let[n]=Lt(`Conversations`,Ft.Conversations),i=!!e?.length;return q.createElement(`div`,{className:r(t,{[`${t}-shortcut-keys-show`]:i})},q.createElement(`span`,null,n.create),i&&q.createElement(`span`,{className:r(`${t}-shortcut-keys`)},e.map(e=>q.createElement(`span`,{className:r(`${t}-shortcut-key`),key:e},e))))},cr=({icon:e,label:t,align:r,shortcutKeyInfo:i,prefixCls:a})=>{let{shortcutKeysIcon:o}=i||{},s={label:q.createElement(sr,{prefixCls:`${a}-label`,shortcutKeysIcon:o}),icon:q.createElement(n,{className:`${a}-icon`}),align:`center`};return t&&(s.label=typeof t==`function`?t({shortcutKeyInfo:i,components:{CreationLabel:sr}}):t),e&&(s.icon=typeof e==`function`?e():e),[s.icon,s.label,r||s.align]},lr=({className:e,icon:t,label:n,align:i,style:a,disabled:o,onClick:s,prefixCls:c,shortcutKeyInfo:l})=>{let[u,d,f]=cr({prefixCls:c,label:n,icon:t,align:i,shortcutKeyInfo:l});return q.createElement(`button`,{type:`button`,onClick:e=>{o||s?.(e)},style:a,className:r(c,e,`${c}-${f}`,{[`${c}-disabled`]:o})},u,d)},ur=q.createContext(null),dr=({className:e,children:t})=>{let{prefixCls:n,groupInfo:i,enableCollapse:a,expandedKeys:o,onItemExpand:s,collapseMotion:c}=q.useContext(ur)||{},{label:l,name:u,collapsible:d}=i||{},f=typeof l==`function`?l(u,{groupInfo:i}):l||u,p=d&&a,m=()=>{p&&s?.(i.name)},h=p&&!!o?.includes?.(u);return q.createElement(`li`,{className:e},q.createElement(`div`,{className:r(`${n}-group-title`,{[`${n}-group-title-collapsible`]:p}),onClick:m},f&&q.createElement(`div`,{className:r(`${n}-group-label`)},f),p&&q.createElement(`div`,{className:r(`${n}-group-collapse-trigger `,`${n}-group-collapse-trigger-${h?`open`:`close`}`)},q.createElement(k,null))),q.createElement(L,O({},c,{visible:p?h:!0}),({className:e,style:n},i)=>q.createElement(`div`,{className:r(e),ref:i,style:n},t)))},fr=(e,t=[])=>{let[n,r,i]=(0,q.useMemo)(()=>{let t={label:``,collapsibleHandle:!1,collapsibleOptions:{}};if(!e)return[``,t.collapsibleHandle,t.collapsibleOptions];if(typeof e==`object`){let{collapsible:n,defaultExpandedKeys:r,expandedKeys:i,onExpand:a,...o}=e;t={...t,...o,collapsibleHandle:n,collapsibleOptions:{defaultExpandedKeys:r,expandedKeys:i,onExpand:a}}}return[t.label,t.collapsibleHandle,t.collapsibleOptions]},[e]);return q.useMemo(()=>{let a=t.reduce((t,i)=>{if(i?.type===`divider`||!i.group||!e)return t.push({data:[i],name:``,label:``,enableGroup:!1,collapsible:!1}),t;let a=i,o=t.some((e,n)=>e.name===a?.group?(t[n].data.push(a),!0):!1),s=typeof r==`function`?r?.(a?.group):r;return o||t.push({data:[a],enableGroup:!0,name:a?.group,label:n,collapsible:s}),t},[]);return[a,i,a.reduce((e,t)=>(t.data.forEach(t=>{t.type!==`divider`&&e.push({key:t.key,disabled:t.disabled})}),e),[])]},[t,i])},pr=e=>{e.stopPropagation()},mr=e=>{let{prefixCls:t,info:n,className:i,direction:a,onClick:o,active:s,menu:c,...l}=e,u=(0,jn.default)(l,{aria:!0,data:!0,attr:!0}),{disabled:d}=n,p=r(i,`${t}-item`,{[`${t}-item-active`]:s&&!d},{[`${t}-item-disabled`]:d}),m=()=>{!d&&o&&o(n.key)},{trigger:h,...g}=c||{},_=g?.getPopupContainer;return q.createElement(`li`,O({title:typeof n.label==`object`?void 0:`${n.label}`},u,{className:p,onClick:m}),n.icon&&q.createElement(`div`,{className:`${t}-icon`},n.icon),q.createElement(te.Text,{className:`${t}-label`},n.label),!d&&c&&q.createElement(`div`,{onClick:pr},q.createElement(f,{menu:g,placement:a===`rtl`?`bottomLeft`:`bottomRight`,trigger:[`click`],disabled:d,getPopupContainer:_},(e=>{let n=q.createElement(H,{onClick:pr,className:`${t}-menu-icon`});return h?typeof h==`function`?h(e,{originNode:n}):h:n})(n))))},hr=e=>{let{componentCls:t,calc:n}=e;return{[t]:{display:`flex`,flexDirection:`column`,gap:e.paddingXXS,overflowY:`auto`,padding:e.paddingSM,margin:0,listStyle:`none`,"ul, ol":{margin:0,padding:0,listStyle:`none`},[`&${t}-rtl`]:{direction:`rtl`},[`${t}-creation`]:{backgroundColor:e.creationBgColor,color:e.colorPrimary,border:`none`,fontWeight:500,paddingBlock:e.paddingXS,paddingInline:e.paddingSM,fontSize:e.fontSize,cursor:`pointer`,display:`flex`,gap:e.paddingXS,marginBlockEnd:e.marginSM,lineHeight:e.lineHeight,borderRadius:e.borderRadiusLG,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,[`&:not(${t}-creation-disabled):hover`]:{color:e.colorPrimary,background:e.creationHoverColor},[`&:not(${t}-creation-disabled)`]:{border:`${u(e.lineWidth)} ${e.lineType}, ${e.creationBorderColor}`},"&-start":{justifyContent:`flex-start`},"&-center":{justifyContent:`center`},"&-end":{justifyContent:`flex-end`},"&-label":{display:`flex`,justifyContent:`space-between`,alignItems:`center`},"&-label-shortcut-keys-show":{flex:1},"&-label-shortcut-keys":{height:e.controlHeightXS,display:`flex`,alignItems:`center`,gap:u(4)},"&-label-shortcut-key":{borderRadius:e.borderRadiusSM,height:`100%`,boxSizing:`border-box`,fontSize:e.fontSizeIcon,paddingInline:`${u(n(e.paddingXXS).sub(1).equal())}`,display:`flex`,justifyContent:`center`,alignItems:`center`,color:e.shortcutKeyTextColor,border:`${u(e.lineWidth)} ${e.lineType}, ${e.creationBorderColor}`},"&-disabled":{cursor:`not-allowed`,background:e.colorBgContainerDisabled,[`& ${t}-creation-label, ${t}-creation-icon`]:{color:e.colorTextDisabled},[`& ${t}-creation-label-shortcut-keys`]:{color:e.colorTextDisabled,border:`${u(e.lineWidth)} ${e.lineType}, ${e.colorBgContainerDisabled}`}}},[`${t}-divider`]:{marginBlock:e.marginXXS},[`${t}-item`]:{display:`flex`,height:e.controlHeightLG,minHeight:e.controlHeightLG,gap:e.paddingXS,padding:`0 ${u(e.paddingXS)}`,alignItems:`center`,borderRadius:e.borderRadiusLG,cursor:`pointer`,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,[`&:not(${t}-item-disabled):hover`]:{backgroundColor:e.colorBgTextHover},"&-active":{backgroundColor:e.colorBgTextHover,[`& ${t}-label, ${t}-menu-icon`]:{color:e.colorText}},"&-disabled":{cursor:`not-allowed`,[`& ${t}-label, ${t}-icon, ${t}-menu-icon`]:{color:e.colorTextDisabled}},"&:hover, &-active":{[`& ${t}-menu-icon`]:{opacity:.6}},[`${t}-menu-icon:hover`]:{opacity:1}},[`${t}-content-hidden`]:{display:`none`},[`${t}-label`]:{flex:1,color:e.colorText,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},[`${t}-menu-icon`]:{opacity:0,fontSize:e.fontSizeXL},[`${t}-list`]:{display:`flex`,gap:e.paddingXXS,flexDirection:`column`},[`${t}-group-collapsible-list`]:{paddingBlockStart:e.paddingXXS,[`& ${t}-item`]:{paddingInlineStart:e.paddingXL}},[`${t}-group-title`]:{display:`flex`,alignItems:`center`,color:e.colorTextDescription,height:e.controlHeightLG,minHeight:e.controlHeightLG,padding:`0 ${u(e.paddingXS)}`},[`${t}-group-title-collapsible`]:{justifyContent:`space-between`,cursor:`pointer`,color:e.colorText,borderRadius:e.borderRadiusLG,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,"&:hover":{backgroundColor:e.colorBgTextHover}},[`${t}-group-collapse-trigger`]:{transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,transform:`rotate(0deg)`,transformOrigin:`center center`},[`${t}-group-collapse-trigger-open`]:{transform:`rotate(90deg)`},[`${t}-group-collapse-trigger-close`]:{transform:`rotate(0deg)`}}}},gr=on(`Conversations`,e=>{let t=l(e,{});return[hr(t),Kt(t)]},e=>{let t=new a(e.colorPrimary).setA(.15),n=new a(e.colorPrimary).setA(.22),r=new a(e.colorPrimary).setA(.25),i=new a(e.colorPrimary).setA(.65);return{creationBgColor:t.toRgbString(),creationBorderColor:n.toRgbString(),creationHoverColor:r.toRgbString(),shortcutKeyTextColor:i.toRgbString()}}),_r=q.forwardRef((e,t)=>{let{prefixCls:n,shortcutKeys:i,rootClassName:a,items:o,activeKey:s,defaultActiveKey:c,onActiveChange:l,menu:u,styles:d={},classNames:f={},groupable:p,className:m,style:h,creation:g,..._}=e,v=(0,jn.default)(_,{attr:!0,aria:!0,data:!0}),y=q.useRef(null);bt(t,()=>({nativeElement:y.current}));let[b,x]=P(c,s),[S,C,w]=fr(p,o),{getPrefixCls:T,direction:E}=Y(),D=T(`conversations`,n),k=Ct(`conversations`),[A,j]=gr(D),M=r(D,k.className,k.classNames.root,m,f.root,a,A,j,{[`${D}-rtl`]:E===`rtl`}),N=e=>{x(e),l?.(e,o?.find(t=>t.key===e))},[F,te,ne]=or(`conversations`,i);ne(e=>{switch(e?.name){case`items`:{let t=e?.actionKeyCodeNumber??e?.index;typeof t==`number`&&!w?.[t]?.disabled&&w?.[t]?.key&&(x(w?.[t]?.key),l?.(w?.[t]?.key,o?.find(e=>e.key===w?.[t]?.key)))}break;case`creation`:typeof g?.onClick==`function`&&!g?.disabled&&g.onClick();break}});let I=e=>e.map((e,t)=>{if(e.type===`divider`)return q.createElement(ee,{key:`key-divider-${t}`,className:`${D}-divider`,dashed:e.dashed});let n=e,{label:i,disabled:a,icon:o,...s}=n;return q.createElement(mr,O({},s,{key:n.key||`key-${t}`,info:n,prefixCls:D,direction:E,className:r(f.item,k.classNames.item,n.className),style:{...k.styles.item,...d.item,...n.style},menu:typeof u==`function`?u(n):u,active:b===n.key,onClick:N}))}),[L,R,z,B]=Yn(C,D,T());return q.createElement(`ul`,O({},v,{style:{...k.style,...h,...k.styles.root,...d.root},className:M,ref:y}),!!g&&q.createElement(lr,O({className:r(k.classNames.creation,f.creation),style:{...k.styles.creation,...d.creation},shortcutKeyInfo:te?.creation,prefixCls:`${D}-creation`},g)),S.map((e,t)=>{let n=I(e.data);return e.enableGroup?q.createElement(ur.Provider,{key:e.name||`key-${t}`,value:{prefixCls:D,groupInfo:e,enableCollapse:L,expandedKeys:R,onItemExpand:z,collapseMotion:B}},q.createElement(dr,{className:r(k.classNames.group,f.group)},q.createElement(`ul`,{className:r(`${D}-list`,{[`${D}-group-collapsible-list`]:e.collapsible}),style:{...k.styles.group,...d.group}},n))):n}))});_r.Creation=lr;var vr=q.createContext(null),yr=q.forwardRef((e,t)=>{let{className:n,action:i,onClick:a,...o}=e,s=(0,q.useContext)(vr),{prefixCls:c,disabled:l,setSubmitDisabled:u}=s,d=o.disabled??l??s[`${i}Disabled`];return(0,q.useEffect)(()=>{i===`onSend`&&u?.(d)},[d,i,u]),q.createElement(M,O({type:`text`},o,{ref:t,onClick:e=>{d||(s[i]?.(),a?.(e))},disabled:d,className:r(c,n,{[`${c}-disabled`]:d})}))});function br(e,t){return q.createElement(yr,O({icon:q.createElement(y,null)},e,{action:`onClear`,ref:t}))}var xr=q.forwardRef(br),Sr=(0,q.memo)(e=>{let{className:t}=e,[n]=Lt(`Sender`,Ft.Sender);return q.createElement(`svg`,{color:`currentColor`,viewBox:`0 0 1000 1000`,xmlns:`http://www.w3.org/2000/svg`,className:t},q.createElement(`title`,null,n.stopLoading),q.createElement(`rect`,{fill:`currentColor`,height:`250`,rx:`24`,ry:`24`,width:`250`,x:`375`,y:`375`}),q.createElement(`circle`,{cx:`500`,cy:`500`,fill:`none`,r:`450`,stroke:`currentColor`,strokeWidth:`100`,opacity:`0.45`}),q.createElement(`circle`,{cx:`500`,cy:`500`,fill:`none`,r:`450`,stroke:`currentColor`,strokeWidth:`100`,strokeDasharray:`600 9999999`},q.createElement(`animateTransform`,{attributeName:`transform`,dur:`1s`,from:`0 500 500`,repeatCount:`indefinite`,to:`360 500 500`,type:`rotate`})))}),Cr=q.forwardRef((e,t)=>{let{prefixCls:n}=q.useContext(vr),{className:i}=e;return q.createElement(yr,O({icon:q.createElement(Sr,{className:`${n}-loading-icon`}),color:`primary`,variant:`text`,shape:`circle`},e,{className:r(i,`${n}-loading-button`),action:`onCancel`,ref:t}))});function wr(e,t){return q.createElement(yr,O({icon:q.createElement(S,null),type:`primary`,shape:`circle`},e,{action:`onSend`,ref:t}))}var Tr=q.forwardRef(wr),Er=q.createContext({}),Dr=e=>{let t=(0,q.useCallback)(()=>typeof window>`u`?null:window.getSelection(),[]),n=(e,t)=>{if(!e||!t)return t;let n=e,r=null;for(n.nodeType===Node.TEXT_NODE&&(n=n.parentElement);n&&n!==t;)n instanceof HTMLElement&&n.tagName===`SPAN`&&(r=n),n=n.parentElement;return r||t},r=(0,q.useCallback)(()=>{let e=t();if(!e)return{range:null,selection:e};try{return{range:e.getRangeAt(0)||document.createRange(),selection:e}}catch{return{range:document.createRange(),selection:e}}},[t]),i=(0,q.useCallback)((e,t)=>{if(!(!e||!t))try{t.removeAllRanges(),t.addRange(e)}catch(e){Tt(!1,`Sender`,`Failed to set range: ${e}`)}},[]),a=(0,q.useCallback)(()=>{let e=t();if(e)try{e.removeAllRanges()}catch(e){Tt(!1,`Sender`,`Failed to remove all ranges: ${e}`)}},[t]),o=(0,q.useCallback)((e,t=!1)=>{if(!(!e||typeof e.focus!=`function`))try{e.focus({preventScroll:t})}catch(e){Tt(!1,`Sender`,`Failed to focus element: ${e}`)}},[]),s=(0,q.useCallback)((e,t)=>{if(!e)return;o(e,t);let{range:n,selection:a}=r();if(n&&a)try{n.selectNodeContents(e),n.collapse(!1),i(n,a)}catch(e){Tt(!1,`Sender`,`Failed to set end cursor: ${e}`)}},[o,r,i]),c=(0,q.useCallback)((e,t)=>{if(!e)return;o(e,t);let{range:n,selection:a}=r();if(n&&a)try{n.selectNodeContents(e),n.collapse(!0),i(n,a)}catch(e){Tt(!1,`Sender`,`Failed to set start cursor: ${e}`)}},[o,r,i]),l=(0,q.useCallback)((e,t,n)=>{if(!e)return;o(e,n);let{range:a,selection:s}=r();if(a&&s)try{a.selectNodeContents(e),t&&a.setStart(e,1),i(a,s)}catch(e){Tt(!1,`Sender`,`Failed to select all content: ${e}`)}},[o,r,i]),u=(0,q.useCallback)((e,t,n,a)=>{if(!e||typeof n!=`number`||n<0||!t)return{range:null,selection:null};o(t,a);let{range:s,selection:c}=r();if(s&&c)try{let t=Math.min(n,e.childNodes.length);s.setStart(e,t),s.setEnd(e,t),s.collapse(!1),i(s,c)}catch(e){Tt(!1,`Sender`,`Failed to set cursor position:: ${e}`)}return{range:s,selection:c}},[o,r,i]),d=(0,q.useCallback)((t,n,r=!1)=>{if(!e||!t?.current)return;let{getSlotDom:i,slotConfigMap:a}=e,o=e=>{let t=i(e);if(!t)return null;let n=a.get(e);if(!n)return null;if(n.type===`input`)return t.querySelector(`input`);let r=t?.getAttribute?.(`data-node-type`)||``;return n.type===`content`&&r!==`nbsp`?t:null},s=(e=>{let n=t.current;if(!n)return null;if(e)return o(e);for(let e of Array.from(n.childNodes)){let t=e?.getAttribute?.(`data-slot-key`);if(t){let e=o(t);if(e)return e}}return null})(n);s&&(s.nodeName===`INPUT`?s.focus({preventScroll:r}):u(s,t.current,0,r))},[e,u]),f=(0,q.useCallback)((e,t,n,r,i)=>{!n||!r||(o(t,i),n?.setStartAfter(e),n.collapse(!1),r.removeAllRanges(),r.addRange(n))},[o]),p=(0,q.useCallback)(e=>{if(!e)return{value:``,startContainer:null,startOffset:0};let n=t();if(!n||n.rangeCount===0)return{value:``,startContainer:null,startOffset:0};try{let t=n.getRangeAt(0),r=t.cloneRange();if(!e.contains(t.startContainer))return{value:``,startContainer:null,startOffset:0};if(t.endContainer===e&&t.endContainer.lastChild?.nodeType===Node.TEXT_NODE){let e=t.endContainer.lastChild;t=document.createRange(),t.setStart(e,e.length),t.setEnd(e,e.length)}return r=t.cloneRange(),r.selectNodeContents(e),r.setEnd(t.startContainer,t.startOffset),{value:r.toString().replace(/\u200B/g,``),startContainer:t.startContainer,startOffset:t.startOffset}}catch(e){return Tt(!1,`Sender`,`Failed to get text before cursor: ${e}`),{value:``,startContainer:null,startOffset:0}}},[t]),m=(0,q.useCallback)((i,a,o)=>{if(i===`start`||i===`end`)return{type:i,selection:t()};let l=null,u=null;if(o?.current)l=o.current,u=t();else{let e=r();l=e.range,u=e.selection}if(!l||!u)return{type:`end`,selection:u};let d=a?.current;if(!d)return{type:`end`,selection:u};let f=d.contains(l.endContainer),p=d.contains(l.startContainer);if(!f)return s(d,!0),{type:`end`,selection:u};if(!p)return c(d,!0),{type:`start`,selection:u};let m=n(l.endContainer,d),h=n(l.startContainer,d);if(m===h&&h!==d&&e?.getNodeInfo){let{slotKey:t,slotConfig:n,skillKey:r}=e.getNodeInfo(m)||{};if(t)return{type:`slot`,slotKey:n?.key,slotType:n?.type,range:l,selection:u};if(r)return{type:`start`,selection:u}}return{type:`box`,range:l,selection:u}},[e,r,t,s,c,n]),h=(0,q.useCallback)(e=>{let t=e.childNodes[e.childNodes.length-1];return u(e,e,t?.nodeType===Node.TEXT_NODE&&t.textContent===` `?e.childNodes.length-1:e.childNodes.length).range||document.createRange()},[u]),g=(0,q.useCallback)(t=>u(t,t,+!!e?.getEditorValue?.().skill).range||document.createRange(),[u,e]),_=(0,q.useCallback)(e=>e.replace(/\u200B/g,``).replace(/\n/g,``).replace(/^\n+|\n+$/g,``),[]);return{setEndCursor:s,setStartCursor:c,setAllSelectCursor:l,setCursorPosition:u,setAfterNodeFocus:f,setSlotFocus:d,getTextBeforeCursor:p,getSelection:t,removeAllRanges:a,getRange:r,getInsertPosition:m,getEndRange:h,getStartRange:g,copySelectionString:(0,q.useCallback)(async()=>{try{let e=t();if(!e)return!1;let n=e.toString();if(!n)return!1;let r=_(n);return await navigator.clipboard.writeText(r),!0}catch(e){return Tt(!1,`Sender`,`Failed to copy selection: ${e}`),!1}},[t,_]),getCleanedText:_}},Or=4.35,kr=(e,t,n)=>{let{token:r}=an(),i=n.current?window.getComputedStyle(n.current):{},a=parseFloat(`${e.lineHeight||r.lineHeight}`),o=parseFloat(`${i?.fontSize||e.fontSize||r.fontSize}`),s=i?.lineHeight?parseFloat(`${i?.lineHeight}`):a*o;return t===!1||!t?{}:t===!0?{height:`auto`}:{minHeight:t.minRows?(s+Or)*t.minRows:`auto`,maxHeight:t.maxRows?(s+Or)*t.maxRows:`auto`,overflowY:`auto`}},Ar=e=>{let{prefixCls:t,placeholder:n,slotDomMap:i,slotConfigMap:a}=e,o=(0,q.useCallback)(e=>{let r=document.createElement(`span`);return r.setAttribute(`contenteditable`,`false`),r.dataset.skillKey=e,r.dataset.placeholder=n||``,r.className=`${t}-skill`,r},[t,n]),s=(0,q.useCallback)(e=>{let n=document.createElement(`span`);return n.setAttribute(`contenteditable`,`true`),n.dataset.slotKey=e.key,n.className=r(`${t}-slot`,`${t}-slot-content`),n},[t]),c=(0,q.useCallback)(e=>{let n=document.createElement(`span`);return n.setAttribute(`contenteditable`,`false`),n.dataset.slotKey=e,n.className=`${t}-slot`,n},[t]),l=(0,q.useCallback)((e,n)=>{let i=document.createElement(`span`);return i.setAttribute(`contenteditable`,`false`),i.dataset.slotKey=e,i.dataset.nodeType=`nbsp`,i.className=r(`${t}-slot-${n}`,`${t}-slot-no-width`),i.textContent=`\xA0`,i},[t]),u=(e,t)=>{i.current.set(e,t)},d=e=>i.current.get(e);return{buildSkillSpan:o,buildEditSlotSpan:s,buildSlotSpan:c,buildSpaceSpan:l,saveSlotDom:u,getSlotDom:d,getSlotLastDom:(e,t)=>(t??a.get(e)?.type)===`content`?d(`${e}_after`):d(e)}},jr=new Set([`input`,`select`,`custom`,`content`]),Mr=e=>e?.reduce((e,t)=>{let{key:n,type:r}=t;if(!n)return e;let i=t.props||{};return e[n]=(jr.has(r)?i.defaultValue:i.value??i.label)??``,e},{})??{},Nr=(e,t)=>{e?.forEach(e=>{e.key&&t.set(e.key,e)})},Pr=(e,t)=>{if(!e?.dataset)return null;let{dataset:n}=e;return{slotKey:n.slotKey,placeholder:n.placeholder,nodeType:n.nodeType,skillKey:n.skillKey,slotConfig:n.slotKey?t.get(n.slotKey):void 0,targetNode:e}},Fr=e=>{let[t,n]=(0,q.useState)({}),r=(0,q.useRef)(t),i=(0,q.useRef)(new Map);(0,q.useEffect)(()=>{if(!e)return;i.current.clear(),Nr(e,i.current);let t=Mr(e);n(t),r.current=t},[e]);let a=(0,q.useCallback)(e=>{let t=typeof e==`function`?e(r.current):e;n(t),r.current=t},[]),o=(0,q.useCallback)(e=>{let t=Mr(e);e.forEach(e=>{e.key&&i.current.set(e.key,e)}),n(e=>({...e,...t})),r.current={...r.current,...t}},[]),s=(0,q.useCallback)(e=>Pr(e,i.current),[]);return[i.current,{getSlotValues:()=>r.current,setSlotValues:a,mergeSlotConfig:o,getNodeInfo:s,getNodeTextValue:e=>{let t=e.nodeType;if(t===Node.TEXT_NODE)return e.textContent||``;if(t!==Node.ELEMENT_NODE)return``;let n=e,i=s(n);if(!i)return n.innerText||``;let{slotKey:a,skillKey:o,nodeType:c,slotConfig:l}=i;if(o)return``;let u=n.innerText||``;if(a){if(c===`nbsp`)return` `;if(!l||l.type===`content`)return u;let e=r.current[a]??``;return l.formatResult?.(e)??e}return u}}]},Ir=({removeSkill:e,prefixCls:t,toolTip:n,closable:i,title:a,value:s})=>{let c=`${t}-skill`,l=(0,q.useMemo)(()=>{if(!i)return[null];let t=typeof i==`boolean`?{}:i,n=n=>{t.disabled||(n.stopPropagation(),e(),t.onClose?.(n))},a=t.closeIcon||q.createElement(w,{className:`${c}-close-icon`});return q.createElement(`div`,{className:r(`${c}-close`,{[`${c}-close-disabled`]:t.disabled}),onClick:n,role:`button`,"aria-label":`Close skill`,tabIndex:0},a)},[i,e]),u=a||s,d=n?q.createElement(o,n,u):u;return q.createElement(`div`,{className:`${c}-wrapper`,contentEditable:!1},q.createElement(`div`,{className:`${c}-tag`,contentEditable:!1,role:`button`,tabIndex:0},q.createElement(`span`,{className:`${c}-tag-text`},d),l),q.createElement(`div`,{className:`${c}-holder`}))};Ir.displayName=`Skill`;var Lr=c(_()),Rr=q.forwardRef((e,t)=>{let{onChange:n,onKeyUp:i,onKeyDown:a,onPaste:o,onPasteFile:c,disabled:l,readOnly:u,submitType:d=`enter`,prefixCls:p,styles:m={},classNames:h={},autoSize:g,triggerSend:_,placeholder:v,onFocus:y,onBlur:b,slotConfig:x,skill:S,...C}=q.useContext(Er),{direction:w,getPrefixCls:T}=Y(),E=`${T(`sender`,p)}`,D=Ct(`sender`),k=`${E}-input`,j=(0,q.useRef)(null),M=(0,q.useRef)(new Map),N=(0,q.useRef)(!1),P=(0,q.useRef)(!1),ee=(0,q.useRef)(null),F=(0,q.useRef)(null),te=(0,q.useRef)(null),ne={...D.styles?.input,...m.input},I=kr(ne,g,j),L={...(0,jn.default)(C,{attr:!0,aria:!0,data:!0}),ref:j},[R,{getSlotValues:z,setSlotValues:B,getNodeInfo:re,mergeSlotConfig:V,getNodeTextValue:H}]=Fr(x),[ie,ae]=(0,q.useState)(new Map),[oe,se]=(0,q.useState)(null),{setEndCursor:ce,setStartCursor:le,setAllSelectCursor:ue,setCursorPosition:de,setSlotFocus:fe,setAfterNodeFocus:pe,getTextBeforeCursor:me,removeAllRanges:he,getRange:U,getInsertPosition:ge,getEndRange:_e,getStartRange:ve,getSelection:ye,copySelectionString:be,getCleanedText:xe}=Dr({prefixCls:E,getSlotDom:e=>M.current.get(e),slotConfigMap:R,getNodeInfo:re,getEditorValue:()=>Ne()}),{buildSkillSpan:Se,buildEditSlotSpan:Ce,buildSlotSpan:we,buildSpaceSpan:Te,getSlotDom:Ee,saveSlotDom:De,getSlotLastDom:Oe}=Ar({prefixCls:E,placeholder:v,slotDomMap:M,slotConfigMap:R}),ke=e=>{let t=Ne();F.current&&(!t?.value&&t.slotConfig.length===0&&v?(F.current.setAttribute(`contenteditable`,`true`),F.current.classList.add(`${E}-skill-empty`)):(F.current.setAttribute(`contenteditable`,`false`),F.current.classList.remove(`${E}-skill-empty`))),n?.(t.value,e,t.slotConfig,t.skill)},Ae=(e,t,n)=>{let r=Ee(e),i=R.get(e);if(B(n=>({...n,[e]:t})),r&&i){let t=je(i,r);ae(n=>{let r=new Map(n);return r.set(e,t),r}),ke(n)}},je=(e,t)=>{if(!e.key)return null;let n=z()[e.key];return(0,Lr.createPortal)((()=>{switch(e.type){case`content`:return t.innerHTML=n||``,t.setAttribute(`data-placeholder`,e.props?.placeholder||``),null;case`input`:return q.createElement(s,{readOnly:u,className:`${E}-slot-input`,placeholder:e.props?.placeholder||``,"data-slot-input":e.key,size:`small`,variant:`borderless`,value:n||``,tabIndex:0,onKeyDown:We,onChange:t=>{Ae(e.key,t.target.value,t)},spellCheck:!1});case`select`:return q.createElement(f,{disabled:u,menu:{items:e.props?.options?.map(e=>({label:e,key:e})),defaultSelectedKeys:e.props?.defaultValue?[e.props.defaultValue]:[],selectable:!0,onSelect:({key:t,domEvent:n})=>{Ae(e.key,t,n)}},trigger:[`click`]},q.createElement(`span`,{className:r(`${E}-slot-select`,{placeholder:!n,[`${E}-slot-select-selector-value`]:n})},q.createElement(`span`,{"data-placeholder":e.props?.placeholder,className:`${E}-slot-select-value`},n||``),q.createElement(`span`,{className:`${E}-slot-select-arrow`},q.createElement(A,null))));case`tag`:return q.createElement(`span`,{className:`${E}-slot-tag`},e.props?.label||e.props?.value||``);case`custom`:return e.customRender?.(n,t=>{Ae(e.key,t)},{disabled:l,readOnly:u},e);default:return null}})(),t)},Me=e=>e.reduce((e,t)=>{if(t.type===`text`)return e.push(document.createTextNode(t.value||``)),e;let n=t.key;if(Tt(!!n,`Sender`,`Slot key is missing: ${n}`),n){let r,i;if(t.type===`content`){i=Ce(t);let e=Te(n,`before`),a=Te(n,`after`);r=[e,i,a],De(`${n}_before`,e),De(n,i),De(`${n}_after`,a)}else i=we(n),r=[i],De(n,i);if(i){let a=je(t,i);a&&(ae(e=>{let t=new Map(e);return t.set(n,a),t}),e.push(...r))}}return e},[]),Ne=()=>{let e=j.current,t={value:``,slotConfig:[],skill:void 0};if(!e)return t;let n=e.childNodes;if(n.length===0)return e.innerHTML=``,F.current=null,t;let r=!!S,i=Array(n.length),a=[],o,s=0;for(let e=0;e{let e=j.current;e&&(e.innerHTML=``,F.current=null,te.current=null,ee.current=null,he(),M?.current?.clear())},Fe=e=>{e.forEach(e=>{j.current?.appendChild(e)})},Ie=(e,t)=>{let n=j.current;n&&(n.querySelectorAll(`[data-slot-key="${e}"]`).forEach(e=>{e.remove()}),M.current.delete(e),B(t=>{let{[e]:n,...r}=t;return r}),ae(t=>{let n=new Map(t);return n.delete(e),n}),ke(t))},W=()=>{if(S&&te.current!==S){Le(!1),te.current=S;let e=Se(S.value);se((0,Lr.createPortal)(q.createElement(Ir,O({removeSkill:Le},S,{prefixCls:E})),e));let t=document.createRange(),n=j.current;if(!n)return;t.setStart(n,0),t.insertNode(e),F.current=e,ke()}},Le=(e=!0)=>{!j.current||!F.current||(F.current?.remove(),F.current=null,te.current=null,e&&ke())},Re=e=>{d!==`enter`||!e||e.querySelectorAll(`br`).forEach(e=>{e.remove()})},ze=()=>{x&&x.length>0&&j.current&&(Pe(),Fe(Me(x)))},G=e=>{let t=a?.(e);return P.current||N.current||t===!1},Be=(e,t)=>{if(!j.current)return!1;let{range:n,selection:r}=U();if(!r||r.rangeCount===0)return!1;let{focusOffset:i,anchorNode:a}=r;if(!a||!j.current.contains(a))return!1;if(a.nodeType===Node.TEXT_NODE&&n){let r=a.parentNode,o=re(r),s=n.toString(),c=a.textContent?.length===s.length,l=a.textContent?.length===1&&i===1;if(o?.slotConfig?.type===`content`&&(c||l))return e.preventDefault(),t===`cut`&&be(),a.parentNode.innerHTML=``,!0}if(t===`backspace`&&i===0){let t=a.previousSibling;if(t){let n=re(t);if(n){let{slotKey:t,skillKey:r}=n;if(t)return e.preventDefault(),Ie(t,e),!0;if(r)return e.preventDefault(),Le(),!0}}}return!1},K=e=>{let{key:t,shiftKey:n,ctrlKey:r,altKey:i,metaKey:a}=e;if(t!==`Enter`)return!1;let o=r||i||a;return d===`enter`&&!n&&!o||d===`shiftEnter`&&n&&!o},Ve=()=>{if(!F.current||!j.current||F.current.getAttribute(`contenteditable`)===`false`)return;let e=ye();!e?.anchorNode||!F.current.contains(e.anchorNode)||!j.current.contains(e.anchorNode)||(F.current.setAttribute(`contenteditable`,`false`),F.current.classList.remove(`${E}-skill-empty`),rt({cursor:`end`}))},He=()=>{N.current=!0},Ue=()=>{N.current=!1,P.current=!1},We=e=>{if(!G(e)&&!(e.key===`Backspace`&&Be(e,`backspace`))){if(K(e)){e.preventDefault(),P.current=!0,_?.();return}if((e.key===`a`||e.key===`A`)&&(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey){ue(j.current,F.current),e.preventDefault();return}Ve()}},Ge=e=>{y?.(e)},Ke=e=>{P.current&&=!1;let{range:t}=U();ee.current=t;let n=setTimeout(()=>{ee.current=null,clearTimeout(n)},200);b?.(e)},qe=e=>{Re(j?.current),ke(e)},Je=e=>{Be(e,`cut`)},Ye=e=>{e.preventDefault();let t=e.clipboardData?.files,n=e.clipboardData?.getData(`text/plain`);if(!n&&t?.length&&c){c(t);return}if(n){let e=!1,t=xe(n);try{e=document.execCommand(`insertText`,!1,t)}catch(e){Tt(!1,`Sender`,`insertText command failed: ${e}`)}e||Qe([{type:`text`,value:t}])}o?.(e)},Xe=e=>{e.key===`Enter`&&(P.current=!1),i?.(e)},Ze=()=>{let e=j.current,t=ye();e&&t?.focusNode===e&&t.focusOffset===0&&Ne().skill&&de(e,j.current,1)},Qe=(e,t,n,r)=>{let i=j.current;if(i)try{V(e);let a=Me(e);if(a.length===0)return;let o=$e(t,i);if(!o.range||!o.selection)return;let{range:s,selection:c}=o;n?.length&&et(s,n,i),s.deleteContents(),tt(a,s,o),nt(a,s,c,r)}catch(e){Tt(!1,`Sender`,`Insert operation failed: ${e}`)}},$e=(e,t)=>{let{type:n,slotKey:r,slotType:i,range:a,selection:o}=ge(e,j,ee);if(!o)return{range:null,selection:null,type:n};let s=null;switch(n){case`end`:s=_e(t);break;case`start`:s=ve(t);break;case`slot`:s=U().range;break;case`box`:s=a||null,s&&F.current&&s.collapsed&&s.startOffset===0&&s.setStartAfter(F.current);break}return{range:s,selection:o,type:n,slotKey:r,slotType:i}},et=(e,t,n)=>{let{value:r,startContainer:i,startOffset:a}=me(n);r.length>=t.length&&r.endsWith(t)&&i&&a>=0&&(e.setStart(i,a-t.length),e.setEnd(i,a),e.deleteContents())},tt=(e,t,n)=>{let{type:r,slotKey:i,slotType:a}=n,o=!0;e.forEach(e=>{if(o&&r===`slot`&&(a!==`content`||e.nodeType!==Node.TEXT_NODE)&&i){o=!1;let e=Oe(i);e&&t.setStartAfter(e)}t.insertNode(e),t.setStartAfter(e)})},nt=(e,t,n,r)=>{let i=e[e.length-1];pe(i,j.current,t,n,r),setTimeout(()=>{qe(null)},0)},rt=e=>{let t={preventScroll:e?.preventScroll??!1,cursor:e?.cursor??`end`,key:e?.key};switch(t.cursor){case`slot`:fe(j,e?.key,t.preventScroll);break;case`start`:le(j.current,t.preventScroll);break;case`all`:ue(j.current,F.current,t.preventScroll);break;case`end`:ce(j.current,t.preventScroll);break}},it=()=>{let e=j.current;e&&(e.innerHTML=``,te.current=null,F.current=null,R.clear(),W(),B({}),ee.current=null,M?.current?.clear(),qe(null))};return(0,q.useEffect)(()=>{ze(),S?W():ke()},[x]),(0,q.useEffect)(()=>{W()},[S]),(0,q.useImperativeHandle)(t,()=>({nativeElement:j.current,focus:rt,blur:()=>j.current?.blur(),insert:Qe,clear:it,getValue:Ne})),q.createElement(q.Fragment,null,q.createElement(`div`,O({},L,{role:`textbox`,tabIndex:0,style:{...ne,...I},className:r(k,`${k}-slot`,D.classNames.input,h.input,{[`${E}-rtl`]:w===`rtl`}),"data-placeholder":v,contentEditable:!u,suppressContentEditableWarning:!0,spellCheck:!1,onCut:Je,onKeyDown:We,onKeyUp:Xe,onPaste:Ye,onCompositionStart:He,onCompositionEnd:Ue,onFocus:Ge,onBlur:Ke,onSelect:Ze,onInput:qe},C)),q.createElement(`div`,{style:{display:`none`},id:`${E}-slot-placeholders`},Array.from(ie.values()),oe))}),zr=q.forwardRef((e,t)=>{let{speechRecording:n,disabled:r,onSpeechDisabled:i,prefixCls:a}=q.useContext(vr),o=e.disabled??r??i,s=null;return s=n?q.createElement(Gt,{className:`${a}-recording-icon`}):o?q.createElement(b,null):q.createElement(x,null),q.createElement(yr,O({icon:s,variant:`text`,color:`primary`},e,{action:`onSpeech`,ref:t}))}),Br=c(z((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(e,t){let n=e;for(let e=0;e{let{value:n,onChange:i,onKeyUp:a,onKeyDown:o,onPaste:c,onPasteFile:l,disabled:u,readOnly:d,submitType:f=`enter`,prefixCls:p,styles:m={},classNames:h={},autoSize:g,components:_,triggerSend:v,placeholder:y,onFocus:b,onBlur:x,...S}=q.useContext(Er),C=q.useRef(null),w=(e,t=`cursor`)=>{let n=C.current?.resizableTextArea?.textArea,r=n.value,a=r.length,o=r.length;t===`cursor`&&(a=n?.selectionStart,o=n?.selectionEnd),t===`start`&&(a=0,o=0),n.value=r.substring(0,a)+e+r.substring(o,r.length),n.selectionStart=a+e.length,n.selectionEnd=a+e.length,n.focus(),i?.(n.value)},T=()=>{i?.(``)},E=()=>({value:n||``,slotConfig:[]});q.useImperativeHandle(t,()=>({nativeElement:C.current?.resizableTextArea?.textArea,focus:C.current?.focus,blur:C.current?.blur,insert:w,clear:T,getValue:E}));let D=q.useRef(!1),k=()=>{D.current=!0},A=()=>{D.current=!1},j=e=>{let t=o?.(e),{key:n,shiftKey:r,ctrlKey:i,altKey:a,metaKey:s}=e;if(!(D.current||n!==`Enter`||t===!1)&&n===`Enter`){let t=i||a||s;if(f===`enter`&&!r&&!t||f===`shiftEnter`&&r&&!t){e.preventDefault(),v?.();return}}},M=e=>{let t=e.clipboardData?.files;!e.clipboardData?.getData(`text/plain`)&&t?.length&&l&&(l(t),e.preventDefault()),c?.(e)},N=Vr(_,[`input`],s.TextArea),P={...(0,jn.default)(S,{attr:!0,aria:!0,data:!0}),ref:C};return q.createElement(N,O({},P,{disabled:u,style:m.input,className:r(`${p}-input`,h.input),autoSize:g,value:n,onChange:e=>{i?.(e.target.value,e)},onKeyUp:a,onCompositionStart:k,onCompositionEnd:A,onKeyDown:j,onPaste:M,variant:`borderless`,readOnly:d,placeholder:y,onFocus:b,onBlur:x}))});function Ur(e,t){let n=C(e),[r,i,a]=q.useMemo(()=>typeof t==`object`?[t.recording,t.onRecordingChange,typeof t.recording==`boolean`]:[void 0,void 0,!1],[t]),[o,s]=q.useState(null);q.useEffect(()=>{if(!a&&`permissions`in navigator){let e=null;return navigator.permissions.query({name:`microphone`}).then(t=>{s(t.state),t.onchange=function(){s(this.state)},e=t}).catch(e=>{Tt(!1,`Sender`,`Browser does not support querying microphone permission. ${e instanceof Error?e.message:String(e)}`)}),()=>{e&&(e.onchange=null)}}},[a]);let c;!c&&typeof window<`u`&&(c=window.SpeechRecognition||window.webkitSpeechRecognition);let l=!!(a||c&&o!==`denied`),u=q.useRef(null),[d,f]=P(!1,r),p=q.useRef(!1),m=()=>{if(l&&!u.current){let e=new c;e.onstart=()=>{f(!0)},e.onend=()=>{f(!1)},e.onresult=e=>{if(!p.current){let t=e.results?.[0]?.[0]?.transcript;n(t)}p.current=!1},u.current=e}};return[l,C(e=>{e&&!d||(p.current=e,a?i?.(!d):(m(),u.current&&(d?(u.current.stop(),i?.(!1)):(u.current.start(),i?.(!0)))))}),d]}var Wr=q.createContext({}),Gr=()=>({height:0}),Kr=e=>({height:e.scrollHeight});function qr(e){let{title:t,onOpenChange:n,open:i,children:a,className:o,style:s,classNames:c={},styles:l={},prefixCls:u,closable:d,forceRender:f}=e,{prefixCls:p}=q.useContext(Wr),{direction:m,getPrefixCls:h}=Y(),g=h(`sender`,u||p),_=`${g}-header`,v=()=>{n?.(!i)};return q.createElement(L,{motionEnter:!0,motionLeave:!0,motionName:`${_}-motion`,leavedClassName:`${_}-motion-hidden`,onEnterStart:Gr,onEnterActive:Kr,onLeaveStart:Kr,onLeaveActive:Gr,visible:i,forceRender:f},({className:e,style:n})=>q.createElement(`div`,{className:r(g,_,e,o,{[`${_}-rtl`]:m===`rtl`}),style:{...n,...s}},(d!==!1||t)&&q.createElement(`div`,{className:r(`${_}-header`,c.header),style:{...l.header}},q.createElement(`div`,{className:`${_}-title`},t),d!==!1&&q.createElement(`div`,{className:`${_}-close`},q.createElement(M,{type:`text`,icon:q.createElement(w,null),size:`small`,onClick:v}))),a&&q.createElement(`div`,{className:r(`${_}-content`,c.content),style:{...l.content}},a)))}var Jr=e=>{let{componentCls:t,calc:n}=e,r=`${t}-header`;return{[t]:{[`&${r}-rtl`]:{direction:`rtl`},[`${r}`]:{borderBottomWidth:e.lineWidth,borderBottomStyle:`solid`,borderBottomColor:e.colorBorderInput,[`${r}-header`]:{background:e.colorFillAlter,fontSize:e.fontSize,lineHeight:e.lineHeight,paddingBlock:n(e.paddingSM).sub(e.lineWidthBold).equal(),paddingInlineStart:e.padding,paddingInlineEnd:e.paddingXS,display:`flex`,borderRadius:{_skip_check_:!0,value:n(e.borderRadius).mul(2).equal()},borderEndStartRadius:0,borderEndEndRadius:0,[`${r}-title`]:{flex:`auto`}},[`${r}-content`]:{padding:e.padding}},[`${r}-motion`]:{transition:[`height`,`border`].map(t=>`${t} ${e.motionDurationSlow}`).join(`,`),overflow:`hidden`,"&-enter-start, &-leave-active":{borderBottomColor:`transparent`},"&-hidden":{display:`none`}}}}},Yr=e=>{let{componentCls:t,antCls:n,calc:r}=e,i=`${t}-slot`,a=`${n}-input`,o=`${n}-dropdown-trigger`,s=`${t}-slot-input`,c=`${t}-slot-select`,l=`${t}-slot-tag`,d=`${t}-slot-content`,f=`${t}-skill`;return{[t]:{[`${t}-input-slot`]:{outline:`none`,cursor:`text`,whiteSpace:`pre-wrap`,width:`100%`,caretColor:e.colorPrimary,fontSize:e.fontSize,lineHeight:e.lineHeight,"&:empty::before":{content:`attr(data-placeholder)`,color:e.colorTextPlaceholder}},[`${i}:not(${d})`]:{display:`inline-block`,verticalAlign:`middle`,alignItems:`center`,marginBlock:1,height:r(e.fontSize).mul(e.lineHeight).add(2).equal(),wordBreak:`break-all`,marginInline:e.marginXXS},[`${a}${s}`]:{height:`100%`,background:e.colorBgSlot,outline:`none`,color:e.colorTextSlot,borderRadius:e.borderRadius,paddingInline:e.paddingXXS,fontSize:`inherit`,lineHeight:`inherit`,position:`relative`,"&::placeholder":{color:e.colorTextSlotPlaceholder,fontSize:`inherit`,lineHeight:`inherit`},[i]:{display:`inline-flex`,margin:`0 ${u(e.marginXXS)}`,verticalAlign:`bottom`,alignItems:`center`,marginBlock:u(r(e.marginXXS).div(2).equal()),minHeight:e.controlHeightSM,wordBreak:`break-all`}},[c]:{fontSize:e.fontSize,lineHeight:e.lineHeight,paddingInline:e.paddingXXS,transition:`border-color ${e.motionDurationMid}`,position:`relative`,display:`inline-flex`,alignItems:`center`,cursor:`pointer`,background:e.colorBgSlot,height:`100%`,boxSizing:`border-box`,borderRadius:e.borderRadius,color:e.colorTextSlot,border:`1px solid ${e.colorBorderSlot}`,"&.placeholder":{color:e.colorTextSlotPlaceholder},[`${c}`]:{fontSize:e.fontSize,lineHeight:e.lineHeight,padding:`0 ${u(e.paddingXXS)}`,transition:`border-color ${e.motionDurationMid}`,position:`relative`,display:`inline`,cursor:`pointer`,background:e.colorBgSlot,alignItems:`center`,justifyContent:`center`,borderRadius:e.borderRadius,color:e.colorTextSlot,border:`1px solid ${e.colorBorderSlot}`,"&.placeholder":{color:e.colorTextSlotPlaceholder},[`&${o}-open`]:{borderColor:e.colorBorderSlotHover}},[`${c}-value`]:{flex:1,fontSize:e.fontSize,lineHeight:e.lineHeight,"&:empty::before":{content:`attr(data-placeholder)`}},[`${c}-arrow`]:{marginInlineStart:e.marginXXS,fontSize:e.fontSize,lineHeight:e.lineHeight,display:`inline-flex`,alignItems:`center`,justifyContent:`center`},[`${l}`]:{background:e.colorBgSlot,border:`1px solid ${e.colorBorderSlot}`,outline:`none`,color:e.colorTextSlot,borderRadius:e.borderRadius,padding:`0 ${u(e.paddingXXS)}`,fontSize:e.fontSize,lineHeight:e.lineHeight,position:`relative`,cursor:`default`}},[`${c}-arrow`]:{marginInlineStart:e.marginXXS,fontSize:e.fontSize,lineHeight:e.lineHeight,display:`inline-flex`,alignItems:`center`,justifyContent:`center`},[l]:{background:e.colorBgSlot,border:`1px solid ${e.colorBorderSlot}`,outline:`none`,color:e.colorTextSlot,borderRadius:e.borderRadius,padding:`0 ${u(e.paddingXXS)}`,fontSize:e.fontSize,lineHeight:e.lineHeight,height:`100%`,boxSizing:`border-box`,position:`relative`,cursor:`default`},[d]:{height:r(e.fontSize).mul(e.lineHeight).add(2).equal(),caretColor:e.colorPrimary,background:e.colorBgSlot,outline:`none`,color:e.colorTextSlot,borderRadius:e.borderRadius,paddingInline:e.paddingXXS,boxSizing:`border-box`,verticalAlign:`middle`,fontSize:e.fontSize,marginBlock:1,lineHeight:e.lineHeight,display:`inline-block`,position:`relative`,cursor:`text`,"&:empty":{width:`fit-content`,"&::after":{display:`inline-block`,height:`inherit`,content:`attr(data-placeholder)`,color:e.colorTextSlotPlaceholder}}},[`${i}-no-width`]:{userSelect:`none`,width:`3px`,display:`inline-block`,lineHeight:`inherit`},[f]:{display:`inline-block`,verticalAlign:`baseline`,alignItems:`center`,marginBlock:1,height:r(e.fontSize).mul(e.lineHeight).add(2).equal(),wordBreak:`break-all`,paddingInlineEnd:0,paddingInlineStart:0,marginInlineEnd:0,marginInlineStart:-1,[`&${f}-empty`]:{"&::after":{display:`inline-block`,pointerEvents:`none`,height:`inherit`,content:`attr(data-placeholder)`,color:e.colorTextPlaceholder}}},[`${f}-wrapper`]:{height:`100%`,display:`inline-flex`},[`${f}-tag`]:{paddingInline:e.paddingXS,height:`100%`,backgroundColor:e.colorBgSkill,borderRadius:e.borderRadius,color:e.colorPrimary,alignItems:`center`,fontWeight:500,display:`inline-flex`,cursor:`pointer`,gap:e.marginXXS,transition:`background-color ${e.motionDurationMid}`,"&:hover":{backgroundColor:e.colorBgSkillHover,[`${f}-tag-close:not(${f}-tag-close-disabled)`]:{color:e.colorPrimaryHover}},"&-close":{fontSize:e.fontSizeSM,display:`inline-flex`,transition:`color ${e.motionDurationMid}`,color:e.colorPrimary},"&-close-disabled":{cursor:`not-allowed`,color:e.colorTextDisabled}},[`${f}-holder`]:{width:e.marginXS,height:`100%`}}}},Xr=e=>{let{componentCls:t,antCls:n}=e,r=`${t}-switch`;return{[t]:{[`&${r}-rtl`]:{direction:`rtl`},[`&${r}`]:{display:`inline-block`,[`${n}-btn:not(:disabled):not(${n}-btn-disabled):hover`]:{background:e.switchUncheckedHoverBg,borderColor:e.colorBorder,color:e.colorText},[`&${r}-checked`]:{[`${n}-btn:not(:disabled):not(${n}-btn-disabled):hover`]:{background:e.switchCheckedHoverBg,borderColor:e.colorPrimary,color:e.colorPrimaryText},[`${r}-content`]:{background:e.switchCheckedBg}}}}}},Zr=e=>{let{antCls:t,componentCls:n,paddingSM:r,paddingXS:i,paddingXXS:a,lineWidth:o,calc:s}=e;return{[n]:{[`&${n}-main`]:{position:`relative`,width:`100%`,boxSizing:`border-box`,boxShadow:`${e.boxShadowTertiary}`,borderRadius:{_skip_check_:!0,value:s(e.borderRadius).mul(2).equal()},borderColor:e.colorBorderInput,borderWidth:o,borderStyle:`solid`},[`&${n}-disabled`]:{background:e.colorBgContainerDisabled,borderColor:`transparent`},[`&${n}-rtl`]:{direction:`rtl`},[`${n}-content`]:{display:`flex`,gap:i,width:`100%`,paddingBlock:r,paddingInlineStart:r,paddingInlineEnd:r,boxSizing:`border-box`,alignItems:`flex-end`},[`${n}-prefix`]:{flex:`none`},[`${n}-input`]:{paddingInline:0,borderRadius:0,flex:`auto`,alignSelf:`center`,caretColor:e.colorPrimary,fontSize:e.fontSize},[`${n}-actions-list`]:{flex:`none`,display:`flex`,"&-presets":{gap:e.paddingXS}},[`${n}-actions-btn`]:{[`&-disabled:where(${t}-btn-variant-text)`]:{color:e.colorTextActionsDisabled,borderColor:`transparent`},[`&-disabled:not(${t}-btn-variant-text)`]:{background:e.colorBgActionsDisabled,color:e.colorTextLightSolid,borderColor:`transparent`},"&-loading-button":{padding:0,border:0},"&-loading-icon":{height:e.controlHeight,width:e.controlHeight,verticalAlign:`top`},"&-recording-icon":{height:`1.2em`,width:`1.2em`,verticalAlign:`top`}},[`${n}-footer`]:{paddingInlineStart:r,paddingInlineEnd:r,paddingBlockEnd:r,paddingBlockStart:a,boxSizing:`border-box`}}}},Qr=on(`Sender`,e=>{let{paddingXS:t,calc:n}=e,r=l(e,{SenderContentMaxWidth:`calc(100% - ${u(n(t).add(32).equal())})`});return[Zr(r),Jr(r),Xr(r),Yr(r)]},e=>{let{colorPrimary:t,colorFillTertiary:n}=e,r=new a(t).setA(.06).toRgbString(),i=new a(t).setA(.08).toRgbString(),o=new a(t).setA(.15).toRgbString(),s=t,c=new a(t).setA(.25).toRgbString(),l=new a(t).setA(.1).toRgbString(),u=r,d=new a(t).setA(.08).toRgbString(),f=new a(n).setA(.04).toRgbString(),p=new a(t).setA(.1).toRgbString(),m=new a(n).setA(.1).toRgbString(),h=`0 4px 12px 0 ${new a(t).setA(.1).toRgbString()}`,g=new a(t).setA(.45).toRgbString();return{colorBgSlot:r,colorBgSkill:i,colorBgSkillHover:o,colorTextSlot:s,colorTextSlotPlaceholder:c,colorBorderSlotHover:l,colorBorderSlot:u,switchCheckedBg:d,switchCheckedHoverBg:p,switchUncheckedHoverBg:f,colorBorderInput:m,boxShadowInput:h,colorBgActionsDisabled:g,colorTextActionsDisabled:g}}),$r={SendButton:Tr,ClearButton:xr,LoadingButton:Cr,SpeechButton:zr},ei=q.forwardRef((e,n)=>{let{prefixCls:i,styles:a={},classNames:o={},className:s,rootClassName:c,style:l,defaultValue:u,value:d,slotConfig:f,readOnly:p,submitType:m=`enter`,onSubmit:h,loading:g,components:_,onCancel:v,onChange:y,suffix:b,onKeyUp:x,onKeyDown:S,disabled:C,allowSpeech:w,prefix:T,footer:E,header:D,onPaste:k,onPasteFile:A,autoSize:j={maxRows:8},placeholder:M,onFocus:N,onBlur:ee,skill:F,...te}=e,ne=(0,jn.default)(te,{attr:!0,aria:!0,data:!0}),I=q.useId(),L=Array.isArray(f)||F?.value,{direction:R,getPrefixCls:z}=Y(),B=z(`sender`,i),re=q.useRef(null),V=q.useRef(null);bt(n,()=>({nativeElement:re.current,inputElement:V.current?.nativeElement,focus:e=>V.current?.focus(e),blur:()=>V.current?.blur(),insert:(...e)=>V.current?.insert?.(...e),clear:()=>V.current?.clear(),getValue:()=>V.current?.getValue()??{value:``,slotConfig:[],skill:void 0}}));let H=Ct(`sender`),ie=`${B}-input`,[ae,oe]=Qr(B),se=r(B,H.className,s,c,H.classNames.root,o.root,ae,oe,`${B}-main`,{[`${B}-rtl`]:R===`rtl`,[`${B}-disabled`]:C}),ce=`${B}-actions-btn`,le=`${B}-actions-list`,[ue,de]=P(u||``,d),fe=(e,t,n,r)=>{de(e),y?.(e,t,n??[],r)},[pe,me,he]=Ur(e=>{L?V.current?.insert?.([{type:`text`,value:e}]):fe(`${ue} ${e}`)},w),U=()=>{if(V?.current&&h&&!g&&!Se){let e=V.current.getValue();h(e.value,e.slotConfig,e.skill)}},ge=()=>{fe(``),L&&V.current?.clear?.()},_e=q.createElement(t,{className:`${le}-presets`},w&&q.createElement(zr,null),g?q.createElement(Cr,null):q.createElement(Tr,null)),ve=_e;typeof b==`function`?ve=b(_e,{components:$r}):(b||b===!1)&&(ve=b);let ye=typeof T==`function`?T(_e,{components:$r}):T||null,be=typeof D==`function`?D(_e,{components:$r}):D||null,xe=typeof E==`function`?E(_e,{components:$r}):E||null,[Se,Ce]=(0,q.useState)(!ue),we={prefixCls:ce,onSend:U,onSendDisabled:!ue,onClear:ge,onClearDisabled:!ue,onCancel:v,onCancelDisabled:!g,onSpeech:()=>me(!1),onSpeechDisabled:!pe,speechRecording:he,disabled:C,setSubmitDisabled:Ce},Te=q.useMemo(()=>({value:ue,onChange:fe,slotConfig:f,onKeyUp:x,onKeyDown:S,onPaste:k,onPasteFile:A,disabled:C,readOnly:p,submitType:m,prefixCls:B,styles:a,classNames:o,autoSize:j,components:_,triggerSend:U,placeholder:M,onFocus:N,onBlur:ee,skill:F,...te}),[ue,fe,f,x,S,k,A,C,p,m,B,a,o,j,_,U,M,N,ee,F,te]),Ee=e=>{!L&&e.target!==re.current?.querySelector(`.${ie}`)&&e.preventDefault(),e.target===re.current?.querySelector(`.${ie}`)&&V.current?.focus()};return q.createElement(`div`,O({key:I,ref:re,className:se,style:{...H.style,...l,...H.styles.root,...a.root}},ne),q.createElement(Er.Provider,{value:Te},q.createElement(vr.Provider,{value:we},be&&q.createElement(Wr.Provider,{value:{prefixCls:B}},be),q.createElement(`div`,{className:r(`${B}-content`,o.content),style:a.content,onMouseDown:Ee},ye&&q.createElement(`div`,{className:r(`${B}-prefix`,H.classNames.prefix,o.prefix),style:{...H.styles.prefix,...a.prefix}},ye),L?q.createElement(Rr,{ref:V}):q.createElement(Hr,{ref:V}),ve&&q.createElement(`div`,{className:r(le,H.classNames.suffix,o.suffix),style:{...H.styles.suffix,...a.suffix}},ve)),xe&&q.createElement(`div`,{className:r(`${B}-footer`,H.classNames.footer,o.footer),style:{...H.styles.footer,...a.footer}},xe))))}),ti=q.forwardRef((e,t)=>{let{children:n,className:i,classNames:a={},styles:o={},icon:s,style:c,onChange:l,rootClassName:u,loading:d,defaultValue:f,value:p,checkedChildren:m,unCheckedChildren:h,disabled:g,prefixCls:_,...v}=e,{styles:y={},classNames:b={},prefixCls:x}=q.useContext(Er),S=(0,jn.default)(v,{attr:!0,aria:!0,data:!0}),C=q.useId(),{direction:w,getPrefixCls:T}=Y(),E=T(`sender`,_||x),D=`${E}-switch`,[k,A]=Qr(E),j=q.useRef(null);bt(t,()=>({nativeElement:j.current}));let[N,ee]=P(f,p),F=Ct(`sender`),te=r(E,D,i,u,F.classNames.switch,b.switch,a.root,k,A,{[`${D}-checked`]:N,[`${D}-rtl`]:w===`rtl`});return q.createElement(`div`,O({ref:j,className:te,key:C,style:{...c,...F.styles.switch,...y.switch,...o.root}},S),q.createElement(M,{disabled:g,loading:d,className:r(`${D}-content`,a.content),style:o.content,styles:{icon:o.icon,content:o.title},classNames:{icon:a.icon,content:a.title},variant:`outlined`,color:N?`primary`:`default`,icon:s,onClick:()=>{let e=!N;ee(e),l?.(e)}},N?m:h,n))}),ni=ei;ni.Header=qr,ni.Switch=ti;var ri=e=>{let{componentCls:t,calc:n}=e,r=n(e.fontSizeHeading3).mul(e.lineHeightHeading3).equal(),i=n(e.fontSize).mul(e.lineHeight).equal();return{[t]:{gap:e.padding,[`${t}-icon`]:{height:n(r).add(i).add(e.paddingXXS).equal(),display:`flex`,img:{height:`100%`}},[`${t}-content-wrapper`]:{gap:e.paddingXS,flex:`auto`,minWidth:0,[`${t}-title-wrapper`]:{gap:e.paddingXS},[`${t}-title`]:{margin:0},[`${t}-extra`]:{marginInlineStart:`auto`}}}}},ii=e=>{let{componentCls:t}=e;return{[t]:{"&-filled":{paddingInline:e.padding,paddingBlock:e.paddingSM,background:e.colorFillContent,borderRadius:e.borderRadiusLG},"&-borderless":{[`${t}-title`]:{fontSize:e.fontSizeHeading3,lineHeight:e.lineHeightHeading3}}}}},ai=on(`Welcome`,e=>{let t=l(e,{});return[ri(t),ii(t)]},()=>({})),oi=q.forwardRef((e,n)=>{let{prefixCls:i,rootClassName:a,className:o,style:s,variant:c=`filled`,classNames:l={},styles:u={},icon:d,title:f,description:p,extra:m}=e,{direction:h,getPrefixCls:g}=Y(),_=g(`welcome`,i),v=Ct(`welcome`),[y,b]=ai(_),x=q.useMemo(()=>{if(!d)return null;let e=d;return typeof d==`string`&&d.startsWith(`http`)&&(e=q.createElement(`img`,{src:d,alt:`icon`})),q.createElement(`div`,{className:r(`${_}-icon`,v.classNames.icon,l.icon),style:u.icon},e)},[d]),S=q.useMemo(()=>f?q.createElement(te.Title,{level:4,className:r(`${_}-title`,v.classNames.title,l.title),style:u.title},f):null,[f]),C=q.useMemo(()=>m?q.createElement(`div`,{className:r(`${_}-extra`,v.classNames.extra,l.extra),style:u.extra},m):null,[m]);return q.createElement(t,{ref:n,className:r(_,v.className,o,a,l.root,y,b,`${_}-${c}`,{[`${_}-rtl`]:h===`rtl`}),style:{...s,...u.root}},x,q.createElement(t,{vertical:!0,className:`${_}-content-wrapper`},m?q.createElement(t,{align:`flex-start`,className:`${_}-title-wrapper`},S,C):S,p&&q.createElement(te.Text,{className:r(`${_}-description`,v.classNames.description,l.description),style:u.description},p)))}),si={_chatMessagesStores:new Map,get:e=>si._chatMessagesStores.get(e),set:(e,t)=>{si._chatMessagesStores.set(e,t)},delete:e=>{si._chatMessagesStores.delete(e)},getMessages:e=>si._chatMessagesStores.get(e)?.getMessages()},ci={_allConversationStores:new Map,set:(e,t)=>{ci._allConversationStores.set(e,t)},delete:e=>{ci._allConversationStores.delete(e)},getConversation:e=>{for(let t of ci._allConversationStores.values())if(t){let n=t.getConversation(e);if(n)return n}}},li=class{conversations=[];listeners=[];storeKey;activeConversationKey;emitListeners(){this.listeners.forEach(e=>{e()})}constructor(e,t){this.setConversations(e),this.storeKey=Math.random().toString(),ci.set(this.storeKey,this),this.activeConversationKey=t}setActiveConversationKey=e=>(this.activeConversationKey=e,this.emitListeners(),!0);setConversations=e=>(this.conversations=[...e],this.emitListeners(),!0);getConversation=e=>this.conversations.find(t=>t.key===e);addConversation=(e,t)=>this.getConversation(e.key)?!1:(this.setConversations(t===`prepend`?[e,...this.conversations]:[...this.conversations,e]),!0);setConversation=(e,t)=>{let n=this.getConversation(e);return n?(Object.assign(n,t),this.setConversations([...this.conversations]),!0):!1};removeConversation=e=>{let t=this.conversations.findIndex(t=>t.key===e);return t===-1?!1:(this.conversations.splice(t,1),this.setConversations([...this.conversations]),!0)};getMessages=e=>si.getMessages(e);getSnapshot=()=>this.conversations;getActiveConversationKey=()=>this.activeConversationKey;subscribe=e=>(this.listeners.push(e),()=>{this.listeners=this.listeners.filter(t=>t!==e)});destroy=()=>{ci.delete(this.storeKey)}};function ui(e){let[t]=(0,q.useState)(()=>new li(e?.defaultConversations||[],e?.defaultActiveConversationKey||``));return(0,q.useEffect)(()=>()=>{t.destroy()},[]),{conversations:(0,q.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getSnapshot),activeConversationKey:(0,q.useSyncExternalStore)(t.subscribe,t.getActiveConversationKey,t.getActiveConversationKey),setActiveConversationKey:t.setActiveConversationKey,addConversation:t.addConversation,removeConversation:t.removeConversation,setConversation:t.setConversation,getConversation:t.getConversation,setConversations:t.setConversations,getMessages:t.getMessages}}var di=` `,fi=` `,pi=`:`,mi=e=>(e??``).trim()!==``;function hi(e=di){let t=``;return new TransformStream({transform(n,r){t+=n;let i=t.split(e);i.slice(0,-1).forEach(e=>{mi(e)&&r.enqueue(e)}),t=i[i.length-1]},flush(e){mi(t)&&e.enqueue(t)}})}function gi(e=fi,t=pi){return new TransformStream({transform(n,r){let i=n.split(e).reduce((e,n)=>{let r=n.indexOf(t);if(r===-1)return console.warn(`The key-value separator "${t}" is not found in the sse line: ${n} !`),e;let i=n.slice(0,r).trim();if(!mi(i))return e;let a=n.slice(r+1).trim();return{...e,[i]:a}},{});Object.keys(i).length!==0&&r.enqueue(i)}})}function _i(){if(typeof TextDecoderStream<`u`)return new TextDecoderStream;let e=new TextDecoder(`utf-8`);return new TransformStream({transform(t,n){n.enqueue(e.decode(t,{stream:!0}))},flush(t){t.enqueue(e.decode())}})}function vi(e){let{readableStream:t,transformStream:n,streamSeparator:r,partSeparator:i,kvSeparator:a}=e;if(!(t instanceof ReadableStream))throw Error(`The options.readableStream must be an instance of ReadableStream.`);let o=_i(),s=n?t.pipeThrough(o).pipeThrough(n):t.pipeThrough(o).pipeThrough(hi(r)).pipeThrough(gi(i,a));return s[Symbol.asyncIterator]=async function*(){let e=this.getReader();for(;;){let{done:t,value:n}=await e.read();if(t)break;n&&(yield n)}},s}var yi=async(e,t)=>{let{fetch:n=globalThis.fetch,middlewares:r={},...i}=t;if(typeof n!=`function`)throw Error(`The options.fetch must be a typeof fetch function!`);let a=[e,i];typeof r.onRequest==`function`&&(a=await r.onRequest(...a));let o=await n(...a);if(typeof r.onResponse==`function`){let e=await r.onResponse(o);if(!(e instanceof Response))throw Error(`The options.onResponse must return a Response instance!`);o=e}if(!o.ok)throw Error(`Fetch failed with status ${o.status}`);if(!o.body)throw Error(`The response body is empty.`);return o},bi={manual:!1,headers:{"Content-Type":`application/json`}},xi=`Last-Event-ID`,Si=class{baseURL;options;constructor(e,t){if(!e||typeof e!=`string`)throw Error(`The baseURL is not valid!`);this.baseURL=e,this.options=t||{}}},Ci=class extends Si{_asyncHandler;timeoutHandler;_isTimeout=!1;streamTimeoutHandler;_isStreamTimeout=!1;abortController;_isRequesting=!1;_manual=!1;lastManualParams;retryTimes=0;retryTimer;lastEventId=void 0;get asyncHandler(){return this._asyncHandler}get isTimeout(){return this._isTimeout}set isTimeout(e){this._isTimeout=e}get isStreamTimeout(){return this._isStreamTimeout}set isStreamTimeout(e){this._isStreamTimeout=e}get isRequesting(){return this._isRequesting}get manual(){return this._manual}constructor(e,t){super(e,t),this._manual=t?.manual||!1,this.manual||this.init()}run(e){return this.manual?(this.resetRetry(),this.lastManualParams=e,this.init(e),!0):(console.warn(`The request is not manual, so it cannot be run!`),!1)}abort(){clearTimeout(this.timeoutHandler),clearTimeout(this.streamTimeoutHandler),this.abortController.abort()}init(e,t){this.abortController=new AbortController;let{callbacks:n,params:r,headers:i={},transformStream:a,fetch:o,timeout:s,streamTimeout:c,middlewares:l,streamSeparator:u,partSeparator:d,kvSeparator:f,...p}=this.options,m=Object.assign({},bi.headers||{},i,t||{}),h={...p,method:`POST`,body:JSON.stringify({...r,...e||{}}),params:{...r,...e},headers:m,signal:this.abortController.signal,middlewares:l};s&&s>0&&(this.timeoutHandler=window.setTimeout(()=>{this.isTimeout=!0,this.finishRequest(),n?.onError?.(Error(`TimeoutError`))},s)),this.startRequest(),this._asyncHandler=yi(this.baseURL,{fetch:o,...h}).then(async e=>{if(clearTimeout(this.timeoutHandler),this.isTimeout)return;if(a){let t=a;typeof a==`function`&&(t=a(this.baseURL,e.headers)),await this.customResponseHandler(e,n,t,c,u,d,f);return}let t=e.headers.get(`content-type`)||``;switch(t.split(`;`)[0].trim()){case`text/event-stream`:await this.sseResponseHandler(e,n,c,u,d,f);break;case`application/json`:await this.jsonResponseHandler(e,n);break;default:throw Error(`The response content-type: ${t} is not support!`)}}).catch(e=>{clearTimeout(this.timeoutHandler),this.finishRequest();let t=e instanceof Error||e instanceof DOMException?e:Error(`Unknown error!`),r=n?.onError?.(t);if(t.name!==`AbortError`){let e=typeof r==`number`?r:this.options.retryInterval;if(e&&e>0){if(typeof this.options.retryTimes==`number`&&this.retryTimes>=this.options.retryTimes)return;clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{let e={};this.lastEventId!==void 0&&(e[xi]=this.lastEventId),this.init(this.lastManualParams,e)},e),this.retryTimes+=1}}})}startRequest(){this._isRequesting=!0}finishRequest(){this._isRequesting=!1}customResponseHandler=async(e,t,n,r,i,a,o)=>{let s=vi({readableStream:e.body,transformStream:n,streamSeparator:i,partSeparator:a,kvSeparator:o});await this.processStream(s,e,t,r)};sseResponseHandler=async(e,t,n,r,i,a)=>{let o=vi({readableStream:e.body,streamSeparator:r,partSeparator:i,kvSeparator:a});await this.processStream(o,e,t,n)};async processStream(e,t,n,r){let i=[],a=e[Symbol.asyncIterator](),o;do{if(r&&(this.streamTimeoutHandler=window.setTimeout(()=>{this.isStreamTimeout=!0,this.finishRequest(),n?.onError?.(Error(`StreamTimeoutError`),void 0,t.headers)},r)),o=await a.next(),clearTimeout(this.streamTimeoutHandler),this.isStreamTimeout)break;o.value&&(i.push(o.value),n?.onUpdate?.(o.value,t.headers),o?.value?.id!==void 0&&(this.lastEventId=o.value.id))}while(!o.done);if(r&&(clearTimeout(this.streamTimeoutHandler),this.isStreamTimeout)){this.finishRequest();return}this.finishRequest(),n?.onSuccess?.(i,t.headers)}jsonResponseHandler=async(e,t)=>{let n=await e.json();if(n?.success===!1){let r=Error(n.message||`System error`);r.name=n.name||`SystemError`,t?.onError?.(r,n,e.headers)}else t?.onUpdate?.(n,e.headers),this.finishRequest(),t?.onSuccess?.([n],e.headers)};resetRetry(){clearTimeout(this.retryTimer),this.retryTimes=0,this.lastEventId=void 0}};function wi(e,t){return new Ci(e,t)}function Ti(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ei=Ti();function Di(e){Ei=e}var Oi={exec:()=>null};function X(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(ki.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var ki={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},Ai=/^(?:[ \t]*(?:\n|$))+/,ji=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Mi=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ni=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Pi=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Fi=/(?:[*+-]|\d{1,9}[.)])/,Ii=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Li=X(Ii).replace(/bull/g,Fi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Ri=X(Ii).replace(/bull/g,Fi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),zi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Bi=/^[^\n]+/,Vi=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Hi=X(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Vi).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ui=X(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Fi).getRegex(),Wi=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Gi=/|$))/,Ki=X(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Gi).replace(`tag`,Wi).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),qi=X(zi).replace(`hr`,Ni).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Wi).getRegex(),Ji={blockquote:X(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,qi).getRegex(),code:ji,def:Hi,fences:Mi,heading:Pi,hr:Ni,html:Ki,lheading:Li,list:Ui,newline:Ai,paragraph:qi,table:Oi,text:Bi},Yi=X(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Ni).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Wi).getRegex(),Xi={...Ji,lheading:Ri,table:Yi,paragraph:X(zi).replace(`hr`,Ni).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Yi).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Wi).getRegex()},Zi={...Ji,html:X(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Gi).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Oi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:X(zi).replace(`hr`,Ni).replace(`heading`,` *#{1,6} *[^ ]`).replace(`lheading`,Li).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Qi=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,$i=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ea=/^( {2,}|\\)\n(?!\s*$)/,ta=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,ua=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,da=X(ua,`u`).replace(/punct/g,na).getRegex(),fa=X(ua,`u`).replace(/punct/g,oa).getRegex(),pa=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,ma=X(pa,`gu`).replace(/notPunctSpace/g,ia).replace(/punctSpace/g,ra).replace(/punct/g,na).getRegex(),ha=X(pa,`gu`).replace(/notPunctSpace/g,ca).replace(/punctSpace/g,sa).replace(/punct/g,oa).getRegex(),ga=X(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,ia).replace(/punctSpace/g,ra).replace(/punct/g,na).getRegex(),_a=X(/\\(punct)/,`gu`).replace(/punct/g,na).getRegex(),va=X(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ya=X(Gi).replace(`(?:-->|$)`,`-->`).getRegex(),ba=X(`^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^`).replace(`comment`,ya).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),xa=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Sa=X(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,xa).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ca=X(/^!?\[(label)\]\[(ref)\]/).replace(`label`,xa).replace(`ref`,Vi).getRegex(),wa=X(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Vi).getRegex(),Ta={_backpedal:Oi,anyPunctuation:_a,autolink:va,blockSkip:la,br:ea,code:$i,del:Oi,emStrongLDelim:da,emStrongRDelimAst:ma,emStrongRDelimUnd:ga,escape:Qi,link:Sa,nolink:wa,punctuation:aa,reflink:Ca,reflinkSearch:X(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Ca).replace(`nolink`,wa).getRegex(),tag:ba,text:ta,url:Oi},Ea={...Ta,link:X(/^!?\[(label)\]\((.*?)\)/).replace(`label`,xa).getRegex(),reflink:X(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,xa).getRegex()},Da={...Ta,emStrongRDelimAst:ha,emStrongLDelim:fa,url:X(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,`i`).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":`>`,'"':`"`,"'":`'`},Ma=e=>ja[e];function Na(e,t){if(t){if(ki.escapeTest.test(e))return e.replace(ki.escapeReplace,Ma)}else if(ki.escapeTestNoEncode.test(e))return e.replace(ki.escapeReplaceNoEncode,Ma);return e}function Pa(e){try{e=encodeURI(e).replace(ki.percentDecode,`%`)}catch{return null}return e}function Fa(e,t){let n=e.replace(ki.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(ki.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0?-2:-1}function Ra(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function za(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(` `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(` `)}var Ba=class{options;rules;lexer;constructor(e){this.options=e||Ei}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:Ia(e,` `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=za(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Ia(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Ia(t[0],` `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Ia(t[0],` `).split(` `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(` `,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),l=e.split(` `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+` `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let f=e.split(` `,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),p=l):p=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=` `+p.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=` `+l}!u&&!l.trim()&&(u=!0),r+=f+` `,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let f=null,p;this.options.gfm&&(f=this.rules.other.listIsTask.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(this.rules.other.listReplaceTask,``))),i.items.push({type:`list_item`,raw:r,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e=0;ee.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}if(i.loose)for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===` `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=Ia(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=La(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Ra(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Ra(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&!(r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},Va=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ei,this.options.tokenizer=this.options.tokenizer||new Ba,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:ki,block:ka.normal,inline:Aa.normal};this.options.pedantic?(t.block=ka.pedantic,t.inline=Aa.pedantic):this.options.gfm&&(t.block=ka.gfm,this.options.breaks?t.inline=Aa.breaks:t.inline=Aa.gfm),this.tokenizer.rules=t}static get rules(){return{block:ka,inline:Aa}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(ki.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let e=0;e(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=` `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=` `+r.raw,n.text+=` `+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=` `+r.raw,n.text+=` `+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=` `+r.raw,a.text+=` `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=` `+r.raw,n.text+=` `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a=``;for(;e;){i||(a=``),i=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,a)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(a=r.raw.slice(-1)),i=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},Ha=class{options;parser;constructor(e){this.options=e||Ei}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(ki.notSpaceStart)?.[0],i=e.replace(ki.endingNewline,``)+` `;return r?`
`+(n?i:Na(i,!0))+`
`:`
`+(n?i:Na(i,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} `}hr(e){return`
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t `+r+` `}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+Na(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `,escaped:!0}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • `}checkbox({checked:e}){return``}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    `}table(e){let t=``,n=``;for(let t=0;t${r}`,` `+t+` `+r+`
    `}tablerow({text:e}){return` ${e} `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` `}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${Na(e,!0)}`}br(e){return`
    `}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Pa(e);if(i===null)return r;e=i;let a=`
    `+r+``,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Pa(e);if(i===null)return Na(n);e=i;let a=`${n}`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Na(e.text)}},Ua=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},Wa=class e{options;renderer;textRenderer;constructor(e){this.options=e||Ei,this.options.renderer=this.options.renderer||new Ha,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ua}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Ha(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Ba(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Ga;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];Ga.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));let n=i.call(t,e);return a.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Va.lex(e,t??this.defaults)}parser(e,t){return Wa.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(t==null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let o=i.hooks?i.hooks.provideLexer():e?Va.lex:Va.lexInline,s=i.hooks?i.hooks.provideParser():e?Wa.parse:Wa.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(e=>o(e,i)).then(e=>i.hooks?i.hooks.processAllTokens(e):e).then(e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then(()=>e):e).then(e=>s(e,i)).then(e=>i.hooks?i.hooks.postprocess(e):e).catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=s(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=` Please report this to https://github.com/markedjs/marked.`,e){let e=`

    An error occurred:

    `+Na(n.message+``,!0)+`
    `;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},qa=new Ka;function Z(e,t){return qa.parse(e,t)}Z.options=Z.setOptions=function(e){return qa.setOptions(e),Z.defaults=qa.defaults,Di(Z.defaults),Z},Z.getDefaults=Ti,Z.defaults=Ei,Z.use=function(...e){return qa.use(...e),Z.defaults=qa.defaults,Di(Z.defaults),Z},Z.walkTokens=function(e,t){return qa.walkTokens(e,t)},Z.parseInline=qa.parseInline,Z.Parser=Wa,Z.parser=Wa.parse,Z.Renderer=Ha,Z.TextRenderer=Ua,Z.Lexer=Va,Z.lexer=Va.lex,Z.Tokenizer=Ba,Z.Hooks=Ga,Z.parse=Z,Z.options,Z.setOptions,Z.use,Z.walkTokens,Z.parseInline,Wa.parse,Va.lex;var Ja={escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeTest:/[&<>"'/]/,notSpaceStart:/^\S*/,endingNewline:/\n$/,escapeReplace:/[&<>"'/]/g,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,completeFencedCode:/^ {0,3}(`{3,}|~{3,})([\s\S]*?)\n {0,3}\1[ \n\t]*$/},Ya={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},Xa=e=>Ya[e];function Za(e,t){if(t){if(Ja.escapeTest.test(e))return e.replace(Ja.escapeReplace,Xa)}else if(Ja.escapeTestNoEncode.test(e))return e.replace(Ja.escapeReplaceNoEncode,Xa);return e}var Qa=Symbol(`tailMarker`),$a=class{options;markdownInstance;injectTail=!1;constructor(e={}){this.options=e,this.markdownInstance=new Ka,this.configureLinkRenderer(),this.configureParagraphRenderer(),this.configureCodeRenderer(),this.configureHtmlEscapeRenderer(),this.configureTailInjection(),this.markdownInstance.use(e.markedConfig||{})}configureHtmlEscapeRenderer(){this.options.escapeRawHtml&&this.markdownInstance.use({renderer:{html(e){let{raw:t=``,text:n=``}=e;return Za(t||n,!0)}}})}configureLinkRenderer(){this.options.openLinksInNewTab&&this.markdownInstance.use({renderer:{link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n);return`${r}`}}})}configureParagraphRenderer(){let{paragraphTag:e}=this.options;e&&this.markdownInstance.use({renderer:{paragraph({tokens:t}){return`<${e}>${this.parser.parseInline(t)}\n`}}})}configureCodeRenderer(){this.markdownInstance.use({renderer:{code({text:e,raw:t,lang:n,escaped:r,codeBlockStyle:i}){let a=(n||``).trim(),o=a.match(Ja.notSpaceStart)?.[0],s=`${e.replace(Ja.endingNewline,``)}\n`,c=i===`indented`||Ja.completeFencedCode.test(t)?`done`:`loading`,l=r?s:Za(s,!0),u=o?` class="language-${Za(o)}"`:``;return`
    ${l}
    \n`}}})}configureTailInjection(){let e=this;this.markdownInstance.use({hooks:{processAllTokens(t){if(!e.injectTail)return t;let n=e.findLastTextToken(t);return n&&(n[Qa]=!0),t}},renderer:{text(e){let t=`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`text`in e?e.text:``;return e[Qa]?`${t}`:t}}})}protectCustomTags(e){let t=new Map,n=Object.keys(this.options.components||{});if(n.length===0)return{protected:e,placeholders:t};let r=0,i=n.map(e=>e.toLowerCase().replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),a=RegExp(`<(${i})(?:\\s[^>]*)?>`,`gi`),o=RegExp(``,`gi`),s=[],c=a.exec(e);for(;c!==null;)s.push({index:c.index,type:`open`,tagName:c[1].toLowerCase(),match:c[0]}),c=a.exec(e);for(o.lastIndex=0,c=o.exec(e);c!==null;)s.push({index:c.index,type:`close`,tagName:c[1].toLowerCase(),match:c[0]}),c=o.exec(e);s.sort((e,t)=>e.index-t.index);let l=[],u=[],d=0;for(let n of s)if(n.type===`open`)n.match.endsWith(`/>`)||l.push({tagName:n.tagName,start:n.index,openTag:n.match});else if(n.type===`close`&&l.length>0&&l[l.length-1].tagName===n.tagName){let i=l.pop();if(l.length===0){let a=i.start,o=n.index+n.match.length,s=i.openTag,c=n.match,l=e.slice(a+s.length,n.index);if(d{let e=`__X_MD_PLACEHOLDER_${r++}__`;return t.set(e,` `),e});u.push(s+e+c)}else u.push(s+l+c);d=o}}return dt.get(e)??e)}findLastNonEmptyToken(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`list`&&`items`in n&&Array.isArray(n.items))for(let e=n.items.length-1;e>=0;e--){let t=n.items[e];if(`tokens`in t&&t.tokens&&t.tokens.length>0){let e=this.findLastNonEmptyToken(t.tokens);if(e)return e}}if(`tokens`in n&&n.tokens&&n.tokens.length>0){let e=this.findLastNonEmptyToken(n.tokens);if(e)return e}if(n.type===`text`){if((`text`in n?n.text:``).trim())return n}else if(n.type===`html`||n.type===`tag`)return n}return null}findLastTextToken(e){let t=this.findLastNonEmptyToken(e);return!t||t.type!==`text`?null:t}parse(e,t){if(this.injectTail=t?.injectTail??!1,this.options.protectCustomTagNewlines){let{protected:t,placeholders:n}=this.protectCustomTags(e),r=this.markdownInstance.parse(t);return this.restorePlaceholders(r,n)}return this.markdownInstance.parse(e)}},eo=z((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var t;(function(e){e.Root=`root`,e.Text=`text`,e.Directive=`directive`,e.Comment=`comment`,e.Script=`script`,e.Style=`style`,e.Tag=`tag`,e.CDATA=`cdata`,e.Doctype=`doctype`})(t=e.ElementType||={});function n(e){return e.type===t.Tag||e.type===t.Script||e.type===t.Style}e.isTag=n,e.Root=t.Root,e.Text=t.Text,e.Directive=t.Directive,e.Comment=t.Comment,e.Script=t.Script,e.Style=t.Style,e.Tag=t.Tag,e.CDATA=t.CDATA,e.Doctype=t.Doctype})),to=z((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),n=e&&e.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),n}(i);e.NodeWithChildren=l;var u=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=r.ElementType.CDATA,t}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),n}(l);e.CDATA=u;var d=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=r.ElementType.Root,t}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),n}(l);e.Document=d;var f=function(e){t(n,e);function n(t,n,i,a){i===void 0&&(i=[]),a===void 0&&(a=t===`script`?r.ElementType.Script:t===`style`?r.ElementType.Style:r.ElementType.Tag);var o=e.call(this,i)||this;return o.name=t,o.attribs=n,o.type=a,o}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map(function(t){return{name:t,value:e.attribs[t],namespace:e[`x-attribsNamespace`]?.[t],prefix:e[`x-attribsPrefix`]?.[t]}})},enumerable:!1,configurable:!0}),n}(l);e.Element=f;function p(e){return(0,r.isTag)(e)}e.isTag=p;function m(e){return e.type===r.ElementType.CDATA}e.isCDATA=m;function h(e){return e.type===r.ElementType.Text}e.isText=h;function g(e){return e.type===r.ElementType.Comment}e.isComment=g;function _(e){return e.type===r.ElementType.Directive}e.isDirective=_;function v(e){return e.type===r.ElementType.Root}e.isDocument=v;function y(e){return Object.prototype.hasOwnProperty.call(e,`children`)}e.hasChildren=y;function b(e,t){t===void 0&&(t=!1);var r;if(h(e))r=new o(e.data);else if(g(e))r=new s(e.data);else if(p(e)){var i=t?x(e.children):[],a=new f(e.name,n({},e.attribs),i);i.forEach(function(e){return e.parent=a}),e.namespace!=null&&(a.namespace=e.namespace),e[`x-attribsNamespace`]&&(a[`x-attribsNamespace`]=n({},e[`x-attribsNamespace`])),e[`x-attribsPrefix`]&&(a[`x-attribsPrefix`]=n({},e[`x-attribsPrefix`])),r=a}else if(m(e)){var i=t?x(e.children):[],l=new u(i);i.forEach(function(e){return e.parent=l}),r=l}else if(v(e)){var i=t?x(e.children):[],y=new d(i);i.forEach(function(e){return e.parent=y}),e[`x-mode`]&&(y[`x-mode`]=e[`x-mode`]),r=y}else if(_(e)){var b=new c(e.name,e.data);e[`x-name`]!=null&&(b[`x-name`]=e[`x-name`],b[`x-publicId`]=e[`x-publicId`],b[`x-systemId`]=e[`x-systemId`]),r=b}else throw Error(`Not implemented yet: ${e.type}`);return r.startIndex=e.startIndex,r.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(r.sourceCodeLocation=e.sourceCodeLocation),r}e.cloneNode=b;function x(e){for(var t=e.map(function(e){return b(e,!0)}),n=1;n{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var r=eo(),i=to();n(to(),e);var a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},o=function(){function e(e,t,n){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof t==`function`&&(n=t,t=a),typeof e==`object`&&(t=e,e=void 0),this.callback=e??null,this.options=t??a,this.elementCB=n??null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?r.ElementType.Tag:void 0,a=new i.Element(e,t,void 0,n);this.addNode(a),this.tagStack.push(a)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===r.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new i.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment){this.lastNode.data+=e;return}var t=new i.Comment(e);this.addNode(t),this.lastNode=t},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new i.Text(``),t=new i.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new i.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if(typeof this.callback==`function`)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();e.DomHandler=o,e.default=o})),ro=z((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=e.CARRIAGE_RETURN_PLACEHOLDER=e.CARRIAGE_RETURN_REGEX=e.CARRIAGE_RETURN=e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES=`animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.linearGradient.radialGradient.textPath`.split(`.`),e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(e,t){return e[t.toLowerCase()]=t,e},{}),e.CARRIAGE_RETURN=`\r`,e.CARRIAGE_RETURN_REGEX=new RegExp(e.CARRIAGE_RETURN,`g`),e.CARRIAGE_RETURN_PLACEHOLDER=`__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_${Date.now().toString()}__`,e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(e.CARRIAGE_RETURN_PLACEHOLDER,`g`)})),io=z((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=i,e.hasOpenTag=o,e.escapeSpecialCharacters=s,e.revertEscapedCharacters=c,e.formatDOM=l;var t=no(),n=ro();function r(e){return n.CASE_SENSITIVE_TAG_NAMES_MAP[e]}function i(e){for(var t={},n=0,r=e.length;n`||i===` `||i===` `||i===` `||i===`\r`||i===`/`}function s(e){return e.replace(n.CARRIAGE_RETURN_REGEX,n.CARRIAGE_RETURN_PLACEHOLDER)}function c(e){return e.replace(n.CARRIAGE_RETURN_PLACEHOLDER_REGEX,n.CARRIAGE_RETURN)}function l(e,n,r){n===void 0&&(n=null);for(var o=[],s,u=0,d=e.length;u{Object.defineProperty(e,"__esModule",{value:!0}),e.default=h;var t=io(),n=`html`,r=`head`,i=`body`,a=/<([a-zA-Z]+[0-9]?)/,o=function(e,t){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},s=function(e,t){throw Error("This browser does not support `DOMParser.prototype.parseFromString`")},c=typeof window==`object`&&window.DOMParser;if(typeof c==`function`){var l=new c,u=`text/html`;s=function(e,t){return t&&(e=`<${t}>${e}`),l.parseFromString(e,u)},o=s}if(typeof document==`object`&&document.implementation){var d=document.implementation.createHTMLDocument();o=function(e,t){if(t){var n=d.documentElement.querySelector(t);return n&&(n.innerHTML=e),d}return d.documentElement.innerHTML=e,d}}var f=typeof document==`object`&&document.createElement(`template`),p;f&&f.content&&(p=function(e){return f.innerHTML=e,f.content.childNodes});var m=function(){return document.createDocumentFragment().childNodes};function h(e){var c,l;e=(0,t.escapeSpecialCharacters)(e);var u=(a.exec(e)?.[1])?.toLowerCase();switch(u){case n:var d=s(e);if(!(0,t.hasOpenTag)(e,r)){var f=d.querySelector(r);(c=f?.parentNode)==null||c.removeChild(f)}if(!(0,t.hasOpenTag)(e,i)){var f=d.querySelector(i);(l=f?.parentNode)==null||l.removeChild(f)}return d.querySelectorAll(n);case r:case i:var h=o(e).querySelectorAll(u);return(0,t.hasOpenTag)(e,i)&&(0,t.hasOpenTag)(e,r)?h[0].parentNode?.childNodes??m():h;default:if(p)return p(e);var f=o(e,i).querySelector(i);return f?.childNodes??m()}}})),oo=z((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=t(ao()),r=io(),i=/<(![a-zA-Z\s]+)>/;function a(e){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];var t=i.exec(e),a=t?t[1]:void 0;return(0,r.formatDOM)((0,n.default)(e),null,a)}})),so=z((e=>{e.SAME=0,e.CAMELCASE=1,e.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":`acceptCharset`,accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:`className`,classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:`htmlFor`,form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":`httpEquiv`,icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":`accentHeight`,accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":`alignmentBaseline`,allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":`arabicForm`,ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":`baselineShift`,baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":`capHeight`,clip:0,clipPath:1,"clip-path":`clipPath`,clipPathUnits:1,clipRule:1,"clip-rule":`clipRule`,color:0,colorInterpolation:1,"color-interpolation":`colorInterpolation`,colorInterpolationFilters:1,"color-interpolation-filters":`colorInterpolationFilters`,colorProfile:1,"color-profile":`colorProfile`,colorRendering:1,"color-rendering":`colorRendering`,contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":`dominantBaseline`,dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":`enableBackground`,end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":`fillOpacity`,fillRule:1,"fill-rule":`fillRule`,filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":`floodOpacity`,floodColor:1,"flood-color":`floodColor`,focusable:0,fontFamily:1,"font-family":`fontFamily`,fontSize:1,"font-size":`fontSize`,fontSizeAdjust:1,"font-size-adjust":`fontSizeAdjust`,fontStretch:1,"font-stretch":`fontStretch`,fontStyle:1,"font-style":`fontStyle`,fontVariant:1,"font-variant":`fontVariant`,fontWeight:1,"font-weight":`fontWeight`,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":`glyphName`,glyphOrientationHorizontal:1,"glyph-orientation-horizontal":`glyphOrientationHorizontal`,glyphOrientationVertical:1,"glyph-orientation-vertical":`glyphOrientationVertical`,glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":`horizAdvX`,horizOriginX:1,"horiz-origin-x":`horizOriginX`,ideographic:0,imageRendering:1,"image-rendering":`imageRendering`,in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":`letterSpacing`,lightingColor:1,"lighting-color":`lightingColor`,limitingConeAngle:1,local:0,markerEnd:1,"marker-end":`markerEnd`,markerHeight:1,markerMid:1,"marker-mid":`markerMid`,markerStart:1,"marker-start":`markerStart`,markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":`overlinePosition`,overlineThickness:1,"overline-thickness":`overlineThickness`,paintOrder:1,"paint-order":`paintOrder`,panose1:0,"panose-1":`panose1`,pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":`pointerEvents`,points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":`renderingIntent`,repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":`shapeRendering`,slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":`stopColor`,stopOpacity:1,"stop-opacity":`stopOpacity`,strikethroughPosition:1,"strikethrough-position":`strikethroughPosition`,strikethroughThickness:1,"strikethrough-thickness":`strikethroughThickness`,string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":`strokeDasharray`,strokeDashoffset:1,"stroke-dashoffset":`strokeDashoffset`,strokeLinecap:1,"stroke-linecap":`strokeLinecap`,strokeLinejoin:1,"stroke-linejoin":`strokeLinejoin`,strokeMiterlimit:1,"stroke-miterlimit":`strokeMiterlimit`,strokeWidth:1,"stroke-width":`strokeWidth`,strokeOpacity:1,"stroke-opacity":`strokeOpacity`,suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":`textAnchor`,textDecoration:1,"text-decoration":`textDecoration`,textLength:1,textRendering:1,"text-rendering":`textRendering`,to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":`underlinePosition`,underlineThickness:1,"underline-thickness":`underlineThickness`,unicode:0,unicodeBidi:1,"unicode-bidi":`unicodeBidi`,unicodeRange:1,"unicode-range":`unicodeRange`,unitsPerEm:1,"units-per-em":`unitsPerEm`,unselectable:0,vAlphabetic:1,"v-alphabetic":`vAlphabetic`,values:0,vectorEffect:1,"vector-effect":`vectorEffect`,version:0,vertAdvY:1,"vert-adv-y":`vertAdvY`,vertOriginX:1,"vert-origin-x":`vertOriginX`,vertOriginY:1,"vert-origin-y":`vertOriginY`,vHanging:1,"v-hanging":`vHanging`,vIdeographic:1,"v-ideographic":`vIdeographic`,viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":`vMathematical`,vocab:0,widths:0,wordSpacing:1,"word-spacing":`wordSpacing`,writingMode:1,"writing-mode":`writingMode`,x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":`xHeight`,xlinkActuate:1,"xlink:actuate":`xlinkActuate`,xlinkArcrole:1,"xlink:arcrole":`xlinkArcrole`,xlinkHref:1,"xlink:href":`xlinkHref`,xlinkRole:1,"xlink:role":`xlinkRole`,xlinkShow:1,"xlink:show":`xlinkShow`,xlinkTitle:1,"xlink:title":`xlinkTitle`,xlinkType:1,"xlink:type":`xlinkType`,xmlBase:1,"xml:base":`xmlBase`,xmlLang:1,"xml:lang":`xmlLang`,xmlns:0,"xml:space":`xmlSpace`,xmlnsXlink:1,"xmlns:xlink":`xmlnsXlink`,xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}})),co=z((e=>{var t=0,n=1,r=2,i=3,a=4,o=5,s=6;function c(e){return u.hasOwnProperty(e)?u[e]:null}function l(e,t,n,o,s,c,l){this.acceptsBooleans=t===r||t===i||t===a,this.attributeName=o,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=l}var u={};[`children`,`dangerouslySetInnerHTML`,`defaultValue`,`defaultChecked`,`innerHTML`,`suppressContentEditableWarning`,`suppressHydrationWarning`,`style`].forEach(e=>{u[e]=new l(e,t,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(([e,t])=>{u[e]=new l(e,n,!1,t,null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(e=>{u[e]=new l(e,r,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(e=>{u[e]=new l(e,r,!1,e,null,!1,!1)}),[`allowFullScreen`,`async`,`autoFocus`,`autoPlay`,`controls`,`default`,`defer`,`disabled`,`disablePictureInPicture`,`disableRemotePlayback`,`formNoValidate`,`hidden`,`loop`,`noModule`,`noValidate`,`open`,`playsInline`,`readOnly`,`required`,`reversed`,`scoped`,`seamless`,`itemScope`].forEach(e=>{u[e]=new l(e,i,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(e=>{u[e]=new l(e,i,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(e=>{u[e]=new l(e,a,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(e=>{u[e]=new l(e,s,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(e=>{u[e]=new l(e,o,!1,e.toLowerCase(),null,!1,!1)});var d=/[\-\:]([a-z])/g,f=e=>e[1].toUpperCase();`accent-height.alignment-baseline.arabic-form.baseline-shift.cap-height.clip-path.clip-rule.color-interpolation.color-interpolation-filters.color-profile.color-rendering.dominant-baseline.enable-background.fill-opacity.fill-rule.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.glyph-name.glyph-orientation-horizontal.glyph-orientation-vertical.horiz-adv-x.horiz-origin-x.image-rendering.letter-spacing.lighting-color.marker-end.marker-mid.marker-start.overline-position.overline-thickness.paint-order.panose-1.pointer-events.rendering-intent.shape-rendering.stop-color.stop-opacity.strikethrough-position.strikethrough-thickness.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.text-anchor.text-decoration.text-rendering.underline-position.underline-thickness.unicode-bidi.unicode-range.units-per-em.v-alphabetic.v-hanging.v-ideographic.v-mathematical.vector-effect.vert-adv-y.vert-origin-x.vert-origin-y.word-spacing.writing-mode.xmlns:xlink.x-height`.split(`.`).forEach(e=>{let t=e.replace(d,f);u[t]=new l(t,n,!1,e,null,!1,!1)}),[`xlink:actuate`,`xlink:arcrole`,`xlink:role`,`xlink:show`,`xlink:title`,`xlink:type`].forEach(e=>{let t=e.replace(d,f);u[t]=new l(t,n,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(e=>{let t=e.replace(d,f);u[t]=new l(t,n,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(e=>{u[e]=new l(e,n,!1,e.toLowerCase(),null,!1,!1)});var p=`xlinkHref`;u[p]=new l(`xlinkHref`,n,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(e=>{u[e]=new l(e,n,!1,e.toLowerCase(),null,!0,!0)});var{CAMELCASE:m,SAME:h,possibleStandardNames:g}=so(),_=RegExp.prototype.test.bind(RegExp(`^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`)),v=Object.keys(g).reduce((e,t)=>{let n=g[t];return n===h?e[t]=t:n===m?e[t.toLowerCase()]=t:e[t]=n,e},{});e.BOOLEAN=i,e.BOOLEANISH_STRING=r,e.NUMERIC=o,e.OVERLOADED_BOOLEAN=a,e.POSITIVE_NUMERIC=s,e.RESERVED=t,e.STRING=n,e.getPropertyInfo=c,e.isCustomAttribute=_,e.possibleStandardNames=v})),lo=z(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=` `,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),uo=z((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(lo());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),fo=z((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),po=z(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(uo()),r=fo();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),mo=z((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=o,e.setStyleProp=c;var n=i(),r=t(po()),a=new Set([`annotation-xml`,`color-profile`,`font-face`,`font-face-src`,`font-face-uri`,`font-face-format`,`font-face-name`,`missing-glyph`]);function o(e,t){return e.includes(`-`)?!a.has(e):!!(t&&typeof t.is==`string`)}var s={reactCompat:!0};function c(e,t){if(typeof e==`string`){if(!e.trim()){t.style={};return}try{t.style=(0,r.default)(e,s)}catch{t.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(n.version.split(`.`)[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set([`tr`,`tbody`,`thead`,`tfoot`,`colgroup`,`table`,`head`,`html`,`frameset`]),e.canTextBeChildOfNode=function(t){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(t.name)},e.returnFirstArg=function(e){return e}})),ho=z((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var t=co(),n=mo(),r=[`checked`,`value`],i=[`input`,`select`,`textarea`],a={reset:!0,submit:!0};function o(e,o){e===void 0&&(e={});var c={},l=!!(e.type&&a[e.type]);for(var u in e){var d=e[u];if((0,t.isCustomAttribute)(u)){c[u]=d;continue}var f=u.toLowerCase(),p=s(f);if(p){var m=(0,t.getPropertyInfo)(p);switch(r.includes(p)&&i.includes(o)&&!l&&(p=s(`default`+f)),c[p]=d,m?.type){case t.BOOLEAN:c[p]=!0;break;case t.OVERLOADED_BOOLEAN:d===``&&(c[p]=!0);break}continue}n.PRESERVE_CUSTOM_ATTRIBUTES&&(c[u]=d)}return(0,n.setStyleProp)(e.style,c),c}function s(e){return t.possibleStandardNames[e]}})),go=z((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var n=i(),r=t(ho()),a=mo(),o={cloneElement:n.cloneElement,createElement:n.createElement,isValidElement:n.isValidElement};function s(e,t){t===void 0&&(t={});for(var n=[],i=typeof t.replace==`function`,l=t.transform??a.returnFirstArg,u=t.library??o,d=u.cloneElement,f=u.createElement,p=u.isValidElement,m=e.length,h=0;h1&&(_=d(_,{key:_.key??h})),n.push(l(_,g,h));continue}}if(g.type===`text`){var v=!g.data.trim().length;if(v&&g.parent&&!(0,a.canTextBeChildOfNode)(g.parent)||t.trim&&v)continue;n.push(l(g.data,g,h));continue}var y=g,b={};c(y)?((0,a.setStyleProp)(y.attribs.style,y.attribs),b=y.attribs):y.attribs&&(b=(0,r.default)(y.attribs,y.name));var x=void 0;switch(g.type){case`script`:case`style`:g.children[0]&&(b.dangerouslySetInnerHTML={__html:g.children[0].data});break;case`tag`:g.name===`textarea`&&g.children[0]?b.defaultValue=g.children[0].data:g.children?.length&&(x=s(g.children,t));break;default:continue}m>1&&(b.key=h),n.push(l(f(g.name,b,x),g,h))}return n.length===1?n[0]:n}function c(e){return a.PRESERVE_CUSTOM_ATTRIBUTES&&e.type===`tag`&&(0,a.isCustomComponent)(e.name,e.attribs)}})),_o=c(z((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=o;var n=t(oo());e.htmlToDOM=n.default,e.attributesToProps=t(ho()).default;var r=t(go());e.domToReact=r.default;var i=no();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return i.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return i.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return i.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return i.Text}});var a={lowerCaseAttributeNames:!1};function o(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);return e?(0,r.default)((0,n.default)(e,t?.htmlparser2??a),t):[]}}))(),1),vo=_o.default.default||_o.default,yo=q.memo(e=>{let{text:t,animationConfig:n}=e,{fadeDuration:r=200,easing:i=`ease-in-out`}=n||{},[a,o]=(0,q.useState)([]),s=(0,q.useRef)(``);(0,q.useEffect)(()=>{if(t===s.current)return;if(!(s.current&&t.indexOf(s.current)===0)){o([t]),s.current=t;return}let e=t.slice(s.current.length);e&&(o(t=>[...t,e]),s.current=t)},[t]);let c=(0,q.useMemo)(()=>({animation:`x-markdown-fade-in ${r}ms ${i} forwards`,color:`inherit`}),[r,i]);return q.createElement(q.Fragment,null,a.map((e,t)=>q.createElement(`span`,{style:c,key:`animation-text-${t}`},e)))}),bo=/\s/,xo=/[a-zA-Z0-9-]/,So=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),Co=``,To=``,Do=(e,t)=>`${e}-${t}`,Oo=(e,t)=>{if(!e.startsWith(Co,t))return t;let n=e.indexOf(wo,t+4);return n===-1?e.length:n+3},ko=(e,t)=>{if(!e.startsWith(To,t))return t;let n=e.indexOf(Eo,t+9);return n===-1?e.length:n+3},Ao=(e,t)=>{if(e[t+1]!==`/`)return null;let n=t+2,r=``;for(;n`?null:{tagName:r.toLowerCase(),endPos:n+1}},jo=(e,t)=>{let n=t+1,r=``;for(;n`){i=!0,a=e[n-1]===`/`;break}if(e[n]===`"`||e[n]===`'`){let t=e[n];for(n++;ne.toLowerCase()));if(n.size===0||e.length===0)return new Set;let r=new Set,i={},a={},o=0;for(;o{r.add(Do(e,t))});return r}var No=class e{options;static NON_WHITESPACE_REGEX=/[^\r\n\s]+/;constructor(e){this.options=e}detectUnclosedTags(e){return Mo(e,Object.keys(this.options.components??{}))}configureDOMPurify(){let e=Object.keys(this.options.components||{}),t=this.options.dompurifyConfig||{},n=Array.isArray(t.ADD_TAGS)?t.ADD_TAGS:[],r=Array.isArray(t.ADD_ATTR)?t.ADD_ATTR:[];return{...t,ADD_TAGS:Array.from(new Set([...e,...n])),ADD_ATTR:Array.from(new Set([`target`,`rel`,...r]))}}createReplaceElement(t,n){let{enableAnimation:r,animationConfig:i}=this.options.streaming||{};return a=>{let o=`x-markdown-component-${n.current++}`,s=a.type===`text`&&a.data&&e.NON_WHITESPACE_REGEX.test(a.data),c=a.parent?.name,l=c&&this.options.components?.[c];if(r&&s&&!l)return q.createElement(yo,{text:a.data,key:o,animationConfig:i});if(!(`name`in a))return;let{name:u,attribs:d,children:f}=a,p=this.options.components?.[u];if(p){n.tagIndexes[u]=(n.tagIndexes[u]??0)+1;let e={domNode:a,streamStatus:t?.has(Do(u,n.tagIndexes[u]))?`loading`:`done`,key:o,...d,...d.disabled!==void 0&&{disabled:!0},...d.checked!==void 0&&{checked:!0}};if(e.className=[e.className,e.classname,e.class].filter(Boolean).join(` `).trim()||``,u===`code`){let{"data-block":t=`false`,"data-state":n=`done`}=d||{};e.block=t===`true`,e.streamStatus=n===`loading`?`loading`:`done`;let r=d?.[`data-lang`],i=d?.class?.match(/(?:^|\s)language-([^\s]+)/)?.[1]??d?.class?.match(/(?:^|\s)lang-([^\s]+)/)?.[1],a=r||i;a&&(e.lang=a)}return f&&(e.children=this.processChildren(f,t,n)),q.createElement(p,e)}}}processChildren(e,t,n){return(0,_o.domToReact)(e,{replace:this.createReplaceElement(t,n)})}processHtml(e){let t=this.detectUnclosedTags(e),n={current:0,tagIndexes:{}},r=this.configureDOMPurify();return vo(vt.sanitize(e,r),{replace:this.createReplaceElement(t,n)})}render(e){return this.processHtml(e)}},Po={FPS_THRESHOLD:{GOOD:55,WARNING:40},COLORS:{GOOD:`#52c41a`,WARNING:`#faad14`,DANGER:`#ff4d4f`},CHART:{WIDTH:750,HEIGHT:400,PADDING:80}},Fo=()=>typeof window>`u`?{x:12,y:12}:{x:window.innerWidth-220,y:window.innerHeight/2-100},Io=()=>{let[e,t]=(0,q.useState)(0),[n,r]=(0,q.useState)(0),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(!1),[c,l]=(0,q.useState)([]),[u,d]=(0,q.useState)(Fo()),[f,p]=(0,q.useState)(!1),m=(0,q.useRef)([]),h=(0,q.useRef)([]),g=(0,q.useRef)(0),_=(0,q.useRef)(0),v=(0,q.useRef)(void 0),y=(0,q.useRef)({isDragging:!1,startX:0,startY:0,initialX:0,initialY:0});(0,q.useEffect)(()=>{if(typeof window>`u`)return;f||(p(!0),g.current=performance.now());let e=()=>{let n=performance.now(),a=n-g.current;if(h.current.push(a),h.current.length>60&&h.current.shift(),_.current++,a>=1e3){let e=Math.round(_.current*1e3/a),o=b();t(e),r(o),i&&m.current.push({timestamp:Date.now(),fps:e,memory:o}),_.current=0,g.current=n}v.current=requestAnimationFrame(e)};return v.current=requestAnimationFrame(e),()=>{v.current!==void 0&&cancelAnimationFrame(v.current)}},[i,f]);let b=()=>{let e=performance;return e.memory?Math.round(e.memory.usedJSHeapSize/1024/1024):0},x=e=>e<1?`${Math.round(e*1024)} KB`:e>=1024?`${(e/1024).toFixed(2)} GB`:`${e.toFixed(2)} MB`,S=e=>e>=Po.FPS_THRESHOLD.GOOD?Po.COLORS.GOOD:e>=Po.FPS_THRESHOLD.WARNING?Po.COLORS.WARNING:Po.COLORS.DANGER,C=(0,q.useCallback)(()=>{i?(a(!1),l([...m.current]),s(!0)):(m.current=[],a(!0))},[i]),w=(0,q.useCallback)(e=>{e.target.closest(`.x-markdown-debug-action`)||(y.current={isDragging:!0,startX:e.clientX,startY:e.clientY,initialX:u.x,initialY:u.y})},[u]),T=(0,q.useCallback)(e=>{if(!y.current.isDragging)return;let t=e.clientX-y.current.startX,n=e.clientY-y.current.startY;d({x:y.current.initialX+t,y:y.current.initialY+n})},[]),E=(0,q.useCallback)(()=>{y.current.isDragging=!1},[]);return(0,q.useEffect)(()=>{if(!(typeof window>`u`))return document.addEventListener(`mousemove`,T),document.addEventListener(`mouseup`,E),()=>{document.removeEventListener(`mousemove`,T),document.removeEventListener(`mouseup`,E)}},[T,E]),q.createElement(q.Fragment,null,q.createElement(`div`,{className:`x-markdown-debug-panel`,style:{left:u.x,top:u.y,cursor:y.current.isDragging?`grabbing`:`grab`},onMouseDown:w},q.createElement(`div`,{className:`x-markdown-debug-row`},q.createElement(`span`,{className:`x-markdown-debug-label`},`FPS`),q.createElement(`span`,{className:`x-markdown-debug-value`,style:{color:S(e)}},e)),q.createElement(`div`,{className:`x-markdown-debug-row`},q.createElement(`span`,{className:`x-markdown-debug-label`},`Memory`),q.createElement(`span`,{className:`x-markdown-debug-value`},x(n))),q.createElement(`div`,{className:`x-markdown-debug-actions`},q.createElement(`button`,{type:`button`,className:`x-markdown-debug-action x-markdown-debug-record-btn ${i?`recording`:``}`,onClick:C},i?`⏹ Stop`:`⏺ Record`),c.length>0&&!i&&q.createElement(`button`,{type:`button`,className:`x-markdown-debug-action`,onClick:()=>s(!0)},`📊 View`))),o&&c.length>0?q.createElement(`div`,{className:`x-markdown-debug-modal-overlay`,onClick:()=>s(!1)},q.createElement(`div`,{className:`x-markdown-debug-modal`,onClick:e=>e.stopPropagation()},q.createElement(`div`,{className:`x-markdown-debug-modal-header`},q.createElement(`span`,{style:{color:`#fff`,fontSize:18,fontWeight:`600`}},`Performance Recording`),q.createElement(`button`,{type:`button`,className:`x-markdown-debug-close-btn`,onClick:()=>s(!1)},`✕`)),q.createElement(()=>{if(!c.length)return null;let{WIDTH:e,HEIGHT:t,PADDING:n}=Po.CHART,r=e-n*2,i=t-n*2,a=c[0]?.timestamp??0,o=(c[c.length-1]?.timestamp??0)-a||1,s=Math.max(...c.map(e=>e.fps),60),l=Math.max(...c.map(e=>e.memory),0)*1.1,u=c.length>0?c.reduce((e,t)=>e+t.fps,0)/c.length:0,d=c.length>0?c.reduce((e,t)=>e+t.memory,0)/c.length:0,f=c.length>0?Math.min(...c.map(e=>e.fps)):0,p=c.length>0?Math.max(...c.map(e=>e.fps)):0,m=(e,t)=>c.map(s=>`${n+(s.timestamp-a)/o*r},${n+i-s[e]/t*i}`).join(` `);return q.createElement(`div`,{className:`x-markdown-debug-modal-content`},q.createElement(`div`,{className:`x-markdown-debug-stats-summary`},q.createElement(`div`,{className:`x-markdown-debug-stat-item`},q.createElement(`div`,{className:`x-markdown-debug-stat-label`},`Duration`),q.createElement(`div`,{className:`x-markdown-debug-stat-value`},(o/1e3).toFixed(2),`s`)),q.createElement(`div`,{className:`x-markdown-debug-stat-item`},q.createElement(`div`,{className:`x-markdown-debug-stat-label`},`FPS Avg`),q.createElement(`div`,{className:`x-markdown-debug-stat-value`,style:{color:S(u)}},u.toFixed(1))),q.createElement(`div`,{className:`x-markdown-debug-stat-item`},q.createElement(`div`,{className:`x-markdown-debug-stat-label`},`FPS Range`),q.createElement(`div`,{className:`x-markdown-debug-stat-value`},f,` - `,p)),q.createElement(`div`,{className:`x-markdown-debug-stat-item`},q.createElement(`div`,{className:`x-markdown-debug-stat-label`},`Memory Avg`),q.createElement(`div`,{className:`x-markdown-debug-stat-value`},x(d)))),q.createElement(`svg`,{width:e,height:t,className:`x-markdown-debug-chart-full`,role:`img`,"aria-label":`Performance chart showing FPS and memory usage over time`},q.createElement(`title`,null,`Performance Chart`),[0,.25,.5,.75,1].map(a=>q.createElement(`g`,{key:a},q.createElement(`line`,{x1:n,y1:n+i*a,x2:e-n,y2:n+i*a,stroke:`rgba(255,255,255,0.1)`,strokeWidth:`1`}),q.createElement(`line`,{x1:n+r*a,y1:n,x2:n+r*a,y2:t-n,stroke:`rgba(255,255,255,0.1)`,strokeWidth:`1`}))),q.createElement(`polyline`,{points:m(`fps`,s),fill:`none`,stroke:Po.COLORS.GOOD,strokeWidth:`2`,className:`fps-line`}),q.createElement(`polyline`,{points:m(`memory`,l),fill:`none`,stroke:`#1890ff`,strokeWidth:`2`,className:`memory-line`}),q.createElement(`text`,{x:n-10,y:n,fill:Po.COLORS.GOOD,fontSize:`12`,textAnchor:`end`},s.toFixed(0)),q.createElement(`text`,{x:n-10,y:t-n,fill:Po.COLORS.GOOD,fontSize:`12`,textAnchor:`end`},`0`),q.createElement(`text`,{x:n-10,y:n-15,fill:Po.COLORS.GOOD,fontSize:`14`,fontWeight:`bold`,textAnchor:`end`},`FPS`),q.createElement(`text`,{x:e-n+10,y:n+20,fill:`#1890ff`,fontSize:`12`,textAnchor:`start`},x(l)),q.createElement(`text`,{x:e-n+10,y:t-n,fill:`#1890ff`,fontSize:`12`,textAnchor:`start`},x(0)),q.createElement(`text`,{x:e-n+10,y:n+5,fill:`#1890ff`,fontSize:`14`,fontWeight:`bold`,textAnchor:`start`},`Memory`),q.createElement(`text`,{x:n,y:t-n+20,fill:`rgba(255,255,255,0.6)`,fontSize:`12`,textAnchor:`middle`},`0s`),q.createElement(`text`,{x:e-n,y:t-n+20,fill:`rgba(255,255,255,0.6)`,fontSize:`12`,textAnchor:`middle`},(o/1e3).toFixed(1),`s`)),q.createElement(`div`,{className:`x-markdown-debug-legend`},q.createElement(`div`,{className:`x-markdown-debug-legend-item`},q.createElement(`span`,{className:`x-markdown-debug-legend-color`,style:{backgroundColor:Po.COLORS.GOOD}}),q.createElement(`span`,null,`FPS`)),q.createElement(`div`,{className:`x-markdown-debug-legend-item`},q.createElement(`span`,{className:`x-markdown-debug-legend-color`,style:{backgroundColor:`#1890ff`}}),q.createElement(`span`,null,`Memory`))))},null))):null)},Q=function(e){return e.Text=`text`,e.Link=`link`,e.Image=`image`,e.Html=`html`,e.Emphasis=`emphasis`,e.List=`list`,e.Table=`table`,e.InlineCode=`inline-code`,e}({}),Lo={image:[/^!\[[^\]\r\n]{0,1000}$/,/^!\[[^\r\n]{0,1000}\]\(*[^)\r\n]{0,1000}$/],link:[/^\[[^\]\r\n]{0,1000}$/,/^\[[^\r\n]{0,1000}\]\(*[^)\r\n]{0,1000}$/],html:[/^<\/$/,/^<\/?[a-zA-Z][a-zA-Z0-9-]{0,100}[^>\r\n]{0,1000}$/],commonEmphasis:[/^(\*{1,3}|_{1,3})(?!\s)(?!.*\1$)[^\r\n]{0,1000}$/],list:[/^[-+*]\s{0,3}$/,/^[-+*]\s{1,3}(\*{1,3}|_{1,3})(?!\s)(?!.*\1$)[^\r\n]{0,1000}$/],"inline-code":[/^`[^`\r\n]{0,300}$/]},Ro=e=>{if(e.includes(` `))return!1;let t=e.split(` `);if(t.length<=1)return!0;let[n,r]=t,i=n.trim();if(!/^\|.*\|$/.test(i))return!1;let a=r.trim().split(`|`).map(e=>e.trim()).filter(Boolean),o=/^:?-+:?$/;return a.every((e,t)=>t===a.length-1&&e===`:`||o.test(e))},zo={[Q.Link]:{tokenType:Q.Link,isStartOfToken:e=>e.startsWith(`[`),isStreamingValid:e=>Lo.link.some(t=>t.test(e))},[Q.Image]:{tokenType:Q.Image,isStartOfToken:e=>e.startsWith(`!`),isStreamingValid:e=>Lo.image.some(t=>t.test(e))},[Q.Html]:{tokenType:Q.Html,isStartOfToken:e=>e.startsWith(`<`),isStreamingValid:e=>Lo.html.some(t=>t.test(e))},[Q.Emphasis]:{tokenType:Q.Emphasis,isStartOfToken:e=>e.startsWith(`*`)||e.startsWith(`_`),isStreamingValid:e=>Lo.commonEmphasis.some(t=>t.test(e))},[Q.List]:{tokenType:Q.List,isStartOfToken:e=>/^[-+*]/.test(e),isStreamingValid:e=>Lo.list.some(t=>t.test(e)),getCommitPrefix:e=>{let t=e.match(/^([-+*]\s{0,3})/)?.[1],n=t?e.slice(t.length):``;return t&&n.startsWith("`")?t:null}},[Q.Table]:{tokenType:Q.Table,isStartOfToken:e=>e.startsWith(`|`),isStreamingValid:Ro},[Q.InlineCode]:{tokenType:Q.InlineCode,isStartOfToken:e=>e.startsWith("`"),isStreamingValid:e=>Lo[`inline-code`].some(t=>t.test(e))}},Bo=(e,t)=>{let n=zo[t];if(!n)return;let{token:r,pending:i}=e;if(r===Q.Text&&n.isStartOfToken(i)){e.token=t;return}if(r===t&&!n.isStreamingValid(i)){let t=n.getCommitPrefix?.(i);if(t){e.completeMarkdown+=t,e.pending=i.slice(t.length),e.token=Q.Text;return}Uo(e)}},Vo=Object.values(zo).map(e=>({tokenType:e.tokenType,recognize:t=>Bo(t,e.tokenType)})),Ho=()=>({pending:``,token:Q.Text,processedLength:0,completeMarkdown:``}),Uo=e=>{e.pending&&=(e.completeMarkdown+=e.pending,``),e.token=Q.Text},Wo=(e,t=!1)=>{let n=e.split(` `),r=!1,i=``,a=0;for(let e=0;e=a&&/^\s*$/.test(c)&&(t||e{let t=``;for(let n=0;n=55296&&r<=56319?n+1=56320&&e.charCodeAt(n+1)<=57343&&(t+=e[n]+e[n+1],n++):(r<56320||r>57343)&&(t+=e[n])}return t},Ko=e=>{try{return encodeURIComponent(e)}catch(t){return t instanceof URIError?encodeURIComponent(Go(e)):``}},qo=(e,t)=>{let{streaming:n,components:r={}}=t||{},{hasNextChunk:i=!1,incompleteMarkdownComponentMap:a}=n||{},[o,s]=(0,q.useState)(``),c=(0,q.useRef)(Ho()),l=(0,q.useCallback)(e=>{let{token:t,pending:n}=e;if(t===Q.Text||t===Q.Image&&n===`!`)return;if(t===Q.Table&&n.split(` `).length>2)return n;let i=(a||{})[t]||`incomplete-${t}`,o=Ko(n);return r?.[i]?`<${i} data-raw="${o}" />`:void 0},[a,r]),u=(0,q.useCallback)(e=>{if(!e){s(``),c.current=Ho();return}let t=c.current.completeMarkdown+c.current.pending;e.startsWith(t)||(c.current=Ho());let n=c.current,r=e.slice(n.processedLength);if(!r)return;n.processedLength+=r.length;for(let e of r){if(n.pending+=e,Wo(n.completeMarkdown+n.pending)){Uo(n);continue}if(n.token===Q.Text)for(let e of Vo)e.recognize(n);else if(Vo.find(e=>e.tokenType===n.token)?.recognize(n),n.token===Q.Text)for(let e of Vo)e.recognize(n);n.token===Q.Text&&Uo(n)}let i=l(n);s(n.completeMarkdown+(i||``))},[l]);return(0,q.useEffect)(()=>{if(typeof e!=`string`){console.error(`X-Markdown: input must be string, not ${typeof e}.`),s(``);return}i?u(e):s(e)},[e,i,u]),o},Jo=e=>e?typeof e==`boolean`?`▋`:e.content||`▋`:null,Yo=q.memo(e=>{let{streaming:t,config:n,components:i,paragraphTag:a,content:o,children:s,rootClassName:c,className:l,style:u,openLinksInNewTab:d,dompurifyConfig:f,protectCustomTagNewlines:p,escapeRawHtml:m,debug:h}=e,g=(0,q.useMemo)(()=>Jo(t?.tail),[t?.tail]),_=typeof t?.tail==`object`?t.tail.component:void 0,v=!!t?.hasNextChunk&&g,y=r(`x-markdown`,c,l),b=qo(o||s||``,{streaming:t,components:i}),x=(0,q.useMemo)(()=>{if(!v)return i;let e=_?q.createElement(_,{content:g}):q.createElement(`span`,{className:`xmd-tail`},g);return{...i,"xmd-tail":()=>e}},[v,i,_,g]),S=(0,q.useMemo)(()=>new $a({markedConfig:n,paragraphTag:a,openLinksInNewTab:d,components:x,protectCustomTagNewlines:p,escapeRawHtml:m}),[n,a,d,x,p,m]),C=(0,q.useMemo)(()=>new No({components:x,dompurifyConfig:f,streaming:t}),[x,f,t]),w=(0,q.useMemo)(()=>b?S.parse(b,{injectTail:!!v}):``,[b,S,v]),T=(0,q.useMemo)(()=>w?C.render(w):null,[w,C]);return b?q.createElement(q.Fragment,null,q.createElement(`div`,{className:y,style:u},T),h?q.createElement(Io,null):null):null});async function Xo(){return V({url:`/ai/chat/conversations`,method:`get`})}async function Zo(e){return V({url:`/ai/chat/messages/${e}`,method:`get`})}async function Qo(e){return V({url:`/ai/chat/conversations/${e}`,method:`delete`})}var $=ne(),{Text:$o}=te,es=()=>{let{t}=D(),{message:n,modal:r}=F.useApp(),{token:i}=I.useToken(),a=R(e=>e.themeConfig),o=E(),[s]=re(),c=s.get(`agent_id`),[l,u]=(0,q.useState)(null),d=(0,q.useRef)(null),{conversations:f,setConversations:m,activeConversationKey:h,setActiveConversationKey:g}=ui({}),[_,v]=(0,q.useState)([]),[y,b]=(0,q.useState)(!1),[x,S]=(0,q.useState)(``),[C,w]=(0,q.useState)(!1),O=async()=>{let{data:e}=await Xo();e.success&&e.data&&m(e.data)},k=async e=>{let{data:t}=await Zo(e);t.success&&t.data&&(v(t.data),setTimeout(()=>{d.current?.scrollTo({top:`bottom`})},100))};(0,q.useEffect)(()=>{O()},[]),(0,q.useEffect)(()=>{c&&ie(Number(c)).then(({data:e})=>{e.success&&e.data&&u(e.data)})},[c]);let A=e=>{g(e),k(e)},P=()=>{g(``),v([])},ee=e=>{r.confirm({title:t(`ai.chat.delete.confirm`),okButtonProps:{danger:!0},onOk:async()=>{await Qo(e),n.success(t(`ai.chat.delete.success`)),h===e&&(g(``),v([])),await O()}})},te=async e=>{if(!e.trim()||y)return;let t={key:`user-${Date.now()}`,role:`user`,content:e,status:`success`},n={key:`assistant-${Date.now()}`,role:`assistant`,content:``,loading:!0,extraInfo:{isStreaming:!0}};v(e=>[...e,t,n]),b(!0),w(!0);let r=localStorage.getItem(`token`),i=``;wi(`/index.php/ai/chat/send`,{headers:{"Content-Type":`application/json`,Authorization:`Bearer ${r}`,Accept:`text/event-stream`},method:`post`,params:{conversation_id:h,message:e,agent_id:c?Number(c):void 0},callbacks:{onSuccess:async()=>{if(b(!1),S(``),w(!1),!h){let{data:e}=await Xo();if(e.success&&e.data&&e.data.length>0){m(e.data);let t=e.data[0].key;g(t)}}},onError:()=>{b(!1),w(!1)},onUpdate:e=>{console.log(`onUpdate`,e);let t=e.data;if(t!==`[DONE]`)try{let e=JSON.parse(t);e.type===`text_delta`&&e.delta&&(i+=e.delta,v(e=>e.map(e=>e.key===n.key?{...e,content:i,loading:!1}:e))),e.type===`text_end`&&v(t=>t.map(t=>t.key===n.key?{...t,key:e.message_id,loading:!1}:t))}catch{}}}})},ne={assistant:{placement:`start`,variant:`filled`,avatar:(0,$.jsx)(B,{src:l?.icon||`https://file.xinadmin.cn/file/favicons.ico`}),contentRender:(e,t)=>{if(!e)return null;let n=t?.extraInfo?.isStreaming===!0;return(0,$.jsx)(Yo,{content:e,streaming:{hasNextChunk:n,enableAnimation:!0,tail:n},openLinksInNewTab:!0,escapeRawHtml:!0})}},user:{placement:`end`,variant:`filled`,avatar:(0,$.jsx)(B,{icon:(0,$.jsx)(j,{}),style:{background:i.colorFillSecondary,color:i.colorTextSecondary},size:36})}},L=_.length>0;return(0,$.jsxs)(e,{styles:{body:{padding:0,overflow:`hidden`,display:`flex`,height:`calc(100vh - 180px)`}},title:(0,$.jsx)(p,{align:`center`,children:l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(B,{src:l.icon,size:36}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{style:{fontSize:18,fontWeight:600,marginRight:10},children:l.name}),l.description&&(0,$.jsx)($o,{type:`secondary`,style:{fontSize:12,lineHeight:1},children:l.description})]})]}):(0,$.jsx)(`span`,{children:t(`ai.chat.defaultTitle`)})}),extra:(0,$.jsx)(M,{onClick:()=>o(`/ai/agent`),children:t(`ai.chat.switchAgent`)}),children:[(0,$.jsx)(`div`,{style:{width:280,borderRight:`1px solid ${i.colorBorderSecondary}`},children:(0,$.jsx)(_r,{items:f,activeKey:h,onActiveChange:A,menu:e=>({items:[{label:`Rename`,key:`Rename`,icon:(0,$.jsx)(T,{})},{type:`divider`},{label:`Delete Chat`,key:`delete`,icon:(0,$.jsx)(N,{}),danger:!0,onClick:()=>ee(e.key)}]}),creation:{onClick:P},style:{flex:1,overflow:`auto`}})}),(0,$.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0 px-1`,children:[!L&&(0,$.jsx)(`div`,{className:`h-full flex items-center justify-center`,children:(0,$.jsx)(oi,{icon:l?.icon||`https://file.xinadmin.cn/file/favicons.ico`,style:{backgroundImage:a.themeScheme===`dark`?`linear-gradient(97deg, rgba(90,196,255,0.12) 0%, rgba(174,136,255,0.12) 100%)`:`linear-gradient(97deg, #f2f9fe 0%, #f7f3ff 100%)`,borderRadius:20,width:`80%`,padding:`20px`},title:t(`ai.chat.welcome.title`),description:t(`ai.chat.welcome.description`),variant:`borderless`})}),L&&(0,$.jsx)(`div`,{style:{flex:1,overflow:`hidden`},children:(0,$.jsx)(Un.List,{ref:d,items:_,autoScroll:!0,style:{height:`100%`,padding:16},role:ne})}),(0,$.jsx)(`div`,{style:{padding:`0 16px 16px`},children:(0,$.jsx)(ni,{loading:y,disabled:C,value:x,onChange:S,placeholder:t(`ai.chat.placeholder`),onSubmit:te,onCancel:()=>b(!1),autoSize:{minRows:1,maxRows:6}})})]})]})};export{es as default};