@talkjs/react-components 0.0.35 → 0.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/default.cjs +5 -5
  2. package/default.js +12 -12
  3. package/package.json +1 -1
package/default.cjs CHANGED
@@ -696,7 +696,7 @@
696
696
  <div className="t-theme-audio-block">
697
697
  <${Vo} src=${n.url} filename=${n.filename} />
698
698
 
699
- <a className="t-body-text" href=${e}>
699
+ <a className="t-body-text" href=${e} target="_blank">
700
700
  <${r}
701
701
  type="attachment"
702
702
  className="t-attachment-icon"
@@ -786,7 +786,7 @@
786
786
  </div>
787
787
  `},FileBlock:function({block:n,downloadUrl:e,common:t}){const{Icon:r}=t.theme;return x`
788
788
  <div className="t-theme-file-block">
789
- <a className="t-body-text" href=${e}>
789
+ <a className="t-body-text" href=${e} target="_blank">
790
790
  <${r}
791
791
  type="attachment"
792
792
  className="t-attachment-icon"
@@ -857,7 +857,7 @@
857
857
  </div>
858
858
  </a>
859
859
 
860
- <a href=${e} className="t-body-text">
860
+ <a href=${e} className="t-body-text" target="_blank">
861
861
  <${r} className="download-icon" type="download" common=${t} />
862
862
  <span>${n.filename}</span>
863
863
  <span className="t-filesize"> (${oi(n.size)})</span>
@@ -1169,7 +1169,7 @@
1169
1169
  </div>
1170
1170
  </div>
1171
1171
 
1172
- <a href=${e} className="t-body-text">
1172
+ <a href=${e} className="t-body-text" target="_blank">
1173
1173
  <${r} className="download-icon" type="download" common=${t} />
1174
1174
  <span>${n.filename}</span>
1175
1175
  <span className="t-filesize"> (${oi(n.size)})</span>
@@ -1270,7 +1270,7 @@
1270
1270
  </div>
1271
1271
  `,[e,t]}setOptions(e){if(this.options.container!==e.container){const t=this.parentFromOptionsContainer(e.container);t.appendChild(this.container),this.parent=t}e.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.options=e,this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth}getScroll(){return this.scrollContainer.scrollLeft}setScroll(e){this.scrollContainer.scrollLeft=e}setScrollPercentage(e){const{scrollWidth:t}=this.scrollContainer,r=t*e;this.setScroll(r)}destroy(){var e,t;this.subscriptions.forEach(r=>r()),this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.unsubscribeOnScroll)===null||t===void 0||t.call(this)}createDelay(e=10){let t,r;const i=()=>{t&&clearTimeout(t),r&&r()};return this.timeouts.push(i),()=>new Promise((o,s)=>{i(),r=s,t=setTimeout(()=>{t=void 0,r=void 0,o()},e)})}convertColorValues(e){if(!Array.isArray(e))return e||"";if(e.length<2)return e[0]||"";const t=document.createElement("canvas"),r=t.getContext("2d"),i=t.height*(window.devicePixelRatio||1),o=r.createLinearGradient(0,0,0,i),s=1/(e.length-1);return e.forEach((a,l)=>{const u=l*s;o.addColorStop(u,a)}),o}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(e,t,r,i){const o=e[0],s=e[1]||e[0],a=o.length,{width:l,height:u}=r.canvas,c=u/2,d=this.getPixelRatio(),h=t.barWidth?t.barWidth*d:1,p=t.barGap?t.barGap*d:t.barWidth?h/2:0,f=t.barRadius||0,m=l/(h+p)/a,E=f&&"roundRect"in r?"roundRect":"rect";r.beginPath();let A=0,D=0,_=0;for(let S=0;S<=a;S++){const T=Math.round(S*m);if(T>A){const L=Math.round(D*c*i),g=L+Math.round(_*c*i)||1;let O=c-L;t.barAlign==="top"?O=0:t.barAlign==="bottom"&&(O=u-g),r[E](A*(h+p),O,h,g,f),A=T,D=0,_=0}const N=Math.abs(o[S]||0),I=Math.abs(s[S]||0);N>D&&(D=N),I>_&&(_=I)}r.fill(),r.closePath()}renderLineWaveform(e,t,r,i){const o=s=>{const a=e[s]||e[0],l=a.length,{height:u}=r.canvas,c=u/2,d=r.canvas.width/l;r.moveTo(0,c);let h=0,p=0;for(let f=0;f<=l;f++){const m=Math.round(f*d);if(m>h){const A=c+(Math.round(p*c*i)||1)*(s===0?-1:1);r.lineTo(h,A),h=m,p=0}const E=Math.abs(a[f]||0);E>p&&(p=E)}r.lineTo(h,c)};r.beginPath(),o(0),o(1),r.fill(),r.closePath()}renderWaveform(e,t,r){if(r.fillStyle=this.convertColorValues(t.waveColor),t.renderFunction)return void t.renderFunction(e,r);let i=t.barHeight||1;if(t.normalize){const o=Array.from(e[0]).reduce((s,a)=>Math.max(s,Math.abs(a)),0);i=o?1/o:1}t.barWidth||t.barGap||t.barAlign?this.renderBarWaveform(e,t,r,i):this.renderLineWaveform(e,t,r,i)}renderSingleCanvas(e,t,r,i,o,s,a){const l=this.getPixelRatio(),u=document.createElement("canvas");u.width=Math.round(r*l),u.height=Math.round(i*l),u.style.width=`${r}px`,u.style.height=`${i}px`,u.style.left=`${Math.round(o)}px`,s.appendChild(u);const c=u.getContext("2d");if(this.renderWaveform(e,t,c),u.width>0&&u.height>0){const d=u.cloneNode(),h=d.getContext("2d");h.drawImage(u,0,0),h.globalCompositeOperation="source-in",h.fillStyle=this.convertColorValues(t.progressColor),h.fillRect(0,0,u.width,u.height),a.appendChild(d)}}renderMultiCanvas(e,t,r,i,o,s){const a=this.getPixelRatio(),{clientWidth:l}=this.scrollContainer;if(l*a>=r)return void this.renderSingleCanvas(e,t,l,i,0,o,s);const u=r/a;let c=Math.min(Rr.MAX_CANVAS_WIDTH,l,u),d={};if(t.barWidth||t.barGap){const E=t.barWidth||.5,A=E+(t.barGap||E/2);c%A!=0&&(c=Math.floor(c/A)*A)}const h=E=>{if(E<0||E>=p||d[E])return;d[E]=!0;const A=E*c,D=Math.min(u-A,c);if(D<=0)return;const _=e.map(S=>{const T=Math.floor(A/u*S.length),N=Math.floor((A+D)/u*S.length);return S.slice(T,N)});this.renderSingleCanvas(_,t,D,i,A,o,s)},p=Math.ceil(u/c),f=this.scrollContainer.scrollLeft/u,m=Math.floor(f*p);h(m-1),h(m),h(m+1),p>1&&(this.unsubscribeOnScroll=this.on("scroll",()=>{const{scrollLeft:E}=this.scrollContainer,A=Math.floor(E/u*p);Object.keys(d).length>Rr.MAX_NODES&&(o.innerHTML="",s.innerHTML="",d={}),h(A-1),h(A),h(A+1)}))}renderChannel(e,t,r,i){var{overlay:o}=t,s=function(c,d){var h={};for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&d.indexOf(p)<0&&(h[p]=c[p]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function"){var f=0;for(p=Object.getOwnPropertySymbols(c);f<p.length;f++)d.indexOf(p[f])<0&&Object.prototype.propertyIsEnumerable.call(c,p[f])&&(h[p[f]]=c[p[f]])}return h}(t,["overlay"]);const a=document.createElement("div"),l=this.getHeight(s.height,s.splitChannels);a.style.height=`${l}px`,o&&i>0&&(a.style.marginTop=`-${l}px`),this.canvasWrapper.style.minHeight=`${l}px`,this.canvasWrapper.appendChild(a);const u=a.cloneNode();this.progressWrapper.appendChild(u),this.renderMultiCanvas(e,s,r,l,a,u)}render(e){return Me(this,void 0,void 0,function*(){var t;this.timeouts.forEach(l=>l()),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const r=this.getPixelRatio(),i=this.scrollContainer.clientWidth,o=Math.ceil(e.duration*(this.options.minPxPerSec||0));this.isScrollable=o>i;const s=this.options.fillParent&&!this.isScrollable,a=(s?i:o)*r;if(this.wrapper.style.width=s?"100%":`${o}px`,this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}px`,this.audioData=e,this.emit("render"),this.options.splitChannels)for(let l=0;l<e.numberOfChannels;l++){const u=Object.assign(Object.assign({},this.options),(t=this.options.splitChannels)===null||t===void 0?void 0:t[l]);this.renderChannel([e.getChannelData(l)],u,a,l)}else{const l=[e.getChannelData(0)];e.numberOfChannels>1&&l.push(e.getChannelData(1)),this.renderChannel(l,this.options,a,0)}Promise.resolve().then(()=>this.emit("rendered"))})}reRender(){var e;if((e=this.unsubscribeOnScroll)===null||e===void 0||e.call(this),delete this.unsubscribeOnScroll,!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:r}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:i}=this.progressWrapper.getBoundingClientRect();let o=i-r;o*=2,o=o<0?Math.floor(o):Math.ceil(o),o/=2,this.scrollContainer.scrollLeft+=o}}zoom(e){this.options.minPxPerSec=e,this.reRender()}scrollIntoView(e,t=!1){const{scrollLeft:r,scrollWidth:i,clientWidth:o}=this.scrollContainer,s=e*i,a=r,l=r+o,u=o/2;if(this.isDragging)s+30>l?this.scrollContainer.scrollLeft+=30:s-30<a&&(this.scrollContainer.scrollLeft-=30);else{(s<a||s>l)&&(this.scrollContainer.scrollLeft=s-(this.options.autoCenter?u:0));const c=s-r-u;t&&this.options.autoCenter&&c>0&&(this.scrollContainer.scrollLeft+=Math.min(c,10))}{const c=this.scrollContainer.scrollLeft,d=c/i,h=(c+o)/i;this.emit("scroll",d,h,c,c+o)}}renderProgress(e,t){if(isNaN(e))return;const r=100*e;this.canvasWrapper.style.clipPath=`polygon(${r}% 0, 100% 0, 100% 100%, ${r}% 100%)`,this.progressWrapper.style.width=`${r}%`,this.cursor.style.left=`${r}%`,this.cursor.style.transform=`translateX(-${Math.round(r)===100?this.options.cursorWidth:0}px)`,this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(e,t)}exportImage(e,t,r){return Me(this,void 0,void 0,function*(){const i=this.canvasWrapper.querySelectorAll("canvas");if(!i.length)throw new Error("No waveform data");if(r==="dataURL"){const o=Array.from(i).map(s=>s.toDataURL(e,t));return Promise.resolve(o)}return Promise.all(Array.from(i).map(o=>new Promise((s,a)=>{o.toBlob(l=>{l?s(l):a(new Error("Could not export image"))},e,t)})))})}}Rr.MAX_CANVAS_WIDTH=8e3,Rr.MAX_NODES=10;class LD extends ji{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}}class $d extends ji{constructor(e=new AudioContext){super(),this.bufferNode=null,this.playStartTime=0,this.playedDuration=0,this._muted=!1,this._playbackRate=1,this._duration=void 0,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.seeking=!1,this.autoplay=!1,this.addEventListener=this.on,this.removeEventListener=this.un,this.audioContext=e,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return Me(this,void 0,void 0,function*(){})}get src(){return this.currentSrc}set src(e){if(this.currentSrc=e,this._duration=void 0,!e)return this.buffer=null,void this.emit("emptied");fetch(e).then(t=>{if(t.status>=400)throw new Error(`Failed to fetch ${e}: ${t.status} (${t.statusText})`);return t.arrayBuffer()}).then(t=>this.currentSrc!==e?null:this.audioContext.decodeAudioData(t)).then(t=>{this.currentSrc===e&&(this.buffer=t,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())})}_play(){var e;if(!this.paused)return;this.paused=!1,(e=this.bufferNode)===null||e===void 0||e.disconnect(),this.bufferNode=this.audioContext.createBufferSource(),this.buffer&&(this.bufferNode.buffer=this.buffer),this.bufferNode.playbackRate.value=this._playbackRate,this.bufferNode.connect(this.gainNode);let t=this.playedDuration*this._playbackRate;t>=this.duration&&(t=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,t),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var e;this.paused=!0,(e=this.bufferNode)===null||e===void 0||e.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return Me(this,void 0,void 0,function*(){this.paused&&(this._play(),this.emit("play"))})}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(e){var t,r;const i=e-this.currentTime;(t=this.bufferNode)===null||t===void 0||t.stop(this.audioContext.currentTime+i),(r=this.bufferNode)===null||r===void 0||r.addEventListener("ended",()=>{this.bufferNode=null,this.pause()},{once:!0})}setSinkId(e){return Me(this,void 0,void 0,function*(){return this.audioContext.setSinkId(e)})}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this.bufferNode&&(this.bufferNode.playbackRate.value=e)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(e){const t=!this.paused;t&&this._pause(),this.playedDuration=e/this._playbackRate,t&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var e,t;return(e=this._duration)!==null&&e!==void 0?e:((t=this.buffer)===null||t===void 0?void 0:t.duration)||0}set duration(e){this._duration=e}get volume(){return this.gainNode.gain.value}set volume(e){this.gainNode.gain.value=e,this.emit("volumechange")}get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(e){return/^(audio|video)\//.test(e)}getGainNode(){return this.gainNode}getChannelData(){const e=[];if(!this.buffer)return e;const t=this.buffer.numberOfChannels;for(let r=0;r<t;r++)e.push(this.buffer.getChannelData(r));return e}}const kD={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};class Ni extends bD{static create(e){return new Ni(e)}constructor(e){const t=e.media||(e.backend==="WebAudio"?new $d:void 0);super({media:t,mediaControls:e.mediaControls,autoplay:e.autoplay,playbackRate:e.audioRate}),this.plugins=[],this.decodedData=null,this.subscriptions=[],this.mediaSubscriptions=[],this.abortController=null,this.options=Object.assign({},kD,e),this.timer=new LD;const r=t?void 0:this.getMediaElement();this.renderer=new Rr(this.options,r),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const i=this.options.url||this.getSrc()||"";Promise.resolve().then(()=>{this.emit("init");const{peaks:o,duration:s}=this.options;(i||o&&s)&&this.load(i,o,s).catch(()=>null)})}updateProgress(e=this.getCurrentTime()){return this.renderer.renderProgress(e/this.getDuration(),this.isPlaying()),e}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",()=>{if(!this.isSeeking()){const e=this.updateProgress();this.emit("timeupdate",e),this.emit("audioprocess",e)}}))}initPlayerEvents(){this.isPlaying()&&(this.emit("play"),this.timer.start()),this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",()=>{const e=this.updateProgress();this.emit("timeupdate",e)}),this.onMediaEvent("play",()=>{this.emit("play"),this.timer.start()}),this.onMediaEvent("pause",()=>{this.emit("pause"),this.timer.stop()}),this.onMediaEvent("emptied",()=>{this.timer.stop()}),this.onMediaEvent("ended",()=>{this.emit("finish")}),this.onMediaEvent("seeking",()=>{this.emit("seeking",this.getCurrentTime())}),this.onMediaEvent("error",e=>{this.emit("error",e.error)}))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",(e,t)=>{this.options.interact&&(this.seekTo(e),this.emit("interaction",e*this.getDuration()),this.emit("click",e,t))}),this.renderer.on("dblclick",(e,t)=>{this.emit("dblclick",e,t)}),this.renderer.on("scroll",(e,t,r,i)=>{const o=this.getDuration();this.emit("scroll",e*o,t*o,r,i)}),this.renderer.on("render",()=>{this.emit("redraw")}),this.renderer.on("rendered",()=>{this.emit("redrawcomplete")}),this.renderer.on("dragstart",e=>{this.emit("dragstart",e)}),this.renderer.on("dragend",e=>{this.emit("dragend",e)}));{let e;this.subscriptions.push(this.renderer.on("drag",t=>{if(!this.options.interact)return;let r;this.renderer.renderProgress(t),clearTimeout(e),this.isPlaying()?r=0:this.options.dragToSeek===!0?r=200:typeof this.options.dragToSeek=="object"&&this.options.dragToSeek!==void 0&&(r=this.options.dragToSeek.debounceTime),e=setTimeout(()=>{this.seekTo(t)},r),this.emit("interaction",t*this.getDuration()),this.emit("drag",t)}))}}initPlugins(){var e;!((e=this.options.plugins)===null||e===void 0)&&e.length&&this.options.plugins.forEach(t=>{this.registerPlugin(t)})}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach(e=>e()),this.mediaSubscriptions=[]}setOptions(e){this.options=Object.assign({},this.options,e),this.renderer.setOptions(this.options),e.audioRate&&this.setPlaybackRate(e.audioRate),e.mediaControls!=null&&(this.getMediaElement().controls=e.mediaControls)}registerPlugin(e){return e._init(this),this.plugins.push(e),this.subscriptions.push(e.once("destroy",()=>{this.plugins=this.plugins.filter(t=>t!==e)})),e}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(e){return this.renderer.setScroll(e)}setScrollTime(e){const t=e/this.getDuration();this.renderer.setScrollPercentage(t)}getActivePlugins(){return this.plugins}loadAudio(e,t,r,i){return Me(this,void 0,void 0,function*(){var o;if(this.emit("load",e),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,!t&&!r){const a=this.options.fetchParams||{};window.AbortController&&!a.signal&&(this.abortController=new AbortController,a.signal=(o=this.abortController)===null||o===void 0?void 0:o.signal);const l=u=>this.emit("loading",u);t=yield yD.fetchBlob(e,l,a)}this.setSrc(e,t);const s=yield new Promise(a=>{const l=i||this.getDuration();l?a(l):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",()=>a(this.getDuration()),{once:!0}))});if(!e&&!t){const a=this.getMediaElement();a instanceof $d&&(a.duration=s)}if(r)this.decodedData=Ud.createBuffer(r,s||0);else if(t){const a=yield t.arrayBuffer();this.decodedData=yield Ud.decode(a,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())})}load(e,t,r){return Me(this,void 0,void 0,function*(){try{return yield this.loadAudio(e,void 0,t,r)}catch(i){throw this.emit("error",i),i}})}loadBlob(e,t,r){return Me(this,void 0,void 0,function*(){try{return yield this.loadAudio("",e,t,r)}catch(i){throw this.emit("error",i),i}})}zoom(e){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(e),this.emit("zoom",e)}getDecodedData(){return this.decodedData}exportPeaks({channels:e=2,maxLength:t=8e3,precision:r=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const i=Math.min(e,this.decodedData.numberOfChannels),o=[];for(let s=0;s<i;s++){const a=this.decodedData.getChannelData(s),l=[],u=a.length/t;for(let c=0;c<t;c++){const d=a.slice(Math.floor(c*u),Math.ceil((c+1)*u));let h=0;for(let p=0;p<d.length;p++){const f=d[p];Math.abs(f)>Math.abs(h)&&(h=f)}l.push(Math.round(h*r)/r)}o.push(l)}return o}getDuration(){let e=super.getDuration()||0;return e!==0&&e!==1/0||!this.decodedData||(e=this.decodedData.duration),e}toggleInteraction(e){this.options.interact=e}setTime(e){super.setTime(e),this.updateProgress(e),this.emit("timeupdate",e)}seekTo(e){const t=this.getDuration()*e;this.setTime(t)}playPause(){return Me(this,void 0,void 0,function*(){return this.isPlaying()?this.pause():this.play()})}stop(){this.pause(),this.setTime(0)}skip(e){this.setTime(this.getCurrentTime()+e)}empty(){this.load("",[[0]],.001)}setMediaElement(e){this.unsubscribePlayerEvents(),super.setMediaElement(e),this.initPlayerEvents()}exportImage(){return Me(this,arguments,void 0,function*(e="image/png",t=1,r="dataURL"){return this.renderer.exportImage(e,t,r)})}destroy(){var e;this.emit("destroy"),(e=this.abortController)===null||e===void 0||e.abort(),this.plugins.forEach(t=>t.destroy()),this.subscriptions.forEach(t=>t()),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}}function Vo({src:n,onError:e,filename:t,className:r=""}){const i=R.useRef(null),o=R.useRef(),s=R.useRef(),[a,l]=R.useState(!1),[u,c]=R.useState(0),[d,h]=R.useState(1),p=R.useRef(),[f,m]=R.useState(!1),E=Z(ie().t$);R.useEffect(()=>{o.current=new Audio;const _={normalize:!0,height:50,container:i.current};function S(){const I=o.current;I&&(I.error.message==="PIPELINE_ERROR_READ: FFmpegDemuxer: demuxer seek failed"?(I.load(),l(!1)):(m(!0),l(!1),e==null||e()))}const T=t.slice(t.lastIndexOf(".")+1);if(function(I){return/(?:^|\/)talkjs_audio_message_[0-9]+_([0-9]+)[.](?:mp3|webm)$/.test(I)}(t)&&T==="webm"&&!o.current.canPlayType("audio/webm;codecs=opus"))_.backend="WebAudio",s.current=new Audio("data:audio/mp3;base64,//MkxAAHiAICWABElBeKPL/RANb2w+yiT1g/gTok//lP/W/l3h8QO/OCdCqCW2Cw//MkxAQHkAIWUAhEmAQXWUOFW2dxPu//9mr60ElY5sseQ+xxesmHKtZr7bsqqX2L//MkxAgFwAYiQAhEAC2hq22d3///9FTV6tA36JdgBJoOGgc+7qvqej5Zu7/7uI9l//MkxBQHAAYi8AhEAO193vt9KGOq+6qcT7hhfN5FTInmwk8RkqKImTM55pRQHQSq//MkxBsGkgoIAABHhTACIJLf99nVI///yuW1uBqWfEu7CgNPWGpUadBmZ////4sL//MkxCMHMAH9iABEmAsKioqKigsLCwtVTEFNRTMuOTkuNVVVVVVVVVVVVVVVVVVV//MkxCkECAUYCAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),s.current.controls=!1;else{const I=o.current;I.addEventListener("error",S),I.src=n,I.preload="auto",I.preservesPitch=!0,_.media=I}p.current=function(I){var k,w,U,y,M,$,j,G;if(!I.container)return;const L=getComputedStyle(I.container),g=(k=vi.parse(L.color))!=null?k:new vi(255,255,255,1),O=g.withAlpha(g.alpha/2);return Ni.create({...I,barGap:(w=I.barGap)!=null?w:2,barRadius:(U=I.barRadius)!=null?U:0,barWidth:(y=I.barWidth)!=null?y:2,barHeight:I.barHeight,hideScrollbar:!0,cursorWidth:(M=I.cursorWidth)!=null?M:0,cursorColor:I.cursorColor,height:($=I.height)!=null?$:24,progressColor:(j=I.progressColor)!=null?j:O.toRgbaString(),waveColor:(G=I.waveColor)!=null?G:O.toRgbaString()})}(_);const N=p.current;return N.on("finish",()=>{o.current.loop=!0,l(!1)}),N.on("ready",I=>c(Math.trunc(I))),N.on("timeupdate",I=>c(Math.trunc(I))),_.backend==="WebAudio"&&N.load(n).catch(()=>{m(!0),l(!1),e==null||e()}),()=>{var I;(I=o.current)==null||I.removeEventListener("error",S),o.current=void 0,N.destroy(),p.current=void 0}},[n,t,e]);const A=R.useCallback(()=>{var _;if(p.current.options.backend==="WebAudio")p.current.isPlaying()||s.current.play(),p.current.playPause(),l((_=p.current.isPlaying())!=null?_:!1);else{const S=o.current;S.paused?S.play():S.pause(),S.loop=!1,!S.paused&&S.ended&&(S.load(),S.play()),l(!S.paused)}},[]),D=R.useCallback(_=>{p.current.setPlaybackRate(_),h(_)},[]);return f?v.jsx("div",{}):v.jsxs("div",{className:`t-audio-player ${r}`,children:[v.jsx("button",{onClick:A,children:v.jsx(zo,{className:"t-play-pause-icon",type:a?"pause":"play","aria-label":a?E.ARIA_PAUSE_AUDIO:E.ARIA_PLAY_AUDIO})}),v.jsx("div",{className:"t-waveform",ref:i}),v.jsx("div",{className:"t-duration",children:pu(u)}),v.jsxs(rr,{type:"menu",popoverComponent:MD,popoverProps:{playbackSpeed:d,selectPlaybackSpeed:D},className:"t-playback-speed","aria-label":E.ARIA_SET_PLAYBACK_SPEED,children:[d,"x",v.jsx(zo,{type:"updown",className:"t-up-down-icon","aria-hidden":!0})]})]})}Ni.BasePlugin=class extends ji{constructor(n){super(),this.subscriptions=[],this.options=n}onInit(){}_init(n){this.wavesurfer=n,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(n=>n())}},Ni.dom=vD;const wD=[.25,.5,.75,1,1.25,1.5,2];function MD({playbackSpeed:n,selectPlaybackSpeed:e}){return v.jsxs("div",{className:"t-playback-speed-menu",children:[v.jsx("div",{className:"t-playback-heading",children:"Playback Speed"}),wD.map(t=>v.jsxs(en,{className:"t-menu-item",onSelect:()=>e(t),children:[v.jsx("span",{className:"t-playback-checkmark",children:n===t?"✓ ":""}),t,"x"]},t))]})}const FD=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,xD=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/;class vi{constructor(e,t,r,i){this.red=e,this.green=t,this.blue=r,this.alpha=i}static parse(e){var r;const t=(r=e.match(FD))!=null?r:e.match(xD);if(t){const[i,o,s,a,l="1"]=t;return new vi(Number(o),Number(s),Number(a),Number(l))}return null}withAlpha(e){return new vi(this.red,this.green,this.blue,e)}toRgbaString(){const{red:e,green:t,blue:r,alpha:i}=this;return i!==1?`rgba(${e}, ${t}, ${r}, ${i})`:`rgb(${e}, ${t}, ${r})`}}const rm=/^\/.*[^\\]\/[im]*$/;function zd(n){return rm.test(n)?!Yo(n).test(""):!1}function Yo(n){const e=n.match(/^\/(.*[^\\])\/(.*)$/);if(!e)throw new Error(`Expected ${n} to be a (non-empty) regex`);let t=e[2]||"";return t=t.replace(/[^im]/g,"")+"g",new RegExp(e[1],t)}function im(n){const e=n.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp("^"+e+"$","i")}function PD(n,e){const t=Ep(e),r=im(n);return t!==void 0&&r.test(t)}const BD=/^[]/g;function om(n){return n.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function cl(n,e){!n()&&!e&&(e=n.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/,"`$1`")+" was not true")}(n=>{function e(r){}function t(r,i){(function(o,s){switch(s){case"undefined":return o===void 0;case String:return typeof o=="string"||o instanceof String;case Boolean:return typeof o=="boolean"||o instanceof Boolean;case Number:return typeof o=="number"||o instanceof Number;default:return o instanceof s}})(r,i)||(i.name,String(r))}n.defined=e,n.has=function(r,i){r[i]},n.is=t,n.equals=function(r,i){},n.oneOf=function(r,i){i.includes(r)||JSON.stringify(i)},n.isArray=function(r,i){t(r,Array),r&&r.length>0&&t(r[0],i)},n.optional=function(r,i){r!==void 0&&t(r,i)},n.falsy=function(r){},n.never=function(r){}})(cl||(cl={}));const lr=cl,HD=new RegExp(":arslan:|"+/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g.source,"g"),UD=/\uFE0F/g,jD="‍";function $D(n){if(n===":arslan:")return"https://cdn.talkjs.com/__assets/5461191341cea882b3f227c085d5772c.gif";const e=function(r){const i=[];let o=0,s=0,a=0;for(;a<r.length;)o=r.charCodeAt(a++),s?(i.push((65536+(s-55296<<10)+(o-56320)).toString(16)),s=0):55296<=o&&o<=56319?s=o:i.push(o.toString(16));return i.join("-")}((t=n).indexOf(jD)<0?t.replace(UD,""):t);var t;return`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/${e}.svg`}class sm{constructor({mode:e,allowedHostnames:t,allowedPhoneNrs:r,allowedMatches:i,forbiddenMatches:o,forbiddenWords:s,suppressLinks:a,suppressEmailAddresses:l,suppressPhoneNumbers:u,replacement:c}){if(lr.oneOf(e,["all","otherOnly","off"]),this.mode=e,this.suppressLinks=a!==!1,this.suppressEmailAddresses=l!==!1,this.suppressPhoneNumbers=u!==!1,this.allowedHostnames=t||[],this.allowedPhoneNrs=(r||[]).filter(d=>d).map(d=>d.replace(/[^0-9]/g,"")),this.allowedMatches=(i||[]).filter(zd).map(d=>Yo(d)),this.forbiddenMatches=(o||[]).filter(zd).map(d=>Yo(d)),s){const d=s.split(`
1272
1272
  `).map(h=>h.trim().toLowerCase()).filter(h=>h.length>0&&!h.startsWith("#")).map(h=>om(h));d.length&&this.forbiddenMatches.push(new RegExp(`\\b(${d.join("|")})\\b`,"gi"))}lr(()=>this.allowedMatches.every(d=>d.flags.includes("g")),"All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"),lr(()=>this.forbiddenMatches.every(d=>d.flags.includes("g")),"All regexes in `suppressContactInfo.forbiddenMatches` must be global. Check `forbiddenMatches`!"),c=c==null?void 0:c.trim(),this.replacement=c&&c.length>0?c:void 0}shouldSuppress({isContentBySender:e}){return this.mode==="all"||this.mode==="otherOnly"&&!e}}function iu(n){var t,r,i,o,s,a,l,u,c,d,h,p,f;let e="";return n.t&&(e=`(${n.t("CONTACT_INFORMATION_HIDDEN")})`),{formattedLinks:(t=n.formattedLinks)!=null?t:"plaintext",markup:(r=n.markup)!=null?r:!1,useFallbackMentions:(i=n.useFallbackMentions)!=null?i:!1,sameTabLinkRules:(o=n.sameTabLinkRules)!=null?o:[],enableEmojiImageFallback:(s=n.enableEmojiImageFallback)!=null?s:!1,highlight:(a=n.highlight)!=null?a:[],contactInfo:(l=n.contactInfo)!=null?l:!1,suppression:(u=n.suppression)!=null?u:new sm({mode:"off"}),contactInfoHiddenText:(h=(d=n.contactInfoHiddenText)!=null?d:(c=n.suppression)==null?void 0:c.replacement)!=null?h:e,customEmojiUrls:(p=n.customEmojiUrls)!=null?p:{},enableActions:(f=n.enableActions)!=null?f:!0}}function zD({id:n,text:e}){var s;const t=ie(),r=Z(()=>{var u;if(t.type==="ConversationListStore")return;const a=t.state$.extCurrentConversationId.get(),l=a&&t.state$.participants.child(a).get();return(u=l==null?void 0:l.find(c=>c.user.id===n))==null?void 0:u.user}),i=Z(t.extUserId$)===n,o=`@${(s=r==null?void 0:r.name)!=null?s:e}`;return v.jsx("span",{className:"t-mention","t-is-current-user":i?"":void 0,children:o})}function VD({message:n,type:e,action:t,params:r,children:i}){const o=Bi(),s=R.useCallback(l=>{l.preventDefault(),o.triggerMessageAction(n,t,r)},[o,n,t,r]),a={"t-action":t,onClick:s};return e==="actionButton"?v.jsx("button",{...a,type:"button",children:i}):v.jsx("a",{...a,href:"#",children:i})}function Cr(n,e){const t=n.flatMap(r=>{if(typeof r=="string")return Aa(r,e.highlight);switch(r.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletpoint":case"bulletPoint":return YD(r,e);case"bulletlist":case"bulletList":return[R.createElement("ul",null,...Cr(r.children,e))];case"autolink":case"autoLink":case"link":return XD(r,e);case"codeblock":case"codeBlock":return[v.jsx("code",{"data-language":r.language,children:Aa(r.text,e.highlight)})];case"codespan":case"codeSpan":return v.jsx("code",{children:Aa((i=r.text,i.replace(/^\s*\n/m,"").replace(/\n\s*$/m,"")),e.highlight)});case"mention":return lr.falsy(e.useFallbackMentions),v.jsx(zD,{id:r.id,text:r.text},r.id);case"suppressed":return[v.jsx("i",{children:e.contactInfoHiddenText})];case"emoji":return e.enableEmojiImageFallback?[v.jsx(GD,{unicode:r.text})]:[r.text];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return KD(r,e);case"customemoji":case"customEmoji":return r.text;default:lr.never(r)}var i});return t.every(r=>typeof r=="string")?[t.join("")]:t}function Aa(n,e){if(e.length===0)return[n];const t=function(r){const i=r.map(s=>s.trim()).filter(s=>s);if(i.length===0)return BD;const o=i.map(om).join("|");return new RegExp(o,"gi")}(e);return Ma(n,cs(n,t).map(r=>({offset:r.index,matchedText:r[0]})),({matchedText:r})=>[v.jsx("span",{className:"highlighted-text",children:r})])}const YD=(n,e)=>{const t={bold:"strong",italic:"em",strikethrough:"del",blockquote:"blockquote",bulletpoint:"li",bulletPoint:"li"}[n.type];return[R.createElement(t,null,...Cr(n.children,e))]};function GD({unicode:n}){const[e,t]=R.useState(()=>n!==":arslan:");if(R.useEffect(()=>{e&&!hp(n)&&t(!1)},[]),e)return v.jsx("span",{className:"t-emoji",children:n});const r=$D(n);return v.jsx("img",{className:"t-emoji",src:r,alt:n})}const XD=(n,e)=>{const t="children"in n?n.children:[n.text];switch(e.formattedLinks){case"link":{const r=function(i,o){for(const s of i)if(rm.test(s)){if(Yo(s).test(o))return"_top"}else if(PD(s,o))return"_top";return"_blank"}(e.sameTabLinkRules,n.url);return[R.createElement("a",{target:r,href:n.url,rel:"noreferrer"},...Cr(t,e))]}case"plaintext":return"children"in n&&n.children.every(r=>typeof r=="string")?[n.children.join("")]:[R.createElement(R.Fragment,null,...Cr(t,e))];default:lr.never(e.formattedLinks)}},KD=(n,e)=>{if(!e.enableActions)return n.children;const t=n.type==="actionlink"?"actionLink":n.type==="actionbutton"?"actionButton":n.type;return[R.createElement(VD,{type:t,action:n.action,params:n.params,message:e.message},...Cr(n.children,e))]};function WD(n,e){return Oo(n,iu(e))}function Oo(n,e){return n.flatMap(t=>{if(typeof t=="string"){let r=[t];return r=ga(r,i=>function(o,s){const{suppression:{forbiddenMatches:a,allowedMatches:l}}=s,u=Zl(a,c=>cs(o,c)).filter(([c])=>!l.some(d=>c.match(d)!==null)).map(c=>({offset:c.index,matchedText:c[0]}));return Ma(o,u,()=>[{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"}])}(i,e)),r=ga(r,i=>function(o){return Ma(o,function(s){const a=[];let l;for(;l=HD.exec(s);){const u=l[0],c=l.index;a.push({offset:c,matchedText:u})}return a}(o),s=>[{type:"emoji",text:s.matchedText}])}(i)),r=ga(r,i=>function(o,s){if(s.contactInfo!=="suppress")return[o];const a=[];if((s.suppression.suppressEmailAddresses||s.suppression.suppressLinks)&&a.push(zf),s.suppression.suppressPhoneNumbers&&a.push($f),a.length===0)return[o];const l=Yf(o,{multilineSteps:[],singlelineSteps:a}),u=l.map(c=>typeof c=="string"?c:Vd(c.url,s.suppression)?c.text:{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"});return tu(u)}(i,e)),r}switch(t.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return{type:t.type,children:Oo(t.children,e)};case"codespan":case"codeSpan":case"codeblock":case"codeBlock":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return t;case"mention":return{type:"mention",id:t.id,text:t.text};case"autolink":case"autoLink":return function(r,i){return i.contactInfo==="link"?r:i.contactInfo==="suppress"?Vd(r.url,i.suppression)?r:{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"}:r.text}(t,e);case"link":return{type:"link",url:t.url,children:Oo(t.children,e)};case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return{type:t.type,action:t.action,params:t.params,children:Oo(t.children,e)}}})}function ga(n,e){return Zl(n,t=>typeof t=="string"?e(t):[t])}function Vd(n,e){if(e.allowedMatches.some(t=>n.match(t)!==null))return!0;if(e.forbiddenMatches.some(t=>n.match(t)!==null))return!1;if(n.startsWith("mailto:")){const t=n.substring(7).replace(/^.*@/,"");return!e.suppressEmailAddresses||Yd(e.allowedHostnames,t)}if(n.startsWith("tel:")){const t=n.substring(4).replace(/[^0-9]/g,"");return!e.suppressPhoneNumbers||e.allowedPhoneNrs.some(r=>t.endsWith(r))}{const t=Ep(n);return!e.suppressLinks||!t||Yd(e.allowedHostnames,t)}}function Yd(n,e){for(const t of n)if(im(t).test(e))return!0;return!1}function ou({block:n,nonInteractive:e,message:t,className:r=""}){const i=!e,{nodes:o,roleOptions:s}=function(l,u){var D;const c=ie(),d=Z(c.app$.role);le.defined(d);const h=u.type==="UserMessage",p=((D=u.sender)==null?void 0:D.id)===c.extUserId$.peek(),f=d.suppressContactInfo,m=h&&f.shouldSuppress({isContentBySender:p}),E=WD(l.children,{contactInfo:m?"suppress":"link",suppression:f}),A={sameTabLinkRules:d.sameTabLinkRules,contactInfoHiddenText:d.suppressContactInfo.replacement||`(${c.t$.peek().CONTACT_INFORMATION_HIDDEN})`};return{nodes:E,roleOptions:A}}(n,t),a=function(l,u={},c){return Cr(l,{...iu(u),message:c})}(o,{enableEmojiImageFallback:!0,formattedLinks:i?"link":"plaintext",enableActions:i,...s},t);return ae.createElement("span",{className:`t-text ${r}`},...a)}function am(n){const e=Dt(),t=ie(),{className:r="",...i}=n,o=Z(()=>t.state$.messages.child(t.state$.extCurrentConversationId.get()).lookup.child(n.message.id).content.child(0).url.get());return v.jsx("div",{className:`t-message-content ${r}`,children:n.message.content.map(s=>{var a;return v.jsx(JD,{block:s,theme:e,downloadUrl:o,...i},n.message.createdAt+((a=n.message.editedAt)!=null?a:0))})})}function JD({common:n,block:e,message:t,theme:r,downloadUrl:i}){const o=function(s,a){switch(a.type){case"text":return s.TextBlock;case"location":return s.LocationBlock;case"file":switch(a.subtype){case"image":return s.ImageBlock;case"video":return s.VideoBlock;case"voice":return s.VoiceBlock;case"audio":return s.AudioBlock;default:return s.FileBlock}default:le.never(a)}}(r,e);return v.jsx(o,{block:e,common:n,message:t,downloadUrl:i})}const qD=27;function $i(n,e,t=!0){const r=R.useCallback(o=>{o.keyCode===qD&&n()},[n]),i=R.useCallback(o=>{o.target.closest(e)===null&&n()},[e,n]);R.useEffect(()=>{if(t)return window.addEventListener("keydown",r,!0),document.addEventListener("mousedown",i,!0),()=>{window.removeEventListener("keydown",r,!0),document.removeEventListener("mousedown",i,!0)}},[r,i,t])}const ZD=".search-row{margin-right:var(--emoji-padding)}.emoji-menu{grid-template-columns:repeat(auto-fill,var(--total-emoji-size));padding:var(--emoji-padding)}.emoji,button.emoji{border-radius:8px}.favorites{border-top-width:1px}input.search:focus{border-color:var(--input-focused-border-color);outline:0}.picker{container-type:size}@container (height < 300px){.favorites{display:none}}#skintone-button{margin:0 -3px 0 4px}.custom-emoji{padding:0}#emo-🏻,#emo-🏼,#emo-🏽,#emo-🏾,#emo-🏿{display:none}[data-has-mouse] .emoji:hover{background-color:var(--button-hover-background)}";function lm(n){const[e,t]=R.useState();return R.useEffect(()=>{let r=!0;return n().then(i=>{r&&t({value:i})}),()=>{r=!1}},[n]),e}function su(n){const{onClose:e,onEmojiSelected:t}=qE(),r=R.useRef(null),i=lm(kl);return R.useEffect(()=>{if(!i)return;le.defined(r.current);const o=r.current,s=o.shadowRoot;(function(u,c){const d=document.createElement("style");d.textContent=c,u.appendChild(d)})(s,ZD);const a=u=>{var d;const c=(d=u.detail.unicode)!=null?d:u.detail.name;t(c)};function l(u){u.pointerType==="mouse"&&(s.querySelector("section").dataset.hasMouse="true")}return o.addEventListener("emoji-click",a),o.addEventListener("pointermove",l,{once:!0}),()=>{o.removeEventListener("emoji-click",a),o.removeEventListener("pointermove",l)}},[i,t]),R.useEffect(()=>{var o;i&&r.current&&((o=r.current.shadowRoot.getElementById("search"))==null||o.focus())},[i]),$i(()=>e(),".t-emoji-picker"),i?v.jsx("div",{className:"t-emoji-picker",children:v.jsx("emoji-picker",{ref:r,class:n.colorScheme})}):v.jsx("div",{className:"t-emoji-picker","t-loading":"",children:v.jsx(nu,{})})}function um({messageId:n,colorScheme:e}){const{closePopover:t}=Fl(),r=Bi();return v.jsx("div",{className:"t-reaction-picker",children:v.jsx(lp.Provider,{value:{onClose:t,onEmojiSelected:i=>{r.addReaction(n,i),t()}},children:v.jsx(su,{colorScheme:e})})})}function dl(){return dl=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},dl.apply(this,arguments)}function cm(n,e){if(n==null)return{};var t,r,i={},o=Object.keys(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)>=0||(i[t]=n[t]);return i}function hl(n,e){return hl=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},hl(n,e)}function dm(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,hl(n,e)}function hm(){}function pm(){}pm.resetWarningCache=hm;function Gd(n,e){return n.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}(function(){function n(r,i,o,s,a,l){if(l!=="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function e(){return n}n.isRequired=n;var t={array:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:pm,resetWarningCache:hm};t.PropTypes=t})();const Xd=!1,fm=R.createContext(null);var ni="unmounted",gn="exited",Dn="entering",qn="entered",pl="exiting",Bt=function(n){function e(r,i){var o;o=n.call(this,r,i)||this;var s,a=i&&!i.isMounting?r.enter:r.appear;return o.appearStatus=null,r.in?a?(s=gn,o.appearStatus=Dn):s=qn:s=r.unmountOnExit||r.mountOnEnter?ni:gn,o.state={status:s},o.nextCallback=null,o}dm(e,n),e.getDerivedStateFromProps=function(r,i){return r.in&&i.status===ni?{status:gn}:null};var t=e.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(r){var i=null;if(r!==this.props){var o=this.state.status;this.props.in?o!==Dn&&o!==qn&&(i=Dn):o!==Dn&&o!==qn||(i=pl)}this.updateStatus(!1,i)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var r,i,o,s=this.props.timeout;return r=i=o=s,s!=null&&typeof s!="number"&&(r=s.exit,i=s.enter,o=s.appear!==void 0?s.appear:i),{exit:r,enter:i,appear:o}},t.updateStatus=function(r,i){r===void 0&&(r=!1),i!==null?(this.cancelNextCallback(),i===Dn?this.performEnter(r):this.performExit()):this.props.unmountOnExit&&this.state.status===gn&&this.setState({status:ni})},t.performEnter=function(r){var i=this,o=this.props.enter,s=this.context?this.context.isMounting:r,a=this.props.nodeRef?[s]:[lo.findDOMNode(this),s],l=a[0],u=a[1],c=this.getTimeouts(),d=s?c.appear:c.enter;!r&&!o||Xd?this.safeSetState({status:qn},function(){i.props.onEntered(l)}):(this.props.onEnter(l,u),this.safeSetState({status:Dn},function(){i.props.onEntering(l,u),i.onTransitionEnd(d,function(){i.safeSetState({status:qn},function(){i.props.onEntered(l,u)})})}))},t.performExit=function(){var r=this,i=this.props.exit,o=this.getTimeouts(),s=this.props.nodeRef?void 0:lo.findDOMNode(this);i&&!Xd?(this.props.onExit(s),this.safeSetState({status:pl},function(){r.props.onExiting(s),r.onTransitionEnd(o.exit,function(){r.safeSetState({status:gn},function(){r.props.onExited(s)})})})):this.safeSetState({status:gn},function(){r.props.onExited(s)})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(r,i){i=this.setNextCallback(i),this.setState(r,i)},t.setNextCallback=function(r){var i=this,o=!0;return this.nextCallback=function(s){o&&(o=!1,i.nextCallback=null,r(s))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},t.onTransitionEnd=function(r,i){this.setNextCallback(i);var o=this.props.nodeRef?this.props.nodeRef.current:lo.findDOMNode(this),s=r==null&&!this.props.addEndListener;if(o&&!s){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],l=a[0],u=a[1];this.props.addEndListener(l,u)}r!=null&&setTimeout(this.nextCallback,r)}else setTimeout(this.nextCallback,0)},t.render=function(){var r=this.state.status;if(r===ni)return null;var i=this.props,o=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var s=cm(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return R.createElement(fm.Provider,{value:null},typeof o=="function"?o(r,s):R.cloneElement(R.Children.only(o),s))},e}(R.Component);function Gn(){}Bt.contextType=fm,Bt.propTypes={},Bt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Gn,onEntering:Gn,onEntered:Gn,onExit:Gn,onExiting:Gn,onExited:Gn},Bt.UNMOUNTED=ni,Bt.EXITED=gn,Bt.ENTERING=Dn,Bt.ENTERED=qn,Bt.EXITING=pl;var Da=function(n,e){return n&&e&&e.split(" ").forEach(function(t){return i=t,void((r=n).classList?r.classList.remove(i):typeof r.className=="string"?r.className=Gd(r.className,i):r.setAttribute("class",Gd(r.className&&r.className.baseVal||"",i)));var r,i})},fl=function(n){function e(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return(r=n.call.apply(n,[this].concat(o))||this).appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1];r.removeClasses(c,"exit"),r.addClass(c,d?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(a,l)},r.onEntering=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1]?"appear":"enter";r.addClass(c,d,"active"),r.props.onEntering&&r.props.onEntering(a,l)},r.onEntered=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1]?"appear":"enter";r.removeClasses(c,d),r.addClass(c,d,"done"),r.props.onEntered&&r.props.onEntered(a,l)},r.onExit=function(a){var l=r.resolveArguments(a)[0];r.removeClasses(l,"appear"),r.removeClasses(l,"enter"),r.addClass(l,"exit","base"),r.props.onExit&&r.props.onExit(a)},r.onExiting=function(a){var l=r.resolveArguments(a)[0];r.addClass(l,"exit","active"),r.props.onExiting&&r.props.onExiting(a)},r.onExited=function(a){var l=r.resolveArguments(a)[0];r.removeClasses(l,"exit"),r.addClass(l,"exit","done"),r.props.onExited&&r.props.onExited(a)},r.resolveArguments=function(a,l){return r.props.nodeRef?[r.props.nodeRef.current,a]:[a,l]},r.getClassNames=function(a){var l=r.props.classNames,u=typeof l=="string",c=u?(u&&l?l+"-":"")+a:l[a];return{baseClassName:c,activeClassName:u?c+"-active":l[a+"Active"],doneClassName:u?c+"-done":l[a+"Done"]}},r}dm(e,n);var t=e.prototype;return t.addClass=function(r,i,o){var s=this.getClassNames(i)[o+"ClassName"],a=this.getClassNames("enter").doneClassName;i==="appear"&&o==="done"&&a&&(s+=" "+a),o==="active"&&r&&r.scrollTop,s&&(this.appliedClasses[i][o]=s,function(l,u){l&&u&&u.split(" ").forEach(function(c){return h=c,void((d=l).classList?d.classList.add(h):function(p,f){return p.classList?!!f&&p.classList.contains(f):(" "+(p.className.baseVal||p.className)+" ").indexOf(" "+f+" ")!==-1}(d,h)||(typeof d.className=="string"?d.className=d.className+" "+h:d.setAttribute("class",(d.className&&d.className.baseVal||"")+" "+h)));var d,h})}(r,s))},t.removeClasses=function(r,i){var o=this.appliedClasses[i],s=o.base,a=o.active,l=o.done;this.appliedClasses[i]={},s&&Da(r,s),a&&Da(r,a),l&&Da(r,l)},t.render=function(){var r=this.props;r.classNames;var i=cm(r,["classNames"]);return R.createElement(Bt,dl({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(R.Component);fl.defaultProps={classNames:""},fl.propTypes={};const QD={ltr:["ArrowLeft","ArrowRight"],rtl:["ArrowRight","ArrowLeft"],ttb:["ArrowUp","ArrowDown"]};function mm(n,{focused:e,setFocused:t,itemCount:r,dir:i,onConfirm:o,onSpace:s}){if(r===0)return!1;const a=c=>{var d,h,p;d=0,h=c,p=r-1,c=Math.max(d,Math.min(h,p)),t(c)},[l,u]=QD[i];switch(n){case l:return a(e-1),!0;case u:return a(e+1),!0;case" ":return!!s&&s();case"Enter":case"Tab":return o(),!0}return!1}function Em({focused:n,setFocused:e,buttonId:t}){R.useLayoutEffect(()=>{var a;const s=t(n);s&&((a=document.getElementById(s))==null||a.scrollIntoView({block:"nearest"}))},[n,t]);const r=R.useCallback(s=>{const a=s.currentTarget.dataset.index;e(+a)},[e]),i=R.useMemo(()=>({role:"menu","aria-activedescendant":t(n)}),[n,t]),o=R.useCallback(s=>({onMouseMove:r,id:t(s),"data-index":s}),[r,t]);return{containerProps:i,itemProps:o}}function Am(n){const[e,t]=R.useState([]),[r,i]=R.useState([]),[o,s]=R.useState(0),[a,l]=R.useState(0),u=lm(kl),c=R.useMemo(()=>u&&new u.value.Database({}),[u]),d=xi(),h=Z(d.state$.suggestEmojiQuery);R.useEffect(()=>{c&&(h?async function(){const D=await c.getPreferredSkinTone();l(D);let _=await c.getEmojiBySearchQuery(h);if(_=_.filter(S=>S.url||function(T){return T.version<=pp&&!t0.includes(T.unicode)}(S)),function(S,T){T.sort((N,I)=>{var O,k;const L=(O=N.shortcodes)==null?void 0:O.find(w=>w.startsWith(S)),g=(k=I.shortcodes)==null?void 0:k.find(w=>w.startsWith(S));return L&&!g?-1:!L&&g?1:L&&g?L.length-g.length:0})}(h.substring(1),_),s(0),t(_),_.length>0&&i(_),h.endsWith(":")){const S=h.slice(1,-1),T=_.find(N=>{var I;return(I=N.shortcodes)==null?void 0:I.includes(S)});T&&d.selectEmoji(ri(T,D))}}():t([]))},[h,d,c]);const p=R.useCallback(D=>{const _=e[D];return _&&"emoji-button-"+ri(_,a)},[e,a]),{containerProps:f,itemProps:m}=Em({focused:o,setFocused:s,buttonId:p}),E=e.length>0;$i(()=>d.closeSuggester(),".t-emoji-suggest-bar",E),R.useEffect(()=>{if(E)return d.listenKeydown("emoji",D=>mm(D,{dir:"ltr",focused:o,setFocused:s,itemCount:e.length,onConfirm(){const _=e[o];le.defined(_),d.selectEmoji(ri(_,a))}})),()=>{d.listenKeydown("emoji",void 0)};d.listenKeydown("emoji",void 0)},[d,e,o,E,a]);const A=R.useRef(null);return v.jsx(fl,{in:E,timeout:100,classNames:"slide",mountOnEnter:!0,unmountOnExit:!0,nodeRef:A,children:v.jsx("div",{className:"t-emoji-suggest-bar",ref:A,...f,children:r.map((D,_)=>v.jsx(e0,{emoji:D,skinTone:a,focused:_===o,onSelect:S=>d.selectEmoji(S),...m(_)},ri(D,a)))})})}function ri(n,e){return ml(n)?gm(n,e):n.name}function ml(n){return!!n.unicode}function e0(n){var u;const{emoji:e,focused:t,skinTone:r,onSelect:i,...o}=n,s=((u=e.shortcodes)!=null?u:[]).join(", "),a=ml(e)?[e.unicode,s].join(", "):s,l=ml(e)?gm(e,r):null;return v.jsx("button",{"t-focused":t?"":void 0,title:s,"aria-label":a,onClick:()=>i(ri(e,r)),...o,children:l})}function gm(n,e){var r,i;const t=(r=n.skins)==null?void 0:r.find(o=>o.tone===e);return(i=t==null?void 0:t.unicode)!=null?i:n.unicode}const t0=["🏻","🏼","🏽","🏾","🏿"],n0=["top","right","bottom","left"],El=Math.min,ur=Math.max,Go=Math.round,oo=Math.floor,yt=n=>({x:n,y:n}),r0={left:"right",right:"left",bottom:"top",top:"bottom"},i0={start:"end",end:"start"};function au(n,e){return typeof n=="function"?n(e):n}function yi(n){return n.split("-")[0]}function lu(n){return n.split("-")[1]}function Dm(n){return n==="y"?"height":"width"}const o0=new Set(["top","bottom"]);function nr(n){return o0.has(yi(n))?"y":"x"}function Om(n){return nr(n)==="x"?"y":"x"}function Al(n){return n.replace(/start|end/g,e=>i0[e])}const Kd=["left","right"],Wd=["right","left"],s0=["top","bottom"],a0=["bottom","top"];function l0(n,e,t,r){const i=lu(n);let o=function(s,a,l){switch(s){case"top":case"bottom":return l?a?Wd:Kd:a?Kd:Wd;case"left":case"right":return a?s0:a0;default:return[]}}(yi(n),t==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Al)))),o}function so(n){return n.replace(/left|right|bottom|top/g,e=>r0[e])}function Xo(n){const{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function Jd(n,e,t){let{reference:r,floating:i}=n;const o=nr(e),s=Om(e),a=Dm(s),l=yi(e),u=o==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(lu(e)){case"start":p[s]-=h*(t&&u?-1:1);break;case"end":p[s]+=h*(t&&u?-1:1)}return p}async function gl(n,e){var t;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=n,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=au(e,n),f=function(T){return typeof T!="number"?function(N){return{top:0,right:0,bottom:0,left:0,...N}}(T):{top:T,right:T,bottom:T,left:T}}(p),m=a[h?d==="floating"?"reference":"floating":d],E=Xo(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(m)))==null||t?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),A=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,D=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),_=await(o.isElement==null?void 0:o.isElement(D))&&await(o.getScale==null?void 0:o.getScale(D))||{x:1,y:1},S=Xo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:A,offsetParent:D,strategy:l}):A);return{top:(E.top-S.top+f.top)/_.y,bottom:(S.bottom-E.bottom+f.bottom)/_.y,left:(E.left-S.left+f.left)/_.x,right:(S.right-E.right+f.right)/_.x}}function qd(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function Zd(n){return n0.some(e=>n[e]>=0)}function gs(){return typeof window!="undefined"}function Ir(n){return _m(n)?(n.nodeName||"").toLowerCase():"#document"}function ot(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function bt(n){var e;return(e=(_m(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function _m(n){return!!gs()&&(n instanceof Node||n instanceof ot(n).Node)}function mt(n){return!!gs()&&(n instanceof Element||n instanceof ot(n).Element)}function kt(n){return!!gs()&&(n instanceof HTMLElement||n instanceof ot(n).HTMLElement)}function Qd(n){return!(!gs()||typeof ShadowRoot=="undefined")&&(n instanceof ShadowRoot||n instanceof ot(n).ShadowRoot)}const u0=new Set(["inline","contents"]);function bi(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=Et(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!u0.has(i)}const c0=new Set(["table","td","th"]);function d0(n){return c0.has(Ir(n))}const h0=[":popover-open",":modal"];function Ko(n){return h0.some(e=>{try{return n.matches(e)}catch(t){return!1}})}const p0=["transform","translate","scale","rotate","perspective"],f0=["transform","translate","scale","rotate","perspective","filter"],m0=["paint","layout","strict","content"];function Dl(n){const e=uu(),t=mt(n)?Et(n):n;return p0.some(r=>!!t[r]&&t[r]!=="none")||!!t.containerType&&t.containerType!=="normal"||!e&&!!t.backdropFilter&&t.backdropFilter!=="none"||!e&&!!t.filter&&t.filter!=="none"||f0.some(r=>(t.willChange||"").includes(r))||m0.some(r=>(t.contain||"").includes(r))}function uu(){return!(typeof CSS=="undefined"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const E0=new Set(["html","body","#document"]);function cr(n){return E0.has(Ir(n))}function Et(n){return ot(n).getComputedStyle(n)}function Ds(n){return mt(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function on(n){if(Ir(n)==="html")return n;const e=n.assignedSlot||n.parentNode||Qd(n)&&n.host||bt(n);return Qd(e)?e.host:e}function Sm(n){const e=on(n);return cr(e)?n.ownerDocument?n.ownerDocument.body:n.body:kt(e)&&bi(e)?e:Sm(e)}function Li(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=Sm(n),o=i===((r=n.ownerDocument)==null?void 0:r.body),s=ot(i);if(o){const a=Ol(s);return e.concat(s,s.visualViewport||[],bi(i)?i:[],a&&t?Li(a):[])}return e.concat(i,Li(i,[],t))}function Ol(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Tm(n){const e=Et(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=kt(n),o=i?n.offsetWidth:t,s=i?n.offsetHeight:r,a=Go(t)!==o||Go(r)!==s;return a&&(t=o,r=s),{width:t,height:r,$:a}}function cu(n){return mt(n)?n:n.contextElement}function dr(n){const e=cu(n);if(!kt(e))return yt(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:o}=Tm(e);let s=(o?Go(t.width):t.width)/r,a=(o?Go(t.height):t.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const A0=yt(0);function Rm(n){const e=ot(n);return uu()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:A0}function Un(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=n.getBoundingClientRect(),o=cu(n);let s=yt(1);e&&(r?mt(r)&&(s=dr(r)):s=dr(n));const a=function(h,p,f){return p===void 0&&(p=!1),!(!f||p&&f!==ot(h))&&p}(o,t,r)?Rm(o):yt(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(o){const h=ot(o),p=r&&mt(r)?ot(r):r;let f=h,m=Ol(f);for(;m&&r&&p!==f;){const E=dr(m),A=m.getBoundingClientRect(),D=Et(m),_=A.left+(m.clientLeft+parseFloat(D.paddingLeft))*E.x,S=A.top+(m.clientTop+parseFloat(D.paddingTop))*E.y;l*=E.x,u*=E.y,c*=E.x,d*=E.y,l+=_,u+=S,f=ot(m),m=Ol(f)}}return Xo({width:c,height:d,x:l,y:u})}function Wo(n,e){const t=Ds(n).scrollLeft;return e?e.left+t:Un(bt(n)).left+t}function Cm(n,e){const t=n.getBoundingClientRect();return{x:t.left+e.scrollLeft-Wo(n,t),y:t.top+e.scrollTop}}const g0=new Set(["absolute","fixed"]);function eh(n,e,t){let r;if(e==="viewport")r=function(i,o){const s=ot(i),a=bt(i),l=s.visualViewport;let u=a.clientWidth,c=a.clientHeight,d=0,h=0;if(l){u=l.width,c=l.height;const f=uu();(!f||f&&o==="fixed")&&(d=l.offsetLeft,h=l.offsetTop)}const p=Wo(a);if(p<=0){const f=a.ownerDocument,m=f.body,E=getComputedStyle(m),A=f.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,D=Math.abs(a.clientWidth-m.clientWidth-A);D<=25&&(u-=D)}else p<=25&&(u+=p);return{width:u,height:c,x:d,y:h}}(n,t);else if(e==="document")r=function(i){const o=bt(i),s=Ds(i),a=i.ownerDocument.body,l=ur(o.scrollWidth,o.clientWidth,a.scrollWidth,a.clientWidth),u=ur(o.scrollHeight,o.clientHeight,a.scrollHeight,a.clientHeight);let c=-s.scrollLeft+Wo(i);const d=-s.scrollTop;return Et(a).direction==="rtl"&&(c+=ur(o.clientWidth,a.clientWidth)-l),{width:l,height:u,x:c,y:d}}(bt(n));else if(mt(e))r=function(i,o){const s=Un(i,!0,o==="fixed"),a=s.top+i.clientTop,l=s.left+i.clientLeft,u=kt(i)?dr(i):yt(1);return{width:i.clientWidth*u.x,height:i.clientHeight*u.y,x:l*u.x,y:a*u.y}}(e,t);else{const i=Rm(n);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Xo(r)}function Im(n,e){const t=on(n);return!(t===e||!mt(t)||cr(t))&&(Et(t).position==="fixed"||Im(t,e))}function D0(n,e,t){const r=kt(e),i=bt(e),o=t==="fixed",s=Un(n,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=yt(0);function u(){l.x=Wo(i)}if(r||!r&&!o)if((Ir(e)!=="body"||bi(i))&&(a=Ds(e)),r){const d=Un(e,!0,o,e);l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}else i&&u();o&&!r&&i&&u();const c=!i||r||o?yt(0):Cm(i,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function Oa(n){return Et(n).position==="static"}function th(n,e){if(!kt(n)||Et(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return bt(n)===t&&(t=t.ownerDocument.body),t}function nh(n,e){const t=ot(n);if(Ko(n))return t;if(!kt(n)){let i=on(n);for(;i&&!cr(i);){if(mt(i)&&!Oa(i))return i;i=on(i)}return t}let r=th(n,e);for(;r&&d0(r)&&Oa(r);)r=th(r,e);return r&&cr(r)&&Oa(r)&&!Dl(r)?t:r||function(i){let o=on(i);for(;kt(o)&&!cr(o);){if(Dl(o))return o;if(Ko(o))return null;o=on(o)}return null}(n)||t}const O0={convertOffsetParentRelativeRectToViewportRelativeRect:function(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n;const o=i==="fixed",s=bt(r),a=!!e&&Ko(e.floating);if(r===s||a&&o)return t;let l={scrollLeft:0,scrollTop:0},u=yt(1);const c=yt(0),d=kt(r);if((d||!d&&!o)&&((Ir(r)!=="body"||bi(s))&&(l=Ds(r)),kt(r))){const p=Un(r);u=dr(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}const h=!s||d||o?yt(0):Cm(s,l);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:t.y*u.y-l.scrollTop*u.y+c.y+h.y}},getDocumentElement:bt,getClippingRect:function(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n;const o=t==="clippingAncestors"?Ko(e)?[]:function(u,c){const d=c.get(u);if(d)return d;let h=Li(u,[],!1).filter(E=>mt(E)&&Ir(E)!=="body"),p=null;const f=Et(u).position==="fixed";let m=f?on(u):u;for(;mt(m)&&!cr(m);){const E=Et(m),A=Dl(m);A||E.position!=="fixed"||(p=null),(f?!A&&!p:!A&&E.position==="static"&&p&&g0.has(p.position)||bi(m)&&!A&&Im(u,m))?h=h.filter(D=>D!==m):p=E,m=on(m)}return c.set(u,h),h}(e,this._c):[].concat(t),s=[...o,r],a=s[0],l=s.reduce((u,c)=>{const d=eh(e,c,i);return u.top=ur(d.top,u.top),u.right=El(d.right,u.right),u.bottom=El(d.bottom,u.bottom),u.left=ur(d.left,u.left),u},eh(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:nh,getElementRects:async function(n){const e=this.getOffsetParent||nh,t=this.getDimensions,r=await t(n.floating);return{reference:D0(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(n){return Array.from(n.getClientRects())},getDimensions:function(n){const{width:e,height:t}=Tm(n);return{width:e,height:t}},getScale:dr,isElement:mt,isRTL:function(n){return Et(n).direction==="rtl"}};function rh(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function _0(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=cu(n),c=i||o?[...u?Li(u):[],...Li(e)]:[];c.forEach(E=>{i&&E.addEventListener("scroll",t,{passive:!0}),o&&E.addEventListener("resize",t)});const d=u&&a?function(E,A){let D,_=null;const S=bt(E);function T(){var N;clearTimeout(D),(N=_)==null||N.disconnect(),_=null}return function N(I,L){I===void 0&&(I=!1),L===void 0&&(L=1),T();const g=E.getBoundingClientRect(),{left:O,top:k,width:w,height:U}=g;if(I||A(),!w||!U)return;const y={rootMargin:-oo(k)+"px "+-oo(S.clientWidth-(O+w))+"px "+-oo(S.clientHeight-(k+U))+"px "+-oo(O)+"px",threshold:ur(0,El(1,L))||1};let M=!0;function $(j){const G=j[0].intersectionRatio;if(G!==L){if(!M)return N();G?N(!1,G):D=setTimeout(()=>{N(!1,1e-7)},1e3)}G!==1||rh(g,E.getBoundingClientRect())||N(),M=!1}try{_=new IntersectionObserver($,{...y,root:S.ownerDocument})}catch(j){_=new IntersectionObserver($,y)}_.observe(E)}(!0),T}(u,t):null;let h,p=-1,f=null;s&&(f=new ResizeObserver(E=>{let[A]=E;A&&A.target===u&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var D;(D=f)==null||D.observe(e)})),t()}),u&&!l&&f.observe(u),f.observe(e));let m=l?Un(n):null;return l&&function E(){const A=Un(n);m&&!rh(m,A)&&t(),m=A,h=requestAnimationFrame(E)}(),t(),()=>{var E;c.forEach(A=>{i&&A.removeEventListener("scroll",t),o&&A.removeEventListener("resize",t)}),d==null||d(),(E=f)==null||E.disconnect(),f=null,l&&cancelAnimationFrame(h)}}const S0=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...E}=au(n,e);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const A=yi(i),D=nr(a),_=yi(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),T=h||(_||!m?[so(a)]:function(y){const M=so(y);return[Al(y),M,Al(M)]}(a)),N=f!=="none";!h&&N&&T.push(...l0(a,m,f,S));const I=[a,...T],L=await gl(e,E),g=[];let O=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&g.push(L[A]),d){const y=function(M,$,j){j===void 0&&(j=!1);const G=lu(M),V=Om(M),Y=Dm(V);let K=V==="x"?G===(j?"end":"start")?"right":"left":G==="start"?"bottom":"top";return $.reference[Y]>$.floating[Y]&&(K=so(K)),[K,so(K)]}(i,s,S);g.push(L[y[0]],L[y[1]])}if(O=[...O,{placement:i,overflows:g}],!g.every(y=>y<=0)){var k,w;const y=(((k=o.flip)==null?void 0:k.index)||0)+1,M=I[y];if(M&&(!(d==="alignment"&&D!==nr(M))||O.every(j=>nr(j.placement)!==D||j.overflows[0]>0)))return{data:{index:y,overflows:O},reset:{placement:M}};let $=(w=O.filter(j=>j.overflows[0]<=0).sort((j,G)=>j.overflows[1]-G.overflows[1])[0])==null?void 0:w.placement;if(!$)switch(p){case"bestFit":{var U;const j=(U=O.filter(G=>{if(N){const V=nr(G.placement);return V===D||V==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(V=>V>0).reduce((V,Y)=>V+Y,0)]).sort((G,V)=>G[1]-V[1])[0])==null?void 0:U[0];j&&($=j);break}case"initialPlacement":$=a}if(i!==$)return{reset:{placement:$}}}return{}}}},T0=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:r="referenceHidden",...i}=au(n,e);switch(r){case"referenceHidden":{const o=qd(await gl(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Zd(o)}}}case"escaped":{const o=qd(await gl(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:o,escaped:Zd(o)}}}default:return{}}}}},R0=(n,e,t)=>{const r=new Map,i={platform:O0,...t},o={...i.platform,_c:r};return(async(s,a,l)=>{const{placement:u="bottom",strategy:c="absolute",middleware:d=[],platform:h}=l,p=d.filter(Boolean),f=await(h.isRTL==null?void 0:h.isRTL(a));let m=await h.getElementRects({reference:s,floating:a,strategy:c}),{x:E,y:A}=Jd(m,u,f),D=u,_={},S=0;for(let T=0;T<p.length;T++){const{name:N,fn:I}=p[T],{x:L,y:g,data:O,reset:k}=await I({x:E,y:A,initialPlacement:u,placement:D,strategy:c,middlewareData:_,rects:m,platform:h,elements:{reference:s,floating:a}});E=L!=null?L:E,A=g!=null?g:A,_={..._,[N]:{..._[N],...O}},k&&S<=50&&(S++,typeof k=="object"&&(k.placement&&(D=k.placement),k.rects&&(m=k.rects===!0?await h.getElementRects({reference:s,floating:a,strategy:c}):k.rects),{x:E,y:A}=Jd(m,D,f)),T=-1)}return{x:E,y:A,placement:D,strategy:c,middlewareData:_}})(n,e,{...i,platform:o})};var _o=typeof document!="undefined"?R.useLayoutEffect:function(){};function Jo(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,r,i;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(r=t;r--!=0;)if(!Jo(n[r],e[r]))return!1;return!0}if(i=Object.keys(n),t=i.length,t!==Object.keys(e).length)return!1;for(r=t;r--!=0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=t;r--!=0;){const o=i[r];if((o!=="_owner"||!n.$$typeof)&&!Jo(n[o],e[o]))return!1}return!0}return n!=n&&e!=e}function Nm(n){return typeof window=="undefined"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function ih(n,e){const t=Nm(n);return Math.round(e*t)/t}function _a(n){const e=ae.useRef(n);return _o(()=>{e.current=n}),e}const C0=(n,e)=>({...S0(n),options:[n,e]}),I0=(n,e)=>({...T0(n),options:[n,e]});var vm={exports:{}},ym=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],qo=ym.join(","),bm=typeof Element=="undefined",jn=bm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,So=!bm&&Element.prototype.getRootNode?function(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}:function(n){return n==null?void 0:n.ownerDocument},ki=function(n,e){var t;e===void 0&&(e=!0);var r=n==null||(t=n.getAttribute)===null||t===void 0?void 0:t.call(n,"inert");return r===""||r==="true"||e&&n&&ki(n.parentNode)},Lm=function(n,e,t){if(ki(n))return[];var r=Array.prototype.slice.apply(n.querySelectorAll(qo));return e&&jn.call(n,qo)&&r.unshift(n),r=r.filter(t)},Zo=function(n,e,t){for(var r=[],i=Array.from(n);i.length;){var o=i.shift();if(!ki(o,!1))if(o.tagName==="SLOT"){var s=o.assignedElements(),a=s.length?s:o.children,l=Zo(a,!0,t);t.flatten?r.push.apply(r,l):r.push({scopeParent:o,candidates:l})}else{jn.call(o,qo)&&t.filter(o)&&(e||!n.includes(o))&&r.push(o);var u=o.shadowRoot||typeof t.getShadowRoot=="function"&&t.getShadowRoot(o),c=!ki(u,!1)&&(!t.shadowRootFilter||t.shadowRootFilter(o));if(u&&c){var d=Zo(u===!0?o.children:u.children,!0,t);t.flatten?r.push.apply(r,d):r.push({scopeParent:o,candidates:d})}else i.unshift.apply(i,o.children)}}return r},km=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},nn=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"}(n))&&!km(n)?0:n.tabIndex},N0=function(n,e){return n.tabIndex===e.tabIndex?n.documentOrder-e.documentOrder:n.tabIndex-e.tabIndex},wm=function(n){return n.tagName==="INPUT"},v0=function(n){return function(e){return wm(e)&&e.type==="radio"}(n)&&!function(e){if(!e.name)return!0;var t,r=e.form||So(e),i=function(s){return r.querySelectorAll('input[type="radio"][name="'+s+'"]')};if(typeof window!="undefined"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")t=i(window.CSS.escape(e.name));else try{t=i(e.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=function(s,a){for(var l=0;l<s.length;l++)if(s[l].checked&&s[l].form===a)return s[l]}(t,e.form);return!o||o===e}(n)},oh=function(n){var e=n.getBoundingClientRect(),t=e.width,r=e.height;return t===0&&r===0},y0=function(n,e){var t=e.displayCheck,r=e.getShadowRoot;if(t==="full-native"&&"checkVisibility"in n)return!n.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(n).visibility==="hidden")return!0;var i=jn.call(n,"details>summary:first-of-type")?n.parentElement:n;if(jn.call(i,"details:not([open]) *"))return!0;if(t&&t!=="full"&&t!=="full-native"&&t!=="legacy-full"){if(t==="non-zero-area")return oh(n)}else{if(typeof r=="function"){for(var o=n;n;){var s=n.parentElement,a=So(n);if(s&&!s.shadowRoot&&r(s)===!0)return oh(n);n=n.assignedSlot?n.assignedSlot:s||a===n.ownerDocument?s:a.host}n=o}if(function(l){var u,c,d,h,p=l&&So(l),f=(u=p)===null||u===void 0?void 0:u.host,m=!1;if(p&&p!==l)for(m=!!((c=f)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(f)||l!=null&&(h=l.ownerDocument)!==null&&h!==void 0&&h.contains(l));!m&&f;){var E,A,D;m=!((A=f=(E=p=So(f))===null||E===void 0?void 0:E.host)===null||A===void 0||(D=A.ownerDocument)===null||D===void 0||!D.contains(f))}return m}(n))return!n.getClientRects().length;if(t!=="legacy-full")return!0}return!1},Qo=function(n,e){return!(e.disabled||ki(e)||function(t){return wm(t)&&t.type==="hidden"}(e)||y0(e,n)||function(t){return t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"})}(e)||function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var i=0;i<r.children.length;i++){var o=r.children.item(i);if(o.tagName==="LEGEND")return!!jn.call(r,"fieldset[disabled] *")||!o.contains(t)}return!0}r=r.parentElement}return!1}(e))},_l=function(n,e){return!(v0(e)||nn(e)<0||!Qo(n,e))},b0=function(n){var e=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},Mm=function(n){var e=[],t=[];return n.forEach(function(r,i){var o=!!r.scopeParent,s=o?r.scopeParent:r,a=function(u,c){var d=nn(u);return d<0&&c&&!km(u)?0:d}(s,o),l=o?Mm(r.candidates):s;a===0?o?e.push.apply(e,l):e.push(s):t.push({documentOrder:i,tabIndex:a,item:r,isScope:o,content:l})}),t.sort(N0).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(e)},Fm=function(n,e){var t;return t=(e=e||{}).getShadowRoot?Zo([n],e.includeContainer,{filter:_l.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:b0}):Lm(n,e.includeContainer,_l.bind(null,e)),Mm(t)},du=function(n,e){return(e=e||{}).getShadowRoot?Zo([n],e.includeContainer,{filter:Qo.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):Lm(n,e.includeContainer,Qo.bind(null,e))},On=function(n,e){if(e=e||{},!n)throw new Error("No node provided");return jn.call(n,qo)!==!1&&_l(e,n)},L0=ym.concat("iframe").join(","),To=function(n,e){if(e=e||{},!n)throw new Error("No node provided");return jn.call(n,L0)!==!1&&Qo(e,n)};const k0=Object.freeze(Object.defineProperty({__proto__:null,focusable:du,getTabIndex:nn,isFocusable:To,isTabbable:On,tabbable:Fm},Symbol.toStringTag,{value:"Module"}));function Sa(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function w0(n,e,t){return(e=function(r){var i=function(o,s){if(typeof o!="object"||!o)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var l=a.call(o,s);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(o)}(r,"string");return typeof i=="symbol"?i:i+""}(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sh(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ah(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?sh(Object(t),!0).forEach(function(r){w0(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):sh(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function M0(n){return function(e){if(Array.isArray(e))return Sa(e)}(n)||function(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(n)||function(e,t){if(e){if(typeof e=="string")return Sa(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Sa(e,t):void 0}}(n)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1273
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var F0=function(n,e){if(n.length>0){var t=n[n.length-1];t!==e&&t._setPausedState(!0)}var r=n.indexOf(e);r===-1||n.splice(r,1),n.push(e)},x0=function(n,e){var t=n.indexOf(e);t!==-1&&n.splice(t,1),n.length>0&&!n[n.length-1]._isManuallyPaused()&&n[n.length-1]._setPausedState(!1)},Ei=function(n){return(n==null?void 0:n.key)==="Tab"||(n==null?void 0:n.keyCode)===9},P0=function(n){return Ei(n)&&!n.shiftKey},B0=function(n){return Ei(n)&&n.shiftKey},lh=function(n){return setTimeout(n,0)},Ur=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return typeof n=="function"?n.apply(void 0,t):n},ao=function(n){return n.target.shadowRoot&&typeof n.composedPath=="function"?n.composedPath()[0]:n.target},H0=[];const U0=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:function(n,e){var t,r=(e==null?void 0:e.document)||document,i=(e==null?void 0:e.trapStack)||H0,o=ah({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:P0,isKeyBackward:B0},e),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a=function(g,O,k){return g&&g[O]!==void 0?g[O]:o[k||O]},l=function(g,O){var k=typeof(O==null?void 0:O.composedPath)=="function"?O.composedPath():void 0;return s.containerGroups.findIndex(function(w){var U=w.container,y=w.tabbableNodes;return U.contains(g)||(k==null?void 0:k.includes(U))||y.find(function(M){return M===g})})},u=function(g){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=O.hasFallback,w=k!==void 0&&k,U=O.params,y=U===void 0?[]:U,M=o[g];if(typeof M=="function"&&(M=M.apply(void 0,M0(y))),M===!0&&(M=void 0),!M){if(M===void 0||M===!1)return M;throw new Error("`".concat(g,"` was specified but was not a node, or did not return a node"))}var $=M;if(typeof M=="string"){try{$=r.querySelector(M)}catch(j){throw new Error("`".concat(g,'` appears to be an invalid selector; error="').concat(j.message,'"'))}if(!$&&!w)throw new Error("`".concat(g,"` as selector refers to no known node"))}return $},c=function(){var g=u("initialFocus",{hasFallback:!0});if(g===!1)return!1;if(g===void 0||g&&!To(g,o.tabbableOptions))if(l(r.activeElement)>=0)g=r.activeElement;else{var O=s.tabbableGroups[0];g=O&&O.firstTabbableNode||u("fallbackFocus")}else g===null&&(g=u("fallbackFocus"));if(!g)throw new Error("Your focus-trap needs to have at least one focusable element");return g},d=function(){if(s.containerGroups=s.containers.map(function(g){var O=Fm(g,o.tabbableOptions),k=du(g,o.tabbableOptions),w=O.length>0?O[0]:void 0,U=O.length>0?O[O.length-1]:void 0,y=k.find(function(j){return On(j)}),M=k.slice().reverse().find(function(j){return On(j)}),$=!!O.find(function(j){return nn(j)>0});return{container:g,tabbableNodes:O,focusableNodes:k,posTabIndexesFound:$,firstTabbableNode:w,lastTabbableNode:U,firstDomTabbableNode:y,lastDomTabbableNode:M,nextTabbableNode:function(j){var G=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],V=O.indexOf(j);return V<0?G?k.slice(k.indexOf(j)+1).find(function(Y){return On(Y)}):k.slice(0,k.indexOf(j)).reverse().find(function(Y){return On(Y)}):O[V+(G?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(g){return g.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(g){return g.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(g){var O=g.activeElement;if(O)return O.shadowRoot&&O.shadowRoot.activeElement!==null?h(O.shadowRoot):O},p=function(g){g!==!1&&g!==h(document)&&(g&&g.focus?(g.focus({preventScroll:!!o.preventScroll}),s.mostRecentlyFocusedNode=g,function(O){return O.tagName&&O.tagName.toLowerCase()==="input"&&typeof O.select=="function"}(g)&&g.select()):p(c()))},f=function(g){var O=u("setReturnFocus",{params:[g]});return O||O!==!1&&g},m=function(g){var O=g.target,k=g.event,w=g.isBackward,U=w!==void 0&&w;O=O||ao(k),d();var y=null;if(s.tabbableGroups.length>0){var M=l(O,k),$=M>=0?s.containerGroups[M]:void 0;if(M<0)y=U?s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:s.tabbableGroups[0].firstTabbableNode;else if(U){var j=s.tabbableGroups.findIndex(function(ee){var F=ee.firstTabbableNode;return O===F});if(j<0&&($.container===O||To(O,o.tabbableOptions)&&!On(O,o.tabbableOptions)&&!$.nextTabbableNode(O,!1))&&(j=M),j>=0){var G=j===0?s.tabbableGroups.length-1:j-1,V=s.tabbableGroups[G];y=nn(O)>=0?V.lastTabbableNode:V.lastDomTabbableNode}else Ei(k)||(y=$.nextTabbableNode(O,!1))}else{var Y=s.tabbableGroups.findIndex(function(ee){var F=ee.lastTabbableNode;return O===F});if(Y<0&&($.container===O||To(O,o.tabbableOptions)&&!On(O,o.tabbableOptions)&&!$.nextTabbableNode(O))&&(Y=M),Y>=0){var K=Y===s.tabbableGroups.length-1?0:Y+1,W=s.tabbableGroups[K];y=nn(O)>=0?W.firstTabbableNode:W.firstDomTabbableNode}else Ei(k)||(y=$.nextTabbableNode(O))}}else y=u("fallbackFocus");return y},E=function(g){var O=ao(g);l(O,g)>=0||(Ur(o.clickOutsideDeactivates,g)?t.deactivate({returnFocus:o.returnFocusOnDeactivate}):Ur(o.allowOutsideClick,g)||g.preventDefault())},A=function(g){var O=ao(g),k=l(O,g)>=0;if(k||O instanceof Document)k&&(s.mostRecentlyFocusedNode=O);else{var w;g.stopImmediatePropagation();var U=!0;if(s.mostRecentlyFocusedNode)if(nn(s.mostRecentlyFocusedNode)>0){var y=l(s.mostRecentlyFocusedNode),M=s.containerGroups[y].tabbableNodes;if(M.length>0){var $=M.findIndex(function(j){return j===s.mostRecentlyFocusedNode});$>=0&&(o.isKeyForward(s.recentNavEvent)?$+1<M.length&&(w=M[$+1],U=!1):$-1>=0&&(w=M[$-1],U=!1))}}else s.containerGroups.some(function(j){return j.tabbableNodes.some(function(G){return nn(G)>0})})||(U=!1);else U=!1;U&&(w=m({target:s.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(s.recentNavEvent)})),p(w||s.mostRecentlyFocusedNode||c())}s.recentNavEvent=void 0},D=function(g){(o.isKeyForward(g)||o.isKeyBackward(g))&&function(O){var k=arguments.length>1&&arguments[1]!==void 0&&arguments[1];s.recentNavEvent=O;var w=m({event:O,isBackward:k});w&&(Ei(O)&&O.preventDefault(),p(w))}(g,o.isKeyBackward(g))},_=function(g){(function(O){return(O==null?void 0:O.key)==="Escape"||(O==null?void 0:O.key)==="Esc"||(O==null?void 0:O.keyCode)===27})(g)&&Ur(o.escapeDeactivates,g)!==!1&&(g.preventDefault(),t.deactivate())},S=function(g){var O=ao(g);l(O,g)>=0||Ur(o.clickOutsideDeactivates,g)||Ur(o.allowOutsideClick,g)||(g.preventDefault(),g.stopImmediatePropagation())},T=function(){if(s.active)return F0(i,t),s.delayInitialFocusTimer=o.delayInitialFocus?lh(function(){p(c())}):p(c()),r.addEventListener("focusin",A,!0),r.addEventListener("mousedown",E,{capture:!0,passive:!1}),r.addEventListener("touchstart",E,{capture:!0,passive:!1}),r.addEventListener("click",S,{capture:!0,passive:!1}),r.addEventListener("keydown",D,{capture:!0,passive:!1}),r.addEventListener("keydown",_),t},N=function(){if(s.active)return r.removeEventListener("focusin",A,!0),r.removeEventListener("mousedown",E,!0),r.removeEventListener("touchstart",E,!0),r.removeEventListener("click",S,!0),r.removeEventListener("keydown",D,!0),r.removeEventListener("keydown",_),t},I=typeof window!="undefined"&&"MutationObserver"in window?new MutationObserver(function(g){g.some(function(O){return Array.from(O.removedNodes).some(function(k){return k===s.mostRecentlyFocusedNode})})&&p(c())}):void 0,L=function(){I&&(I.disconnect(),s.active&&!s.paused&&s.containers.map(function(g){I.observe(g,{subtree:!0,childList:!0})}))};return t={get active(){return s.active},get paused(){return s.paused},activate:function(g){if(s.active)return this;var O=a(g,"onActivate"),k=a(g,"onPostActivate"),w=a(g,"checkCanFocusTrap");w||d(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=h(r),O==null||O();var U=function(){w&&d(),T(),L(),k==null||k()};return w?(w(s.containers.concat()).then(U,U),this):(U(),this)},deactivate:function(g){if(!s.active)return this;var O=ah({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},g);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,N(),s.active=!1,s.paused=!1,L(),x0(i,t);var k=a(O,"onDeactivate"),w=a(O,"onPostDeactivate"),U=a(O,"checkCanReturnFocus"),y=a(O,"returnFocus","returnFocusOnDeactivate");k==null||k();var M=function(){lh(function(){y&&p(f(s.nodeFocusedBeforeActivation)),w==null||w()})};return y&&U?(U(f(s.nodeFocusedBeforeActivation)).then(M,M),this):(M(),this)},pause:function(g){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,g)):this},unpause:function(g){return s.active?(s.manuallyPaused=!1,i[i.length-1]!==this?this:this._setPausedState(!1,g)):this},updateContainerElements:function(g){var O=[].concat(g).filter(Boolean);return s.containers=O.map(function(k){return typeof k=="string"?r.querySelector(k):k}),s.active&&d(),L(),this}},Object.defineProperties(t,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(g,O){if(s.paused===g)return this;if(s.paused=g,g){var k=a(O,"onPause"),w=a(O,"onPostPause");k==null||k(),N(),L(),w==null||w()}else{var U=a(O,"onUnpause"),y=a(O,"onPostUnpause");U==null||U(),d(),T(),L(),y==null||y()}return this}}}),t.updateContainerElements(n),t}},Symbol.toStringTag,{value:"Module"})),j0=qh(U0),$0=qh(k0);function hr(n){return hr=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},hr(n)}var Ta,Ra;function z0(n,e,t){return e&&function(r,i){for(var o=0;o<i.length;o++){var s=i[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(r,Pm(s.key),s)}}(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function V0(n,e,t){return e=es(e),function(r,i){if(i&&(hr(i)=="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}(r)}(n,xm()?Reflect.construct(e,t||[],es(n).constructor):e.apply(n,t))}function xm(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(xm=function(){return!!n})()}function es(n){return es=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},es(n)}function Sl(n,e){return Sl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},Sl(n,e)}function Pm(n){var e=function(t,r){if(hr(t)!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var o=i.call(t,r);if(hr(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n,"string");return hr(e)=="symbol"?e:e+""}var ii=R,Y0=j0.createFocusTrap,G0=$0.isFocusable,X0=parseInt((Ta=(Ra=/^(\d+)\./.exec(ii.version))===null||Ra===void 0?void 0:Ra[1])!==null&&Ta!==void 0?Ta:0,10),Tl=function(){function n(e){var t;(function(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")})(this,n),function(o,s,a){(s=Pm(s))in o?Object.defineProperty(o,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[s]=a}(t=V0(this,n,[e]),"getNodeForOption",function(o){var s,a=(s=this.internalOptions[o])!==null&&s!==void 0?s:this.originalOptions[o];if(typeof a=="function"){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];a=a.apply(void 0,u)}if(a===!0&&(a=void 0),!a){if(a===void 0||a===!1)return a;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var d,h=a;if(typeof a=="string"&&!(h=(d=this.getDocument())===null||d===void 0?void 0:d.querySelector(a)))throw new Error("`".concat(o,"` as selector refers to no known node"));return h}),t.handleDeactivate=t.handleDeactivate.bind(t),t.handlePostDeactivate=t.handlePostDeactivate.bind(t),t.handleClickOutsideDeactivates=t.handleClickOutsideDeactivates.bind(t),t.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:t.handleDeactivate,onPostDeactivate:t.handlePostDeactivate,clickOutsideDeactivates:t.handleClickOutsideDeactivates},t.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var r=e.focusTrapOptions;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(i!=="returnFocusOnDeactivate"&&i!=="onDeactivate"&&i!=="onPostDeactivate"&&i!=="checkCanReturnFocus"&&i!=="clickOutsideDeactivates"?t.internalOptions[i]=r[i]:t.originalOptions[i]=r[i]);return t.outsideClick=null,t.focusTrapElements=e.containerElements||[],t.updatePreviousElement(),t}return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sl(e,t)}(n,ii.Component),z0(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document!="undefined"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var e=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return e||e!==!1&&this.previouslyFocusedElement}},{key:"updatePreviousElement",value:function(){var e=this.getDocument();e&&(this.previouslyFocusedElement=e.activeElement)}},{key:"deactivateTrap",value:function(){this.focusTrap&&this.focusTrap.active&&this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(e){var t=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,e):this.originalOptions.clickOutsideDeactivates;return t&&(this.outsideClick={target:e.target,allowDeactivation:t}),t}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var e=this,t=function(){var r=e.getReturnFocusNode(),i=!(!e.originalOptions.returnFocusOnDeactivate||r==null||!r.focus||e.outsideClick&&(!e.outsideClick.allowDeactivation||G0(e.outsideClick.target,e.internalOptions.tabbableOptions))),o=e.internalOptions.preventScroll,s=o!==void 0&&o;i&&r.focus({preventScroll:s}),e.originalOptions.onPostDeactivate&&e.originalOptions.onPostDeactivate.call(null),e.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(t,t):t()}},{key:"setupFocusTrap",value:function(){this.focusTrap?this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause()):this.focusTrapElements.some(Boolean)&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(e){if(this.focusTrap){e.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var t=!e.active&&this.props.active,r=e.active&&!this.props.active,i=!e.paused&&this.props.paused,o=e.paused&&!this.props.paused;if(t&&(this.updatePreviousElement(),this.focusTrap.activate()),r)return void this.deactivateTrap();i&&this.focusTrap.pause(),o&&this.focusTrap.unpause()}else e.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var e=this,t=this.props.children?ii.Children.only(this.props.children):void 0;if(t){if(t.type&&t.type===ii.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");return ii.cloneElement(t,{ref:function(r){var i=e.props.containerElements;t&&(X0>=19?typeof t.props.ref=="function"?t.props.ref(r):t.props.ref&&(t.props.ref.current=r):typeof t.ref=="function"?t.ref(r):t.ref&&(t.ref.current=r)),e.focusTrapElements=i||[r]}})}return null}}])}();Tl.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:Y0},vm.exports=Tl;var K0=vm.exports.FocusTrap=Tl;function Bm(n){var m;const{children:e,preferredPlacement:t="top-start",anchorElement:r,boundaryElement:i,trapFocus:o=!1,initialFocus:s,...a}=n,{anchor:l,boundary:u}=R.useMemo(()=>({anchor:uh(r),boundary:i?uh(i):void 0}),[r,i]);let c=[];u&&(c=[C0({boundary:u}),I0({boundary:u})]);const{refs:d,floatingStyles:h,middlewareData:p}=function(E){E===void 0&&(E={});const{placement:A="bottom",strategy:D="absolute",middleware:_=[],platform:S,elements:{reference:T,floating:N}={},transform:I=!0,whileElementsMounted:L,open:g}=E,[O,k]=ae.useState({x:0,y:0,strategy:D,placement:A,middlewareData:{},isPositioned:!1}),[w,U]=ae.useState(_);Jo(w,_)||U(_);const[y,M]=ae.useState(null),[$,j]=ae.useState(null),G=ae.useCallback(ue=>{ue!==W.current&&(W.current=ue,M(ue))},[]),V=ae.useCallback(ue=>{ue!==ee.current&&(ee.current=ue,j(ue))},[]),Y=T||y,K=N||$,W=ae.useRef(null),ee=ae.useRef(null),F=ae.useRef(O),re=L!=null,Oe=_a(L),_e=_a(S),Qe=_a(g),ct=ae.useCallback(()=>{if(!W.current||!ee.current)return;const ue={placement:A,strategy:D,middleware:w};_e.current&&(ue.platform=_e.current),R0(W.current,ee.current,ue).then($n=>{const _t={...$n,isPositioned:Qe.current!==!1};kr.current&&!Jo(F.current,_t)&&(F.current=_t,aE.flushSync(()=>{k(_t)}))})},[w,A,D,_e,Qe]);_o(()=>{g===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,k(ue=>({...ue,isPositioned:!1})))},[g]);const kr=ae.useRef(!1);_o(()=>(kr.current=!0,()=>{kr.current=!1}),[]),_o(()=>{if(Y&&(W.current=Y),K&&(ee.current=K),Y&&K){if(Oe.current)return Oe.current(Y,K,ct);ct()}},[Y,K,ct,Oe,re]);const Ot=ae.useMemo(()=>({reference:W,floating:ee,setReference:G,setFloating:V}),[G,V]),Ce=ae.useMemo(()=>({reference:Y,floating:K}),[Y,K]),Ft=ae.useMemo(()=>{const ue={position:D,left:0,top:0};if(!Ce.floating)return ue;const $n=ih(Ce.floating,O.x),_t=ih(Ce.floating,O.y);return I?{...ue,transform:"translate("+$n+"px, "+_t+"px)",...Nm(Ce.floating)>=1.5&&{willChange:"transform"}}:{position:D,left:$n,top:_t}},[D,I,Ce.floating,O.x,O.y]);return ae.useMemo(()=>({...O,update:ct,refs:Ot,elements:Ce,floatingStyles:Ft}),[O,ct,Ot,Ce,Ft])}({placement:t,middleware:c,whileElementsMounted:_0});R.useLayoutEffect(()=>{l&&d.setReference(l)},[d,l]);const f=o?v.jsx(K0,{focusTrapOptions:{initialFocus:s,fallbackFocus:".t-fallback-focus",tabbableOptions:{getShadowRoot:!0}},children:v.jsxs("div",{children:[e,v.jsx("span",{className:"t-fallback-focus",tabIndex:-1})]})}):e;return v.jsx("div",{ref:d.setFloating,style:{...h,zIndex:1e3,visibility:(m=p.hide)!=null&&m.referenceHidden?"hidden":"visible"},...a,children:f})}function uh(n){return typeof n=="string"?document.querySelector(n):n}function Hm(n){const e=ie(),t=xi(),r=Z(t.state$.suggestMentionQuery),i=function(E,A=10){const D=R.useContext(Ml),[_,S]=R.useState(null);return R.useEffect(()=>{const T=D.conversation(E).subscribeParticipants(I=>S(I));let N=10;for(;N<A;){const I=Math.min(A-N,50);T.loadMore(I),N+=I}return()=>{T.unsubscribe()}},[E,D,A]),_}(Z(e.state$.extCurrentConversationId),r?100:0),o=R.useMemo(()=>(i!=null?i:[]).map(E=>E.user),[i]),[s,a]=R.useState(0),l=R.useMemo(()=>Object.fromEntries(o.map(E=>{return[E.id,(A=E.name,[...A.matchAll(/^|\s+/g)].map(D=>D.index+D[0].length).map(D=>A.substring(D)))];var A})),[o]),u=R.useMemo(()=>{if(!r)return[];const E=ch(r);return E===""?o:o.filter(A=>l[A.id].some(D=>function(_,S){return oc(_.substring(0,S.length),S)}(D,E)))},[r,o,l]),c=R.useRef(void 0);R.useEffect(()=>{if(c.current){const E=u.findIndex(A=>A.id===c.current);a(E===-1?0:E)}},[u]),R.useEffect(()=>{var E;c.current=(E=u[s])==null?void 0:E.id},[s,u]);const d=R.useCallback(E=>{var D;const A=(D=u[E])==null?void 0:D.id;return A&&"mention-button-"+A},[u]),{containerProps:h,itemProps:p}=Em({focused:s,setFocused:a,buttonId:d});if(R.useEffect(()=>{if(u.length!==0)return t.listenKeydown("mention",E=>mm(E,{dir:"ttb",focused:s,setFocused:a,itemCount:u.length,onSpace(){if(r){const A=u[s];if(oc(A.name,ch(r)))return t.selectMention(A),!0}return!1},onConfirm(){const A=u[s];t.selectMention(A)}})),()=>{t.listenKeydown("mention",void 0)}},[t,s,u,r]),$i(()=>t.closeSuggester(),".t-mention-suggest-list",u.length>0),u.length===0)return null;const f=document.querySelector(".ProseMirror-suggestion");let m;if(f){let E=f.getBoundingClientRect();m={getBoundingClientRect(){const A=f.getBoundingClientRect();return A.width>0&&(E=A),E}}}return v.jsx(Bm,{className:"t-mention-suggest-list",...h,anchorElement:m,children:u.map((E,A)=>v.jsx(W0,{user:E,isFocused:A===s,onSelect:()=>t.selectMention(E),...p(A)},E.id))})}const W0=ae.memo(function(n){const{user:e,isFocused:t,onSelect:r,...i}=n;return v.jsx("button",{className:t?"focused":"",onClick:()=>r(e.id),...i,children:e.name})});function ch(n){return le(n[0]==="@"),n.substring(1)}function dh(n,e,t){const r=du(n),i=r.indexOf(e);return i===-1?null:r[i+t]||null}const J0=R.forwardRef(function(n,e){const{children:t,triggerElement:r}=n,{closePopover:i}=Fl(),o=R.useRef(null);R.useImperativeHandle(e,()=>o.current),R.useEffect(()=>{var a;(a=o.current)==null||a.focus()},[]);const s=R.useCallback(a=>{(function(l,u,c,d){var E;const h=u.querySelectorAll("[t-menu-item]"),p=document.activeElement;if(!p||!p.hasAttribute("t-menu-item")&&!p.hasAttribute("t-menu"))return;const f=Array.from(h).indexOf(p);let m;switch(l.key){case"ArrowDown":m=Math.min(f+1,h.length-1);break;case"ArrowUp":m=Math.max(f-1,0),f===-1&&(m=h.length-1);break;case"Home":m=0;break;case"End":m=h.length-1;break;case"Tab":{const A=c.closest("t-chatbox,t-conversation-list,.t-chatbox,.t-conversation-list"),D=l.shiftKey?dh(A,c,-1):function(_,S){return dh(_,S,1)}(A,c);return D==null||D.focus(),void d()}default:return}(E=h[m])==null||E.focus()})(a,o.current,r,i)},[i,r]);return v.jsx("div",{"t-menu":"",role:"menu",tabIndex:-1,ref:o,onKeyDown:s,children:t})});function rr(n){const{popoverComponent:e,popoverProps:t,children:r,type:i="popover",initialFocus:o,...s}=n,[a,l]=R.useState(void 0),u=R.useRef(null),[c,d]=R.useState(!1);$i(R.useCallback(()=>{var p;d(!1),(p=u.current)==null||p.focus()},[]),"[t-popover-content]",c);const h=i==="menu"?v.jsx(J0,{triggerElement:u.current,children:v.jsx(e,{...t})}):v.jsx(e,{...t});return v.jsxs(ZE.Provider,{value:{closePopover:()=>d(!1)},children:[v.jsx(q0,{...s,"aria-haspopup":i==="menu"?"menu":"true","aria-expanded":c,onTrigger:()=>d(!0),ref:p=>(f=>{var E;const m=(E=f==null?void 0:f.closest("[t-menu-boundary]"))!=null?E:void 0;u.current=f,l(m)})(p),children:r}),c&&v.jsx(Bm,{"t-popover-content":"",anchorElement:u.current,boundaryElement:a,preferredPlacement:"bottom-start",trapFocus:i==="popover",initialFocus:i==="menu"?"t-menu":o,role:i==="menu"?void 0:"dialog",children:h})]})}const q0=R.forwardRef(function(n,e){const{onTrigger:t,...r}=n,i=R.useCallback(o=>{o.key!=="Enter"&&o.key!==" "||t()},[t]);return v.jsx("button",{...r,ref:e,onClick:t,onKeyDown:i})});function en(n){const{onSelect:e,...t}=n,{closePopover:r}=Fl(),i=R.useCallback(s=>{s.key!=="Enter"&&s.key!==" "||(r(),e==null||e())},[e,r]),o=R.useCallback(()=>{r(),e==null||e()},[r,e]);return v.jsx("div",{tabIndex:-1,role:"menuitem",onClick:o,onKeyDown:i,"t-menu-item":"",...t})}function Um(n){return mp(n)}function _n(n){var e;return(e=n.photoUrl)!=null?e:function(t,r){const i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
1273
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var F0=function(n,e){if(n.length>0){var t=n[n.length-1];t!==e&&t._setPausedState(!0)}var r=n.indexOf(e);r===-1||n.splice(r,1),n.push(e)},x0=function(n,e){var t=n.indexOf(e);t!==-1&&n.splice(t,1),n.length>0&&!n[n.length-1]._isManuallyPaused()&&n[n.length-1]._setPausedState(!1)},Ei=function(n){return(n==null?void 0:n.key)==="Tab"||(n==null?void 0:n.keyCode)===9},P0=function(n){return Ei(n)&&!n.shiftKey},B0=function(n){return Ei(n)&&n.shiftKey},lh=function(n){return setTimeout(n,0)},Ur=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return typeof n=="function"?n.apply(void 0,t):n},ao=function(n){return n.target.shadowRoot&&typeof n.composedPath=="function"?n.composedPath()[0]:n.target},H0=[];const U0=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:function(n,e){var t,r=(e==null?void 0:e.document)||document,i=(e==null?void 0:e.trapStack)||H0,o=ah({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:P0,isKeyBackward:B0},e),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a=function(g,O,k){return g&&g[O]!==void 0?g[O]:o[k||O]},l=function(g,O){var k=typeof(O==null?void 0:O.composedPath)=="function"?O.composedPath():void 0;return s.containerGroups.findIndex(function(w){var U=w.container,y=w.tabbableNodes;return U.contains(g)||(k==null?void 0:k.includes(U))||y.find(function(M){return M===g})})},u=function(g){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=O.hasFallback,w=k!==void 0&&k,U=O.params,y=U===void 0?[]:U,M=o[g];if(typeof M=="function"&&(M=M.apply(void 0,M0(y))),M===!0&&(M=void 0),!M){if(M===void 0||M===!1)return M;throw new Error("`".concat(g,"` was specified but was not a node, or did not return a node"))}var $=M;if(typeof M=="string"){try{$=r.querySelector(M)}catch(j){throw new Error("`".concat(g,'` appears to be an invalid selector; error="').concat(j.message,'"'))}if(!$&&!w)throw new Error("`".concat(g,"` as selector refers to no known node"))}return $},c=function(){var g=u("initialFocus",{hasFallback:!0});if(g===!1)return!1;if(g===void 0||g&&!To(g,o.tabbableOptions))if(l(r.activeElement)>=0)g=r.activeElement;else{var O=s.tabbableGroups[0];g=O&&O.firstTabbableNode||u("fallbackFocus")}else g===null&&(g=u("fallbackFocus"));if(!g)throw new Error("Your focus-trap needs to have at least one focusable element");return g},d=function(){if(s.containerGroups=s.containers.map(function(g){var O=Fm(g,o.tabbableOptions),k=du(g,o.tabbableOptions),w=O.length>0?O[0]:void 0,U=O.length>0?O[O.length-1]:void 0,y=k.find(function(j){return On(j)}),M=k.slice().reverse().find(function(j){return On(j)}),$=!!O.find(function(j){return nn(j)>0});return{container:g,tabbableNodes:O,focusableNodes:k,posTabIndexesFound:$,firstTabbableNode:w,lastTabbableNode:U,firstDomTabbableNode:y,lastDomTabbableNode:M,nextTabbableNode:function(j){var G=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],V=O.indexOf(j);return V<0?G?k.slice(k.indexOf(j)+1).find(function(Y){return On(Y)}):k.slice(0,k.indexOf(j)).reverse().find(function(Y){return On(Y)}):O[V+(G?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(g){return g.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(g){return g.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(g){var O=g.activeElement;if(O)return O.shadowRoot&&O.shadowRoot.activeElement!==null?h(O.shadowRoot):O},p=function(g){g!==!1&&g!==h(document)&&(g&&g.focus?(g.focus({preventScroll:!!o.preventScroll}),s.mostRecentlyFocusedNode=g,function(O){return O.tagName&&O.tagName.toLowerCase()==="input"&&typeof O.select=="function"}(g)&&g.select()):p(c()))},f=function(g){var O=u("setReturnFocus",{params:[g]});return O||O!==!1&&g},m=function(g){var O=g.target,k=g.event,w=g.isBackward,U=w!==void 0&&w;O=O||ao(k),d();var y=null;if(s.tabbableGroups.length>0){var M=l(O,k),$=M>=0?s.containerGroups[M]:void 0;if(M<0)y=U?s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:s.tabbableGroups[0].firstTabbableNode;else if(U){var j=s.tabbableGroups.findIndex(function(ee){var F=ee.firstTabbableNode;return O===F});if(j<0&&($.container===O||To(O,o.tabbableOptions)&&!On(O,o.tabbableOptions)&&!$.nextTabbableNode(O,!1))&&(j=M),j>=0){var G=j===0?s.tabbableGroups.length-1:j-1,V=s.tabbableGroups[G];y=nn(O)>=0?V.lastTabbableNode:V.lastDomTabbableNode}else Ei(k)||(y=$.nextTabbableNode(O,!1))}else{var Y=s.tabbableGroups.findIndex(function(ee){var F=ee.lastTabbableNode;return O===F});if(Y<0&&($.container===O||To(O,o.tabbableOptions)&&!On(O,o.tabbableOptions)&&!$.nextTabbableNode(O))&&(Y=M),Y>=0){var K=Y===s.tabbableGroups.length-1?0:Y+1,W=s.tabbableGroups[K];y=nn(O)>=0?W.firstTabbableNode:W.firstDomTabbableNode}else Ei(k)||(y=$.nextTabbableNode(O))}}else y=u("fallbackFocus");return y},E=function(g){var O=ao(g);l(O,g)>=0||(Ur(o.clickOutsideDeactivates,g)?t.deactivate({returnFocus:o.returnFocusOnDeactivate}):Ur(o.allowOutsideClick,g)||g.preventDefault())},A=function(g){var O=ao(g),k=l(O,g)>=0;if(k||O instanceof Document)k&&(s.mostRecentlyFocusedNode=O);else{var w;g.stopImmediatePropagation();var U=!0;if(s.mostRecentlyFocusedNode)if(nn(s.mostRecentlyFocusedNode)>0){var y=l(s.mostRecentlyFocusedNode),M=s.containerGroups[y].tabbableNodes;if(M.length>0){var $=M.findIndex(function(j){return j===s.mostRecentlyFocusedNode});$>=0&&(o.isKeyForward(s.recentNavEvent)?$+1<M.length&&(w=M[$+1],U=!1):$-1>=0&&(w=M[$-1],U=!1))}}else s.containerGroups.some(function(j){return j.tabbableNodes.some(function(G){return nn(G)>0})})||(U=!1);else U=!1;U&&(w=m({target:s.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(s.recentNavEvent)})),p(w||s.mostRecentlyFocusedNode||c())}s.recentNavEvent=void 0},D=function(g){(o.isKeyForward(g)||o.isKeyBackward(g))&&function(O){var k=arguments.length>1&&arguments[1]!==void 0&&arguments[1];s.recentNavEvent=O;var w=m({event:O,isBackward:k});w&&(Ei(O)&&O.preventDefault(),p(w))}(g,o.isKeyBackward(g))},_=function(g){(function(O){return(O==null?void 0:O.key)==="Escape"||(O==null?void 0:O.key)==="Esc"||(O==null?void 0:O.keyCode)===27})(g)&&Ur(o.escapeDeactivates,g)!==!1&&(g.preventDefault(),t.deactivate())},S=function(g){var O=ao(g);l(O,g)>=0||Ur(o.clickOutsideDeactivates,g)||Ur(o.allowOutsideClick,g)||(g.preventDefault(),g.stopImmediatePropagation())},T=function(){if(s.active)return F0(i,t),s.delayInitialFocusTimer=o.delayInitialFocus?lh(function(){p(c())}):p(c()),r.addEventListener("focusin",A,!0),r.addEventListener("mousedown",E,{capture:!0,passive:!1}),r.addEventListener("touchstart",E,{capture:!0,passive:!1}),r.addEventListener("click",S,{capture:!0,passive:!1}),r.addEventListener("keydown",D,{capture:!0,passive:!1}),r.addEventListener("keydown",_),t},N=function(){if(s.active)return r.removeEventListener("focusin",A,!0),r.removeEventListener("mousedown",E,!0),r.removeEventListener("touchstart",E,!0),r.removeEventListener("click",S,!0),r.removeEventListener("keydown",D,!0),r.removeEventListener("keydown",_),t},I=typeof window!="undefined"&&"MutationObserver"in window?new MutationObserver(function(g){g.some(function(O){return Array.from(O.removedNodes).some(function(k){return k===s.mostRecentlyFocusedNode})})&&p(c())}):void 0,L=function(){I&&(I.disconnect(),s.active&&!s.paused&&s.containers.map(function(g){I.observe(g,{subtree:!0,childList:!0})}))};return t={get active(){return s.active},get paused(){return s.paused},activate:function(g){if(s.active)return this;var O=a(g,"onActivate"),k=a(g,"onPostActivate"),w=a(g,"checkCanFocusTrap");w||d(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=h(r),O==null||O();var U=function(){w&&d(),T(),L(),k==null||k()};return w?(w(s.containers.concat()).then(U,U),this):(U(),this)},deactivate:function(g){if(!s.active)return this;var O=ah({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},g);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,N(),s.active=!1,s.paused=!1,L(),x0(i,t);var k=a(O,"onDeactivate"),w=a(O,"onPostDeactivate"),U=a(O,"checkCanReturnFocus"),y=a(O,"returnFocus","returnFocusOnDeactivate");k==null||k();var M=function(){lh(function(){y&&p(f(s.nodeFocusedBeforeActivation)),w==null||w()})};return y&&U?(U(f(s.nodeFocusedBeforeActivation)).then(M,M),this):(M(),this)},pause:function(g){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,g)):this},unpause:function(g){return s.active?(s.manuallyPaused=!1,i[i.length-1]!==this?this:this._setPausedState(!1,g)):this},updateContainerElements:function(g){var O=[].concat(g).filter(Boolean);return s.containers=O.map(function(k){return typeof k=="string"?r.querySelector(k):k}),s.active&&d(),L(),this}},Object.defineProperties(t,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(g,O){if(s.paused===g)return this;if(s.paused=g,g){var k=a(O,"onPause"),w=a(O,"onPostPause");k==null||k(),N(),L(),w==null||w()}else{var U=a(O,"onUnpause"),y=a(O,"onPostUnpause");U==null||U(),d(),T(),L(),y==null||y()}return this}}}),t.updateContainerElements(n),t}},Symbol.toStringTag,{value:"Module"})),j0=qh(U0),$0=qh(k0);function hr(n){return hr=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},hr(n)}var Ta,Ra;function z0(n,e,t){return e&&function(r,i){for(var o=0;o<i.length;o++){var s=i[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(r,Pm(s.key),s)}}(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function V0(n,e,t){return e=es(e),function(r,i){if(i&&(hr(i)=="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}(r)}(n,xm()?Reflect.construct(e,t||[],es(n).constructor):e.apply(n,t))}function xm(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(xm=function(){return!!n})()}function es(n){return es=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},es(n)}function Sl(n,e){return Sl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},Sl(n,e)}function Pm(n){var e=function(t,r){if(hr(t)!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var o=i.call(t,r);if(hr(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n,"string");return hr(e)=="symbol"?e:e+""}var ii=R,Y0=j0.createFocusTrap,G0=$0.isFocusable,X0=parseInt((Ta=(Ra=/^(\d+)\./.exec(ii.version))===null||Ra===void 0?void 0:Ra[1])!==null&&Ta!==void 0?Ta:0,10),Tl=function(){function n(e){var t;(function(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")})(this,n),function(o,s,a){(s=Pm(s))in o?Object.defineProperty(o,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[s]=a}(t=V0(this,n,[e]),"getNodeForOption",function(o){var s,a=(s=this.internalOptions[o])!==null&&s!==void 0?s:this.originalOptions[o];if(typeof a=="function"){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];a=a.apply(void 0,u)}if(a===!0&&(a=void 0),!a){if(a===void 0||a===!1)return a;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var d,h=a;if(typeof a=="string"&&!(h=(d=this.getDocument())===null||d===void 0?void 0:d.querySelector(a)))throw new Error("`".concat(o,"` as selector refers to no known node"));return h}),t.handleDeactivate=t.handleDeactivate.bind(t),t.handlePostDeactivate=t.handlePostDeactivate.bind(t),t.handleClickOutsideDeactivates=t.handleClickOutsideDeactivates.bind(t),t.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:t.handleDeactivate,onPostDeactivate:t.handlePostDeactivate,clickOutsideDeactivates:t.handleClickOutsideDeactivates},t.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var r=e.focusTrapOptions;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(i!=="returnFocusOnDeactivate"&&i!=="onDeactivate"&&i!=="onPostDeactivate"&&i!=="checkCanReturnFocus"&&i!=="clickOutsideDeactivates"?t.internalOptions[i]=r[i]:t.originalOptions[i]=r[i]);return t.outsideClick=null,t.focusTrapElements=e.containerElements||[],t.updatePreviousElement(),t}return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sl(e,t)}(n,ii.Component),z0(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document!="undefined"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var e=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return e||e!==!1&&this.previouslyFocusedElement}},{key:"updatePreviousElement",value:function(){var e=this.getDocument();e&&(this.previouslyFocusedElement=e.activeElement)}},{key:"deactivateTrap",value:function(){this.focusTrap&&this.focusTrap.active&&this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(e){var t=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,e):this.originalOptions.clickOutsideDeactivates;return t&&(this.outsideClick={target:e.target,allowDeactivation:t}),t}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var e=this,t=function(){var r=e.getReturnFocusNode(),i=!(!e.originalOptions.returnFocusOnDeactivate||r==null||!r.focus||e.outsideClick&&(!e.outsideClick.allowDeactivation||G0(e.outsideClick.target,e.internalOptions.tabbableOptions))),o=e.internalOptions.preventScroll,s=o!==void 0&&o;i&&r.focus({preventScroll:s}),e.originalOptions.onPostDeactivate&&e.originalOptions.onPostDeactivate.call(null),e.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(t,t):t()}},{key:"setupFocusTrap",value:function(){this.focusTrap?this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause()):this.focusTrapElements.some(Boolean)&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(e){if(this.focusTrap){e.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var t=!e.active&&this.props.active,r=e.active&&!this.props.active,i=!e.paused&&this.props.paused,o=e.paused&&!this.props.paused;if(t&&(this.updatePreviousElement(),this.focusTrap.activate()),r)return void this.deactivateTrap();i&&this.focusTrap.pause(),o&&this.focusTrap.unpause()}else e.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var e=this,t=this.props.children?ii.Children.only(this.props.children):void 0;if(t){if(t.type&&t.type===ii.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");return ii.cloneElement(t,{ref:function(r){var i=e.props.containerElements;t&&(X0>=19?typeof t.props.ref=="function"?t.props.ref(r):t.props.ref&&(t.props.ref.current=r):typeof t.ref=="function"?t.ref(r):t.ref&&(t.ref.current=r)),e.focusTrapElements=i||[r]}})}return null}}])}();Tl.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:Y0},vm.exports=Tl;var K0=vm.exports.FocusTrap=Tl;function Bm(n){var m;const{children:e,preferredPlacement:t="top-start",anchorElement:r,boundaryElement:i,trapFocus:o=!1,initialFocus:s,...a}=n,{anchor:l,boundary:u}=R.useMemo(()=>({anchor:uh(r),boundary:i?uh(i):void 0}),[r,i]);let c=[];u&&(c=[C0({boundary:u}),I0({boundary:u})]);const{refs:d,floatingStyles:h,middlewareData:p}=function(E){E===void 0&&(E={});const{placement:A="bottom",strategy:D="absolute",middleware:_=[],platform:S,elements:{reference:T,floating:N}={},transform:I=!0,whileElementsMounted:L,open:g}=E,[O,k]=ae.useState({x:0,y:0,strategy:D,placement:A,middlewareData:{},isPositioned:!1}),[w,U]=ae.useState(_);Jo(w,_)||U(_);const[y,M]=ae.useState(null),[$,j]=ae.useState(null),G=ae.useCallback(ue=>{ue!==W.current&&(W.current=ue,M(ue))},[]),V=ae.useCallback(ue=>{ue!==ee.current&&(ee.current=ue,j(ue))},[]),Y=T||y,K=N||$,W=ae.useRef(null),ee=ae.useRef(null),F=ae.useRef(O),re=L!=null,Oe=_a(L),_e=_a(S),Qe=_a(g),ct=ae.useCallback(()=>{if(!W.current||!ee.current)return;const ue={placement:A,strategy:D,middleware:w};_e.current&&(ue.platform=_e.current),R0(W.current,ee.current,ue).then($n=>{const _t={...$n,isPositioned:Qe.current!==!1};kr.current&&!Jo(F.current,_t)&&(F.current=_t,aE.flushSync(()=>{k(_t)}))})},[w,A,D,_e,Qe]);_o(()=>{g===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,k(ue=>({...ue,isPositioned:!1})))},[g]);const kr=ae.useRef(!1);_o(()=>(kr.current=!0,()=>{kr.current=!1}),[]),_o(()=>{if(Y&&(W.current=Y),K&&(ee.current=K),Y&&K){if(Oe.current)return Oe.current(Y,K,ct);ct()}},[Y,K,ct,Oe,re]);const Ot=ae.useMemo(()=>({reference:W,floating:ee,setReference:G,setFloating:V}),[G,V]),Ce=ae.useMemo(()=>({reference:Y,floating:K}),[Y,K]),Ft=ae.useMemo(()=>{const ue={position:D,left:0,top:0};if(!Ce.floating)return ue;const $n=ih(Ce.floating,O.x),_t=ih(Ce.floating,O.y);return I?{...ue,transform:"translate("+$n+"px, "+_t+"px)",...Nm(Ce.floating)>=1.5&&{willChange:"transform"}}:{position:D,left:$n,top:_t}},[D,I,Ce.floating,O.x,O.y]);return ae.useMemo(()=>({...O,update:ct,refs:Ot,elements:Ce,floatingStyles:Ft}),[O,ct,Ot,Ce,Ft])}({placement:t,middleware:c,whileElementsMounted:_0});R.useLayoutEffect(()=>{l&&d.setReference(l)},[d,l]);const f=o?v.jsx(K0,{focusTrapOptions:{initialFocus:s,fallbackFocus:".t-fallback-focus",tabbableOptions:{getShadowRoot:!0}},children:v.jsxs("div",{children:[e,v.jsx("span",{className:"t-fallback-focus",tabIndex:-1})]})}):e;return v.jsx("div",{ref:d.setFloating,style:{...h,zIndex:1e3,visibility:(m=p.hide)!=null&&m.referenceHidden?"hidden":"visible"},...a,children:f})}function uh(n){return typeof n=="string"?document.querySelector(n):n}function Hm(n){const e=ie(),t=xi(),r=Z(t.state$.suggestMentionQuery),i=function(E,A=10){const D=R.useContext(Ml),[_,S]=R.useState(null);return R.useEffect(()=>{const T=D.conversation(E).subscribeParticipants(N=>S(N));return A>10&&T.connected.then(async()=>{for(;T.state.type==="active"&&!T.state.loadedAll&&T.state.latestSnapshot!==null&&T.state.latestSnapshot.length<A;){const N=Math.min(A-T.state.latestSnapshot.length,50);await T.loadMore(N)}}),()=>{T.unsubscribe()}},[E,D,A]),_}(Z(e.state$.extCurrentConversationId),r?1e3:0),o=R.useMemo(()=>(i!=null?i:[]).map(E=>E.user),[i]),[s,a]=R.useState(0),l=R.useMemo(()=>Object.fromEntries(o.map(E=>{return[E.id,(A=E.name,[...A.matchAll(/^|\s+/g)].map(D=>D.index+D[0].length).map(D=>A.substring(D)))];var A})),[o]),u=R.useMemo(()=>{if(!r)return[];const E=ch(r);return E===""?o:o.filter(A=>l[A.id].some(D=>function(_,S){return oc(_.substring(0,S.length),S)}(D,E)))},[r,o,l]),c=R.useRef(void 0);R.useEffect(()=>{if(c.current){const E=u.findIndex(A=>A.id===c.current);a(E===-1?0:E)}},[u]),R.useEffect(()=>{var E;c.current=(E=u[s])==null?void 0:E.id},[s,u]);const d=R.useCallback(E=>{var D;const A=(D=u[E])==null?void 0:D.id;return A&&"mention-button-"+A},[u]),{containerProps:h,itemProps:p}=Em({focused:s,setFocused:a,buttonId:d});if(R.useEffect(()=>{if(u.length!==0)return t.listenKeydown("mention",E=>mm(E,{dir:"ttb",focused:s,setFocused:a,itemCount:u.length,onSpace(){if(r){const A=u[s];if(oc(A.name,ch(r)))return t.selectMention(A),!0}return!1},onConfirm(){const A=u[s];t.selectMention(A)}})),()=>{t.listenKeydown("mention",void 0)}},[t,s,u,r]),$i(()=>t.closeSuggester(),".t-mention-suggest-list",u.length>0),u.length===0)return null;const f=document.querySelector(".ProseMirror-suggestion");let m;if(f){let E=f.getBoundingClientRect();m={getBoundingClientRect(){const A=f.getBoundingClientRect();return A.width>0&&(E=A),E}}}return v.jsx(Bm,{className:"t-mention-suggest-list",...h,anchorElement:m,children:u.map((E,A)=>v.jsx(W0,{user:E,isFocused:A===s,onSelect:()=>t.selectMention(E),...p(A)},E.id))})}const W0=ae.memo(function(n){const{user:e,isFocused:t,onSelect:r,...i}=n;return v.jsx("button",{className:t?"focused":"",onClick:()=>r(e.id),...i,children:e.name})});function ch(n){return le(n[0]==="@"),n.substring(1)}function dh(n,e,t){const r=du(n),i=r.indexOf(e);return i===-1?null:r[i+t]||null}const J0=R.forwardRef(function(n,e){const{children:t,triggerElement:r}=n,{closePopover:i}=Fl(),o=R.useRef(null);R.useImperativeHandle(e,()=>o.current),R.useEffect(()=>{var a;(a=o.current)==null||a.focus()},[]);const s=R.useCallback(a=>{(function(l,u,c,d){var E;const h=u.querySelectorAll("[t-menu-item]"),p=document.activeElement;if(!p||!p.hasAttribute("t-menu-item")&&!p.hasAttribute("t-menu"))return;const f=Array.from(h).indexOf(p);let m;switch(l.key){case"ArrowDown":m=Math.min(f+1,h.length-1);break;case"ArrowUp":m=Math.max(f-1,0),f===-1&&(m=h.length-1);break;case"Home":m=0;break;case"End":m=h.length-1;break;case"Tab":{const A=c.closest("t-chatbox,t-conversation-list,.t-chatbox,.t-conversation-list"),D=l.shiftKey?dh(A,c,-1):function(_,S){return dh(_,S,1)}(A,c);return D==null||D.focus(),void d()}default:return}(E=h[m])==null||E.focus()})(a,o.current,r,i)},[i,r]);return v.jsx("div",{"t-menu":"",role:"menu",tabIndex:-1,ref:o,onKeyDown:s,children:t})});function rr(n){const{popoverComponent:e,popoverProps:t,children:r,type:i="popover",initialFocus:o,...s}=n,[a,l]=R.useState(void 0),u=R.useRef(null),[c,d]=R.useState(!1);$i(R.useCallback(()=>{var p;d(!1),(p=u.current)==null||p.focus()},[]),"[t-popover-content]",c);const h=i==="menu"?v.jsx(J0,{triggerElement:u.current,children:v.jsx(e,{...t})}):v.jsx(e,{...t});return v.jsxs(ZE.Provider,{value:{closePopover:()=>d(!1)},children:[v.jsx(q0,{...s,"aria-haspopup":i==="menu"?"menu":"true","aria-expanded":c,onTrigger:()=>d(!0),ref:p=>(f=>{var E;const m=(E=f==null?void 0:f.closest("[t-menu-boundary]"))!=null?E:void 0;u.current=f,l(m)})(p),children:r}),c&&v.jsx(Bm,{"t-popover-content":"",anchorElement:u.current,boundaryElement:a,preferredPlacement:"bottom-start",trapFocus:i==="popover",initialFocus:i==="menu"?"t-menu":o,role:i==="menu"?void 0:"dialog",children:h})]})}const q0=R.forwardRef(function(n,e){const{onTrigger:t,...r}=n,i=R.useCallback(o=>{o.key!=="Enter"&&o.key!==" "||t()},[t]);return v.jsx("button",{...r,ref:e,onClick:t,onKeyDown:i})});function en(n){const{onSelect:e,...t}=n,{closePopover:r}=Fl(),i=R.useCallback(s=>{s.key!=="Enter"&&s.key!==" "||(r(),e==null||e())},[e,r]),o=R.useCallback(()=>{r(),e==null||e()},[r,e]);return v.jsx("div",{tabIndex:-1,role:"menuitem",onClick:o,onKeyDown:i,"t-menu-item":"",...t})}function Um(n){return mp(n)}function _n(n){var e;return(e=n.photoUrl)!=null?e:function(t,r){const i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
1274
1274
  <rect x="0" y="0" width="100" height="100" fill="${mp(t)}"/>
1275
1275
  <text x="50%" y="54%" dominant-baseline="middle" font-size="34" font-family="San Francisco, Segoe UI, Helvetica Neue, Arial, Helvetica, sans-serif" fill="#fff" text-anchor="middle">${r}</text>
1276
1276
  </svg>`.replace(/\s+/g," ");return"data:image/svg+xml;base64,"+nA(i)}(n.id,oA(n.name))}function oi(n){return n<1024?n+" B":n<1048576?Math.floor(n/1024)+" KB":n<1073741824?Math.floor(n/1048576)+" MB":n<1099511627776?Math.floor(n/1073741824)+" GB":Math.floor(n/1099511627776)+" TB"}function hu({latitude:n,longitude:e}){const t=n+","+e;return{imageUrl:`https://maps.googleapis.com/maps/api/staticmap?center=${t}&zoom=15&size=300x200&scale=2&maptype=roadmap&markers=${t}&key=${ND}`,linkUrl:`https://maps.google.com/maps?q=${t}&z=15`}}function jm(n,e){const[t,r]=R.useState({long:"",short:""});return R.useLayoutEffect(()=>{let i,o=!0;const s=()=>{const l=Date.now(),u=function(c,d,h){const p=c-d;let f,m,E;const A=new Date(d),D={month:"short",day:"numeric"};if(p<ph)return{changeTimeout:5e3,short:h.JUST_NOW,long:h.JUST_NOW};if(p<fh)f=ph,m="MINUTES",E=h.MINUTES;else if(p<mh)f=fh,m="HOURS",E=h.HOURS;else{if(!(p<Z0)){if(A.getFullYear()===new Date(c).getFullYear()){const S=A.toLocaleDateString(h.locale,D);return{changeTimeout:void 0,short:S,long:S}}{const S=A.toLocaleDateString(h.locale,{...D,year:"numeric"});return{changeTimeout:void 0,short:S,long:S}}}f=mh,m="DAYS",E=h.DAYS}const _=Math.floor(p/f);return{changeTimeout:f,short:_+E,long:Q0(_,m.toLowerCase(),h.locale)}}(l,n>l?l-2e3:n,e);return r(u),u},a=()=>{const l=s();o&&l.changeTimeout&&(i=window.setTimeout(a,l.changeTimeout))};return s(),i=window.setTimeout(a,100),()=>{o=!1,clearTimeout(i)}},[e,n]),t}function pu(n){n=Math.floor(n);const e=Math.floor(n/3600);n%=3600;const t=Math.floor(n/60);n%=60;const r=o=>o.toString().padStart(2,"0");let i=`${r(t)}:${r(n)}`;return e>0&&(i=`${r(e)}:${i}`),i}const hh=864e5;function $m(n,e){const t=Date.now(),r=(i=n,o=t,Math.floor((o-i)/hh));var i,o;if(r<0||r===0)return e.TODAY;if(r===1)return e.YESTERDAY;const s={weekday:"long"},a=new Date(n);if(r<7)return a.toLocaleDateString(e.locale,s);const l=new Date(t);return function(c,d){return Math.floor((d-c)/(365*hh))}(l.setFullYear(l.getFullYear()-1),n)===0?a.toLocaleDateString(e.locale,{...s,month:"long",day:"numeric"}):a.toLocaleDateString(e.locale,{...s,year:"numeric",month:"long",day:"numeric"})}const ph=6e4,fh=36e5,mh=864e5,Z0=6048e5;function Q0(n,e,t){return new Intl.RelativeTimeFormat(t).format(-n,e)}function x(n,...e){const t=CD.bind(ae.createElement)(n,...e);return Array.isArray(t)?ae.createElement(ae.Fragment,{},...t):t}function zm({children:n,className:e,...t}){return v.jsx("div",{className:"t-attach-overlay "+e,...t,children:n})}function eO({uploadState:n}){const{uploaded:e,errored:t}=n;$i(()=>n.closePreview("cancel"),".t-upload-preview");const r=R.useRef(null);R.useEffect(()=>{e&&r.current.focus()},[e]);const i=Z(ie().t$);return v.jsx(zm,{className:"t-upload-preview",children:v.jsxs("div",{className:"t-preview",children:[v.jsx(tO,{upload:n.upload,uploaded:e}),t&&v.jsx("div",{className:"t-error-row",children:i.UPLOAD_ERROR}),v.jsxs("div",{className:"t-send-row",children:[v.jsx("button",{className:"t-cancel",onClick:()=>n.closePreview("cancel"),children:i.CANCEL}),!t&&e&&v.jsx("button",{className:"t-confirm-send test__confirm-upload-button",onClick:()=>n.closePreview("send"),ref:r,children:i.SEND_BUTTON_TEXT})]})]})})}function tO({upload:n,uploaded:e}){const t=Z(ie().t$);return n.type!=="location"?v.jsxs(v.Fragment,{children:[v.jsx(rO,{upload:n}),v.jsx(iO,{upload:n,uploaded:e,t})]}):e?v.jsx(nO,{location:n.location}):v.jsx("div",{className:"t-loading",children:v.jsx(nu,{})})}function nO({location:n}){const{imageUrl:e,linkUrl:t}=hu(n),r=JSON.stringify(e);return v.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"t-location-upload-preview",style:{background:`url(${r}) center center / cover no-repeat`}})}const rO=ae.memo(function({upload:n}){let e=null;const t=n.file;if(n.type==="video"){const r=/[.]ts/i.test(t.name)?"mpegts":"native";e=v.jsx("div",{className:"video-container",children:v.jsx(oO,{src:n.temporaryBlobUrl,videoType:r,playsInline:!0,controls:!0,preload:"auto"})})}else if(n.type==="image"){const r=URL.createObjectURL(t);e=v.jsx("div",{className:"t-img-container",children:v.jsx("img",{src:r})})}else if(n.type==="audio"){const r=URL.createObjectURL(t);e=v.jsx(Vo,{src:r,filename:t.name})}return e}),iO=ae.memo(function({uploaded:n,upload:e,t}){let r;r=n?e.metadata.filename:t.UPLOAD_IN_PROGRESS;let i="",o="";return e.type==="file"&&(i="is-file",n&&(o="file-block")),v.jsx("div",{className:`t-filename-row ${i}`,children:v.jsx("div",{className:o,children:r})})});function oO(n){const{videoType:e,...t}=n;return v.jsx("video",{...t})}function sO(){const n=Dt(),e=ie(),t=Lr(),r=Z(e.state$.isUserConnected),i=Z(e.state$.userPermissions);return v.jsx(n.ChatHeader,{common:t,isUserConnected:r,permissions:i})}function aO({appId:n,chatHeaderVisible:e,messageFieldVisible:t}){const r=xi(),i=function(){const m=ie(),E=ft(()=>{const _=m.extUserId$.get(),S=m.errors$.get(),T=m.authTokenState$.get(),N=_&&m.currentUser$.get(),I=m.state$.currentConversation.get(),L=m.state$.extCurrentConversationId.get(),g=L&&m.state$.participants.child(L).get(),O=m.app$.get();return m.device$.get(),S.serverError?"server-error":S.wrongAppId?"wrong-app-id":T==="loading"||T==="idle"?"loading-token":T==="invalid"?"invalid-token":T==="expired"?"expired-token":T==="valid"?S.unknownUser?"unknown-user":S.unknownConversation?"loading-conv-failed":N&&I&&g&&O?"loaded":"loading-data":void le.unreachable()}),A=ft({type:"loading"});Or(_=>{const S=E.get(),T=m.state$.extCurrentConversationId.peek(),N=m.extUserId$.peek(),I=m.appId$.peek();function L(g){A.set({type:"loading"});const O=setTimeout(()=>{A.set(g)},5e3);return()=>clearTimeout(O)}switch(S){case"invalid-token":A.set({type:"auth-failed"});break;case"expired-token":A.set({type:"expired-token"});break;case"wrong-app-id":A.set({type:"wrong-app-id",appId:I});break;case"server-error":A.set({type:"server-error"});break;case"loading-data":case"loading-token":A.set({type:"loading"});break;case"loaded":A.set({type:"loaded",conversationId:T,userId:N});break;case"loading-conv-failed":_.onCleanup=L({type:"inaccessible-conversation",userId:N,conversationId:T});break;case"unknown-user":_.onCleanup=L({type:"unknown-user",userId:N});break;default:le.never(S)}});const D=ft({type:"loading"});return Or(_=>{if(A.type.get()==="loading"){D.set({type:"invisible-loading"});const S=setTimeout(()=>{D.set({type:"loading"})},1e3);_.onCleanup=()=>{clearTimeout(S)}}else D.set(A.get())}),Z(D)}(),{attachFile:o,shareLocation:s,uploadState:a}=RD({onClose:()=>r.focus()});R.useEffect(()=>{r.uploadFile=o},[r,o]);const[l,u]=R.useState(!1),c=ie(),d=Z(()=>c.app$.get()?c.state$.userPermissions.canShareFile.get():void 0),h=R.useCallback(m=>{o(m.dataTransfer.files[0]),m.preventDefault(),u(!1)},[o]),p=R.useCallback(m=>{m.preventDefault(),u(!0)},[]),f=R.useCallback(m=>{m.preventDefault(),u(!1)},[]);return i.type==="invisible-loading"?v.jsx(v.Fragment,{}):i.type==="loading"?v.jsx(Qf,{}):i.type==="inaccessible-conversation"?v.jsx(_D,{}):i.type==="unknown-user"||i.type==="auth-failed"||i.type==="wrong-app-id"||i.type==="server-error"||i.type==="unexpected-error"?v.jsx(As,{appId:n,chatboxState:i}):i.type=="expired-token"?v.jsx(em,{}):i.type==="loaded"?v.jsxs("div",{className:"t-chatbox-content",onDragOver:d?p:void 0,onDragLeave:d?f:void 0,onDrop:d?h:void 0,children:[e&&v.jsx(sO,{}),v.jsx(ED,{extConversationId:i.conversationId}),t&&v.jsx(Zf,{attachFile:o,shareLocation:s}),a&&v.jsx(eO,{uploadState:a}),l&&v.jsx(zm,{className:"t-drop-overlay",children:v.jsx(zo,{type:"attach"})})]}):v.jsx(v.Fragment,{})}function lO(n,e){return n.map(r=>function(i,o){if(i.type==="text")return function(s,a){const l=iu(a);return Ro(s,l)}(i.children,o);if(i.type==="file"&&i.subtype==="video")return`🎥 ${qi(i.url)}`;if(i.type==="file"&&i.subtype==="image")return`📷 ${qi(i.url)}`;if(i.type==="file"&&i.subtype==="audio")return`🎧 ${qi(i.url)}`;if(i.type==="file"&&i.subtype==="voice"){const s=i.duration;return s===void 0?"🎙️":`🎙️ (${Math.floor(s/60)}:${Math.floor(s%60).toString().padStart(2,"0")})`}return i.type==="file"?(i.subtype,`📎 ${qi(i.url)}`):i.type==="location"?"📍":""}(r,e)).join(`
package/default.js CHANGED
@@ -1865,7 +1865,7 @@ const Xl = Object.freeze(Object.defineProperty({ __proto__: null, AudioBlock: fu
1865
1865
  <div className="t-theme-audio-block">
1866
1866
  <${Sl} src=${n.url} filename=${n.filename} />
1867
1867
 
1868
- <a className="t-body-text" href=${e}>
1868
+ <a className="t-body-text" href=${e} target="_blank">
1869
1869
  <${r}
1870
1870
  type="attachment"
1871
1871
  className="t-attachment-icon"
@@ -1972,7 +1972,7 @@ const Xl = Object.freeze(Object.defineProperty({ __proto__: null, AudioBlock: fu
1972
1972
  const { Icon: r } = t.theme;
1973
1973
  return F`
1974
1974
  <div className="t-theme-file-block">
1975
- <a className="t-body-text" href=${e}>
1975
+ <a className="t-body-text" href=${e} target="_blank">
1976
1976
  <${r}
1977
1977
  type="attachment"
1978
1978
  className="t-attachment-icon"
@@ -2050,7 +2050,7 @@ const Xl = Object.freeze(Object.defineProperty({ __proto__: null, AudioBlock: fu
2050
2050
  </div>
2051
2051
  </a>
2052
2052
 
2053
- <a href=${e} className="t-body-text">
2053
+ <a href=${e} className="t-body-text" target="_blank">
2054
2054
  <${r} className="download-icon" type="download" common=${t} />
2055
2055
  <span>${n.filename}</span>
2056
2056
  <span className="t-filesize"> (${Do(n.size)})</span>
@@ -2399,7 +2399,7 @@ const Xl = Object.freeze(Object.defineProperty({ __proto__: null, AudioBlock: fu
2399
2399
  </div>
2400
2400
  </div>
2401
2401
 
2402
- <a href=${e} className="t-body-text">
2402
+ <a href=${e} className="t-body-text" target="_blank">
2403
2403
  <${r} className="download-icon" type="download" common=${t} />
2404
2404
  <span>${n.filename}</span>
2405
2405
  <span className="t-filesize"> (${Do(n.size)})</span>
@@ -14752,17 +14752,17 @@ function sO(n) {
14752
14752
  const e = ae(), t = Gi(), r = Z(t.state$.suggestMentionQuery), i = function(E, A = 10) {
14753
14753
  const D = fs(Wl), [_, S] = Ee(null);
14754
14754
  return G(() => {
14755
- const T = D.conversation(E).subscribeParticipants((C) => S(C));
14756
- let I = 10;
14757
- for (; I < A; ) {
14758
- const C = Math.min(A - I, 50);
14759
- T.loadMore(C), I += C;
14760
- }
14761
- return () => {
14755
+ const T = D.conversation(E).subscribeParticipants((I) => S(I));
14756
+ return A > 10 && T.connected.then(async () => {
14757
+ for (; T.state.type === "active" && !T.state.loadedAll && T.state.latestSnapshot !== null && T.state.latestSnapshot.length < A; ) {
14758
+ const I = Math.min(A - T.state.latestSnapshot.length, 50);
14759
+ await T.loadMore(I);
14760
+ }
14761
+ }), () => {
14762
14762
  T.unsubscribe();
14763
14763
  };
14764
14764
  }, [E, D, A]), _;
14765
- }(Z(e.state$.extCurrentConversationId), r ? 100 : 0), o = se(() => (i != null ? i : []).map((E) => E.user), [i]), [s, a] = Ee(0), l = se(() => Object.fromEntries(o.map((E) => {
14765
+ }(Z(e.state$.extCurrentConversationId), r ? 1e3 : 0), o = se(() => (i != null ? i : []).map((E) => E.user), [i]), [s, a] = Ee(0), l = se(() => Object.fromEntries(o.map((E) => {
14766
14766
  return [E.id, (A = E.name, [...A.matchAll(/^|\s+/g)].map((D) => D.index + D[0].length).map((D) => A.substring(D)))];
14767
14767
  var A;
14768
14768
  })), [o]), u = se(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talkjs/react-components",
3
- "version": "0.0.35",
3
+ "version": "0.0.36",
4
4
  "bugs": {
5
5
  "url": "https://talkjs.com/?chat"
6
6
  },